Skip to main content
Version: Next

Type Alias: STRK20_SUBACCOUNT_INVOKE_ACTION

STRK20_SUBACCOUNT_INVOKE_ACTION = Omit<STRK20_SUBACCOUNT_INVOKE_ACTION_SPEC, "calls"> & object

Defined in: src/wallet/types/strk20.type.ts:39

Invokes one or more contract calls through the user's STRK20 sub-account for a DAPP, routed via the sub-account anonymizer. The sub-account is selected by (dapp_name, nonce); each nonce maps to a distinct, deterministic sub-account.

The proceeds of the calls are settled into the open notes created by transfer actions with amount: "OPEN" in the same transaction, so the number of open notes filled by this action must match the number of open notes created in the transaction.

Type Declaration

calls

calls: Call[]

The contract calls to execute through the sub-account, in order (min 1).

Example

const action: STRK20_SUBACCOUNT_INVOKE_ACTION = {
type: 'subaccount_invoke',
dapp_name: 'myDapp',
nonce: '0x0',
calls: [myContract.populate('stake', { amount: 1000n })],
collect_policy: { type: 'diff' },
};