Skip to content
On this page

Provider Api

ProviderEvents

Ƭ ProviderEvents<Addr>: Object

Type parameters

NameType
AddrAddress

Type declaration

NameTypeDescription
connectedRecord<string, never>Called when inpage provider connects to the extension
disconnectedErrorCalled when inpage provider disconnects from extension
transactionsFound{ address: Addr ; transactions: Transaction<Addr>[] ; info: TransactionsBatchInfo }Called on each new transactions batch, received on subscription
transactionsFound.addressAddrContract address
transactionsFound.transactionsTransaction<Addr>[]Guaranteed to be non-empty and ordered by descending lt
transactionsFound.infoTransactionsBatchInfoDescribes transactions lt rage
contractStateChanged{ address: Addr ; state: ContractState }Called every time contract state changes
contractStateChanged.addressAddrContract address
contractStateChanged.stateContractStateNew contract state
messageStatusUpdated{ address: Addr ; hash: string ; transaction?: Transaction<Addr> }Called every time a delayed message was delivered or expired
messageStatusUpdated.addressAddrAccount address
messageStatusUpdated.hashstringMessage hash
messageStatusUpdated.transaction?Transaction<Addr>If not null, the transaction of the delivered message. Otherwise, the message has expired.
networkChanged{ selectedConnection: string ; networkId: number }Called each time the user changes network
networkChanged.selectedConnectionstringNetwork group name Deprecated networkId should be used instead
networkChanged.networkIdnumberNumeric network id
permissionsChanged{ permissions: Partial<Permissions<Addr>> }Called when permissions are changed. Mostly when account has been removed from the current accountInteraction permission, or disconnect method was called
permissionsChanged.permissionsPartial<Permissions<Addr>>-
loggedOutRecord<string, never>Called when the user logs out of the extension

Defined in:

src/api.ts:26


ProviderApi

Ƭ ProviderApi<Addr>: Object

Type parameters

NameType
AddrAddress

Type declaration

