Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddressToBytes ¶ added in v0.44.0
AddressToBytes converts a Sui address string to bytes. Sui addresses are hex strings typically prefixed with "0x" (32 bytes).
func NewPTBClientFromNodeURL ¶ added in v0.111.1
func NewPTBClientFromNodeURL(log logger.Logger, nodeURL string, grpcToken string) (cslclient.SuiPTBClient, error)
NewPTBClientFromNodeURL creates a gRPC-backed Sui PTB client from an HTTP RPC URL.
The gRPC auth token is resolved in priority order:
- The grpcToken argument, when non-empty. This is the primary path: the deployment framework threads cfgnet.RPC.AuthToken through RPCChainProviderConfig into this argument, so an authenticated endpoint such as Alchemy is configured via a first-class token field rather than embedded in the URL.
- The URL userinfo (e.g. https://<token>@host), used only as a legacy fallback when grpcToken is empty but the URL carries userinfo. grpcTargetFromNodeURL strips userinfo from the gRPC target, so only the host:port is dialed regardless.
- defaultGrpcToken ("test"), preserving prior behavior for unauthenticated endpoints (local nodes, public fullnodes).
The resolved token is sent as gRPC metadata (Bearer / x-api-key / x-token / x-spectrum-auth) by suigrpcconn.authMetadata. Note: it is applied to the gRPC transport only; the JSON-RPC/devInspect client built downstream from the bare gRPC target does not receive it.
func PublicKeyBytes ¶ added in v0.45.1
PublicKeyBytes extracts the raw 32-byte ed25519 public key from a SuiSigner.
Types ¶
type AddressConverter ¶ added in v0.44.0
type AddressConverter struct{}
AddressConverter implements address conversion for Sui chains. This struct implements the AddressConverter strategy interface.
func (AddressConverter) ConvertToBytes ¶ added in v0.44.0
func (s AddressConverter) ConvertToBytes(address string) ([]byte, error)
ConvertToBytes converts a Sui address string to bytes.
func (AddressConverter) Supports ¶ added in v0.44.0
func (s AddressConverter) Supports(family string) bool
Supports returns true if this converter supports the given chain family.
type Chain ¶
type Chain struct {
ChainMetadata
Client cslclient.SuiPTBClient
Signer SuiSigner
URL string
FaucetURL string
}
Chain represents an Sui chain.
type ChainMetadata ¶ added in v0.5.1
type ChainMetadata = common.ChainMetadata
type SuiSigner ¶ added in v0.23.0
type SuiSigner interface {
// Sign signs the given message and returns the serialized signature.
Sign(message []byte) ([]string, error)
// GetAddress returns the Sui address derived from the signer's public key
GetAddress() (string, error)
}
TODO: Everything in this file should come from chainlink-sui when available