Type alias ProviderApi<Addr>

ProviderApi<Addr>: {
    requestPermissions: {
        input: {
            permissions: UniqueArray<Permission[]>;
        };
        output: Partial<Permissions<Addr>>;
    };
    changeAccount: {
        output: Partial<Permissions<Addr>>;
    };
    disconnect: Record<string, never>;
    subscribe: {
        input: {
            address: Addr;
            subscriptions: Partial<ContractUpdatesSubscription>;
        };
        output: ContractUpdatesSubscription;
    };
    unsubscribe: {
        input: {
            address: Addr;
        };
    };
    unsubscribeAll: Record<string, never>;
    getProviderState: {
        output: {
            version: string;
            numericVersion: number;
            selectedConnection: string;
            networkId: number;
            supportedPermissions: UniqueArray<Permission[]>;
            permissions: Partial<Permissions<Addr>>;
            subscriptions: {
                [address: string]: ContractUpdatesSubscription;
            };
        };
    };
    getFullContractState: {
        input: {
            address: Addr;
        };
        output: {
            state: FullContractState | undefined;
        };
    };
    computeStorageFee: {
        input: {
            state: FullContractState;
            masterchain?: boolean;
            timestamp?: number;
        };
        output: {
            storageFee: string;
            storageFeeDebt?: string;
            accountStatus: AccountStatus;
            freezeDueLimit: string;
            deleteDueLimit: string;
        };
    };
    getAccountsByCodeHash: {
        input: {
            codeHash: string;
            continuation?: string;
            limit?: number;
        };
        output: {
            accounts: Addr[];
            continuation: string | undefined;
        };
    };
    getTransactions: {
        input: {
            address: Addr;
            continuation?: TransactionId;
            limit?: number;
        };
        output: {
            transactions: Transaction<Addr>[];
            continuation: TransactionId | undefined;
            info?: TransactionsBatchInfo;
        };
    };
    getTransaction: {
        input: {
            hash: string;
        };
        output: {
            transaction: Transaction<Addr> | undefined;
        };
    };
    findTransaction: {
        input: {
            inMessageHash?: string;
        };
        output: {
            transaction: Transaction<Addr> | undefined;
        };
    };
    runLocal: {
        input: {
            address: Addr;
            cachedState?: FullContractState;
            responsible?: boolean;
            functionCall: FunctionCall<Addr>;
            withSignatureId?: boolean | number;
        };
        output: {
            output: TokensObject<Addr> | undefined;
            code: number;
        };
    };
    executeLocal: {
        input: {
            address: Addr;
            cachedState?: FullContractState;
            stateInit?: string;
            payload?: string | FunctionCall<Addr>;
            messageHeader: {
                type: "external";
                publicKey: string;
                withoutSignature?: boolean;
            } | {
                type: "internal";
                sender: Addr;
                amount: string;
                bounce: boolean;
                bounced?: boolean;
            };
            executorParams?: {
                disableSignatureCheck?: boolean;
                overrideBalance?: string | number;
            };
        };
        output: {
            transaction: Transaction<Addr>;
            newState: FullContractState | undefined;
            output: TokensObject<Addr> | undefined;
        };
    };
    getExpectedAddress: {
        input: {
            tvc: string;
            abi: string;
            workchain?: number;
            publicKey?: string;
            initParams: TokensObject<Addr>;
        };
        output: {
            address: Addr;
            stateInit: string;
            hash: string;
        };
    };
    getContractFields: {
        input: {
            address: Addr;
            abi: string;
            cachedState?: FullContractState;
            allowPartial: boolean;
        };
        output: {
            fields?: TokensObject<Addr>;
            state: FullContractState | undefined;
        };
    };
    unpackInitData: {
        input: {
            abi: string;
            data: string;
        };
        output: {
            publicKey: string | undefined;
            initParams: TokensObject<Addr>;
        };
    };
    getBocHash: {
        input: {
            boc: string;
        };
        output: {
            hash: string;
        };
    };
    packIntoCell: {
        input: {
            abiVersion?: AbiVersion;
            structure: AbiParam[];
            data: TokensObject<Addr>;
        };
        output: {
            boc: string;
            hash: string;
        };
    };
    unpackFromCell: {
        input: {
            abiVersion?: AbiVersion;
            structure: AbiParam[];
            boc: string;
            allowPartial: boolean;
        };
        output: {
            data: TokensObject<Addr>;
        };
    };
    extractPublicKey: {
        input: {
            boc: string;
        };
        output: {
            publicKey: string;
        };
    };
    codeToTvc: {
        input: {
            code: string;
        };
        output: {
            tvc: string;
            hash: string;
        };
    };
    mergeTvc: {
        input: {
            code: string;
            data: string;
        };
        output: {
            tvc: string;
            hash: string;
        };
    };
    splitTvc: {
        input: {
            tvc: string;
        };
        output: {
            data: string | undefined;
            code: string | undefined;
        };
    };
    setCodeSalt: {
        input: {
            code: string;
            salt: string;
        };
        output: {
            code: string;
            hash: string;
        };
    };
    getCodeSalt: {
        input: {
            code: string;
        };
        output: {
            salt: string | undefined;
        };
    };
    encodeInternalInput: {
        input: FunctionCall<Addr>;
        output: {
            boc: string;
        };
    };
    decodeInput: {
        input: {
            body: string;
            abi: string;
            method: string | string[];
            internal: boolean;
        };
        output: {
            method: string;
            input: TokensObject<Addr>;
        } | null;
    };
    decodeOutput: {
        input: {
            body: string;
            abi: string;
            method: string | string[];
        };
        output: {
            method: string;
            output: TokensObject<Addr>;
        } | null;
    };
    decodeEvent: {
        input: {
            body: string;
            abi: string;
            event: string | string[];
        };
        output: {
            event: string;
            data: TokensObject<Addr>;
        } | null;
    };
    decodeTransaction: {
        input: {
            transaction: Transaction<Addr>;
            abi: string;
            method: string | string[];
        };
        output: {
            method: string;
            input: TokensObject<Addr>;
            output: TokensObject<Addr>;
        } | null;
    };
    decodeTransactionEvents: {
        input: {
            transaction: Transaction<Addr>;
            abi: string;
        };
        output: {
            events: {
                event: string;
                data: TokensObject<Addr>;
            }[];
        };
    };
    verifySignature: {
        input: {
            publicKey: string;
            dataHash: string;
            signature: string;
            withSignatureId?: boolean | number;
        };
        output: {
            isValid: boolean;
        };
    };
    sendUnsignedExternalMessage: {
        input: {
            recipient: Addr;
            stateInit?: string;
            payload?: string | FunctionCall<Addr>;
            local?: boolean;
            executorParams?: {
                disableSignatureCheck?: boolean;
                overrideBalance?: string | number;
            };
        };
        output: {
            transaction: Transaction<Addr>;
            output: TokensObject<Addr> | undefined;
        };
    };
    addAsset: {
        input: {
            account: Addr;
            type: AssetType;
            params: AssetTypeParams<AssetType, Addr>;
        };
        output: {
            newAsset: boolean;
        };
    };
    signData: {
        input: {
            publicKey: string;
            data: string;
            withSignatureId?: boolean | number;
        };
        output: {
            dataHash: string;
            signature: string;
            signatureHex: string;
            signatureParts: {
                high: string;
                low: string;
            };
        };
    };
    signDataRaw: {
        input: {
            publicKey: string;
            data: string;
            withSignatureId?: boolean | number;
        };
        output: {
            signature: string;
            signatureHex: string;
            signatureParts: {
                high: string;
                low: string;
            };
        };
    };
    encryptData: {
        input: {
            publicKey: string;
            recipientPublicKeys: string[];
            algorithm: EncryptionAlgorithm;
            data: string;
        };
        output: {
            encryptedData: EncryptedData[];
        };
    };
    decryptData: {
        input: {
            encryptedData: EncryptedData;
        };
        output: {
            data: string;
        };
    };
    estimateFees: {
        input: {
            sender: Addr;
            recipient: Addr;
            amount: string;
            payload?: FunctionCall<Addr>;
            stateInit?: string;
        };
        output: {
            fees: string;
        };
    };
    sendMessage: {
        input: {
            sender: Addr;
            recipient: Addr;
            amount: string;
            bounce: boolean;
            payload?: FunctionCall<Addr>;
            stateInit?: string;
        };
        output: {
            transaction: Transaction<Addr>;
        };
    };
    sendMessageDelayed: {
        input: {
            sender: Addr;
            recipient: Addr;
            amount: string;
            bounce: boolean;
            payload?: FunctionCall<Addr>;
            stateInit?: string;
        };
        output: {
            message: DelayedMessage<Addr>;
        };
    };
    sendExternalMessage: {
        input: {
            publicKey: string;
            recipient: Addr;
            stateInit?: string;
            payload: FunctionCall<Addr>;
            local?: boolean;
            executorParams?: {
                disableSignatureCheck?: boolean;
                overrideBalance?: string | number;
            };
        };
        output: {
            transaction: Transaction<Addr>;
            output: TokensObject<Addr> | undefined;
        };
    };
    sendExternalMessageDelayed: {
        input: {
            publicKey: string;
            recipient: Addr;
            stateInit?: string;
            payload: FunctionCall<Addr>;
        };
        output: {
            message: DelayedMessage<Addr>;
        };
    };
}

