@bankofai/x402-evm 1.0.0-beta.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/README.md +172 -0
- package/dist/cjs/auth-capture/client/index.d.ts +44 -0
- package/dist/cjs/auth-capture/client/index.js +298 -0
- package/dist/cjs/auth-capture/client/index.js.map +1 -0
- package/dist/cjs/batch-settlement/client/file-storage.d.ts +47 -0
- package/dist/cjs/batch-settlement/client/file-storage.js +116 -0
- package/dist/cjs/batch-settlement/client/file-storage.js.map +1 -0
- package/dist/cjs/batch-settlement/client/index.d.ts +111 -0
- package/dist/cjs/batch-settlement/client/index.js +1565 -0
- package/dist/cjs/batch-settlement/client/index.js.map +1 -0
- package/dist/cjs/batch-settlement/facilitator/index.d.ts +72 -0
- package/dist/cjs/batch-settlement/facilitator/index.js +2102 -0
- package/dist/cjs/batch-settlement/facilitator/index.js.map +1 -0
- package/dist/cjs/batch-settlement/server/file-storage.d.ts +53 -0
- package/dist/cjs/batch-settlement/server/file-storage.js +181 -0
- package/dist/cjs/batch-settlement/server/file-storage.js.map +1 -0
- package/dist/cjs/batch-settlement/server/index.d.ts +491 -0
- package/dist/cjs/batch-settlement/server/index.js +1978 -0
- package/dist/cjs/batch-settlement/server/index.js.map +1 -0
- package/dist/cjs/batch-settlement/server/redis-storage.d.ts +87 -0
- package/dist/cjs/batch-settlement/server/redis-storage.js +181 -0
- package/dist/cjs/batch-settlement/server/redis-storage.js.map +1 -0
- package/dist/cjs/client/agent-wallet.d.ts +69 -0
- package/dist/cjs/client/agent-wallet.js +84 -0
- package/dist/cjs/client/agent-wallet.js.map +1 -0
- package/dist/cjs/exact/client/index.d.ts +63 -0
- package/dist/cjs/exact/client/index.js +739 -0
- package/dist/cjs/exact/client/index.js.map +1 -0
- package/dist/cjs/exact/facilitator/index.d.ts +141 -0
- package/dist/cjs/exact/facilitator/index.js +1989 -0
- package/dist/cjs/exact/facilitator/index.js.map +1 -0
- package/dist/cjs/exact/server/index.d.ts +118 -0
- package/dist/cjs/exact/server/index.js +326 -0
- package/dist/cjs/exact/server/index.js.map +1 -0
- package/dist/cjs/exact/v1/client/index.d.ts +38 -0
- package/dist/cjs/exact/v1/client/index.js +193 -0
- package/dist/cjs/exact/v1/client/index.js.map +1 -0
- package/dist/cjs/exact/v1/facilitator/index.d.ts +84 -0
- package/dist/cjs/exact/v1/facilitator/index.js +739 -0
- package/dist/cjs/exact/v1/facilitator/index.js.map +1 -0
- package/dist/cjs/facilitator/agent-wallet.d.ts +109 -0
- package/dist/cjs/facilitator/agent-wallet.js +105 -0
- package/dist/cjs/facilitator/agent-wallet.js.map +1 -0
- package/dist/cjs/index.d.ts +338 -0
- package/dist/cjs/index.js +2860 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/permit2-DK5A8alk.d.ts +729 -0
- package/dist/cjs/permit2-DhJRUcgY.d.ts +729 -0
- package/dist/cjs/rpc-DULZzRne.d.ts +13 -0
- package/dist/cjs/scheme-7ehldYoO.d.ts +307 -0
- package/dist/cjs/scheme-BjBJzHF7.d.ts +307 -0
- package/dist/cjs/scheme-DWgpkDgz.d.ts +47 -0
- package/dist/cjs/signer-BFelv8DL.d.ts +170 -0
- package/dist/cjs/storage-6W5MO46W.d.ts +50 -0
- package/dist/cjs/storage-CHNote8s.d.ts +81 -0
- package/dist/cjs/storage-DjCv5IPh.d.ts +81 -0
- package/dist/cjs/types-CKd3Xoi1.d.ts +180 -0
- package/dist/cjs/types-DIt9uAUy.d.ts +180 -0
- package/dist/cjs/upto/client/index.d.ts +34 -0
- package/dist/cjs/upto/client/index.js +509 -0
- package/dist/cjs/upto/client/index.js.map +1 -0
- package/dist/cjs/upto/facilitator/index.d.ts +54 -0
- package/dist/cjs/upto/facilitator/index.js +1313 -0
- package/dist/cjs/upto/facilitator/index.js.map +1 -0
- package/dist/cjs/upto/server/index.d.ts +69 -0
- package/dist/cjs/upto/server/index.js +296 -0
- package/dist/cjs/upto/server/index.js.map +1 -0
- package/dist/cjs/v1/index.d.ts +40 -0
- package/dist/cjs/v1/index.js +199 -0
- package/dist/cjs/v1/index.js.map +1 -0
- package/dist/esm/auth-capture/client/index.d.mts +44 -0
- package/dist/esm/auth-capture/client/index.mjs +8 -0
- package/dist/esm/auth-capture/client/index.mjs.map +1 -0
- package/dist/esm/batch-settlement/client/file-storage.d.mts +47 -0
- package/dist/esm/batch-settlement/client/file-storage.mjs +63 -0
- package/dist/esm/batch-settlement/client/file-storage.mjs.map +1 -0
- package/dist/esm/batch-settlement/client/index.d.mts +111 -0
- package/dist/esm/batch-settlement/client/index.mjs +58 -0
- package/dist/esm/batch-settlement/client/index.mjs.map +1 -0
- package/dist/esm/batch-settlement/facilitator/index.d.mts +72 -0
- package/dist/esm/batch-settlement/facilitator/index.mjs +1252 -0
- package/dist/esm/batch-settlement/facilitator/index.mjs.map +1 -0
- package/dist/esm/batch-settlement/server/file-storage.d.mts +53 -0
- package/dist/esm/batch-settlement/server/file-storage.mjs +128 -0
- package/dist/esm/batch-settlement/server/file-storage.mjs.map +1 -0
- package/dist/esm/batch-settlement/server/index.d.mts +491 -0
- package/dist/esm/batch-settlement/server/index.mjs +1640 -0
- package/dist/esm/batch-settlement/server/index.mjs.map +1 -0
- package/dist/esm/batch-settlement/server/redis-storage.d.mts +87 -0
- package/dist/esm/batch-settlement/server/redis-storage.mjs +156 -0
- package/dist/esm/batch-settlement/server/redis-storage.mjs.map +1 -0
- package/dist/esm/chunk-2EUQTNJO.mjs +38 -0
- package/dist/esm/chunk-2EUQTNJO.mjs.map +1 -0
- package/dist/esm/chunk-3WZF6722.mjs +36 -0
- package/dist/esm/chunk-3WZF6722.mjs.map +1 -0
- package/dist/esm/chunk-E4Z7PNXC.mjs +275 -0
- package/dist/esm/chunk-E4Z7PNXC.mjs.map +1 -0
- package/dist/esm/chunk-GQVMVP4N.mjs +911 -0
- package/dist/esm/chunk-GQVMVP4N.mjs.map +1 -0
- package/dist/esm/chunk-H2EYJIZL.mjs +489 -0
- package/dist/esm/chunk-H2EYJIZL.mjs.map +1 -0
- package/dist/esm/chunk-H3KPLYGI.mjs +152 -0
- package/dist/esm/chunk-H3KPLYGI.mjs.map +1 -0
- package/dist/esm/chunk-HYABYUBD.mjs +432 -0
- package/dist/esm/chunk-HYABYUBD.mjs.map +1 -0
- package/dist/esm/chunk-I2DVUHM5.mjs +123 -0
- package/dist/esm/chunk-I2DVUHM5.mjs.map +1 -0
- package/dist/esm/chunk-JK7SLLF7.mjs +34 -0
- package/dist/esm/chunk-JK7SLLF7.mjs.map +1 -0
- package/dist/esm/chunk-JNT7C46S.mjs +352 -0
- package/dist/esm/chunk-JNT7C46S.mjs.map +1 -0
- package/dist/esm/chunk-MACPBXCT.mjs +415 -0
- package/dist/esm/chunk-MACPBXCT.mjs.map +1 -0
- package/dist/esm/chunk-P3QOX3QZ.mjs +113 -0
- package/dist/esm/chunk-P3QOX3QZ.mjs.map +1 -0
- package/dist/esm/chunk-QVATVA3J.mjs +47 -0
- package/dist/esm/chunk-QVATVA3J.mjs.map +1 -0
- package/dist/esm/chunk-SHJFA25H.mjs +159 -0
- package/dist/esm/chunk-SHJFA25H.mjs.map +1 -0
- package/dist/esm/chunk-TW7Z65AO.mjs +34 -0
- package/dist/esm/chunk-TW7Z65AO.mjs.map +1 -0
- package/dist/esm/chunk-U4HCGTLU.mjs +35 -0
- package/dist/esm/chunk-U4HCGTLU.mjs.map +1 -0
- package/dist/esm/chunk-VS3RYAYE.mjs +80 -0
- package/dist/esm/chunk-VS3RYAYE.mjs.map +1 -0
- package/dist/esm/chunk-W6ON4LG2.mjs +39 -0
- package/dist/esm/chunk-W6ON4LG2.mjs.map +1 -0
- package/dist/esm/chunk-XG2JLZVJ.mjs +627 -0
- package/dist/esm/chunk-XG2JLZVJ.mjs.map +1 -0
- package/dist/esm/chunk-ZCJRY5LQ.mjs +162 -0
- package/dist/esm/chunk-ZCJRY5LQ.mjs.map +1 -0
- package/dist/esm/client/agent-wallet.d.mts +69 -0
- package/dist/esm/client/agent-wallet.mjs +36 -0
- package/dist/esm/client/agent-wallet.mjs.map +1 -0
- package/dist/esm/exact/client/index.d.mts +63 -0
- package/dist/esm/exact/client/index.mjs +25 -0
- package/dist/esm/exact/client/index.mjs.map +1 -0
- package/dist/esm/exact/facilitator/index.d.mts +141 -0
- package/dist/esm/exact/facilitator/index.mjs +694 -0
- package/dist/esm/exact/facilitator/index.mjs.map +1 -0
- package/dist/esm/exact/server/index.d.mts +118 -0
- package/dist/esm/exact/server/index.mjs +153 -0
- package/dist/esm/exact/server/index.mjs.map +1 -0
- package/dist/esm/exact/v1/client/index.d.mts +38 -0
- package/dist/esm/exact/v1/client/index.mjs +12 -0
- package/dist/esm/exact/v1/client/index.mjs.map +1 -0
- package/dist/esm/exact/v1/facilitator/index.d.mts +84 -0
- package/dist/esm/exact/v1/facilitator/index.mjs +12 -0
- package/dist/esm/exact/v1/facilitator/index.mjs.map +1 -0
- package/dist/esm/facilitator/agent-wallet.d.mts +109 -0
- package/dist/esm/facilitator/agent-wallet.mjs +74 -0
- package/dist/esm/facilitator/agent-wallet.mjs.map +1 -0
- package/dist/esm/index.d.mts +338 -0
- package/dist/esm/index.mjs +144 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/permit2-DhJRUcgY.d.mts +729 -0
- package/dist/esm/rpc-DULZzRne.d.mts +13 -0
- package/dist/esm/scheme-CkNhpXrG.d.mts +307 -0
- package/dist/esm/scheme-D8ZbykGV.d.mts +47 -0
- package/dist/esm/signer-BFelv8DL.d.mts +170 -0
- package/dist/esm/storage-6W5MO46W.d.mts +50 -0
- package/dist/esm/storage-BEzTEiUr.d.mts +81 -0
- package/dist/esm/types-DIt9uAUy.d.mts +180 -0
- package/dist/esm/upto/client/index.d.mts +34 -0
- package/dist/esm/upto/client/index.mjs +22 -0
- package/dist/esm/upto/client/index.mjs.map +1 -0
- package/dist/esm/upto/facilitator/index.d.mts +54 -0
- package/dist/esm/upto/facilitator/index.mjs +507 -0
- package/dist/esm/upto/facilitator/index.mjs.map +1 -0
- package/dist/esm/upto/server/index.d.mts +69 -0
- package/dist/esm/upto/server/index.mjs +124 -0
- package/dist/esm/upto/server/index.mjs.map +1 -0
- package/dist/esm/v1/index.d.mts +40 -0
- package/dist/esm/v1/index.mjs +18 -0
- package/dist/esm/v1/index.mjs.map +1 -0
- package/package.json +250 -0
|
@@ -0,0 +1,694 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isPermit2Payload
|
|
3
|
+
} from "../../chunk-JK7SLLF7.mjs";
|
|
4
|
+
import "../../chunk-U4HCGTLU.mjs";
|
|
5
|
+
import {
|
|
6
|
+
ExactEvmSchemeV1,
|
|
7
|
+
NETWORKS,
|
|
8
|
+
diagnoseEip3009SimulationFailure,
|
|
9
|
+
executeTransferWithAuthorization,
|
|
10
|
+
parseEip3009TransferError,
|
|
11
|
+
simulateEip3009Transfer
|
|
12
|
+
} from "../../chunk-XG2JLZVJ.mjs";
|
|
13
|
+
import {
|
|
14
|
+
buildExactPermit2SettleArgs,
|
|
15
|
+
checkPermit2Prerequisites,
|
|
16
|
+
diagnosePermit2SimulationFailure,
|
|
17
|
+
mapSettleError,
|
|
18
|
+
simulatePermit2Settle,
|
|
19
|
+
simulatePermit2SettleWithErc20Approval,
|
|
20
|
+
simulatePermit2SettleWithPermit,
|
|
21
|
+
splitEip2612Signature,
|
|
22
|
+
validateEip2612PermitForPayment,
|
|
23
|
+
validateErc20ApprovalForPayment,
|
|
24
|
+
waitAndReturnSettleResponse
|
|
25
|
+
} from "../../chunk-H2EYJIZL.mjs";
|
|
26
|
+
import {
|
|
27
|
+
ErrAssetNotDeployedContract,
|
|
28
|
+
ErrFactoryNotAllowed,
|
|
29
|
+
ErrInvalidAuthorizationValue,
|
|
30
|
+
ErrInvalidScheme,
|
|
31
|
+
ErrInvalidSignature,
|
|
32
|
+
ErrMissingEip712Domain,
|
|
33
|
+
ErrNetworkMismatch,
|
|
34
|
+
ErrPermit2AmountMismatch,
|
|
35
|
+
ErrPermit2DeadlineExpired,
|
|
36
|
+
ErrPermit2InvalidSignature,
|
|
37
|
+
ErrPermit2InvalidSpender,
|
|
38
|
+
ErrPermit2NotYetValid,
|
|
39
|
+
ErrPermit2RecipientMismatch,
|
|
40
|
+
ErrPermit2TokenMismatch,
|
|
41
|
+
ErrRecipientMismatch,
|
|
42
|
+
ErrTransactionFailed,
|
|
43
|
+
ErrUndeployedSmartWallet,
|
|
44
|
+
ErrUnsupportedPayloadType,
|
|
45
|
+
ErrValidAfterInFuture,
|
|
46
|
+
ErrValidBeforeExpired
|
|
47
|
+
} from "../../chunk-P3QOX3QZ.mjs";
|
|
48
|
+
import {
|
|
49
|
+
ERC20_APPROVAL_GAS_SPONSORING_KEY,
|
|
50
|
+
appendDataSuffix,
|
|
51
|
+
extractEip2612GasSponsoringInfo,
|
|
52
|
+
extractErc20ApprovalGasSponsoringInfo,
|
|
53
|
+
resolveDataSuffix,
|
|
54
|
+
resolveErc20ApprovalExtensionSigner
|
|
55
|
+
} from "../../chunk-JNT7C46S.mjs";
|
|
56
|
+
import {
|
|
57
|
+
PERMIT2_ADDRESS,
|
|
58
|
+
authorizationTypes,
|
|
59
|
+
permit2WitnessTypes,
|
|
60
|
+
x402ExactPermit2ProxyABI,
|
|
61
|
+
x402ExactPermit2ProxyAddress
|
|
62
|
+
} from "../../chunk-MACPBXCT.mjs";
|
|
63
|
+
import "../../chunk-VS3RYAYE.mjs";
|
|
64
|
+
import {
|
|
65
|
+
getEvmChainId
|
|
66
|
+
} from "../../chunk-TW7Z65AO.mjs";
|
|
67
|
+
|
|
68
|
+
// src/exact/facilitator/eip3009.ts
|
|
69
|
+
import { getAddress, isAddressEqual, parseErc6492Signature } from "viem";
|
|
70
|
+
async function verifyEIP3009(signer, payload, requirements, eip3009Payload, options) {
|
|
71
|
+
const payer = eip3009Payload.authorization.from;
|
|
72
|
+
let eip6492Deployment;
|
|
73
|
+
if (payload.accepted.scheme !== "exact" || requirements.scheme !== "exact") {
|
|
74
|
+
return {
|
|
75
|
+
isValid: false,
|
|
76
|
+
invalidReason: ErrInvalidScheme,
|
|
77
|
+
payer
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
if (!requirements.extra?.name || !requirements.extra?.version) {
|
|
81
|
+
return {
|
|
82
|
+
isValid: false,
|
|
83
|
+
invalidReason: ErrMissingEip712Domain,
|
|
84
|
+
payer
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const { name, version } = requirements.extra;
|
|
88
|
+
const erc20Address = getAddress(requirements.asset);
|
|
89
|
+
if (payload.accepted.network !== requirements.network) {
|
|
90
|
+
return {
|
|
91
|
+
isValid: false,
|
|
92
|
+
invalidReason: ErrNetworkMismatch,
|
|
93
|
+
payer
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const permitTypedData = {
|
|
97
|
+
types: authorizationTypes,
|
|
98
|
+
primaryType: "TransferWithAuthorization",
|
|
99
|
+
domain: {
|
|
100
|
+
name,
|
|
101
|
+
version,
|
|
102
|
+
chainId: getEvmChainId(requirements.network),
|
|
103
|
+
verifyingContract: erc20Address
|
|
104
|
+
},
|
|
105
|
+
message: {
|
|
106
|
+
from: eip3009Payload.authorization.from,
|
|
107
|
+
to: eip3009Payload.authorization.to,
|
|
108
|
+
value: BigInt(eip3009Payload.authorization.value),
|
|
109
|
+
validAfter: BigInt(eip3009Payload.authorization.validAfter),
|
|
110
|
+
validBefore: BigInt(eip3009Payload.authorization.validBefore),
|
|
111
|
+
nonce: eip3009Payload.authorization.nonce
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
let isValid = false;
|
|
115
|
+
try {
|
|
116
|
+
isValid = await signer.verifyTypedData({
|
|
117
|
+
address: eip3009Payload.authorization.from,
|
|
118
|
+
...permitTypedData,
|
|
119
|
+
signature: eip3009Payload.signature
|
|
120
|
+
});
|
|
121
|
+
} catch {
|
|
122
|
+
isValid = false;
|
|
123
|
+
}
|
|
124
|
+
const signature = eip3009Payload.signature;
|
|
125
|
+
const sigLen = signature.startsWith("0x") ? signature.length - 2 : signature.length;
|
|
126
|
+
const erc6492Data = parseErc6492Signature(signature);
|
|
127
|
+
const hasDeploymentInfo = erc6492Data.address && erc6492Data.data && !isAddressEqual(erc6492Data.address, "0x0000000000000000000000000000000000000000");
|
|
128
|
+
if (hasDeploymentInfo) {
|
|
129
|
+
eip6492Deployment = {
|
|
130
|
+
factoryAddress: erc6492Data.address,
|
|
131
|
+
factoryCalldata: erc6492Data.data
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
if (!isValid) {
|
|
135
|
+
const isSmartWallet = sigLen > 130;
|
|
136
|
+
if (!isSmartWallet) {
|
|
137
|
+
return {
|
|
138
|
+
isValid: false,
|
|
139
|
+
invalidReason: ErrInvalidSignature,
|
|
140
|
+
payer
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
const bytecode = await signer.getCode({ address: payer });
|
|
144
|
+
const isDeployed = bytecode && bytecode !== "0x";
|
|
145
|
+
if (!isDeployed && !hasDeploymentInfo) {
|
|
146
|
+
return {
|
|
147
|
+
isValid: false,
|
|
148
|
+
invalidReason: ErrUndeployedSmartWallet,
|
|
149
|
+
payer
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (getAddress(eip3009Payload.authorization.to) !== getAddress(requirements.payTo)) {
|
|
154
|
+
return {
|
|
155
|
+
isValid: false,
|
|
156
|
+
invalidReason: ErrRecipientMismatch,
|
|
157
|
+
payer
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
const now = Math.floor(Date.now() / 1e3);
|
|
161
|
+
if (BigInt(eip3009Payload.authorization.validBefore) < BigInt(now + 6)) {
|
|
162
|
+
return {
|
|
163
|
+
isValid: false,
|
|
164
|
+
invalidReason: ErrValidBeforeExpired,
|
|
165
|
+
payer
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
if (BigInt(eip3009Payload.authorization.validAfter) > BigInt(now)) {
|
|
169
|
+
return {
|
|
170
|
+
isValid: false,
|
|
171
|
+
invalidReason: ErrValidAfterInFuture,
|
|
172
|
+
payer
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
if (BigInt(eip3009Payload.authorization.value) !== BigInt(requirements.amount)) {
|
|
176
|
+
return {
|
|
177
|
+
isValid: false,
|
|
178
|
+
invalidReason: ErrInvalidAuthorizationValue,
|
|
179
|
+
payer
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
const assetBytecode = await signer.getCode({ address: erc20Address });
|
|
183
|
+
if (!assetBytecode || assetBytecode === "0x") {
|
|
184
|
+
return { isValid: false, invalidReason: ErrAssetNotDeployedContract, payer };
|
|
185
|
+
}
|
|
186
|
+
if (options?.simulate !== false) {
|
|
187
|
+
const simulationSucceeded = await simulateEip3009Transfer(
|
|
188
|
+
signer,
|
|
189
|
+
erc20Address,
|
|
190
|
+
eip3009Payload,
|
|
191
|
+
eip6492Deployment
|
|
192
|
+
);
|
|
193
|
+
if (!simulationSucceeded) {
|
|
194
|
+
return diagnoseEip3009SimulationFailure(
|
|
195
|
+
signer,
|
|
196
|
+
erc20Address,
|
|
197
|
+
eip3009Payload,
|
|
198
|
+
requirements,
|
|
199
|
+
requirements.amount
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return {
|
|
204
|
+
isValid: true,
|
|
205
|
+
invalidReason: void 0,
|
|
206
|
+
payer
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
async function settleEIP3009(signer, payload, requirements, eip3009Payload, config, context) {
|
|
210
|
+
const payer = eip3009Payload.authorization.from;
|
|
211
|
+
const valid = await verifyEIP3009(signer, payload, requirements, eip3009Payload, {
|
|
212
|
+
simulate: config.simulateInSettle ?? false
|
|
213
|
+
});
|
|
214
|
+
if (!valid.isValid) {
|
|
215
|
+
return {
|
|
216
|
+
success: false,
|
|
217
|
+
network: payload.accepted.network,
|
|
218
|
+
transaction: "",
|
|
219
|
+
errorReason: valid.invalidReason ?? ErrInvalidScheme,
|
|
220
|
+
payer
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
try {
|
|
224
|
+
const { address: factoryAddress, data: factoryCalldata } = parseErc6492Signature(
|
|
225
|
+
eip3009Payload.signature
|
|
226
|
+
);
|
|
227
|
+
if (factoryAddress && factoryCalldata && !isAddressEqual(factoryAddress, "0x0000000000000000000000000000000000000000")) {
|
|
228
|
+
const bytecode = await signer.getCode({ address: payer });
|
|
229
|
+
if (!bytecode || bytecode === "0x") {
|
|
230
|
+
const normalizedFactory = factoryAddress.toLowerCase();
|
|
231
|
+
const isAllowed = (config.eip6492AllowedFactories ?? []).some(
|
|
232
|
+
(allowed) => allowed.toLowerCase() === normalizedFactory
|
|
233
|
+
);
|
|
234
|
+
if (!isAllowed) {
|
|
235
|
+
return {
|
|
236
|
+
success: false,
|
|
237
|
+
errorReason: ErrFactoryNotAllowed,
|
|
238
|
+
transaction: "",
|
|
239
|
+
network: payload.accepted.network,
|
|
240
|
+
payer
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
const deployTx = await signer.sendTransaction({
|
|
244
|
+
to: factoryAddress,
|
|
245
|
+
data: factoryCalldata
|
|
246
|
+
});
|
|
247
|
+
await signer.waitForTransactionReceipt({ hash: deployTx });
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
const dataSuffix = await resolveDataSuffix(context, {
|
|
251
|
+
paymentPayload: payload,
|
|
252
|
+
paymentRequirements: requirements
|
|
253
|
+
});
|
|
254
|
+
const tx = await executeTransferWithAuthorization(
|
|
255
|
+
signer,
|
|
256
|
+
getAddress(requirements.asset),
|
|
257
|
+
eip3009Payload,
|
|
258
|
+
dataSuffix
|
|
259
|
+
);
|
|
260
|
+
const receipt = await signer.waitForTransactionReceipt({ hash: tx });
|
|
261
|
+
if (receipt.status !== "success") {
|
|
262
|
+
return {
|
|
263
|
+
success: false,
|
|
264
|
+
errorReason: ErrTransactionFailed,
|
|
265
|
+
transaction: tx,
|
|
266
|
+
network: payload.accepted.network,
|
|
267
|
+
payer
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
return {
|
|
271
|
+
success: true,
|
|
272
|
+
transaction: tx,
|
|
273
|
+
network: payload.accepted.network,
|
|
274
|
+
payer
|
|
275
|
+
};
|
|
276
|
+
} catch (error) {
|
|
277
|
+
return {
|
|
278
|
+
success: false,
|
|
279
|
+
errorReason: parseEip3009TransferError(error),
|
|
280
|
+
transaction: "",
|
|
281
|
+
network: payload.accepted.network,
|
|
282
|
+
payer
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// src/exact/facilitator/permit2.ts
|
|
288
|
+
import { getAddress as getAddress2, encodeFunctionData } from "viem";
|
|
289
|
+
var exactProxyConfig = {
|
|
290
|
+
proxyAddress: x402ExactPermit2ProxyAddress,
|
|
291
|
+
proxyABI: x402ExactPermit2ProxyABI
|
|
292
|
+
};
|
|
293
|
+
async function verifyPermit2(signer, payload, requirements, permit2Payload, context, options) {
|
|
294
|
+
const payer = permit2Payload.permit2Authorization.from;
|
|
295
|
+
if (payload.accepted.scheme !== "exact" || requirements.scheme !== "exact") {
|
|
296
|
+
return {
|
|
297
|
+
isValid: false,
|
|
298
|
+
invalidReason: ErrUnsupportedPayloadType,
|
|
299
|
+
payer
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
if (payload.accepted.network !== requirements.network) {
|
|
303
|
+
return {
|
|
304
|
+
isValid: false,
|
|
305
|
+
invalidReason: ErrNetworkMismatch,
|
|
306
|
+
payer
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
const chainId = getEvmChainId(requirements.network);
|
|
310
|
+
const tokenAddress = getAddress2(requirements.asset);
|
|
311
|
+
const assetBytecode = await signer.getCode({ address: tokenAddress });
|
|
312
|
+
if (!assetBytecode || assetBytecode === "0x") {
|
|
313
|
+
return { isValid: false, invalidReason: ErrAssetNotDeployedContract, payer };
|
|
314
|
+
}
|
|
315
|
+
if (getAddress2(permit2Payload.permit2Authorization.spender) !== getAddress2(x402ExactPermit2ProxyAddress)) {
|
|
316
|
+
return {
|
|
317
|
+
isValid: false,
|
|
318
|
+
invalidReason: ErrPermit2InvalidSpender,
|
|
319
|
+
payer
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
if (getAddress2(permit2Payload.permit2Authorization.witness.to) !== getAddress2(requirements.payTo)) {
|
|
323
|
+
return {
|
|
324
|
+
isValid: false,
|
|
325
|
+
invalidReason: ErrPermit2RecipientMismatch,
|
|
326
|
+
payer
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
const now = Math.floor(Date.now() / 1e3);
|
|
330
|
+
if (BigInt(permit2Payload.permit2Authorization.deadline) < BigInt(now + 6)) {
|
|
331
|
+
return {
|
|
332
|
+
isValid: false,
|
|
333
|
+
invalidReason: ErrPermit2DeadlineExpired,
|
|
334
|
+
payer
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
if (BigInt(permit2Payload.permit2Authorization.witness.validAfter) > BigInt(now)) {
|
|
338
|
+
return {
|
|
339
|
+
isValid: false,
|
|
340
|
+
invalidReason: ErrPermit2NotYetValid,
|
|
341
|
+
payer
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
if (BigInt(permit2Payload.permit2Authorization.permitted.amount) !== BigInt(requirements.amount)) {
|
|
345
|
+
return {
|
|
346
|
+
isValid: false,
|
|
347
|
+
invalidReason: ErrPermit2AmountMismatch,
|
|
348
|
+
payer
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
if (getAddress2(permit2Payload.permit2Authorization.permitted.token) !== tokenAddress) {
|
|
352
|
+
return {
|
|
353
|
+
isValid: false,
|
|
354
|
+
invalidReason: ErrPermit2TokenMismatch,
|
|
355
|
+
payer
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
const permit2TypedData = {
|
|
359
|
+
types: permit2WitnessTypes,
|
|
360
|
+
primaryType: "PermitWitnessTransferFrom",
|
|
361
|
+
domain: {
|
|
362
|
+
name: "Permit2",
|
|
363
|
+
chainId,
|
|
364
|
+
verifyingContract: PERMIT2_ADDRESS
|
|
365
|
+
},
|
|
366
|
+
message: {
|
|
367
|
+
permitted: {
|
|
368
|
+
token: getAddress2(permit2Payload.permit2Authorization.permitted.token),
|
|
369
|
+
amount: BigInt(permit2Payload.permit2Authorization.permitted.amount)
|
|
370
|
+
},
|
|
371
|
+
spender: getAddress2(permit2Payload.permit2Authorization.spender),
|
|
372
|
+
nonce: BigInt(permit2Payload.permit2Authorization.nonce),
|
|
373
|
+
deadline: BigInt(permit2Payload.permit2Authorization.deadline),
|
|
374
|
+
witness: {
|
|
375
|
+
to: getAddress2(permit2Payload.permit2Authorization.witness.to),
|
|
376
|
+
validAfter: BigInt(permit2Payload.permit2Authorization.witness.validAfter)
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
let signatureValid = false;
|
|
381
|
+
try {
|
|
382
|
+
signatureValid = await signer.verifyTypedData({
|
|
383
|
+
address: payer,
|
|
384
|
+
...permit2TypedData,
|
|
385
|
+
signature: permit2Payload.signature
|
|
386
|
+
});
|
|
387
|
+
} catch {
|
|
388
|
+
signatureValid = false;
|
|
389
|
+
}
|
|
390
|
+
if (!signatureValid) {
|
|
391
|
+
const bytecode = await signer.getCode({ address: payer });
|
|
392
|
+
const isDeployedContract = bytecode && bytecode !== "0x";
|
|
393
|
+
if (!isDeployedContract) {
|
|
394
|
+
return {
|
|
395
|
+
isValid: false,
|
|
396
|
+
invalidReason: ErrPermit2InvalidSignature,
|
|
397
|
+
payer
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
if (options?.simulate === false) {
|
|
402
|
+
return { isValid: true, invalidReason: void 0, payer };
|
|
403
|
+
}
|
|
404
|
+
const eip2612Info = extractEip2612GasSponsoringInfo(payload);
|
|
405
|
+
if (eip2612Info) {
|
|
406
|
+
const fieldResult = validateEip2612PermitForPayment(eip2612Info, payer, tokenAddress);
|
|
407
|
+
if (!fieldResult.isValid) {
|
|
408
|
+
return { isValid: false, invalidReason: fieldResult.invalidReason, payer };
|
|
409
|
+
}
|
|
410
|
+
const exactSettleArgs = buildExactPermit2SettleArgs(permit2Payload);
|
|
411
|
+
const simOk2 = await simulatePermit2SettleWithPermit(
|
|
412
|
+
exactProxyConfig,
|
|
413
|
+
signer,
|
|
414
|
+
exactSettleArgs,
|
|
415
|
+
eip2612Info
|
|
416
|
+
);
|
|
417
|
+
if (!simOk2) {
|
|
418
|
+
return diagnosePermit2SimulationFailure(
|
|
419
|
+
exactProxyConfig,
|
|
420
|
+
signer,
|
|
421
|
+
tokenAddress,
|
|
422
|
+
permit2Payload,
|
|
423
|
+
requirements.amount
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
return { isValid: true, invalidReason: void 0, payer };
|
|
427
|
+
}
|
|
428
|
+
const erc20GasSponsorshipExtension = context?.getExtension(
|
|
429
|
+
ERC20_APPROVAL_GAS_SPONSORING_KEY
|
|
430
|
+
);
|
|
431
|
+
if (erc20GasSponsorshipExtension) {
|
|
432
|
+
const erc20Info = extractErc20ApprovalGasSponsoringInfo(payload);
|
|
433
|
+
if (erc20Info) {
|
|
434
|
+
const fieldResult = await validateErc20ApprovalForPayment(erc20Info, payer, tokenAddress);
|
|
435
|
+
if (!fieldResult.isValid) {
|
|
436
|
+
return { isValid: false, invalidReason: fieldResult.invalidReason, payer };
|
|
437
|
+
}
|
|
438
|
+
const extensionSigner = resolveErc20ApprovalExtensionSigner(
|
|
439
|
+
erc20GasSponsorshipExtension,
|
|
440
|
+
requirements.network
|
|
441
|
+
);
|
|
442
|
+
if (extensionSigner?.simulateTransactions) {
|
|
443
|
+
const simOk2 = await simulatePermit2SettleWithErc20Approval(
|
|
444
|
+
exactProxyConfig,
|
|
445
|
+
extensionSigner,
|
|
446
|
+
buildExactPermit2SettleArgs(permit2Payload),
|
|
447
|
+
erc20Info
|
|
448
|
+
);
|
|
449
|
+
if (!simOk2) {
|
|
450
|
+
return diagnosePermit2SimulationFailure(
|
|
451
|
+
exactProxyConfig,
|
|
452
|
+
signer,
|
|
453
|
+
tokenAddress,
|
|
454
|
+
permit2Payload,
|
|
455
|
+
requirements.amount
|
|
456
|
+
);
|
|
457
|
+
}
|
|
458
|
+
return { isValid: true, invalidReason: void 0, payer };
|
|
459
|
+
}
|
|
460
|
+
return checkPermit2Prerequisites(
|
|
461
|
+
exactProxyConfig,
|
|
462
|
+
signer,
|
|
463
|
+
tokenAddress,
|
|
464
|
+
payer,
|
|
465
|
+
requirements.amount
|
|
466
|
+
);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
const simOk = await simulatePermit2Settle(
|
|
470
|
+
exactProxyConfig,
|
|
471
|
+
signer,
|
|
472
|
+
buildExactPermit2SettleArgs(permit2Payload)
|
|
473
|
+
);
|
|
474
|
+
if (!simOk) {
|
|
475
|
+
return diagnosePermit2SimulationFailure(
|
|
476
|
+
exactProxyConfig,
|
|
477
|
+
signer,
|
|
478
|
+
tokenAddress,
|
|
479
|
+
permit2Payload,
|
|
480
|
+
requirements.amount
|
|
481
|
+
);
|
|
482
|
+
}
|
|
483
|
+
return { isValid: true, invalidReason: void 0, payer };
|
|
484
|
+
}
|
|
485
|
+
async function settlePermit2(signer, payload, requirements, permit2Payload, context, config) {
|
|
486
|
+
const payer = permit2Payload.permit2Authorization.from;
|
|
487
|
+
const valid = await verifyPermit2(signer, payload, requirements, permit2Payload, context, {
|
|
488
|
+
simulate: config?.simulateInSettle ?? false
|
|
489
|
+
});
|
|
490
|
+
if (!valid.isValid) {
|
|
491
|
+
return {
|
|
492
|
+
success: false,
|
|
493
|
+
network: payload.accepted.network,
|
|
494
|
+
transaction: "",
|
|
495
|
+
errorReason: valid.invalidReason ?? ErrInvalidScheme,
|
|
496
|
+
payer
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
const dataSuffix = await resolveDataSuffix(context, {
|
|
500
|
+
paymentPayload: payload,
|
|
501
|
+
paymentRequirements: requirements
|
|
502
|
+
});
|
|
503
|
+
const eip2612Info = extractEip2612GasSponsoringInfo(payload);
|
|
504
|
+
if (eip2612Info) {
|
|
505
|
+
return settlePermit2WithEIP2612(
|
|
506
|
+
exactProxyConfig,
|
|
507
|
+
signer,
|
|
508
|
+
payload,
|
|
509
|
+
permit2Payload,
|
|
510
|
+
eip2612Info,
|
|
511
|
+
dataSuffix
|
|
512
|
+
);
|
|
513
|
+
}
|
|
514
|
+
const erc20Info = extractErc20ApprovalGasSponsoringInfo(payload);
|
|
515
|
+
if (erc20Info) {
|
|
516
|
+
const erc20GasSponsorshipExtension = context?.getExtension(
|
|
517
|
+
ERC20_APPROVAL_GAS_SPONSORING_KEY
|
|
518
|
+
);
|
|
519
|
+
const extensionSigner = resolveErc20ApprovalExtensionSigner(
|
|
520
|
+
erc20GasSponsorshipExtension,
|
|
521
|
+
payload.accepted.network
|
|
522
|
+
);
|
|
523
|
+
if (extensionSigner) {
|
|
524
|
+
return settlePermit2WithERC20Approval(
|
|
525
|
+
exactProxyConfig,
|
|
526
|
+
extensionSigner,
|
|
527
|
+
payload,
|
|
528
|
+
permit2Payload,
|
|
529
|
+
erc20Info,
|
|
530
|
+
dataSuffix
|
|
531
|
+
);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
return settlePermit2Direct(exactProxyConfig, signer, payload, permit2Payload, dataSuffix);
|
|
535
|
+
}
|
|
536
|
+
async function settlePermit2WithEIP2612(config, signer, payload, permit2Payload, eip2612Info, dataSuffix) {
|
|
537
|
+
const payer = permit2Payload.permit2Authorization.from;
|
|
538
|
+
try {
|
|
539
|
+
const { v, r, s } = splitEip2612Signature(eip2612Info.signature);
|
|
540
|
+
const tx = await signer.writeContract({
|
|
541
|
+
address: config.proxyAddress,
|
|
542
|
+
abi: config.proxyABI,
|
|
543
|
+
functionName: "settleWithPermit",
|
|
544
|
+
args: [
|
|
545
|
+
{
|
|
546
|
+
value: BigInt(eip2612Info.amount),
|
|
547
|
+
deadline: BigInt(eip2612Info.deadline),
|
|
548
|
+
r,
|
|
549
|
+
s,
|
|
550
|
+
v
|
|
551
|
+
},
|
|
552
|
+
...buildExactPermit2SettleArgs(permit2Payload)
|
|
553
|
+
],
|
|
554
|
+
dataSuffix
|
|
555
|
+
});
|
|
556
|
+
return waitAndReturnSettleResponse(signer, tx, payload, payer);
|
|
557
|
+
} catch (error) {
|
|
558
|
+
return mapSettleError(error, payload, payer);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
async function settlePermit2WithERC20Approval(config, extensionSigner, payload, permit2Payload, erc20Info, dataSuffix) {
|
|
562
|
+
const payer = permit2Payload.permit2Authorization.from;
|
|
563
|
+
try {
|
|
564
|
+
const settleData = appendDataSuffix(
|
|
565
|
+
encodeFunctionData({
|
|
566
|
+
abi: config.proxyABI,
|
|
567
|
+
functionName: "settle",
|
|
568
|
+
args: buildExactPermit2SettleArgs(permit2Payload)
|
|
569
|
+
}),
|
|
570
|
+
dataSuffix
|
|
571
|
+
);
|
|
572
|
+
const txHashes = await extensionSigner.sendTransactions([
|
|
573
|
+
erc20Info.signedTransaction,
|
|
574
|
+
{ to: config.proxyAddress, data: settleData, gas: BigInt(3e5) }
|
|
575
|
+
]);
|
|
576
|
+
const settleTxHash = txHashes[txHashes.length - 1];
|
|
577
|
+
return waitAndReturnSettleResponse(extensionSigner, settleTxHash, payload, payer);
|
|
578
|
+
} catch (error) {
|
|
579
|
+
return mapSettleError(error, payload, payer);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
async function settlePermit2Direct(config, signer, payload, permit2Payload, dataSuffix) {
|
|
583
|
+
const payer = permit2Payload.permit2Authorization.from;
|
|
584
|
+
try {
|
|
585
|
+
const tx = await signer.writeContract({
|
|
586
|
+
address: config.proxyAddress,
|
|
587
|
+
abi: config.proxyABI,
|
|
588
|
+
functionName: "settle",
|
|
589
|
+
args: buildExactPermit2SettleArgs(permit2Payload),
|
|
590
|
+
dataSuffix
|
|
591
|
+
});
|
|
592
|
+
return waitAndReturnSettleResponse(signer, tx, payload, payer);
|
|
593
|
+
} catch (error) {
|
|
594
|
+
return mapSettleError(error, payload, payer);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
// src/exact/facilitator/scheme.ts
|
|
599
|
+
var ExactEvmScheme = class {
|
|
600
|
+
/**
|
|
601
|
+
* Creates a new ExactEvmScheme facilitator instance.
|
|
602
|
+
*
|
|
603
|
+
* @param signer - The EVM signer for facilitator operations
|
|
604
|
+
* @param config - Optional configuration
|
|
605
|
+
*/
|
|
606
|
+
constructor(signer, config) {
|
|
607
|
+
this.signer = signer;
|
|
608
|
+
this.scheme = "exact";
|
|
609
|
+
this.caipFamily = "eip155:*";
|
|
610
|
+
this.config = {
|
|
611
|
+
eip6492AllowedFactories: config?.eip6492AllowedFactories ?? [],
|
|
612
|
+
simulateInSettle: config?.simulateInSettle ?? false
|
|
613
|
+
};
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Returns undefined — EVM has no mechanism-specific extra data.
|
|
617
|
+
*
|
|
618
|
+
* @param _ - The network identifier (unused)
|
|
619
|
+
* @returns undefined
|
|
620
|
+
*/
|
|
621
|
+
getExtra(_) {
|
|
622
|
+
return void 0;
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* Returns facilitator wallet addresses for the supported response.
|
|
626
|
+
*
|
|
627
|
+
* @param _ - The network identifier (unused, addresses are network-agnostic)
|
|
628
|
+
* @returns Array of facilitator wallet addresses
|
|
629
|
+
*/
|
|
630
|
+
getSigners(_) {
|
|
631
|
+
return [...this.signer.getAddresses()];
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* Verifies a payment payload. Routes to Permit2 or EIP-3009 based on payload type.
|
|
635
|
+
*
|
|
636
|
+
* @param payload - The payment payload to verify
|
|
637
|
+
* @param requirements - The payment requirements
|
|
638
|
+
* @param context - Optional facilitator context for extension capabilities
|
|
639
|
+
* @param _ - Payment required extensions (unused; reserved for interface parity)
|
|
640
|
+
* @returns Promise resolving to verification response
|
|
641
|
+
*/
|
|
642
|
+
async verify(payload, requirements, context, _) {
|
|
643
|
+
const rawPayload = payload.payload;
|
|
644
|
+
const isPermit2 = isPermit2Payload(rawPayload);
|
|
645
|
+
if (isPermit2) {
|
|
646
|
+
return verifyPermit2(this.signer, payload, requirements, rawPayload, context);
|
|
647
|
+
}
|
|
648
|
+
const eip3009Payload = rawPayload;
|
|
649
|
+
return verifyEIP3009(this.signer, payload, requirements, eip3009Payload);
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Settles a payment. Routes to Permit2 or EIP-3009 based on payload type.
|
|
653
|
+
*
|
|
654
|
+
* @param payload - The payment payload to settle
|
|
655
|
+
* @param requirements - The payment requirements
|
|
656
|
+
* @param context - Optional facilitator context for extension capabilities
|
|
657
|
+
* @returns Promise resolving to settlement response
|
|
658
|
+
*/
|
|
659
|
+
async settle(payload, requirements, context) {
|
|
660
|
+
const rawPayload = payload.payload;
|
|
661
|
+
const isPermit2 = isPermit2Payload(rawPayload);
|
|
662
|
+
if (isPermit2) {
|
|
663
|
+
return settlePermit2(this.signer, payload, requirements, rawPayload, context, {
|
|
664
|
+
simulateInSettle: this.config.simulateInSettle
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
const eip3009Payload = rawPayload;
|
|
668
|
+
return settleEIP3009(this.signer, payload, requirements, eip3009Payload, this.config, context);
|
|
669
|
+
}
|
|
670
|
+
};
|
|
671
|
+
|
|
672
|
+
// src/exact/facilitator/register.ts
|
|
673
|
+
function registerExactEvmScheme(facilitator, config) {
|
|
674
|
+
facilitator.register(
|
|
675
|
+
config.networks,
|
|
676
|
+
new ExactEvmScheme(config.signer, {
|
|
677
|
+
eip6492AllowedFactories: config.eip6492AllowedFactories,
|
|
678
|
+
simulateInSettle: config.simulateInSettle
|
|
679
|
+
})
|
|
680
|
+
);
|
|
681
|
+
facilitator.registerV1(
|
|
682
|
+
NETWORKS,
|
|
683
|
+
new ExactEvmSchemeV1(config.signer, {
|
|
684
|
+
eip6492AllowedFactories: config.eip6492AllowedFactories,
|
|
685
|
+
simulateInSettle: config.simulateInSettle
|
|
686
|
+
})
|
|
687
|
+
);
|
|
688
|
+
return facilitator;
|
|
689
|
+
}
|
|
690
|
+
export {
|
|
691
|
+
ExactEvmScheme,
|
|
692
|
+
registerExactEvmScheme
|
|
693
|
+
};
|
|
694
|
+
//# sourceMappingURL=index.mjs.map
|