@funkit/core 0.9.0 → 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/actions/AccessControl.d.ts +6 -6
- package/dist/src/actions/AccessControl.js +19 -15
- 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 +4 -4
- package/dist/src/actions/Bridge.js +10 -6
- package/dist/src/actions/Bridge.js.map +1 -1
- package/dist/src/actions/FirstClassActions.d.ts +6 -6
- package/dist/src/actions/FirstClassActions.js +25 -23
- 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 +3 -3
- package/dist/src/actions/LimitOrder.js +16 -13
- 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 +37 -35
- package/dist/src/actions/Swap.js.map +1 -1
- package/dist/src/actions/Token.d.ts +3 -3
- package/dist/src/actions/Token.js +33 -23
- 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 -2
- package/dist/src/apis/GroupApis.js +3 -3
- 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 -1
- package/dist/src/apis/PaymasterApis.js +2 -2
- 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 +1 -1
- package/dist/src/apis/TurnkeyApis.js +3 -3
- package/dist/src/apis/TurnkeyApis.js.map +1 -1
- package/dist/src/apis/UserApis.d.ts +2 -2
- package/dist/src/apis/UserApis.js +10 -7
- package/dist/src/apis/UserApis.js.map +1 -1
- package/dist/src/apis/index.d.ts +13 -11
- package/dist/src/apis/index.js +3 -1
- package/dist/src/apis/index.js.map +1 -1
- package/dist/src/apis/types.d.ts +75 -3
- 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 +43 -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 +110 -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 +4 -4
- package/dist/src/data/Token.js +9 -9
- 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 +4 -4
- package/dist/src/sponsors/GaslessSponsor.js +18 -15
- package/dist/src/sponsors/GaslessSponsor.js.map +1 -1
- package/dist/src/sponsors/Sponsor.d.ts +5 -5
- package/dist/src/sponsors/Sponsor.js +12 -11
- package/dist/src/sponsors/Sponsor.js.map +1 -1
- package/dist/src/sponsors/TokenSponsor.d.ts +7 -7
- package/dist/src/sponsors/TokenSponsor.js +75 -68
- 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 -1
- package/dist/src/utils/AuthUtils.js +4 -4
- 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 +3 -3
- package/dist/src/utils/GroupUtils.js +8 -8
- package/dist/src/utils/GroupUtils.js.map +1 -1
- 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 +42 -33
- 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 +77 -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 +11 -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 +133 -89
- 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 +13 -5
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.decodeCalldata = exports.getSelectorFromCall = exports.getTargetFromCall = exports.SessionKeyAuth = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
|
-
const Auth_1 = require("./Auth");
|
|
6
5
|
const common_1 = require("../common");
|
|
7
6
|
const data_1 = require("../data");
|
|
8
7
|
const ViemUtils_1 = require("../utils/ViemUtils");
|
|
8
|
+
const Auth_1 = require("./Auth");
|
|
9
9
|
const SELECTOR_LENGTH = 10;
|
|
10
|
-
const execFromEntryPointSelector = (0, ViemUtils_1.getSigHash)(common_1.WALLET_ABI,
|
|
11
|
-
const execFromEntryPointFeeSelector = (0, ViemUtils_1.getSigHash)(common_1.WALLET_ABI,
|
|
10
|
+
const execFromEntryPointSelector = (0, ViemUtils_1.getSigHash)(common_1.WALLET_ABI, 'execFromEntryPoint');
|
|
11
|
+
const execFromEntryPointFeeSelector = (0, ViemUtils_1.getSigHash)(common_1.WALLET_ABI, 'execFromEntryPointWithFee');
|
|
12
12
|
class SessionKeyAuth extends Auth_1.Auth {
|
|
13
13
|
constructor(authInput, ruleId, roleId, targetSelectorMerkleTree, feeRecipientMerkleTree) {
|
|
14
14
|
super(authInput);
|
|
@@ -19,37 +19,42 @@ class SessionKeyAuth extends Auth_1.Auth {
|
|
|
19
19
|
}
|
|
20
20
|
async signOp(operation, chain) {
|
|
21
21
|
if (!this.targetSelectorMerkleTree) {
|
|
22
|
-
throw new Error(
|
|
22
|
+
throw new Error('SessionKeyAuth not connected to wallet');
|
|
23
23
|
}
|
|
24
24
|
await this.init();
|
|
25
25
|
const opHash = await operation.getOpHash(chain);
|
|
26
26
|
let signature;
|
|
27
|
-
if (this.signer?.type ===
|
|
28
|
-
signature = await this.signer.signMessage({
|
|
27
|
+
if (this.signer?.type === 'local') {
|
|
28
|
+
signature = await this.signer.signMessage({
|
|
29
|
+
message: { raw: (0, viem_1.toBytes)(opHash) },
|
|
30
|
+
});
|
|
29
31
|
}
|
|
30
32
|
else if (this.client && this.account) {
|
|
31
|
-
signature = await this.client.signMessage({
|
|
33
|
+
signature = await this.client.signMessage({
|
|
34
|
+
account: this.account,
|
|
35
|
+
message: { raw: (0, viem_1.toBytes)(opHash) },
|
|
36
|
+
});
|
|
32
37
|
}
|
|
33
38
|
else {
|
|
34
|
-
throw new Error(
|
|
39
|
+
throw new Error('No signer or client');
|
|
35
40
|
}
|
|
36
41
|
const target = (0, exports.getTargetFromCall)(operation.userOp.callData);
|
|
37
42
|
const selector = (0, exports.getSelectorFromCall)(operation.userOp.callData);
|
|
38
43
|
const walletSignature = {
|
|
39
44
|
userId: await this.getUserId(),
|
|
40
|
-
signature
|
|
45
|
+
signature,
|
|
41
46
|
roleId: this.roleId,
|
|
42
47
|
ruleId: this.ruleId,
|
|
43
48
|
extraData: {
|
|
44
49
|
targetPath: this.targetSelectorMerkleTree.getPathForItem(target),
|
|
45
|
-
selectorPath: this.targetSelectorMerkleTree.getPathForItem(selector)
|
|
46
|
-
}
|
|
50
|
+
selectorPath: this.targetSelectorMerkleTree.getPathForItem(selector),
|
|
51
|
+
},
|
|
47
52
|
};
|
|
48
53
|
return (0, data_1.encodeWalletSignature)(walletSignature);
|
|
49
54
|
}
|
|
50
55
|
async getEstimateGasSignature(userId, operation) {
|
|
51
56
|
if (!this.targetSelectorMerkleTree) {
|
|
52
|
-
throw new Error(
|
|
57
|
+
throw new Error('SessionKeyAuth not connected to wallet');
|
|
53
58
|
}
|
|
54
59
|
await this.init();
|
|
55
60
|
const target = (0, exports.getTargetFromCall)(operation.userOp.callData);
|
|
@@ -57,18 +62,18 @@ class SessionKeyAuth extends Auth_1.Auth {
|
|
|
57
62
|
try {
|
|
58
63
|
const walletSignature = {
|
|
59
64
|
userId: (0, viem_1.pad)(userId, { size: 32 }),
|
|
60
|
-
signature: (0, viem_1.pad)(
|
|
65
|
+
signature: (0, viem_1.pad)('0x', { size: 65 }),
|
|
61
66
|
roleId: this.roleId,
|
|
62
67
|
ruleId: this.ruleId,
|
|
63
68
|
extraData: {
|
|
64
69
|
targetPath: this.targetSelectorMerkleTree.getPathForItem(target),
|
|
65
|
-
selectorPath: this.targetSelectorMerkleTree.getPathForItem(selector)
|
|
66
|
-
}
|
|
70
|
+
selectorPath: this.targetSelectorMerkleTree.getPathForItem(selector),
|
|
71
|
+
},
|
|
67
72
|
};
|
|
68
73
|
return (0, data_1.encodeWalletSignature)(walletSignature);
|
|
69
74
|
}
|
|
70
75
|
catch {
|
|
71
|
-
throw new Error(
|
|
76
|
+
throw new Error('Function or target is not allowed in session key');
|
|
72
77
|
}
|
|
73
78
|
}
|
|
74
79
|
}
|
|
@@ -79,7 +84,7 @@ const getTargetFromCall = (callData) => {
|
|
|
79
84
|
exports.getTargetFromCall = getTargetFromCall;
|
|
80
85
|
const getSelectorFromCall = (callData) => {
|
|
81
86
|
const out = (0, exports.decodeCalldata)(callData).calldata.slice(0, SELECTOR_LENGTH);
|
|
82
|
-
return out ===
|
|
87
|
+
return out === '0x' ? common_1.ETH_TRANSFER_SELECTOR : out;
|
|
83
88
|
};
|
|
84
89
|
exports.getSelectorFromCall = getSelectorFromCall;
|
|
85
90
|
const decodeCalldata = (callData) => {
|
|
@@ -89,25 +94,25 @@ const decodeCalldata = (callData) => {
|
|
|
89
94
|
else if (callData.includes(execFromEntryPointSelector)) {
|
|
90
95
|
return _decodeExec(callData);
|
|
91
96
|
}
|
|
92
|
-
throw new Error(
|
|
97
|
+
throw new Error('invalid call data. must be execFromEntryPoint or execFromEntryPointWithFee');
|
|
93
98
|
};
|
|
94
99
|
exports.decodeCalldata = decodeCalldata;
|
|
95
100
|
const _decodeExecWithFee = (callData) => {
|
|
96
|
-
const walletcalldata = (
|
|
97
|
-
const [target, value, calldata] = (0, viem_1.decodeAbiParameters)([{ type:
|
|
101
|
+
const walletcalldata = ('0x' + callData.slice(SELECTOR_LENGTH));
|
|
102
|
+
const [target, value, calldata] = (0, viem_1.decodeAbiParameters)([{ type: 'address' }, { type: 'uint256' }, { type: 'bytes' }], walletcalldata);
|
|
98
103
|
return {
|
|
99
104
|
target: target,
|
|
100
105
|
value: value,
|
|
101
|
-
calldata: calldata
|
|
106
|
+
calldata: calldata,
|
|
102
107
|
};
|
|
103
108
|
};
|
|
104
109
|
const _decodeExec = (callData) => {
|
|
105
|
-
const walletcalldata = (
|
|
106
|
-
const [target, value, calldata] = (0, viem_1.decodeAbiParameters)([{ type:
|
|
110
|
+
const walletcalldata = ('0x' + callData.slice(SELECTOR_LENGTH));
|
|
111
|
+
const [target, value, calldata] = (0, viem_1.decodeAbiParameters)([{ type: 'address' }, { type: 'uint256' }, { type: 'bytes' }], walletcalldata);
|
|
107
112
|
return {
|
|
108
113
|
target: target,
|
|
109
114
|
value: value,
|
|
110
|
-
calldata: calldata
|
|
115
|
+
calldata: calldata,
|
|
111
116
|
};
|
|
112
117
|
};
|
|
113
118
|
//# sourceMappingURL=SessionKeyAuth.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionKeyAuth.js","sourceRoot":"","sources":["../../../src/auth/SessionKeyAuth.ts"],"names":[],"mappings":";;;AAAA,+BAA6D;
|
|
1
|
+
{"version":3,"file":"SessionKeyAuth.js","sourceRoot":"","sources":["../../../src/auth/SessionKeyAuth.ts"],"names":[],"mappings":";;;AAAA,+BAA6D;AAE7D,sCAA6D;AAC7D,kCAKgB;AAEhB,kDAA+C;AAC/C,iCAA6B;AAG7B,MAAM,eAAe,GAAG,EAAE,CAAA;AAC1B,MAAM,0BAA0B,GAAG,IAAA,sBAAU,EAAC,mBAAU,EAAE,oBAAoB,CAAC,CAAA;AAC/E,MAAM,6BAA6B,GAAG,IAAA,s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AAkB,GAAG,CAAC,QAAa,EAAkB,EAAE;IAC3D,MAAM,cAAc,GAAG,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,CAAQ,CAAA;IACtE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,0BAAmB,EACnD,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAC7D,cAAc,CACf,CAAA;IACD,OAAO;QACL,MAAM,EAAE,MAAa;QACrB,KAAK,EAAE,KAAe;QACtB,QAAQ,EAAE,QAAe;KAC1B,CAAA;AACH,CAAC,CAAA;AACD,MAAM,WAAW,GAAG,CAAC,QAAa,EAAkB,EAAE;IACpD,MAAM,cAAc,GAAG,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,CAAQ,CAAA;IACtE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,0BAAmB,EACnD,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAC7D,cAAc,CACf,CAAA;IACD,OAAO;QACL,MAAM,EAAE,MAAa;QACrB,KAAK,EAAE,KAAe;QACtB,QAAQ,EAAE,QAAe;KAC1B,CAAA;AACH,CAAC,CAAA"}
|
package/dist/src/auth/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './Auth';
|
|
2
|
+
export * from './SessionKeyAuth';
|
package/dist/src/auth/types.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { ContractInterface } from
|
|
1
|
+
import { ContractInterface } from '../viem/ContractInterface';
|
|
2
2
|
export declare const LOCAL_API_URL = "http://127.0.0.1:3000";
|
|
3
3
|
declare let API_URL: string;
|
|
4
4
|
export { API_URL };
|
|
5
5
|
export declare const DASHBOARD_API_URL = "https://api.fun.xyz/dashboard";
|
|
6
6
|
export declare const BASE_WRAP_TOKEN_ADDR: {
|
|
7
|
-
|
|
7
|
+
'1': {
|
|
8
8
|
weth: string;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
'5': {
|
|
11
11
|
weth: string;
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
'10': {
|
|
14
14
|
weth: string;
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
'137': {
|
|
17
17
|
wmatic: string;
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
'8453': {
|
|
20
20
|
weth: string;
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
'36865': {
|
|
23
23
|
weth: string;
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
'42161': {
|
|
26
26
|
weth: string;
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
'43113': {
|
|
29
29
|
weth: string;
|
|
30
30
|
};
|
|
31
31
|
};
|
|
@@ -33,6 +33,7 @@ export declare const FUN_GASLESS_SPONSOR_ADDRESS = "0xCB5D0b4569A39C217c243a436A
|
|
|
33
33
|
export declare const FUN_TOKEN_SPONSOR_ADDRESS = "0x40C0cCa76088D45106c2D74D0B4B6405865f22De";
|
|
34
34
|
export declare const TOKEN_SPONSOR_SUPPORT_CHAINS: string[];
|
|
35
35
|
export declare const GASLESS_SPONSOR_SUPPORT_CHAINS: string[];
|
|
36
|
+
export declare const CHECKOUT_SPONSOR_SUPPORT_CHAINS: string[];
|
|
36
37
|
export declare const AddressZero: `0x${string}`;
|
|
37
38
|
export declare const HashZero: `0x${string}`;
|
|
38
39
|
export declare const APPROVE_AND_EXEC_ABI: ({
|
|
@@ -490,6 +491,66 @@ export declare const TOKEN_PAYMASTER_ABI: ({
|
|
|
490
491
|
type: string;
|
|
491
492
|
anonymous?: undefined;
|
|
492
493
|
})[];
|
|
494
|
+
export declare const CHECKOUT_PAYMASTER_ABI: ({
|
|
495
|
+
type: string;
|
|
496
|
+
inputs: {
|
|
497
|
+
name: string;
|
|
498
|
+
type: string;
|
|
499
|
+
internalType: string;
|
|
500
|
+
}[];
|
|
501
|
+
stateMutability: string;
|
|
502
|
+
name?: undefined;
|
|
503
|
+
outputs?: undefined;
|
|
504
|
+
anonymous?: undefined;
|
|
505
|
+
} | {
|
|
506
|
+
type: string;
|
|
507
|
+
name: string;
|
|
508
|
+
inputs: ({
|
|
509
|
+
name: string;
|
|
510
|
+
type: string;
|
|
511
|
+
internalType: string;
|
|
512
|
+
components: {
|
|
513
|
+
name: string;
|
|
514
|
+
type: string;
|
|
515
|
+
internalType: string;
|
|
516
|
+
}[];
|
|
517
|
+
} | {
|
|
518
|
+
name: string;
|
|
519
|
+
type: string;
|
|
520
|
+
internalType: string;
|
|
521
|
+
components?: undefined;
|
|
522
|
+
})[];
|
|
523
|
+
outputs: {
|
|
524
|
+
name: string;
|
|
525
|
+
type: string;
|
|
526
|
+
internalType: string;
|
|
527
|
+
}[];
|
|
528
|
+
stateMutability: string;
|
|
529
|
+
anonymous?: undefined;
|
|
530
|
+
} | {
|
|
531
|
+
type: string;
|
|
532
|
+
name: string;
|
|
533
|
+
inputs: {
|
|
534
|
+
name: string;
|
|
535
|
+
type: string;
|
|
536
|
+
indexed: boolean;
|
|
537
|
+
internalType: string;
|
|
538
|
+
}[];
|
|
539
|
+
anonymous: boolean;
|
|
540
|
+
stateMutability?: undefined;
|
|
541
|
+
outputs?: undefined;
|
|
542
|
+
} | {
|
|
543
|
+
type: string;
|
|
544
|
+
name: string;
|
|
545
|
+
inputs: {
|
|
546
|
+
name: string;
|
|
547
|
+
type: string;
|
|
548
|
+
internalType: string;
|
|
549
|
+
}[];
|
|
550
|
+
stateMutability?: undefined;
|
|
551
|
+
outputs?: undefined;
|
|
552
|
+
anonymous?: undefined;
|
|
553
|
+
})[];
|
|
493
554
|
export declare const WITHDRAW_QUEUE_ABI: ({
|
|
494
555
|
inputs: {
|
|
495
556
|
internalType: string;
|
|
@@ -889,6 +950,7 @@ export declare const ERC20_CONTRACT_INTERFACE: ContractInterface;
|
|
|
889
950
|
export declare const FACTORY_CONTRACT_INTERFACE: ContractInterface;
|
|
890
951
|
export declare const GASLESS_PAYMASTER_CONTRACT_INTERFACE: ContractInterface;
|
|
891
952
|
export declare const TOKEN_PAYMASTER_CONTRACT_INTERFACE: ContractInterface;
|
|
953
|
+
export declare const CHECKOUT_PAYMASTER_CONTRACT_INTERFACE: ContractInterface;
|
|
892
954
|
export declare const WALLET_CONTRACT_INTERFACE: ContractInterface;
|
|
893
955
|
export declare const POOL_CONTRACT_INTERFACE: ContractInterface;
|
|
894
956
|
export declare const APPROVE_AND_EXEC_CONTRACT_INTERFACE: ContractInterface;
|
|
@@ -943,6 +1005,11 @@ export declare const CONTRACT_ADDRESSES: {
|
|
|
943
1005
|
"36865": string;
|
|
944
1006
|
"42161": string;
|
|
945
1007
|
};
|
|
1008
|
+
checkoutPaymasterAddress: {
|
|
1009
|
+
'137': string;
|
|
1010
|
+
'8453': string;
|
|
1011
|
+
'42161': string;
|
|
1012
|
+
};
|
|
946
1013
|
estimationPaymasterAddress: {
|
|
947
1014
|
"1": string;
|
|
948
1015
|
"5": string;
|
|
@@ -1053,19 +1120,19 @@ export declare const CONTRACT_ADDRESSES: {
|
|
|
1053
1120
|
"42161": string;
|
|
1054
1121
|
};
|
|
1055
1122
|
funGaslessSponsorAddress: {
|
|
1056
|
-
|
|
1123
|
+
'5': string;
|
|
1057
1124
|
};
|
|
1058
1125
|
funTokenSponsorAddress: {
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1126
|
+
'1': string;
|
|
1127
|
+
'5': string;
|
|
1128
|
+
'10': string;
|
|
1129
|
+
'137': string;
|
|
1130
|
+
'8453': string;
|
|
1131
|
+
'42161': string;
|
|
1065
1132
|
};
|
|
1066
1133
|
};
|
|
1067
1134
|
export declare const gasSpecificChain: {
|
|
1068
|
-
|
|
1135
|
+
'137': {
|
|
1069
1136
|
gasStationUrl: string;
|
|
1070
1137
|
backupPriorityFee: string;
|
|
1071
1138
|
backupFee: string;
|
|
@@ -1078,3 +1145,29 @@ export declare const BYTES32_LENGTH = 66;
|
|
|
1078
1145
|
export declare const BASE_PIMLICO_PAYMASTER_AND_DATA_ESTIMATION = "0xa880eae8900eb59bf7dad9bdb741a086238adca900000000000000000000000000000000000000000000000000000101010101010000000000000000000000000000000000000000000000000000000000000000cd91f19f0f19ce862d7bec7b7d9b95457145afc6f639c28fd0360f488937bfa41e6eedcd3a46054fd95fcd0e3ef6b0bc0a615c4d975eef55c8a3517257904d5b1c";
|
|
1079
1146
|
export declare const OPTIMISM_PIMLICO_PAYMASTER_AND_DATA_ESTIMATION = "0x4Df91e173A6CdC74EfeF6fC72bb5Df1E8A8d758200000000000000000000000000000000000000000000000000000101010101010000000000000000000000000000000000000000000000000000000000000000cd91f19f0f19ce862d7bec7b7d9b95457145afc6f639c28fd0360f488937bfa41e6eedcd3a46054fd95fcd0e3ef6b0bc0a615c4d975eef55c8a3517257904d5b1c";
|
|
1080
1147
|
export declare const ETHEREUM_PIMLICO_PAYMASTER_AND_DATA_ESTIMATION = "0x67F21bE69A16c314a0b7Da537309b2f3ADdDE03100000000000000000000000000000000000000000000000000000101010101010000000000000000000000000000000000000000000000000000000000000000cd91f19f0f19ce862d7bec7b7d9b95457145afc6f639c28fd0360f488937bfa41e6eedcd3a46054fd95fcd0e3ef6b0bc0a615c4d975eef55c8a3517257904d5b1c";
|
|
1148
|
+
/**
|
|
1149
|
+
* Info on the supported chains of FunkitConnect
|
|
1150
|
+
* Added into coresdk because it is used in here too.
|
|
1151
|
+
*/
|
|
1152
|
+
export declare const FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO: {
|
|
1153
|
+
[x: string]: {
|
|
1154
|
+
nativeCurrency: {
|
|
1155
|
+
symbol: "ETH";
|
|
1156
|
+
decimals: 18;
|
|
1157
|
+
name: "Ether";
|
|
1158
|
+
};
|
|
1159
|
+
} | {
|
|
1160
|
+
nativeCurrency: {
|
|
1161
|
+
symbol: "MATIC";
|
|
1162
|
+
decimals: 18;
|
|
1163
|
+
name: "MATIC";
|
|
1164
|
+
};
|
|
1165
|
+
} | {
|
|
1166
|
+
nativeCurrency: {
|
|
1167
|
+
symbol: "ETH";
|
|
1168
|
+
decimals: 18;
|
|
1169
|
+
name: "Goerli Ether";
|
|
1170
|
+
};
|
|
1171
|
+
};
|
|
1172
|
+
};
|
|
1173
|
+
export declare const FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|