NameTypeDescription
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
requestPermissions.input{ permissions: UniqueArray<Permission[]> }-
requestPermissions.input.permissionsUniqueArray<Permission[]>-
requestPermissions.outputPartial<Permissions<Addr>>-
changeAccount{ output: Partial<Permissions<Addr>> }Updates accountInteraction permission value --- Requires permissions: accountInteraction
changeAccount.outputPartial<Permissions<Addr>>-
disconnectRecord<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
subscribe.input{ address: Addr ; subscriptions: Partial<ContractUpdatesSubscription> }-
subscribe.input.addressAddrContract address
subscribe.input.subscriptionsPartial<ContractUpdatesSubscription>Subscription changes
subscribe.outputContractUpdatesSubscription-
unsubscribe{ input: { address: Addr } }Fully unsubscribe from specific contract updates --- Required permissions: none
unsubscribe.input{ address: Addr }-
unsubscribe.input.addressAddrContract address
unsubscribeAllRecord<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
getProviderState.output{ version: string ; numericVersion: number ; selectedConnection: string ; networkId: number ; supportedPermissions: UniqueArray<Permission[]> ; permissions: Partial<Permissions<Addr>> ; subscriptions: { [address: string]: ContractUpdatesSubscription; } }-
getProviderState.output.versionstringProvider api version in semver format (x.y.z)
getProviderState.output.numericVersionnumberProvider api version in uint32 format (xxxyyyzzz)
getProviderState.output.selectedConnectionstringSelected connection group name (mainnet / testnet / etc.) Deprecated networkId should be used instead
getProviderState.output.networkIdnumberNumeric network id
getProviderState.output.supportedPermissionsUniqueArray<Permission[]>List of supported permissions
getProviderState.output.permissionsPartial<Permissions<Addr>>Object with active permissions attached data
getProviderState.output.subscriptions{ [address: string]: ContractUpdatesSubscription; }Current subscription states
getFullContractState{ input: { address: Addr } ; output: { state: FullContractState | undefined } }Requests contract data --- Required permissions: basic
getFullContractState.input{ address: Addr }-
getFullContractState.input.addressAddrContract address
getFullContractState.output{ state: FullContractState | undefined }-
getFullContractState.output.stateFullContractState | undefinedContract state or undefined if it doesn't exist
getAccountsByCodeHash{ input: { codeHash: string ; continuation?: string ; limit?: number } ; output: { accounts: Addr[] ; continuation: string | undefined } }Requests accounts with specified code hash --- Required permissions: basic
getAccountsByCodeHash.input{ codeHash: string ; continuation?: string ; limit?: number }-
getAccountsByCodeHash.input.codeHashstringHex encoded code hash
getAccountsByCodeHash.input.continuation?stringLast address from previous batch
getAccountsByCodeHash.input.limit?numberOptional limit. Values grater than 50 have no effect
getAccountsByCodeHash.output{ accounts: Addr[] ; continuation: string | undefined }-
getAccountsByCodeHash.output.accountsAddr[]List of account addresses
getAccountsByCodeHash.output.continuationstring | undefinedLast 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
getTransactions.input{ address: Addr ; continuation?: TransactionId ; limit?: number }-
getTransactions.input.addressAddrContract address
getTransactions.input.continuation?TransactionIdId of the transaction from which to request the next batch
getTransactions.input.limit?numberOptional limit. Values greater than 50 have no effect
getTransactions.output{ transactions: Transaction<Addr>[] ; continuation: TransactionId | undefined ; info?: TransactionsBatchInfo }-
getTransactions.output.transactionsTransaction<Addr>[]Transactions list in descending order (from latest lt to the oldest)
getTransactions.output.continuationTransactionId | undefinedPrevious transaction id of the last transaction in result. Can be used to continue transactions batch
getTransactions.output.info?TransactionsBatchInfoDescribes 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
getTransaction.input{ hash: string }-
getTransaction.input.hashstringHex encoded transaction hash
getTransaction.output{ transaction: Transaction<Addr> | undefined }-
getTransaction.output.transactionTransaction<Addr> | undefinedTransaction
findTransaction{ input: { inMessageHash?: string } ; output: { transaction: Transaction<Addr> | undefined } }Searches transaction by filters NOTE: at least one filter must be specified --- Required permissions: basic
findTransaction.input{ inMessageHash?: string }-
findTransaction.input.inMessageHash?stringHex encoded incoming message hash
findTransaction.output{ transaction: Transaction<Addr> | undefined }-
findTransaction.output.transactionTransaction<Addr> | undefinedTransaction
runLocal{ input: { address: Addr ; cachedState?: FullContractState ; responsible?: boolean ; functionCall: FunctionCall<Addr> } ; output: { output: TokensObject<Addr> | undefined ; code: number } }Executes only a compute phase locally --- Required permissions: basic
runLocal.input{ address: Addr ; cachedState?: FullContractState ; responsible?: boolean ; functionCall: FunctionCall<Addr> }-
runLocal.input.addressAddrContract address
runLocal.input.cachedState?FullContractStateCached contract state
runLocal.input.responsible?booleanWhether to run the method locally as responsible. This will use internal message with unlimited account balance.
runLocal.input.functionCallFunctionCall<Addr>Function call params
runLocal.output{ output: TokensObject<Addr> | undefined ; code: number }-
runLocal.output.outputTokensObject<Addr> | undefinedExecution output
runLocal.output.codenumberTVM 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
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 } }-
executeLocal.input.addressAddrContract address
executeLocal.input.cachedState?FullContractStateCached contract state
executeLocal.input.stateInit?stringOptional base64 encoded .tvc file
executeLocal.input.payload?string | FunctionCall<Addr>Function call
executeLocal.input.messageHeader{ type: "external" ; publicKey: string ; withoutSignature?: boolean } | { type: "internal" ; sender: Addr ; amount: string ; bounce: boolean ; bounced?: boolean }Message header
executeLocal.input.executorParams?{ disableSignatureCheck?: boolean ; overrideBalance?: string | number }Optional executor parameters used during local contract execution
executeLocal.input.executorParams.disableSignatureCheck?booleanIf true, signature verification always succeeds
executeLocal.input.executorParams.overrideBalance?string | numberExplicit account balance in nano EVER
executeLocal.output{ transaction: Transaction<Addr> ; newState: FullContractState | undefined ; output: TokensObject<Addr> | undefined }-
executeLocal.output.transactionTransaction<Addr>Executed transaction
executeLocal.output.newStateFullContractState | undefinedContract state after the executed transaction
executeLocal.output.outputTokensObject<Addr> | undefinedParsed 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
getExpectedAddress.input{ tvc: string ; abi: string ; workchain?: number ; publicKey?: string ; initParams: TokensObject<Addr> }-
getExpectedAddress.input.tvcstringBase64 encoded TVC file
getExpectedAddress.input.abistringContract ABI
getExpectedAddress.input.workchain?numberContract workchain. 0 by default
getExpectedAddress.input.publicKey?stringPublic key, which will be injected into the contract. 0 by default
getExpectedAddress.input.initParamsTokensObject<Addr>State init params
getExpectedAddress.output{ address: Addr ; stateInit: string ; hash: string }-
getExpectedAddress.output.addressAddrContract address
getExpectedAddress.output.stateInitstringBase64 encoded state init
getExpectedAddress.output.hashstringHex 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
getContractFields.input{ address: Addr ; abi: string ; cachedState?: FullContractState ; allowPartial: boolean }-
getContractFields.input.addressAddrContract address
getContractFields.input.abistringContract ABI
getContractFields.input.cachedState?FullContractStateCached contract state
getContractFields.input.allowPartialbooleanDon't fail if something is left in a cell after unpacking
getContractFields.output{ fields?: TokensObject<Addr> ; state: FullContractState | undefined }-
getContractFields.output.fields?TokensObject<Addr>Parsed contracts fields
getContractFields.output.stateFullContractState | undefinedContract 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
unpackInitData.input{ abi: string ; data: string }-
unpackInitData.input.abistringContract ABI
unpackInitData.input.datastringBase64 encoded init data BOC.
unpackInitData.output{ publicKey: string | undefined ; initParams: TokensObject<Addr> }-
unpackInitData.output.publicKeystring | undefinedOptional hex encoded public key
unpackInitData.output.initParamsTokensObject<Addr>State init params
getBocHash{ input: { boc: string } ; output: { hash: string } }Computes hash of base64 encoded BOC --- Required permissions: basic
getBocHash.input{ boc: string }-
getBocHash.input.bocstringBase64 encoded cell BOC
getBocHash.output{ hash: string }-
getBocHash.output.hashstringHex encoded cell hash
packIntoCell{ input: { abiVersion?: AbiVersion ; structure: AbiParam[] ; data: TokensObject<Addr> } ; output: { boc: string ; hash: string } }Creates base64 encoded BOC --- Required permissions: basic
packIntoCell.input{ abiVersion?: AbiVersion ; structure: AbiParam[] ; data: TokensObject<Addr> }-
packIntoCell.input.abiVersion?AbiVersionABI version. 2.2 if not specified otherwise
packIntoCell.input.structureAbiParam[]Cell structure
packIntoCell.input.dataTokensObject<Addr>Cell data
packIntoCell.output{ boc: string ; hash: string }-
packIntoCell.output.bocstringBase64 encoded cell BOC
packIntoCell.output.hashstringHex encoded cell hash
unpackFromCell{ input: { abiVersion?: AbiVersion ; structure: AbiParam[] ; boc: string ; allowPartial: boolean } ; output: { data: TokensObject<Addr> } }Decodes base64 encoded BOC --- Required permissions: basic
unpackFromCell.input{ abiVersion?: AbiVersion ; structure: AbiParam[] ; boc: string ; allowPartial: boolean }-
unpackFromCell.input.abiVersion?AbiVersionABI version. 2.2 if not specified otherwise
unpackFromCell.input.structureAbiParam[]Cell structure
unpackFromCell.input.bocstringBase64 encoded cell BOC
unpackFromCell.input.allowPartialbooleanDon't fail if something is left in a cell after unpacking
unpackFromCell.output{ data: TokensObject<Addr> }-
unpackFromCell.output.dataTokensObject<Addr>Cell data
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
extractPublicKey.input{ boc: string }-
extractPublicKey.input.bocstringBase64 encoded account state See FullContractState
extractPublicKey.output{ publicKey: string }-
extractPublicKey.output.publicKeystringHex 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
codeToTvc.input{ code: string }-
codeToTvc.input.codestringBase64 encoded contract code
codeToTvc.output{ tvc: string ; hash: string }-
codeToTvc.output.tvcstringBase64 encoded state init
codeToTvc.output.hashstringHex 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
mergeTvc.input{ code: string ; data: string }-
mergeTvc.input.codestringBase64 encoded contract code
mergeTvc.input.datastringBase64 encoded contract data
mergeTvc.output{ tvc: string ; hash: string }-
mergeTvc.output.tvcstringBase64 encoded state init
mergeTvc.output.hashstringHex 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
splitTvc.input{ tvc: string }-
splitTvc.input.tvcstringBase64 encoded state init
splitTvc.output{ data: string | undefined ; code: string | undefined }-
splitTvc.output.datastring | undefinedBase64 encoded init data
splitTvc.output.codestring | undefinedBase64 encoded contract code
setCodeSalt{ input: { code: string ; salt: string } ; output: { code: string ; hash: string } }Inserts salt into code --- Required permissions: basic
setCodeSalt.input{ code: string ; salt: string }-
setCodeSalt.input.codestringBase64 encoded contract code
setCodeSalt.input.saltstringBase64 encoded salt (as BOC)
setCodeSalt.output{ code: string ; hash: string }-
setCodeSalt.output.codestringBase64 encoded contract code with salt
setCodeSalt.output.hashstringHex 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
getCodeSalt.input{ code: string }-
getCodeSalt.input.codestringBase64 encoded contract code
getCodeSalt.output{ salt: string | undefined }-
getCodeSalt.output.saltstring | undefinedBase64 encoded salt (as BOC)
encodeInternalInput{ input: FunctionCall<Addr> ; output: { boc: string } }Creates internal message body --- Required permissions: basic
encodeInternalInput.inputFunctionCall<Addr>-
encodeInternalInput.output{ boc: string }-
encodeInternalInput.output.bocstringBase64 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
decodeInput.input{ body: string ; abi: string ; method: string | string[] ; internal: boolean }-
decodeInput.input.bodystringBase64 encoded message body BOC
decodeInput.input.abistringContract ABI
decodeInput.input.methodstring | 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.
decodeInput.input.internalbooleanFunction call type
decodeInput.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
decodeOutput.input{ body: string ; abi: string ; method: string | string[] }-
decodeOutput.input.bodystringBase64 encoded message body BOC
decodeOutput.input.abistringContract ABI
decodeOutput.input.methodstring | 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.
decodeOutput.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
decodeEvent.input{ body: string ; abi: string ; event: string | string[] }-
decodeEvent.input.bodystringBase64 encoded message body BOC
decodeEvent.input.abistringContract ABI
decodeEvent.input.eventstring | 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.
decodeEvent.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
decodeTransaction.input{ transaction: Transaction<Addr> ; abi: string ; method: string | string[] }-
decodeTransaction.input.transactionTransaction<Addr>Transaction with the function call
decodeTransaction.input.abistringContract ABI
decodeTransaction.input.methodstring | 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.
decodeTransaction.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
decodeTransactionEvents.input{ transaction: Transaction<Addr> ; abi: string }-
decodeTransactionEvents.input.transactionTransaction<Addr>Transaction with the function call
decodeTransactionEvents.input.abistringContract ABI
decodeTransactionEvents.output{ events: { event: string ; data: TokensObject<Addr> }[] }-
decodeTransactionEvents.output.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
verifySignature.input{ publicKey: string ; dataHash: string ; signature: string ; withSignatureId?: boolean | number }-
verifySignature.input.publicKeystringThe public key of the preferred account. It is the same publicKey as the accountInteraction.publicKey, but it must be explicitly provided
verifySignature.input.dataHashstringBase64 or hex encoded arbitrary bytes hash (data must be 32 bytes long)
verifySignature.input.signaturestringBase64 or hex encoded signature bytes (data must be 64 bytes long)
verifySignature.input.withSignatureId?boolean | numberWhether 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.
verifySignature.output{ isValid: boolean }-
verifySignature.output.isValidbooleanReturns 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
sendUnsignedExternalMessage.input{ recipient: Addr ; stateInit?: string ; payload?: string | FunctionCall<Addr> ; local?: boolean ; executorParams?: { disableSignatureCheck?: boolean ; overrideBalance?: string | number } }-
sendUnsignedExternalMessage.input.recipientAddrMessage destination address
sendUnsignedExternalMessage.input.stateInit?stringOptional base64 encoded .tvc file
sendUnsignedExternalMessage.input.payload?string | FunctionCall<Addr>Function call
sendUnsignedExternalMessage.input.local?booleanWhether to only run it locally (false by default) Can be used as alternative runLocal method
sendUnsignedExternalMessage.input.executorParams?{ disableSignatureCheck?: boolean ; overrideBalance?: string | number }Optional executor parameters used during local contract execution
sendUnsignedExternalMessage.input.executorParams.disableSignatureCheck?booleanIf true, signature verification always succeds
sendUnsignedExternalMessage.input.executorParams.overrideBalance?string | numberExplicit account balance in nano EVER
sendUnsignedExternalMessage.output{ transaction: Transaction<Addr> ; output: TokensObject<Addr> | undefined }-
sendUnsignedExternalMessage.output.transactionTransaction<Addr>Executed transaction
sendUnsignedExternalMessage.output.outputTokensObject<Addr> | undefinedParsed 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
addAsset.input{ account: Addr ; type: AssetType ; params: AssetTypeParams<AssetType, Addr> }-
addAsset.input.accountAddrOwner's wallet address. It is the same address as the accountInteraction.address, but it must be explicitly provided
addAsset.input.typeAssetTypeWhich asset to add
addAsset.input.paramsAssetTypeParams<AssetType, Addr>Asset parameters
addAsset.output{ newAsset: boolean }-
addAsset.output.newAssetbooleanReturns 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
signData.input{ publicKey: string ; data: string ; withSignatureId?: boolean | number }-
signData.input.publicKeystringThe public key of the preferred account. It is the same publicKey as the accountInteraction.publicKey, but it must be explicitly provided
signData.input.datastringBase64 encoded arbitrary bytes
signData.input.withSignatureId?boolean | numberWhether 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.
signData.output{ dataHash: string ; signature: string ; signatureHex: string ; signatureParts: { high: string ; low: string } }-
signData.output.dataHashstringHex encoded data hash
signData.output.signaturestringBase64 encoded signature bytes (data is guaranteed to be 64 bytes long)
signData.output.signatureHexstringHex encoded signature bytes (data is guaranteed to be 64 bytes long)
signData.output.signatureParts{ high: string ; low: string }Same signature, but split into two uint256 parts
signData.output.signatureParts.highstringHigh 32 bytes of the signature as uint256
signData.output.signatureParts.lowstringLow 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
signDataRaw.input{ publicKey: string ; data: string ; withSignatureId?: boolean | number }-
signDataRaw.input.publicKeystringThe public key of the preferred account. It is the same publicKey as the accountInteraction.publicKey, but it must be explicitly provided
signDataRaw.input.datastringBase64 encoded arbitrary bytes
signDataRaw.input.withSignatureId?boolean | numberWhether 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.
signDataRaw.output{ signature: string ; signatureHex: string ; signatureParts: { high: string ; low: string } }-
signDataRaw.output.signaturestringBase64 encoded signature bytes (data is guaranteed to be 64 bytes long)
signDataRaw.output.signatureHexstringHex encoded signature bytes (data is guaranteed to be 64 bytes long)
signDataRaw.output.signatureParts{ high: string ; low: string }Same signature, but split into two uint256 parts
signDataRaw.output.signatureParts.highstringHigh 32 bytes of the signature as uint256
signDataRaw.output.signatureParts.lowstringLow 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
encryptData.input{ publicKey: string ; recipientPublicKeys: string[] ; algorithm: EncryptionAlgorithm ; data: string }-
encryptData.input.publicKeystringThe public key of the preferred account. It is the same publicKey as the accountInteraction.publicKey, but it must be explicitly provided
encryptData.input.recipientPublicKeysstring[]Public keys of recipients. Hex encoded
encryptData.input.algorithmEncryptionAlgorithmEncryption algorithm. Nonce will be generated for each recipient
encryptData.input.datastringBase64 encoded data
encryptData.output{ encryptedData: EncryptedData[] }-
encryptData.output.encryptedDataEncryptedData[]Encrypted data for each recipient public key
decryptData{ input: { encryptedData: EncryptedData } ; output: { data: string } }Decrypts encrypted data --- Requires permissions: accountInteraction
decryptData.input{ encryptedData: EncryptedData }-
decryptData.input.encryptedDataEncryptedDataEncrypted data. The recipient's public key must match the public key of the current account.
decryptData.output{ data: string }-
decryptData.output.datastringBase64 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
estimateFees.input{ sender: Addr ; recipient: Addr ; amount: string ; payload?: FunctionCall<Addr> ; stateInit?: string }-
estimateFees.input.senderAddrThis wallet will be used to send the message. It is the same address as the accountInteraction.address, but it must be explicitly provided
estimateFees.input.recipientAddrMessage destination address
estimateFees.input.amountstringAmount of nano EVER to send
estimateFees.input.payload?FunctionCall<Addr>Optional function call
estimateFees.input.stateInit?stringOptional base64 encoded TVC NOTE: If the selected contract do not support this, an error is returned
estimateFees.output{ fees: string }-
estimateFees.output.feesstringFees 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
sendMessage.input{ sender: Addr ; recipient: Addr ; amount: string ; bounce: boolean ; payload?: FunctionCall<Addr> ; stateInit?: string }-
sendMessage.input.senderAddrPreferred wallet address. It is the same address as the accountInteraction.address, but it must be explicitly provided
sendMessage.input.recipientAddrMessage destination address
sendMessage.input.amountstringAmount of nano EVER to send
sendMessage.input.bouncebooleanWhether to bounce message back on error
sendMessage.input.payload?FunctionCall<Addr>Optional function call
sendMessage.input.stateInit?stringOptional base64 encoded TVC NOTE: If the selected contract do not support this, an error is returned
sendMessage.output{ transaction: Transaction<Addr> }-
sendMessage.output.transactionTransaction<Addr>Executed transaction
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
sendMessageDelayed.input{ sender: Addr ; recipient: Addr ; amount: string ; bounce: boolean ; payload?: FunctionCall<Addr> ; stateInit?: string }-
sendMessageDelayed.input.senderAddrPreferred wallet address. It is the same address as the accountInteraction.address, but it must be explicitly provided
sendMessageDelayed.input.recipientAddrMessage destination address
sendMessageDelayed.input.amountstringAmount of nano EVER to send
sendMessageDelayed.input.bouncebooleanWhether to bounce message back on error
sendMessageDelayed.input.payload?FunctionCall<Addr>Optional function call
sendMessageDelayed.input.stateInit?stringOptional base64 encoded TVC NOTE: If the selected contract do not support this, an error is returned
sendMessageDelayed.output{ message: DelayedMessage<Addr> }-
sendMessageDelayed.output.messageDelayedMessage<Addr>External message info
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
sendExternalMessage.input{ publicKey: string ; recipient: Addr ; stateInit?: string ; payload: FunctionCall<Addr> ; local?: boolean ; executorParams?: { disableSignatureCheck?: boolean ; overrideBalance?: string | number } }-
sendExternalMessage.input.publicKeystringThe public key of the preferred account. It is the same publicKey as the accountInteraction.publicKey, but it must be explicitly provided
sendExternalMessage.input.recipientAddrMessage destination address
sendExternalMessage.input.stateInit?stringOptional base64 encoded .tvc file
sendExternalMessage.input.payloadFunctionCall<Addr>Function call
sendExternalMessage.input.local?booleanWhether to only run it locally (false by default) Can be used as alternative runLocal method but with user signature
sendExternalMessage.input.executorParams?{ disableSignatureCheck?: boolean ; overrideBalance?: string | number }Optional executor parameters used during local contract execution
sendExternalMessage.input.executorParams.disableSignatureCheck?booleanIf true, signature verification always succeds
sendExternalMessage.input.executorParams.overrideBalance?string | numberExplicit account balance in nano EVER
sendExternalMessage.output{ transaction: Transaction<Addr> ; output: TokensObject<Addr> | undefined }-
sendExternalMessage.output.transactionTransaction<Addr>Executed transaction
sendExternalMessage.output.outputTokensObject<Addr> | undefinedParsed 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
sendExternalMessageDelayed.input{ publicKey: string ; recipient: Addr ; stateInit?: string ; payload: FunctionCall<Addr> }-
sendExternalMessageDelayed.input.publicKeystringThe public key of the preferred account. It is the same publicKey as the accountInteraction.publicKey, but it must be explicitly provided
sendExternalMessageDelayed.input.recipientAddrMessage destination address
sendExternalMessageDelayed.input.stateInit?stringOptional base64 encoded .tvc file
sendExternalMessageDelayed.input.payloadFunctionCall<Addr>Function call
sendExternalMessageDelayed.output{ message: DelayedMessage<Addr> }-
sendExternalMessageDelayed.output.messageDelayedMessage<Addr>External message info

