@pafi-dev/core 0.3.0-beta.0 → 0.3.0-beta.10
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/abi/index.cjs +2 -6
- package/dist/abi/index.cjs.map +1 -1
- package/dist/abi/index.d.cts +1 -286
- package/dist/abi/index.d.ts +1 -286
- package/dist/abi/index.js +1 -5
- package/dist/{chunk-R4L66ZR5.js → chunk-73CQTNLB.js} +10 -1
- package/dist/chunk-73CQTNLB.js.map +1 -0
- package/dist/{chunk-5YH4D7QF.js → chunk-7UBO7DY5.js} +1 -1
- package/dist/{chunk-FGKLDKJK.cjs → chunk-ALCWYDVG.cjs} +1 -1
- package/dist/{chunk-FGKLDKJK.cjs.map → chunk-ALCWYDVG.cjs.map} +1 -1
- package/dist/{chunk-X3I5XWAR.cjs → chunk-CQCSQPWG.cjs} +2 -15
- package/dist/chunk-CQCSQPWG.cjs.map +1 -0
- package/dist/{chunk-CWP4PFOP.cjs → chunk-DMW67WBU.cjs} +11 -2
- package/dist/chunk-DMW67WBU.cjs.map +1 -0
- package/dist/{chunk-C4ZDYG4D.js → chunk-DUY7Z2AI.js} +48 -6
- package/dist/chunk-DUY7Z2AI.js.map +1 -0
- package/dist/chunk-EDR5SFJN.cjs +351 -0
- package/dist/chunk-EDR5SFJN.cjs.map +1 -0
- package/dist/{chunk-FIKTQR7H.js → chunk-I2P3TIP7.js} +2 -2
- package/dist/{chunk-BNTVOKYT.cjs → chunk-KJKDLD7N.cjs} +51 -9
- package/dist/chunk-KJKDLD7N.cjs.map +1 -0
- package/dist/{chunk-VQSRCMMK.js → chunk-QGO6X6LG.js} +2 -15
- package/dist/chunk-QGO6X6LG.js.map +1 -0
- package/dist/chunk-W23EJNYG.js +351 -0
- package/dist/chunk-W23EJNYG.js.map +1 -0
- package/dist/{chunk-CAE2BVKI.cjs → chunk-Z2V525IS.cjs} +6 -6
- package/dist/{chunk-CAE2BVKI.cjs.map → chunk-Z2V525IS.cjs.map} +1 -1
- package/dist/contract/index.cjs +2 -5
- package/dist/contract/index.cjs.map +1 -1
- package/dist/contract/index.d.cts +2 -4
- package/dist/contract/index.d.ts +2 -4
- package/dist/contract/index.js +1 -4
- package/dist/eip712/index.cjs +9 -3
- package/dist/eip712/index.cjs.map +1 -1
- package/dist/eip712/index.d.cts +44 -2
- package/dist/eip712/index.d.ts +44 -2
- package/dist/eip712/index.js +8 -2
- package/dist/index-B06IJlHe.d.ts +244 -0
- package/dist/index-B7pGBych.d.cts +244 -0
- package/dist/index.cjs +365 -329
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +778 -459
- package/dist/index.d.ts +778 -459
- package/dist/index.js +383 -347
- package/dist/index.js.map +1 -1
- package/dist/quoting/index.cjs +3 -3
- package/dist/quoting/index.d.cts +1 -1
- package/dist/quoting/index.d.ts +1 -1
- package/dist/quoting/index.js +2 -2
- package/dist/swap/index.cjs +4 -3
- package/dist/swap/index.cjs.map +1 -1
- package/dist/swap/index.d.cts +3 -84
- package/dist/swap/index.d.ts +3 -84
- package/dist/swap/index.js +3 -2
- package/dist/{types-BDOnH5Le.d.ts → types-b5_Tokjl.d.cts} +8 -17
- package/dist/{types-BDOnH5Le.d.cts → types-b5_Tokjl.d.ts} +8 -17
- package/package.json +1 -1
- package/dist/chunk-27V32VNM.cjs +0 -370
- package/dist/chunk-27V32VNM.cjs.map +0 -1
- package/dist/chunk-4RYBJLF3.js +0 -370
- package/dist/chunk-4RYBJLF3.js.map +0 -1
- package/dist/chunk-5QJZT7VB.cjs +0 -46
- package/dist/chunk-5QJZT7VB.cjs.map +0 -1
- package/dist/chunk-6I6K43RQ.cjs +0 -149
- package/dist/chunk-6I6K43RQ.cjs.map +0 -1
- package/dist/chunk-BNTVOKYT.cjs.map +0 -1
- package/dist/chunk-C4ZDYG4D.js.map +0 -1
- package/dist/chunk-CWP4PFOP.cjs.map +0 -1
- package/dist/chunk-L74CZAVQ.cjs +0 -99
- package/dist/chunk-L74CZAVQ.cjs.map +0 -1
- package/dist/chunk-P56TUGTS.js +0 -46
- package/dist/chunk-P56TUGTS.js.map +0 -1
- package/dist/chunk-R4L66ZR5.js.map +0 -1
- package/dist/chunk-UU72CX7E.js +0 -149
- package/dist/chunk-UU72CX7E.js.map +0 -1
- package/dist/chunk-VQSRCMMK.js.map +0 -1
- package/dist/chunk-X3I5XWAR.cjs.map +0 -1
- package/dist/chunk-X4IXUTTD.js +0 -99
- package/dist/chunk-X4IXUTTD.js.map +0 -1
- package/dist/relay/index.cjs +0 -19
- package/dist/relay/index.cjs.map +0 -1
- package/dist/relay/index.d.cts +0 -75
- package/dist/relay/index.d.ts +0 -75
- package/dist/relay/index.js +0 -19
- package/dist/relay/index.js.map +0 -1
- /package/dist/{chunk-5YH4D7QF.js.map → chunk-7UBO7DY5.js.map} +0 -0
- /package/dist/{chunk-FIKTQR7H.js.map → chunk-I2P3TIP7.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pointTokenFactoryAbi
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7UBO7DY5.js";
|
|
4
4
|
import {
|
|
5
5
|
createLoginMessage,
|
|
6
6
|
parseLoginMessage,
|
|
@@ -14,25 +14,27 @@ import {
|
|
|
14
14
|
getPointTokenIssuer,
|
|
15
15
|
getReceiverConsentNonce,
|
|
16
16
|
getTokenName,
|
|
17
|
-
getUsdt,
|
|
18
17
|
isActiveIssuer,
|
|
19
18
|
isMinter,
|
|
20
19
|
verifyMintCap
|
|
21
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-QGO6X6LG.js";
|
|
22
21
|
import {
|
|
23
22
|
issuerRegistryAbi,
|
|
24
23
|
mintingOracleAbi,
|
|
25
24
|
pointTokenAbi
|
|
26
25
|
} from "./chunk-FXNG4G22.js";
|
|
27
26
|
import {
|
|
27
|
+
buildBurnRequestTypedData,
|
|
28
28
|
buildDomain,
|
|
29
29
|
buildMintRequestTypedData,
|
|
30
30
|
buildReceiverConsentTypedData,
|
|
31
|
+
signBurnRequest,
|
|
31
32
|
signMintRequest,
|
|
32
33
|
signReceiverConsent,
|
|
34
|
+
verifyBurnRequest,
|
|
33
35
|
verifyMintRequest,
|
|
34
36
|
verifyReceiverConsent
|
|
35
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-DUY7Z2AI.js";
|
|
36
38
|
import {
|
|
37
39
|
buildAllPaths,
|
|
38
40
|
combineRoutes,
|
|
@@ -40,7 +42,7 @@ import {
|
|
|
40
42
|
quoteBestRoute,
|
|
41
43
|
quoteExactInput,
|
|
42
44
|
quoteExactInputSingle
|
|
43
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-I2P3TIP7.js";
|
|
44
46
|
import {
|
|
45
47
|
v4QuoterAbi
|
|
46
48
|
} from "./chunk-KFWZRL7I.js";
|
|
@@ -51,141 +53,189 @@ import {
|
|
|
51
53
|
SUPPORTED_CHAINS,
|
|
52
54
|
UNIVERSAL_ROUTER_ADDRESSES,
|
|
53
55
|
V4_QUOTER_ADDRESSES,
|
|
56
|
+
burnRequestTypes,
|
|
54
57
|
mintRequestTypes,
|
|
55
58
|
receiverConsentTypes
|
|
56
|
-
} from "./chunk-
|
|
57
|
-
import {
|
|
58
|
-
buildRelaySwapParams,
|
|
59
|
-
decodeExtData,
|
|
60
|
-
decodeMintAndSwap,
|
|
61
|
-
encodeExtData,
|
|
62
|
-
encodeMintAndSwap,
|
|
63
|
-
simulateMintAndSwap
|
|
64
|
-
} from "./chunk-X4IXUTTD.js";
|
|
65
|
-
import {
|
|
66
|
-
relayAbi
|
|
67
|
-
} from "./chunk-4RYBJLF3.js";
|
|
59
|
+
} from "./chunk-73CQTNLB.js";
|
|
68
60
|
import {
|
|
61
|
+
ApiError,
|
|
62
|
+
BATCH_EXECUTOR_ABI,
|
|
63
|
+
ConfigurationError,
|
|
64
|
+
PafiSDKError,
|
|
69
65
|
SETTLE_ALL,
|
|
70
66
|
SWAP_EXACT_IN,
|
|
67
|
+
SigningError,
|
|
68
|
+
SimulationError,
|
|
71
69
|
TAKE_ALL,
|
|
72
70
|
V4_SWAP,
|
|
71
|
+
assembleUserOperation,
|
|
73
72
|
buildErc20ApprovalCalldata,
|
|
73
|
+
buildPartialUserOperation,
|
|
74
74
|
buildPermit2ApprovalCalldata,
|
|
75
75
|
buildSwapFromQuote,
|
|
76
|
+
buildSwapWithGasDeduction,
|
|
76
77
|
buildUniversalRouterExecuteArgs,
|
|
77
78
|
buildV4SwapInput,
|
|
78
79
|
checkAllowance,
|
|
80
|
+
encodeBatchExecute,
|
|
81
|
+
erc20ApproveOp,
|
|
82
|
+
erc20BurnOp,
|
|
83
|
+
erc20TransferOp,
|
|
84
|
+
rawCallOp,
|
|
79
85
|
simulateSwap
|
|
80
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-W23EJNYG.js";
|
|
81
87
|
import {
|
|
82
88
|
erc20Abi,
|
|
83
89
|
permit2Abi,
|
|
84
90
|
universalRouterAbi
|
|
85
91
|
} from "./chunk-2PIXFXA2.js";
|
|
86
|
-
import {
|
|
87
|
-
ApiError,
|
|
88
|
-
ConfigurationError,
|
|
89
|
-
PafiSDKError,
|
|
90
|
-
SigningError,
|
|
91
|
-
SimulationError
|
|
92
|
-
} from "./chunk-P56TUGTS.js";
|
|
93
92
|
|
|
94
93
|
// src/index.ts
|
|
95
94
|
import { createPublicClient, http } from "viem";
|
|
96
95
|
|
|
97
|
-
// src/
|
|
98
|
-
|
|
99
|
-
var ZERO_VALUE = 0n;
|
|
96
|
+
// src/perp/buildPerpDepositWithGasDeduction.ts
|
|
97
|
+
import { encodeFunctionData } from "viem";
|
|
100
98
|
|
|
101
|
-
// src/
|
|
102
|
-
import {
|
|
103
|
-
var
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
target: token,
|
|
129
|
-
value: 0n,
|
|
130
|
-
data: encodeFunctionData({
|
|
131
|
-
abi: ERC20_BURNABLE_ABI,
|
|
132
|
-
functionName: "burn",
|
|
133
|
-
args: [amount]
|
|
134
|
-
})
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
function rawCallOp(target, data, value = 0n) {
|
|
138
|
-
return { target, value, data };
|
|
99
|
+
// src/contracts/real/orderlyVault.ts
|
|
100
|
+
import { keccak256, encodePacked, encodeAbiParameters } from "viem";
|
|
101
|
+
var ORDERLY_VAULT_BASE_MAINNET = "0xDe5cE5DD048596e46Ff671b13317aCC3C5B59b01";
|
|
102
|
+
var ORDERLY_VAULT_ADDRESSES = {
|
|
103
|
+
8453: ORDERLY_VAULT_BASE_MAINNET
|
|
104
|
+
};
|
|
105
|
+
var BROKER_HASHES = {
|
|
106
|
+
/** Default partner broker on Base — most commonly whitelisted. */
|
|
107
|
+
woofi_pro: keccak256(encodePacked(["string"], ["woofi_pro"])),
|
|
108
|
+
/** Orderly's own white-label broker. */
|
|
109
|
+
orderly: keccak256(encodePacked(["string"], ["orderly"])),
|
|
110
|
+
/** LogX. */
|
|
111
|
+
logx: keccak256(encodePacked(["string"], ["logx"]))
|
|
112
|
+
};
|
|
113
|
+
var TOKEN_HASHES = {
|
|
114
|
+
USDC: keccak256(encodePacked(["string"], ["USDC"]))
|
|
115
|
+
};
|
|
116
|
+
function computeAccountId(user, brokerHash) {
|
|
117
|
+
return keccak256(
|
|
118
|
+
encodeAbiParameters(
|
|
119
|
+
[
|
|
120
|
+
{ type: "address" },
|
|
121
|
+
{ type: "bytes32" }
|
|
122
|
+
],
|
|
123
|
+
[user, brokerHash]
|
|
124
|
+
)
|
|
125
|
+
);
|
|
139
126
|
}
|
|
127
|
+
var ORDERLY_VAULT_ABI = [
|
|
128
|
+
// Deposit USDC into Orderly perp account. Emits LayerZero message
|
|
129
|
+
// to the Orderly chain. `msg.value` MUST equal `getDepositFee(...)`.
|
|
130
|
+
{
|
|
131
|
+
type: "function",
|
|
132
|
+
name: "deposit",
|
|
133
|
+
stateMutability: "payable",
|
|
134
|
+
inputs: [
|
|
135
|
+
{
|
|
136
|
+
name: "data",
|
|
137
|
+
type: "tuple",
|
|
138
|
+
components: [
|
|
139
|
+
{ name: "accountId", type: "bytes32" },
|
|
140
|
+
{ name: "brokerHash", type: "bytes32" },
|
|
141
|
+
{ name: "tokenHash", type: "bytes32" },
|
|
142
|
+
{ name: "tokenAmount", type: "uint128" }
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
outputs: []
|
|
147
|
+
},
|
|
148
|
+
// Quote the LayerZero fee for a deposit message. Pass the same
|
|
149
|
+
// VaultDepositFE struct you intend to send.
|
|
150
|
+
{
|
|
151
|
+
type: "function",
|
|
152
|
+
name: "getDepositFee",
|
|
153
|
+
stateMutability: "view",
|
|
154
|
+
inputs: [
|
|
155
|
+
{ name: "user", type: "address" },
|
|
156
|
+
{
|
|
157
|
+
name: "data",
|
|
158
|
+
type: "tuple",
|
|
159
|
+
components: [
|
|
160
|
+
{ name: "accountId", type: "bytes32" },
|
|
161
|
+
{ name: "brokerHash", type: "bytes32" },
|
|
162
|
+
{ name: "tokenHash", type: "bytes32" },
|
|
163
|
+
{ name: "tokenAmount", type: "uint128" }
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
outputs: [{ name: "", type: "uint256" }]
|
|
168
|
+
},
|
|
169
|
+
// Pre-flight check — is this brokerId whitelisted on this Vault?
|
|
170
|
+
{
|
|
171
|
+
type: "function",
|
|
172
|
+
name: "getAllowedBroker",
|
|
173
|
+
stateMutability: "view",
|
|
174
|
+
inputs: [{ name: "brokerHash", type: "bytes32" }],
|
|
175
|
+
outputs: [{ name: "", type: "bool" }]
|
|
176
|
+
},
|
|
177
|
+
// Pre-flight check — what ERC-20 address does this token symbol
|
|
178
|
+
// resolve to on this Vault?
|
|
179
|
+
{
|
|
180
|
+
type: "function",
|
|
181
|
+
name: "getAllowedToken",
|
|
182
|
+
stateMutability: "view",
|
|
183
|
+
inputs: [{ name: "tokenHash", type: "bytes32" }],
|
|
184
|
+
outputs: [{ name: "", type: "address" }]
|
|
185
|
+
}
|
|
186
|
+
];
|
|
140
187
|
|
|
141
|
-
// src/
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
188
|
+
// src/perp/buildPerpDepositWithGasDeduction.ts
|
|
189
|
+
function buildPerpDepositWithGasDeduction(params) {
|
|
190
|
+
if (params.amount <= 0n) {
|
|
191
|
+
throw new Error("buildPerpDepositWithGasDeduction: amount must be positive");
|
|
192
|
+
}
|
|
193
|
+
if (params.layerZeroFee < 0n) {
|
|
194
|
+
throw new Error(
|
|
195
|
+
"buildPerpDepositWithGasDeduction: layerZeroFee cannot be negative"
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
if (params.depositData.tokenAmount !== params.amount) {
|
|
199
|
+
throw new Error(
|
|
200
|
+
`buildPerpDepositWithGasDeduction: depositData.tokenAmount (${params.depositData.tokenAmount}) must equal amount (${params.amount})`
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
const vault = params.vaultAddress ?? ORDERLY_VAULT_ADDRESSES[params.chainId];
|
|
204
|
+
if (!vault) {
|
|
205
|
+
throw new Error(
|
|
206
|
+
`buildPerpDepositWithGasDeduction: no Orderly Vault address for chainId ${params.chainId}`
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
const depositCallData = encodeFunctionData({
|
|
210
|
+
abi: ORDERLY_VAULT_ABI,
|
|
211
|
+
functionName: "deposit",
|
|
212
|
+
args: [params.depositData]
|
|
213
|
+
});
|
|
214
|
+
const operations = [
|
|
215
|
+
erc20ApproveOp(params.usdcAddress, vault, params.amount),
|
|
216
|
+
{
|
|
217
|
+
...rawCallOp(vault, depositCallData),
|
|
218
|
+
// BatchExecutor passes `value` from the inner call along; this
|
|
219
|
+
// becomes the LayerZero fee. The aggregated `msg.value` for the
|
|
220
|
+
// top-level UserOp must equal the sum of inner `value`s.
|
|
221
|
+
value: params.layerZeroFee
|
|
222
|
+
}
|
|
223
|
+
];
|
|
224
|
+
return buildPartialUserOperation({
|
|
225
|
+
sender: params.userAddress,
|
|
226
|
+
nonce: params.aaNonce,
|
|
227
|
+
operations,
|
|
228
|
+
gasLimits: {
|
|
229
|
+
callGasLimit: params.gasLimits?.callGasLimit ?? 800000n,
|
|
230
|
+
verificationGasLimit: params.gasLimits?.verificationGasLimit ?? 150000n,
|
|
231
|
+
preVerificationGas: params.gasLimits?.preVerificationGas ?? 50000n
|
|
232
|
+
}
|
|
160
233
|
});
|
|
161
234
|
}
|
|
162
235
|
|
|
163
|
-
// src/userop/
|
|
164
|
-
var
|
|
165
|
-
var
|
|
166
|
-
var DEFAULT_PRE_VERIFICATION_GAS = 50000n;
|
|
167
|
-
function buildPartialUserOperation(params) {
|
|
168
|
-
return {
|
|
169
|
-
sender: params.sender,
|
|
170
|
-
nonce: params.nonce,
|
|
171
|
-
callData: encodeBatchExecute(params.operations),
|
|
172
|
-
callGasLimit: params.gasLimits?.callGasLimit ?? DEFAULT_CALL_GAS_LIMIT,
|
|
173
|
-
verificationGasLimit: params.gasLimits?.verificationGasLimit ?? DEFAULT_VERIFICATION_GAS_LIMIT,
|
|
174
|
-
preVerificationGas: params.gasLimits?.preVerificationGas ?? DEFAULT_PRE_VERIFICATION_GAS,
|
|
175
|
-
maxFeePerGas: params.feeOverrides?.maxFeePerGas ?? 0n,
|
|
176
|
-
maxPriorityFeePerGas: params.feeOverrides?.maxPriorityFeePerGas ?? 0n
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
function assembleUserOperation(partial, paymaster, signature) {
|
|
180
|
-
return {
|
|
181
|
-
...partial,
|
|
182
|
-
paymaster: paymaster.paymaster,
|
|
183
|
-
paymasterData: paymaster.paymasterData,
|
|
184
|
-
paymasterVerificationGasLimit: paymaster.paymasterVerificationGasLimit,
|
|
185
|
-
paymasterPostOpGasLimit: paymaster.paymasterPostOpGasLimit,
|
|
186
|
-
signature
|
|
187
|
-
};
|
|
188
|
-
}
|
|
236
|
+
// src/userop/types.ts
|
|
237
|
+
var ENTRY_POINT_V07 = "0x0000000071727De22E5E9d8BAf0edAc6f37da032";
|
|
238
|
+
var ZERO_VALUE = 0n;
|
|
189
239
|
|
|
190
240
|
// src/paymaster/config.ts
|
|
191
241
|
var _config = null;
|
|
@@ -230,186 +280,233 @@ async function checkEthAndBranch(params) {
|
|
|
230
280
|
return balance >= required ? "normal" : "paymaster";
|
|
231
281
|
}
|
|
232
282
|
|
|
233
|
-
// src/contracts/
|
|
234
|
-
import { parseAbi
|
|
235
|
-
var
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
"function
|
|
239
|
-
|
|
283
|
+
// src/contracts/real/pointToken.ts
|
|
284
|
+
import { parseAbi } from "viem";
|
|
285
|
+
var POINT_TOKEN_ABI = parseAbi([
|
|
286
|
+
// --- Mint paths ---
|
|
287
|
+
"function mint(address to, uint256 amount) external",
|
|
288
|
+
"function mint(address to, uint256 amount, uint256 deadline, bytes minterSig) external",
|
|
289
|
+
// --- Burn paths ---
|
|
290
|
+
"function burn(address from, uint256 amount) external",
|
|
291
|
+
"function burn(address from, uint256 amount, uint256 deadline, bytes burnerSig) external",
|
|
292
|
+
// --- Authorization reads ---
|
|
293
|
+
"function minters(address account) external view returns (bool)",
|
|
294
|
+
"function burners(address account) external view returns (bool)",
|
|
295
|
+
// --- Authorization writes (owner-only; used by provisioning scripts) ---
|
|
296
|
+
"function addMinter(address minter) external",
|
|
297
|
+
"function removeMinter(address minter) external",
|
|
298
|
+
"function addBurner(address burner) external",
|
|
299
|
+
"function removeBurner(address burner) external",
|
|
300
|
+
// --- Nonces (sig-gated paths) ---
|
|
301
|
+
"function mintRequestNonces(address receiver) external view returns (uint256)",
|
|
302
|
+
"function burnRequestNonces(address from) external view returns (uint256)",
|
|
303
|
+
// --- Oracle ---
|
|
304
|
+
"function mintingOracle() external view returns (address)",
|
|
305
|
+
"function setMintingOracle(address _mintingOracle) external",
|
|
306
|
+
// --- Issuer ---
|
|
307
|
+
"function issuer() external view returns (address)",
|
|
308
|
+
// --- Standard ERC-20 reads ---
|
|
309
|
+
"function balanceOf(address account) external view returns (uint256)",
|
|
310
|
+
"function totalSupply() external view returns (uint256)",
|
|
311
|
+
"function name() external view returns (string)",
|
|
312
|
+
"function symbol() external view returns (string)",
|
|
313
|
+
"function decimals() external view returns (uint8)",
|
|
314
|
+
// --- EIP-712 domain (for off-chain sig verification) ---
|
|
315
|
+
"function DOMAIN_SEPARATOR() external view returns (bytes32)",
|
|
316
|
+
"function eip712Domain() external view returns (bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions)",
|
|
317
|
+
// --- Events ---
|
|
318
|
+
// PointIndexer filters Transfer(from=0x0) for mints
|
|
319
|
+
// BurnIndexer filters Transfer(to=0x0) for burns
|
|
320
|
+
"event Transfer(address indexed from, address indexed to, uint256 value)",
|
|
321
|
+
"event MinterAdded(address indexed minter)",
|
|
322
|
+
"event MinterRemoved(address indexed minter)",
|
|
323
|
+
"event BurnerAdded(address indexed burner)",
|
|
324
|
+
"event BurnerRemoved(address indexed burner)",
|
|
325
|
+
"event MintingOracleUpdated(address indexed mintingOracle)"
|
|
240
326
|
]);
|
|
241
|
-
var MOCK_RELAYER_V2_MINT_SELECTOR = "0xMOCKED__";
|
|
242
327
|
|
|
243
|
-
// src/contracts/
|
|
244
|
-
|
|
245
|
-
var
|
|
246
|
-
// Variant A
|
|
247
|
-
"function burn(uint256 amount) external",
|
|
248
|
-
// Variant B
|
|
249
|
-
"function burnWithSig((address user, address pointToken, uint256 amount, uint256 nonce, uint256 deadline) consent, (uint8 v, bytes32 r, bytes32 s) sig) external",
|
|
250
|
-
// Standard reads we always need
|
|
251
|
-
"function balanceOf(address user) external view returns (uint256)",
|
|
252
|
-
"function burnNonce(address user) external view returns (uint256)",
|
|
253
|
-
// ERC-20 Transfer event (inherited) — BurnIndexer filters `to = 0x0`
|
|
254
|
-
"event Transfer(address indexed from, address indexed to, uint256 value)"
|
|
255
|
-
]);
|
|
256
|
-
|
|
257
|
-
// src/contracts/mocks/batchExecutor.mock.ts
|
|
258
|
-
var MOCK_BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA = "0x000000000000000000000000000000000000DE01";
|
|
259
|
-
var MOCK_BATCH_EXECUTOR_ADDRESS_BASE_MAINNET = "0x000000000000000000000000000000000000DE02";
|
|
328
|
+
// src/contracts/real/batchExecutor.ts
|
|
329
|
+
var BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA = "0x000000000000000000000000000000000000DE01";
|
|
330
|
+
var BATCH_EXECUTOR_ADDRESS_BASE_MAINNET = "0x7702cb554e6bFb442cb743A7dF23154544a7176C";
|
|
260
331
|
|
|
261
|
-
// src/contracts/
|
|
262
|
-
var
|
|
263
|
-
var
|
|
264
|
-
// Base
|
|
265
|
-
//
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
},
|
|
274
|
-
// Base mainnet — intentionally left as placeholder. Do NOT ship to
|
|
275
|
-
// prod without swapping.
|
|
332
|
+
// src/contracts/real/addresses.ts
|
|
333
|
+
var PLACEHOLDER_DEAD = (suffix) => `0x000000000000000000000000000000000000${suffix.toLowerCase().padStart(4, "0")}`;
|
|
334
|
+
var CONTRACT_ADDRESSES = {
|
|
335
|
+
// Base mainnet — SC-delivered (2026-04-21, 2026-04-22)
|
|
336
|
+
// registry: IssuerRegistry 0xda2D3338CF70F462Ac175F5f2edfa45660CA4f31
|
|
337
|
+
// factory: PointTokenFactory 0x36c0BAb2faBE45EfA6d13001143e43A266Af673B
|
|
338
|
+
// oracle: MintingOracle 0xD85165939C700E51c8a45099316C6482634C2Ab9
|
|
339
|
+
// tokenImpl: PointToken (impl) 0x2e6FB1B0C1A51abb83eC974890126a64eC02E995
|
|
340
|
+
// mockUsdt: MockERC20 0x5d313485Ba59C3bb91e1A9C0C11782F0b83d5dcd
|
|
341
|
+
// POINT: PointToken instance 0x7d25E7156E51F865D522fd3ef257a6B5DD41b97e
|
|
342
|
+
// batchExecutor: Coinbase SW v2 0x7702cb554e6bFb442cb743A7dF23154544a7176C
|
|
343
|
+
// pafiHook: PAFIHook (V4, 10%) 0x870cAF9882d3160602AaC1769C2B264A2d8EC044
|
|
276
344
|
8453: {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
345
|
+
pointToken: "0x7d25E7156E51F865D522fd3ef257a6B5DD41b97e",
|
|
346
|
+
batchExecutor: "0x7702cb554e6bFb442cb743A7dF23154544a7176C",
|
|
347
|
+
usdt: "0x5d313485Ba59C3bb91e1A9C0C11782F0b83d5dcd",
|
|
348
|
+
issuerRegistry: "0xda2D3338CF70F462Ac175F5f2edfa45660CA4f31",
|
|
349
|
+
mintingOracle: "0xD85165939C700E51c8a45099316C6482634C2Ab9",
|
|
350
|
+
pafiHook: "0x870cAF9882d3160602AaC1769C2B264A2d8EC044"
|
|
351
|
+
},
|
|
352
|
+
// Base Sepolia — not in active use; placeholders kept so the map
|
|
353
|
+
// compiles for tooling that enumerates chains.
|
|
354
|
+
84532: {
|
|
355
|
+
pointToken: PLACEHOLDER_DEAD("dead"),
|
|
356
|
+
batchExecutor: PLACEHOLDER_DEAD("de01"),
|
|
357
|
+
usdt: PLACEHOLDER_DEAD("dead"),
|
|
358
|
+
issuerRegistry: PLACEHOLDER_DEAD("dead"),
|
|
359
|
+
mintingOracle: PLACEHOLDER_DEAD("dead"),
|
|
360
|
+
pafiHook: PLACEHOLDER_DEAD("dead")
|
|
283
361
|
}
|
|
284
362
|
};
|
|
285
|
-
|
|
286
|
-
|
|
363
|
+
var POINT_TOKEN_FACTORY_ADDRESSES = {
|
|
364
|
+
8453: "0x36c0BAb2faBE45EfA6d13001143e43A266Af673B",
|
|
365
|
+
84532: PLACEHOLDER_DEAD("dead")
|
|
366
|
+
};
|
|
367
|
+
var POINT_TOKEN_IMPL_ADDRESSES = {
|
|
368
|
+
8453: "0x2e6FB1B0C1A51abb83eC974890126a64eC02E995",
|
|
369
|
+
84532: PLACEHOLDER_DEAD("dead")
|
|
370
|
+
};
|
|
371
|
+
function getContractAddresses(chainId) {
|
|
372
|
+
const addrs = CONTRACT_ADDRESSES[chainId];
|
|
287
373
|
if (!addrs) {
|
|
288
374
|
throw new Error(
|
|
289
|
-
`
|
|
375
|
+
`getContractAddresses: no addresses for chainId ${chainId}. Supported: ${Object.keys(CONTRACT_ADDRESSES).join(", ")}`
|
|
290
376
|
);
|
|
291
377
|
}
|
|
292
378
|
return addrs;
|
|
293
379
|
}
|
|
294
380
|
|
|
295
|
-
// src/
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
381
|
+
// src/web-handoff/webPopup.ts
|
|
382
|
+
var DEFAULT_WIDTH = 900;
|
|
383
|
+
var DEFAULT_HEIGHT = 700;
|
|
384
|
+
var DEFAULT_NAME = "pafi-web";
|
|
385
|
+
function openWebPopup(url, options = {}) {
|
|
386
|
+
if (typeof window === "undefined" || typeof window.open !== "function") {
|
|
387
|
+
throw new Error(
|
|
388
|
+
"openWebPopup: `window.open` is not available in this runtime. Register a platform adapter via setPafiWebModalAdapter() instead."
|
|
389
|
+
);
|
|
390
|
+
}
|
|
391
|
+
const width = options.width ?? DEFAULT_WIDTH;
|
|
392
|
+
const height = options.height ?? DEFAULT_HEIGHT;
|
|
393
|
+
const name = options.windowName ?? DEFAULT_NAME;
|
|
394
|
+
const screenW = window.screen?.availWidth ?? window.innerWidth;
|
|
395
|
+
const screenH = window.screen?.availHeight ?? window.innerHeight;
|
|
396
|
+
const left = Math.max(0, Math.floor((screenW - width) / 2));
|
|
397
|
+
const top = Math.max(0, Math.floor((screenH - height) / 2));
|
|
398
|
+
const features = [
|
|
399
|
+
`width=${width}`,
|
|
400
|
+
`height=${height}`,
|
|
401
|
+
`left=${left}`,
|
|
402
|
+
`top=${top}`,
|
|
403
|
+
"resizable=yes",
|
|
404
|
+
"scrollbars=yes",
|
|
405
|
+
"noopener=no"
|
|
406
|
+
// we need opener.postMessage to work
|
|
407
|
+
].join(",");
|
|
408
|
+
const popup = window.open(url, name, features);
|
|
409
|
+
if (!popup) {
|
|
410
|
+
throw new Error(
|
|
411
|
+
"openWebPopup: popup was blocked. Ensure this call runs inside a user gesture (click handler)."
|
|
412
|
+
);
|
|
413
|
+
}
|
|
414
|
+
let closed = false;
|
|
415
|
+
let pollId = null;
|
|
416
|
+
let messageListener = null;
|
|
417
|
+
const dispose = () => {
|
|
418
|
+
if (closed) return;
|
|
419
|
+
closed = true;
|
|
420
|
+
if (pollId !== null) {
|
|
421
|
+
clearInterval(pollId);
|
|
422
|
+
pollId = null;
|
|
423
|
+
}
|
|
424
|
+
if (messageListener) {
|
|
425
|
+
window.removeEventListener("message", messageListener);
|
|
426
|
+
messageListener = null;
|
|
427
|
+
}
|
|
428
|
+
options.onClose?.();
|
|
333
429
|
};
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
430
|
+
pollId = setInterval(() => {
|
|
431
|
+
if (popup.closed) {
|
|
432
|
+
dispose();
|
|
433
|
+
}
|
|
434
|
+
}, 500);
|
|
435
|
+
if (options.onMessage) {
|
|
436
|
+
const allowed = options.allowedOrigins ?? [];
|
|
437
|
+
const onMessage = options.onMessage;
|
|
438
|
+
messageListener = (event) => {
|
|
439
|
+
if (event.source !== popup) return;
|
|
440
|
+
if (!allowed.includes(event.origin)) return;
|
|
441
|
+
onMessage(event.data, event.origin);
|
|
442
|
+
};
|
|
443
|
+
window.addEventListener("message", messageListener);
|
|
444
|
+
}
|
|
344
445
|
return {
|
|
345
|
-
|
|
346
|
-
|
|
446
|
+
get isOpen() {
|
|
447
|
+
return !closed && !popup.closed;
|
|
448
|
+
},
|
|
449
|
+
close() {
|
|
450
|
+
if (closed) return;
|
|
451
|
+
try {
|
|
452
|
+
popup.close();
|
|
453
|
+
} catch {
|
|
454
|
+
}
|
|
455
|
+
dispose();
|
|
456
|
+
},
|
|
457
|
+
focus() {
|
|
458
|
+
if (closed || popup.closed) return;
|
|
459
|
+
try {
|
|
460
|
+
popup.focus();
|
|
461
|
+
} catch {
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
postMessage(data) {
|
|
465
|
+
if (closed || popup.closed) return;
|
|
466
|
+
try {
|
|
467
|
+
popup.postMessage(data, "*");
|
|
468
|
+
} catch {
|
|
469
|
+
}
|
|
470
|
+
}
|
|
347
471
|
};
|
|
348
472
|
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
recoverTypedDataAddress as recoverTypedDataAddress2
|
|
354
|
-
} from "viem";
|
|
355
|
-
var MOCK_BURN_CONSENT_TYPES = {
|
|
356
|
-
BurnConsent: [
|
|
357
|
-
{ name: "user", type: "address" },
|
|
358
|
-
{ name: "pointToken", type: "address" },
|
|
359
|
-
{ name: "amount", type: "uint256" },
|
|
360
|
-
{ name: "nonce", type: "uint256" },
|
|
361
|
-
{ name: "deadline", type: "uint256" }
|
|
362
|
-
]
|
|
473
|
+
var webPopupAdapter = {
|
|
474
|
+
open(url, options) {
|
|
475
|
+
return openWebPopup(url, options);
|
|
476
|
+
}
|
|
363
477
|
};
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
message
|
|
370
|
-
};
|
|
478
|
+
|
|
479
|
+
// src/web-handoff/index.ts
|
|
480
|
+
var registeredAdapter = null;
|
|
481
|
+
function setPafiWebModalAdapter(adapter) {
|
|
482
|
+
registeredAdapter = adapter;
|
|
371
483
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
account: walletClient.account,
|
|
375
|
-
domain: buildDomain(domain),
|
|
376
|
-
types: MOCK_BURN_CONSENT_TYPES,
|
|
377
|
-
primaryType: "BurnConsent",
|
|
378
|
-
message
|
|
379
|
-
});
|
|
380
|
-
const { v, r, s } = parseSignature2(serialized);
|
|
381
|
-
return {
|
|
382
|
-
v: Number(v),
|
|
383
|
-
r,
|
|
384
|
-
s,
|
|
385
|
-
serialized
|
|
386
|
-
};
|
|
484
|
+
function getPafiWebModalAdapter() {
|
|
485
|
+
return registeredAdapter;
|
|
387
486
|
}
|
|
388
|
-
async function
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
487
|
+
async function openPafiWebModal(url, options = {}) {
|
|
488
|
+
if (!url || typeof url !== "string") {
|
|
489
|
+
throw new Error("openPafiWebModal: `url` is required");
|
|
490
|
+
}
|
|
491
|
+
if (registeredAdapter) {
|
|
492
|
+
return Promise.resolve(registeredAdapter.open(url, options));
|
|
493
|
+
}
|
|
494
|
+
if (typeof window !== "undefined" && typeof window.open === "function") {
|
|
495
|
+
return openWebPopup(url, options);
|
|
496
|
+
}
|
|
497
|
+
throw new Error(
|
|
498
|
+
"openPafiWebModal: no adapter registered and `window.open` is unavailable. Call `setPafiWebModalAdapter()` with a platform-specific adapter (e.g. SFSafariViewController on iOS) during app boot."
|
|
499
|
+
);
|
|
401
500
|
}
|
|
402
501
|
|
|
403
502
|
// src/index.ts
|
|
404
503
|
var PafiSDK = class {
|
|
405
504
|
_pointTokenAddress;
|
|
406
|
-
_relayContractAddress;
|
|
407
505
|
_signer;
|
|
408
506
|
_provider;
|
|
409
507
|
_chainId;
|
|
410
508
|
constructor(config) {
|
|
411
509
|
this._pointTokenAddress = config.pointTokenAddress;
|
|
412
|
-
this._relayContractAddress = config.relayContractAddress;
|
|
413
510
|
this._signer = config.signer;
|
|
414
511
|
this._chainId = config.chainId;
|
|
415
512
|
if (config.provider) {
|
|
@@ -426,9 +523,6 @@ var PafiSDK = class {
|
|
|
426
523
|
setPointTokenAddress(address) {
|
|
427
524
|
this._pointTokenAddress = address;
|
|
428
525
|
}
|
|
429
|
-
setRelayContractAddress(address) {
|
|
430
|
-
this._relayContractAddress = address;
|
|
431
|
-
}
|
|
432
526
|
setSigner(signer) {
|
|
433
527
|
this._signer = signer;
|
|
434
528
|
}
|
|
@@ -475,18 +569,10 @@ var PafiSDK = class {
|
|
|
475
569
|
// -------------------------------------------------------------------------
|
|
476
570
|
// EIP-712 — delegates to pure functions
|
|
477
571
|
// -------------------------------------------------------------------------
|
|
478
|
-
/**
|
|
479
|
-
* Build the EIP-712 typed data for a MintRequest.
|
|
480
|
-
* Pass the result to any external signer (Privy, WalletConnect, etc.).
|
|
481
|
-
*/
|
|
482
572
|
async buildMintRequestTypedData(message) {
|
|
483
573
|
const domain = await this.getDomain();
|
|
484
574
|
return buildMintRequestTypedData(domain, message);
|
|
485
575
|
}
|
|
486
|
-
/**
|
|
487
|
-
* Build the EIP-712 typed data for a ReceiverConsent.
|
|
488
|
-
* Pass the result to any external signer (Privy, WalletConnect, etc.).
|
|
489
|
-
*/
|
|
490
576
|
async buildReceiverConsentTypedData(message) {
|
|
491
577
|
const domain = await this.getDomain();
|
|
492
578
|
return buildReceiverConsentTypedData(domain, message);
|
|
@@ -525,15 +611,6 @@ var PafiSDK = class {
|
|
|
525
611
|
);
|
|
526
612
|
}
|
|
527
613
|
// -------------------------------------------------------------------------
|
|
528
|
-
// Relay calldata — delegates to pure functions
|
|
529
|
-
// -------------------------------------------------------------------------
|
|
530
|
-
encodeMintAndSwap(mint, swap) {
|
|
531
|
-
return encodeMintAndSwap(mint, swap);
|
|
532
|
-
}
|
|
533
|
-
decodeMintAndSwap(calldata) {
|
|
534
|
-
return decodeMintAndSwap(calldata);
|
|
535
|
-
}
|
|
536
|
-
// -------------------------------------------------------------------------
|
|
537
614
|
// Quoting — delegates to pure functions
|
|
538
615
|
// -------------------------------------------------------------------------
|
|
539
616
|
/**
|
|
@@ -563,41 +640,9 @@ var PafiSDK = class {
|
|
|
563
640
|
buildSwapFromQuote(params) {
|
|
564
641
|
return buildSwapFromQuote(params);
|
|
565
642
|
}
|
|
566
|
-
/**
|
|
567
|
-
* Build Relay SwapParams + extData from a quote result.
|
|
568
|
-
* Returns ready-to-use args for `Relay.mintAndSwap`.
|
|
569
|
-
*/
|
|
570
|
-
buildRelaySwapParams(params) {
|
|
571
|
-
return buildRelaySwapParams(params);
|
|
572
|
-
}
|
|
573
|
-
/**
|
|
574
|
-
* Encode extData for ReceiverConsent and MintParams.
|
|
575
|
-
* extData = abi.encode(minAmountOut, feeInUsdt)
|
|
576
|
-
*/
|
|
577
|
-
encodeExtData(minAmountOut, feeInUsdt) {
|
|
578
|
-
return encodeExtData(minAmountOut, feeInUsdt);
|
|
579
|
-
}
|
|
580
643
|
// -------------------------------------------------------------------------
|
|
581
644
|
// Simulation — dry-run via eth_call (no gas spent)
|
|
582
645
|
// -------------------------------------------------------------------------
|
|
583
|
-
/**
|
|
584
|
-
* Simulate a Relay.mintAndSwap call. Catches reverts (bad signatures,
|
|
585
|
-
* expired deadlines, insufficient mint cap, pool errors) before submitting.
|
|
586
|
-
*
|
|
587
|
-
* @param relayAddress - Relay contract address
|
|
588
|
-
* @param mint - MintParams with real signatures
|
|
589
|
-
* @param swap - SwapParams (path + deadline)
|
|
590
|
-
* @param from - Relayer address that will submit the tx
|
|
591
|
-
*/
|
|
592
|
-
async simulateMintAndSwap(relayAddress, mint, swap, from) {
|
|
593
|
-
return simulateMintAndSwap(
|
|
594
|
-
this.requireProvider(),
|
|
595
|
-
relayAddress,
|
|
596
|
-
mint,
|
|
597
|
-
swap,
|
|
598
|
-
from
|
|
599
|
-
);
|
|
600
|
-
}
|
|
601
646
|
/**
|
|
602
647
|
* Simulate a UniversalRouter.execute swap call. Catches reverts (bad
|
|
603
648
|
* approvals, insufficient balance, pool errors) before submitting.
|
|
@@ -620,17 +665,7 @@ var PafiSDK = class {
|
|
|
620
665
|
}
|
|
621
666
|
// -------------------------------------------------------------------------
|
|
622
667
|
// Auth — EIP-4361 login helpers (offline, stateless)
|
|
623
|
-
//
|
|
624
|
-
// These are convenience wrappers around the pure functions in
|
|
625
|
-
// `./auth/loginMessage.ts`. They do NOT hit the network — the caller is
|
|
626
|
-
// responsible for fetching the nonce, POSTing the signed message, and
|
|
627
|
-
// storing the JWT returned by the issuer backend.
|
|
628
668
|
// -------------------------------------------------------------------------
|
|
629
|
-
/**
|
|
630
|
-
* Build an EIP-4361 login message for the current signer + chain. The
|
|
631
|
-
* caller supplies the issuer-specific fields (domain, nonce, uri); the SDK
|
|
632
|
-
* fills in the wallet address and chain id from its own config.
|
|
633
|
-
*/
|
|
634
669
|
async createLoginMessage(params) {
|
|
635
670
|
const signer = this.requireSigner();
|
|
636
671
|
const chainId = this.requireChainId();
|
|
@@ -653,27 +688,30 @@ var PafiSDK = class {
|
|
|
653
688
|
export {
|
|
654
689
|
ApiError,
|
|
655
690
|
BATCH_EXECUTOR_ABI,
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
691
|
+
BATCH_EXECUTOR_ADDRESS_BASE_MAINNET,
|
|
692
|
+
BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA,
|
|
693
|
+
BROKER_HASHES,
|
|
659
694
|
COMMON_POOLS,
|
|
660
695
|
COMMON_TOKENS,
|
|
661
|
-
|
|
696
|
+
CONTRACT_ADDRESSES,
|
|
662
697
|
ConfigurationError,
|
|
663
698
|
ENTRY_POINT_V07,
|
|
664
|
-
|
|
699
|
+
ORDERLY_VAULT_ABI,
|
|
700
|
+
ORDERLY_VAULT_ADDRESSES,
|
|
701
|
+
ORDERLY_VAULT_BASE_MAINNET,
|
|
702
|
+
POINT_TOKEN_FACTORY_ADDRESSES,
|
|
703
|
+
POINT_TOKEN_IMPL_ADDRESSES,
|
|
665
704
|
POINT_TOKEN_POOLS,
|
|
666
|
-
|
|
705
|
+
POINT_TOKEN_ABI as POINT_TOKEN_V2_ABI,
|
|
667
706
|
PafiSDK,
|
|
668
707
|
PafiSDKError,
|
|
669
|
-
MOCK_RELAYER_V2_ABI as RELAYER_V2_ABI,
|
|
670
|
-
MOCK_RELAYER_V2_MINT_SELECTOR as RELAYER_V2_MINT_SELECTOR,
|
|
671
708
|
SETTLE_ALL,
|
|
672
709
|
SUPPORTED_CHAINS,
|
|
673
710
|
SWAP_EXACT_IN,
|
|
674
711
|
SigningError,
|
|
675
712
|
SimulationError,
|
|
676
713
|
TAKE_ALL,
|
|
714
|
+
TOKEN_HASHES,
|
|
677
715
|
UNIVERSAL_ROUTER_ADDRESSES,
|
|
678
716
|
V4_QUOTER_ADDRESSES,
|
|
679
717
|
V4_SWAP,
|
|
@@ -681,48 +719,48 @@ export {
|
|
|
681
719
|
_resetPaymasterConfigForTests,
|
|
682
720
|
assembleUserOperation,
|
|
683
721
|
buildAllPaths,
|
|
684
|
-
|
|
722
|
+
buildBurnRequestTypedData,
|
|
685
723
|
buildDomain,
|
|
686
724
|
buildErc20ApprovalCalldata,
|
|
687
725
|
buildMintRequestTypedData,
|
|
688
|
-
buildMockMintRequestV2TypedData as buildMintRequestV2TypedData,
|
|
689
726
|
buildPartialUserOperation,
|
|
690
727
|
buildPermit2ApprovalCalldata,
|
|
728
|
+
buildPerpDepositWithGasDeduction,
|
|
691
729
|
buildReceiverConsentTypedData,
|
|
692
|
-
buildRelaySwapParams,
|
|
693
730
|
buildSwapFromQuote,
|
|
731
|
+
buildSwapWithGasDeduction,
|
|
694
732
|
buildUniversalRouterExecuteArgs,
|
|
695
733
|
buildV4SwapInput,
|
|
734
|
+
burnRequestTypes,
|
|
696
735
|
checkAllowance,
|
|
697
736
|
checkEthAndBranch,
|
|
698
737
|
combineRoutes,
|
|
738
|
+
computeAccountId,
|
|
699
739
|
createLoginMessage,
|
|
700
|
-
decodeExtData,
|
|
701
|
-
decodeMintAndSwap,
|
|
702
740
|
encodeBatchExecute,
|
|
703
|
-
encodeExtData,
|
|
704
|
-
encodeMintAndSwap,
|
|
705
741
|
erc20Abi,
|
|
706
742
|
erc20ApproveOp,
|
|
707
743
|
erc20BurnOp,
|
|
708
744
|
erc20TransferOp,
|
|
709
745
|
findBestQuote,
|
|
710
|
-
|
|
746
|
+
getContractAddresses,
|
|
711
747
|
getIssuer2 as getIssuer,
|
|
712
748
|
getMintRequestNonce,
|
|
749
|
+
getPafiWebModalAdapter,
|
|
713
750
|
getPaymasterConfig,
|
|
714
751
|
getPointTokenBalance,
|
|
715
752
|
getPointTokenIssuer,
|
|
716
753
|
getIssuer as getPointTokenIssuerAddress,
|
|
717
754
|
getReceiverConsentNonce,
|
|
718
755
|
getTokenName,
|
|
719
|
-
getUsdt,
|
|
720
756
|
isActiveIssuer,
|
|
721
757
|
isMinter,
|
|
722
758
|
isPaymasterConfigured,
|
|
723
759
|
issuerRegistryAbi,
|
|
724
760
|
mintRequestTypes,
|
|
725
761
|
mintingOracleAbi,
|
|
762
|
+
openPafiWebModal,
|
|
763
|
+
openWebPopup,
|
|
726
764
|
parseLoginMessage,
|
|
727
765
|
permit2Abi,
|
|
728
766
|
pointTokenAbi,
|
|
@@ -732,21 +770,19 @@ export {
|
|
|
732
770
|
quoteExactInputSingle,
|
|
733
771
|
rawCallOp,
|
|
734
772
|
receiverConsentTypes,
|
|
735
|
-
|
|
773
|
+
setPafiWebModalAdapter,
|
|
736
774
|
setPaymasterConfig,
|
|
737
|
-
|
|
775
|
+
signBurnRequest,
|
|
738
776
|
signMintRequest,
|
|
739
|
-
signMockMintRequestV2 as signMintRequestV2,
|
|
740
777
|
signReceiverConsent,
|
|
741
|
-
simulateMintAndSwap,
|
|
742
778
|
simulateSwap,
|
|
743
779
|
universalRouterAbi,
|
|
744
780
|
v4QuoterAbi,
|
|
745
|
-
|
|
781
|
+
verifyBurnRequest,
|
|
746
782
|
verifyLoginMessage,
|
|
747
783
|
verifyMintCap,
|
|
748
784
|
verifyMintRequest,
|
|
749
|
-
|
|
750
|
-
|
|
785
|
+
verifyReceiverConsent,
|
|
786
|
+
webPopupAdapter
|
|
751
787
|
};
|
|
752
788
|
//# sourceMappingURL=index.js.map
|