@funkit/core 2.2.5 → 2.2.7
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 +7290 -4277
- package/dist/index.js.map +4 -4
- package/dist/src/actions/AccessControl.d.ts +4 -4
- package/dist/src/actions/BatchActions.d.ts +2 -2
- package/dist/src/actions/Bridge.d.ts +3 -3
- package/dist/src/actions/FirstClassActions.d.ts +6 -6
- package/dist/src/actions/Group.d.ts +3 -3
- package/dist/src/actions/LimitOrder.d.ts +3 -3
- package/dist/src/actions/Stake.d.ts +3 -3
- package/dist/src/actions/Swap.d.ts +4 -4
- package/dist/src/actions/Token.d.ts +2 -2
- package/dist/src/actions/types.d.ts +3 -3
- package/dist/src/apis/AccessControlApis.d.ts +1 -1
- package/dist/src/apis/BridgeApis.d.ts +1 -1
- package/dist/src/apis/GroupApis.d.ts +2 -2
- package/dist/src/apis/InfoApis.d.ts +1 -1
- package/dist/src/apis/ListenerApis.d.ts +1 -1
- package/dist/src/apis/OperationApis.d.ts +4 -4
- package/dist/src/apis/PaymasterApis.d.ts +1 -1
- package/dist/src/apis/SwapApis.d.ts +1 -1
- package/dist/src/apis/UserApis.d.ts +2 -2
- package/dist/src/apis/types.d.ts +3 -3
- package/dist/src/auth/Auth.d.ts +6 -6
- package/dist/src/auth/SessionKeyAuth.d.ts +4 -4
- package/dist/src/auth/types.d.ts +1 -1
- package/dist/src/common/constants.d.ts +12 -11
- package/dist/src/common/types.d.ts +2 -2
- package/dist/src/config/Config.d.ts +2 -2
- package/dist/src/config/types.d.ts +2 -2
- package/dist/src/data/Chain.d.ts +4 -4
- package/dist/src/data/NFT.d.ts +4 -4
- package/dist/src/data/Operation.d.ts +9 -6
- package/dist/src/data/SolidityData.d.ts +3 -3
- package/dist/src/data/Token.d.ts +3 -3
- package/dist/src/data/types.d.ts +2 -2
- package/dist/src/sponsors/CheckoutSponsor.d.ts +3 -3
- package/dist/src/sponsors/GaslessSponsor.d.ts +3 -3
- package/dist/src/sponsors/Sponsor.d.ts +6 -6
- package/dist/src/sponsors/TokenSponsor.d.ts +6 -6
- package/dist/src/utils/ApiUtils.d.ts +5 -5
- package/dist/src/utils/AuthUtils.d.ts +2 -2
- package/dist/src/utils/ChainUtils.d.ts +10 -5
- package/dist/src/utils/GroupUtils.d.ts +3 -3
- package/dist/src/utils/MerkleUtils.d.ts +1 -1
- package/dist/src/utils/PaymasterUtils.d.ts +1 -1
- package/dist/src/utils/SwapUtils.d.ts +4 -4
- package/dist/src/utils/UserOpUtils.d.ts +2 -2
- package/dist/src/utils/ViemUtils.d.ts +2 -2
- package/dist/src/utils/WalletUtils.d.ts +2 -2
- package/dist/src/viem/ContractInterface.d.ts +3 -3
- package/dist/src/viem/Converter.d.ts +2 -2
- package/dist/src/wallet/FunWallet.d.ts +10 -10
- package/dist/src/wallet/types.d.ts +1 -1
- package/package.json +4 -13
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SessionKeyAuth } from '../auth';
|
|
2
|
-
import { AuthInput } from '../auth/types';
|
|
3
|
-
import { TransactionParams } from '../common';
|
|
4
|
-
import { EnvOption } from '../config';
|
|
2
|
+
import type { AuthInput } from '../auth/types';
|
|
3
|
+
import { type TransactionParams } from '../common';
|
|
4
|
+
import type { EnvOption } from '../config';
|
|
5
5
|
import { MerkleTree } from '../utils/MerkleUtils';
|
|
6
|
-
import { AddOwnerParams, RemoveOwnerParams, SessionKeyParams } from './types';
|
|
6
|
+
import type { AddOwnerParams, RemoveOwnerParams, SessionKeyParams } from './types';
|
|
7
7
|
export declare const createFeeRecipientAndTokenMerkleTree: (params: SessionKeyParams) => Promise<MerkleTree>;
|
|
8
8
|
export declare const createTargetSelectorMerkleTree: (params: SessionKeyParams) => MerkleTree;
|
|
9
9
|
export declare const createSessionKeyTransactionParams: (params: SessionKeyParams, txOptions?: EnvOption) => Promise<TransactionParams>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Address } from 'viem';
|
|
2
|
-
import { TransactionParams } from '../common';
|
|
1
|
+
import type { Address } from 'viem';
|
|
2
|
+
import { type TransactionParams } from '../common';
|
|
3
3
|
export declare const createExecuteBatchTxParams: (params: TransactionParams[], walletAddress: Address) => TransactionParams;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Address } from 'viem';
|
|
2
|
-
import { TransactionParams } from '../common';
|
|
1
|
+
import type { Address } from 'viem';
|
|
2
|
+
import { type TransactionParams } from '../common';
|
|
3
3
|
import { Chain } from '../data';
|
|
4
|
-
import { BridgeParams } from './types';
|
|
4
|
+
import { type BridgeParams } from './types';
|
|
5
5
|
export declare const bridgeTransactionParams: (params: BridgeParams, walletAddress: Address, chain: Chain) => Promise<TransactionParams>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Address } from 'viem';
|
|
2
|
-
import { Auth } from '../auth';
|
|
3
|
-
import { TransactionParams } from '../common';
|
|
4
|
-
import { EnvOption } from '../config';
|
|
5
|
-
import { Chain, Operation } from '../data';
|
|
6
|
-
import { AddOwnerParams, AddUserToGroupParams, ApproveParams, BridgeParams, CreateGroupParams, FinishUnstakeParams, LimitOrderParam, RemoveGroupParams, RemoveOwnerParams, RemoveUserFromGroupParams, RequestUnstakeParams, SessionKeyParams, StakeParams, SwapParams, TransferParams, UpdateThresholdOfGroupParams } from './types';
|
|
1
|
+
import { type Address } from 'viem';
|
|
2
|
+
import type { Auth } from '../auth';
|
|
3
|
+
import type { TransactionParams } from '../common';
|
|
4
|
+
import type { EnvOption } from '../config';
|
|
5
|
+
import { Chain, type Operation } from '../data';
|
|
6
|
+
import type { AddOwnerParams, AddUserToGroupParams, ApproveParams, BridgeParams, CreateGroupParams, FinishUnstakeParams, LimitOrderParam, RemoveGroupParams, RemoveOwnerParams, RemoveUserFromGroupParams, RequestUnstakeParams, SessionKeyParams, StakeParams, SwapParams, TransferParams, UpdateThresholdOfGroupParams } from './types';
|
|
7
7
|
export declare abstract class FirstClassActions {
|
|
8
8
|
protected chain: Chain;
|
|
9
9
|
constructor(chain: Chain);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TransactionParams } from '../common';
|
|
2
|
-
import { EnvOption } from '../config';
|
|
3
|
-
import { CreateGroupParams, RemoveGroupParams, UpdateGroupParams } from './types';
|
|
1
|
+
import { type TransactionParams } from '../common';
|
|
2
|
+
import type { EnvOption } from '../config';
|
|
3
|
+
import type { CreateGroupParams, RemoveGroupParams, UpdateGroupParams } from './types';
|
|
4
4
|
export declare const createGroupTxParams: (params: CreateGroupParams, txOptions?: EnvOption) => Promise<TransactionParams>;
|
|
5
5
|
export declare const updateGroupTxParams: (params: UpdateGroupParams, txOptions?: EnvOption) => Promise<TransactionParams>;
|
|
6
6
|
export declare const removeGroupTxParams: (params: RemoveGroupParams, txOptions?: EnvOption) => Promise<TransactionParams>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TransactionParams } from '../common';
|
|
2
|
-
import { Chain } from '../data';
|
|
3
|
-
import { LimitOrderParam } from './types';
|
|
1
|
+
import { type TransactionParams } from '../common';
|
|
2
|
+
import { type Chain } from '../data';
|
|
3
|
+
import type { LimitOrderParam } from './types';
|
|
4
4
|
export declare const limitSwapOrderTransactionParams: (params: LimitOrderParam, chain: Chain) => Promise<TransactionParams>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TransactionParams } from '../common';
|
|
2
|
-
import { EnvOption } from '../config';
|
|
3
|
-
import { FinishUnstakeParams, RequestUnstakeParams, StakeParams } from './types';
|
|
1
|
+
import { type TransactionParams } from '../common';
|
|
2
|
+
import type { EnvOption } from '../config';
|
|
3
|
+
import type { FinishUnstakeParams, RequestUnstakeParams, StakeParams } from './types';
|
|
4
4
|
export declare const isRequestUnstakeParams: (input: any) => boolean;
|
|
5
5
|
export declare const isFinishUnstakeParams: (input: any) => boolean;
|
|
6
6
|
export declare const stakeTransactionParams: (params: StakeParams, txOptions?: EnvOption) => Promise<TransactionParams>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Address } from 'viem';
|
|
2
|
-
import { TransactionParams } from '../common';
|
|
3
|
-
import { EnvOption } from '../config';
|
|
4
|
-
import { SwapParams } from './types';
|
|
1
|
+
import { type Address } from 'viem';
|
|
2
|
+
import { type TransactionParams } from '../common';
|
|
3
|
+
import type { EnvOption } from '../config';
|
|
4
|
+
import { type SwapParams } from './types';
|
|
5
5
|
export declare const oneInchSupported: number[];
|
|
6
6
|
export declare const uniswapV3Supported: number[];
|
|
7
7
|
export declare const oneInchTransactionParams: (params: SwapParams, walletAddress: Address, txOptions?: EnvOption) => Promise<TransactionParams>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TransactionParams } from '../common';
|
|
1
|
+
import { type TransactionParams } from '../common';
|
|
2
2
|
import { Chain } from '../data/Chain';
|
|
3
|
-
import { ApproveERC20Params, ApproveERC721Params, ApproveParams, ERC721TransferParams, TokenTransferParams, TransferParams } from './types';
|
|
3
|
+
import type { ApproveERC20Params, ApproveERC721Params, ApproveParams, ERC721TransferParams, TokenTransferParams, TransferParams } from './types';
|
|
4
4
|
export declare const isERC721TransferParams: (obj: TransferParams) => obj is ERC721TransferParams;
|
|
5
5
|
export declare const isTokenTransferParams: (obj: TransferParams) => obj is TokenTransferParams;
|
|
6
6
|
export declare const erc721TransferTransactionParams: (params: ERC721TransferParams) => Promise<TransactionParams>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Address, Hex } from 'viem';
|
|
2
|
-
import { TransactionParams } from '../common';
|
|
3
|
-
import { Chain } from '../data';
|
|
1
|
+
import type { Address, Hex } from 'viem';
|
|
2
|
+
import type { TransactionParams } from '../common';
|
|
3
|
+
import type { Chain } from '../data';
|
|
4
4
|
export interface ApproveAndExecParams {
|
|
5
5
|
approve: ApproveERC20Params;
|
|
6
6
|
exec: TransactionParams;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address, Hex } from 'viem';
|
|
1
|
+
import type { Address, Hex } from 'viem';
|
|
2
2
|
export declare function initializeWalletAccess(walletAddr: Address, creatorAddr: Address): Promise<void>;
|
|
3
3
|
export declare function checkWalletAccessInitialization(walletAddr: Address): Promise<boolean>;
|
|
4
4
|
export declare function addAccessToWallet(walletAddr: Address, nonce: number, signature: Hex): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address } from 'viem';
|
|
1
|
+
import type { Address } from 'viem';
|
|
2
2
|
export declare function getSocketBridgeQuote(recipient: string, walletAddress: string, fromChain: string, toChain: string, fromToken: string, toToken: string, amount: bigint, sort: string): Promise<any>;
|
|
3
3
|
export declare function getSocketBridgeTransaction(route: any): Promise<any>;
|
|
4
4
|
export declare function getSocketBridgeAllowance(chainId: string, sender: Address, allowanceTarget: string, token: string): Promise<any>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address, Hex } from 'viem';
|
|
2
|
-
import { GroupMetadata } from './types';
|
|
1
|
+
import type { Address, Hex } from 'viem';
|
|
2
|
+
import type { GroupMetadata } from './types';
|
|
3
3
|
export declare function getGroups(groupIds: Hex[], chainId: string): Promise<GroupMetadata[]>;
|
|
4
4
|
export declare function getGroupsByWallet(walletAddr: Address, chainId: string): Promise<GroupMetadata[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address } from 'viem';
|
|
1
|
+
import type { Address } from 'viem';
|
|
2
2
|
export declare function getTokenInfo(symbol: string, chainId: string): Promise<Address>;
|
|
3
3
|
export declare function getChainFromId(chainId: string): Promise<any>;
|
|
4
4
|
export declare function getChainFromName(name: string): Promise<any>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Address } from 'viem';
|
|
1
|
+
import type { Address } from 'viem';
|
|
2
2
|
export declare function createListener(walletAddresses: Address[], chains: string[], webhookUrl: string): Promise<void>;
|
|
3
3
|
export declare function deleteListener(walletAddress: Address, chain: string): Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Address, Hex } from 'viem';
|
|
2
|
-
import { ExecutionReceipt } from '../common/types';
|
|
3
|
-
import { Operation, OperationStatus } from '../data';
|
|
4
|
-
import {
|
|
1
|
+
import type { Address, Hex } from 'viem';
|
|
2
|
+
import type { ExecutionReceipt } from '../common/types';
|
|
3
|
+
import { type Operation, OperationStatus } from '../data';
|
|
4
|
+
import type { EstimateOpInput, EstimatedGas, ExecuteOpInput, ScheduleOpInput, UserOperationGasPrice } from './types';
|
|
5
5
|
export declare function createOp(op: Operation): Promise<string>;
|
|
6
6
|
export declare function getOpsOfGroup(groupId: Hex, chainId: string, status: OperationStatus): Promise<Operation[]>;
|
|
7
7
|
export declare function getOpsOfWallet(walletAddr: Address, chainId: string, status?: OperationStatus): Promise<Operation[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TransactionParams } from '../common';
|
|
1
|
+
import type { TransactionParams } from '../common';
|
|
2
2
|
export declare function get1InchSwapTx(chainId: string, src: string, dst: string, amount: string, from: string, slippage: string, disableEstimate: string, allowPartialFill: string): Promise<TransactionParams>;
|
|
3
3
|
export declare function get1InchAllowance(chainId: string, tokenAddress: string, walletAddress: string): Promise<number>;
|
|
4
4
|
export declare function get1InchApproveTx(chainId: string, tokenAddress: string, amount: string): Promise<TransactionParams>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Address, Hex } from 'viem';
|
|
2
|
-
import { Wallet } from './types';
|
|
1
|
+
import { type Address, type Hex } from 'viem';
|
|
2
|
+
import type { Wallet } from './types';
|
|
3
3
|
export declare function createUser(authId: string, addr: string, method: string, userUniqueId: string): Promise<void>;
|
|
4
4
|
export declare function getUserUniqueId(authId: string): Promise<string>;
|
|
5
5
|
export declare function getUserAddr(authId: string): Promise<string>;
|
package/dist/src/apis/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Address, Hex } from 'viem';
|
|
2
|
-
import { UserOperation } from '../data';
|
|
3
|
-
import { GroupInfo } from '../wallet';
|
|
1
|
+
import type { Address, Hex } from 'viem';
|
|
2
|
+
import type { UserOperation } from '../data';
|
|
3
|
+
import type { GroupInfo } from '../wallet';
|
|
4
4
|
export type Wallet = {
|
|
5
5
|
walletUniqueId?: string;
|
|
6
6
|
walletAddr: Address;
|
package/dist/src/auth/Auth.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Address, Hex, JsonRpcAccount, PrivateKeyAccount, TransactionReceipt, WalletClient } from 'viem';
|
|
2
|
-
import { Wallet } from '../apis/types';
|
|
3
|
-
import { TransactionData, TransactionParams } from '../common';
|
|
4
|
-
import { EnvOption } from '../config';
|
|
5
|
-
import { Chain, Operation } from '../data';
|
|
6
|
-
import { AuthInput } from './types';
|
|
1
|
+
import { type Address, type Hex, type JsonRpcAccount, type PrivateKeyAccount, type TransactionReceipt, type WalletClient } from 'viem';
|
|
2
|
+
import type { Wallet } from '../apis/types';
|
|
3
|
+
import { type TransactionData, type TransactionParams } from '../common';
|
|
4
|
+
import type { EnvOption } from '../config';
|
|
5
|
+
import { Chain, type Operation } from '../data';
|
|
6
|
+
import type { AuthInput } from './types';
|
|
7
7
|
export declare class Auth {
|
|
8
8
|
authId?: string;
|
|
9
9
|
signer?: PrivateKeyAccount | JsonRpcAccount;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Hex } from 'viem';
|
|
2
|
-
import { Chain, Operation } from '../data';
|
|
3
|
-
import { MerkleTree } from '../utils/MerkleUtils';
|
|
1
|
+
import { type Hex } from 'viem';
|
|
2
|
+
import { type Chain, type Operation } from '../data';
|
|
3
|
+
import type { MerkleTree } from '../utils/MerkleUtils';
|
|
4
4
|
import { Auth } from './Auth';
|
|
5
|
-
import { AuthInput, WalletCallData } from './types';
|
|
5
|
+
import type { AuthInput, WalletCallData } from './types';
|
|
6
6
|
export declare class SessionKeyAuth extends Auth {
|
|
7
7
|
ruleId: Hex;
|
|
8
8
|
roleId: Hex;
|
package/dist/src/auth/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Hex } from 'viem';
|
|
1
2
|
import { ContractInterface } from '../viem/ContractInterface';
|
|
2
3
|
export declare const LOCAL_API_URL = "http://127.0.0.1:3000";
|
|
3
4
|
declare let API_URL: string;
|
|
@@ -5,37 +6,37 @@ export { API_URL };
|
|
|
5
6
|
export declare const DASHBOARD_API_URL = "https://api.fun.xyz/dashboard";
|
|
6
7
|
export declare const BASE_WRAP_TOKEN_ADDR: {
|
|
7
8
|
'1': {
|
|
8
|
-
weth:
|
|
9
|
+
weth: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2";
|
|
9
10
|
};
|
|
10
11
|
'5': {
|
|
11
|
-
weth:
|
|
12
|
+
weth: "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6";
|
|
12
13
|
};
|
|
13
14
|
'10': {
|
|
14
|
-
weth:
|
|
15
|
+
weth: "0x4200000000000000000000000000000000000006";
|
|
15
16
|
};
|
|
16
17
|
'137': {
|
|
17
|
-
wmatic:
|
|
18
|
+
wmatic: "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270";
|
|
18
19
|
};
|
|
19
20
|
'5000': {
|
|
20
|
-
weth:
|
|
21
|
+
weth: "0xdEAddEaDdeadDEadDEADDEAddEADDEAddead1111";
|
|
21
22
|
};
|
|
22
23
|
'8453': {
|
|
23
|
-
weth:
|
|
24
|
+
weth: "0x4200000000000000000000000000000000000006";
|
|
24
25
|
};
|
|
25
26
|
'36865': {
|
|
26
|
-
weth:
|
|
27
|
+
weth: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2";
|
|
27
28
|
};
|
|
28
29
|
'42161': {
|
|
29
|
-
weth:
|
|
30
|
+
weth: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1";
|
|
30
31
|
};
|
|
31
32
|
'421614': {
|
|
32
|
-
weth:
|
|
33
|
+
weth: "0x980b62da83eff3d4576c647993b0c1d7faf17c73";
|
|
33
34
|
};
|
|
34
35
|
'43113': {
|
|
35
|
-
weth:
|
|
36
|
+
weth: "0x1D308089a2D1Ced3f1Ce36B1FcaF815b07217be3";
|
|
36
37
|
};
|
|
37
38
|
'534352': {
|
|
38
|
-
weth:
|
|
39
|
+
weth: "0x5300000000000000000000000000000000000004";
|
|
39
40
|
};
|
|
40
41
|
};
|
|
41
42
|
export declare const FUN_GASLESS_SPONSOR_ADDRESS = "0xCB5D0b4569A39C217c243a436AC3feEe5dFeb9Ad";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EnvOption, GlobalEnvOption } from './types';
|
|
1
|
+
import type { EnvOption, GlobalEnvOption } from './types';
|
|
2
2
|
export declare function getEnvOptions(): GlobalEnvOption;
|
|
3
|
-
export declare function parseOptions(option: EnvOption):
|
|
3
|
+
export declare function parseOptions(option: EnvOption): GlobalEnvOption & EnvOption;
|
|
4
4
|
export declare function configureEnvironment(option: GlobalEnvOption): Promise<void>;
|
package/dist/src/data/Chain.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Address, Hex, PublicClient } from 'viem';
|
|
2
|
-
import { UserOperationGasPrice } from '../apis';
|
|
3
|
-
import { EstimateGasResult } from '../common';
|
|
4
|
-
import { ChainInput, UserOperation } from './types';
|
|
1
|
+
import { type Address, type Hex, type PublicClient } from 'viem';
|
|
2
|
+
import { type UserOperationGasPrice } from '../apis';
|
|
3
|
+
import { type EstimateGasResult } from '../common';
|
|
4
|
+
import type { ChainInput, UserOperation } from './types';
|
|
5
5
|
export declare class Chain {
|
|
6
6
|
private initialized;
|
|
7
7
|
private id?;
|
package/dist/src/data/NFT.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Address } from 'viem';
|
|
2
|
-
import { TransactionData } from '../common';
|
|
3
|
-
import { EnvOption } from '../config';
|
|
1
|
+
import { type Address } from 'viem';
|
|
2
|
+
import { type TransactionData } from '../common';
|
|
3
|
+
import type { EnvOption } from '../config';
|
|
4
4
|
export declare class NFT {
|
|
5
5
|
address?: Address;
|
|
6
6
|
name: string;
|
|
@@ -16,7 +16,7 @@ export declare class NFT {
|
|
|
16
16
|
transfer(sender: string, spender: string, tokenId: number, options?: EnvOption): Promise<any>;
|
|
17
17
|
static approve(data: string, spender: string, tokenId: number, options?: EnvOption): Promise<TransactionData>;
|
|
18
18
|
static approveForAll(data: string, spender: string, options?: EnvOption): Promise<TransactionData>;
|
|
19
|
-
static getAddress(data: string): Promise<
|
|
19
|
+
static getAddress(data: string): Promise<Address>;
|
|
20
20
|
static getApproved(data: string, tokenId: string, options?: EnvOption): Promise<string>;
|
|
21
21
|
static revokeForAll(data: string, spender: string, options?: EnvOption): Promise<TransactionData>;
|
|
22
22
|
static transfer(data: string, sender: string, spender: string, tokenId: number, options?: EnvOption): Promise<TransactionData>;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { Address, Hex } from 'viem';
|
|
2
|
-
import { Auth } from '../auth';
|
|
3
|
-
import { EnvOption } from '../config';
|
|
1
|
+
import type { Address, Hex } from 'viem';
|
|
2
|
+
import type { Auth } from '../auth';
|
|
3
|
+
import type { EnvOption } from '../config';
|
|
4
4
|
import { Chain } from './Chain';
|
|
5
|
-
import { AuthType, OperationMetadata, OperationStatus, OperationType, Signature, UserOperation } from './types';
|
|
6
|
-
export
|
|
5
|
+
import type { AuthType, OperationMetadata, OperationStatus, OperationType, Signature, UserOperation } from './types';
|
|
6
|
+
export interface OperationData extends OperationMetadata {
|
|
7
|
+
userOp: UserOperation;
|
|
8
|
+
}
|
|
9
|
+
export declare class Operation implements OperationData {
|
|
7
10
|
opId?: Hex;
|
|
8
11
|
chainId: string;
|
|
9
12
|
opType: OperationType;
|
|
@@ -26,7 +29,7 @@ export declare class Operation {
|
|
|
26
29
|
executedBlockNumber?: number;
|
|
27
30
|
executedBlockTimeStamp?: number;
|
|
28
31
|
constructor(userOp: UserOperation, metadata: OperationMetadata);
|
|
29
|
-
static convertTypeToObject(op:
|
|
32
|
+
static convertTypeToObject(op: OperationData): Operation;
|
|
30
33
|
getOpHash(chain: Chain): Promise<Hex>;
|
|
31
34
|
getMaxTxCost(): bigint;
|
|
32
35
|
estimateGas(auth: Auth, userId: string, options?: EnvOption): Promise<Operation>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Address, Hex } from 'viem';
|
|
2
|
-
import { User } from '../wallet/types';
|
|
3
|
-
import { LoginData, WalletSignature } from './types';
|
|
1
|
+
import { type Address, type Hex } from 'viem';
|
|
2
|
+
import type { User } from '../wallet/types';
|
|
3
|
+
import type { LoginData, WalletSignature } from './types';
|
|
4
4
|
export declare function encodeLoginData(data: LoginData): Hex;
|
|
5
5
|
export declare function encodeWalletSignature(data: WalletSignature): Hex;
|
|
6
6
|
export declare function encodeUserAuthInitData(groupUsers: User[]): Hex;
|
package/dist/src/data/Token.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Address } from 'viem';
|
|
2
|
-
import { TransactionParams } from '../common';
|
|
3
|
-
import { Chain } from './Chain';
|
|
1
|
+
import { type Address } from 'viem';
|
|
2
|
+
import { type TransactionParams } from '../common';
|
|
3
|
+
import type { Chain } from './Chain';
|
|
4
4
|
export declare class Token {
|
|
5
5
|
address?: Address;
|
|
6
6
|
chain: Chain;
|
package/dist/src/data/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Address } from 'viem';
|
|
2
|
-
import { TransactionParams } from '../common';
|
|
3
|
-
import { EnvOption } from '../config';
|
|
1
|
+
import type { Address } from 'viem';
|
|
2
|
+
import { type TransactionParams } from '../common';
|
|
3
|
+
import type { EnvOption } from '../config';
|
|
4
4
|
import { Sponsor } from './Sponsor';
|
|
5
5
|
export declare class CheckoutSponsor extends Sponsor {
|
|
6
6
|
constructor(options?: EnvOption);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Address } from 'viem';
|
|
2
|
-
import { TransactionParams } from '../common';
|
|
3
|
-
import { EnvOption } from '../config';
|
|
1
|
+
import { type Address } from 'viem';
|
|
2
|
+
import { type TransactionParams } from '../common';
|
|
3
|
+
import type { EnvOption } from '../config';
|
|
4
4
|
import { Sponsor } from './Sponsor';
|
|
5
5
|
export declare class GaslessSponsor extends Sponsor {
|
|
6
6
|
constructor(options?: EnvOption);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Address } from 'viem';
|
|
2
|
-
import { TransactionParams } from '../common';
|
|
3
|
-
import { EnvOption } from '../config';
|
|
4
|
-
import { ContractInterface } from '../viem/ContractInterface';
|
|
5
|
-
import { PaymasterType } from './types';
|
|
1
|
+
import type { Address } from 'viem';
|
|
2
|
+
import type { TransactionParams } from '../common';
|
|
3
|
+
import type { EnvOption } from '../config';
|
|
4
|
+
import type { ContractInterface } from '../viem/ContractInterface';
|
|
5
|
+
import type { PaymasterType } from './types';
|
|
6
6
|
export declare abstract class Sponsor {
|
|
7
7
|
sponsorAddress?: Address;
|
|
8
8
|
contractInterface: ContractInterface;
|
|
@@ -10,7 +10,7 @@ export declare abstract class Sponsor {
|
|
|
10
10
|
paymasterAddress?: Address;
|
|
11
11
|
paymasterType: PaymasterType;
|
|
12
12
|
chainId?: string;
|
|
13
|
-
constructor(options: EnvOption
|
|
13
|
+
constructor(options: EnvOption, contractInterface: ContractInterface, name: string, paymasterType: PaymasterType);
|
|
14
14
|
getPaymasterAddress(options?: EnvOption): Promise<Address>;
|
|
15
15
|
abstract getPaymasterAndData(options: EnvOption): Promise<string>;
|
|
16
16
|
abstract stake(sponsor: string, amount: number, options: EnvOption): Promise<TransactionParams>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Address } from 'viem';
|
|
2
|
-
import { Auth } from '../auth';
|
|
3
|
-
import { TransactionParams } from '../common';
|
|
4
|
-
import { EnvOption } from '../config';
|
|
5
|
-
import { Operation } from '../data';
|
|
1
|
+
import { type Address } from 'viem';
|
|
2
|
+
import type { Auth } from '../auth';
|
|
3
|
+
import { type TransactionParams } from '../common';
|
|
4
|
+
import type { EnvOption } from '../config';
|
|
5
|
+
import { type Operation } from '../data';
|
|
6
6
|
import { Sponsor } from './Sponsor';
|
|
7
|
-
import { AllTokenData } from './types';
|
|
7
|
+
import { type AllTokenData } from './types';
|
|
8
8
|
export declare class TokenSponsor extends Sponsor {
|
|
9
9
|
token: string;
|
|
10
10
|
constructor(options?: EnvOption);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PartialAttemptOptions } from '@lifeomic/attempt';
|
|
1
|
+
import { type PartialAttemptOptions } from '@lifeomic/attempt';
|
|
2
2
|
export declare const DEFAULT_RETRY_OPTIONS: {
|
|
3
3
|
delay: number;
|
|
4
4
|
initialDelay: number;
|
|
@@ -14,7 +14,7 @@ export declare const DEFAULT_RETRY_OPTIONS: {
|
|
|
14
14
|
calculateDelay: null;
|
|
15
15
|
};
|
|
16
16
|
export declare const sendRequest: (uri: string, method: string, apiKey: string, body?: object, retryOptions?: PartialAttemptOptions<any>) => Promise<any>;
|
|
17
|
-
export declare function sendGetRequest(uri: string
|
|
18
|
-
export declare function sendPostRequest(uri: string
|
|
19
|
-
export declare function sendDeleteRequest(uri: string
|
|
20
|
-
export declare function sendPutRequest(uri: string
|
|
17
|
+
export declare function sendGetRequest(uri: string, endpoint: string, apiKey?: string, retryOptions?: PartialAttemptOptions<any>): Promise<any>;
|
|
18
|
+
export declare function sendPostRequest(uri: string, endpoint: string, body: object, apiKey?: string, retryOptions?: PartialAttemptOptions<any>): Promise<any>;
|
|
19
|
+
export declare function sendDeleteRequest(uri: string, endpoint: string, apiKey?: string): Promise<void>;
|
|
20
|
+
export declare function sendPutRequest(uri: string, endpoint: string, body: object, apiKey?: string): Promise<void>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Hex } from 'viem';
|
|
2
|
-
export declare const getAuthUniqueId: (authId: string, addr?: string, skipDBActions?: boolean) => Promise<
|
|
1
|
+
import type { Hex } from 'viem';
|
|
2
|
+
export declare const getAuthUniqueId: (authId: string, addr?: string, skipDBActions?: boolean) => Promise<string>;
|
|
3
3
|
export declare const generatePrivateKey: () => Hex;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import { Address, PublicClient } from 'viem';
|
|
2
|
-
import { Auth } from '../auth';
|
|
3
|
-
import { EnvOption } from '../config';
|
|
1
|
+
import { type Address, type PublicClient } from 'viem';
|
|
2
|
+
import type { Auth } from '../auth';
|
|
3
|
+
import type { EnvOption } from '../config';
|
|
4
4
|
import { Chain } from '../data';
|
|
5
|
-
import { FunWallet } from '../wallet';
|
|
5
|
+
import type { FunWallet } from '../wallet';
|
|
6
6
|
export declare const isAddress: (address: string) => boolean;
|
|
7
7
|
export declare const fundWallet: (auth: Auth, wallet: 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
10
|
export declare const getWalletPermitNonce: (walletAddr: Address, chain: Chain, nonceKey?: number) => Promise<any>;
|
|
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) => Promise<{
|
|
13
|
+
standard: {
|
|
14
|
+
maxPriorityFee: number;
|
|
15
|
+
maxFee: number;
|
|
16
|
+
};
|
|
17
|
+
}>;
|
|
13
18
|
export declare const useFaucet: (chainIdentifier: Chain | number | string, wallet: FunWallet) => Promise<any[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address, Hex } from 'viem';
|
|
2
|
-
import { Chain } from '../data';
|
|
3
|
-
import { GroupInfo } from '../wallet';
|
|
1
|
+
import { type Address, type Hex } from 'viem';
|
|
2
|
+
import type { Chain } from '../data';
|
|
3
|
+
import type { GroupInfo } from '../wallet';
|
|
4
4
|
export declare function getOnChainGroupData(groupId: Hex, chain: Chain, walletAddr: Address): Promise<GroupInfo>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { EnvOption } from '../config';
|
|
1
|
+
import type { EnvOption } from '../config';
|
|
2
2
|
import { PaymasterType } from '../sponsors/types';
|
|
3
3
|
export declare const getPaymasterType: (txOptions: EnvOption) => PaymasterType.GaslessSponsor | PaymasterType.TokenSponsor | PaymasterType.CheckoutSponsor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Address, PublicClient } from 'viem';
|
|
2
|
-
import { UniswapPoolFeeOptions } from '../actions';
|
|
1
|
+
import { type Address, type PublicClient } from 'viem';
|
|
2
|
+
import type { UniswapPoolFeeOptions } from '../actions';
|
|
3
3
|
export declare function fromReadableAmount(amount: number, decimals: number): bigint;
|
|
4
4
|
type SwapParamsUtils = {
|
|
5
5
|
tokenInAddress: Address;
|
|
@@ -26,8 +26,8 @@ export declare function swapExec(client: PublicClient, uniswapAddrs: UniswapV3Ad
|
|
|
26
26
|
value: string;
|
|
27
27
|
}>;
|
|
28
28
|
export declare function swapExecV2(client: PublicClient, uniswapAddrs: UniswapV2Addrs, swapParams: SwapParamsUtils, chainId: number): Promise<{
|
|
29
|
-
data:
|
|
30
|
-
to:
|
|
29
|
+
data: `0x${string}` | undefined;
|
|
30
|
+
to: `0x${string}`;
|
|
31
31
|
amount: string;
|
|
32
32
|
}>;
|
|
33
33
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Hex } from 'viem';
|
|
2
|
-
import { Chain, UserOperation } from '../data';
|
|
1
|
+
import { type Hex } from 'viem';
|
|
2
|
+
import type { Chain, UserOperation } from '../data';
|
|
3
3
|
export declare const calcPreVerificationGas: (userOp: UserOperation) => bigint;
|
|
4
4
|
export declare const getPromiseFromOp: (op: UserOperation) => Promise<any>;
|
|
5
5
|
export declare function gasCalculation(txid: string, chain: Chain): Promise<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbiParameter } from 'abitype';
|
|
2
|
-
import { AbiItem } from 'viem';
|
|
1
|
+
import type { AbiParameter } from 'abitype';
|
|
2
|
+
import { type AbiItem } from 'viem';
|
|
3
3
|
export declare function formatAbiItem(abiItem: AbiItem, { includeName }?: {
|
|
4
4
|
includeName?: boolean;
|
|
5
5
|
}): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Address, Hex } from 'viem';
|
|
2
|
-
import { Chain, Operation, Signature, UserOperation } from '../data';
|
|
1
|
+
import { type Address, type Hex } from 'viem';
|
|
2
|
+
import { type Chain, type Operation, type Signature, type UserOperation } from '../data';
|
|
3
3
|
export declare const generateRandomBytes32: () => Hex;
|
|
4
4
|
export declare const generateRandomWalletUniqueId: () => Hex;
|
|
5
5
|
export declare const generateRandomGroupId: () => Hex;
|