@funkit/core 0.8.6 → 0.10.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/fetch-polyfill.js.map +1 -1
- package/dist/index.d.ts +12 -12
- package/dist/src/abis/CheckoutPaymaster.json +1 -0
- package/dist/src/abis/EstimationPaymaster.json +1 -1
- package/dist/src/abis/UniswapV3LimitOrder.json +1 -1
- package/dist/src/actions/AccessControl.d.ts +6 -6
- package/dist/src/actions/AccessControl.js +23 -16
- package/dist/src/actions/AccessControl.js.map +1 -1
- package/dist/src/actions/BatchActions.d.ts +2 -2
- package/dist/src/actions/BatchActions.js +2 -2
- package/dist/src/actions/BatchActions.js.map +1 -1
- package/dist/src/actions/Bridge.d.ts +5 -4
- package/dist/src/actions/Bridge.js +13 -9
- package/dist/src/actions/Bridge.js.map +1 -1
- package/dist/src/actions/FirstClassActions.d.ts +8 -6
- package/dist/src/actions/FirstClassActions.js +44 -69
- package/dist/src/actions/FirstClassActions.js.map +1 -1
- package/dist/src/actions/Group.d.ts +3 -3
- package/dist/src/actions/Group.js +6 -14
- package/dist/src/actions/Group.js.map +1 -1
- package/dist/src/actions/LimitOrder.d.ts +4 -4
- package/dist/src/actions/LimitOrder.js +21 -19
- package/dist/src/actions/LimitOrder.js.map +1 -1
- package/dist/src/actions/Stake.d.ts +3 -3
- package/dist/src/actions/Stake.js +31 -44
- package/dist/src/actions/Stake.js.map +1 -1
- package/dist/src/actions/Swap.d.ts +4 -4
- package/dist/src/actions/Swap.js +43 -41
- package/dist/src/actions/Swap.js.map +1 -1
- package/dist/src/actions/Token.d.ts +6 -6
- package/dist/src/actions/Token.js +46 -33
- package/dist/src/actions/Token.js.map +1 -1
- package/dist/src/actions/index.d.ts +7 -7
- package/dist/src/actions/types.d.ts +4 -4
- package/dist/src/actions/types.js +2 -2
- package/dist/src/actions/types.js.map +1 -1
- package/dist/src/apis/AccessControlApis.d.ts +1 -1
- package/dist/src/apis/AccessControlApis.js +7 -3
- package/dist/src/apis/AccessControlApis.js.map +1 -1
- package/dist/src/apis/AssetApis.d.ts +10 -0
- package/dist/src/apis/AssetApis.js +11 -1
- package/dist/src/apis/AssetApis.js.map +1 -1
- package/dist/src/apis/BridgeApis.d.ts +1 -1
- package/dist/src/apis/BridgeApis.js +13 -13
- package/dist/src/apis/BridgeApis.js.map +1 -1
- package/dist/src/apis/CheckoutApis.d.ts +43 -0
- package/dist/src/apis/CheckoutApis.js +116 -0
- package/dist/src/apis/CheckoutApis.js.map +1 -0
- package/dist/src/apis/ContractApis.js +1 -1
- package/dist/src/apis/ContractApis.js.map +1 -1
- package/dist/src/apis/FaucetApis.js.map +1 -1
- package/dist/src/apis/GroupApis.d.ts +2 -6
- package/dist/src/apis/GroupApis.js +4 -29
- package/dist/src/apis/GroupApis.js.map +1 -1
- package/dist/src/apis/InfoApis.d.ts +1 -1
- package/dist/src/apis/InfoApis.js +9 -7
- package/dist/src/apis/InfoApis.js.map +1 -1
- package/dist/src/apis/ListenerApis.d.ts +1 -1
- package/dist/src/apis/ListenerApis.js +6 -6
- package/dist/src/apis/ListenerApis.js.map +1 -1
- package/dist/src/apis/MeshApis.d.ts +87 -0
- package/dist/src/apis/MeshApis.js +213 -0
- package/dist/src/apis/MeshApis.js.map +1 -0
- package/dist/src/apis/NFTApis.js.map +1 -1
- package/dist/src/apis/OnOffRampApis.d.ts +2 -0
- package/dist/src/apis/OnOffRampApis.js +24 -5
- package/dist/src/apis/OnOffRampApis.js.map +1 -1
- package/dist/src/apis/OnOffRampUtils.js +2 -2
- package/dist/src/apis/OnOffRampUtils.js.map +1 -1
- package/dist/src/apis/OperationApis.d.ts +4 -4
- package/dist/src/apis/OperationApis.js +21 -12
- package/dist/src/apis/OperationApis.js.map +1 -1
- package/dist/src/apis/PaymasterApis.d.ts +1 -6
- package/dist/src/apis/PaymasterApis.js +3 -70
- package/dist/src/apis/PaymasterApis.js.map +1 -1
- package/dist/src/apis/SwapApis.d.ts +2 -2
- package/dist/src/apis/SwapApis.js +6 -6
- package/dist/src/apis/SwapApis.js.map +1 -1
- package/dist/src/apis/TurnkeyApis.d.ts +3 -0
- package/dist/src/apis/TurnkeyApis.js +19 -0
- package/dist/src/apis/TurnkeyApis.js.map +1 -0
- package/dist/src/apis/UserApis.d.ts +2 -5
- package/dist/src/apis/UserApis.js +11 -22
- package/dist/src/apis/UserApis.js.map +1 -1
- package/dist/src/apis/index.d.ts +13 -10
- package/dist/src/apis/index.js +4 -1
- package/dist/src/apis/index.js.map +1 -1
- package/dist/src/apis/types.d.ts +79 -7
- package/dist/src/apis/types.js +16 -0
- package/dist/src/apis/types.js.map +1 -1
- package/dist/src/auth/Auth.d.ts +6 -6
- package/dist/src/auth/Auth.js +48 -46
- package/dist/src/auth/Auth.js.map +1 -1
- package/dist/src/auth/SessionKeyAuth.d.ts +5 -5
- package/dist/src/auth/SessionKeyAuth.js +29 -24
- package/dist/src/auth/SessionKeyAuth.js.map +1 -1
- package/dist/src/auth/index.d.ts +2 -2
- package/dist/src/auth/types.d.ts +1 -1
- package/dist/src/common/constants.d.ts +111 -17
- package/dist/src/common/constants.js +158 -85
- package/dist/src/common/constants.js.map +1 -1
- package/dist/src/common/index.d.ts +2 -2
- package/dist/src/common/types.d.ts +2 -2
- package/dist/src/config/Config.d.ts +1 -1
- package/dist/src/config/Config.js +10 -4
- package/dist/src/config/Config.js.map +1 -1
- package/dist/src/config/index.d.ts +2 -2
- package/dist/src/config/types.d.ts +4 -2
- package/dist/src/data/Chain.d.ts +4 -4
- package/dist/src/data/Chain.js +38 -27
- package/dist/src/data/Chain.js.map +1 -1
- package/dist/src/data/NFT.d.ts +3 -3
- package/dist/src/data/NFT.js +11 -11
- package/dist/src/data/NFT.js.map +1 -1
- package/dist/src/data/Operation.d.ts +5 -5
- package/dist/src/data/Operation.js +12 -10
- package/dist/src/data/Operation.js.map +1 -1
- package/dist/src/data/SolidityData.d.ts +3 -3
- package/dist/src/data/SolidityData.js +37 -17
- package/dist/src/data/SolidityData.js.map +1 -1
- package/dist/src/data/Token.d.ts +21 -20
- package/dist/src/data/Token.js +49 -51
- package/dist/src/data/Token.js.map +1 -1
- package/dist/src/data/index.d.ts +6 -6
- package/dist/src/data/index.js +2 -2
- package/dist/src/data/index.js.map +1 -1
- package/dist/src/data/types.d.ts +2 -2
- package/dist/src/data/types.js +3 -3
- package/dist/src/data/types.js.map +1 -1
- package/dist/src/errors/BaseError.js +4 -3
- package/dist/src/errors/BaseError.js.map +1 -1
- package/dist/src/errors/ClientError.d.ts +1 -1
- package/dist/src/errors/ClientError.js +3 -3
- package/dist/src/errors/ClientError.js.map +1 -1
- package/dist/src/errors/ServerError.d.ts +1 -1
- package/dist/src/errors/ServerError.js.map +1 -1
- package/dist/src/errors/index.d.ts +4 -4
- package/dist/src/errors/types.d.ts +2 -1
- package/dist/src/errors/types.js +4 -3
- package/dist/src/errors/types.js.map +1 -1
- package/dist/src/sponsors/CheckoutSponsor.d.ts +23 -0
- package/dist/src/sponsors/CheckoutSponsor.js +65 -0
- package/dist/src/sponsors/CheckoutSponsor.js.map +1 -0
- package/dist/src/sponsors/GaslessSponsor.d.ts +6 -6
- package/dist/src/sponsors/GaslessSponsor.js +20 -32
- package/dist/src/sponsors/GaslessSponsor.js.map +1 -1
- package/dist/src/sponsors/Sponsor.d.ts +15 -15
- package/dist/src/sponsors/Sponsor.js +24 -40
- package/dist/src/sponsors/Sponsor.js.map +1 -1
- package/dist/src/sponsors/TokenSponsor.d.ts +15 -15
- package/dist/src/sponsors/TokenSponsor.js +118 -135
- package/dist/src/sponsors/TokenSponsor.js.map +1 -1
- package/dist/src/sponsors/index.d.ts +4 -3
- package/dist/src/sponsors/index.js +2 -1
- package/dist/src/sponsors/index.js.map +1 -1
- package/dist/src/sponsors/types.d.ts +2 -1
- package/dist/src/sponsors/types.js +2 -1
- package/dist/src/sponsors/types.js.map +1 -1
- package/dist/src/utils/ApiUtils.js +21 -19
- package/dist/src/utils/ApiUtils.js.map +1 -1
- package/dist/src/utils/AuthUtils.d.ts +1 -2
- package/dist/src/utils/AuthUtils.js +7 -25
- package/dist/src/utils/AuthUtils.js.map +1 -1
- package/dist/src/utils/ChainUtils.d.ts +5 -5
- package/dist/src/utils/ChainUtils.js +35 -20
- package/dist/src/utils/ChainUtils.js.map +1 -1
- package/dist/src/utils/CheckoutUtils.d.ts +6 -0
- package/dist/src/utils/CheckoutUtils.js +24 -0
- package/dist/src/utils/CheckoutUtils.js.map +1 -0
- package/dist/src/utils/GroupUtils.d.ts +4 -0
- package/dist/src/utils/GroupUtils.js +30 -0
- package/dist/src/utils/GroupUtils.js.map +1 -0
- package/dist/src/utils/MerkleUtils.d.ts +1 -1
- package/dist/src/utils/MerkleUtils.js +5 -5
- package/dist/src/utils/MerkleUtils.js.map +1 -1
- package/dist/src/utils/PaymasterUtils.d.ts +3 -3
- package/dist/src/utils/PaymasterUtils.js +6 -2
- package/dist/src/utils/PaymasterUtils.js.map +1 -1
- package/dist/src/utils/SwapUtils.d.ts +2 -2
- package/dist/src/utils/SwapUtils.js +43 -34
- package/dist/src/utils/SwapUtils.js.map +1 -1
- package/dist/src/utils/TypeUtils.js.map +1 -1
- package/dist/src/utils/UserOpUtils.d.ts +2 -2
- package/dist/src/utils/UserOpUtils.js +79 -65
- package/dist/src/utils/UserOpUtils.js.map +1 -1
- package/dist/src/utils/ViemUtils.d.ts +2 -2
- package/dist/src/utils/ViemUtils.js +10 -6
- package/dist/src/utils/ViemUtils.js.map +1 -1
- package/dist/src/utils/WalletUtils.d.ts +2 -2
- package/dist/src/utils/WalletUtils.js +6 -5
- package/dist/src/utils/WalletUtils.js.map +1 -1
- package/dist/src/utils/index.d.ts +8 -7
- package/dist/src/utils/index.js +1 -0
- package/dist/src/utils/index.js.map +1 -1
- package/dist/src/viem/ContractInterface.d.ts +4 -4
- package/dist/src/viem/ContractInterface.js +8 -8
- package/dist/src/viem/ContractInterface.js.map +1 -1
- package/dist/src/viem/Converter.d.ts +823 -1107
- package/dist/src/viem/Converter.js +13 -11
- package/dist/src/viem/Converter.js.map +1 -1
- package/dist/src/viem/index.d.ts +2 -2
- package/dist/src/wallet/FunWallet.d.ts +8 -8
- package/dist/src/wallet/FunWallet.js +141 -97
- package/dist/src/wallet/FunWallet.js.map +1 -1
- package/dist/src/wallet/index.d.ts +2 -2
- package/dist/src/wallet/types.d.ts +1 -1
- package/package.json +15 -8
|
@@ -1,61 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.addTransaction = void 0;
|
|
4
4
|
const constants_1 = require("../common/constants");
|
|
5
5
|
const ApiUtils_1 = require("../utils/ApiUtils");
|
|
6
|
-
async function updatePaymasterMode(chainId, updateObj, paymasterType, sponsorAddress) {
|
|
7
|
-
try {
|
|
8
|
-
return await (0, ApiUtils_1.sendPostRequest)(constants_1.DASHBOARD_API_URL, "paymasters/update", {
|
|
9
|
-
chain: chainId,
|
|
10
|
-
sponsorAddress,
|
|
11
|
-
type: paymasterType,
|
|
12
|
-
updateObj
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
catch (e) {
|
|
16
|
-
/* empty */
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.updatePaymasterMode = updatePaymasterMode;
|
|
20
|
-
async function removeFromList(chainId, address, listType, paymasterType, sponsorAddress) {
|
|
21
|
-
try {
|
|
22
|
-
return await (0, ApiUtils_1.sendPostRequest)(constants_1.DASHBOARD_API_URL, "paymasters/remove-from-list", {
|
|
23
|
-
chain: chainId,
|
|
24
|
-
sponsorAddress,
|
|
25
|
-
type: paymasterType,
|
|
26
|
-
listType,
|
|
27
|
-
updateAddrs: address
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
catch (e) {
|
|
31
|
-
/* empty */
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.removeFromList = removeFromList;
|
|
35
|
-
async function addToList(chainId, address, listType, paymasterType, sponsorAddress) {
|
|
36
|
-
try {
|
|
37
|
-
return await (0, ApiUtils_1.sendPostRequest)(constants_1.DASHBOARD_API_URL, "paymasters/add-to-list", {
|
|
38
|
-
chain: chainId,
|
|
39
|
-
sponsorAddress,
|
|
40
|
-
type: paymasterType,
|
|
41
|
-
listType,
|
|
42
|
-
updateAddrs: address
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
catch (e) {
|
|
46
|
-
/* empty */
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
exports.addToList = addToList;
|
|
50
6
|
async function addTransaction(chainId, timestamp, txid, transaction, paymasterType, sponsorAddress) {
|
|
51
7
|
try {
|
|
52
|
-
return await (0, ApiUtils_1.sendPostRequest)(constants_1.DASHBOARD_API_URL,
|
|
8
|
+
return await (0, ApiUtils_1.sendPostRequest)(constants_1.DASHBOARD_API_URL, 'paymasters/add-transaction', {
|
|
53
9
|
chain: chainId,
|
|
54
10
|
sponsorAddress,
|
|
55
11
|
type: paymasterType,
|
|
56
12
|
timestamp,
|
|
57
13
|
transaction,
|
|
58
|
-
txid
|
|
14
|
+
txid,
|
|
59
15
|
});
|
|
60
16
|
}
|
|
61
17
|
catch (e) {
|
|
@@ -63,27 +19,4 @@ async function addTransaction(chainId, timestamp, txid, transaction, paymasterTy
|
|
|
63
19
|
}
|
|
64
20
|
}
|
|
65
21
|
exports.addTransaction = addTransaction;
|
|
66
|
-
async function addPaymasterToken(chainId, tokenAddress) {
|
|
67
|
-
try {
|
|
68
|
-
return await (0, ApiUtils_1.sendPostRequest)(constants_1.DASHBOARD_API_URL, "paymasters/supported-tokens/add", {
|
|
69
|
-
chain: chainId,
|
|
70
|
-
tokenAddress
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
catch (e) {
|
|
74
|
-
/* empty */
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
exports.addPaymasterToken = addPaymasterToken;
|
|
78
|
-
async function batchOperation(chainId, addresses, modes, list, paymasterType, sponsorAddress) {
|
|
79
|
-
const addList = addresses.filter((_, i) => {
|
|
80
|
-
return modes[i];
|
|
81
|
-
});
|
|
82
|
-
const removeList = addresses.filter((_, i) => {
|
|
83
|
-
return !modes[i];
|
|
84
|
-
});
|
|
85
|
-
await addToList(chainId.toString(), addList, list, paymasterType, sponsorAddress);
|
|
86
|
-
await removeFromList(chainId, removeList, list, paymasterType, sponsorAddress);
|
|
87
|
-
}
|
|
88
|
-
exports.batchOperation = batchOperation;
|
|
89
22
|
//# sourceMappingURL=PaymasterApis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymasterApis.js","sourceRoot":"","sources":["../../../src/apis/PaymasterApis.ts"],"names":[],"mappings":";;;AAAA,mDAAuD;AAEvD,gDAAmD;AAU5C,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"PaymasterApis.js","sourceRoot":"","sources":["../../../src/apis/PaymasterApis.ts"],"names":[],"mappings":";;;AAAA,mDAAuD;AAEvD,gDAAmD;AAU5C,KAAK,UAAU,cAAc,CAClC,OAAe,EACf,SAAiB,EACjB,IAAI,EACJ,WAAiC,EACjC,aAA4B,EAC5B,cAAsB;IAEtB,IAAI,CAAC;QACH,OAAO,MAAM,IAAA,0BAAe,EAC1B,6BAAiB,EACjB,4BAA4B,EAC5B;YACE,KAAK,EAAE,OAAO;YACd,cAAc;YACd,IAAI,EAAE,aAAa;YACnB,SAAS;YACT,WAAW;YACX,IAAI;SACL,CACF,CAAA;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,WAAW;IACb,CAAC;AACH,CAAC;AAxBD,wCAwBC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TransactionParams } from
|
|
1
|
+
import { 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
|
-
export declare function get1InchAllowance(chainId: string, tokenAddress: string, walletAddress: string): Promise<
|
|
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>;
|
|
@@ -11,35 +11,35 @@ async function get1InchSwapTx(chainId, src, dst, amount, from, slippage, disable
|
|
|
11
11
|
from,
|
|
12
12
|
slippage,
|
|
13
13
|
disableEstimate,
|
|
14
|
-
allowPartialFill
|
|
14
|
+
allowPartialFill,
|
|
15
15
|
}).toString();
|
|
16
16
|
const res = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `swap/${chainId}/swap/?${params}`);
|
|
17
17
|
return {
|
|
18
18
|
to: res.tx.to,
|
|
19
19
|
value: Number(res.tx.value),
|
|
20
|
-
data: res.tx.data
|
|
20
|
+
data: res.tx.data,
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
exports.get1InchSwapTx = get1InchSwapTx;
|
|
24
24
|
async function get1InchAllowance(chainId, tokenAddress, walletAddress) {
|
|
25
25
|
const params = new URLSearchParams({
|
|
26
26
|
tokenAddress,
|
|
27
|
-
walletAddress
|
|
27
|
+
walletAddress,
|
|
28
28
|
}).toString();
|
|
29
29
|
const res = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `swap/${chainId}/approve/allowance/?${params}`);
|
|
30
|
-
return Number(res[
|
|
30
|
+
return Number(res['allowance']);
|
|
31
31
|
}
|
|
32
32
|
exports.get1InchAllowance = get1InchAllowance;
|
|
33
33
|
async function get1InchApproveTx(chainId, tokenAddress, amount) {
|
|
34
34
|
const params = new URLSearchParams({
|
|
35
35
|
tokenAddress,
|
|
36
|
-
amount
|
|
36
|
+
amount,
|
|
37
37
|
}).toString();
|
|
38
38
|
const res = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `swap/${chainId}/approve/transaction/?${params}`);
|
|
39
39
|
return {
|
|
40
40
|
to: res.to,
|
|
41
41
|
value: Number(res.value),
|
|
42
|
-
data: res.data
|
|
42
|
+
data: res.data,
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
exports.get1InchApproveTx = get1InchApproveTx;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwapApis.js","sourceRoot":"","sources":["../../../src/apis/SwapApis.ts"],"names":[],"mappings":";;;AACA,mDAA6C;AAC7C,gDAAkD;AAE3C,KAAK,UAAU,cAAc,
|
|
1
|
+
{"version":3,"file":"SwapApis.js","sourceRoot":"","sources":["../../../src/apis/SwapApis.ts"],"names":[],"mappings":";;;AACA,mDAA6C;AAC7C,gDAAkD;AAE3C,KAAK,UAAU,cAAc,CAClC,OAAe,EACf,GAAW,EACX,GAAW,EACX,MAAc,EACd,IAAY,EACZ,QAAgB,EAChB,eAAuB,EACvB,gBAAwB;IAExB,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;QACjC,GAAG;QACH,GAAG;QACH,MAAM;QACN,IAAI;QACJ,QAAQ;QACR,eAAe;QACf,gBAAgB;KACjB,CAAC,CAAC,QAAQ,EAAE,CAAA;IACb,MAAM,GAAG,GAAG,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,QAAQ,OAAO,UAAU,MAAM,EAAE,CAAC,CAAA;IAC5E,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE;QACb,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC;QAC3B,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI;KAClB,CAAA;AACH,CAAC;AAzBD,wCAyBC;AAEM,KAAK,UAAU,iBAAiB,CACrC,OAAe,EACf,YAAoB,EACpB,aAAqB;IAErB,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;QACjC,YAAY;QACZ,aAAa;KACd,CAAC,CAAC,QAAQ,EAAE,CAAA;IACb,MAAM,GAAG,GAAG,MAAM,IAAA,yBAAc,EAC9B,mBAAO,EACP,QAAQ,OAAO,uBAAuB,MAAM,EAAE,CAC/C,CAAA;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAA;AACjC,CAAC;AAdD,8CAcC;AAEM,KAAK,UAAU,iBAAiB,CACrC,OAAe,EACf,YAAoB,EACpB,MAAc;IAEd,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;QACjC,YAAY;QACZ,MAAM;KACP,CAAC,CAAC,QAAQ,EAAE,CAAA;IACb,MAAM,GAAG,GAAG,MAAM,IAAA,yBAAc,EAC9B,mBAAO,EACP,QAAQ,OAAO,yBAAyB,MAAM,EAAE,CACjD,CAAA;IACD,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;QACxB,IAAI,EAAE,GAAG,CAAC,IAAI;KACf,CAAA;AACH,CAAC;AAlBD,8CAkBC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTurnkeyPrivateKey = exports.createTurnkeySubOrg = void 0;
|
|
4
|
+
const constants_1 = require("../common/constants");
|
|
5
|
+
const ApiUtils_1 = require("../utils/ApiUtils");
|
|
6
|
+
async function createTurnkeySubOrg(createSubOrgRequest) {
|
|
7
|
+
const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'turnkey/sub-org', createSubOrgRequest);
|
|
8
|
+
return res;
|
|
9
|
+
}
|
|
10
|
+
exports.createTurnkeySubOrg = createTurnkeySubOrg;
|
|
11
|
+
async function createTurnkeyPrivateKey(signedRequest) {
|
|
12
|
+
const res = await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'turnkey/private-key', signedRequest);
|
|
13
|
+
return {
|
|
14
|
+
id: res.id,
|
|
15
|
+
address: res.address,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
exports.createTurnkeyPrivateKey = createTurnkeyPrivateKey;
|
|
19
|
+
//# sourceMappingURL=TurnkeyApis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TurnkeyApis.js","sourceRoot":"","sources":["../../../src/apis/TurnkeyApis.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,gDAAmD;AAG5C,KAAK,UAAU,mBAAmB,CACvC,mBAA2B;IAE3B,MAAM,GAAG,GAAG,MAAM,IAAA,0BAAe,EAC/B,mBAAO,EACP,iBAAiB,EACjB,mBAAmB,CACpB,CAAA;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AATD,kDASC;AAEM,KAAK,UAAU,uBAAuB,CAC3C,aAAqB;IAErB,MAAM,GAAG,GAAG,MAAM,IAAA,0BAAe,EAC/B,mBAAO,EACP,qBAAqB,EACrB,aAAa,CACd,CAAA;IACD,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,OAAO,EAAE,GAAG,CAAC,OAAO;KACrB,CAAA;AACH,CAAC;AAZD,0DAYC"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { Address, Hex } from
|
|
2
|
-
import { Wallet } from
|
|
1
|
+
import { Address, Hex } from 'viem';
|
|
2
|
+
import { 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>;
|
|
6
6
|
export declare function getUserWalletsByAddr(addr: string, chainId?: string): Promise<Wallet[]>;
|
|
7
7
|
export declare function getUserAuthIdByAddr(addr: string): Promise<string>;
|
|
8
8
|
export declare function addUserToWallet(authId: string, chainId: string, walletAddr: Address, userIds: Hex[], walletUniqueId?: string): Promise<void>;
|
|
9
|
-
export declare function removeUserWalletIdentity(authId: string, chainId: string, walletAddr: Address, userId: Hex): Promise<void>;
|
|
10
9
|
export declare function getUserWalletIdentities(authId: string, chainId: string, walletAddr: Address): Promise<Hex[]>;
|
|
11
|
-
export declare function addUserToGroup(authId: string, chainId: string, walletAddr: Address, groupId: Hex): Promise<void>;
|
|
12
|
-
export declare function removeUserFromGroup(authId: string, chainId: string, walletAddr: Address, groupId: Hex): Promise<void>;
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getUserWalletIdentities = exports.addUserToWallet = exports.getUserAuthIdByAddr = exports.getUserWalletsByAddr = exports.getUserAddr = exports.getUserUniqueId = exports.createUser = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
5
|
const constants_1 = require("../common/constants");
|
|
6
6
|
const errors_1 = require("../errors");
|
|
7
7
|
const ApiUtils_1 = require("../utils/ApiUtils");
|
|
8
8
|
async function createUser(authId, addr, method, userUniqueId) {
|
|
9
|
-
await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL,
|
|
9
|
+
await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'user', {
|
|
10
10
|
authId,
|
|
11
11
|
addr,
|
|
12
12
|
method,
|
|
13
|
-
userUniqueId
|
|
13
|
+
userUniqueId,
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
exports.createUser = createUser;
|
|
17
17
|
async function getUserUniqueId(authId) {
|
|
18
18
|
try {
|
|
19
|
-
return (await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `user/auth/${authId}/unique-id`))
|
|
19
|
+
return (await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `user/auth/${authId}/unique-id`))
|
|
20
|
+
.userUniqueId;
|
|
20
21
|
}
|
|
21
22
|
catch (err) {
|
|
22
23
|
if (err instanceof errors_1.ResourceNotFoundError) {
|
|
23
|
-
return
|
|
24
|
+
return '';
|
|
24
25
|
}
|
|
25
26
|
throw err;
|
|
26
27
|
}
|
|
@@ -31,7 +32,9 @@ async function getUserAddr(authId) {
|
|
|
31
32
|
}
|
|
32
33
|
exports.getUserAddr = getUserAddr;
|
|
33
34
|
async function getUserWalletsByAddr(addr, chainId) {
|
|
34
|
-
const endpoint = chainId
|
|
35
|
+
const endpoint = chainId
|
|
36
|
+
? `user/addr/${addr}/wallets?chainId=${chainId}`
|
|
37
|
+
: `user/addr/${addr}/wallets`;
|
|
35
38
|
return (await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, endpoint)).wallets;
|
|
36
39
|
}
|
|
37
40
|
exports.getUserWalletsByAddr = getUserWalletsByAddr;
|
|
@@ -44,7 +47,7 @@ async function addUserToWallet(authId, chainId, walletAddr, userIds, walletUniqu
|
|
|
44
47
|
await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, `user/auth/${authId}/chain/${chainId}/wallet`, {
|
|
45
48
|
walletAddr,
|
|
46
49
|
userIds,
|
|
47
|
-
walletUniqueId
|
|
50
|
+
walletUniqueId,
|
|
48
51
|
});
|
|
49
52
|
}
|
|
50
53
|
catch (err) {
|
|
@@ -55,23 +58,9 @@ async function addUserToWallet(authId, chainId, walletAddr, userIds, walletUniqu
|
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
60
|
exports.addUserToWallet = addUserToWallet;
|
|
58
|
-
async function removeUserWalletIdentity(authId, chainId, walletAddr, userId) {
|
|
59
|
-
await (0, ApiUtils_1.sendDeleteRequest)(constants_1.API_URL, `user/auth/${authId}/chain/${chainId}/wallet/${walletAddr}/identity/${userId}`);
|
|
60
|
-
}
|
|
61
|
-
exports.removeUserWalletIdentity = removeUserWalletIdentity;
|
|
62
61
|
// return userIds of the specificed Wallet.
|
|
63
62
|
async function getUserWalletIdentities(authId, chainId, walletAddr) {
|
|
64
|
-
return (await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `user/auth/${authId}/chain/${chainId}/wallet/${walletAddr}/identities`)).ids ?? [];
|
|
63
|
+
return ((await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `user/auth/${authId}/chain/${chainId}/wallet/${walletAddr}/identities`)).ids ?? []);
|
|
65
64
|
}
|
|
66
65
|
exports.getUserWalletIdentities = getUserWalletIdentities;
|
|
67
|
-
async function addUserToGroup(authId, chainId, walletAddr, groupId) {
|
|
68
|
-
await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, `user/auth/${authId}/chain/${chainId}/wallet/${walletAddr}/group`, {
|
|
69
|
-
groupId
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
exports.addUserToGroup = addUserToGroup;
|
|
73
|
-
async function removeUserFromGroup(authId, chainId, walletAddr, groupId) {
|
|
74
|
-
await (0, ApiUtils_1.sendDeleteRequest)(constants_1.API_URL, `user/auth/${authId}/chain/${chainId}/wallet/${walletAddr}/group/${groupId}`);
|
|
75
|
-
}
|
|
76
|
-
exports.removeUserFromGroup = removeUserFromGroup;
|
|
77
66
|
//# sourceMappingURL=UserApis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserApis.js","sourceRoot":"","sources":["../../../src/apis/UserApis.ts"],"names":[],"mappings":";;;AAAA,+BAA0D;AAE1D,mDAA6C;AAC7C,sCAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"UserApis.js","sourceRoot":"","sources":["../../../src/apis/UserApis.ts"],"names":[],"mappings":";;;AAAA,+BAA0D;AAE1D,mDAA6C;AAC7C,sCAAiD;AACjD,gDAAmE;AAG5D,KAAK,UAAU,UAAU,CAC9B,MAAc,EACd,IAAY,EACZ,MAAc,EACd,YAAoB;IAEpB,MAAM,IAAA,0BAAe,EAAC,mBAAO,EAAE,MAAM,EAAE;QACrC,MAAM;QACN,IAAI;QACJ,MAAM;QACN,YAAY;KACb,CAAC,CAAA;AACJ,CAAC;AAZD,gCAYC;AAEM,KAAK,UAAU,eAAe,CAAC,MAAc;IAClD,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,aAAa,MAAM,YAAY,CAAC,CAAC;aACpE,YAAY,CAAA;IACjB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,8BAAqB,EAAE,CAAC;YACzC,OAAO,EAAE,CAAA;QACX,CAAC;QACD,MAAM,GAAG,CAAA;IACX,CAAC;AACH,CAAC;AAVD,0CAUC;AAEM,KAAK,UAAU,WAAW,CAAC,MAAc;IAC9C,OAAO,CAAC,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,aAAa,MAAM,OAAO,CAAC,CAAC,CAAC,IAAI,CAAA;AACzE,CAAC;AAFD,kCAEC;AAEM,KAAK,UAAU,oBAAoB,CACxC,IAAY,EACZ,OAAgB;IAEhB,MAAM,QAAQ,GAAG,OAAO;QACtB,CAAC,CAAC,aAAa,IAAI,oBAAoB,OAAO,EAAE;QAChD,CAAC,CAAC,aAAa,IAAI,UAAU,CAAA;IAC/B,OAAO,CAAC,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAA;AAC1D,CAAC;AARD,oDAQC;AAEM,KAAK,UAAU,mBAAmB,CAAC,IAAY;IACpD,OAAO,CAAC,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,aAAa,IAAI,SAAS,CAAC,CAAC,CAAC,MAAM,CAAA;AAC3E,CAAC;AAFD,kDAEC;AAEM,KAAK,UAAU,eAAe,CACnC,MAAc,EACd,OAAe,EACf,UAAmB,EACnB,OAAc,EACd,cAAuB;IAEvB,IAAI,CAAC;QACH,MAAM,IAAA,0BAAe,EACnB,mBAAO,EACP,aAAa,MAAM,UAAU,OAAO,SAAS,EAC7C;YACE,UAAU;YACV,OAAO;YACP,cAAc;SACf,CACF,CAAA;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,4BAAqB,EAAE,CAAC;YACzC,kDAAkD;YAClD,OAAM;QACR,CAAC;IACH,CAAC;AACH,CAAC;AAvBD,0CAuBC;AAED,2CAA2C;AACpC,KAAK,UAAU,uBAAuB,CAC3C,MAAc,EACd,OAAe,EACf,UAAmB;IAEnB,OAAO,CACL,CACE,MAAM,IAAA,yBAAc,EAClB,mBAAO,EACP,aAAa,MAAM,UAAU,OAAO,WAAW,UAAU,aAAa,CACvE,CACF,CAAC,GAAG,IAAI,EAAE,CACZ,CAAA;AACH,CAAC;AAbD,0DAaC"}
|
package/dist/src/apis/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
1
|
+
export * from './AssetApis';
|
|
2
|
+
export * from './CheckoutApis';
|
|
3
|
+
export * from './ContractApis';
|
|
4
|
+
export * from './GroupApis';
|
|
5
|
+
export * from './InfoApis';
|
|
6
|
+
export * from './MeshApis';
|
|
7
|
+
export * from './NFTApis';
|
|
8
|
+
export * from './OnOffRampApis';
|
|
9
|
+
export * from './OperationApis';
|
|
10
|
+
export * from './PaymasterApis';
|
|
11
|
+
export * from './TurnkeyApis';
|
|
12
|
+
export * from './types';
|
|
13
|
+
export * from './UserApis';
|
package/dist/src/apis/index.js
CHANGED
|
@@ -15,13 +15,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./AssetApis"), exports);
|
|
18
|
+
__exportStar(require("./CheckoutApis"), exports);
|
|
18
19
|
__exportStar(require("./ContractApis"), exports);
|
|
19
20
|
__exportStar(require("./GroupApis"), exports);
|
|
20
21
|
__exportStar(require("./InfoApis"), exports);
|
|
22
|
+
__exportStar(require("./MeshApis"), exports);
|
|
21
23
|
__exportStar(require("./NFTApis"), exports);
|
|
22
24
|
__exportStar(require("./OnOffRampApis"), exports);
|
|
23
25
|
__exportStar(require("./OperationApis"), exports);
|
|
24
26
|
__exportStar(require("./PaymasterApis"), exports);
|
|
25
|
-
__exportStar(require("./
|
|
27
|
+
__exportStar(require("./TurnkeyApis"), exports);
|
|
26
28
|
__exportStar(require("./types"), exports);
|
|
29
|
+
__exportStar(require("./UserApis"), exports);
|
|
27
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/apis/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,iDAA8B;AAC9B,8CAA2B;AAC3B,6CAA0B;AAC1B,4CAAyB;AACzB,kDAA+B;AAC/B,kDAA+B;AAC/B,kDAA+B;AAC/B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/apis/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,iDAA8B;AAC9B,iDAA8B;AAC9B,8CAA2B;AAC3B,6CAA0B;AAC1B,6CAA0B;AAC1B,4CAAyB;AACzB,kDAA+B;AAC/B,kDAA+B;AAC/B,kDAA+B;AAC/B,gDAA6B;AAC7B,0CAAuB;AACvB,6CAA0B"}
|
package/dist/src/apis/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Address, Hex } from
|
|
2
|
-
import { UserOperation } from
|
|
3
|
-
import { GroupInfo } from
|
|
1
|
+
import { Address, Hex } from 'viem';
|
|
2
|
+
import { UserOperation } from '../data';
|
|
3
|
+
import { GroupInfo } from '../wallet';
|
|
4
4
|
export type Wallet = {
|
|
5
5
|
walletUniqueId?: string;
|
|
6
6
|
walletAddr: Address;
|
|
@@ -13,10 +13,6 @@ export type GroupMetadata = {
|
|
|
13
13
|
walletAddr: Address;
|
|
14
14
|
memberIds: Hex[];
|
|
15
15
|
};
|
|
16
|
-
export type UpdateGroupMetadata = {
|
|
17
|
-
threshold?: number;
|
|
18
|
-
memberIds?: Hex[];
|
|
19
|
-
};
|
|
20
16
|
export type ExecuteOpInput = {
|
|
21
17
|
opId: Hex;
|
|
22
18
|
chainId: string;
|
|
@@ -51,3 +47,79 @@ export type UserOperationGasPrice = {
|
|
|
51
47
|
maxFeePerGas: bigint;
|
|
52
48
|
maxPriorityFeePerGas: bigint;
|
|
53
49
|
};
|
|
50
|
+
export type TPrivateKeyState = {
|
|
51
|
+
id: string;
|
|
52
|
+
address: string;
|
|
53
|
+
} | null;
|
|
54
|
+
export type MeshOrderSide = 'buy' | 'sell';
|
|
55
|
+
/**===============*
|
|
56
|
+
* CHECKOUT QUOTE *
|
|
57
|
+
*================*/
|
|
58
|
+
export type CheckoutApiQuoteParams = {
|
|
59
|
+
fromChainId: string;
|
|
60
|
+
fromTokenAddress: Address;
|
|
61
|
+
toChainId: string;
|
|
62
|
+
toTokenAddress: Address;
|
|
63
|
+
toAmountBaseUnit: string;
|
|
64
|
+
checkoutExpirationTimestampSeconds: string;
|
|
65
|
+
};
|
|
66
|
+
export type CheckoutCoreQuoteParams = Omit<CheckoutApiQuoteParams, 'toAmountBaseUnit' | 'checkoutExpirationTimestampSeconds'> & {
|
|
67
|
+
toTokenAmount: number;
|
|
68
|
+
expirationTimestampMs: number;
|
|
69
|
+
apiKey: string;
|
|
70
|
+
};
|
|
71
|
+
export type CheckoutApiQuoteResponse = {
|
|
72
|
+
quoteId: string;
|
|
73
|
+
estTotalFromAmountBaseUnit: string;
|
|
74
|
+
estFeesFromAmountBaseUnit: string;
|
|
75
|
+
fromTokenAddress: Address;
|
|
76
|
+
estFeesUsd: number;
|
|
77
|
+
estTotalUsd: number;
|
|
78
|
+
estCheckoutTimeMs: number;
|
|
79
|
+
};
|
|
80
|
+
export type CheckoutCoreQuoteResponse = CheckoutApiQuoteResponse & {
|
|
81
|
+
estTotalFromAmount: string;
|
|
82
|
+
estFeesFromAmount: string;
|
|
83
|
+
};
|
|
84
|
+
/**===============*
|
|
85
|
+
* CHECKOUT INIT *
|
|
86
|
+
*================*/
|
|
87
|
+
export type CheckoutApiInitParams = {
|
|
88
|
+
userOp: UserOperation;
|
|
89
|
+
quoteId: string;
|
|
90
|
+
salt: bigint;
|
|
91
|
+
clientMetadata: object;
|
|
92
|
+
};
|
|
93
|
+
export type CheckoutCoreInitParams = Omit<CheckoutApiInitParams, 'salt'> & {
|
|
94
|
+
apiKey: string;
|
|
95
|
+
};
|
|
96
|
+
export type CheckoutCoreInitResponse = Address;
|
|
97
|
+
export declare enum CheckoutState {
|
|
98
|
+
FROM_UNFUNDED = "FROM_UNFUNDED",
|
|
99
|
+
FROM_FUNDED = "FROM_FUNDED",
|
|
100
|
+
FROM_POOLED = "FROM_POOLED",
|
|
101
|
+
TO_UNFUNDED = "TO_UNFUNDED",
|
|
102
|
+
TO_FUNDED = "TO_FUNDED",
|
|
103
|
+
TO_POOLED = "TO_POOLED",
|
|
104
|
+
COMPLETED = "COMPLETED",
|
|
105
|
+
CHECKOUT_ERROR = "CHECKOUT_ERROR",
|
|
106
|
+
EXPIRED = "EXPIRED"
|
|
107
|
+
}
|
|
108
|
+
export type CheckoutHistoryItem = {
|
|
109
|
+
createdTimeMs: number;
|
|
110
|
+
depositAddr: Address;
|
|
111
|
+
expirationTimestampSeconds: number;
|
|
112
|
+
fromAmountBaseUnit: string;
|
|
113
|
+
fromChainId: string;
|
|
114
|
+
fromTokenAddress: Address;
|
|
115
|
+
funWalletAddr: Address;
|
|
116
|
+
lastUpdatedTimeMs: number;
|
|
117
|
+
salt: Hex;
|
|
118
|
+
state: CheckoutState;
|
|
119
|
+
toAmountBaseUnit: string;
|
|
120
|
+
toChainId: string;
|
|
121
|
+
toTokenAddress: Address;
|
|
122
|
+
userOp: UserOperation;
|
|
123
|
+
version: number;
|
|
124
|
+
clientMetadata: object;
|
|
125
|
+
};
|
package/dist/src/apis/types.js
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckoutState = void 0;
|
|
4
|
+
// Reference from api server: https://github.com/fun-xyz/fun-api-server/blob/main/src/tables/FunWalletCheckout.ts#L11C1-L21C2
|
|
5
|
+
var CheckoutState;
|
|
6
|
+
(function (CheckoutState) {
|
|
7
|
+
// In-progress States
|
|
8
|
+
CheckoutState["FROM_UNFUNDED"] = "FROM_UNFUNDED";
|
|
9
|
+
CheckoutState["FROM_FUNDED"] = "FROM_FUNDED";
|
|
10
|
+
CheckoutState["FROM_POOLED"] = "FROM_POOLED";
|
|
11
|
+
CheckoutState["TO_UNFUNDED"] = "TO_UNFUNDED";
|
|
12
|
+
CheckoutState["TO_FUNDED"] = "TO_FUNDED";
|
|
13
|
+
CheckoutState["TO_POOLED"] = "TO_POOLED";
|
|
14
|
+
// Terminal States
|
|
15
|
+
CheckoutState["COMPLETED"] = "COMPLETED";
|
|
16
|
+
CheckoutState["CHECKOUT_ERROR"] = "CHECKOUT_ERROR";
|
|
17
|
+
CheckoutState["EXPIRED"] = "EXPIRED";
|
|
18
|
+
})(CheckoutState || (exports.CheckoutState = CheckoutState = {}));
|
|
3
19
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/apis/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/apis/types.ts"],"names":[],"mappings":";;;AA2HA,6HAA6H;AAC7H,IAAY,aAYX;AAZD,WAAY,aAAa;IACvB,qBAAqB;IACrB,gDAA+B,CAAA;IAC/B,4CAA2B,CAAA;IAC3B,4CAA2B,CAAA;IAC3B,4CAA2B,CAAA;IAC3B,wCAAuB,CAAA;IACvB,wCAAuB,CAAA;IACvB,kBAAkB;IAClB,wCAAuB,CAAA;IACvB,kDAAiC,CAAA;IACjC,oCAAmB,CAAA;AACrB,CAAC,EAZW,aAAa,6BAAb,aAAa,QAYxB"}
|
package/dist/src/auth/Auth.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Address, Hex, JsonRpcAccount, PrivateKeyAccount, TransactionReceipt, WalletClient } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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';
|
|
7
7
|
export declare class Auth {
|
|
8
8
|
authId?: string;
|
|
9
9
|
signer?: PrivateKeyAccount | JsonRpcAccount;
|