import type { Address } from 'abitype'; import * as Hex from 'ox/Hex'; import { TokenId, TokenRole } from 'ox/tempo'; import type { Account } from '../../accounts/types.js'; import type { ReadContractReturnType } from '../../actions/public/readContract.js'; import type { WatchContractEventParameters, WatchContractEventReturnType } from '../../actions/public/watchContractEvent.js'; import { sendTransaction } from '../../actions/wallet/sendTransaction.js'; import { type SendTransactionSyncParameters, sendTransactionSync } from '../../actions/wallet/sendTransactionSync.js'; import type { WriteContractReturnType } from '../../actions/wallet/writeContract.js'; import { writeContract } from '../../actions/wallet/writeContract.js'; import { writeContractSync } from '../../actions/wallet/writeContractSync.js'; import type { Client } from '../../clients/createClient.js'; import type { Transport } from '../../clients/transports/createTransport.js'; import type { BaseErrorType } from '../../errors/base.js'; import type { Chain } from '../../types/chain.js'; import type { ExtractAbiItem, GetEventArgs } from '../../types/contract.js'; import type { Log, Log as viem_Log } from '../../types/log.js'; import type { Compute, OneOf, UnionOmit } from '../../types/utils.js'; import * as Abis from '../Abis.js'; import type { GetAccountParameter, ReadParameters, WriteParameters } from '../internal/types.js'; import type { TransactionReceipt } from '../Transaction.js'; /** * Approves a spender to transfer TIP20 tokens on behalf of the caller. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.approve(client, { * spender: '0x...', * amount: 100n, * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction hash. */ export declare function approve(client: Client, parameters: approve.Parameters): Promise; export declare namespace approve { type Parameters = WriteParameters & Args; type Args = { /** Amount of tokens to approve. */ amount: bigint; /** Address of the spender. */ spender: Address; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; type ReturnValue = WriteContractReturnType; type ErrorType = BaseErrorType; /** @internal */ function inner(action: action, client: Client, parameters: approve.Parameters, args: Args): Promise>; /** * Defines a call to the `approve` function. * * Can be passed as a parameter to: * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls * * @example * ```ts * import { createClient, http, walletActions } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }).extend(walletActions) * * const { result } = await client.sendCalls({ * calls: [ * actions.token.approve.call({ * spender: '0x20c0...beef', * amount: 100n, * token: '0x20c0...babe', * }), * ] * }) * ``` * * @param args - Arguments. * @returns The call. */ function call(args: Args): { abi: [{ readonly name: "approve"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "address"; readonly name: "spender"; }, { readonly type: "uint256"; readonly name: "amount"; }]; readonly outputs: readonly [{ readonly type: "bool"; }]; }]; functionName: "approve"; } & { args: readonly [spender: `0x${string}`, amount: bigint]; } & { address: Address; } & { data: import("../../index.js").Hex; to: Address; }; function extractEvent(logs: Log[]): Log; } /** * Approves a spender to transfer TIP20 tokens on behalf of the caller. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.approveSync(client, { * spender: '0x...', * amount: 100n, * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction receipt and event data. */ export declare function approveSync(client: Client, parameters: approveSync.Parameters): Promise; export declare namespace approveSync { type Parameters = approve.Parameters; type Args = approve.Args; type ReturnValue = Compute & { /** Transaction receipt. */ receipt: TransactionReceipt; }>; type ErrorType = BaseErrorType; } /** * Burns TIP20 tokens from a blocked address. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.burnBlocked(client, { * from: '0x...', * amount: 100n, * token: '0x...', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction hash. */ export declare function burnBlocked(client: Client, parameters: burnBlocked.Parameters): Promise; export declare namespace burnBlocked { type Parameters = WriteParameters & Args; type Args = { /** Amount of tokens to burn. */ amount: bigint; /** Address to burn tokens from. */ from: Address; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; type ReturnValue = WriteContractReturnType; type ErrorType = BaseErrorType; /** @internal */ function inner(action: action, client: Client, parameters: burnBlocked.Parameters): Promise>; /** * Defines a call to the `burnBlocked` function. * * Can be passed as a parameter to: * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls * * @example * ```ts * import { createClient, http, walletActions } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }).extend(walletActions) * * const { result } = await client.sendCalls({ * calls: [ * actions.token.burnBlocked.call({ * from: '0x20c0...beef', * amount: 100n, * token: '0x20c0...babe', * }), * ] * }) * ``` * * @param args - Arguments. * @returns The call. */ function call(args: Args): { abi: [{ readonly name: "burnBlocked"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "address"; readonly name: "from"; }, { readonly type: "uint256"; readonly name: "amount"; }]; readonly outputs: readonly []; }]; functionName: "burnBlocked"; } & { args: readonly [from: `0x${string}`, amount: bigint]; } & { address: Address; } & { data: import("../../index.js").Hex; to: Address; }; /** * Extracts the event from the logs. * * @param logs - Logs. * @returns The event. */ function extractEvent(logs: Log[]): Log; } /** * Burns TIP20 tokens from a blocked address. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.burnBlockedSync(client, { * from: '0x...', * amount: 100n, * token: '0x...', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction receipt and event data. */ export declare function burnBlockedSync(client: Client, parameters: burnBlockedSync.Parameters): Promise; export declare namespace burnBlockedSync { type Parameters = burnBlocked.Parameters; type Args = burnBlocked.Args; type ReturnValue = Compute & { /** Transaction receipt. */ receipt: TransactionReceipt; }>; type ErrorType = BaseErrorType; } /** * Burns TIP20 tokens from the caller's balance. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.burn(client, { * amount: 100n, * token: '0x...', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction hash. */ export declare function burn(client: Client, parameters: burn.Parameters): Promise; export declare namespace burn { type Parameters = WriteParameters & Args; type Args = { /** Amount of tokens to burn. */ amount: bigint; /** Memo to include in the transfer. */ memo?: Hex.Hex | undefined; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; type ReturnValue = WriteContractReturnType; type ErrorType = BaseErrorType; /** @internal */ function inner(action: action, client: Client, parameters: burn.Parameters): Promise>; /** * Defines a call to the `burn` or `burnWithMemo` function. * * Can be passed as a parameter to: * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls * * @example * ```ts * import { createClient, http, walletActions } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }).extend(walletActions) * * const { result } = await client.sendCalls({ * calls: [ * actions.token.burn.call({ * amount: 100n, * token: '0x20c0...babe', * }), * ] * }) * ``` * * @param args - Arguments. * @returns The call. */ function call(args: Args): { abi: [{ readonly name: "burn"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "uint256"; readonly name: "amount"; }]; readonly outputs: readonly []; } | { readonly name: "burnWithMemo"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "uint256"; readonly name: "amount"; }, { readonly type: "bytes32"; readonly name: "memo"; }]; readonly outputs: readonly []; }]; functionName: "burn" | "burnWithMemo"; } & { args: readonly [amount: bigint] | readonly [amount: bigint, memo: `0x${string}`]; } & { address: Address; } & { data: import("../../index.js").Hex; to: Address; }; /** * Extracts the event from the logs. * * @param logs - Logs. * @returns The event. */ function extractEvent(logs: Log[]): Log; } /** * Burns TIP20 tokens from the caller's balance. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.burnSync(client, { * amount: 100n, * token: '0x...', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction receipt and event data. */ export declare function burnSync(client: Client, parameters: burnSync.Parameters): Promise; export declare namespace burnSync { type Parameters = burn.Parameters; type Args = burn.Args; type ReturnValue = Compute & { receipt: TransactionReceipt; }>; type ErrorType = BaseErrorType; } /** * Changes the transfer policy ID for a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.changeTransferPolicy(client, { * token: '0x...', * policyId: 1n, * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction hash. */ export declare function changeTransferPolicy(client: Client, parameters: changeTransferPolicy.Parameters): Promise; export declare namespace changeTransferPolicy { type Parameters = WriteParameters & Args; type Args = { /** New transfer policy ID. */ policyId: bigint; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; type ReturnValue = WriteContractReturnType; type ErrorType = BaseErrorType; /** @internal */ function inner(action: action, client: Client, parameters: changeTransferPolicy.Parameters): Promise>; /** * Defines a call to the `changeTransferPolicyId` function. * * Can be passed as a parameter to: * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls * * @example * ```ts * import { createClient, http, walletActions } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }).extend(walletActions) * * const { result } = await client.sendCalls({ * calls: [ * actions.token.changeTransferPolicy.call({ * token: '0x20c0...babe', * policyId: 1n, * }), * ] * }) * ``` * * @param args - Arguments. * @returns The call. */ function call(args: Args): { abi: [{ readonly name: "changeTransferPolicyId"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "uint64"; readonly name: "newPolicyId"; }]; readonly outputs: readonly []; }]; functionName: "changeTransferPolicyId"; } & { args: readonly [bigint]; } & { address: Address; } & { data: import("../../index.js").Hex; to: Address; }; /** * Extracts the event from the logs. * * @param logs - Logs. * @returns The event. */ function extractEvent(logs: Log[]): Log; } /** * Changes the transfer policy ID for a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.changeTransferPolicySync(client, { * token: '0x...', * policyId: 1n, * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction receipt and event data. */ export declare function changeTransferPolicySync(client: Client, parameters: changeTransferPolicySync.Parameters): Promise; export declare namespace changeTransferPolicySync { type Parameters = changeTransferPolicy.Parameters; type Args = changeTransferPolicy.Args; type ReturnValue = Compute & { receipt: TransactionReceipt; }>; type ErrorType = BaseErrorType; } /** * Creates a new TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.create(client, { * name: 'My Token', * symbol: 'MTK', * currency: 'USD', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction hash. */ export declare function create(client: Client, parameters: create.Parameters): Promise; export declare namespace create { type Parameters = WriteParameters & Omit & (account extends Account ? { admin?: Account | Address | undefined; } : { admin: Account | Address; }); type Args = { /** Admin address. */ admin: Address; /** Currency (e.g. "USD"). */ currency: string; /** Token name. */ name: string; /** Quote token. */ quoteToken?: TokenId.TokenIdOrAddress | undefined; /** Unique salt. @default Hex.random(32) */ salt?: Hex.Hex | undefined; /** Token symbol. */ symbol: string; }; type ReturnValue = WriteContractReturnType; type ErrorType = BaseErrorType; /** @internal */ function inner(action: action, client: Client, parameters: any): Promise>; /** * Defines a call to the `createToken` function. * * Can be passed as a parameter to: * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls * * @example * ```ts * import { createClient, http, walletActions } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }).extend(walletActions) * * const { result } = await client.sendCalls({ * calls: [ * actions.token.create.call({ * name: 'My Token', * symbol: 'MTK', * currency: 'USD', * admin: '0xfeed...fede', * }), * ] * }) * ``` * * @param args - Arguments. * @returns The call. */ function call(args: Args): { abi: [{ readonly name: "createToken"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "string"; readonly name: "name"; }, { readonly type: "string"; readonly name: "symbol"; }, { readonly type: "string"; readonly name: "currency"; }, { readonly type: "address"; readonly name: "quoteToken"; }, { readonly type: "address"; readonly name: "admin"; }, { readonly type: "bytes32"; readonly name: "salt"; }]; readonly outputs: readonly [{ readonly type: "address"; }]; }]; functionName: "createToken"; } & { args: readonly [name: string, symbol: string, currency: string, quoteToken: `0x${string}`, admin: `0x${string}`, salt: `0x${string}`]; } & { address: Address; } & { data: import("../../index.js").Hex; to: Address; }; /** * Extracts the `TokenCreated` event from logs. * * @param logs - The logs. * @returns The `TokenCreated` event. */ function extractEvent(logs: Log[]): Log; } /** * Creates a new TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.createSync(client, { * name: 'My Token', * symbol: 'MTK', * currency: 'USD', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction receipt and event data. */ export declare function createSync(client: Client, parameters: createSync.Parameters): Promise; export declare namespace createSync { type Parameters = create.Parameters; type Args = create.Args; type ReturnValue = Compute & { /** Token ID. */ tokenId: TokenId.TokenId; /** Transaction receipt. */ receipt: TransactionReceipt; }>; type ErrorType = BaseErrorType; } /** * Gets TIP20 token allowance. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const allowance = await Actions.token.getAllowance(client, { * spender: '0x...', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The token allowance. */ export declare function getAllowance(client: Client, parameters: getAllowance.Parameters): Promise; export declare namespace getAllowance { type Parameters = ReadParameters & GetAccountParameter & Omit & {}; type Args = { /** Account address. */ account: Address; /** Address of the spender. */ spender: Address; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; type ReturnValue = ReadContractReturnType; /** * Defines a call to the `allowance` function. * * @param args - Arguments. * @returns The call. */ function call(args: Args): { abi: [{ readonly name: "allowance"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly type: "address"; readonly name: "owner"; }, { readonly type: "address"; readonly name: "spender"; }]; readonly outputs: readonly [{ readonly type: "uint256"; }]; }]; functionName: "allowance"; } & { args: readonly [owner: `0x${string}`, spender: `0x${string}`]; } & { address: Address; } & { data: import("../../index.js").Hex; to: Address; }; } /** * Gets TIP20 token balance for an address. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const balance = await Actions.token.getBalance(client, { * token: '0x...', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The token balance. */ export declare function getBalance(client: Client, parameters: getBalance.Parameters): Promise; export declare namespace getBalance { type Parameters = ReadParameters & GetAccountParameter & Omit; type Args = { /** Account address. */ account: Address; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; type ReturnValue = ReadContractReturnType; /** * Defines a call to the `balanceOf` function. * * @param args - Arguments. * @returns The call. */ function call(args: Args): { abi: [{ readonly name: "balanceOf"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly type: "address"; readonly name: "account"; }]; readonly outputs: readonly [{ readonly type: "uint256"; }]; }]; functionName: "balanceOf"; } & { args: readonly [account: `0x${string}`]; } & { address: Address; } & { data: import("../../index.js").Hex; to: Address; }; } /** * Gets TIP20 token metadata including name, symbol, currency, decimals, and total supply. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const metadata = await Actions.token.getMetadata(client, { * token: '0x...', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The token metadata. */ export declare function getMetadata(client: Client, parameters: getMetadata.Parameters): Promise; export declare namespace getMetadata { type Parameters = { /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; type ReturnValue = Compute<{ /** * Currency (e.g. "USD"). */ currency: string; /** * Decimals of the token. */ decimals: number; /** * Quote token. * * Returns `undefined` for the default quote token (`0x20c...0000`). */ quoteToken?: Address | undefined; /** * Name of the token. */ name: string; /** * Whether the token is paused. * * Returns `undefined` for the default quote token (`0x20c...0000`). */ paused?: boolean | undefined; /** * Supply cap. * * Returns `undefined` for the default quote token (`0x20c...0000`). */ supplyCap?: bigint | undefined; /** * Symbol of the token. */ symbol: string; /** * Total supply of the token. */ totalSupply: bigint; /** * Transfer policy ID. * 0="always-reject", 1="always-allow", >2=custom policy * * Returns `undefined` for the default quote token (`0x20c...0000`). */ transferPolicyId?: bigint | undefined; }>; } /** * Gets the admin role for a specific role in a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const adminRole = await Actions.token.getRoleAdmin(client, { * role: 'issuer', * token: '0x...', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The admin role hash. */ export declare function getRoleAdmin(client: Client, parameters: getRoleAdmin.Parameters): Promise; export declare namespace getRoleAdmin { type Parameters = ReadParameters & Args; type Args = { /** Role to get admin for. */ role: TokenRole.TokenRole; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; type ReturnValue = ReadContractReturnType; /** * Defines a call to the `getRoleAdmin` function. * * @param args - Arguments. * @returns The call. */ function call(args: Args): { abi: [{ readonly name: "getRoleAdmin"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly type: "bytes32"; readonly name: "role"; }]; readonly outputs: readonly [{ readonly type: "bytes32"; }]; }]; functionName: "getRoleAdmin"; } & { args: readonly [role: `0x${string}`]; } & { address: Address; } & { data: import("../../index.js").Hex; to: Address; }; } /** * Checks if an account has a specific role for a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const hasRole = await Actions.token.hasRole(client, { * account: '0x...', * role: 'issuer', * token: '0x...', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns Whether the account has the role. */ export declare function hasRole(client: Client, parameters: hasRole.Parameters): Promise; export declare namespace hasRole { type Parameters = ReadParameters & Omit & GetAccountParameter; type Args = { /** Account address to check. */ account: Address; /** Role to check. */ role: TokenRole.TokenRole; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; type ReturnValue = ReadContractReturnType; /** * Defines a call to the `hasRole` function. * * @param args - Arguments. * @returns The call. */ function call(args: Args): { abi: [{ readonly name: "hasRole"; readonly type: "function"; readonly stateMutability: "view"; readonly inputs: readonly [{ readonly type: "address"; readonly name: "account"; }, { readonly type: "bytes32"; readonly name: "role"; }]; readonly outputs: readonly [{ readonly type: "bool"; }]; }]; functionName: "hasRole"; } & { args: readonly [account: `0x${string}`, role: `0x${string}`]; } & { address: Address; } & { data: import("../../index.js").Hex; to: Address; }; } /** * Grants a role for a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.grantRoles(client, { * token: '0x...', * to: '0x...', * roles: ['issuer'], * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction hash. */ export declare function grantRoles(client: Client, parameters: grantRoles.Parameters): Promise; export declare namespace grantRoles { type Parameters = WriteParameters & Omit & { /** Role to grant. */ roles: readonly TokenRole.TokenRole[]; }; type Args = { /** Role to grant. */ role: TokenRole.TokenRole; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; /** Address to grant the role to. */ to: Address; }; type ReturnValue = WriteContractReturnType; type ErrorType = BaseErrorType; /** @internal */ function inner(action: action, client: Client, parameters: grantRoles.Parameters): Promise>; /** * Defines a call to the `grantRole` function. * * Can be passed as a parameter to: * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls * * @example * ```ts * import { createClient, http, walletActions } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }).extend(walletActions) * * const { result } = await client.sendCalls({ * calls: [ * actions.token.grantRoles.call({ * token: '0x20c0...babe', * to: '0x20c0...beef', * role: 'issuer', * }), * ] * }) * ``` * * @param args - Arguments. * @returns The call. */ function call(args: Args): { abi: [{ readonly name: "grantRole"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "bytes32"; readonly name: "role"; }, { readonly type: "address"; readonly name: "account"; }]; readonly outputs: readonly []; }]; functionName: "grantRole"; } & { args: readonly [role: `0x${string}`, account: `0x${string}`]; } & { address: Address; } & { data: import("../../index.js").Hex; to: Address; }; /** * Extracts the events from the logs. * * @param logs - Logs. * @returns The events. */ function extractEvents(logs: Log[]): import("../../utils/abi/parseEventLogs.js").ParseEventLogsReturnType; } /** * Grants a role for a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.grantRolesSync(client, { * token: '0x...', * to: '0x...', * roles: ['issuer'], * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction receipt and event data. */ export declare function grantRolesSync(client: Client, parameters: grantRolesSync.Parameters): Promise; export declare namespace grantRolesSync { type Parameters = grantRoles.Parameters; type Args = grantRoles.Args; type ReturnValue = { receipt: TransactionReceipt; value: readonly GetEventArgs[]; }; type ErrorType = BaseErrorType; } /** * Mints TIP20 tokens to an address. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.mint(client, { * to: '0x...', * amount: 100n, * token: '0x...', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction hash. */ export declare function mint(client: Client, parameters: mint.Parameters): Promise; export declare namespace mint { type Parameters = WriteParameters & Args; type Args = { /** Amount of tokens to mint. */ amount: bigint; /** Memo to include in the mint. */ memo?: Hex.Hex | undefined; /** Address to mint tokens to. */ to: Address; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; type ReturnValue = WriteContractReturnType; type ErrorType = BaseErrorType; /** @internal */ function inner(action: action, client: Client, parameters: any): Promise>; /** * Defines a call to the `mint` or `mintWithMemo` function. * * Can be passed as a parameter to: * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls * * @example * ```ts * import { createClient, http, walletActions } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }).extend(walletActions) * * const { result } = await client.sendCalls({ * calls: [ * actions.token.mint.call({ * to: '0x20c0...beef', * amount: 100n, * token: '0x20c0...babe', * }), * ] * }) * ``` * * @param args - Arguments. * @returns The call. */ function call(args: Args): { abi: [{ readonly name: "mint"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "address"; readonly name: "to"; }, { readonly type: "uint256"; readonly name: "amount"; }]; readonly outputs: readonly []; } | { readonly name: "mintWithMemo"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "address"; readonly name: "to"; }, { readonly type: "uint256"; readonly name: "amount"; }, { readonly type: "bytes32"; readonly name: "memo"; }]; readonly outputs: readonly []; }]; functionName: "mint" | "mintWithMemo"; } & { args: readonly [to: `0x${string}`, amount: bigint] | readonly [to: `0x${string}`, amount: bigint, memo: `0x${string}`]; } & { address: Address; } & { data: import("../../index.js").Hex; to: Address; }; /** * Extracts the event from the logs. * * @param logs - Logs. * @returns The event. */ function extractEvent(logs: Log[]): Log; } /** * Mints TIP20 tokens to an address. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.mintSync(client, { * to: '0x...', * amount: 100n, * token: '0x...', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction receipt and event data. */ export declare function mintSync(client: Client, parameters: mintSync.Parameters): Promise; export declare namespace mintSync { type Parameters = mint.Parameters; type Args = mint.Args; type ReturnValue = Compute & { receipt: TransactionReceipt; }>; type ErrorType = BaseErrorType; } /** * Pauses a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.pause(client, { * token: '0x...', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction hash. */ export declare function pause(client: Client, parameters: pause.Parameters): Promise; export declare namespace pause { type Parameters = WriteParameters & Args; type Args = { /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; type ReturnValue = WriteContractReturnType; type ErrorType = BaseErrorType; /** @internal */ function inner(action: action, client: Client, parameters: pause.Parameters): Promise>; /** * Defines a call to the `pause` function. * * Can be passed as a parameter to: * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls * * @example * ```ts * import { createClient, http, walletActions } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }).extend(walletActions) * * const { result } = await client.sendCalls({ * calls: [ * actions.token.pause.call({ * token: '0x20c0...babe', * }), * ] * }) * ``` * * @param args - Arguments. * @returns The call. */ function call(args: Args): { abi: [{ readonly name: "pause"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly []; readonly outputs: readonly []; }]; functionName: "pause"; } & { args?: readonly [] | undefined; } & { address: Address; } & { data: import("../../index.js").Hex; to: Address; }; /** * Extracts the event from the logs. * * @param logs - Logs. * @returns The event. */ function extractEvent(logs: Log[]): Log; } /** * Pauses a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.pauseSync(client, { * token: '0x...', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction receipt and event data. */ export declare function pauseSync(client: Client, parameters: pauseSync.Parameters): Promise; export declare namespace pauseSync { type Parameters = pause.Parameters; type Args = pause.Args; type ReturnValue = GetEventArgs & { receipt: TransactionReceipt; }; type ErrorType = BaseErrorType; } /** * Renounces a role for a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.renounceRoles(client, { * token: '0x...', * roles: ['issuer'], * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction hash. */ export declare function renounceRoles(client: Client, parameters: renounceRoles.Parameters): Promise; export declare namespace renounceRoles { type Parameters = WriteParameters & Omit & { /** Roles to renounce. */ roles: readonly TokenRole.TokenRole[]; }; type Args = { /** Role to renounce. */ role: TokenRole.TokenRole; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; type ReturnValue = WriteContractReturnType; type ErrorType = BaseErrorType; /** @internal */ function inner(action: action, client: Client, parameters: renounceRoles.Parameters): Promise>; /** * Defines a call to the `renounceRole` function. * * Can be passed as a parameter to: * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls * * @example * ```ts * import { createClient, http, walletActions } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }).extend(walletActions) * * const { result } = await client.sendCalls({ * calls: [ * actions.token.renounceRoles.call({ * token: '0x20c0...babe', * role: 'issuer', * }), * ] * }) * ``` * * @param args - Arguments. * @returns The call. */ function call(args: Args): { abi: [{ readonly name: "renounceRole"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "bytes32"; readonly name: "role"; }]; readonly outputs: readonly []; }]; functionName: "renounceRole"; } & { args: readonly [role: `0x${string}`]; } & { address: Address; } & { data: import("../../index.js").Hex; to: Address; }; /** * Extracts the events from the logs. * * @param logs - Logs. * @returns The events. */ function extractEvents(logs: Log[]): import("../../utils/abi/parseEventLogs.js").ParseEventLogsReturnType; } /** * Renounces a role for a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.renounceRolesSync(client, { * token: '0x...', * roles: ['issuer'], * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction receipt and event data. */ export declare function renounceRolesSync(client: Client, parameters: renounceRolesSync.Parameters): Promise; export declare namespace renounceRolesSync { type Parameters = renounceRoles.Parameters; type Args = renounceRoles.Args; type ReturnValue = { receipt: TransactionReceipt; value: readonly GetEventArgs[]; }; type ErrorType = BaseErrorType; } /** * Revokes a role for a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.revokeRoles(client, { * token: '0x...', * from: '0x...', * roles: ['issuer'], * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction hash. */ export declare function revokeRoles(client: Client, parameters: revokeRoles.Parameters): Promise; export declare namespace revokeRoles { type Parameters = SendTransactionSyncParameters & Omit & { /** Role to revoke. */ roles: readonly TokenRole.TokenRole[]; }; type Args = { /** Address to revoke the role from. */ from: Address; /** Role to revoke. */ role: TokenRole.TokenRole; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; type ReturnValue = WriteContractReturnType; type ErrorType = BaseErrorType; /** @internal */ function inner(action: action, client: Client, parameters: revokeRoles.Parameters): Promise>; /** * Defines a call to the `revokeRole` function. * * Can be passed as a parameter to: * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls * * @example * ```ts * import { createClient, http, walletActions } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }).extend(walletActions) * * const { result } = await client.sendCalls({ * calls: [ * actions.token.revokeRoles.call({ * token: '0x20c0...babe', * from: '0x20c0...beef', * role: 'issuer', * }), * ] * }) * ``` * * @param args - Arguments. * @returns The call. */ function call(args: Args): { abi: [{ readonly name: "revokeRole"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "bytes32"; readonly name: "role"; }, { readonly type: "address"; readonly name: "account"; }]; readonly outputs: readonly []; }]; functionName: "revokeRole"; } & { args: readonly [role: `0x${string}`, account: `0x${string}`]; } & { address: Address; } & { data: import("../../index.js").Hex; to: Address; }; /** * Extracts the events from the logs. * * @param logs - Logs. * @returns The events. */ function extractEvents(logs: Log[]): import("../../utils/abi/parseEventLogs.js").ParseEventLogsReturnType; } /** * Revokes a role for a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.revokeRolesSync(client, { * token: '0x...', * from: '0x...', * roles: ['issuer'], * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction receipt and event data. */ export declare function revokeRolesSync(client: Client, parameters: revokeRolesSync.Parameters): Promise; export declare namespace revokeRolesSync { type Parameters = revokeRoles.Parameters; type Args = revokeRoles.Args; type ReturnValue = { receipt: TransactionReceipt; value: readonly GetEventArgs[]; }; type ErrorType = BaseErrorType; } /** * Sets the supply cap for a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.setSupplyCap(client, { * token: '0x...', * supplyCap: 1000000n, * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction hash. */ export declare function setSupplyCap(client: Client, parameters: setSupplyCap.Parameters): Promise; export declare namespace setSupplyCap { type Parameters = WriteParameters & Args; type Args = { /** New supply cap. */ supplyCap: bigint; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; type ReturnValue = WriteContractReturnType; type ErrorType = BaseErrorType; /** @internal */ function inner(action: action, client: Client, parameters: setSupplyCap.Parameters): Promise>; /** * Defines a call to the `setSupplyCap` function. * * Can be passed as a parameter to: * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls * * @example * ```ts * import { createClient, http, walletActions } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }).extend(walletActions) * * const { result } = await client.sendCalls({ * calls: [ * actions.token.setSupplyCap.call({ * token: '0x20c0...babe', * supplyCap: 1000000n, * }), * ] * }) * ``` * * @param args - Arguments. * @returns The call. */ function call(args: Args): { abi: [{ readonly name: "setSupplyCap"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "uint256"; readonly name: "newSupplyCap"; }]; readonly outputs: readonly []; }]; functionName: "setSupplyCap"; } & { args: readonly [bigint]; } & { address: Address; } & { data: import("../../index.js").Hex; to: Address; }; /** * Extracts the event from the logs. * * @param logs - Logs. * @returns The event. */ function extractEvent(logs: Log[]): Log; } /** * Sets the supply cap for a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.setSupplyCapSync(client, { * token: '0x...', * supplyCap: 1000000n, * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction receipt and event data. */ export declare function setSupplyCapSync(client: Client, parameters: setSupplyCapSync.Parameters): Promise; export declare namespace setSupplyCapSync { type Parameters = setSupplyCap.Parameters; type Args = setSupplyCap.Args; type ReturnValue = GetEventArgs & { receipt: TransactionReceipt; }; type ErrorType = BaseErrorType; } /** * Sets the admin role for a specific role in a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.setRoleAdmin(client, { * token: '0x...', * role: 'issuer', * adminRole: 'admin', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction hash. */ export declare function setRoleAdmin(client: Client, parameters: setRoleAdmin.Parameters): Promise; export declare namespace setRoleAdmin { type Parameters = WriteParameters & Args; type Args = { /** New admin role. */ adminRole: TokenRole.TokenRole; /** Role to set admin for. */ role: TokenRole.TokenRole; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; type ReturnValue = WriteContractReturnType; type ErrorType = BaseErrorType; /** @internal */ function inner(action: action, client: Client, parameters: setRoleAdmin.Parameters): Promise>; /** * Defines a call to the `setRoleAdmin` function. * * Can be passed as a parameter to: * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls * * @example * ```ts * import { createClient, http, walletActions } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }).extend(walletActions) * * const { result } = await client.sendCalls({ * calls: [ * actions.token.setRoleAdmin.call({ * token: '0x20c0...babe', * role: 'issuer', * adminRole: 'admin', * }), * ] * }) * ``` * * @param args - Arguments. * @returns The call. */ function call(args: Args): { abi: [{ readonly name: "setRoleAdmin"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "bytes32"; readonly name: "role"; }, { readonly type: "bytes32"; readonly name: "adminRole"; }]; readonly outputs: readonly []; }]; functionName: "setRoleAdmin"; } & { args: readonly [role: `0x${string}`, `0x${string}`]; } & { address: Address; } & { data: import("../../index.js").Hex; to: Address; }; /** * Extracts the event from the logs. * * @param logs - Logs. * @returns The event. */ function extractEvent(logs: Log[]): Log; } /** * Sets the admin role for a specific role in a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.setRoleAdminSync(client, { * token: '0x...', * role: 'issuer', * adminRole: 'admin', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction receipt and event data. */ export declare function setRoleAdminSync(client: Client, parameters: setRoleAdminSync.Parameters): Promise; export declare namespace setRoleAdminSync { type Parameters = setRoleAdmin.Parameters; type Args = setRoleAdmin.Args; type ReturnValue = GetEventArgs & { receipt: TransactionReceipt; }; type ErrorType = BaseErrorType; } /** * Transfers TIP20 tokens to another address. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.transfer(client, { * to: '0x...', * amount: 100n, * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction hash. */ export declare function transfer(client: Client, parameters: transfer.Parameters): Promise; export declare namespace transfer { type Parameters = WriteParameters & Args; type Args = { /** Amount of tokens to transfer. */ amount: bigint; /** Address to transfer tokens from. */ from?: Address | undefined; /** Memo to include in the transfer. */ memo?: Hex.Hex | undefined; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; /** Address to transfer tokens to. */ to: Address; }; type ReturnValue = WriteContractReturnType; type ErrorType = BaseErrorType; /** @internal */ function inner(action: action, client: Client, parameters: transfer.Parameters): Promise>; /** * Defines a call to the `transfer`, `transferFrom`, `transferWithMemo`, or `transferFromWithMemo` function. * * Can be passed as a parameter to: * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls * * @example * ```ts * import { createClient, http, walletActions } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }).extend(walletActions) * * const { result } = await client.sendCalls({ * calls: [ * actions.token.transfer.call({ * to: '0x20c0...beef', * amount: 100n, * token: '0x20c0...babe', * }), * ] * }) * ``` * * @param args - Arguments. * @returns The call. */ function call(args: Args): { abi: [{ readonly name: "transfer"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "address"; readonly name: "to"; }, { readonly type: "uint256"; readonly name: "amount"; }]; readonly outputs: readonly [{ readonly type: "bool"; }]; } | { readonly name: "transferFrom"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "address"; readonly name: "from"; }, { readonly type: "address"; readonly name: "to"; }, { readonly type: "uint256"; readonly name: "amount"; }]; readonly outputs: readonly [{ readonly type: "bool"; }]; } | { readonly name: "transferWithMemo"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "address"; readonly name: "to"; }, { readonly type: "uint256"; readonly name: "amount"; }, { readonly type: "bytes32"; readonly name: "memo"; }]; readonly outputs: readonly []; } | { readonly name: "transferFromWithMemo"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "address"; readonly name: "from"; }, { readonly type: "address"; readonly name: "to"; }, { readonly type: "uint256"; readonly name: "amount"; }, { readonly type: "bytes32"; readonly name: "memo"; }]; readonly outputs: readonly [{ readonly type: "bool"; }]; }]; functionName: "transfer" | "transferFrom" | "transferWithMemo" | "transferFromWithMemo"; } & { args: readonly [to: `0x${string}`, amount: bigint] | readonly [to: `0x${string}`, amount: bigint, memo: `0x${string}`] | readonly [from: `0x${string}`, to: `0x${string}`, amount: bigint] | readonly [from: `0x${string}`, to: `0x${string}`, amount: bigint, memo: `0x${string}`]; } & { address: Address; } & { data: import("../../index.js").Hex; to: Address; }; /** * Extracts the event from the logs. * * @param logs - Logs. * @returns The event. */ function extractEvent(logs: Log[]): Log; } /** * Transfers TIP20 tokens to another address. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.transferSync(client, { * to: '0x...', * amount: 100n, * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction receipt and event data. */ export declare function transferSync(client: Client, parameters: transferSync.Parameters): Promise; export declare namespace transferSync { type Parameters = transfer.Parameters; type Args = transfer.Args; type ReturnValue = GetEventArgs & { receipt: TransactionReceipt; }; type ErrorType = BaseErrorType; } /** * Unpauses a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.unpause(client, { * token: '0x...', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction hash. */ export declare function unpause(client: Client, parameters: unpause.Parameters): Promise; export declare namespace unpause { type Parameters = WriteParameters & Args; type Args = { /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; type ReturnValue = WriteContractReturnType; type ErrorType = BaseErrorType; /** @internal */ function inner(action: action, client: Client, parameters: unpause.Parameters): Promise>; /** * Defines a call to the `unpause` function. * * Can be passed as a parameter to: * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls * * @example * ```ts * import { createClient, http, walletActions } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }).extend(walletActions) * * const { result } = await client.sendCalls({ * calls: [ * actions.token.unpause.call({ * token: '0x20c0...babe', * }), * ] * }) * ``` * * @param args - Arguments. * @returns The call. */ function call(args: Args): { abi: [{ readonly name: "unpause"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly []; readonly outputs: readonly []; }]; functionName: "unpause"; } & { args?: readonly [] | undefined; } & { address: Address; } & { data: import("../../index.js").Hex; to: Address; }; /** * Extracts the event from the logs. * * @param logs - Logs. * @returns The event. */ function extractEvent(logs: Log[]): Log; } /** * Unpauses a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.unpauseSync(client, { * token: '0x...', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction receipt and event data. */ export declare function unpauseSync(client: Client, parameters: unpauseSync.Parameters): Promise; export declare namespace unpauseSync { type Parameters = unpause.Parameters; type Args = unpause.Args; type ReturnValue = GetEventArgs & { receipt: TransactionReceipt; }; type ErrorType = BaseErrorType; } /** * Updates the quote token for a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.prepareUpdateQuoteToken(client, { * token: '0x...', * quoteToken: '0x...', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction hash. */ export declare function prepareUpdateQuoteToken(client: Client, parameters: prepareUpdateQuoteToken.Parameters): Promise; export declare namespace prepareUpdateQuoteToken { type Parameters = WriteParameters & Args; type Args = { /** New quote token address. */ quoteToken: TokenId.TokenIdOrAddress; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; type ReturnValue = WriteContractReturnType; type ErrorType = BaseErrorType; /** @internal */ function inner(action: action, client: Client, parameters: prepareUpdateQuoteToken.Parameters): Promise>; /** * Defines a call to the `prepareUpdateQuoteToken` function. * * Can be passed as a parameter to: * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls * * @example * ```ts * import { createClient, http, walletActions } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }).extend(walletActions) * * const { result } = await client.sendCalls({ * calls: [ * actions.token.prepareUpdateQuoteToken.call({ * token: '0x20c0...babe', * quoteToken: '0x20c0...cafe', * }), * ] * }) * ``` * * @param args - Arguments. * @returns The call. */ function call(args: Args): { abi: [{ readonly name: "setNextQuoteToken"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "address"; readonly name: "newQuoteToken"; }]; readonly outputs: readonly []; }]; functionName: "setNextQuoteToken"; } & { args: readonly [`0x${string}`]; } & { address: Address; } & { data: import("../../index.js").Hex; to: Address; }; /** * Extracts the event from the logs. * * @param logs - Logs. * @returns The event. */ function extractEvent(logs: Log[]): Log; } /** * Updates the quote token for a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.prepareUpdateQuoteTokenSync(client, { * token: '0x...', * quoteToken: '0x...', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction receipt and event data. */ export declare function prepareUpdateQuoteTokenSync(client: Client, parameters: prepareUpdateQuoteTokenSync.Parameters): Promise; export declare namespace prepareUpdateQuoteTokenSync { type Parameters = prepareUpdateQuoteToken.Parameters; type Args = prepareUpdateQuoteToken.Args; type ReturnValue = Compute & { receipt: TransactionReceipt; }>; type ErrorType = BaseErrorType; } /** * Updates the quote token for a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.updateQuoteToken(client, { * token: '0x...', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction hash. */ export declare function updateQuoteToken(client: Client, parameters: updateQuoteToken.Parameters): Promise; export declare namespace updateQuoteToken { type Parameters = WriteParameters & Args; type Args = { /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; type ReturnValue = WriteContractReturnType; type ErrorType = BaseErrorType; /** @internal */ function inner(action: action, client: Client, parameters: updateQuoteToken.Parameters): Promise>; /** * Defines a call to the `updateQuoteToken` function. * * Can be passed as a parameter to: * - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call * - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call * - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls * * @example * ```ts * import { createClient, http, walletActions } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }).extend(walletActions) * * const { result } = await client.sendCalls({ * calls: [ * actions.token.updateQuoteToken.call({ * token: '0x20c0...babe', * }), * ] * }) * ``` * * @param args - Arguments. * @returns The call. */ function call(args: Args): { abi: [{ readonly name: "completeQuoteTokenUpdate"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly []; readonly outputs: readonly []; }]; functionName: "completeQuoteTokenUpdate"; } & { args?: readonly [] | undefined; } & { address: Address; } & { data: import("../../index.js").Hex; to: Address; }; /** * Extracts the event from the logs. * * @param logs - Logs. * @returns The event. */ function extractEvent(logs: Log[]): Log; } /** * Updates the quote token for a TIP20 token. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * import { privateKeyToAccount } from 'viem/accounts' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const result = await Actions.token.updateQuoteTokenSync(client, { * token: '0x...', * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns The transaction receipt and event data. */ export declare function updateQuoteTokenSync(client: Client, parameters: updateQuoteTokenSync.Parameters): Promise; export declare namespace updateQuoteTokenSync { type Parameters = updateQuoteToken.Parameters; type Args = updateQuoteToken.Args; type ReturnValue = Compute & { receipt: TransactionReceipt; }>; type ErrorType = BaseErrorType; } /** * Watches for TIP20 token approval events. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const unwatch = actions.token.watchApprove(client, { * onApproval: (args, log) => { * console.log('Approval:', args) * }, * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns A function to unsubscribe from the event. */ export declare function watchApprove(client: Client, parameters: watchApprove.Parameters): WatchContractEventReturnType; export declare namespace watchApprove { type Args = GetEventArgs; type Log = viem_Log, true>; type Parameters = UnionOmit, 'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'> & { /** Callback to invoke when tokens are approved. */ onApproval: (args: Args, log: Log) => void; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; } /** * Watches for TIP20 token burn events. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const unwatch = actions.token.watchBurn(client, { * onBurn: (args, log) => { * console.log('Burn:', args) * }, * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns A function to unsubscribe from the event. */ export declare function watchBurn(client: Client, parameters: watchBurn.Parameters): WatchContractEventReturnType; export declare namespace watchBurn { type Args = GetEventArgs; type Log = viem_Log, true>; type Parameters = UnionOmit, 'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'> & { /** Callback to invoke when tokens are burned. */ onBurn: (args: Args, log: Log) => void; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; } /** * Watches for new TIP20 tokens created. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const unwatch = actions.token.watchCreate(client, { * onTokenCreated: (args, log) => { * console.log('Token created:', args) * }, * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns A function to unsubscribe from the event. */ export declare function watchCreate(client: Client, parameters: watchCreate.Parameters): WatchContractEventReturnType; export declare namespace watchCreate { type Args = GetEventArgs; type Log = viem_Log, true>; type Parameters = UnionOmit, 'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'> & { /** Callback to invoke when a new TIP20 token is created. */ onTokenCreated: (args: Args, log: Log) => void; }; } /** * Watches for TIP20 token mint events. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const unwatch = actions.token.watchMint(client, { * onMint: (args, log) => { * console.log('Mint:', args) * }, * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns A function to unsubscribe from the event. */ export declare function watchMint(client: Client, parameters: watchMint.Parameters): WatchContractEventReturnType; export declare namespace watchMint { type Args = GetEventArgs; type Log = viem_Log, true>; type Parameters = UnionOmit, 'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'> & { /** Callback to invoke when tokens are minted. */ onMint: (args: Args, log: Log) => void; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; type ReturnValue = WatchContractEventReturnType; } /** * Watches for TIP20 token role admin updates. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const unwatch = actions.token.watchAdminRole(client, { * onRoleAdminUpdated: (args, log) => { * console.log('Role admin updated:', args) * }, * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns A function to unsubscribe from the event. */ export declare function watchAdminRole(client: Client, parameters: watchAdminRole.Parameters): WatchContractEventReturnType; export declare namespace watchAdminRole { type Args = GetEventArgs; type Log = viem_Log, true>; type Parameters = UnionOmit, 'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'> & { /** Callback to invoke when a role admin is updated. */ onRoleAdminUpdated: (args: Args, log: Log) => void; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; } /** * Watches for TIP20 token role membership updates. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const unwatch = actions.token.watchRole(client, { * onRoleUpdated: (args, log) => { * console.log('Role updated:', args) * }, * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns A function to unsubscribe from the event. */ export declare function watchRole(client: Client, parameters: watchRole.Parameters): WatchContractEventReturnType; export declare namespace watchRole { type Args = GetEventArgs & { /** Type of role update. */ type: 'granted' | 'revoked'; }; type Log = viem_Log, true>; type Parameters = UnionOmit, 'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'> & { /** Callback to invoke when a role membership is updated. */ onRoleUpdated: (args: Args, log: Log) => void; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; } /** * Watches for TIP20 token transfer events. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * account: privateKeyToAccount('0x...'), * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const unwatch = actions.token.watchTransfer(client, { * onTransfer: (args, log) => { * console.log('Transfer:', args) * }, * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns A function to unsubscribe from the event. */ export declare function watchTransfer(client: Client, parameters: watchTransfer.Parameters): WatchContractEventReturnType; export declare namespace watchTransfer { type Args = GetEventArgs; type Log = viem_Log, true>; type Parameters = UnionOmit, 'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'> & { /** Callback to invoke when tokens are transferred. */ onTransfer: (args: Args, log: Log) => void; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; } /** * Watches for TIP20 token quote token update events. * * @example * ```ts * import { createClient, http } from 'viem' * import { tempo } from 'viem/chains' * import { Actions } from 'viem/tempo' * * const client = createClient({ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }) * transport: http(), * }) * * const unwatch = actions.token.watchUpdateQuoteToken(client, { * onUpdateQuoteToken: (args, log) => { * if (args.completed) * console.log('quote token update completed:', args.newQuoteToken) * else * console.log('quote token update proposed:', args.newQuoteToken) * }, * }) * ``` * * @param client - Client. * @param parameters - Parameters. * @returns A function to unsubscribe from the event. */ export declare function watchUpdateQuoteToken(client: Client, parameters: watchUpdateQuoteToken.Parameters): WatchContractEventReturnType; export declare namespace watchUpdateQuoteToken { type Args = OneOf | GetEventArgs> & { /** Whether the update has been completed. */ completed: boolean; }; type Log = viem_Log; type Parameters = UnionOmit, 'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'> & { /** Callback to invoke when a quote token update is proposed or completed. */ onUpdateQuoteToken: (args: Args, log: Log) => void; /** Address or ID of the TIP20 token. */ token: TokenId.TokenIdOrAddress; }; } //# sourceMappingURL=token.d.ts.map