@funkit/core 2.3.6 → 2.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1019 -719
- package/dist/index.js.map +4 -4
- package/dist/src/actions/AccessControl.d.ts +1 -1
- package/dist/src/actions/FirstClassActions.d.ts +1 -1
- package/dist/src/actions/Token.d.ts +6 -5
- package/dist/src/auth/Auth.d.ts +4 -4
- package/dist/src/config/types.d.ts +4 -1
- package/dist/src/data/Chain.d.ts +12 -11
- package/dist/src/data/NFT.d.ts +2 -2
- package/dist/src/data/Operation.d.ts +1 -1
- package/dist/src/data/Token.d.ts +17 -16
- package/dist/src/utils/ApiUtils.d.ts +1 -6
- package/dist/src/utils/AuthUtils.d.ts +2 -1
- package/dist/src/utils/ChainUtils.d.ts +3 -3
- package/dist/src/utils/GroupUtils.d.ts +2 -1
- package/dist/src/utils/TokenUtils.d.ts +2 -1
- package/dist/src/utils/UserOpUtils.d.ts +2 -7
- package/dist/src/utils/WalletUtils.d.ts +2 -1
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/viem/ContractInterface.d.ts +6 -5
- package/dist/src/wallet/FunWallet.d.ts +6 -6
- package/package.json +3 -3
|
@@ -4,7 +4,7 @@ import { type TransactionParams } from '../common';
|
|
|
4
4
|
import type { EnvOption } from '../config';
|
|
5
5
|
import { MerkleTree } from '../utils/MerkleUtils';
|
|
6
6
|
import type { AddOwnerParams, RemoveOwnerParams, SessionKeyParams } from './types';
|
|
7
|
-
export declare const createFeeRecipientAndTokenMerkleTree: (params: SessionKeyParams) => Promise<MerkleTree>;
|
|
7
|
+
export declare const createFeeRecipientAndTokenMerkleTree: (params: SessionKeyParams, txOptions?: EnvOption) => Promise<MerkleTree>;
|
|
8
8
|
export declare const createTargetSelectorMerkleTree: (params: SessionKeyParams) => MerkleTree;
|
|
9
9
|
export declare const createSessionKeyTransactionParams: (params: SessionKeyParams, txOptions?: EnvOption) => Promise<TransactionParams>;
|
|
10
10
|
export declare const createSessionUser: (auth: AuthInput, params: SessionKeyParams) => Promise<SessionKeyAuth>;
|
|
@@ -21,7 +21,7 @@ export declare abstract class FirstClassActions {
|
|
|
21
21
|
* If the address is not already cached, it fetches it using the wallet's unique ID and chain information.
|
|
22
22
|
* @returns {Promise<Address>} The wallet address.
|
|
23
23
|
*/
|
|
24
|
-
abstract getAddress(): Promise<Address>;
|
|
24
|
+
abstract getAddress(options?: EnvOption): Promise<Address>;
|
|
25
25
|
/**
|
|
26
26
|
* Initiates a transfer operation and returns the prepared operation for execution.
|
|
27
27
|
* @param {Auth} auth - The authentication instance for the user.
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { type TransactionParams } from '../common';
|
|
2
|
+
import type { EnvOption } from '../config';
|
|
2
3
|
import { Chain } from '../data/Chain';
|
|
3
4
|
import type { ApproveERC20Params, ApproveERC721Params, ApproveParams, ERC721TransferParams, TokenTransferParams, TransferParams } from './types';
|
|
4
5
|
export declare const isERC721TransferParams: (obj: TransferParams) => obj is ERC721TransferParams;
|
|
5
6
|
export declare const isTokenTransferParams: (obj: TransferParams) => obj is TokenTransferParams;
|
|
6
|
-
export declare const erc721TransferTransactionParams: (params: ERC721TransferParams) => Promise<TransactionParams>;
|
|
7
|
-
export declare const tokenTransferTransactionParams: (params: TokenTransferParams, chain: Chain) => Promise<TransactionParams>;
|
|
8
|
-
export declare const tokenTransferFromTransactionParams: (params: TokenTransferParams, chain: Chain) => Promise<TransactionParams>;
|
|
7
|
+
export declare const erc721TransferTransactionParams: (params: ERC721TransferParams, options?: EnvOption) => Promise<TransactionParams>;
|
|
8
|
+
export declare const tokenTransferTransactionParams: (params: TokenTransferParams, chain: Chain, options?: EnvOption) => Promise<TransactionParams>;
|
|
9
|
+
export declare const tokenTransferFromTransactionParams: (params: TokenTransferParams, chain: Chain, options?: EnvOption) => Promise<TransactionParams>;
|
|
9
10
|
export declare const isERC20ApproveParams: (obj: ApproveParams) => obj is ApproveERC20Params;
|
|
10
11
|
export declare const isERC721ApproveParams: (obj: ApproveParams) => obj is ApproveERC721Params;
|
|
11
|
-
export declare const erc20ApproveTransactionParams: (params: ApproveERC20Params) => Promise<TransactionParams>;
|
|
12
|
-
export declare const erc721ApproveTransactionParams: (params: ApproveERC721Params) => Promise<TransactionParams>;
|
|
12
|
+
export declare const erc20ApproveTransactionParams: (params: ApproveERC20Params, options?: EnvOption) => Promise<TransactionParams>;
|
|
13
|
+
export declare const erc721ApproveTransactionParams: (params: ApproveERC721Params, options?: EnvOption) => Promise<TransactionParams>;
|
package/dist/src/auth/Auth.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare class Auth {
|
|
|
26
26
|
* @param {boolean} isGroupOp - Whether the operation is a group operation (default: false).
|
|
27
27
|
* @returns {Promise<Hex>} The signature of the operation.
|
|
28
28
|
*/
|
|
29
|
-
signOp(operation: Operation, chain: Chain, isGroupOp?: boolean): Promise<Hex>;
|
|
29
|
+
signOp(operation: Operation, chain: Chain, isGroupOp?: boolean, options?: EnvOption): Promise<Hex>;
|
|
30
30
|
/**
|
|
31
31
|
* Retrieves the address associated with the initialized signer or client.
|
|
32
32
|
* @returns {Promise<Address>} The address associated with the signer or client.
|
|
@@ -51,7 +51,7 @@ export declare class Auth {
|
|
|
51
51
|
* @param {boolean} skipDBActions - Whether to skip database actions (default: false).
|
|
52
52
|
* @returns {Promise<Hex>} The generated unique ID for the wallet.
|
|
53
53
|
*/
|
|
54
|
-
getWalletUniqueId(index?: number, skipDBActions?: boolean): Promise<Hex>;
|
|
54
|
+
getWalletUniqueId(index?: number, skipDBActions?: boolean, options?: EnvOption): Promise<Hex>;
|
|
55
55
|
/**
|
|
56
56
|
* Sends a transaction with the provided transaction data and options.
|
|
57
57
|
* @param {TransactionParams} txData - The transaction data including 'to', 'data', and 'value'.
|
|
@@ -71,11 +71,11 @@ export declare class Auth {
|
|
|
71
71
|
* @param {string} chainId - The chain identifier.
|
|
72
72
|
* @returns {Promise<Hex[]>} An array of user IDs associated with the wallet address.
|
|
73
73
|
*/
|
|
74
|
-
getUserIds(wallet: Address, chainId: string): Promise<Hex[]>;
|
|
74
|
+
getUserIds(wallet: Address, chainId: string, options?: EnvOption): Promise<Hex[]>;
|
|
75
75
|
/**
|
|
76
76
|
* Retrieves the wallets associated with the current auth object.
|
|
77
77
|
* @param {string} [chainId] - Optional chain identifier.
|
|
78
78
|
* @returns {Promise<Wallet[]>} An array of wallet objects associated with the address.
|
|
79
79
|
*/
|
|
80
|
-
getWallets(chainId?: string): Promise<Wallet[]>;
|
|
80
|
+
getWallets(chainId?: string, options?: EnvOption): Promise<Wallet[]>;
|
|
81
81
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Logger } from '@funkit/api-base';
|
|
1
2
|
import type { Address } from 'viem';
|
|
2
3
|
import type { Chain } from '../data';
|
|
3
4
|
export interface EnvOption {
|
|
@@ -17,7 +18,9 @@ export interface EnvOption {
|
|
|
17
18
|
skipDBAction?: boolean;
|
|
18
19
|
nonce?: bigint;
|
|
19
20
|
bypassInit?: boolean;
|
|
21
|
+
logger?: Logger;
|
|
22
|
+
signal?: AbortSignal;
|
|
20
23
|
}
|
|
21
|
-
export interface GlobalEnvOption extends EnvOption {
|
|
24
|
+
export interface GlobalEnvOption extends Omit<EnvOption, 'signal'> {
|
|
22
25
|
apiKey?: string;
|
|
23
26
|
}
|
package/dist/src/data/Chain.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Address, type Hex, type PublicClient } from 'viem';
|
|
2
2
|
import { type UserOperation, type UserOperationGasPrice } from '@funkit/api-base';
|
|
3
3
|
import { type EstimateGasResult } from '../common';
|
|
4
|
+
import type { EnvOption } from '../config';
|
|
4
5
|
import type { ChainInput } from './types';
|
|
5
6
|
export declare class Chain {
|
|
6
7
|
private initialized;
|
|
@@ -12,18 +13,18 @@ export declare class Chain {
|
|
|
12
13
|
private client?;
|
|
13
14
|
private static chain;
|
|
14
15
|
private constructor();
|
|
15
|
-
static getChain(chainInput: ChainInput): Promise<Chain>;
|
|
16
|
+
static getChain(chainInput: ChainInput, options?: EnvOption): Promise<Chain>;
|
|
16
17
|
private init;
|
|
17
18
|
private loadChainFromRpc;
|
|
18
19
|
private loadChain;
|
|
19
|
-
getChainId(): Promise<string>;
|
|
20
|
-
getChainName(): Promise<string>;
|
|
21
|
-
getRpcUrl(): Promise<string>;
|
|
22
|
-
getAddress(name: string): Promise<Address>;
|
|
23
|
-
getCurrency(): Promise<string>;
|
|
24
|
-
getClient(): Promise<PublicClient>;
|
|
25
|
-
getFeeData(): Promise<UserOperationGasPrice>;
|
|
26
|
-
estimateOpGas(partialOp: UserOperation): Promise<EstimateGasResult>;
|
|
27
|
-
getTxId(userOpHash: string, timeout?: number, interval?: number, fromBlock?: bigint): Promise<Hex | null>;
|
|
28
|
-
addressIsContract(address: Address): Promise<boolean>;
|
|
20
|
+
getChainId(options?: EnvOption): Promise<string>;
|
|
21
|
+
getChainName(options?: EnvOption): Promise<string>;
|
|
22
|
+
getRpcUrl(options?: EnvOption): Promise<string>;
|
|
23
|
+
getAddress(name: string, options?: EnvOption): Promise<Address>;
|
|
24
|
+
getCurrency(options?: EnvOption): Promise<string>;
|
|
25
|
+
getClient(options?: EnvOption): Promise<PublicClient>;
|
|
26
|
+
getFeeData(options?: EnvOption): Promise<UserOperationGasPrice>;
|
|
27
|
+
estimateOpGas(partialOp: UserOperation, options?: EnvOption): Promise<EstimateGasResult>;
|
|
28
|
+
getTxId(userOpHash: string, timeout?: number, interval?: number, fromBlock?: bigint, options?: EnvOption): Promise<Hex | null>;
|
|
29
|
+
addressIsContract(address: Address, options?: EnvOption): Promise<boolean>;
|
|
29
30
|
}
|
package/dist/src/data/NFT.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare class NFT {
|
|
|
11
11
|
approveForAll(spender: string, options?: EnvOption): Promise<TransactionParams & {
|
|
12
12
|
chain: Chain;
|
|
13
13
|
}>;
|
|
14
|
-
getAddress(): Promise<Address>;
|
|
14
|
+
getAddress(options?: EnvOption): Promise<Address>;
|
|
15
15
|
getName(options?: EnvOption): Promise<string>;
|
|
16
16
|
getBalance(address: Address, options?: EnvOption): Promise<bigint>;
|
|
17
17
|
getApproved(tokenId: string, options?: EnvOption): Promise<Address>;
|
|
@@ -21,7 +21,7 @@ export declare class NFT {
|
|
|
21
21
|
}>;
|
|
22
22
|
static approve(data: string, spender: string, tokenId: number, options?: EnvOption): Promise<TransactionData>;
|
|
23
23
|
static approveForAll(data: string, spender: string, options?: EnvOption): Promise<TransactionData>;
|
|
24
|
-
static getAddress(data: string): Promise<Address>;
|
|
24
|
+
static getAddress(data: string, options?: EnvOption): Promise<Address>;
|
|
25
25
|
static getApproved(data: string, tokenId: string, options?: EnvOption): Promise<string>;
|
|
26
26
|
static revokeForAll(data: string, spender: string, options?: EnvOption): Promise<TransactionData>;
|
|
27
27
|
static transfer(data: string, sender: string, spender: string, tokenId: number, options?: EnvOption): Promise<TransactionData>;
|
|
@@ -27,7 +27,7 @@ export declare class Operation implements OperationData {
|
|
|
27
27
|
executedBlockTimeStamp?: number;
|
|
28
28
|
constructor(userOp: UserOperation, metadata: OperationMetadata);
|
|
29
29
|
static convertTypeToObject(op: OperationData): Operation;
|
|
30
|
-
getOpHash(chain: Chain): Promise<Hex>;
|
|
30
|
+
getOpHash(chain: Chain, options?: EnvOption): Promise<Hex>;
|
|
31
31
|
getMaxTxCost(): bigint;
|
|
32
32
|
estimateGas(auth: Auth, userId: string, options?: EnvOption): Promise<Operation>;
|
|
33
33
|
}
|
package/dist/src/data/Token.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Address } from 'viem';
|
|
2
2
|
import { type TransactionParams } from '../common';
|
|
3
|
+
import type { EnvOption } from '../config';
|
|
3
4
|
import type { Chain } from './Chain';
|
|
4
5
|
export declare class Token {
|
|
5
6
|
address?: Address;
|
|
@@ -7,21 +8,21 @@ export declare class Token {
|
|
|
7
8
|
isNative: boolean;
|
|
8
9
|
symbol: string;
|
|
9
10
|
constructor(input: Address | string, chain: Chain);
|
|
10
|
-
getAddress(): Promise<Address>;
|
|
11
|
-
getDecimals(): Promise<bigint>;
|
|
12
|
-
getBalance(address: Address): Promise<string>;
|
|
13
|
-
getBalanceBN(address: Address): Promise<bigint>;
|
|
14
|
-
getApproval(owner: string, spender: string): Promise<bigint>;
|
|
15
|
-
getDecimalAmount(amount: number | string): Promise<bigint>;
|
|
16
|
-
approve(spender: string, amount: number): Promise<TransactionParams>;
|
|
17
|
-
transfer(spender: string, amount: number): Promise<TransactionParams>;
|
|
18
|
-
static getAddress(data: string, chain: Chain): Promise<Address>;
|
|
19
|
-
static getDecimals(data: string, chain: Chain): Promise<bigint>;
|
|
20
|
-
static getBalance(data: string, address: Address, chain: Chain): Promise<string>;
|
|
21
|
-
static getBalanceBN(data: string, address: Address, chain: Chain): Promise<bigint>;
|
|
22
|
-
static getApproval(data: string, owner: string, spender: string, chain: Chain): Promise<bigint>;
|
|
23
|
-
static getDecimalAmount(data: string, amount: number, chain: Chain): Promise<bigint>;
|
|
24
|
-
static approve(data: string, spender: string, amount: number, chain: Chain): Promise<TransactionParams>;
|
|
25
|
-
static transfer(data: string, spender: string, amount: number, chain: Chain): Promise<TransactionParams>;
|
|
11
|
+
getAddress(options?: EnvOption): Promise<Address>;
|
|
12
|
+
getDecimals(options?: EnvOption): Promise<bigint>;
|
|
13
|
+
getBalance(address: Address, options?: EnvOption): Promise<string>;
|
|
14
|
+
getBalanceBN(address: Address, options?: EnvOption): Promise<bigint>;
|
|
15
|
+
getApproval(owner: string, spender: string, options?: EnvOption): Promise<bigint>;
|
|
16
|
+
getDecimalAmount(amount: number | string, options?: EnvOption): Promise<bigint>;
|
|
17
|
+
approve(spender: string, amount: number, options?: EnvOption): Promise<TransactionParams>;
|
|
18
|
+
transfer(spender: string, amount: number, options?: EnvOption): Promise<TransactionParams>;
|
|
19
|
+
static getAddress(data: string, chain: Chain, options?: EnvOption): Promise<Address>;
|
|
20
|
+
static getDecimals(data: string, chain: Chain, options?: EnvOption): Promise<bigint>;
|
|
21
|
+
static getBalance(data: string, address: Address, chain: Chain, options?: EnvOption): Promise<string>;
|
|
22
|
+
static getBalanceBN(data: string, address: Address, chain: Chain, options?: EnvOption): Promise<bigint>;
|
|
23
|
+
static getApproval(data: string, owner: string, spender: string, chain: Chain, options?: EnvOption): Promise<bigint>;
|
|
24
|
+
static getDecimalAmount(data: string, amount: number, chain: Chain, options?: EnvOption): Promise<bigint>;
|
|
25
|
+
static approve(data: string, spender: string, amount: number, chain: Chain, options?: EnvOption): Promise<TransactionParams>;
|
|
26
|
+
static transfer(data: string, spender: string, amount: number, chain: Chain, options?: EnvOption): Promise<TransactionParams>;
|
|
26
27
|
static isNative(data: string): boolean;
|
|
27
28
|
}
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { PartialAttemptOptions } from '@lifeomic/attempt';
|
|
2
2
|
export declare const DEFAULT_RETRY_OPTIONS: PartialAttemptOptions<any>;
|
|
3
|
-
export declare const sendRequest: <Response>(uri: string, method: string, apiKey: string, body?: object, retryOptions?: PartialAttemptOptions<Response>) => Promise<Response>;
|
|
4
|
-
export declare function sendGetRequest<Response>(uri: string, endpoint: string, apiKey?: string, retryOptions?: PartialAttemptOptions<Response>): Promise<Response>;
|
|
5
|
-
export declare function sendPostRequest<Response>(uri: string, endpoint: string, body: object, apiKey?: string, retryOptions?: PartialAttemptOptions<Response>): Promise<Response>;
|
|
6
|
-
export declare function sendDeleteRequest(uri: string, endpoint: string, apiKey?: string): Promise<void>;
|
|
7
|
-
export declare function sendPutRequest(uri: string, endpoint: string, body: object, apiKey?: string): Promise<void>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { Hex } from 'viem';
|
|
2
|
-
|
|
2
|
+
import type { EnvOption } from 'src/config';
|
|
3
|
+
export declare const getAuthUniqueId: (authId: string, addr?: string, skipDBActions?: boolean, options?: EnvOption) => Promise<string>;
|
|
3
4
|
export declare const generatePrivateKey: () => Hex;
|
|
@@ -7,12 +7,12 @@ export declare const isAddress: (address: string) => boolean;
|
|
|
7
7
|
export declare const fundWallet: (auth: Auth, wallet: Auth | FunWallet, value: number, txOptions?: EnvOption) => Promise<import("viem").TransactionReceipt>;
|
|
8
8
|
export declare const isContract: (address: Address, client: PublicClient) => Promise<boolean>;
|
|
9
9
|
export declare const randomBytes: (length: number) => `0x${string}`;
|
|
10
|
-
export declare const getWalletPermitNonce: (walletAddr: Address, chain: Chain, nonceKey?: number) => Promise<bigint>;
|
|
10
|
+
export declare const getWalletPermitNonce: (walletAddr: Address, chain: Chain, nonceKey?: number, options?: EnvOption) => Promise<bigint>;
|
|
11
11
|
export declare const getPermitHash: (token: Address, to: Address, amount: bigint, nonce: bigint, walletAddr: Address, chainId: bigint) => `0x${string}`;
|
|
12
|
-
export declare const getGasStation: (gasStationUrl: string) => Promise<{
|
|
12
|
+
export declare const getGasStation: (gasStationUrl: string, options?: EnvOption) => Promise<{
|
|
13
13
|
standard: {
|
|
14
14
|
maxPriorityFee: number;
|
|
15
15
|
maxFee: number;
|
|
16
16
|
};
|
|
17
17
|
}>;
|
|
18
|
-
export declare const useFaucet: (chainIdentifier: Chain | number | string, wallet: FunWallet) => Promise<unknown[]>;
|
|
18
|
+
export declare const useFaucet: (chainIdentifier: Chain | number | string, wallet: FunWallet, txOptions?: EnvOption) => Promise<unknown[]>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Address, type Hex } from 'viem';
|
|
2
2
|
import type { GroupInfo } from '@funkit/api-base';
|
|
3
|
+
import type { EnvOption } from 'src/config';
|
|
3
4
|
import type { Chain } from '../data';
|
|
4
|
-
export declare function getOnChainGroupData(groupId: Hex, chain: Chain, walletAddr: Address): Promise<GroupInfo>;
|
|
5
|
+
export declare function getOnChainGroupData(groupId: Hex, chain: Chain, walletAddr: Address, options?: EnvOption): Promise<GroupInfo>;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import type { EnvOption } from '../config';
|
|
2
|
+
export declare function getTokenAddressBySymbolAndChainId(inputSymbol: any, inputChainId: any, options?: EnvOption): Promise<any>;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { type Hex } from 'viem';
|
|
2
2
|
import type { UserOperation } from '@funkit/api-base';
|
|
3
|
+
import type { EnvOption } from '../config';
|
|
3
4
|
import type { Chain } from '../data';
|
|
4
5
|
export declare const calcPreVerificationGas: (userOp: UserOperation) => bigint;
|
|
5
|
-
export declare function
|
|
6
|
-
gasUsed: string;
|
|
7
|
-
opFee: string;
|
|
8
|
-
opFeeUSD: string;
|
|
9
|
-
}>;
|
|
10
|
-
export declare const stringify: (object: unknown) => string;
|
|
11
|
-
export declare function getOpHash(chain: Chain, userOp: UserOperation): Promise<Hex>;
|
|
6
|
+
export declare function getOpHash(chain: Chain, userOp: UserOperation, options?: EnvOption): Promise<Hex>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Address, type Hex } from 'viem';
|
|
2
2
|
import { type Signature, type UserOperation } from '@funkit/api-base';
|
|
3
|
+
import type { EnvOption } from '../config';
|
|
3
4
|
import { type Chain, type Operation } from '../data';
|
|
4
5
|
export declare const generateRandomBytes32: () => Hex;
|
|
5
6
|
export declare const generateRandomWalletUniqueId: () => Hex;
|
|
@@ -8,7 +9,7 @@ export declare const generateRoleId: () => Hex;
|
|
|
8
9
|
export declare const generateRuleId: () => Hex;
|
|
9
10
|
export declare const generateRandomNonceKey: () => bigint;
|
|
10
11
|
export declare const generateRandomNonce: () => bigint;
|
|
11
|
-
export declare const getWalletAddress: (chain: Chain, walletUniqueId: Hex) => Promise<Address>;
|
|
12
|
+
export declare const getWalletAddress: (chain: Chain, walletUniqueId: Hex, options?: EnvOption) => Promise<Address>;
|
|
12
13
|
export declare const isWalletInitOp: (userOp: UserOperation) => boolean;
|
|
13
14
|
export declare const isGroupOperation: (operation: Operation) => boolean;
|
|
14
15
|
export declare const isSignatureMissing: (userId: Hex, signatures: Signature[] | undefined) => boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AbiError } from 'abitype';
|
|
2
2
|
import { type AbiEvent, type AbiFunction, type Address, type Hex, type Log, type PublicClient } from 'viem';
|
|
3
3
|
import type { TransactionParams } from '../common';
|
|
4
|
+
import type { EnvOption } from '../config';
|
|
4
5
|
import { Chain } from '../data';
|
|
5
6
|
type ChainReadCall = {
|
|
6
7
|
functionName: string;
|
|
@@ -9,12 +10,12 @@ type ChainReadCall = {
|
|
|
9
10
|
export declare class ContractInterface {
|
|
10
11
|
abi: ReadonlyArray<AbiError | AbiEvent | AbiFunction>;
|
|
11
12
|
constructor(abi: ReadonlyArray<any>);
|
|
12
|
-
readFromChain<T>(address: Address, functionName: string, args: unknown[], chainOrClient: Chain | PublicClient): Promise<T>;
|
|
13
|
-
batchReadFromChain<T extends unknown[]>(address: Address, chainOrClient: Chain | PublicClient, calls: ChainReadCall[]): Promise<T>;
|
|
13
|
+
readFromChain<T>(address: Address, functionName: string, args: unknown[], chainOrClient: Chain | PublicClient, options?: EnvOption): Promise<T>;
|
|
14
|
+
batchReadFromChain<T extends unknown[]>(address: Address, chainOrClient: Chain | PublicClient, calls: ChainReadCall[], options?: EnvOption): Promise<T>;
|
|
14
15
|
encodeTransactionParams(address: Address, functionName: string, args: unknown[], value?: bigint): TransactionParams;
|
|
15
16
|
encodeData(functionName: string, args: unknown[]): Hex;
|
|
16
|
-
createFilter(address: Address, eventName: string, args: unknown[], chainOrClient: PublicClient | Chain, fromBlock: bigint): Promise<import("viem").CreateContractEventFilterReturnType<readonly (AbiEvent | AbiFunction | AbiError)[], string, unknown[], undefined, bigint, undefined>>;
|
|
17
|
-
getLog(address: Address, name: string, args: ReadonlyArray<unknown> | Record<string, unknown> | undefined, chainOrClient: PublicClient | Chain, fromBlock: bigint): Promise<Log[]>;
|
|
17
|
+
createFilter(address: Address, eventName: string, args: unknown[], chainOrClient: PublicClient | Chain, fromBlock: bigint, options?: EnvOption): Promise<import("viem").CreateContractEventFilterReturnType<readonly (AbiEvent | AbiFunction | AbiError)[], string, unknown[], undefined, bigint, undefined>>;
|
|
18
|
+
getLog(address: Address, name: string, args: ReadonlyArray<unknown> | Record<string, unknown> | undefined, chainOrClient: PublicClient | Chain, fromBlock: bigint, options?: EnvOption): Promise<Log[]>;
|
|
18
19
|
}
|
|
19
|
-
export declare const parseClient: (chainOrClient: PublicClient | Chain) => Promise<PublicClient>;
|
|
20
|
+
export declare const parseClient: (chainOrClient: PublicClient | Chain, options?: EnvOption) => Promise<PublicClient>;
|
|
20
21
|
export {};
|
|
@@ -28,7 +28,7 @@ export declare class FunWallet extends FirstClassActions {
|
|
|
28
28
|
* @param {string} apiKey - The API key to access the required resources.
|
|
29
29
|
* @returns {Promise<Address>} The wallet address.
|
|
30
30
|
*/
|
|
31
|
-
static getAddress(uniqueId: string, apiKey: string): Promise<Address>;
|
|
31
|
+
static getAddress(uniqueId: string, apiKey: string, options?: EnvOption): Promise<Address>;
|
|
32
32
|
/**
|
|
33
33
|
* Retrieves the wallet address associated with the provided unique ID in an offline environment.
|
|
34
34
|
* @param {string} uniqueId - The unique ID of the wallet.
|
|
@@ -36,21 +36,21 @@ export declare class FunWallet extends FirstClassActions {
|
|
|
36
36
|
* @param {Address} factoryAddress - The address of the factory contract.
|
|
37
37
|
* @returns {Promise<Address>} The wallet address.
|
|
38
38
|
*/
|
|
39
|
-
static getAddressOffline(uniqueId: string, rpcUrl: string, factoryAddress: Address): Promise<unknown>;
|
|
39
|
+
static getAddressOffline(uniqueId: string, rpcUrl: string, factoryAddress: Address, options?: EnvOption): Promise<unknown>;
|
|
40
40
|
/**
|
|
41
41
|
* Get all tokens for a specific chain
|
|
42
42
|
* @param {string} chainId string version of the chainId or ALL. If empty, then default to the one in globalEnvOption
|
|
43
43
|
* @param {boolean} onlyVerifiedTokens If true, only return alchemy tokens that are verified(filters spam) - defaults to false
|
|
44
44
|
* @returns JSON
|
|
45
45
|
*/
|
|
46
|
-
getTokens(chainIdInput?: string, onlyVerifiedTokens?: boolean): Promise<import("@funkit/api-base").GetAllWalletTokensResponse | import("@funkit/api-base").ChainAssetBalanceInfo>;
|
|
46
|
+
getTokens(chainIdInput?: string, onlyVerifiedTokens?: boolean, options?: EnvOption): Promise<import("@funkit/api-base").GetAllWalletTokensResponse | import("@funkit/api-base").ChainAssetBalanceInfo>;
|
|
47
47
|
/**
|
|
48
48
|
* Given an address and a chain, returns all NFTs owned by that address
|
|
49
49
|
* @param {string} chainId string version of the chainId or ALL. If empty, then default to the one in globalEnvOption
|
|
50
50
|
* @returns array
|
|
51
51
|
*/
|
|
52
|
-
getNFTs(chainIdInput?: string): Promise<import("@funkit/api-base").GetAllWalletNFTsResponse | import("@funkit/api-base").GetAllWalletNFTsByChainIdResponse>;
|
|
53
|
-
getLidoWithdrawals(): Promise<import("@funkit/api-base").GetWalletLidoWithdrawalsByChainIdResponse>;
|
|
52
|
+
getNFTs(chainIdInput?: string, options?: EnvOption): Promise<import("@funkit/api-base").GetAllWalletNFTsResponse | import("@funkit/api-base").GetAllWalletNFTsByChainIdResponse>;
|
|
53
|
+
getLidoWithdrawals(options?: EnvOption): Promise<import("@funkit/api-base").GetWalletLidoWithdrawalsByChainIdResponse>;
|
|
54
54
|
/**
|
|
55
55
|
* Get all tokens on all supported chains. Merge tokens by symbol
|
|
56
56
|
* @param {string} chainIdInput string version of the chainId or ALL. If empty, then default to the one in globalEnvOption
|
|
@@ -58,7 +58,7 @@ export declare class FunWallet extends FirstClassActions {
|
|
|
58
58
|
* @param {boolean} checkStatus true if you want to check if the address has any pending lido withdrawals
|
|
59
59
|
* @returns JSON of all tokens owned by address
|
|
60
60
|
*/
|
|
61
|
-
getAssets(chainIdInput?: string, onlyVerifiedTokens?: boolean, checkStatus?: boolean): Promise<{}>;
|
|
61
|
+
getAssets(chainIdInput?: string, onlyVerifiedTokens?: boolean, checkStatus?: boolean, options?: EnvOption): Promise<{}>;
|
|
62
62
|
/**
|
|
63
63
|
* Retrieves the nonce value for the specified sender address and nonce key.
|
|
64
64
|
* If the nonce is unavailable, a random nonce key is generated and returned as the nonce.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funkit/core",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.8",
|
|
4
4
|
"description": "Funkit core SDK provides feature-rich and extensible smart wallets built on account abstraction",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"dotenv": "^16.0.3",
|
|
20
20
|
"ethers": "5.7.2",
|
|
21
21
|
"uuid": "^9.0.0",
|
|
22
|
-
"@funkit/api-base": "1.5.
|
|
22
|
+
"@funkit/api-base": "1.5.7",
|
|
23
23
|
"@funkit/chains": "0.1.2",
|
|
24
|
-
"@funkit/utils": "1.0.
|
|
24
|
+
"@funkit/utils": "1.0.7"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"viem": "2.x"
|