@funkit/core 2.2.8 → 2.3.0
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 +3328 -6841
- package/dist/index.js.map +4 -4
- package/dist/src/actions/FirstClassActions.d.ts +1 -20
- package/dist/src/actions/index.d.ts +0 -1
- package/dist/src/apis/index.d.ts +0 -4
- package/dist/src/apis/types.d.ts +0 -7
- package/dist/src/common/constants.d.ts +80 -221
- package/dist/src/errors/clientErrors.d.ts +4 -0
- package/dist/src/errors/index.d.ts +1 -4
- package/dist/src/sponsors/Sponsor.d.ts +1 -1
- package/dist/src/sponsors/TokenSponsor.d.ts +1 -1
- package/dist/src/sponsors/types.d.ts +0 -6
- package/dist/src/utils/PaymasterUtils.d.ts +1 -1
- package/dist/src/utils/index.d.ts +0 -1
- package/dist/src/wallet/FunWallet.d.ts +0 -19
- package/package.json +13 -15
- package/dist/src/actions/Bridge.d.ts +0 -5
- package/dist/src/actions/LimitOrder.d.ts +0 -4
- package/dist/src/actions/Swap.d.ts +0 -9
- package/dist/src/apis/AccessControlApis.d.ts +0 -5
- package/dist/src/apis/BridgeApis.d.ts +0 -5
- package/dist/src/apis/ContractApis.d.ts +0 -1
- package/dist/src/apis/GroupApis.d.ts +0 -4
- package/dist/src/apis/ListenerApis.d.ts +0 -3
- package/dist/src/apis/NFTApis.d.ts +0 -22
- package/dist/src/apis/PaymasterApis.d.ts +0 -10
- package/dist/src/apis/SwapApis.d.ts +0 -4
- package/dist/src/errors/BaseError.d.ts +0 -9
- package/dist/src/errors/ClientError.d.ts +0 -22
- package/dist/src/errors/ServerError.d.ts +0 -7
- package/dist/src/errors/types.d.ts +0 -60
- package/dist/src/utils/SwapUtils.d.ts +0 -33
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Address } from 'viem';
|
|
2
|
-
export declare function getSocketBridgeQuote(recipient: string, walletAddress: string, fromChain: string, toChain: string, fromToken: string, toToken: string, amount: bigint, sort: string): Promise<any>;
|
|
3
|
-
export declare function getSocketBridgeTransaction(route: any): Promise<any>;
|
|
4
|
-
export declare function getSocketBridgeAllowance(chainId: string, sender: Address, allowanceTarget: string, token: string): Promise<any>;
|
|
5
|
-
export declare function getSocketBridgeApproveTransaction(chainId: string, sender: Address, allowanceTarget: string, token: string, amount: bigint): Promise<any>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getContractAbi(contractName: string, mode?: string): Promise<any>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Address, Hex } from 'viem';
|
|
2
|
-
import type { GroupMetadata } from './types';
|
|
3
|
-
export declare function getGroups(groupIds: Hex[], chainId: string): Promise<GroupMetadata[]>;
|
|
4
|
-
export declare function getGroupsByWallet(walletAddr: Address, chainId: string): Promise<GroupMetadata[]>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get the name of an NFT collection
|
|
3
|
-
* @param {string} chainId https://chainlist.org/
|
|
4
|
-
* @param {string} nftAddress Address of NFT
|
|
5
|
-
* @returns JSON
|
|
6
|
-
* {
|
|
7
|
-
* "success": true,
|
|
8
|
-
* "name": "Anatomy Science Ape Club"
|
|
9
|
-
* }
|
|
10
|
-
*/
|
|
11
|
-
export declare function getNftName(chainId: string, nftAddress: string): Promise<any>;
|
|
12
|
-
/**
|
|
13
|
-
* Get the address and chainId of an NFT collection
|
|
14
|
-
* @param {string} name Name of NFT
|
|
15
|
-
* @returns JSON
|
|
16
|
-
* {
|
|
17
|
-
* "success": true,
|
|
18
|
-
* "address": "0x96fc56721d2b79485692350014875b3b67cb00eb",
|
|
19
|
-
* "chain": "1"
|
|
20
|
-
* }
|
|
21
|
-
*/
|
|
22
|
-
export declare function getNftAddress(name: string): Promise<any>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { PaymasterType } from '../sponsors/types';
|
|
2
|
-
export interface PaymasterTransaction {
|
|
3
|
-
action: string;
|
|
4
|
-
amount: number;
|
|
5
|
-
from: string;
|
|
6
|
-
to: string;
|
|
7
|
-
token: string;
|
|
8
|
-
txid?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function addTransaction(chainId: string, timestamp: number, txid: any, transaction: PaymasterTransaction, paymasterType: PaymasterType, sponsorAddress: string): Promise<any>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { TransactionParams } from '../common';
|
|
2
|
-
export declare function get1InchSwapTx(chainId: string, src: string, dst: string, amount: string, from: string, slippage: string, disableEstimate: string, allowPartialFill: string): Promise<TransactionParams>;
|
|
3
|
-
export declare function get1InchAllowance(chainId: string, tokenAddress: string, walletAddress: string): Promise<number>;
|
|
4
|
-
export declare function get1InchApproveTx(chainId: string, tokenAddress: string, amount: string): Promise<TransactionParams>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare class BaseError extends Error {
|
|
2
|
-
baseType: string;
|
|
3
|
-
type: string;
|
|
4
|
-
code: string;
|
|
5
|
-
paramsUsed: any;
|
|
6
|
-
timestamp: string;
|
|
7
|
-
constructor(baseType: string, type: string, code: string, msg: string, paramsUsed: any, fixSuggestion: string, docLink: string, isInternal?: boolean);
|
|
8
|
-
loadEnd(): void;
|
|
9
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { BaseError } from './BaseError';
|
|
2
|
-
export declare class ClientError extends BaseError {
|
|
3
|
-
constructor(type: string, code: string, msg: string, paramsUsed: any, fixSuggestion: string, docLink: string);
|
|
4
|
-
}
|
|
5
|
-
export declare class InvalidParameterError extends ClientError {
|
|
6
|
-
constructor(code: string, msg: string, paramsUsed: any, fixSuggestion: string, docLink: string);
|
|
7
|
-
}
|
|
8
|
-
export declare class ResourceNotFoundError extends ClientError {
|
|
9
|
-
constructor(code: string, msg: string, paramsUsed: any, fixSuggestion: string, docLink: string);
|
|
10
|
-
}
|
|
11
|
-
export declare class InvalidActionError extends ClientError {
|
|
12
|
-
constructor(code: string, msg: string, paramsUsed: any, fixSuggestion: string, docLink: string);
|
|
13
|
-
}
|
|
14
|
-
export declare class ThrottlingError extends ClientError {
|
|
15
|
-
constructor(code: string, msg: string, paramsUsed: any, fixSuggestion: string, docLink: string);
|
|
16
|
-
}
|
|
17
|
-
export declare class AccessDeniedError extends ClientError {
|
|
18
|
-
constructor(code: string, msg: string, paramsUsed: any, fixSuggestion: string, docLink: string);
|
|
19
|
-
}
|
|
20
|
-
export declare class UserOpFailureError extends ClientError {
|
|
21
|
-
constructor(code: string, msg: string, paramsUsed: any, fixSuggestion: string, docLink: string);
|
|
22
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BaseError } from './BaseError';
|
|
2
|
-
export declare class ServerError extends BaseError {
|
|
3
|
-
constructor(type: string, code: string, msg: string, paramsUsed: any, fixSuggestion: string, docLink: string);
|
|
4
|
-
}
|
|
5
|
-
export declare class InternalFailureError extends ServerError {
|
|
6
|
-
constructor(code: string, msg: string, paramsUsed: any, fixSuggestion: string, docLink: string);
|
|
7
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
export type ErrorData = {
|
|
2
|
-
location: string;
|
|
3
|
-
error?: {
|
|
4
|
-
txDetails?: ErrorTransactionDetails;
|
|
5
|
-
reasonData?: {
|
|
6
|
-
title: string;
|
|
7
|
-
reasons: string[];
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export type ErrorTransactionDetails = {
|
|
12
|
-
method: string;
|
|
13
|
-
params: any[];
|
|
14
|
-
contractAddress?: string;
|
|
15
|
-
chainId?: number | string;
|
|
16
|
-
};
|
|
17
|
-
export declare enum ErrorBaseType {
|
|
18
|
-
ClientError = "ClientError",
|
|
19
|
-
ServerError = "ServerError"
|
|
20
|
-
}
|
|
21
|
-
export declare enum ErrorType {
|
|
22
|
-
InvalidParameter = "InvalidParameter",
|
|
23
|
-
InternalServerFailure = "InternalServerFailure",
|
|
24
|
-
ResourceNotFound = "ResourceNotFound",
|
|
25
|
-
InvalidAction = "InvalidAction",
|
|
26
|
-
ThrottlingError = "ThrottlingError",
|
|
27
|
-
AccessDeniedError = "AccessDeniedError",
|
|
28
|
-
UserOpFailureError = "UserOpFailureError"
|
|
29
|
-
}
|
|
30
|
-
export declare enum ErrorCode {
|
|
31
|
-
MissingParameter = "MissingParameter",
|
|
32
|
-
InvalidParameter = "InvalidParameter",
|
|
33
|
-
InvalidThreshold = "InvalidThreshold",
|
|
34
|
-
InvalidChainIdentifier = "InvalidChainIdentifier",
|
|
35
|
-
InvalidNFTIdentifier = "InvalidNFTIdentifier",
|
|
36
|
-
InsufficientSignatures = "InsufficientSignatures",
|
|
37
|
-
InvalidParameterCombination = "InvalidParameterCombination",
|
|
38
|
-
CheckPointHintsNotFound = "CheckPointHintsNotFound",
|
|
39
|
-
GroupNotFound = "GroupNotFound",
|
|
40
|
-
TokenNotFound = "TokenNotFound",
|
|
41
|
-
AddressNotFound = "AddressNotFound",
|
|
42
|
-
UserAlreadyExists = "UserAlreadyExists",
|
|
43
|
-
UserNotFound = "UserNotFound",
|
|
44
|
-
ChainNotSupported = "ChainNotSupported",
|
|
45
|
-
ServerMissingData = "ServerMissingData",
|
|
46
|
-
ServerFailure = "ServerFailure",
|
|
47
|
-
ServerTimeout = "ServerTimeout",
|
|
48
|
-
UnknownServerError = "UnknownServerError",
|
|
49
|
-
ServerConnectionError = "ServerConnectionError",
|
|
50
|
-
UserOpFailureError = "UserOpFailureError",
|
|
51
|
-
Unauthorized = "Unauthorized",
|
|
52
|
-
RequestLimitExceeded = "RequestLimitExceeded",
|
|
53
|
-
WalletPrefundError = "PrefundError",
|
|
54
|
-
GasSponsorFundError = "GasSponsorFundError",
|
|
55
|
-
FunWalletErrorCode = "FunWalletErrorCode",
|
|
56
|
-
BridgeRouteNotFound = "BridgeRouteNotFound",
|
|
57
|
-
BridgeAllowanceDataNotFound = "BridgeAllowanceDataNotFound",
|
|
58
|
-
BridgeApproveTxDataNotFound = "BridgeApproveTxDataNotFound",
|
|
59
|
-
CheckoutInitDepositAddrNotFound = "CheckoutInitDepositAddrNotFound"
|
|
60
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { type Address, type PublicClient } from 'viem';
|
|
2
|
-
import type { UniswapPoolFeeOptions } from '../actions';
|
|
3
|
-
export declare function fromReadableAmount(amount: number, decimals: number): bigint;
|
|
4
|
-
type SwapParamsUtils = {
|
|
5
|
-
tokenInAddress: Address;
|
|
6
|
-
tokenOutAddress: Address;
|
|
7
|
-
amountIn: number;
|
|
8
|
-
recipient: Address;
|
|
9
|
-
percentDecimal: number;
|
|
10
|
-
slippage: number;
|
|
11
|
-
poolFee: UniswapPoolFeeOptions;
|
|
12
|
-
};
|
|
13
|
-
export type UniswapV3Addrs = {
|
|
14
|
-
univ3quoter: Address;
|
|
15
|
-
univ3factory: Address;
|
|
16
|
-
univ3router: Address;
|
|
17
|
-
};
|
|
18
|
-
export type UniswapV2Addrs = {
|
|
19
|
-
factory: Address;
|
|
20
|
-
router: Address;
|
|
21
|
-
};
|
|
22
|
-
export declare function swapExec(client: PublicClient, uniswapAddrs: UniswapV3Addrs, swapParams: SwapParamsUtils, chainId: number): Promise<{
|
|
23
|
-
amount: string;
|
|
24
|
-
data: string;
|
|
25
|
-
to: string;
|
|
26
|
-
value: string;
|
|
27
|
-
}>;
|
|
28
|
-
export declare function swapExecV2(client: PublicClient, uniswapAddrs: UniswapV2Addrs, swapParams: SwapParamsUtils, chainId: number): Promise<{
|
|
29
|
-
data: `0x${string}` | undefined;
|
|
30
|
-
to: `0x${string}`;
|
|
31
|
-
amount: string;
|
|
32
|
-
}>;
|
|
33
|
-
export {};
|