import { AbiVersion, AbiParam, AccountStatus, AssetType, AssetTypeParams, ContractState, ContractUpdatesSubscription, EncryptedData, EncryptionAlgorithm, FullContractState, Transaction, TransactionId, TransactionsBatchInfo, Permissions, Permission, FunctionCall, TokensObject, DelayedMessage, Network, AddNetwork, IgnoreTransactionTreeSimulationError, GetterCall, SignatureContext, } from './models'; import { UniqueArray, Address } from './utils'; /** * @category Provider Api */ export type ProviderEvents = { /** * Called when inpage provider connects to the extension */ connected: Record; /** * Called when inpage provider disconnects from extension */ disconnected: Error; /** * Called on each new transactions batch, received on subscription */ transactionsFound: { /** * Contract address */ address: Addr; /** * Guaranteed to be non-empty and ordered by descending lt */ transactions: Transaction[]; /** * Describes transactions lt rage */ info: TransactionsBatchInfo; }; /** * Called every time contract state changes */ contractStateChanged: { /** * Contract address */ address: Addr; /** * New contract state */ state: ContractState; }; /** * Called every time a delayed message was delivered or expired */ messageStatusUpdated: { /** * Account address */ address: Addr; /** * Message hash */ hash: string; /** * If not null, the transaction of the delivered message. Otherwise, the message has expired. */ transaction?: Transaction; }; /** * Called each time the user changes network */ networkChanged: { /** * Network group name * * @deprecated `networkId` should be used instead */ selectedConnection: string; /** * Numeric network id */ networkId: number; }; /** * Called when permissions are changed. * Mostly when account has been removed from the current `accountInteraction` permission, * or disconnect method was called */ permissionsChanged: { permissions: Partial>; }; /** * Called when the user logs out of the extension */ loggedOut: Record; }; /** * @category Provider Api */ export type ProviderApi = { /** * Requests new permissions for current origin. * Shows an approval window to the user. * Will overwrite already existing permissions * * --- * Required permissions: none */ requestPermissions: { input: { permissions: UniqueArray; }; output: Partial>; }; /** * Updates `accountInteraction` permission value * * --- * Requires permissions: `accountInteraction` */ changeAccount: { output: Partial>; }; /** * Removes all permissions for current origin and stops all subscriptions * * --- * Required permissions: none */ disconnect: Record; /** * Subscribes to contract updates. * Can also be used to update subscriptions * * --- * Required permissions: `basic` */ subscribe: { input: { /** * Contract address */ address: Addr; /** * Subscription changes */ subscriptions: Partial; }; output: ContractUpdatesSubscription; }; /** * Fully unsubscribe from specific contract updates * * --- * Required permissions: none */ unsubscribe: { input: { /** * Contract address */ address: Addr; }; }; /** * Fully unsubscribe from all contracts * * --- * Required permissions: none */ unsubscribeAll: Record; /** * Returns provider api state * * --- * Required permissions: none */ getProviderState: { output: { /** * Provider api version in semver format (x.y.z) */ version: string; /** * Provider api version in uint32 format (xxxyyyzzz) */ numericVersion: number; /** * Selected connection group name (`mainnet` / `testnet` / etc.) * * @deprecated `networkId` should be used instead */ selectedConnection: string; /** * Numeric network id */ networkId: number; /** * List of supported permissions */ supportedPermissions: UniqueArray; /** * Object with active permissions attached data */ permissions: Partial>; /** * Current subscription states */ subscriptions: { [address: string]: ContractUpdatesSubscription; }; }; }; /** * Requests contract data * * --- * Required permissions: `basic` */ getFullContractState: { input: { /** * Contract address */ address: Addr; }; output: { /** * Contract state or `undefined` if it doesn't exist */ state: FullContractState | undefined; }; }; /** * Compute storage fee * * --- * Required permissions: `basic` */ computeStorageFee: { input: { /** * Existing contract state */ state: FullContractState; /** * Whether to assume that the contract is in the masterchain. Default: false */ masterchain?: boolean; /** * 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. */ timestamp?: number; }; output: { /** * The total storage fee amount in nano EVER for the contract state up to the specified timestamp. */ storageFee: string; /** * The minimum amount in nano EVER of debt that must be paid so that the contract is not frozen * or deleted. */ storageFeeDebt?: string; /** * Account status after charging a storage fee */ accountStatus: AccountStatus; /** * The amount of debt in nano EVER after which the contract will be frozen */ freezeDueLimit: string; /** * The amount of debt in nano EVER after which the contract will be deleted */ deleteDueLimit: string; }; }; /** * Requests accounts with specified code hash * * --- * Required permissions: `basic` */ getAccountsByCodeHash: { input: { /** * Hex encoded code hash */ codeHash: string; /** * Last address from previous batch */ continuation?: string; /** * Optional limit. Values grater than 50 have no effect */ limit?: number; }; output: { /** * List of account addresses */ accounts: Addr[]; /** * Last address from this batch. Should be used as a `continuation` for further requests */ continuation: string | undefined; }; }; /** * Requests contract transactions * * --- * Required permissions: `basic` */ getTransactions: { input: { /** * Contract address */ address: Addr; /** * Id of the transaction from which to request the next batch */ continuation?: TransactionId; /** * Optional limit. Values greater than 50 have no effect */ limit?: number; }; output: { /** * Transactions list in descending order (from latest lt to the oldest) */ transactions: Transaction[]; /** * Previous transaction id of the last transaction in result. Can be used to continue transactions batch */ continuation: TransactionId | undefined; /** * Describes transactions lt rage (none if empty `transactions` array) */ info?: TransactionsBatchInfo; }; }; /** * Fetches transaction by the exact hash * * --- * Required permissions: `basic` */ getTransaction: { input: { /** * Hex encoded transaction hash */ hash: string; }; output: { /** * Transaction */ transaction: Transaction | undefined; }; }; /** * Searches transaction by filters * * NOTE: at least one filter must be specified * * --- * Required permissions: `basic` */ findTransaction: { input: { /** * Hex encoded incoming message hash */ inMessageHash?: string; /* TODO: add more filters */ }; output: { /** * Transaction */ transaction: Transaction | undefined; }; }; /** * Executes only a compute phase locally * * --- * Required permissions: `basic` */ runLocal: { input: { /** * Contract address */ address: Addr; /** * Cached contract state */ cachedState?: FullContractState; /** * Whether to run the method locally as responsible. * * This will use internal message with unlimited account balance. */ responsible?: boolean; /** * Function call params */ functionCall: FunctionCall; /** * 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. * @deprecated * Use `withSignatureContext` instead. */ withSignatureId?: boolean | number; /** * Optional advanced signature configuration. * * In most cases you **do not need to set this manually**. * The wallet or network configuration will choose the correct mode. * * This field controls how the data is prepared before signing: * * - `empty` — signs the data as-is. * Use for simple or legacy signing. * * - `signatureId` — signs the data together with a network-specific id. * Prevents signatures from being reused on another network. * * - `signatureDomainL2` — same as signature id but with a different prefix. * This should be used where the `SignatureDomain` capability is enabled. * * If provided, this field overrides `withSignatureId`. */ withSignatureContext?: SignatureContext; /** * Optional libraries map **/ libraries?: { [K: string]: string }; }; output: { /** * Execution output */ output: TokensObject | undefined; /** * TVM execution code */ code: number; }; }; /** * Executes all transaction phases locally, producing a new state * * --- * Required permissions: `basic` */ executeLocal: { input: { /** * Contract address */ address: Addr; /** * Cached contract state */ cachedState?: FullContractState; /** * Optional base64 encoded `.tvc` file */ stateInit?: string; /** * Function call */ payload?: string | FunctionCall; /** * Message header */ messageHeader: | { /** * External message header */ type: 'external'; /** * The public key of the signer. */ publicKey: string; /** * Whether to prepare this message without signature. Default: false */ withoutSignature?: boolean; } | { /** * Internal message header */ type: 'internal'; /** * Message source address */ sender: Addr; /** * Amount of nano EVER to attach to the message */ amount: string; /** * Whether to bounce message back on error */ bounce: boolean; /** * Whether the constructed message is bounced. Default: false */ bounced?: boolean; }; /** * Optional executor parameters used during local contract execution */ executorParams?: { /** * If `true`, signature verification always succeeds */ disableSignatureCheck?: boolean; /** * Explicit account balance in nano EVER */ overrideBalance?: string | number; }; }; output: { /** * Executed transaction */ transaction: Transaction; /** * Contract state after the executed transaction */ newState: FullContractState | undefined; /** * Parsed function call output */ output: TokensObject | undefined; }; }; /** * Calculates contract address from code and init params * * --- * Required permissions: `basic` */ getExpectedAddress: { input: { /** * Base64 encoded TVC file */ tvc: string; /** * Contract ABI */ abi: string; /** * Contract workchain. 0 by default */ workchain?: number; /** * Public key, which will be injected into the contract. 0 by default */ publicKey?: string; /** * State init params */ initParams: TokensObject; }; output: { /** * Contract address */ address: Addr; /** * Base64 encoded state init */ stateInit: string; /** * Hex encoded state init hash */ hash: string; }; }; /** * Unpacks all fields from the contract state using the specified ABI * * --- * Required permissions: `basic` */ getContractFields: { input: { /** * Contract address */ address: Addr; /** * Contract ABI */ abi: string; /** * Cached contract state */ cachedState?: FullContractState; /** * Don't fail if something is left in a cell after unpacking */ allowPartial: boolean; }; output: { /** * Parsed contracts fields */ fields?: TokensObject; /** * Contract state or `undefined` if it doesn't exist */ state: FullContractState | undefined; }; }; /** * Decodes initial contract data using the specified ABI * * --- * Required permissions: `basic` */ unpackInitData: { input: { /** * Contract ABI */ abi: string; /** * Base64 encoded init data BOC. */ data: string; }; output: { /** * Optional hex encoded public key */ publicKey: string | undefined; /** * State init params */ initParams: TokensObject; }; }; /** * Computes hash of base64 encoded BOC * * --- * Required permissions: `basic` */ getBocHash: { input: { /** * Base64 encoded cell BOC */ boc: string; }; output: { /** * Hex encoded cell hash */ hash: string; }; }; /** * Creates base64 encoded BOC * * --- * Required permissions: `basic` */ packIntoCell: { input: { /** * ABI version. 2.2 if not specified otherwise */ abiVersion?: AbiVersion; /** * Cell structure */ structure: AbiParam[]; /** * Cell data */ data: TokensObject; }; output: { /** * Base64 encoded cell BOC */ boc: string; /** * Hex encoded cell hash */ hash: string; }; }; /** * Decodes base64 encoded BOC * * --- * Required permissions: `basic` */ unpackFromCell: { input: { /** * ABI version. 2.2 if not specified otherwise */ abiVersion?: AbiVersion; /** * Cell structure */ structure: AbiParam[]; /** * Base64 encoded cell BOC */ boc: string; /** * Don't fail if something is left in a cell after unpacking */ allowPartial: boolean; }; output: { /** * Cell data */ data: TokensObject; }; }; /** * Extracts public key from raw account state * * **NOTE:** can only be used on contracts which are deployed and has `pubkey` header * * --- * Required permissions: `basic` */ extractPublicKey: { input: { /** * Base64 encoded account state * * @see FullContractState */ boc: string; }; output: { /** * Hex encoded public key */ publicKey: string; }; }; /** * Converts base64 encoded contract code into tvc with default init data * * --- * Required permissions: `basic` */ codeToTvc: { input: { /** * Base64 encoded contract code */ code: string; }; output: { /** * Base64 encoded state init */ tvc: string; /** * Hex encoded cell hash */ hash: string; }; }; /** * Merges base64 encoded contract code and state into a tvc * * --- * Required permissions: `basic` */ mergeTvc: { input: { /** * Base64 encoded contract code */ code: string; /** * Base64 encoded contract data */ data: string; }; output: { /** * Base64 encoded state init */ tvc: string; /** * Hex encoded cell hash */ hash: string; }; }; /** * Splits base64 encoded state init into code and data * * --- * Required permissions: `basic` */ splitTvc: { input: { /** * Base64 encoded state init */ tvc: string; }; output: { /** * Base64 encoded init data */ data: string | undefined; /** * Base64 encoded contract code */ code: string | undefined; }; }; /** * Inserts salt into code * * --- * Required permissions: `basic` */ setCodeSalt: { input: { /** * Base64 encoded contract code */ code: string; /** * Base64 encoded salt (as BOC) */ salt: string; }; output: { /** * Base64 encoded contract code with salt */ code: string; /** * Hex encoded cell hash */ hash: string; }; }; /** * Retrieves salt from code. Returns undefined if code doesn't contain salt * * --- * Required permissions: `basic` */ getCodeSalt: { input: { /** * Base64 encoded contract code */ code: string; }; output: { /** * Base64 encoded salt (as BOC) */ salt: string | undefined; }; }; /** * Creates internal message body * * --- * Required permissions: `basic` */ encodeInternalInput: { input: FunctionCall; output: { /** * Base64 encoded message body BOC */ boc: string; }; }; /** * Decodes body of incoming message * * --- * Required permissions: `basic` */ decodeInput: { input: { /** * Base64 encoded message body BOC */ body: string; /** * Contract ABI */ abi: 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. */ method: string | string[]; /** * Function call type */ internal: boolean; }; output: { /** * Decoded method name */ method: string; /** * Decoded function arguments */ input: TokensObject; } | null; }; /** * Decodes body of outgoing message * * --- * Required permissions: `basic` */ decodeOutput: { input: { /** * Base64 encoded message body BOC */ body: string; /** * Contract ABI */ abi: 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. */ method: string | string[]; }; output: { /** * Decoded method name */ method: string; /** * Decoded function returned value */ output: TokensObject; } | null; }; /** * Decodes body of event message * * --- * Required permissions: `basic` */ decodeEvent: { input: { /** * Base64 encoded message body BOC */ body: string; /** * Contract ABI */ abi: 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. */ event: string | string[]; }; output: { /** * Decoded event name */ event: string; /** * Decoded event data */ data: TokensObject; } | null; }; /** * Decodes function call * * --- * Required permissions: `basic` */ decodeTransaction: { input: { /** * Transaction with the function call */ transaction: Transaction; /** * Contract ABI */ abi: 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. */ method: string | string[]; }; output: { /** * Decoded method name */ method: string; /** * Decoded function arguments */ input: TokensObject; /** * Decoded function returned value */ output: TokensObject; } | null; }; /** * Decodes transaction events * * --- * Required permissions: `basic` */ decodeTransactionEvents: { input: { /** * Transaction with the function call */ transaction: Transaction; /** * Contract ABI */ abi: string; }; output: { /** * Successfully decoded events */ events: { event: string; data: TokensObject; }[]; }; }; /** * Checks if a specific data hash was signed with the specified key * * --- * Requires permissions: `basic` */ verifySignature: { input: { /** * The public key of the preferred account. * It is the same publicKey as the `accountInteraction.publicKey`, but it must be explicitly provided */ publicKey: string; /** * Base64 or hex encoded arbitrary bytes hash (data must be 32 bytes long) */ dataHash: string; /** * Base64 or hex encoded signature bytes (data must be 64 bytes long) */ signature: string; /** * 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. * @deprecated * Use `withSignatureContext` instead. */ withSignatureId?: boolean | number; /** * Optional advanced signature configuration. * * In most cases you **do not need to set this manually**. * The wallet or network configuration will choose the correct mode. * * This field controls how the data is prepared before signing: * * - `empty` — signs the data as-is. * Use for simple or legacy signing. * * - `signatureId` — signs the data together with a network-specific id. * Prevents signatures from being reused on another network. * * - `signatureDomainL2` — same as signature id but with a different prefix. * This should be used where the `SignatureDomain` capability is enabled. * * If provided, this field overrides `withSignatureId`. */ withSignatureContext?: SignatureContext; }; output: { /** * Returns true if message was signed with this key */ isValid: boolean; }; }; /** * Sends an unsigned external message to the contract * * --- * Required permissions: `basic` */ sendUnsignedExternalMessage: { input: { /** * Message destination address */ recipient: Addr; /** * Optional base64 encoded `.tvc` file */ stateInit?: string; /** * Function call */ payload?: string | FunctionCall; /** * Whether to only run it locally (false by default) * Can be used as alternative `runLocal` method */ local?: boolean; /** * Optional executor parameters used during local contract execution */ executorParams?: { /** * If `true`, signature verification always succeds */ disableSignatureCheck?: boolean; /** * Explicit account balance in nano EVER */ overrideBalance?: string | number; }; }; output: { /** * Executed transaction */ transaction: Transaction; /** * Parsed function call output */ output: TokensObject | undefined; }; }; /** * Adds asset to the selected account * * --- * Requires permissions: `accountInteraction` */ addAsset: { input: { /** * Owner's wallet address. * It is the same address as the `accountInteraction.address`, but it must be explicitly provided */ account: Addr; /** * Which asset to add */ type: AssetType; /** * Asset parameters */ params: AssetTypeParams; }; output: { /** * Returns true if the account did not have this asset before */ newAsset: boolean; }; }; /** * Signs arbitrary data. * * NOTE: hashes data before signing. Use `signDataRaw` to sign without hash. * * --- * Requires permissions: `accountInteraction` */ signData: { input: { /** * The public key of the preferred account. * It is the same publicKey as the `accountInteraction.publicKey`, but it must be explicitly provided */ publicKey: string; /** * Base64 encoded arbitrary bytes */ data: string; /** * 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. * @deprecated * Use `withSignatureContext` instead. */ withSignatureId?: boolean | number; /** * Optional advanced signature configuration. * * In most cases you **do not need to set this manually**. * The wallet or network configuration will choose the correct mode. * * This field controls how the data is prepared before signing: * * - `empty` — signs the data as-is. * Use for simple or legacy signing. * * - `signatureId` — signs the data together with a network-specific id. * Prevents signatures from being reused on another network. * * - `signatureDomainL2` — same as signature id but with a different prefix. * This should be used where the `SignatureDomain` capability is enabled. * * If provided, this field overrides `withSignatureId`. */ withSignatureContext?: SignatureContext; }; output: { /** * Hex encoded data hash */ dataHash: string; /** * Base64 encoded signature bytes (data is guaranteed to be 64 bytes long) */ signature: string; /** * Hex encoded signature bytes (data is guaranteed to be 64 bytes long) */ signatureHex: string; /** * Same signature, but split into two uint256 parts */ signatureParts: { /** * High 32 bytes of the signature as uint256 */ high: string; /** * Low 32 bytes of the signature as uint256 */ low: string; }; }; }; /** * Signs arbitrary data without hashing it * * --- * Requires permissions: `accountInteraction` */ signDataRaw: { input: { /** * The public key of the preferred account. * It is the same publicKey as the `accountInteraction.publicKey`, but it must be explicitly provided */ publicKey: string; /** * Base64 encoded arbitrary bytes */ data: string; /** * 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. * @deprecated * Use `withSignatureContext` instead. */ withSignatureId?: boolean | number; /** * Optional advanced signature configuration. * * In most cases you **do not need to set this manually**. * The wallet or network configuration will choose the correct mode. * * This field controls how the data is prepared before signing: * * - `empty` — signs the data as-is. * Use for simple or legacy signing. * * - `signatureId` — signs the data together with a network-specific id. * Prevents signatures from being reused on another network. * * - `signatureDomainL2` — same as signature id but with a different prefix. * This should be used where the `SignatureDomain` capability is enabled. * * If provided, this field overrides `withSignatureId`. */ withSignatureContext?: SignatureContext; }; output: { /** * Base64 encoded signature bytes (data is guaranteed to be 64 bytes long) */ signature: string; /** * Hex encoded signature bytes (data is guaranteed to be 64 bytes long) */ signatureHex: string; /** * Same signature, but split into two uint256 parts */ signatureParts: { /** * High 32 bytes of the signature as uint256 */ high: string; /** * Low 32 bytes of the signature as uint256 */ low: string; }; }; }; /** * Encrypts arbitrary data with specified algorithm for each specified recipient * * --- * Requires permissions: `accountInteraction` */ encryptData: { input: { /** * The public key of the preferred account. * It is the same publicKey as the `accountInteraction.publicKey`, but it must be explicitly provided */ publicKey: string; /** * Public keys of recipients. Hex encoded */ recipientPublicKeys: string[]; /** * Encryption algorithm. Nonce will be generated for each recipient */ algorithm: EncryptionAlgorithm; /** * Base64 encoded data */ data: string; }; output: { /** * Encrypted data for each recipient public key */ encryptedData: EncryptedData[]; }; }; /** * Decrypts encrypted data * * --- * Requires permissions: `accountInteraction` */ decryptData: { input: { /** * Encrypted data. The recipient's public key must match the public key of the current account. */ encryptedData: EncryptedData; }; output: { /** * Base64 encoded decrypted data */ data: string; }; }; /** * Calculates transaction fees * * --- * Required permissions: `accountInteraction` */ estimateFees: { input: { /** * This wallet will be used to send the message. * It is the same address as the `accountInteraction.address`, but it must be explicitly provided */ sender: Addr; /** * Message destination address */ recipient: Addr; /** * Amount of nano EVER to send */ amount: string; /** * Optional function call */ payload?: FunctionCall; /** * Optional base64 encoded TVC * * NOTE: If the selected contract do not support this, an error is returned */ stateInit?: string; }; output: { /** * Fees in nano EVER */ fees: string; }; }; /** * Sends an internal message from the user account. * Shows an approval window to the user. * * --- * Required permissions: `accountInteraction` */ sendMessage: { input: { /** * Preferred wallet address. * It is the same address as the `accountInteraction.address`, but it must be explicitly provided */ sender: Addr; /** * Message destination address */ recipient: Addr; /** * Amount of nano EVER to send */ amount: string; /** * Whether to bounce message back on error */ bounce: boolean; /** * Optional function call */ payload?: FunctionCall; /** * Optional base64 encoded TVC * * NOTE: If the selected contract do not support this, an error is returned */ stateInit?: string; /** * Optional compute phase error codes to be ignored during transaction tree simulation */ ignoredComputePhaseCodes?: IgnoreTransactionTreeSimulationError[]; /** * Optional action phase error codes to be ignored during transaction tree simulation */ ignoredActionPhaseCodes?: IgnoreTransactionTreeSimulationError[]; }; output: { /** * Executed transaction */ transaction: Transaction; }; }; /** * 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` */ sendMessageDelayed: { input: { /** * Preferred wallet address. * It is the same address as the `accountInteraction.address`, but it must be explicitly provided */ sender: Addr; /** * Message destination address */ recipient: Addr; /** * Amount of nano EVER to send */ amount: string; /** * Whether to bounce message back on error */ bounce: boolean; /** * Optional function call */ payload?: FunctionCall; /** * Optional base64 encoded TVC * * NOTE: If the selected contract do not support this, an error is returned */ stateInit?: string; /** * Optional compute phase error codes to be ignored during transaction tree simulation */ ignoredComputePhaseCodes?: IgnoreTransactionTreeSimulationError[]; /** * Optional action phase error codes to be ignored during transaction tree simulation */ ignoredActionPhaseCodes?: IgnoreTransactionTreeSimulationError[]; }; output: { /** * External message info */ message: DelayedMessage; }; }; /** * Sends an external message to the contract * Shows and approval window to the user * * --- * Required permissions: `accountInteraction` */ sendExternalMessage: { input: { /** * The public key of the preferred account. * It is the same publicKey as the `accountInteraction.publicKey`, but it must be explicitly provided */ publicKey: string; /** * Message destination address */ recipient: Addr; /** * Optional base64 encoded `.tvc` file */ stateInit?: string; /** * Function call */ payload: FunctionCall; /** * Whether to only run it locally (false by default) * Can be used as alternative `runLocal` method but with user signature */ local?: boolean; /** * Optional executor parameters used during local contract execution */ executorParams?: { /** * If `true`, signature verification always succeds */ disableSignatureCheck?: boolean; /** * Explicit account balance in nano EVER */ overrideBalance?: string | number; }; }; output: { /** * Executed transaction */ transaction: Transaction; /** * Parsed function call output */ output: TokensObject | undefined; }; }; /** * Sends an external message to the contract without waiting for the transaction. * Shows and approval window to the user * * @see messageStatusUpdated * * --- * Required permissions: `accountInteraction` */ sendExternalMessageDelayed: { input: { /** * The public key of the preferred account. * It is the same publicKey as the `accountInteraction.publicKey`, but it must be explicitly provided */ publicKey: string; /** * Message destination address */ recipient: Addr; /** * Optional base64 encoded `.tvc` file */ stateInit?: string; /** * Function call */ payload: FunctionCall; }; output: { /** * External message info */ message: DelayedMessage; }; }; /** * Request user to add a new network. * Shows an approval window to the user. * * --- * Required permissions: `basic` */ addNetwork: { input: { /** * Network info */ network: AddNetwork; /** * Whether to switch to the added network (false by default) */ switchNetwork?: boolean; }; output: { network: Network | null; }; }; /** * Request user to change selected network. * Shows an approval window to the user. * * --- * Required permissions: `basic` */ changeNetwork: { input: { networkId: number; }; output: { network: Network | null; }; }; /** * Execute getter of the contract * * --- * Required permissions: `basic` */ runGetter: { input: { /** * Contract address */ address: Addr; /** * Cached contract state */ cachedState?: FullContractState; /** * Getter call params */ getterCall: GetterCall; /** * 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. * @deprecated * Use `withSignatureContext` instead. */ withSignatureId?: boolean | number; /** * Optional advanced signature configuration. * * In most cases you **do not need to set this manually**. * The wallet or network configuration will choose the correct mode. * * This field controls how the data is prepared before signing: * * - `empty` — signs the data as-is. * Use for simple or legacy signing. * * - `signatureId` — signs the data together with a network-specific id. * Prevents signatures from being reused on another network. * * - `signatureDomainL2` — same as signature id but with a different prefix. * This should be used where the `SignatureDomain` capability is enabled. * * If provided, this field overrides `withSignatureId`. */ withSignatureContext?: SignatureContext; /** * Optional libraries map **/ libraries?: { [K: string]: string }; }; output: { /** * Execution output */ output: TokensObject | undefined; /** * TVM execution code */ code: number; }; }; }; /** * @category Provider Api */ export type ProviderEvent = keyof ProviderEvents; /** * @category Provider Api */ export type ProviderEventData = ProviderEvents[T]; /** * @category Provider Api */ export type RawProviderEventData = ProviderEventData; /** * @category Provider Api */ export type ProviderMethod = keyof ProviderApi; /** * @category Provider Api */ export type ProviderApiRequestParams = ProviderApi[T] extends { input: infer I; } ? I : undefined; /** * @category Provider Api */ export type RawProviderApiRequestParams = ProviderApiRequestParams; /** * @category Provider Api */ export type ProviderApiResponse = ProviderApi[T] extends { output: infer O; } ? O : undefined; /** * @category Provider Api */ export type RawProviderApiResponse = ProviderApiResponse; /** * @category Provider Api */ export interface RawProviderRequest { method: T; params: RawProviderApiRequestParams; }