Type Parameters

Type declaration

  • requestPermissions: {
        input: {
            permissions: UniqueArray<Permission[]>;
        };
        output: Partial<Permissions<Addr>>;
    }

    Requests new permissions for current origin. Shows an approval window to the user. Will overwrite already existing permissions


    Required permissions: none

  • changeAccount: {
        output: Partial<Permissions<Addr>>;
    }

    Updates accountInteraction permission value


    Requires permissions: accountInteraction

  • disconnect: Record<string, never>

    Removes all permissions for current origin and stops all subscriptions


    Required permissions: none

  • subscribe: {
        input: {
            address: Addr;
            subscriptions: Partial<ContractUpdatesSubscription>;
        };
        output: ContractUpdatesSubscription;
    }

    Subscribes to contract updates. Can also be used to update subscriptions


    Required permissions: basic

  • unsubscribe: {
        input: {
            address: Addr;
        };
    }

    Fully unsubscribe from specific contract updates


    Required permissions: none

    • input: {
          address: Addr;
      }
      • address: Addr

        Contract address

  • unsubscribeAll: Record<string, never>

    Fully unsubscribe from all contracts


    Required permissions: none

  • getProviderState: {
        output: {
            version: string;
            numericVersion: number;
            selectedConnection: string;
            networkId: number;
            supportedPermissions: UniqueArray<Permission[]>;
            permissions: Partial<Permissions<Addr>>;
            subscriptions: {
                [address: string]: ContractUpdatesSubscription;
            };
        };
    }

    Returns provider api state


    Required permissions: none

    • output: {
          version: string;
          numericVersion: number;
          selectedConnection: string;
          networkId: number;
          supportedPermissions: UniqueArray<Permission[]>;
          permissions: Partial<Permissions<Addr>>;
          subscriptions: {
              [address: string]: ContractUpdatesSubscription;
          };
      }
      • version: string

        Provider api version in semver format (x.y.z)

      • numericVersion: number

        Provider api version in uint32 format (xxxyyyzzz)

      • selectedConnection: string

        Selected connection group name (mainnet / testnet / etc.)

        Deprecated

        networkId should be used instead

      • networkId: number

        Numeric network id

      • supportedPermissions: UniqueArray<Permission[]>

        List of supported permissions

      • permissions: Partial<Permissions<Addr>>

        Object with active permissions attached data

      • subscriptions: {
            [address: string]: ContractUpdatesSubscription;
        }

        Current subscription states

  • getFullContractState: {
        input: {
            address: Addr;
        };
        output: {
            state: FullContractState | undefined;
        };
    }

    Requests contract data


    Required permissions: basic

    • input: {
          address: Addr;
      }
      • address: Addr

        Contract address

    • output: {
          state: FullContractState | undefined;
      }
      • state: FullContractState | undefined

        Contract state or undefined if it doesn't exist

  • computeStorageFee: {
        input: {
            state: FullContractState;
            masterchain?: boolean;
            timestamp?: number;
        };
        output: {
            storageFee: string;
            storageFeeDebt?: string;
            accountStatus: AccountStatus;
            freezeDueLimit: string;
            deleteDueLimit: string;
        };
    }

    Compute storage fee


    Required permissions: basic

    • input: {
          state: FullContractState;
          masterchain?: boolean;
          timestamp?: number;
      }
      • state: FullContractState

        Existing contract state

      • Optional masterchain?: boolean

        Whether to assume that the contract is in the masterchain. Default: false

      • Optional timestamp?: number

        Optional UNIX timestamp (in seconds) of the moment up to which the storage fee is calculated. Default: current timestamp

        NOTE: for a time that was earlier than the last state update, the last_paid time will be used.

    • output: {
          storageFee: string;
          storageFeeDebt?: string;
          accountStatus: AccountStatus;
          freezeDueLimit: string;
          deleteDueLimit: string;
      }
      • storageFee: string

        The total storage fee amount in nano EVER for the contract state up to the specified timestamp.

      • Optional storageFeeDebt?: string

        The minimum amount in nano EVER of debt that must be paid so that the contract is not frozen or deleted.

      • accountStatus: AccountStatus

        Account status after charging a storage fee

      • freezeDueLimit: string

        The amount of debt in nano EVER after which the contract will be frozen

      • deleteDueLimit: string

        The amount of debt in nano EVER after which the contract will be deleted

  • getAccountsByCodeHash: {
        input: {
            codeHash: string;
            continuation?: string;
            limit?: number;
        };
        output: {
            accounts: Addr[];
            continuation: string | undefined;
        };
    }

    Requests accounts with specified code hash


    Required permissions: basic

    • input: {
          codeHash: string;
          continuation?: string;
          limit?: number;
      }
      • codeHash: string

        Hex encoded code hash

      • Optional continuation?: string

        Last address from previous batch

      • Optional limit?: number

        Optional limit. Values grater than 50 have no effect

    • output: {
          accounts: Addr[];
          continuation: string | undefined;
      }
      • accounts: Addr[]

        List of account addresses

      • continuation: string | undefined

        Last address from this batch. Should be used as a continuation for further requests

  • getTransactions: {
        input: {
            address: Addr;
            continuation?: TransactionId;
            limit?: number;
        };
        output: {
            transactions: Transaction<Addr>[];
            continuation: TransactionId | undefined;
            info?: TransactionsBatchInfo;
        };
    }

    Requests contract transactions


    Required permissions: basic

    • input: {
          address: Addr;
          continuation?: TransactionId;
          limit?: number;
      }
      • address: Addr

        Contract address

      • Optional continuation?: TransactionId

        Id of the transaction from which to request the next batch

      • Optional limit?: number

        Optional limit. Values greater than 50 have no effect

    • output: {
          transactions: Transaction<Addr>[];
          continuation: TransactionId | undefined;
          info?: TransactionsBatchInfo;
      }
      • transactions: Transaction<Addr>[]

        Transactions list in descending order (from latest lt to the oldest)

      • continuation: TransactionId | undefined

        Previous transaction id of the last transaction in result. Can be used to continue transactions batch

      • Optional info?: TransactionsBatchInfo

        Describes transactions lt rage (none if empty transactions array)

  • getTransaction: {
        input: {
            hash: string;
        };
        output: {
            transaction: Transaction<Addr> | undefined;
        };
    }

    Fetches transaction by the exact hash


    Required permissions: basic

    • input: {
          hash: string;
      }
      • hash: string

        Hex encoded transaction hash

    • output: {
          transaction: Transaction<Addr> | undefined;
      }
      • transaction: Transaction<Addr> | undefined

        Transaction

  • findTransaction: {
        input: {
            inMessageHash?: string;
        };
        output: {
            transaction: Transaction<Addr> | undefined;
        };
    }

    Searches transaction by filters

    NOTE: at least one filter must be specified


    Required permissions: basic

    • input: {
          inMessageHash?: string;
      }
      • Optional inMessageHash?: string

        Hex encoded incoming message hash

    • output: {
          transaction: Transaction<Addr> | undefined;
      }
      • transaction: Transaction<Addr> | undefined

        Transaction

  • runLocal: {
        input: {
            address: Addr;
            cachedState?: FullContractState;
            responsible?: boolean;
            functionCall: FunctionCall<Addr>;
            withSignatureId?: boolean | number;
        };
        output: {
            output: TokensObject<Addr> | undefined;
            code: number;
        };
    }

    Executes only a compute phase locally


    Required permissions: basic

    • input: {
          address: Addr;
          cachedState?: FullContractState;
          responsible?: boolean;
          functionCall: FunctionCall<Addr>;
          withSignatureId?: boolean | number;
      }
      • address: Addr

        Contract address

      • Optional cachedState?: FullContractState

        Cached contract state

      • Optional responsible?: boolean

        Whether to run the method locally as responsible.

        This will use internal message with unlimited account balance.

      • functionCall: FunctionCall<Addr>

        Function call params

      • Optional withSignatureId?: boolean | number

        Whether to use the signature id during signature verification (true by default).

        • If true, uses the signature id of the selected network (if the capability is enabled).
        • If false, forces signature check to ignore any signature id.
        • If number, uses the specified number as a signature id.
    • output: {
          output: TokensObject<Addr> | undefined;
          code: number;
      }
      • output: TokensObject<Addr> | undefined

        Execution output

      • code: number

        TVM execution code

  • executeLocal: {
        input: {
            address: Addr;
            cachedState?: FullContractState;
            stateInit?: string;
            payload?: string | FunctionCall<Addr>;
            messageHeader: {
                type: "external";
                publicKey: string;
                withoutSignature?: boolean;
            } | {
                type: "internal";
                sender: Addr;
                amount: string;
                bounce: boolean;
                bounced?: boolean;
            };
            executorParams?: {
                disableSignatureCheck?: boolean;
                overrideBalance?: string | number;
            };
        };
        output: {
            transaction: Transaction<Addr>;
            newState: FullContractState | undefined;
            output: TokensObject<Addr> | undefined;
        };
    }

    Executes all transaction phases locally, producing a new state


    Required permissions: basic

    • input: {
          address: Addr;
          cachedState?: FullContractState;
          stateInit?: string;
          payload?: string | FunctionCall<Addr>;
          messageHeader: {
              type: "external";
              publicKey: string;
              withoutSignature?: boolean;
          } | {
              type: "internal";
              sender: Addr;
              amount: string;
              bounce: boolean;
              bounced?: boolean;
          };
          executorParams?: {
              disableSignatureCheck?: boolean;
              overrideBalance?: string | number;
          };
      }
      • address: Addr

        Contract address

      • Optional cachedState?: FullContractState

        Cached contract state

      • Optional stateInit?: string

        Optional base64 encoded .tvc file

      • Optional payload?: string | FunctionCall<Addr>

        Function call

      • messageHeader: {
            type: "external";
            publicKey: string;
            withoutSignature?: boolean;
        } | {
            type: "internal";
            sender: Addr;
            amount: string;
            bounce: boolean;
            bounced?: boolean;
        }

        Message header

      • Optional executorParams?: {
            disableSignatureCheck?: boolean;
            overrideBalance?: string | number;
        }

        Optional executor parameters used during local contract execution

        • Optional disableSignatureCheck?: boolean

          If true, signature verification always succeeds

        • Optional overrideBalance?: string | number

          Explicit account balance in nano EVER

    • output: {
          transaction: Transaction<Addr>;
          newState: FullContractState | undefined;
          output: TokensObject<Addr> | undefined;
      }
      • transaction: Transaction<Addr>

        Executed transaction

      • newState: FullContractState | undefined

        Contract state after the executed transaction

      • output: TokensObject<Addr> | undefined

        Parsed function call output

  • getExpectedAddress: {
        input: {
            tvc: string;
            abi: string;
            workchain?: number;
            publicKey?: string;
            initParams: TokensObject<Addr>;
        };
        output: {
            address: Addr;
            stateInit: string;
            hash: string;
        };
    }

    Calculates contract address from code and init params


    Required permissions: basic

    • input: {
          tvc: string;
          abi: string;
          workchain?: number;
          publicKey?: string;
          initParams: TokensObject<Addr>;
      }
      • tvc: string

        Base64 encoded TVC file

      • abi: string

        Contract ABI

      • Optional workchain?: number

        Contract workchain. 0 by default

      • Optional publicKey?: string

        Public key, which will be injected into the contract. 0 by default

      • initParams: TokensObject<Addr>

        State init params

    • output: {
          address: Addr;
          stateInit: string;
          hash: string;
      }
      • address: Addr

        Contract address

      • stateInit: string

        Base64 encoded state init

      • hash: string

        Hex encoded state init hash

  • getContractFields: {
        input: {
            address: Addr;
            abi: string;
            cachedState?: FullContractState;
            allowPartial: boolean;
        };
        output: {
            fields?: TokensObject<Addr>;
            state: FullContractState | undefined;
        };
    }

    Unpacks all fields from the contract state using the specified ABI


    Required permissions: basic

    • input: {
          address: Addr;
          abi: string;
          cachedState?: FullContractState;
          allowPartial: boolean;
      }
      • address: Addr

        Contract address

      • abi: string

        Contract ABI

      • Optional cachedState?: FullContractState

        Cached contract state

      • allowPartial: boolean

        Don't fail if something is left in a cell after unpacking

    • output: {
          fields?: TokensObject<Addr>;
          state: FullContractState | undefined;
      }
      • Optional fields?: TokensObject<Addr>

        Parsed contracts fields

      • state: FullContractState | undefined

        Contract state or undefined if it doesn't exist

  • unpackInitData: {
        input: {
            abi: string;
            data: string;
        };
        output: {
            publicKey: string | undefined;
            initParams: TokensObject<Addr>;
        };
    }

    Decodes initial contract data using the specified ABI


    Required permissions: basic

    • input: {
          abi: string;
          data: string;
      }
      • abi: string

        Contract ABI

      • data: string

        Base64 encoded init data BOC.

    • output: {
          publicKey: string | undefined;
          initParams: TokensObject<Addr>;
      }
      • publicKey: string | undefined

        Optional hex encoded public key

      • initParams: TokensObject<Addr>

        State init params

  • getBocHash: {
        input: {
            boc: string;
        };
        output: {
            hash: string;
        };
    }

    Computes hash of base64 encoded BOC


    Required permissions: basic

    • input: {
          boc: string;
      }
      • boc: string

        Base64 encoded cell BOC

    • output: {
          hash: string;
      }
      • hash: string

        Hex encoded cell hash

  • packIntoCell: {
        input: {
            abiVersion?: AbiVersion;
            structure: AbiParam[];
            data: TokensObject<Addr>;
        };
        output: {
            boc: string;
            hash: string;
        };
    }

    Creates base64 encoded BOC


    Required permissions: basic

    • input: {
          abiVersion?: AbiVersion;
          structure: AbiParam[];
          data: TokensObject<Addr>;
      }
      • Optional abiVersion?: AbiVersion

        ABI version. 2.2 if not specified otherwise

      • structure: AbiParam[]

        Cell structure

      • data: TokensObject<Addr>

        Cell data

    • output: {
          boc: string;
          hash: string;
      }
      • boc: string

        Base64 encoded cell BOC

      • hash: string

        Hex encoded cell hash

  • unpackFromCell: {
        input: {
            abiVersion?: AbiVersion;
            structure: AbiParam[];
            boc: string;
            allowPartial: boolean;
        };
        output: {
            data: TokensObject<Addr>;
        };
    }

    Decodes base64 encoded BOC


    Required permissions: basic

    • input: {
          abiVersion?: AbiVersion;
          structure: AbiParam[];
          boc: string;
          allowPartial: boolean;
      }
      • Optional abiVersion?: AbiVersion

        ABI version. 2.2 if not specified otherwise

      • structure: AbiParam[]

        Cell structure

      • boc: string

        Base64 encoded cell BOC

      • allowPartial: boolean

        Don't fail if something is left in a cell after unpacking

    • output: {
          data: TokensObject<Addr>;
      }
  • extractPublicKey: {
        input: {
            boc: string;
        };
        output: {
            publicKey: string;
        };
    }

    Extracts public key from raw account state

    NOTE: can only be used on contracts which are deployed and has pubkey header


    Required permissions: basic

    • input: {
          boc: string;
      }
      • boc: string

        Base64 encoded account state

        See

        FullContractState

    • output: {
          publicKey: string;
      }
      • publicKey: string

        Hex encoded public key

  • codeToTvc: {
        input: {
            code: string;
        };
        output: {
            tvc: string;
            hash: string;
        };
    }

    Converts base64 encoded contract code into tvc with default init data


    Required permissions: basic

    • input: {
          code: string;
      }
      • code: string

        Base64 encoded contract code

    • output: {
          tvc: string;
          hash: string;
      }
      • tvc: string

        Base64 encoded state init

      • hash: string

        Hex encoded cell hash

  • mergeTvc: {
        input: {
            code: string;
            data: string;
        };
        output: {
            tvc: string;
            hash: string;
        };
    }

    Merges base64 encoded contract code and state into a tvc


    Required permissions: basic

    • input: {
          code: string;
          data: string;
      }
      • code: string

        Base64 encoded contract code

      • data: string

        Base64 encoded contract data

    • output: {
          tvc: string;
          hash: string;
      }
      • tvc: string

        Base64 encoded state init

      • hash: string

        Hex encoded cell hash

  • splitTvc: {
        input: {
            tvc: string;
        };
        output: {
            data: string | undefined;
            code: string | undefined;
        };
    }

    Splits base64 encoded state init into code and data


    Required permissions: basic

    • input: {
          tvc: string;
      }
      • tvc: string

        Base64 encoded state init

    • output: {
          data: string | undefined;
          code: string | undefined;
      }
      • data: string | undefined

        Base64 encoded init data

      • code: string | undefined

        Base64 encoded contract code

  • setCodeSalt: {
        input: {
            code: string;
            salt: string;
        };
        output: {
            code: string;
            hash: string;
        };
    }

    Inserts salt into code


    Required permissions: basic

    • input: {
          code: string;
          salt: string;
      }
      • code: string

        Base64 encoded contract code

      • salt: string

        Base64 encoded salt (as BOC)

    • output: {
          code: string;
          hash: string;
      }
      • code: string

        Base64 encoded contract code with salt

      • hash: string

        Hex encoded cell hash

  • getCodeSalt: {
        input: {
            code: string;
        };
        output: {
            salt: string | undefined;
        };
    }

    Retrieves salt from code. Returns undefined if code doesn't contain salt


    Required permissions: basic

    • input: {
          code: string;
      }
      • code: string

        Base64 encoded contract code

    • output: {
          salt: string | undefined;
      }
      • salt: string | undefined

        Base64 encoded salt (as BOC)

  • encodeInternalInput: {
        input: FunctionCall<Addr>;
        output: {
            boc: string;
        };
    }

    Creates internal message body


    Required permissions: basic

    • input: FunctionCall<Addr>
    • output: {
          boc: string;
      }
      • boc: string

        Base64 encoded message body BOC

  • decodeInput: {
        input: {
            body: string;
            abi: string;
            method: string | string[];
            internal: boolean;
        };
        output: {
            method: string;
            input: TokensObject<Addr>;
        } | null;
    }

    Decodes body of incoming message


    Required permissions: basic

    • input: {
          body: string;
          abi: string;
          method: string | string[];
          internal: boolean;
      }
      • body: string

        Base64 encoded message body BOC

      • abi: string

        Contract ABI

      • method: string | string[]

        Specific method from specified contract ABI. When an array of method names is passed it will try to decode until first successful

        Note! If method param was provided as string, it will assume that message body contains specified function and this method will either return output or throw an exception. If you just want to try to decode specified method, use ['method'], in that case it will return null if message body doesn't contain requested method.

      • internal: boolean

        Function call type

    • output: {
          method: string;
          input: TokensObject<Addr>;
      } | null
  • decodeOutput: {
        input: {
            body: string;
            abi: string;
            method: string | string[];
        };
        output: {
            method: string;
            output: TokensObject<Addr>;
        } | null;
    }

    Decodes body of outgoing message


    Required permissions: basic

    • input: {
          body: string;
          abi: string;
          method: string | string[];
      }
      • body: string

        Base64 encoded message body BOC

      • abi: string

        Contract ABI

      • method: string | string[]

        Specific method from specified contract ABI. When an array of method names is passed it will try to decode until first successful

        Note! If method param was provided as string, it will assume that message body contains specified function and this method will either return output or throw an exception. If you just want to try to decode specified method, use ['method'], in that case it will return null if message body doesn't contain requested method.

    • output: {
          method: string;
          output: TokensObject<Addr>;
      } | null
  • decodeEvent: {
        input: {
            body: string;
            abi: string;
            event: string | string[];
        };
        output: {
            event: string;
            data: TokensObject<Addr>;
        } | null;
    }

    Decodes body of event message


    Required permissions: basic

    • input: {
          body: string;
          abi: string;
          event: string | string[];
      }
      • body: string

        Base64 encoded message body BOC

      • abi: string

        Contract ABI

      • event: string | string[]

        Specific event from specified contract ABI. When an array of event names is passed it will try to decode until first successful

        Note! If event param was provided as string, it will assume that message body contains specified event and this method will either return output or throw an exception. If you just want to try to decode specified event, use ['event'], in that case it will return null if message body doesn't contain requested event.

    • output: {
          event: string;
          data: TokensObject<Addr>;
      } | null
  • decodeTransaction: {
        input: {
            transaction: Transaction<Addr>;
            abi: string;
            method: string | string[];
        };
        output: {
            method: string;
            input: TokensObject<Addr>;
            output: TokensObject<Addr>;
        } | null;
    }

    Decodes function call


    Required permissions: basic

    • input: {
          transaction: Transaction<Addr>;
          abi: string;
          method: string | string[];
      }
      • transaction: Transaction<Addr>

        Transaction with the function call

      • abi: string

        Contract ABI

      • method: string | string[]

        Specific method from specified contract ABI. When an array of method names is passed it will try to decode until first successful.

        Note! If method param was provided as string, it will assume that transaction contains specified call and this method will either return output or throw an exception. If you just want to try to decode specified method, use ['method'], in that case it will return null if transaction doesn't contain requested method.

    • output: {
          method: string;
          input: TokensObject<Addr>;
          output: TokensObject<Addr>;
      } | null
  • decodeTransactionEvents: {
        input: {
            transaction: Transaction<Addr>;
            abi: string;
        };
        output: {
            events: {
                event: string;
                data: TokensObject<Addr>;
            }[];
        };
    }

    Decodes transaction events


    Required permissions: basic

    • input: {
          transaction: Transaction<Addr>;
          abi: string;
      }
      • transaction: Transaction<Addr>

        Transaction with the function call

      • abi: string

        Contract ABI

    • output: {
          events: {
              event: string;
              data: TokensObject<Addr>;
          }[];
      }
      • events: {
            event: string;
            data: TokensObject<Addr>;
        }[]

        Successfully decoded events

  • verifySignature: {
        input: {
            publicKey: string;
            dataHash: string;
            signature: string;
            withSignatureId?: boolean | number;
        };
        output: {
            isValid: boolean;
        };
    }

    Checks if a specific data hash was signed with the specified key


    Requires permissions: basic

    • input: {
          publicKey: string;
          dataHash: string;
          signature: string;
          withSignatureId?: boolean | number;
      }
      • publicKey: string

        The public key of the preferred account. It is the same publicKey as the accountInteraction.publicKey, but it must be explicitly provided

      • dataHash: string

        Base64 or hex encoded arbitrary bytes hash (data must be 32 bytes long)

      • signature: string

        Base64 or hex encoded signature bytes (data must be 64 bytes long)

      • Optional withSignatureId?: boolean | number

        Whether to use the signature id during verification (true by default).

        • If true, uses the signature id of the selected network (if the capability is enabled).
        • If false, forces signature check to ignore any signature id.
        • If number, uses the specified number as a signature id.
    • output: {
          isValid: boolean;
      }
      • isValid: boolean

        Returns true if message was signed with this key

  • sendUnsignedExternalMessage: {
        input: {
            recipient: Addr;
            stateInit?: string;
            payload?: string | FunctionCall<Addr>;
            local?: boolean;
            executorParams?: {
                disableSignatureCheck?: boolean;
                overrideBalance?: string | number;
            };
        };
        output: {
            transaction: Transaction<Addr>;
            output: TokensObject<Addr> | undefined;
        };
    }

    Sends an unsigned external message to the contract


    Required permissions: basic

    • input: {
          recipient: Addr;
          stateInit?: string;
          payload?: string | FunctionCall<Addr>;
          local?: boolean;
          executorParams?: {
              disableSignatureCheck?: boolean;
              overrideBalance?: string | number;
          };
      }
      • recipient: Addr

        Message destination address

      • Optional stateInit?: string

        Optional base64 encoded .tvc file

      • Optional payload?: string | FunctionCall<Addr>

        Function call

      • Optional local?: boolean

        Whether to only run it locally (false by default) Can be used as alternative runLocal method

      • Optional executorParams?: {
            disableSignatureCheck?: boolean;
            overrideBalance?: string | number;
        }

        Optional executor parameters used during local contract execution

        • Optional disableSignatureCheck?: boolean

          If true, signature verification always succeds

        • Optional overrideBalance?: string | number

          Explicit account balance in nano EVER

    • output: {
          transaction: Transaction<Addr>;
          output: TokensObject<Addr> | undefined;
      }
      • transaction: Transaction<Addr>

        Executed transaction

      • output: TokensObject<Addr> | undefined

        Parsed function call output

  • addAsset: {
        input: {
            account: Addr;
            type: AssetType;
            params: AssetTypeParams<AssetType, Addr>;
        };
        output: {
            newAsset: boolean;
        };
    }

    Adds asset to the selected account


    Requires permissions: accountInteraction

    • input: {
          account: Addr;
          type: AssetType;
          params: AssetTypeParams<AssetType, Addr>;
      }
      • account: Addr

        Owner's wallet address. It is the same address as the accountInteraction.address, but it must be explicitly provided

      • type: AssetType

        Which asset to add

      • params: AssetTypeParams<AssetType, Addr>

        Asset parameters

    • output: {
          newAsset: boolean;
      }
      • newAsset: boolean

        Returns true if the account did not have this asset before

  • signData: {
        input: {
            publicKey: string;
            data: string;
            withSignatureId?: boolean | number;
        };
        output: {
            dataHash: string;
            signature: string;
            signatureHex: string;
            signatureParts: {
                high: string;
                low: string;
            };
        };
    }

    Signs arbitrary data.

    NOTE: hashes data before signing. Use signDataRaw to sign without hash.


    Requires permissions: accountInteraction

    • input: {
          publicKey: string;
          data: string;
          withSignatureId?: boolean | number;
      }
      • publicKey: string

        The public key of the preferred account. It is the same publicKey as the accountInteraction.publicKey, but it must be explicitly provided

      • data: string

        Base64 encoded arbitrary bytes

      • Optional withSignatureId?: boolean | number

        Whether to use the signature id for signing (true by default).

        • If true, uses the signature id of the selected network (if the capability is enabled).
        • If false, forces signature check to ignore any signature id.
        • If number, uses the specified number as a signature id.
    • output: {
          dataHash: string;
          signature: string;
          signatureHex: string;
          signatureParts: {
              high: string;
              low: string;
          };
      }
      • dataHash: string

        Hex encoded data hash

      • signature: string

        Base64 encoded signature bytes (data is guaranteed to be 64 bytes long)

      • signatureHex: string

        Hex encoded signature bytes (data is guaranteed to be 64 bytes long)

      • signatureParts: {
            high: string;
            low: string;
        }

        Same signature, but split into two uint256 parts

        • high: string

          High 32 bytes of the signature as uint256

        • low: string

          Low 32 bytes of the signature as uint256

  • signDataRaw: {
        input: {
            publicKey: string;
            data: string;
            withSignatureId?: boolean | number;
        };
        output: {
            signature: string;
            signatureHex: string;
            signatureParts: {
                high: string;
                low: string;
            };
        };
    }

    Signs arbitrary data without hashing it


    Requires permissions: accountInteraction

    • input: {
          publicKey: string;
          data: string;
          withSignatureId?: boolean | number;
      }
      • publicKey: string

        The public key of the preferred account. It is the same publicKey as the accountInteraction.publicKey, but it must be explicitly provided

      • data: string

        Base64 encoded arbitrary bytes

      • Optional withSignatureId?: boolean | number

        Whether to use the signature id for signing (true by default).

        • If true, uses the signature id of the selected network (if the capability is enabled).
        • If false, forces signature check to ignore any signature id.
        • If number, uses the specified number as a signature id.
    • output: {
          signature: string;
          signatureHex: string;
          signatureParts: {
              high: string;
              low: string;
          };
      }
      • signature: string

        Base64 encoded signature bytes (data is guaranteed to be 64 bytes long)

      • signatureHex: string

        Hex encoded signature bytes (data is guaranteed to be 64 bytes long)

      • signatureParts: {
            high: string;
            low: string;
        }

        Same signature, but split into two uint256 parts

        • high: string

          High 32 bytes of the signature as uint256

        • low: string

          Low 32 bytes of the signature as uint256

  • encryptData: {
        input: {
            publicKey: string;
            recipientPublicKeys: string[];
            algorithm: EncryptionAlgorithm;
            data: string;
        };
        output: {
            encryptedData: EncryptedData[];
        };
    }

    Encrypts arbitrary data with specified algorithm for each specified recipient


    Requires permissions: accountInteraction

    • input: {
          publicKey: string;
          recipientPublicKeys: string[];
          algorithm: EncryptionAlgorithm;
          data: string;
      }
      • publicKey: string

        The public key of the preferred account. It is the same publicKey as the accountInteraction.publicKey, but it must be explicitly provided

      • recipientPublicKeys: string[]

        Public keys of recipients. Hex encoded

      • algorithm: EncryptionAlgorithm

        Encryption algorithm. Nonce will be generated for each recipient

      • data: string

        Base64 encoded data

    • output: {
          encryptedData: EncryptedData[];
      }
      • encryptedData: EncryptedData[]

        Encrypted data for each recipient public key

  • decryptData: {
        input: {
            encryptedData: EncryptedData;
        };
        output: {
            data: string;
        };
    }

    Decrypts encrypted data


    Requires permissions: accountInteraction

    • input: {
          encryptedData: EncryptedData;
      }
      • encryptedData: EncryptedData

        Encrypted data. The recipient's public key must match the public key of the current account.

    • output: {
          data: string;
      }
      • data: string

        Base64 encoded decrypted data

  • estimateFees: {
        input: {
            sender: Addr;
            recipient: Addr;
            amount: string;
            payload?: FunctionCall<Addr>;
            stateInit?: string;
        };
        output: {
            fees: string;
        };
    }

    Calculates transaction fees


    Required permissions: accountInteraction

    • input: {
          sender: Addr;
          recipient: Addr;
          amount: string;
          payload?: FunctionCall<Addr>;
          stateInit?: string;
      }
      • sender: Addr

        This wallet will be used to send the message. It is the same address as the accountInteraction.address, but it must be explicitly provided

      • recipient: Addr

        Message destination address

      • amount: string

        Amount of nano EVER to send

      • Optional payload?: FunctionCall<Addr>

        Optional function call

      • Optional stateInit?: string

        Optional base64 encoded TVC

        NOTE: If the selected contract do not support this, an error is returned

    • output: {
          fees: string;
      }
      • fees: string

        Fees in nano EVER

  • sendMessage: {
        input: {
            sender: Addr;
            recipient: Addr;
            amount: string;
            bounce: boolean;
            payload?: FunctionCall<Addr>;
            stateInit?: string;
        };
        output: {
            transaction: Transaction<Addr>;
        };
    }

    Sends an internal message from the user account. Shows an approval window to the user.


    Required permissions: accountInteraction

    • input: {
          sender: Addr;
          recipient: Addr;
          amount: string;
          bounce: boolean;
          payload?: FunctionCall<Addr>;
          stateInit?: string;
      }
      • sender: Addr

        Preferred wallet address. It is the same address as the accountInteraction.address, but it must be explicitly provided

      • recipient: Addr

        Message destination address

      • amount: string

        Amount of nano EVER to send

      • bounce: boolean

        Whether to bounce message back on error

      • Optional payload?: FunctionCall<Addr>

        Optional function call

      • Optional stateInit?: string

        Optional base64 encoded TVC

        NOTE: If the selected contract do not support this, an error is returned

    • output: {
          transaction: Transaction<Addr>;
      }
  • sendMessageDelayed: {
        input: {
            sender: Addr;
            recipient: Addr;
            amount: string;
            bounce: boolean;
            payload?: FunctionCall<Addr>;
            stateInit?: string;
        };
        output: {
            message: DelayedMessage<Addr>;
        };
    }

    Sends an internal message from the user account without waiting for the transaction. Shows an approval window to the user.

    See

    messageStatusUpdated


    Required permissions: accountInteraction

    • input: {
          sender: Addr;
          recipient: Addr;
          amount: string;
          bounce: boolean;
          payload?: FunctionCall<Addr>;
          stateInit?: string;
      }
      • sender: Addr

        Preferred wallet address. It is the same address as the accountInteraction.address, but it must be explicitly provided

      • recipient: Addr

        Message destination address

      • amount: string

        Amount of nano EVER to send

      • bounce: boolean

        Whether to bounce message back on error

      • Optional payload?: FunctionCall<Addr>

        Optional function call

      • Optional stateInit?: string

        Optional base64 encoded TVC

        NOTE: If the selected contract do not support this, an error is returned

    • output: {
          message: DelayedMessage<Addr>;
      }
  • sendExternalMessage: {
        input: {
            publicKey: string;
            recipient: Addr;
            stateInit?: string;
            payload: FunctionCall<Addr>;
            local?: boolean;
            executorParams?: {
                disableSignatureCheck?: boolean;
                overrideBalance?: string | number;
            };
        };
        output: {
            transaction: Transaction<Addr>;
            output: TokensObject<Addr> | undefined;
        };
    }

    Sends an external message to the contract Shows and approval window to the user


    Required permissions: accountInteraction

    • input: {
          publicKey: string;
          recipient: Addr;
          stateInit?: string;
          payload: FunctionCall<Addr>;
          local?: boolean;
          executorParams?: {
              disableSignatureCheck?: boolean;
              overrideBalance?: string | number;
          };
      }
      • publicKey: string

        The public key of the preferred account. It is the same publicKey as the accountInteraction.publicKey, but it must be explicitly provided

      • recipient: Addr

        Message destination address

      • Optional stateInit?: string

        Optional base64 encoded .tvc file

      • payload: FunctionCall<Addr>

        Function call

      • Optional local?: boolean

        Whether to only run it locally (false by default) Can be used as alternative runLocal method but with user signature

      • Optional executorParams?: {
            disableSignatureCheck?: boolean;
            overrideBalance?: string | number;
        }

        Optional executor parameters used during local contract execution

        • Optional disableSignatureCheck?: boolean

          If true, signature verification always succeds

        • Optional overrideBalance?: string | number

          Explicit account balance in nano EVER

    • output: {
          transaction: Transaction<Addr>;
          output: TokensObject<Addr> | undefined;
      }
      • transaction: Transaction<Addr>

        Executed transaction

      • output: TokensObject<Addr> | undefined

        Parsed function call output

  • sendExternalMessageDelayed: {
        input: {
            publicKey: string;
            recipient: Addr;
            stateInit?: string;
            payload: FunctionCall<Addr>;
        };
        output: {
            message: DelayedMessage<Addr>;
        };
    }

    Sends an external message to the contract without waiting for the transaction. Shows and approval window to the user

    See

    messageStatusUpdated


    Required permissions: accountInteraction

    • input: {
          publicKey: string;
          recipient: Addr;
          stateInit?: string;
          payload: FunctionCall<Addr>;
      }
      • publicKey: string

        The public key of the preferred account. It is the same publicKey as the accountInteraction.publicKey, but it must be explicitly provided

      • recipient: Addr

        Message destination address

      • Optional stateInit?: string

        Optional base64 encoded .tvc file

      • payload: FunctionCall<Addr>

        Function call

    • output: {
          message: DelayedMessage<Addr>;
      }