Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (cl *Client) ExecuteTx(ctx context.Context, wallet *account.Account, txBytes lib.Base64Data, ...) (*types.SuiTransactionBlockResponse, error)
- func (c *Client) GetCheckpoint(ctx context.Context, checkpoint uint64) (*suitypes.CheckpointResponse, error)
- func (c Client) GetCoins(ctx context.Context, addr string) (types.Coins, error)
- func (c *Client) GetEvents(ctx context.Context, txDigest sui_types.TransactionDigest) ([]types.SuiEvent, error)
- func (c *Client) GetEventsFromTxBlocks(ctx context.Context, allowedEventTypes []string, digests []string) ([]suitypes.EventResponse, error)
- func (c Client) GetLatestCheckpointSeq(ctx context.Context) (uint64, error)
- func (c Client) GetObject(ctx context.Context, objID sui_types.ObjectID, ...) (*types.SuiObjectResponse, error)
- func (c *Client) GetTotalBalance(ctx context.Context, addr string) (uint64, error)
- func (cl *Client) GetTransaction(ctx context.Context, txDigest string) (*types.SuiTransactionBlockResponse, error)
- func (c Client) MoveCall(ctx context.Context, signer move_types.AccountAddress, ...) (*types.TransactionBytes, error)
- func (c *Client) MultiGetTxBlocks(ctx context.Context, digests []string) ([]*types.SuiTransactionBlockResponse, error)
- func (cl *Client) QueryContract(ctx context.Context, senderAddr string, txBytes lib.Base64Data, ...) error
- func (c *Client) QueryTxBlocks(ctx context.Context, query types.SuiTransactionBlockResponseQuery, ...) (*types.TransactionBlocksPage, error)
- func (cl *Client) SimulateTx(ctx context.Context, txBytes lib.Base64Data) (*types.DryRunTransactionBlockResponse, int64, error)
- type Config
- type DappModule
- type IClient
- type KeyPair
- type Provider
- func (p *Provider) ClaimFee(ctx context.Context) error
- func (p *Provider) Config() provider.Config
- func (p *Provider) FinalityBlock(ctx context.Context) uint64
- func (p *Provider) GenerateMessages(ctx context.Context, messageKey *relayertypes.MessageKeyWithMessageHeight) ([]*relayertypes.Message, error)
- func (p *Provider) GetFee(ctx context.Context, networkID string, responseFee bool) (uint64, error)
- func (p *Provider) ImportKeystore(ctx context.Context, keyPath, passphrase string) (string, error)
- func (p *Provider) Init(ctx context.Context, homePath string, kms kms.KMS) error
- func (p *Provider) Listener(ctx context.Context, lastProcessedTx relayertypes.LastProcessedTx, ...) error
- func (p *Provider) MakeSuiMessage(message *relayertypes.Message) (*SuiMessage, error)
- func (p *Provider) MessageReceived(ctx context.Context, messageKey *relayertypes.MessageKey) (bool, error)
- func (p *Provider) NID() string
- func (p *Provider) Name() string
- func (p *Provider) NewKeystore(password string) (string, error)
- func (p *Provider) NewSuiMessage(typeArgs []string, params []SuiCallArg, packageId, module, method string) *SuiMessage
- func (p *Provider) QueryBalance(ctx context.Context, addr string) (*relayertypes.Coin, error)
- func (p *Provider) QueryLatestHeight(ctx context.Context) (uint64, error)
- func (p *Provider) QueryTransactionReceipt(ctx context.Context, txDigest string) (*relayertypes.Receipt, error)
- func (p *Provider) RestoreKeystore(ctx context.Context) error
- func (p *Provider) RevertMessage(ctx context.Context, sn *big.Int) error
- func (p *Provider) Route(ctx context.Context, message *relayertypes.Message, ...) error
- func (p *Provider) SendTransaction(ctx context.Context, txBytes lib.Base64Data) (*types.SuiTransactionBlockResponse, error)
- func (p *Provider) SetAdmin(ctx context.Context, adminAddr string) error
- func (p *Provider) SetFee(ctx context.Context, networkID string, msgFee, resFee *big.Int) error
- func (p *Provider) SetLastSavedHeightFunc(f func() uint64)
- func (p *Provider) ShouldReceiveMessage(ctx context.Context, messagekey *relayertypes.Message) (bool, error)
- func (p *Provider) ShouldSendMessage(ctx context.Context, messageKey *relayertypes.Message) (bool, error)
- func (p *Provider) Type() string
- func (p *Provider) Wallet() (*account.Account, error)
- type SuiCallArg
- type SuiMessage
Constants ¶
View Source
const ( CallArgPure = "pure" CallArgObject = "object" )
Variables ¶
View Source
var ( MethodClaimFee = "claim_fees" MethodGetReceipt = "get_receipt" MethodSetFee = "set_fee" MethodGetFee = "get_fee" MethodRevertMessage = "revert_message" MethodSetAdmin = "set_admin" MethodGetAdmin = "get_admin" MethodRecvMessage = "receive_message" MethodExecuteCall = "execute_call" MethodExecuteRollback = "execute_rollback" MethodGetWithdrawTokentype = "get_withdraw_token_type" ModuleConnection = "centralized_connection" ModuleEntry = "centralized_entry" ModuleMain = "main" XcallModule = "xcall" ModuleMockDapp = "mock_dapp" ModuleXcallManager = "xcall_manager" ModuleAssetManager = "asset_manager" ModuleBalancedDollar = "balanced_dollar_crosschain" )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetCheckpoint ¶
func (*Client) GetEventsFromTxBlocks ¶
func (Client) GetLatestCheckpointSeq ¶
func (Client) GetObject ¶
func (c Client) GetObject(ctx context.Context, objID sui_types.ObjectID, options *types.SuiObjectDataOptions) (*types.SuiObjectResponse, error)
func (*Client) GetTotalBalance ¶
func (*Client) GetTransaction ¶
func (Client) MoveCall ¶
func (c Client) MoveCall( ctx context.Context, signer move_types.AccountAddress, packageId move_types.AccountAddress, module, function string, typeArgs []string, arguments []any, gas *move_types.AccountAddress, gasBudget types.SafeSuiBigInt[uint64], ) (*types.TransactionBytes, error)
func (*Client) MultiGetTxBlocks ¶
func (*Client) QueryContract ¶
func (*Client) QueryTxBlocks ¶
func (c *Client) QueryTxBlocks( ctx context.Context, query types.SuiTransactionBlockResponseQuery, cursor *sui_types.TransactionDigest, limit *uint, descendingOrder bool, ) (*types.TransactionBlocksPage, error)
func (*Client) SimulateTx ¶
func (cl *Client) SimulateTx(ctx context.Context, txBytes lib.Base64Data) (*types.DryRunTransactionBlockResponse, int64, error)
type Config ¶
type Config struct { ChainName string `yaml:"-" json:"-"` ChainID string `yaml:"chain-id" json:"chain-id"` RPCUrl string `yaml:"rpc-url" json:"rpc-url"` Address string `yaml:"address" json:"address"` NID string `yaml:"nid" json:"nid"` // list of xcall package ids in order of latest to oldest in descending order XcallPkgIDs []string `yaml:"xcall-package-ids" json:"xcall-package-ids"` XcallStorageID string `yaml:"xcall-storage-id" json:"xcall-storage-id"` ConnectionID string `yaml:"connection-id" json:"connection-id"` ConnectionCapID string `yaml:"connection-cap-id" json:"connection-cap-id"` DappPkgID string `yaml:"dapp-package-id" json:"dapp-package-id"` DappModules []DappModule `yaml:"dapp-modules" json:"dapp-modules"` HomeDir string `yaml:"home-dir" json:"home-dir"` GasLimit uint64 `yaml:"gas-limit" json:"gas-limit"` Disabled bool `json:"disabled" yaml:"disabled"` // Start tx-digest cursor to begin querying for events. // Should be empty if we want to query using last saved tx-digest // from database. StartTxDigest string `json:"start-tx-digest" yaml:"start-tx-digest"` }
func (*Config) NewProvider ¶
type DappModule ¶
type IClient ¶
type IClient interface { GetLatestCheckpointSeq(ctx context.Context) (uint64, error) GetTotalBalance(ctx context.Context, addr string) (uint64, error) SimulateTx(ctx context.Context, txBytes lib.Base64Data) (*types.DryRunTransactionBlockResponse, int64, error) ExecuteTx(ctx context.Context, wallet *account.Account, txBytes lib.Base64Data, signatures []any) (*types.SuiTransactionBlockResponse, error) GetTransaction(ctx context.Context, txDigest string) (*types.SuiTransactionBlockResponse, error) QueryContract(ctx context.Context, senderAddr string, txBytes lib.Base64Data, resPtr interface{}) error GetCheckpoint(ctx context.Context, checkpoint uint64) (*suitypes.CheckpointResponse, error) GetEventsFromTxBlocks(ctx context.Context, allowedEventTypes []string, digests []string) ([]suitypes.EventResponse, error) GetObject(ctx context.Context, objID sui_types.ObjectID, options *types.SuiObjectDataOptions) (*types.SuiObjectResponse, error) GetCoins(ctx context.Context, accountAddress string) (types.Coins, error) MoveCall( ctx context.Context, signer move_types.AccountAddress, packageId move_types.AccountAddress, module, function string, typeArgs []string, arguments []any, gas *move_types.AccountAddress, gasBudget types.SafeSuiBigInt[uint64], ) (*types.TransactionBytes, error) QueryTxBlocks( ctx context.Context, query types.SuiTransactionBlockResponseQuery, cursor *sui_types.TransactionDigest, limit *uint, descendingOrder bool, ) (*types.TransactionBlocksPage, error) GetEvents( ctx context.Context, txDigest sui_types.TransactionDigest, ) ([]types.SuiEvent, error) MultiGetTxBlocks( ctx context.Context, digests []string, ) ([]*types.SuiTransactionBlockResponse, error) }
type Provider ¶
type Provider struct { LastSavedHeightFunc func() uint64 // contains filtered or unexported fields }
func (*Provider) FinalityBlock ¶
FinalityBlock returns the number of blocks the chain has to advance from current block inorder to consider it as final. In Sui checkpoints are analogues to blocks and checkpoints once published are final. So Sui doesn't need to be checked for block/checkpoint finality.
func (*Provider) GenerateMessages ¶
func (p *Provider) GenerateMessages(ctx context.Context, messageKey *relayertypes.MessageKeyWithMessageHeight) ([]*relayertypes.Message, error)
func (*Provider) ImportKeystore ¶
Imports first ed25519 key pair from the keystore
func (*Provider) Listener ¶
func (p *Provider) Listener(ctx context.Context, lastProcessedTx relayertypes.LastProcessedTx, blockInfo chan *relayertypes.BlockInfo) error
func (*Provider) MakeSuiMessage ¶
func (p *Provider) MakeSuiMessage(message *relayertypes.Message) (*SuiMessage, error)
func (*Provider) MessageReceived ¶
func (p *Provider) MessageReceived(ctx context.Context, messageKey *relayertypes.MessageKey) (bool, error)
func (*Provider) NewKeystore ¶
Creates new Ed25519 key
func (*Provider) NewSuiMessage ¶
func (p *Provider) NewSuiMessage(typeArgs []string, params []SuiCallArg, packageId, module, method string) *SuiMessage
func (*Provider) QueryBalance ¶
func (*Provider) QueryLatestHeight ¶
func (*Provider) QueryTransactionReceipt ¶
func (*Provider) RestoreKeystore ¶
Restores the addres configured
func (*Provider) RevertMessage ¶
func (*Provider) Route ¶
func (p *Provider) Route(ctx context.Context, message *relayertypes.Message, callback relayertypes.TxResponseFunc) error
func (*Provider) SendTransaction ¶
func (p *Provider) SendTransaction(ctx context.Context, txBytes lib.Base64Data) (*types.SuiTransactionBlockResponse, error)
func (*Provider) SetAdmin ¶
SetAdmin transfers the ownership of sui connection module to new address
func (*Provider) SetLastSavedHeightFunc ¶
SetLastSavedBlockHeightFunc sets the function to save the last saved block height
func (*Provider) ShouldReceiveMessage ¶
func (*Provider) ShouldSendMessage ¶
type SuiCallArg ¶
type SuiCallArg struct { Val interface{} Type string }
type SuiMessage ¶
type SuiMessage struct { Params []SuiCallArg TypeArgs []string Method string PackageId string Module string }
func (*SuiMessage) MsgBytes ¶
func (m *SuiMessage) MsgBytes() ([]byte, error)
func (*SuiMessage) Type ¶
func (m *SuiMessage) Type() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.