@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/relay/index.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { Hex, PublicClient, Address } from 'viem';
|
|
2
|
-
import { e as PathKey, d as SwapParams, c as MintParams } from '../types-BDOnH5Le.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Encode extData for ReceiverConsent and MintParams.
|
|
6
|
-
* extData = abi.encode(uint256 minAmountOut, uint256 feeInUsdt)
|
|
7
|
-
*/
|
|
8
|
-
declare function encodeExtData(minAmountOut: bigint, feeInUsdt: bigint): Hex;
|
|
9
|
-
/**
|
|
10
|
-
* Decode extData back to { minAmountOut, feeInUsdt }.
|
|
11
|
-
*/
|
|
12
|
-
declare function decodeExtData(extData: Hex): {
|
|
13
|
-
minAmountOut: bigint;
|
|
14
|
-
feeInUsdt: bigint;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Build SwapParams and extData from a quote result for Relay.mintAndSwap.
|
|
18
|
-
*
|
|
19
|
-
* @param quote - Quote result containing the path
|
|
20
|
-
* @param minAmountOut - Minimum acceptable USDT output (caller applies slippage)
|
|
21
|
-
* @param feeInUsdt - Fixed USDT fee for the relayer
|
|
22
|
-
* @param deadline - Swap deadline (unix timestamp)
|
|
23
|
-
*
|
|
24
|
-
* @deprecated Since v1.4 — the `claimAndSwap` flow is retired. The
|
|
25
|
-
* Issuer App now performs mint-only claims; swaps happen on PAFI Web.
|
|
26
|
-
* For PT→USDT swap batch calls on PAFI Web, use
|
|
27
|
-
* `buildSwapWithGasDeduction()` (v1.5). This helper is kept for legacy
|
|
28
|
-
* consumers still on v0.2.x and will be removed in v2.0.
|
|
29
|
-
*/
|
|
30
|
-
declare function buildRelaySwapParams(params: {
|
|
31
|
-
quote: {
|
|
32
|
-
path: PathKey[];
|
|
33
|
-
};
|
|
34
|
-
minAmountOut: bigint;
|
|
35
|
-
feeInUsdt: bigint;
|
|
36
|
-
deadline: bigint;
|
|
37
|
-
}): {
|
|
38
|
-
swapParams: SwapParams;
|
|
39
|
-
extData: Hex;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Encode calldata for the legacy `Relayer.mintAndSwap()` function.
|
|
43
|
-
*
|
|
44
|
-
* @deprecated Since v1.4 — the `claimAndSwap` flow is retired. Use
|
|
45
|
-
* `Relayer.mint()` instead (via `@pafi-dev/issuer` RelayService in v1.4).
|
|
46
|
-
* Kept for legacy v0.2.x consumers; will be removed in v2.0.
|
|
47
|
-
*/
|
|
48
|
-
declare function encodeMintAndSwap(mint: MintParams, swap: SwapParams): Hex;
|
|
49
|
-
declare function decodeMintAndSwap(calldata: Hex): {
|
|
50
|
-
mint: MintParams;
|
|
51
|
-
swap: SwapParams;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
interface SimulationResult {
|
|
55
|
-
success: boolean;
|
|
56
|
-
gasEstimate: bigint;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Simulate a Relay.mintAndSwap call via eth_call (no gas spent).
|
|
60
|
-
*
|
|
61
|
-
* Runs the full flow — signature verification, minting, swap via PoolManager,
|
|
62
|
-
* fee split — without submitting a transaction. If the simulation reverts,
|
|
63
|
-
* throws a `SimulationError` with the revert reason.
|
|
64
|
-
*
|
|
65
|
-
* Call this AFTER both signatures are collected but BEFORE submitting the tx.
|
|
66
|
-
*
|
|
67
|
-
* @param client - viem PublicClient
|
|
68
|
-
* @param relayAddress - Relay contract address
|
|
69
|
-
* @param mint - MintParams (with real minterSig + receiverSig)
|
|
70
|
-
* @param swap - SwapParams (path + deadline)
|
|
71
|
-
* @param from - Address that will call mintAndSwap (the relayer)
|
|
72
|
-
*/
|
|
73
|
-
declare function simulateMintAndSwap(client: PublicClient, relayAddress: Address, mint: MintParams, swap: SwapParams, from: Address): Promise<SimulationResult>;
|
|
74
|
-
|
|
75
|
-
export { type SimulationResult, buildRelaySwapParams, decodeExtData, decodeMintAndSwap, encodeExtData, encodeMintAndSwap, simulateMintAndSwap };
|
package/dist/relay/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
buildRelaySwapParams,
|
|
3
|
-
decodeExtData,
|
|
4
|
-
decodeMintAndSwap,
|
|
5
|
-
encodeExtData,
|
|
6
|
-
encodeMintAndSwap,
|
|
7
|
-
simulateMintAndSwap
|
|
8
|
-
} from "../chunk-X4IXUTTD.js";
|
|
9
|
-
import "../chunk-4RYBJLF3.js";
|
|
10
|
-
import "../chunk-P56TUGTS.js";
|
|
11
|
-
export {
|
|
12
|
-
buildRelaySwapParams,
|
|
13
|
-
decodeExtData,
|
|
14
|
-
decodeMintAndSwap,
|
|
15
|
-
encodeExtData,
|
|
16
|
-
encodeMintAndSwap,
|
|
17
|
-
simulateMintAndSwap
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
package/dist/relay/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
File without changes
|
|
File without changes
|