@pafi-dev/core 0.25.1 → 0.25.2
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/{chunk-3ZT7KTN4.cjs → chunk-F7IKZKZX.cjs} +23 -6
- package/dist/chunk-F7IKZKZX.cjs.map +1 -0
- package/dist/{chunk-K4GBOB5V.js → chunk-MOTNU74I.js} +23 -6
- package/dist/chunk-MOTNU74I.js.map +1 -0
- package/dist/eip712/index.cjs +2 -2
- package/dist/eip712/index.js +1 -1
- package/dist/index.cjs +158 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +91 -5
- package/dist/index.d.ts +91 -5
- package/dist/index.js +146 -18
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-3ZT7KTN4.cjs.map +0 -1
- package/dist/chunk-K4GBOB5V.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var _chunk2DVM77Y2cjs = require('./chunk-2DVM77Y2.cjs');
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
|
|
16
15
|
|
|
16
|
+
var _chunkQFBHBFEYcjs = require('./chunk-QFBHBFEY.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
@@ -25,7 +25,7 @@ var _chunk2DVM77Y2cjs = require('./chunk-2DVM77Y2.cjs');
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _chunk2DVM77Y2cjs = require('./chunk-2DVM77Y2.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
@@ -74,7 +74,7 @@ var _chunk2CU7ZH2Acjs = require('./chunk-2CU7ZH2A.cjs');
|
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
|
|
77
|
-
var
|
|
77
|
+
var _chunkF7IKZKZXcjs = require('./chunk-F7IKZKZX.cjs');
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
var _chunk245YA3CQcjs = require('./chunk-245YA3CQ.cjs');
|
|
@@ -203,7 +203,11 @@ var ValidationError = (_class7 = class extends PafiSdkError {
|
|
|
203
203
|
|
|
204
204
|
var ORDERLY_VAULT_BASE_MAINNET = "0x816f722424B49Cf1275cc86DA9840Fbd5a6167e9";
|
|
205
205
|
var ORDERLY_VAULT_ADDRESSES = {
|
|
206
|
-
8453: ORDERLY_VAULT_BASE_MAINNET
|
|
206
|
+
8453: ORDERLY_VAULT_BASE_MAINNET,
|
|
207
|
+
// Arbitrum One (42161) — Orderly perp path is KEPT on the Arbitrum move.
|
|
208
|
+
// Orderly's Vault Proxy is deployed at the SAME address on Arbitrum as on
|
|
209
|
+
// Base (verified on-chain: 2882 bytes at this address on Arbitrum One).
|
|
210
|
+
42161: "0x816f722424B49Cf1275cc86DA9840Fbd5a6167e9"
|
|
207
211
|
};
|
|
208
212
|
var BROKER_HASHES = {
|
|
209
213
|
/** Default partner broker on Base — most commonly whitelisted. */
|
|
@@ -620,6 +624,70 @@ function buildPerpDepositViaRelay(params) {
|
|
|
620
624
|
});
|
|
621
625
|
}
|
|
622
626
|
|
|
627
|
+
// src/perp/buildAsterDeposit.ts
|
|
628
|
+
|
|
629
|
+
var ASTER_DEPOSIT_ABI = [
|
|
630
|
+
{
|
|
631
|
+
type: "function",
|
|
632
|
+
name: "deposit",
|
|
633
|
+
stateMutability: "nonpayable",
|
|
634
|
+
inputs: [
|
|
635
|
+
{ name: "token", type: "address" },
|
|
636
|
+
{ name: "amount", type: "uint256" },
|
|
637
|
+
{ name: "broker", type: "uint256" }
|
|
638
|
+
],
|
|
639
|
+
outputs: []
|
|
640
|
+
}
|
|
641
|
+
];
|
|
642
|
+
var ASTER_DEPOSIT_SELECTOR = _viem.toFunctionSelector.call(void 0,
|
|
643
|
+
ASTER_DEPOSIT_ABI[0]
|
|
644
|
+
);
|
|
645
|
+
var ASTER_BROKER_IDS = {
|
|
646
|
+
42161: 0n
|
|
647
|
+
// TBD — PAFI Aster broker id
|
|
648
|
+
};
|
|
649
|
+
function getAsterBrokerId(chainId) {
|
|
650
|
+
return _nullishCoalesce(ASTER_BROKER_IDS[chainId], () => ( 0n));
|
|
651
|
+
}
|
|
652
|
+
function buildAsterDeposit(params) {
|
|
653
|
+
if (params.amount <= 0n) {
|
|
654
|
+
throw new Error("buildAsterDeposit: amount must be positive");
|
|
655
|
+
}
|
|
656
|
+
if (!params.bridgeAddress) {
|
|
657
|
+
throw new Error("buildAsterDeposit: bridgeAddress required");
|
|
658
|
+
}
|
|
659
|
+
const operations = [];
|
|
660
|
+
if (params.gasFee && params.gasFee > 0n) {
|
|
661
|
+
if (!params.gasFeeRecipient) {
|
|
662
|
+
throw new Error(
|
|
663
|
+
"buildAsterDeposit: gasFeeRecipient required when gasFee > 0"
|
|
664
|
+
);
|
|
665
|
+
}
|
|
666
|
+
operations.push(
|
|
667
|
+
erc20TransferOp(params.token, params.gasFeeRecipient, params.gasFee)
|
|
668
|
+
);
|
|
669
|
+
}
|
|
670
|
+
operations.push(
|
|
671
|
+
erc20ApproveOp(params.token, params.bridgeAddress, params.amount)
|
|
672
|
+
);
|
|
673
|
+
const depositCallData = _viem.encodeFunctionData.call(void 0, {
|
|
674
|
+
abi: ASTER_DEPOSIT_ABI,
|
|
675
|
+
functionName: "deposit",
|
|
676
|
+
args: [params.token, params.amount, params.broker]
|
|
677
|
+
});
|
|
678
|
+
operations.push(rawCallOp(params.bridgeAddress, depositCallData));
|
|
679
|
+
return buildPartialUserOperation({
|
|
680
|
+
sender: params.userAddress,
|
|
681
|
+
nonce: params.aaNonce,
|
|
682
|
+
operations,
|
|
683
|
+
gasLimits: {
|
|
684
|
+
callGasLimit: _nullishCoalesce(_optionalChain([params, 'access', _25 => _25.gasLimits, 'optionalAccess', _26 => _26.callGasLimit]), () => ( 600000n)),
|
|
685
|
+
verificationGasLimit: _nullishCoalesce(_optionalChain([params, 'access', _27 => _27.gasLimits, 'optionalAccess', _28 => _28.verificationGasLimit]), () => ( 150000n)),
|
|
686
|
+
preVerificationGas: _nullishCoalesce(_optionalChain([params, 'access', _29 => _29.gasLimits, 'optionalAccess', _30 => _30.preVerificationGas]), () => ( 50000n))
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
|
|
623
691
|
// src/transfer/buildErc20Transfer.ts
|
|
624
692
|
function buildErc20TransferUserOp(params) {
|
|
625
693
|
if (params.amount <= 0n) {
|
|
@@ -650,9 +718,9 @@ function buildErc20TransferUserOp(params) {
|
|
|
650
718
|
gasLimits: {
|
|
651
719
|
// 2 simple ERC-20 transfers + 7702 batch overhead. ~70-90k actual;
|
|
652
720
|
// 200k matches the `delegate` scenario budget and covers premium.
|
|
653
|
-
callGasLimit: _nullishCoalesce(_optionalChain([params, 'access',
|
|
654
|
-
verificationGasLimit: _nullishCoalesce(_optionalChain([params, 'access',
|
|
655
|
-
preVerificationGas: _nullishCoalesce(_optionalChain([params, 'access',
|
|
721
|
+
callGasLimit: _nullishCoalesce(_optionalChain([params, 'access', _31 => _31.gasLimits, 'optionalAccess', _32 => _32.callGasLimit]), () => ( 200000n)),
|
|
722
|
+
verificationGasLimit: _nullishCoalesce(_optionalChain([params, 'access', _33 => _33.gasLimits, 'optionalAccess', _34 => _34.verificationGasLimit]), () => ( 150000n)),
|
|
723
|
+
preVerificationGas: _nullishCoalesce(_optionalChain([params, 'access', _35 => _35.gasLimits, 'optionalAccess', _36 => _36.preVerificationGas]), () => ( 50000n))
|
|
656
724
|
}
|
|
657
725
|
});
|
|
658
726
|
}
|
|
@@ -693,7 +761,7 @@ function computeUserOpHash(userOp, chainId) {
|
|
|
693
761
|
} : {};
|
|
694
762
|
return _accountabstraction.getUserOperationHash.call(void 0, {
|
|
695
763
|
chainId,
|
|
696
|
-
entryPointAddress:
|
|
764
|
+
entryPointAddress: _chunkF7IKZKZXcjs.ENTRY_POINT_V07,
|
|
697
765
|
entryPointVersion: "0.7",
|
|
698
766
|
userOperation: {
|
|
699
767
|
sender: userOp.sender,
|
|
@@ -835,7 +903,7 @@ async function getAaNonce(client, userAddress) {
|
|
|
835
903
|
}
|
|
836
904
|
];
|
|
837
905
|
return client.readContract({
|
|
838
|
-
address:
|
|
906
|
+
address: _chunkF7IKZKZXcjs.ENTRY_POINT_V07,
|
|
839
907
|
abi: NONCE_ABI,
|
|
840
908
|
functionName: "getNonce",
|
|
841
909
|
args: [userAddress, 0n]
|
|
@@ -896,6 +964,7 @@ function buildEip7702Authorization(params) {
|
|
|
896
964
|
|
|
897
965
|
// src/contracts/real/addresses.ts
|
|
898
966
|
var PLACEHOLDER_DEAD = (suffix) => `0x000000000000000000000000000000000000${suffix.toLowerCase().padStart(4, "0")}`;
|
|
967
|
+
var TBD_ARBITRUM = "0x0000000000000000000000000000000000000000";
|
|
899
968
|
var CONTRACT_ADDRESSES = {
|
|
900
969
|
// ──────────────────────────────────────────────────────────────────
|
|
901
970
|
// Base mainnet (8453) — V2 dual-bucket deploy 2026-06-12
|
|
@@ -972,27 +1041,72 @@ var CONTRACT_ADDRESSES = {
|
|
|
972
1041
|
vaultRegistry: PLACEHOLDER_DEAD("de08"),
|
|
973
1042
|
vaultFactory: PLACEHOLDER_DEAD("de09"),
|
|
974
1043
|
pointModuleCore: PLACEHOLDER_DEAD("de0a")
|
|
1044
|
+
},
|
|
1045
|
+
// ──────────────────────────────────────────────────────────────────
|
|
1046
|
+
// Arbitrum One (42161) — PAFI SC (re)deploy target (2026-07-03).
|
|
1047
|
+
// Aster deposit is same-chain here (no bridge). Researched/canonical
|
|
1048
|
+
// fields are FINAL; PAFI-deployed fields are TBD_ARBITRUM until the SC
|
|
1049
|
+
// team sends the Arbitrum addresses. See docs/ARBITRUM_ADDRESSES.md.
|
|
1050
|
+
// ──────────────────────────────────────────────────────────────────
|
|
1051
|
+
42161: {
|
|
1052
|
+
// ── Researched / canonical (FINAL) ────────────────────────────
|
|
1053
|
+
// Kernel v3.3 impl — CREATE2-deterministic, identical on every chain.
|
|
1054
|
+
kernel: "0xd6CEDDe84be40893d153Be9d467CD6aD37875b28",
|
|
1055
|
+
// Arbitrum USDT is now "USDT0" (LayerZero OFT), 6 decimals — also the
|
|
1056
|
+
// token Aster deposits accept on Arbitrum.
|
|
1057
|
+
usdt: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
|
|
1058
|
+
// Native Circle USDC on Arbitrum, 6 decimals.
|
|
1059
|
+
usdc: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
|
|
1060
|
+
chainlinkEthUsd: "0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612",
|
|
1061
|
+
chainlinkUsdcUsd: "0x50834F3163758fcC1Df9973b6e91f0F0F0434aD3",
|
|
1062
|
+
// Aster "Deposit Bridge" on Arbitrum (labelled on Arbiscan). Users
|
|
1063
|
+
// deposit USDT here to fund their Aster perp account. FINAL.
|
|
1064
|
+
asterDepositBridge: "0x9E36CB86a159d479cEd94Fa05036f235Ac40E1d5",
|
|
1065
|
+
// ── PAFI-deployed (TBD — awaiting SC team Arbitrum deploy) ─────
|
|
1066
|
+
issuerRegistry: TBD_ARBITRUM,
|
|
1067
|
+
mintingOracle: TBD_ARBITRUM,
|
|
1068
|
+
mintFeeWrapper: TBD_ARBITRUM,
|
|
1069
|
+
tokenRegistry: TBD_ARBITRUM,
|
|
1070
|
+
vaultRegistry: TBD_ARBITRUM,
|
|
1071
|
+
vaultFactory: TBD_ARBITRUM,
|
|
1072
|
+
pointModuleCore: TBD_ARBITRUM,
|
|
1073
|
+
// Only if the Orderly perp path is kept on Arbitrum (else remove).
|
|
1074
|
+
orderlyRelay: TBD_ARBITRUM,
|
|
1075
|
+
// PAFI-controlled fee recipient — confirm whether Base EOA is reused.
|
|
1076
|
+
pafiFeeRecipient: TBD_ARBITRUM,
|
|
1077
|
+
// PAFI V3-fork UniversalRouter + its paired fork Permit2 — NOT the
|
|
1078
|
+
// canonical Arbitrum UR / canonical Permit2 (0x0000…22D473).
|
|
1079
|
+
universalRouter: TBD_ARBITRUM,
|
|
1080
|
+
permit2: TBD_ARBITRUM
|
|
975
1081
|
}
|
|
976
1082
|
};
|
|
977
1083
|
var POINT_TOKEN_FACTORY_ADDRESSES = {
|
|
978
1084
|
// V2 dual-bucket factory (2026-06-12). Replaces v1.6 factory
|
|
979
1085
|
// `0xA08274458b43E7D6F4ff61ddFe8A9852c6531085`.
|
|
980
1086
|
8453: "0x34f9F84841A77A19040686396b8B64522A2da4c8",
|
|
981
|
-
84532: PLACEHOLDER_DEAD("dead")
|
|
1087
|
+
84532: PLACEHOLDER_DEAD("dead"),
|
|
1088
|
+
42161: TBD_ARBITRUM
|
|
1089
|
+
// Arbitrum PAFI deploy — SC team
|
|
982
1090
|
};
|
|
983
1091
|
var POINT_TOKEN_IMPL_ADDRESSES = {
|
|
984
1092
|
// V2 dual-bucket impl (2026-06-12). Replaces v1.6 impl
|
|
985
1093
|
// `0xc41c3F8A0380c7760Ee1209d6d19C4b81dE994e4` (single-bucket).
|
|
986
1094
|
8453: "0x067d2d82F7cfbAf9bBA1f493167cC6043eD5d7dd",
|
|
987
|
-
84532: PLACEHOLDER_DEAD("dead")
|
|
1095
|
+
84532: PLACEHOLDER_DEAD("dead"),
|
|
1096
|
+
42161: TBD_ARBITRUM
|
|
1097
|
+
// Arbitrum PAFI deploy — SC team
|
|
988
1098
|
};
|
|
989
1099
|
var POINT_TOKEN_BEACON_ADDRESSES = {
|
|
990
1100
|
8453: "0xdC479E294FD12658FDC68B9400c2073De291acf3",
|
|
991
|
-
84532: PLACEHOLDER_DEAD("dead")
|
|
1101
|
+
84532: PLACEHOLDER_DEAD("dead"),
|
|
1102
|
+
42161: TBD_ARBITRUM
|
|
1103
|
+
// Arbitrum PAFI deploy — SC team
|
|
992
1104
|
};
|
|
993
1105
|
var VAULT_BEACON_ADDRESSES = {
|
|
994
1106
|
8453: "0x4E583d64bfcCD86dFf1f68b792D5a1Cd169f22eB",
|
|
995
|
-
84532: PLACEHOLDER_DEAD("dead")
|
|
1107
|
+
84532: PLACEHOLDER_DEAD("dead"),
|
|
1108
|
+
42161: TBD_ARBITRUM
|
|
1109
|
+
// Arbitrum PAFI deploy — SC team
|
|
996
1110
|
};
|
|
997
1111
|
function getContractAddresses(chainId) {
|
|
998
1112
|
const addrs = CONTRACT_ADDRESSES[chainId];
|
|
@@ -1069,7 +1183,7 @@ async function delegateDirect(params) {
|
|
|
1069
1183
|
hash: txHash
|
|
1070
1184
|
});
|
|
1071
1185
|
} catch (err) {
|
|
1072
|
-
_optionalChain([params, 'access',
|
|
1186
|
+
_optionalChain([params, 'access', _37 => _37.onWarning, 'optionalCall', _38 => _38(
|
|
1073
1187
|
`delegateDirect: tx ${txHash} sent but receipt fetch failed: ${err instanceof Error ? err.message : String(err)}`
|
|
1074
1188
|
)]);
|
|
1075
1189
|
}
|
|
@@ -1137,7 +1251,7 @@ function createPafiProxyTransport(params) {
|
|
|
1137
1251
|
// fetchFn intercepts every fetch call the viem http transport makes,
|
|
1138
1252
|
// injecting the auth headers before the request leaves the browser.
|
|
1139
1253
|
fetchFn: (input, init) => {
|
|
1140
|
-
const headers = new Headers(_optionalChain([init, 'optionalAccess',
|
|
1254
|
+
const headers = new Headers(_optionalChain([init, 'optionalAccess', _39 => _39.headers]));
|
|
1141
1255
|
const token = getIdentityToken();
|
|
1142
1256
|
if (token) {
|
|
1143
1257
|
headers.set("authorization", `Bearer ${token}`);
|
|
@@ -1161,7 +1275,7 @@ var PAYMASTER_PATTERNS = [
|
|
|
1161
1275
|
function isPaymasterError(err) {
|
|
1162
1276
|
if (err == null || typeof err !== "object") return false;
|
|
1163
1277
|
const e = err;
|
|
1164
|
-
const status = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(e.status, () => ( e.statusCode)), () => ( _optionalChain([e, 'access',
|
|
1278
|
+
const status = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(e.status, () => ( e.statusCode)), () => ( _optionalChain([e, 'access', _40 => _40.response, 'optionalAccess', _41 => _41.status]))), () => ( _optionalChain([e, 'access', _42 => _42.cause, 'optionalAccess', _43 => _43.status])));
|
|
1165
1279
|
if (typeof status === "number" && PAYMASTER_HTTP_STATUSES.has(status)) {
|
|
1166
1280
|
return true;
|
|
1167
1281
|
}
|
|
@@ -1174,8 +1288,8 @@ async function sendWithPaymasterFallback(params) {
|
|
|
1174
1288
|
return await primaryClient.sendTransaction(txParams);
|
|
1175
1289
|
} catch (err) {
|
|
1176
1290
|
if (isPaymasterError(err) && fallbackClient) {
|
|
1177
|
-
const msg = _nullishCoalesce(_optionalChain([err, 'optionalAccess',
|
|
1178
|
-
_optionalChain([onFallback, 'optionalCall',
|
|
1291
|
+
const msg = _nullishCoalesce(_optionalChain([err, 'optionalAccess', _44 => _44.message]), () => ( String(err)));
|
|
1292
|
+
_optionalChain([onFallback, 'optionalCall', _45 => _45(msg)]);
|
|
1179
1293
|
return await fallbackClient.sendTransaction(_nullishCoalesce(txParamsFallback, () => ( txParams)));
|
|
1180
1294
|
}
|
|
1181
1295
|
throw err;
|
|
@@ -1240,7 +1354,7 @@ async function fetchPafiPools(_chainId, pointTokenAddress, subgraphUrl = PAFI_SU
|
|
|
1240
1354
|
);
|
|
1241
1355
|
return [];
|
|
1242
1356
|
}
|
|
1243
|
-
const pool = _optionalChain([json, 'access',
|
|
1357
|
+
const pool = _optionalChain([json, 'access', _46 => _46.data, 'optionalAccess', _47 => _47.pafiToken, 'optionalAccess', _48 => _48.pool]);
|
|
1244
1358
|
if (!pool) return [];
|
|
1245
1359
|
if (!_viem.isAddress.call(void 0, pool.token0.id) || !_viem.isAddress.call(void 0, pool.token1.id) || !Number.isFinite(Number(pool.feeTier))) {
|
|
1246
1360
|
console.error("[fetchPafiPools] invalid pool data in subgraph response \u2014 skipping");
|
|
@@ -1279,6 +1393,9 @@ var SCENARIO_GAS_UNITS = {
|
|
|
1279
1393
|
burn: 500000n,
|
|
1280
1394
|
swap: 700000n,
|
|
1281
1395
|
"perp-deposit": 800000n,
|
|
1396
|
+
// Aster deposit is same-chain (no Orderly LayerZero msg.value hop) — a
|
|
1397
|
+
// plain [fee, approve, bridge.deposit] batch, so cheaper than perp-deposit.
|
|
1398
|
+
"aster-deposit": 600000n,
|
|
1282
1399
|
delegate: 200000n,
|
|
1283
1400
|
// 2-call batch: 1 ERC-20 fee transfer + 1 ERC-20 transfer + 7702
|
|
1284
1401
|
// delegation overhead. ~70-90k empirical; 200k matches `delegate`
|
|
@@ -1427,10 +1544,10 @@ async function getPtPerUsdt18dec(fetchImpl, subgraphUrl, pointTokenAddress, fall
|
|
|
1427
1544
|
});
|
|
1428
1545
|
if (!response.ok) throw new Error(`subgraph HTTP ${response.status}`);
|
|
1429
1546
|
const json = await response.json();
|
|
1430
|
-
if (_optionalChain([json, 'access',
|
|
1547
|
+
if (_optionalChain([json, 'access', _49 => _49.errors, 'optionalAccess', _50 => _50.length])) {
|
|
1431
1548
|
throw new Error(json.errors.map((e) => e.message).join("; "));
|
|
1432
1549
|
}
|
|
1433
|
-
const pool = _optionalChain([json, 'access',
|
|
1550
|
+
const pool = _optionalChain([json, 'access', _51 => _51.data, 'optionalAccess', _52 => _52.pafiToken, 'optionalAccess', _53 => _53.pool]);
|
|
1434
1551
|
if (!pool) throw new Error("pafiToken or pool not found");
|
|
1435
1552
|
const isPtToken0 = pool.token0.id.toLowerCase() === pointTokenAddress.toLowerCase();
|
|
1436
1553
|
let ptPerUsdtHumanStr;
|
|
@@ -1548,6 +1665,12 @@ var PAFI_SERVICE_URLS = {
|
|
|
1548
1665
|
84532: {
|
|
1549
1666
|
sponsorRelayer: "https://api-dev.pacificfinance.org/api/sponsor",
|
|
1550
1667
|
issuerApi: "https://api-dev.pacificfinance.org/api/issuer"
|
|
1668
|
+
},
|
|
1669
|
+
// Arbitrum One — same Kong host, path-routed (chain lives in the ZeroDev
|
|
1670
|
+
// forward URL, not the PAFI service URL). Swap to prod hosts when live.
|
|
1671
|
+
42161: {
|
|
1672
|
+
sponsorRelayer: "https://api-dev.pacificfinance.org/api/sponsor",
|
|
1673
|
+
issuerApi: "https://api-dev.pacificfinance.org/api/issuer"
|
|
1551
1674
|
}
|
|
1552
1675
|
};
|
|
1553
1676
|
function getPafiServiceUrls(chainId, overrides) {
|
|
@@ -1558,10 +1681,10 @@ function getPafiServiceUrls(chainId, overrides) {
|
|
|
1558
1681
|
);
|
|
1559
1682
|
}
|
|
1560
1683
|
const cleanOverrides = {};
|
|
1561
|
-
if (_optionalChain([overrides, 'optionalAccess',
|
|
1684
|
+
if (_optionalChain([overrides, 'optionalAccess', _54 => _54.sponsorRelayer])) {
|
|
1562
1685
|
cleanOverrides.sponsorRelayer = overrides.sponsorRelayer;
|
|
1563
1686
|
}
|
|
1564
|
-
if (_optionalChain([overrides, 'optionalAccess',
|
|
1687
|
+
if (_optionalChain([overrides, 'optionalAccess', _55 => _55.issuerApi])) {
|
|
1565
1688
|
cleanOverrides.issuerApi = overrides.issuerApi;
|
|
1566
1689
|
}
|
|
1567
1690
|
return { ...defaults, ...cleanOverrides };
|
|
@@ -1580,8 +1703,8 @@ function openWebPopup(url, options = {}) {
|
|
|
1580
1703
|
const width = _nullishCoalesce(options.width, () => ( DEFAULT_WIDTH));
|
|
1581
1704
|
const height = _nullishCoalesce(options.height, () => ( DEFAULT_HEIGHT));
|
|
1582
1705
|
const name = _nullishCoalesce(options.windowName, () => ( DEFAULT_NAME));
|
|
1583
|
-
const screenW = _nullishCoalesce(_optionalChain([window, 'access',
|
|
1584
|
-
const screenH = _nullishCoalesce(_optionalChain([window, 'access',
|
|
1706
|
+
const screenW = _nullishCoalesce(_optionalChain([window, 'access', _56 => _56.screen, 'optionalAccess', _57 => _57.availWidth]), () => ( window.innerWidth));
|
|
1707
|
+
const screenH = _nullishCoalesce(_optionalChain([window, 'access', _58 => _58.screen, 'optionalAccess', _59 => _59.availHeight]), () => ( window.innerHeight));
|
|
1585
1708
|
const left = Math.max(0, Math.floor((screenW - width) / 2));
|
|
1586
1709
|
const top = Math.max(0, Math.floor((screenH - height) / 2));
|
|
1587
1710
|
const features = [
|
|
@@ -1614,7 +1737,7 @@ function openWebPopup(url, options = {}) {
|
|
|
1614
1737
|
window.removeEventListener("message", messageListener);
|
|
1615
1738
|
messageListener = null;
|
|
1616
1739
|
}
|
|
1617
|
-
_optionalChain([options, 'access',
|
|
1740
|
+
_optionalChain([options, 'access', _60 => _60.onClose, 'optionalCall', _61 => _61()]);
|
|
1618
1741
|
};
|
|
1619
1742
|
pollId = setInterval(() => {
|
|
1620
1743
|
if (popup.closed) {
|
|
@@ -1782,15 +1905,15 @@ var PafiSDK = class {
|
|
|
1782
1905
|
// -------------------------------------------------------------------------
|
|
1783
1906
|
async buildMintRequestTypedData(message) {
|
|
1784
1907
|
const domain = await this.getDomain();
|
|
1785
|
-
return
|
|
1908
|
+
return _chunkF7IKZKZXcjs.buildMintRequestTypedData.call(void 0, domain, message);
|
|
1786
1909
|
}
|
|
1787
1910
|
async signMintRequest(message) {
|
|
1788
1911
|
const domain = await this.getDomain();
|
|
1789
|
-
return
|
|
1912
|
+
return _chunkF7IKZKZXcjs.signMintRequest.call(void 0, this.requireSigner(), domain, message);
|
|
1790
1913
|
}
|
|
1791
1914
|
async verifyMintRequest(message, signature, expectedMinter, options) {
|
|
1792
1915
|
const domain = await this.getDomain();
|
|
1793
|
-
return
|
|
1916
|
+
return _chunkF7IKZKZXcjs.verifyMintRequest.call(void 0,
|
|
1794
1917
|
domain,
|
|
1795
1918
|
message,
|
|
1796
1919
|
signature,
|
|
@@ -1979,5 +2102,10 @@ var PafiSDK = class {
|
|
|
1979
2102
|
|
|
1980
2103
|
|
|
1981
2104
|
|
|
1982
|
-
|
|
2105
|
+
|
|
2106
|
+
|
|
2107
|
+
|
|
2108
|
+
|
|
2109
|
+
|
|
2110
|
+
exports.ASTER_BROKER_IDS = ASTER_BROKER_IDS; exports.ASTER_DEPOSIT_ABI = ASTER_DEPOSIT_ABI; exports.ASTER_DEPOSIT_SELECTOR = ASTER_DEPOSIT_SELECTOR; exports.ApiError = ApiError; exports.BROKER_HASHES = BROKER_HASHES; exports.COMMON_POOLS = _chunkF7IKZKZXcjs.COMMON_POOLS; exports.COMMON_TOKENS = _chunkF7IKZKZXcjs.COMMON_TOKENS; exports.CONTRACT_ADDRESSES = CONTRACT_ADDRESSES; exports.ConfigurationError = ConfigurationError; exports.DUMMY_SIGNATURE_V07 = DUMMY_SIGNATURE_V07; exports.ENTRY_POINT_V07 = _chunkF7IKZKZXcjs.ENTRY_POINT_V07; exports.ENTRY_POINT_V08 = _chunkF7IKZKZXcjs.ENTRY_POINT_V08; exports.Eip712DomainMismatchError = _chunkF7IKZKZXcjs.Eip712DomainMismatchError; exports.KERNEL_ADDRESS_BASE_MAINNET = KERNEL_ADDRESS_BASE_MAINNET; exports.KERNEL_ADDRESS_BASE_SEPOLIA = KERNEL_ADDRESS_BASE_SEPOLIA; exports.KERNEL_EXECUTE_ABI = KERNEL_EXECUTE_ABI; exports.KERNEL_EXECUTE_SELECTOR = KERNEL_EXECUTE_SELECTOR; exports.KERNEL_EXECUTE_USEROP_SELECTOR = KERNEL_EXECUTE_USEROP_SELECTOR; exports.KERNEL_V3_3_IMPL = KERNEL_V3_3_IMPL; exports.ORDERLY_RELAY_ABI = ORDERLY_RELAY_ABI; exports.ORDERLY_VAULT_ABI = ORDERLY_VAULT_ABI; exports.ORDERLY_VAULT_ADDRESSES = ORDERLY_VAULT_ADDRESSES; exports.ORDERLY_VAULT_BASE_MAINNET = ORDERLY_VAULT_BASE_MAINNET; exports.OracleStaleError = OracleStaleError; exports.PAFI_SERVICE_URLS = PAFI_SERVICE_URLS; exports.PAFI_SUBGRAPH_URL = PAFI_SUBGRAPH_URL; exports.PERMIT2_ADDRESS = _chunkF7IKZKZXcjs.PERMIT2_ADDRESS; exports.POINT_TOKEN_ABI = POINT_TOKEN_ABI; exports.POINT_TOKEN_BEACON_ADDRESSES = POINT_TOKEN_BEACON_ADDRESSES; exports.POINT_TOKEN_BURN_SIG_ABI = POINT_TOKEN_BURN_SIG_ABI; exports.POINT_TOKEN_FACTORY_ADDRESSES = POINT_TOKEN_FACTORY_ADDRESSES; exports.POINT_TOKEN_IMPL_ADDRESSES = POINT_TOKEN_IMPL_ADDRESSES; exports.POINT_TOKEN_MINT_SIG_ABI = POINT_TOKEN_MINT_SIG_ABI; exports.POINT_TOKEN_POOLS = _chunkF7IKZKZXcjs.POINT_TOKEN_POOLS; exports.PafiSDK = PafiSDK; exports.PafiSdkError = PafiSdkError; exports.QUOTER_V2_ADDRESSES = _chunkF7IKZKZXcjs.QUOTER_V2_ADDRESSES; exports.SCENARIO_GAS_UNITS = SCENARIO_GAS_UNITS; exports.SDK_ERROR_HTTP_STATUS_CODE = SDK_ERROR_HTTP_STATUS_CODE; exports.SPONSOR_AUTH_DOMAIN_ANCHOR_BASE_MAINNET = _chunkQFBHBFEYcjs.SPONSOR_AUTH_DOMAIN_ANCHOR_BASE_MAINNET; exports.SPONSOR_AUTH_DOMAIN_NAME = _chunkQFBHBFEYcjs.SPONSOR_AUTH_DOMAIN_NAME; exports.SPONSOR_AUTH_TYPES = _chunkQFBHBFEYcjs.SPONSOR_AUTH_TYPES; exports.SUPPORTED_CHAINS = _chunkF7IKZKZXcjs.SUPPORTED_CHAINS; exports.SigningError = SigningError; exports.SimulationError = SimulationError; exports.Source = _chunkDQKCPH6Bcjs.Source; exports.TOKEN_HASHES = TOKEN_HASHES; exports.UNIVERSAL_ROUTER_ADDRESSES = _chunkF7IKZKZXcjs.UNIVERSAL_ROUTER_ADDRESSES; exports.V3_FACTORY_ADDRESSES = _chunkF7IKZKZXcjs.V3_FACTORY_ADDRESSES; exports.V3_POOL_INIT_CODE_HASH = _chunkF7IKZKZXcjs.V3_POOL_INIT_CODE_HASH; exports.V3_SWAP_ROUTER_ADDRESSES = _chunkF7IKZKZXcjs.V3_SWAP_ROUTER_ADDRESSES; exports.VAULT_BEACON_ADDRESSES = VAULT_BEACON_ADDRESSES; exports.ValidationError = ValidationError; exports.ZERO_VALUE = ZERO_VALUE; exports.assembleUserOperation = assembleUserOperation; exports.assertDomainMatchesContract = _chunkF7IKZKZXcjs.assertDomainMatchesContract; exports.attachDelegationIfNeeded = attachDelegationIfNeeded; exports.buildAndSignSponsorAuth = _chunkQFBHBFEYcjs.buildAndSignSponsorAuth; exports.buildAsterDeposit = buildAsterDeposit; exports.buildBurnRequestTypedData = _chunkF7IKZKZXcjs.buildBurnRequestTypedData; exports.buildDomain = _chunkF7IKZKZXcjs.buildDomain; exports.buildEip7702Authorization = buildEip7702Authorization; exports.buildErc20TransferUserOp = buildErc20TransferUserOp; exports.buildMintRequestTypedData = _chunkF7IKZKZXcjs.buildMintRequestTypedData; exports.buildPartialUserOperation = buildPartialUserOperation; exports.buildPerpDepositViaRelay = buildPerpDepositViaRelay; exports.buildPerpDepositWithGasDeduction = buildPerpDepositWithGasDeduction; exports.buildSponsorAuthDomain = _chunkQFBHBFEYcjs.buildSponsorAuthDomain; exports.buildSponsorAuthTypedData = _chunkQFBHBFEYcjs.buildSponsorAuthTypedData; exports.burnRequestTypes = _chunkF7IKZKZXcjs.burnRequestTypes; exports.checkDelegation = checkDelegation; exports.checkEthAndBranch = checkEthAndBranch; exports.computeAccountId = computeAccountId; exports.computeAuthorizationHash = computeAuthorizationHash; exports.computeCallDataHash = _chunkQFBHBFEYcjs.computeCallDataHash; exports.computeEquityCap = _chunkDQKCPH6Bcjs.computeEquityCap; exports.computeUserOpHash = computeUserOpHash; exports.computeV3PoolAddress = computeV3PoolAddress; exports.createLoginMessage = _chunkQFBHBFEYcjs.createLoginMessage; exports.createPafiProxyTransport = createPafiProxyTransport; exports.decodeKernelExecute = decodeKernelExecute; exports.decodeKernelExecuteCalls = decodeKernelExecuteCalls; exports.defaultErrorTypeForStatus = defaultErrorTypeForStatus; exports.delegateDirect = delegateDirect; exports.detectDelegateImpl = detectDelegateImpl; exports.encodeKernelExecute = encodeKernelExecute; exports.encodeV3Path = encodeV3Path; exports.encodeV3PathReversed = encodeV3PathReversed; exports.erc20Abi = _chunk2DVM77Y2cjs.erc20Abi; exports.erc20ApproveOp = erc20ApproveOp; exports.erc20BurnOp = erc20BurnOp; exports.erc20TransferOp = erc20TransferOp; exports.fetchPafiPools = fetchPafiPools; exports.generateSponsorAuthNonce = _chunkQFBHBFEYcjs.generateSponsorAuthNonce; exports.getAaNonce = getAaNonce; exports.getAsterBrokerId = getAsterBrokerId; exports.getBurnRequestNonce = _chunkDQKCPH6Bcjs.getBurnRequestNonce; exports.getContractAddresses = getContractAddresses; exports.getDummySignatureFor7702 = getDummySignatureFor7702; exports.getIssuer = _chunkDQKCPH6Bcjs.getIssuer2; exports.getMintFeeBps = _chunkDQKCPH6Bcjs.getMintFeeBps; exports.getMintFeeRecipients = _chunkDQKCPH6Bcjs.getMintFeeRecipients; exports.getMintRequestNonce = _chunkDQKCPH6Bcjs.getMintRequestNonce; exports.getOracleRegistries = _chunkDQKCPH6Bcjs.getOracleRegistries; exports.getPafiServiceUrls = getPafiServiceUrls; exports.getPafiWebModalAdapter = getPafiWebModalAdapter; exports.getPointTokenBalance = _chunkDQKCPH6Bcjs.getPointTokenBalance; exports.getPointTokenIssuerAddress = _chunkDQKCPH6Bcjs.getIssuer; exports.getSponsorAuthDomainAnchor = _chunkQFBHBFEYcjs.getSponsorAuthDomainAnchor; exports.getTokenName = _chunkDQKCPH6Bcjs.getTokenName; exports.isActiveIssuer = _chunkDQKCPH6Bcjs.isActiveIssuer; exports.isDelegatedTo = isDelegatedTo; exports.isDelegatedToTarget = isDelegatedToTarget; exports.isMinter = _chunkDQKCPH6Bcjs.isMinter; exports.isPaymasterError = isPaymasterError; exports.issuerRegistryAbi = _chunk2CU7ZH2Acjs.issuerRegistryAbi; exports.issuerRegistryGetIssuerFlatAbi = _chunkDQKCPH6Bcjs.issuerRegistryGetIssuerFlatAbi; exports.mintFeeWrapperAbi = _chunk2CU7ZH2Acjs.mintFeeWrapperAbi; exports.mintRequestTypes = _chunkF7IKZKZXcjs.mintRequestTypes; exports.mintingOracleAbi = _chunk2CU7ZH2Acjs.mintingOracleAbi; exports.openPafiWebModal = openPafiWebModal; exports.openWebPopup = openWebPopup; exports.parseEip7702DelegatedAddress = parseEip7702DelegatedAddress; exports.parseLoginMessage = _chunkQFBHBFEYcjs.parseLoginMessage; exports.permit2Abi = _chunk2DVM77Y2cjs.permit2Abi; exports.pointModuleCoreAbi = _chunk2DVM77Y2cjs.pointModuleCoreAbi; exports.pointTokenAbi = _chunk245YA3CQcjs.pointTokenAbi; exports.pointTokenFactoryAbi = _chunk2DVM77Y2cjs.pointTokenFactoryAbi; exports.quoteOperatorFeeForTransfer = quoteOperatorFeeForTransfer; exports.quoteOperatorFeePt = quoteOperatorFeePt; exports.quoteOperatorFeeUsdt = quoteOperatorFeeUsdt; exports.rawCallOp = rawCallOp; exports.sendWithPaymasterFallback = sendWithPaymasterFallback; exports.serializeUserOpToJsonRpc = serializeUserOpToJsonRpc; exports.setPafiWebModalAdapter = setPafiWebModalAdapter; exports.settlementVaultAbi = _chunk2DVM77Y2cjs.settlementVaultAbi; exports.signBurnRequest = _chunkF7IKZKZXcjs.signBurnRequest; exports.signMintRequest = _chunkF7IKZKZXcjs.signMintRequest; exports.signSponsorAuth = _chunkQFBHBFEYcjs.signSponsorAuth; exports.splitAuthorizationSig = splitAuthorizationSig; exports.tokenRegistryAbi = _chunk2DVM77Y2cjs.tokenRegistryAbi; exports.universalRouterAbi = _chunk2DVM77Y2cjs.universalRouterAbi; exports.v3QuoterV2Abi = _chunk2DVM77Y2cjs.v3QuoterV2Abi; exports.vaultFactoryAbi = _chunk2DVM77Y2cjs.vaultFactoryAbi; exports.vaultRegistryAbi = _chunk2DVM77Y2cjs.vaultRegistryAbi; exports.verifyBurnRequest = _chunkF7IKZKZXcjs.verifyBurnRequest; exports.verifyEquityMint = _chunkDQKCPH6Bcjs.verifyEquityMint; exports.verifyIssuerOperative = _chunkDQKCPH6Bcjs.verifyIssuerOperative; exports.verifyLoginMessage = _chunkQFBHBFEYcjs.verifyLoginMessage; exports.verifyMint = _chunkDQKCPH6Bcjs.verifyMint; exports.verifyMintRequest = _chunkF7IKZKZXcjs.verifyMintRequest; exports.verifySponsorAuth = _chunkQFBHBFEYcjs.verifySponsorAuth; exports.webPopupAdapter = webPopupAdapter;
|
|
1983
2111
|
//# sourceMappingURL=index.cjs.map
|