Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

Const executeTransactionBlock

  • executeTransactionBlock(signer: RawSigner, transactionBlock: TransactionBlock): Promise<{ balanceChanges?: { amount: string; coinType: string; owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } } }[]; checkpoint?: string; confirmedLocalExecution?: boolean; digest: string; effects?: { created?: { owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; reference: { digest: string; objectId: string; version: string | number } }[]; deleted?: { digest: string; objectId: string; version: string | number }[]; dependencies?: string[]; eventsDigest?: string; executedEpoch: string; gasObject: { owner: { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } } | "Immutable"; reference: { digest: string; objectId: string; version: string | number } }; gasUsed: { computationCost: string; nonRefundableStorageFee: string; storageCost: string; storageRebate: string }; messageVersion: "v1"; modifiedAtVersions?: { objectId: string; sequenceNumber: string }[]; mutated?: { owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; reference: { digest: string; objectId: string; version: string | number } }[]; sharedObjects?: { digest: string; objectId: string; version: string | number }[]; status: { error?: string; status: "success" | "failure" }; transactionDigest: string; unwrapped?: { owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; reference: { digest: string; objectId: string; version: string | number } }[]; unwrapped_then_deleted?: { digest: string; objectId: string; version: string | number }[]; wrapped?: { digest: string; objectId: string; version: string | number }[] }; errors?: string[]; events?: { bcs?: string; id: { eventSeq: string; txDigest: string }; packageId: string; parsedJson?: Record<string, any>; sender: string; timestampMs?: string; transactionModule: string; type: string }[]; objectChanges?: ({ digest: string; modules: string[]; packageId: string; type: "published"; version: string } | { digest: string; objectId: string; objectType: string; recipient: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; sender: string; type: "transferred"; version: string } | { digest: string; objectId: string; objectType: string; owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; previousVersion: string; sender: string; type: "mutated"; version: string } | { objectId: string; objectType: string; sender: string; type: "deleted"; version: string } | { objectId: string; objectType: string; sender: string; type: "wrapped"; version: string } | { digest: string; objectId: string; objectType: string; owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; sender: string; type: "created"; version: string })[]; timestampMs?: string; transaction?: { data: { gasData: { budget: string; owner: string; payment: { digest: string; objectId: string; version: string | number }[]; price: string }; messageVersion: "v1"; sender: string; transaction: { computation_charge: string; epoch: string; epoch_start_timestamp_ms?: string; kind: "ChangeEpoch"; storage_charge: string; storage_rebate: string } | { commit_timestamp_ms: string; epoch: string; kind: "ConsensusCommitPrologue"; round: string } | { kind: "Genesis"; objects: string[] } | { inputs: ({ type: "pure"; value: SuiJsonValue; valueType?: string } | { digest: string; objectId: string; objectType: "immOrOwnedObject"; type: "object"; version: string } | { initialSharedVersion: string; mutable: boolean; objectId: string; objectType: "sharedObject"; type: "object" })[]; kind: "ProgrammableTransaction"; transactions: ({ MoveCall: { arguments?: ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]; function: string; module: string; package: string; type_arguments?: string[] } } | { TransferObjects: [("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[], "GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }] } | { SplitCoins: ["GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] } | { MergeCoins: ["GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] } | { Publish: [{ disassembled: Record<string, string> }, string[]] } | { Upgrade: [{ disassembled: Record<string, string> }, string[], string, "GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }] } | { MakeMoveVec: [null | string, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] })[] } }; txSignatures: string[] } }>
  • Parameters

    • signer: RawSigner
    • transactionBlock: TransactionBlock

    Returns Promise<{ balanceChanges?: { amount: string; coinType: string; owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } } }[]; checkpoint?: string; confirmedLocalExecution?: boolean; digest: string; effects?: { created?: { owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; reference: { digest: string; objectId: string; version: string | number } }[]; deleted?: { digest: string; objectId: string; version: string | number }[]; dependencies?: string[]; eventsDigest?: string; executedEpoch: string; gasObject: { owner: { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } } | "Immutable"; reference: { digest: string; objectId: string; version: string | number } }; gasUsed: { computationCost: string; nonRefundableStorageFee: string; storageCost: string; storageRebate: string }; messageVersion: "v1"; modifiedAtVersions?: { objectId: string; sequenceNumber: string }[]; mutated?: { owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; reference: { digest: string; objectId: string; version: string | number } }[]; sharedObjects?: { digest: string; objectId: string; version: string | number }[]; status: { error?: string; status: "success" | "failure" }; transactionDigest: string; unwrapped?: { owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; reference: { digest: string; objectId: string; version: string | number } }[]; unwrapped_then_deleted?: { digest: string; objectId: string; version: string | number }[]; wrapped?: { digest: string; objectId: string; version: string | number }[] }; errors?: string[]; events?: { bcs?: string; id: { eventSeq: string; txDigest: string }; packageId: string; parsedJson?: Record<string, any>; sender: string; timestampMs?: string; transactionModule: string; type: string }[]; objectChanges?: ({ digest: string; modules: string[]; packageId: string; type: "published"; version: string } | { digest: string; objectId: string; objectType: string; recipient: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; sender: string; type: "transferred"; version: string } | { digest: string; objectId: string; objectType: string; owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; previousVersion: string; sender: string; type: "mutated"; version: string } | { objectId: string; objectType: string; sender: string; type: "deleted"; version: string } | { objectId: string; objectType: string; sender: string; type: "wrapped"; version: string } | { digest: string; objectId: string; objectType: string; owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; sender: string; type: "created"; version: string })[]; timestampMs?: string; transaction?: { data: { gasData: { budget: string; owner: string; payment: { digest: string; objectId: string; version: string | number }[]; price: string }; messageVersion: "v1"; sender: string; transaction: { computation_charge: string; epoch: string; epoch_start_timestamp_ms?: string; kind: "ChangeEpoch"; storage_charge: string; storage_rebate: string } | { commit_timestamp_ms: string; epoch: string; kind: "ConsensusCommitPrologue"; round: string } | { kind: "Genesis"; objects: string[] } | { inputs: ({ type: "pure"; value: SuiJsonValue; valueType?: string } | { digest: string; objectId: string; objectType: "immOrOwnedObject"; type: "object"; version: string } | { initialSharedVersion: string; mutable: boolean; objectId: string; objectType: "sharedObject"; type: "object" })[]; kind: "ProgrammableTransaction"; transactions: ({ MoveCall: { arguments?: ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]; function: string; module: string; package: string; type_arguments?: string[] } } | { TransferObjects: [("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[], "GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }] } | { SplitCoins: ["GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] } | { MergeCoins: ["GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] } | { Publish: [{ disassembled: Record<string, string> }, string[]] } | { Upgrade: [{ disassembled: Record<string, string> }, string[], string, "GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }] } | { MakeMoveVec: [null | string, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] })[] } }; txSignatures: string[] } }>

Const getCoinBuildOutput

  • getCoinBuildOutput(provider: JsonRpcProvider, coreBridgePackageId: string, tokenBridgePackageId: string, tokenBridgeStateObjectId: string, decimals: number): Promise<SuiBuildOutput>
  • Parameters

    • provider: JsonRpcProvider
    • coreBridgePackageId: string
    • tokenBridgePackageId: string
    • tokenBridgeStateObjectId: string
    • decimals: number

    Returns Promise<SuiBuildOutput>

Const getEmitterAddressAndSequenceFromResponseSui

  • getEmitterAddressAndSequenceFromResponseSui(originalCoreBridgePackageId: string, response: { balanceChanges?: { amount: string; coinType: string; owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } } }[]; checkpoint?: string; confirmedLocalExecution?: boolean; digest: string; effects?: { created?: { owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; reference: { digest: string; objectId: string; version: string | number } }[]; deleted?: { digest: string; objectId: string; version: string | number }[]; dependencies?: string[]; eventsDigest?: string; executedEpoch: string; gasObject: { owner: { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } } | "Immutable"; reference: { digest: string; objectId: string; version: string | number } }; gasUsed: { computationCost: string; nonRefundableStorageFee: string; storageCost: string; storageRebate: string }; messageVersion: "v1"; modifiedAtVersions?: { objectId: string; sequenceNumber: string }[]; mutated?: { owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; reference: { digest: string; objectId: string; version: string | number } }[]; sharedObjects?: { digest: string; objectId: string; version: string | number }[]; status: { error?: string; status: "success" | "failure" }; transactionDigest: string; unwrapped?: { owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; reference: { digest: string; objectId: string; version: string | number } }[]; unwrapped_then_deleted?: { digest: string; objectId: string; version: string | number }[]; wrapped?: { digest: string; objectId: string; version: string | number }[] }; errors?: string[]; events?: { bcs?: string; id: { eventSeq: string; txDigest: string }; packageId: string; parsedJson?: Record<string, any>; sender: string; timestampMs?: string; transactionModule: string; type: string }[]; objectChanges?: ({ digest: string; modules: string[]; packageId: string; type: "published"; version: string } | { digest: string; objectId: string; objectType: string; recipient: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; sender: string; type: "transferred"; version: string } | { digest: string; objectId: string; objectType: string; owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; previousVersion: string; sender: string; type: "mutated"; version: string } | { objectId: string; objectType: string; sender: string; type: "deleted"; version: string } | { objectId: string; objectType: string; sender: string; type: "wrapped"; version: string } | { digest: string; objectId: string; objectType: string; owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; sender: string; type: "created"; version: string })[]; timestampMs?: string; transaction?: { data: { gasData: { budget: string; owner: string; payment: { digest: string; objectId: string; version: string | number }[]; price: string }; messageVersion: "v1"; sender: string; transaction: { computation_charge: string; epoch: string; epoch_start_timestamp_ms?: string; kind: "ChangeEpoch"; storage_charge: string; storage_rebate: string } | { commit_timestamp_ms: string; epoch: string; kind: "ConsensusCommitPrologue"; round: string } | { kind: "Genesis"; objects: string[] } | { inputs: ({ type: "pure"; value: SuiJsonValue; valueType?: string } | { digest: string; objectId: string; objectType: "immOrOwnedObject"; type: "object"; version: string } | { initialSharedVersion: string; mutable: boolean; objectId: string; objectType: "sharedObject"; type: "object" })[]; kind: "ProgrammableTransaction"; transactions: ({ MoveCall: { arguments?: ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]; function: string; module: string; package: string; type_arguments?: string[] } } | { TransferObjects: [("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[], "GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }] } | { SplitCoins: ["GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] } | { MergeCoins: ["GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] } | { Publish: [{ disassembled: Record<string, string> }, string[]] } | { Upgrade: [{ disassembled: Record<string, string> }, string[], string, "GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }] } | { MakeMoveVec: [null | string, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] })[] } }; txSignatures: string[] } }): { emitterAddress: string; sequence: string }
  • Parameters

    • originalCoreBridgePackageId: string
    • response: { balanceChanges?: { amount: string; coinType: string; owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } } }[]; checkpoint?: string; confirmedLocalExecution?: boolean; digest: string; effects?: { created?: { owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; reference: { digest: string; objectId: string; version: string | number } }[]; deleted?: { digest: string; objectId: string; version: string | number }[]; dependencies?: string[]; eventsDigest?: string; executedEpoch: string; gasObject: { owner: { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } } | "Immutable"; reference: { digest: string; objectId: string; version: string | number } }; gasUsed: { computationCost: string; nonRefundableStorageFee: string; storageCost: string; storageRebate: string }; messageVersion: "v1"; modifiedAtVersions?: { objectId: string; sequenceNumber: string }[]; mutated?: { owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; reference: { digest: string; objectId: string; version: string | number } }[]; sharedObjects?: { digest: string; objectId: string; version: string | number }[]; status: { error?: string; status: "success" | "failure" }; transactionDigest: string; unwrapped?: { owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; reference: { digest: string; objectId: string; version: string | number } }[]; unwrapped_then_deleted?: { digest: string; objectId: string; version: string | number }[]; wrapped?: { digest: string; objectId: string; version: string | number }[] }; errors?: string[]; events?: { bcs?: string; id: { eventSeq: string; txDigest: string }; packageId: string; parsedJson?: Record<string, any>; sender: string; timestampMs?: string; transactionModule: string; type: string }[]; objectChanges?: ({ digest: string; modules: string[]; packageId: string; type: "published"; version: string } | { digest: string; objectId: string; objectType: string; recipient: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; sender: string; type: "transferred"; version: string } | { digest: string; objectId: string; objectType: string; owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; previousVersion: string; sender: string; type: "mutated"; version: string } | { objectId: string; objectType: string; sender: string; type: "deleted"; version: string } | { objectId: string; objectType: string; sender: string; type: "wrapped"; version: string } | { digest: string; objectId: string; objectType: string; owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; sender: string; type: "created"; version: string })[]; timestampMs?: string; transaction?: { data: { gasData: { budget: string; owner: string; payment: { digest: string; objectId: string; version: string | number }[]; price: string }; messageVersion: "v1"; sender: string; transaction: { computation_charge: string; epoch: string; epoch_start_timestamp_ms?: string; kind: "ChangeEpoch"; storage_charge: string; storage_rebate: string } | { commit_timestamp_ms: string; epoch: string; kind: "ConsensusCommitPrologue"; round: string } | { kind: "Genesis"; objects: string[] } | { inputs: ({ type: "pure"; value: SuiJsonValue; valueType?: string } | { digest: string; objectId: string; objectType: "immOrOwnedObject"; type: "object"; version: string } | { initialSharedVersion: string; mutable: boolean; objectId: string; objectType: "sharedObject"; type: "object" })[]; kind: "ProgrammableTransaction"; transactions: ({ MoveCall: { arguments?: ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]; function: string; module: string; package: string; type_arguments?: string[] } } | { TransferObjects: [("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[], "GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }] } | { SplitCoins: ["GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] } | { MergeCoins: ["GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] } | { Publish: [{ disassembled: Record<string, string> }, string[]] } | { Upgrade: [{ disassembled: Record<string, string> }, string[], string, "GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }] } | { MakeMoveVec: [null | string, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] })[] } }; txSignatures: string[] } }
      • Optional balanceChanges?: { amount: string; coinType: string; owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } } }[]
      • Optional checkpoint?: string
      • Optional confirmedLocalExecution?: boolean
      • digest: string
      • Optional effects?: { created?: { owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; reference: { digest: string; objectId: string; version: string | number } }[]; deleted?: { digest: string; objectId: string; version: string | number }[]; dependencies?: string[]; eventsDigest?: string; executedEpoch: string; gasObject: { owner: { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } } | "Immutable"; reference: { digest: string; objectId: string; version: string | number } }; gasUsed: { computationCost: string; nonRefundableStorageFee: string; storageCost: string; storageRebate: string }; messageVersion: "v1"; modifiedAtVersions?: { objectId: string; sequenceNumber: string }[]; mutated?: { owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; reference: { digest: string; objectId: string; version: string | number } }[]; sharedObjects?: { digest: string; objectId: string; version: string | number }[]; status: { error?: string; status: "success" | "failure" }; transactionDigest: string; unwrapped?: { owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; reference: { digest: string; objectId: string; version: string | number } }[]; unwrapped_then_deleted?: { digest: string; objectId: string; version: string | number }[]; wrapped?: { digest: string; objectId: string; version: string | number }[] }
        • Optional created?: { owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; reference: { digest: string; objectId: string; version: string | number } }[]
        • Optional deleted?: { digest: string; objectId: string; version: string | number }[]
        • Optional dependencies?: string[]
        • Optional eventsDigest?: string
        • executedEpoch: string
        • gasObject: { owner: { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } } | "Immutable"; reference: { digest: string; objectId: string; version: string | number } }
          • owner: { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } } | "Immutable"
          • reference: { digest: string; objectId: string; version: string | number }
            • digest: string
            • objectId: string
            • version: string | number
        • gasUsed: { computationCost: string; nonRefundableStorageFee: string; storageCost: string; storageRebate: string }
          • computationCost: string
          • nonRefundableStorageFee: string
          • storageCost: string
          • storageRebate: string
        • messageVersion: "v1"
        • Optional modifiedAtVersions?: { objectId: string; sequenceNumber: string }[]
        • Optional mutated?: { owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; reference: { digest: string; objectId: string; version: string | number } }[]
        • Optional sharedObjects?: { digest: string; objectId: string; version: string | number }[]
        • status: { error?: string; status: "success" | "failure" }
          • Optional error?: string
          • status: "success" | "failure"
        • transactionDigest: string
        • Optional unwrapped?: { owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; reference: { digest: string; objectId: string; version: string | number } }[]
        • Optional unwrapped_then_deleted?: { digest: string; objectId: string; version: string | number }[]
        • Optional wrapped?: { digest: string; objectId: string; version: string | number }[]
      • Optional errors?: string[]
      • Optional events?: { bcs?: string; id: { eventSeq: string; txDigest: string }; packageId: string; parsedJson?: Record<string, any>; sender: string; timestampMs?: string; transactionModule: string; type: string }[]
      • Optional objectChanges?: ({ digest: string; modules: string[]; packageId: string; type: "published"; version: string } | { digest: string; objectId: string; objectType: string; recipient: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; sender: string; type: "transferred"; version: string } | { digest: string; objectId: string; objectType: string; owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; previousVersion: string; sender: string; type: "mutated"; version: string } | { objectId: string; objectType: string; sender: string; type: "deleted"; version: string } | { objectId: string; objectType: string; sender: string; type: "wrapped"; version: string } | { digest: string; objectId: string; objectType: string; owner: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; sender: string; type: "created"; version: string })[]
      • Optional timestampMs?: string
      • Optional transaction?: { data: { gasData: { budget: string; owner: string; payment: { digest: string; objectId: string; version: string | number }[]; price: string }; messageVersion: "v1"; sender: string; transaction: { computation_charge: string; epoch: string; epoch_start_timestamp_ms?: string; kind: "ChangeEpoch"; storage_charge: string; storage_rebate: string } | { commit_timestamp_ms: string; epoch: string; kind: "ConsensusCommitPrologue"; round: string } | { kind: "Genesis"; objects: string[] } | { inputs: ({ type: "pure"; value: SuiJsonValue; valueType?: string } | { digest: string; objectId: string; objectType: "immOrOwnedObject"; type: "object"; version: string } | { initialSharedVersion: string; mutable: boolean; objectId: string; objectType: "sharedObject"; type: "object" })[]; kind: "ProgrammableTransaction"; transactions: ({ MoveCall: { arguments?: ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]; function: string; module: string; package: string; type_arguments?: string[] } } | { TransferObjects: [("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[], "GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }] } | { SplitCoins: ["GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] } | { MergeCoins: ["GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] } | { Publish: [{ disassembled: Record<string, string> }, string[]] } | { Upgrade: [{ disassembled: Record<string, string> }, string[], string, "GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }] } | { MakeMoveVec: [null | string, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] })[] } }; txSignatures: string[] }
        • data: { gasData: { budget: string; owner: string; payment: { digest: string; objectId: string; version: string | number }[]; price: string }; messageVersion: "v1"; sender: string; transaction: { computation_charge: string; epoch: string; epoch_start_timestamp_ms?: string; kind: "ChangeEpoch"; storage_charge: string; storage_rebate: string } | { commit_timestamp_ms: string; epoch: string; kind: "ConsensusCommitPrologue"; round: string } | { kind: "Genesis"; objects: string[] } | { inputs: ({ type: "pure"; value: SuiJsonValue; valueType?: string } | { digest: string; objectId: string; objectType: "immOrOwnedObject"; type: "object"; version: string } | { initialSharedVersion: string; mutable: boolean; objectId: string; objectType: "sharedObject"; type: "object" })[]; kind: "ProgrammableTransaction"; transactions: ({ MoveCall: { arguments?: ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]; function: string; module: string; package: string; type_arguments?: string[] } } | { TransferObjects: [("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[], "GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }] } | { SplitCoins: ["GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] } | { MergeCoins: ["GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] } | { Publish: [{ disassembled: Record<string, string> }, string[]] } | { Upgrade: [{ disassembled: Record<string, string> }, string[], string, "GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }] } | { MakeMoveVec: [null | string, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] })[] } }
          • gasData: { budget: string; owner: string; payment: { digest: string; objectId: string; version: string | number }[]; price: string }
            • budget: string
            • owner: string
            • payment: { digest: string; objectId: string; version: string | number }[]
            • price: string
          • messageVersion: "v1"
          • sender: string
          • transaction: { computation_charge: string; epoch: string; epoch_start_timestamp_ms?: string; kind: "ChangeEpoch"; storage_charge: string; storage_rebate: string } | { commit_timestamp_ms: string; epoch: string; kind: "ConsensusCommitPrologue"; round: string } | { kind: "Genesis"; objects: string[] } | { inputs: ({ type: "pure"; value: SuiJsonValue; valueType?: string } | { digest: string; objectId: string; objectType: "immOrOwnedObject"; type: "object"; version: string } | { initialSharedVersion: string; mutable: boolean; objectId: string; objectType: "sharedObject"; type: "object" })[]; kind: "ProgrammableTransaction"; transactions: ({ MoveCall: { arguments?: ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]; function: string; module: string; package: string; type_arguments?: string[] } } | { TransferObjects: [("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[], "GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }] } | { SplitCoins: ["GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] } | { MergeCoins: ["GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] } | { Publish: [{ disassembled: Record<string, string> }, string[]] } | { Upgrade: [{ disassembled: Record<string, string> }, string[], string, "GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] }] } | { MakeMoveVec: [null | string, ("GasCoin" | { Input: number } | { Result: number } | { NestedResult: [number, number] })[]] })[] }
        • txSignatures: string[]

    Returns { emitterAddress: string; sequence: string }

    • emitterAddress: string
    • sequence: string

Const getFieldsFromObjectResponse

  • getFieldsFromObjectResponse(object: { data?: { bcs?: { dataType: "moveObject"; fields: Record<string, any>; hasPublicTransfer: boolean; type: string } | { dataType: "package"; id: string; moduleMap: Record<string, string> }; content?: { dataType: "moveObject"; fields: Record<string, any>; hasPublicTransfer: boolean; type: string } | { dataType: "package"; disassembled: Record<string, string> }; digest: string; display?: Record<string, string> | { data: null | Record<string, string>; error: null | { code: string; digest?: string; error?: string; object_id?: string; version?: string } }; objectId: string; owner?: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; previousTransaction?: string; storageRebate?: string; type?: string; version: string }; error?: { code: string; digest?: string; error?: string; object_id?: string; version?: string } }): null | Record<string, any>
  • Parameters

    • object: { data?: { bcs?: { dataType: "moveObject"; fields: Record<string, any>; hasPublicTransfer: boolean; type: string } | { dataType: "package"; id: string; moduleMap: Record<string, string> }; content?: { dataType: "moveObject"; fields: Record<string, any>; hasPublicTransfer: boolean; type: string } | { dataType: "package"; disassembled: Record<string, string> }; digest: string; display?: Record<string, string> | { data: null | Record<string, string>; error: null | { code: string; digest?: string; error?: string; object_id?: string; version?: string } }; objectId: string; owner?: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; previousTransaction?: string; storageRebate?: string; type?: string; version: string }; error?: { code: string; digest?: string; error?: string; object_id?: string; version?: string } }
      • Optional data?: { bcs?: { dataType: "moveObject"; fields: Record<string, any>; hasPublicTransfer: boolean; type: string } | { dataType: "package"; id: string; moduleMap: Record<string, string> }; content?: { dataType: "moveObject"; fields: Record<string, any>; hasPublicTransfer: boolean; type: string } | { dataType: "package"; disassembled: Record<string, string> }; digest: string; display?: Record<string, string> | { data: null | Record<string, string>; error: null | { code: string; digest?: string; error?: string; object_id?: string; version?: string } }; objectId: string; owner?: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; previousTransaction?: string; storageRebate?: string; type?: string; version: string }
        • Optional bcs?: { dataType: "moveObject"; fields: Record<string, any>; hasPublicTransfer: boolean; type: string } | { dataType: "package"; id: string; moduleMap: Record<string, string> }
        • Optional content?: { dataType: "moveObject"; fields: Record<string, any>; hasPublicTransfer: boolean; type: string } | { dataType: "package"; disassembled: Record<string, string> }
        • digest: string
        • Optional display?: Record<string, string> | { data: null | Record<string, string>; error: null | { code: string; digest?: string; error?: string; object_id?: string; version?: string } }
        • objectId: string
        • Optional owner?: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }
        • Optional previousTransaction?: string
        • Optional storageRebate?: string
        • Optional type?: string
        • version: string
      • Optional error?: { code: string; digest?: string; error?: string; object_id?: string; version?: string }
        • code: string
        • Optional digest?: string
        • Optional error?: string
        • Optional object_id?: string
        • Optional version?: string

    Returns null | Record<string, any>

Const getInnerType

  • getInnerType(type: string): null | string

Const getObjectFields

  • getObjectFields(provider: JsonRpcProvider, objectId: string): Promise<null | Record<string, any>>
  • Parameters

    • provider: JsonRpcProvider
    • objectId: string

    Returns Promise<null | Record<string, any>>

Const getOriginalPackageId

  • getOriginalPackageId(provider: JsonRpcProvider, stateObjectId: string): Promise<undefined | string>
  • Parameters

    • provider: JsonRpcProvider
    • stateObjectId: string

    Returns Promise<undefined | string>

Const getOwnedObjectId

  • getOwnedObjectId(provider: JsonRpcProvider, owner: string, type: string): Promise<null | string>
  • Parameters

    • provider: JsonRpcProvider
    • owner: string
    • type: string

    Returns Promise<null | string>

Const getOwnedObjectIdPaginated

  • getOwnedObjectIdPaginated(provider: JsonRpcProvider, owner: string, type: string, cursor?: string): Promise<null | string>
  • Parameters

    • provider: JsonRpcProvider
    • owner: string
    • type: string
    • Optional cursor: string

    Returns Promise<null | string>

getPackageId

  • getPackageId(provider: JsonRpcProvider, objectId: string): Promise<string>
  • Parameters

    • provider: JsonRpcProvider
    • objectId: string

      Core or token bridge state object ID

    Returns Promise<string>

    The latest package ID for the provided state object

Const getPackageIdFromType

  • getPackageIdFromType(type: string): null | string

Const getTableKeyType

  • getTableKeyType(tableType: string): null | string

Const getTokenCoinType

  • getTokenCoinType(provider: JsonRpcProvider, tokenBridgeStateObjectId: string, tokenAddress: Uint8Array, tokenChain: number): Promise<null | string>
  • Parameters

    • provider: JsonRpcProvider
    • tokenBridgeStateObjectId: string
    • tokenAddress: Uint8Array
    • tokenChain: number

    Returns Promise<null | string>

Const getTokenFromTokenRegistry

  • getTokenFromTokenRegistry(provider: JsonRpcProvider, tokenBridgeStateObjectId: string, tokenType: string): Promise<{ data?: { bcs?: { dataType: "moveObject"; fields: Record<string, any>; hasPublicTransfer: boolean; type: string } | { dataType: "package"; id: string; moduleMap: Record<string, string> }; content?: { dataType: "moveObject"; fields: Record<string, any>; hasPublicTransfer: boolean; type: string } | { dataType: "package"; disassembled: Record<string, string> }; digest: string; display?: Record<string, string> | { data: null | Record<string, string>; error: null | { code: string; digest?: string; error?: string; object_id?: string; version?: string } }; objectId: string; owner?: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; previousTransaction?: string; storageRebate?: string; type?: string; version: string }; error?: { code: string; digest?: string; error?: string; object_id?: string; version?: string } }>
  • Parameters

    • provider: JsonRpcProvider
    • tokenBridgeStateObjectId: string
    • tokenType: string

    Returns Promise<{ data?: { bcs?: { dataType: "moveObject"; fields: Record<string, any>; hasPublicTransfer: boolean; type: string } | { dataType: "package"; id: string; moduleMap: Record<string, string> }; content?: { dataType: "moveObject"; fields: Record<string, any>; hasPublicTransfer: boolean; type: string } | { dataType: "package"; disassembled: Record<string, string> }; digest: string; display?: Record<string, string> | { data: null | Record<string, string>; error: null | { code: string; digest?: string; error?: string; object_id?: string; version?: string } }; objectId: string; owner?: "Immutable" | { AddressOwner: string } | { ObjectOwner: string } | { Shared: { initial_shared_version: number } }; previousTransaction?: string; storageRebate?: string; type?: string; version: string }; error?: { code: string; digest?: string; error?: string; object_id?: string; version?: string } }>

Const getUpgradeCapObjectId

  • getUpgradeCapObjectId(provider: JsonRpcProvider, owner: string, packageId: string): Promise<null | string>
  • This function returns the object ID of the UpgradeCap that belongs to the given package and owner if it exists.

    Structs created by the Sui framework such as UpgradeCaps all have the same type (e.g. 0x2::package::UpgradeCap) and have a special field, package, we can use to differentiate them.

    Parameters

    • provider: JsonRpcProvider

      Sui RPC provider

    • owner: string

      Address of the current owner of the UpgradeCap

    • packageId: string

      ID of the package that the UpgradeCap was created for

    Returns Promise<null | string>

    The object ID of the UpgradeCap if it exists, otherwise null

Const getWrappedCoinType

  • getWrappedCoinType(coinPackageId: string): string

Const isSameType

  • isSameType(a: string, b: string): boolean

Const isSuiError

  • isSuiError(error: any): error is SuiError

Const isValidSuiAddress

  • isValidSuiAddress(address: string): boolean
  • This method validates any Sui address, even if it's not 32 bytes long, i.e. "0x2". This differs from Mysten's implementation, which requires that the given address is 32 bytes long.

    Parameters

    • address: string

      Address to check

    Returns boolean

    If given address is a valid Sui address or not

Const isValidSuiType

  • isValidSuiType(type: string): boolean

Const padSuiType

  • padSuiType(type: string): string
  • Unlike trimSuiType, this method does not modify nested types, it just pads the top-level type.

    Parameters

    • type: string

    Returns string

Const publishCoin

  • publishCoin(provider: JsonRpcProvider, coreBridgeStateObjectId: string, tokenBridgeStateObjectId: string, decimals: number, signerAddress: string): Promise<TransactionBlock>
  • Parameters

    • provider: JsonRpcProvider
    • coreBridgeStateObjectId: string
    • tokenBridgeStateObjectId: string
    • decimals: number
    • signerAddress: string

    Returns Promise<TransactionBlock>

Const publishPackage

  • publishPackage(buildOutput: SuiBuildOutput, signerAddress: string): Promise<TransactionBlock>
  • Parameters

    • buildOutput: SuiBuildOutput
    • signerAddress: string

    Returns Promise<TransactionBlock>

Const trimSuiType

  • trimSuiType(type: string): string
  • This method removes leading zeroes for types in order to normalize them since some types returned from the RPC have leading zeroes and others don't.

    Parameters

    • type: string

    Returns string

Const uint8ArrayToBCS

  • uint8ArrayToBCS(arr: Uint8Array): Uint8Array

Generated using TypeDoc