Defined in:

src/api.ts:121


ProviderEvent

Ƭ ProviderEvent: keyof ProviderEvents

Defined in:

src/api.ts:1581


ProviderEventData

Ƭ ProviderEventData<T, Addr>: ProviderEvents<Addr>[T]

Type parameters

NameType
Textends ProviderEvent
AddrAddress

Defined in:

src/api.ts:1586


RawProviderEventData

Ƭ RawProviderEventData<T>: ProviderEventData<T, string>

Type parameters

NameType
Textends ProviderEvent

Defined in:

src/api.ts:1591


ProviderMethod

Ƭ ProviderMethod: keyof ProviderApi

Defined in:

src/api.ts:1596


ProviderApiRequestParams

Ƭ ProviderApiRequestParams<T, Addr>: ProviderApi<Addr>[T] extends { input: infer I } ? I : undefined

Type parameters

NameType
Textends ProviderMethod
AddrAddress

Defined in:

src/api.ts:1601


RawProviderApiRequestParams

Ƭ RawProviderApiRequestParams<T>: ProviderApiRequestParams<T, string>

Type parameters

NameType
Textends ProviderMethod

Defined in:

src/api.ts:1610


ProviderApiResponse

Ƭ ProviderApiResponse<T, Addr>: ProviderApi<Addr>[T] extends { output: infer O } ? O : undefined

Type parameters

NameType
Textends ProviderMethod
AddrAddress

Defined in:

src/api.ts:1615


RawProviderApiResponse

Ƭ RawProviderApiResponse<T>: ProviderApiResponse<T, string>

Type parameters

NameType
Textends ProviderMethod

Defined in:

src/api.ts:1624