Documentation ¶
Index ¶
- Constants
- func GetFaucetHost(network string) (string, error)
- func RequestSuiFromFaucet(faucetHost, recipientAddress string, header map[string]string) error
- type Client
- type IBaseAPI
- type IReadCoinFromSuiAPI
- type IReadEventFromSuiAPI
- type IReadMoveFromSuiAPI
- type IReadNameServiceFromSuiAPI
- type IReadObjectFromSuiAPI
- type IReadSystemFromSuiAPI
- type IReadTransactionFromSuiAPI
- type ISubscribeAPI
- type ISuiAPI
- type ISuiWebsocketAPI
- type IWriteTransactionAPI
- type WebsocketClient
Constants ¶
View Source
const ValidSuiAddressLength = 66
Variables ¶
This section is empty.
Functions ¶
func GetFaucetHost ¶
GetFaucetHost returns the faucet host for the given network.
Types ¶
type Client ¶
type Client struct { IBaseAPI IReadCoinFromSuiAPI IWriteTransactionAPI IReadEventFromSuiAPI IReadObjectFromSuiAPI IReadTransactionFromSuiAPI IReadSystemFromSuiAPI IReadMoveFromSuiAPI IReadNameServiceFromSuiAPI }
Client implements SuiAPI related interfaces.
type IReadCoinFromSuiAPI ¶
type IReadCoinFromSuiAPI interface { SuiXGetBalance(ctx context.Context, req models.SuiXGetBalanceRequest) (models.CoinBalanceResponse, error) SuiXGetAllBalance(ctx context.Context, req models.SuiXGetAllBalanceRequest) (models.CoinAllBalanceResponse, error) SuiXGetCoins(ctx context.Context, req models.SuiXGetCoinsRequest) (models.PaginatedCoinsResponse, error) SuiXGetAllCoins(ctx context.Context, req models.SuiXGetAllCoinsRequest) (models.PaginatedCoinsResponse, error) SuiXGetCoinMetadata(ctx context.Context, req models.SuiXGetCoinMetadataRequest) (models.CoinMetadataResponse, error) SuiXGetTotalSupply(ctx context.Context, req models.SuiXGetTotalSupplyRequest) (models.TotalSupplyResponse, error) }
type IReadEventFromSuiAPI ¶
type IReadEventFromSuiAPI interface { SuiGetEvents(ctx context.Context, req models.SuiGetEventsRequest) (models.GetEventsResponse, error) SuiXQueryEvents(ctx context.Context, req models.SuiXQueryEventsRequest) (models.PaginatedEventsResponse, error) }
type IReadMoveFromSuiAPI ¶
type IReadMoveFromSuiAPI interface { SuiGetMoveFunctionArgTypes(ctx context.Context, req models.GetMoveFunctionArgTypesRequest) (models.GetMoveFunctionArgTypesResponse, error) SuiGetNormalizedMoveModulesByPackage(ctx context.Context, req models.GetNormalizedMoveModulesByPackageRequest) (models.GetNormalizedMoveModulesByPackageResponse, error) SuiGetNormalizedMoveModule(ctx context.Context, req models.GetNormalizedMoveModuleRequest) (models.GetNormalizedMoveModuleResponse, error) SuiGetNormalizedMoveStruct(ctx context.Context, req models.GetNormalizedMoveStructRequest) (models.GetNormalizedMoveStructResponse, error) SuiGetNormalizedMoveFunction(ctx context.Context, req models.GetNormalizedMoveFunctionRequest) (models.GetNormalizedMoveFunctionResponse, error) }
type IReadNameServiceFromSuiAPI ¶
type IReadNameServiceFromSuiAPI interface { SuiXResolveNameServiceAddress(ctx context.Context, req models.SuiXResolveNameServiceAddressRequest) (string, error) SuiXResolveNameServiceNames(ctx context.Context, req models.SuiXResolveNameServiceNamesRequest) (models.SuiXResolveNameServiceNamesResponse, error) }
type IReadObjectFromSuiAPI ¶
type IReadObjectFromSuiAPI interface { SuiGetObject(ctx context.Context, req models.SuiGetObjectRequest) (models.SuiObjectResponse, error) SuiXGetOwnedObjects(ctx context.Context, req models.SuiXGetOwnedObjectsRequest) (models.PaginatedObjectsResponse, error) SuiMultiGetObjects(ctx context.Context, req models.SuiMultiGetObjectsRequest) ([]*models.SuiObjectResponse, error) SuiXGetDynamicField(ctx context.Context, req models.SuiXGetDynamicFieldRequest) (models.PaginatedDynamicFieldInfoResponse, error) SuiXGetDynamicFieldObject(ctx context.Context, req models.SuiXGetDynamicFieldObjectRequest) (models.SuiObjectResponse, error) SuiTryGetPastObject(ctx context.Context, req models.SuiTryGetPastObjectRequest) (models.PastObjectResponse, error) SuiGetLoadedChildObjects(ctx context.Context, req models.SuiGetLoadedChildObjectsRequest) (models.ChildObjectsResponse, error) SuiTryMultiGetPastObjects(ctx context.Context, req models.SuiTryMultiGetPastObjectsRequest) ([]*models.PastObjectResponse, error) }
type IReadSystemFromSuiAPI ¶
type IReadSystemFromSuiAPI interface { SuiGetCheckpoint(ctx context.Context, req models.SuiGetCheckpointRequest) (models.CheckpointResponse, error) SuiGetCheckpoints(ctx context.Context, req models.SuiGetCheckpointsRequest) (models.PaginatedCheckpointsResponse, error) SuiGetLatestCheckpointSequenceNumber(ctx context.Context) (uint64, error) SuiXGetReferenceGasPrice(ctx context.Context) (uint64, error) SuiXGetCommitteeInfo(ctx context.Context, req models.SuiXGetCommitteeInfoRequest) (models.SuiXGetCommitteeInfoResponse, error) SuiXGetStakes(ctx context.Context, req models.SuiXGetStakesRequest) ([]*models.DelegatedStakesResponse, error) SuiXGetStakesByIds(ctx context.Context, req models.SuiXGetStakesByIdsRequest) ([]*models.DelegatedStakesResponse, error) SuiXGetEpochs(ctx context.Context, req models.SuiXGetEpochsRequest) (models.PaginatedEpochInfoResponse, error) SuiXGetCurrentEpoch(ctx context.Context) (models.EpochInfo, error) SuiXGetLatestSuiSystemState(ctx context.Context) (models.SuiSystemStateSummary, error) SuiGetChainIdentifier(ctx context.Context) (string, error) SuiXGetValidatorsApy(ctx context.Context) (models.ValidatorsApy, error) SuiGetProtocolConfig(ctx context.Context, req models.SuiGetProtocolConfigRequest) (models.ProtocolConfigResponse, error) }
type IReadTransactionFromSuiAPI ¶
type IReadTransactionFromSuiAPI interface { SuiGetTotalTransactionBlocks(ctx context.Context) (uint64, error) SuiGetTransactionBlock(ctx context.Context, req models.SuiGetTransactionBlockRequest) (models.SuiTransactionBlockResponse, error) SuiMultiGetTransactionBlocks(ctx context.Context, req models.SuiMultiGetTransactionBlocksRequest) (models.SuiMultiGetTransactionBlocksResponse, error) SuiXQueryTransactionBlocks(ctx context.Context, req models.SuiXQueryTransactionBlocksRequest) (models.SuiXQueryTransactionBlocksResponse, error) SuiDryRunTransactionBlock(ctx context.Context, req models.SuiDryRunTransactionBlockRequest) (models.SuiTransactionBlockResponse, error) SuiDevInspectTransactionBlock(ctx context.Context, req models.SuiDevInspectTransactionBlockRequest) (models.SuiTransactionBlockResponse, error) }
type ISubscribeAPI ¶
type ISubscribeAPI interface { SubscribeEvent(ctx context.Context, req models.SuiXSubscribeEventsRequest, msgCh chan models.SuiEventResponse) error SubscribeTransaction(ctx context.Context, req models.SuiXSubscribeTransactionsRequest, msgCh chan models.SuiEffects) error }
type ISuiAPI ¶
type ISuiAPI interface { IBaseAPI IReadCoinFromSuiAPI IWriteTransactionAPI IReadEventFromSuiAPI IReadObjectFromSuiAPI IReadTransactionFromSuiAPI IReadSystemFromSuiAPI IReadMoveFromSuiAPI IReadNameServiceFromSuiAPI }
ISuiAPI defines the SuiAPI related interface, and then implement it by the client.
func NewSuiClient ¶
NewSuiClient instantiates the Sui client to call the methods of each module.
type ISuiWebsocketAPI ¶
type ISuiWebsocketAPI interface { ISubscribeAPI }
ISuiWebsocketAPI defines the subscription API related interface, and then implement it by the WebsocketClient.
func NewSuiWebsocketClient ¶
func NewSuiWebsocketClient(rpcUrl string) ISuiWebsocketAPI
NewSuiWebsocketClient instantiates the WebsocketClient to call the methods of each module.
type IWriteTransactionAPI ¶
type IWriteTransactionAPI interface { SuiExecuteTransactionBlock(ctx context.Context, req models.SuiExecuteTransactionBlockRequest) (models.SuiTransactionBlockResponse, error) MoveCall(ctx context.Context, req models.MoveCallRequest) (models.TxnMetaData, error) MergeCoins(ctx context.Context, req models.MergeCoinsRequest) (models.TxnMetaData, error) SplitCoin(ctx context.Context, req models.SplitCoinRequest) (models.TxnMetaData, error) SplitCoinEqual(ctx context.Context, req models.SplitCoinEqualRequest) (models.TxnMetaData, error) Publish(ctx context.Context, req models.PublishRequest) (models.TxnMetaData, error) TransferObject(ctx context.Context, req models.TransferObjectRequest) (models.TxnMetaData, error) TransferSui(ctx context.Context, req models.TransferSuiRequest) (models.TxnMetaData, error) Pay(ctx context.Context, req models.PayRequest) (models.TxnMetaData, error) PaySui(ctx context.Context, req models.PaySuiRequest) (models.TxnMetaData, error) PayAllSui(ctx context.Context, req models.PayAllSuiRequest) (models.TxnMetaData, error) RequestAddStake(ctx context.Context, req models.AddStakeRequest) (models.TxnMetaData, error) RequestWithdrawStake(ctx context.Context, req models.WithdrawStakeRequest) (models.TxnMetaData, error) BatchTransaction(ctx context.Context, req models.BatchTransactionRequest) (models.BatchTransactionResponse, error) SignAndExecuteTransactionBlock(ctx context.Context, req models.SignAndExecuteTransactionBlockRequest) (models.SuiTransactionBlockResponse, error) }
type WebsocketClient ¶
type WebsocketClient struct {
ISubscribeAPI
}
WebsocketClient implements SuiWebsocketAPI related interfaces.
Click to show internal directories.
Click to hide internal directories.