@pafi-dev/core 0.5.3 → 0.5.4
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-YU7MFR6Y.cjs → chunk-B3PYJGTH.cjs} +14 -2
- package/dist/chunk-B3PYJGTH.cjs.map +1 -0
- package/dist/{chunk-CQCSQPWG.cjs → chunk-G6IUSI5S.cjs} +1 -1
- package/dist/{chunk-CQCSQPWG.cjs.map → chunk-G6IUSI5S.cjs.map} +1 -1
- package/dist/{chunk-QGO6X6LG.js → chunk-HZTR4RHR.js} +1 -1
- package/dist/chunk-HZTR4RHR.js.map +1 -0
- package/dist/{chunk-T6Y32SNK.js → chunk-MWKJODJE.js} +14 -2
- package/dist/{chunk-T6Y32SNK.js.map → chunk-MWKJODJE.js.map} +1 -1
- package/dist/contract/index.cjs +2 -2
- package/dist/contract/index.js +1 -1
- package/dist/index.cjs +43 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +27 -2
- package/dist/index.js.map +1 -1
- package/dist/swap/index.cjs +2 -2
- package/dist/swap/index.js +1 -1
- package/package.json +1 -1
- package/dist/abi/index.d.cts +0 -2194
- package/dist/abi/index.d.ts +0 -2194
- package/dist/auth/index.d.cts +0 -151
- package/dist/auth/index.d.ts +0 -151
- package/dist/chunk-QGO6X6LG.js.map +0 -1
- package/dist/chunk-YU7MFR6Y.cjs.map +0 -1
- package/dist/contract/index.d.cts +0 -22
- package/dist/contract/index.d.ts +0 -22
- package/dist/eip712/index.d.cts +0 -125
- package/dist/eip712/index.d.ts +0 -125
- package/dist/index-BEx-Q1bW.d.cts +0 -227
- package/dist/index-r4xCdQO7.d.ts +0 -227
- package/dist/index.d.cts +0 -1607
- package/dist/index.d.ts +0 -1607
- package/dist/quoting/index.d.cts +0 -59
- package/dist/quoting/index.d.ts +0 -59
- package/dist/swap/index.d.cts +0 -3
- package/dist/swap/index.d.ts +0 -3
- package/dist/types-b5_Tokjl.d.cts +0 -89
- package/dist/types-b5_Tokjl.d.ts +0 -89
package/dist/quoting/index.d.cts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { Address, PublicClient } from 'viem';
|
|
2
|
-
import { P as PoolKey, d as PathKey, B as BestQuote, Q as QuoteResult } from '../types-b5_Tokjl.cjs';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Combine point-token-specific pools and common pools for a given chain.
|
|
6
|
-
* Point token pools are listed first so callers can prioritise them.
|
|
7
|
-
*/
|
|
8
|
-
declare function combineRoutes(chainId: number, pointTokenAddress: Address): PoolKey[];
|
|
9
|
-
/**
|
|
10
|
-
* Build all possible swap paths from `tokenIn` to `tokenOut` using the given
|
|
11
|
-
* pools. Returns an array of PathKey[] routes (each up to `maxHops` hops).
|
|
12
|
-
*
|
|
13
|
-
* Supports both direct single-hop routes and multi-hop routes through
|
|
14
|
-
* intermediate tokens. Each pool is used at most once per path.
|
|
15
|
-
*
|
|
16
|
-
* @param pools - Available pools to route through
|
|
17
|
-
* @param tokenIn - Input token address
|
|
18
|
-
* @param tokenOut - Desired output token address
|
|
19
|
-
* @param maxHops - Maximum number of hops (default 3)
|
|
20
|
-
*/
|
|
21
|
-
declare function buildAllPaths(pools: PoolKey[], tokenIn: Address, tokenOut: Address, maxHops?: number): PathKey[][];
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Quote exact-input for a multi-hop path.
|
|
25
|
-
*/
|
|
26
|
-
declare function quoteExactInput(client: PublicClient, quoterAddress: Address, exactCurrency: Address, path: PathKey[], exactAmount: bigint): Promise<QuoteResult>;
|
|
27
|
-
/**
|
|
28
|
-
* Quote exact-input for a single-hop swap, given an explicit PoolKey and direction.
|
|
29
|
-
*/
|
|
30
|
-
declare function quoteExactInputSingle(client: PublicClient, quoterAddress: Address, poolKey: PoolKey, zeroForOne: boolean, exactAmount: bigint, hookData: `0x${string}`): Promise<{
|
|
31
|
-
amountOut: bigint;
|
|
32
|
-
gasEstimate: bigint;
|
|
33
|
-
}>;
|
|
34
|
-
/**
|
|
35
|
-
* Try multiple PathKey[] routes and return the best quote plus all results.
|
|
36
|
-
* Routes that fail (e.g. pool does not exist) are silently skipped.
|
|
37
|
-
*
|
|
38
|
-
* Uses viem multicall to batch all quotes into a single RPC call for speed.
|
|
39
|
-
*/
|
|
40
|
-
declare function quoteBestRoute(client: PublicClient, quoterAddress: Address, exactCurrency: Address, routes: PathKey[][], exactAmount: bigint): Promise<BestQuote>;
|
|
41
|
-
/**
|
|
42
|
-
* Find and quote the best swap route from `tokenIn` to `tokenOut`.
|
|
43
|
-
*
|
|
44
|
-
* Combines the caller's `pools` with `COMMON_POOLS[chainId]`, builds all
|
|
45
|
-
* possible paths (up to `maxHops`), then quotes them all via a single
|
|
46
|
-
* multicall and returns the best result.
|
|
47
|
-
*
|
|
48
|
-
* @param client - viem PublicClient
|
|
49
|
-
* @param chainId - Chain ID (used to look up COMMON_POOLS and V4_QUOTER_ADDRESSES)
|
|
50
|
-
* @param tokenIn - Input token address
|
|
51
|
-
* @param tokenOut - Desired output token address
|
|
52
|
-
* @param exactAmount - Exact input amount
|
|
53
|
-
* @param pools - Additional pools to consider (e.g. point-token-specific)
|
|
54
|
-
* @param quoterAddress - Override the default V4 Quoter address for this chain
|
|
55
|
-
* @param maxHops - Maximum number of hops per path (default 3)
|
|
56
|
-
*/
|
|
57
|
-
declare function findBestQuote(client: PublicClient, chainId: number, tokenIn: Address, tokenOut: Address, exactAmount: bigint, pools?: PoolKey[], quoterAddress?: Address, maxHops?: number): Promise<BestQuote>;
|
|
58
|
-
|
|
59
|
-
export { buildAllPaths, combineRoutes, findBestQuote, quoteBestRoute, quoteExactInput, quoteExactInputSingle };
|
package/dist/quoting/index.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { Address, PublicClient } from 'viem';
|
|
2
|
-
import { P as PoolKey, d as PathKey, B as BestQuote, Q as QuoteResult } from '../types-b5_Tokjl.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Combine point-token-specific pools and common pools for a given chain.
|
|
6
|
-
* Point token pools are listed first so callers can prioritise them.
|
|
7
|
-
*/
|
|
8
|
-
declare function combineRoutes(chainId: number, pointTokenAddress: Address): PoolKey[];
|
|
9
|
-
/**
|
|
10
|
-
* Build all possible swap paths from `tokenIn` to `tokenOut` using the given
|
|
11
|
-
* pools. Returns an array of PathKey[] routes (each up to `maxHops` hops).
|
|
12
|
-
*
|
|
13
|
-
* Supports both direct single-hop routes and multi-hop routes through
|
|
14
|
-
* intermediate tokens. Each pool is used at most once per path.
|
|
15
|
-
*
|
|
16
|
-
* @param pools - Available pools to route through
|
|
17
|
-
* @param tokenIn - Input token address
|
|
18
|
-
* @param tokenOut - Desired output token address
|
|
19
|
-
* @param maxHops - Maximum number of hops (default 3)
|
|
20
|
-
*/
|
|
21
|
-
declare function buildAllPaths(pools: PoolKey[], tokenIn: Address, tokenOut: Address, maxHops?: number): PathKey[][];
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Quote exact-input for a multi-hop path.
|
|
25
|
-
*/
|
|
26
|
-
declare function quoteExactInput(client: PublicClient, quoterAddress: Address, exactCurrency: Address, path: PathKey[], exactAmount: bigint): Promise<QuoteResult>;
|
|
27
|
-
/**
|
|
28
|
-
* Quote exact-input for a single-hop swap, given an explicit PoolKey and direction.
|
|
29
|
-
*/
|
|
30
|
-
declare function quoteExactInputSingle(client: PublicClient, quoterAddress: Address, poolKey: PoolKey, zeroForOne: boolean, exactAmount: bigint, hookData: `0x${string}`): Promise<{
|
|
31
|
-
amountOut: bigint;
|
|
32
|
-
gasEstimate: bigint;
|
|
33
|
-
}>;
|
|
34
|
-
/**
|
|
35
|
-
* Try multiple PathKey[] routes and return the best quote plus all results.
|
|
36
|
-
* Routes that fail (e.g. pool does not exist) are silently skipped.
|
|
37
|
-
*
|
|
38
|
-
* Uses viem multicall to batch all quotes into a single RPC call for speed.
|
|
39
|
-
*/
|
|
40
|
-
declare function quoteBestRoute(client: PublicClient, quoterAddress: Address, exactCurrency: Address, routes: PathKey[][], exactAmount: bigint): Promise<BestQuote>;
|
|
41
|
-
/**
|
|
42
|
-
* Find and quote the best swap route from `tokenIn` to `tokenOut`.
|
|
43
|
-
*
|
|
44
|
-
* Combines the caller's `pools` with `COMMON_POOLS[chainId]`, builds all
|
|
45
|
-
* possible paths (up to `maxHops`), then quotes them all via a single
|
|
46
|
-
* multicall and returns the best result.
|
|
47
|
-
*
|
|
48
|
-
* @param client - viem PublicClient
|
|
49
|
-
* @param chainId - Chain ID (used to look up COMMON_POOLS and V4_QUOTER_ADDRESSES)
|
|
50
|
-
* @param tokenIn - Input token address
|
|
51
|
-
* @param tokenOut - Desired output token address
|
|
52
|
-
* @param exactAmount - Exact input amount
|
|
53
|
-
* @param pools - Additional pools to consider (e.g. point-token-specific)
|
|
54
|
-
* @param quoterAddress - Override the default V4 Quoter address for this chain
|
|
55
|
-
* @param maxHops - Maximum number of hops per path (default 3)
|
|
56
|
-
*/
|
|
57
|
-
declare function findBestQuote(client: PublicClient, chainId: number, tokenIn: Address, tokenOut: Address, exactAmount: bigint, pools?: PoolKey[], quoterAddress?: Address, maxHops?: number): Promise<BestQuote>;
|
|
58
|
-
|
|
59
|
-
export { buildAllPaths, combineRoutes, findBestQuote, quoteBestRoute, quoteExactInput, quoteExactInputSingle };
|
package/dist/swap/index.d.cts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { B as BuildSwapWithGasDeductionParams, b as SETTLE_ALL, c as SWAP_EXACT_IN, S as SwapSimulationResult, T as TAKE_ALL, V as V4_SWAP, e as buildErc20ApprovalCalldata, f as buildPermit2ApprovalCalldata, g as buildSwapFromQuote, h as buildSwapWithGasDeduction, i as buildUniversalRouterExecuteArgs, j as buildV4SwapInput, k as checkAllowance, s as simulateSwap } from '../index-BEx-Q1bW.cjs';
|
|
2
|
-
import 'viem';
|
|
3
|
-
import '../types-b5_Tokjl.cjs';
|
package/dist/swap/index.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { B as BuildSwapWithGasDeductionParams, b as SETTLE_ALL, c as SWAP_EXACT_IN, S as SwapSimulationResult, T as TAKE_ALL, V as V4_SWAP, e as buildErc20ApprovalCalldata, f as buildPermit2ApprovalCalldata, g as buildSwapFromQuote, h as buildSwapWithGasDeduction, i as buildUniversalRouterExecuteArgs, j as buildV4SwapInput, k as checkAllowance, s as simulateSwap } from '../index-r4xCdQO7.js';
|
|
2
|
-
import 'viem';
|
|
3
|
-
import '../types-b5_Tokjl.js';
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { Address, Hex, WalletClient, PublicClient } from 'viem';
|
|
2
|
-
|
|
3
|
-
/** MintRequest(address to,uint256 amount,uint256 nonce,uint256 deadline) */
|
|
4
|
-
interface MintRequest {
|
|
5
|
-
to: Address;
|
|
6
|
-
amount: bigint;
|
|
7
|
-
nonce: bigint;
|
|
8
|
-
deadline: bigint;
|
|
9
|
-
}
|
|
10
|
-
/** BurnRequest(address from,uint256 amount,uint256 nonce,uint256 deadline) */
|
|
11
|
-
interface BurnRequest {
|
|
12
|
-
from: Address;
|
|
13
|
-
amount: bigint;
|
|
14
|
-
nonce: bigint;
|
|
15
|
-
deadline: bigint;
|
|
16
|
-
}
|
|
17
|
-
/** ReceiverConsent(address onBehalfOf,address originalReceiver,uint256 amount,uint256 nonce,uint256 deadline,bytes extData) */
|
|
18
|
-
interface ReceiverConsent {
|
|
19
|
-
onBehalfOf: Address;
|
|
20
|
-
originalReceiver: Address;
|
|
21
|
-
amount: bigint;
|
|
22
|
-
nonce: bigint;
|
|
23
|
-
deadline: bigint;
|
|
24
|
-
extData: Hex;
|
|
25
|
-
}
|
|
26
|
-
interface EIP712Signature {
|
|
27
|
-
v: number;
|
|
28
|
-
r: Hex;
|
|
29
|
-
s: Hex;
|
|
30
|
-
serialized: Hex;
|
|
31
|
-
}
|
|
32
|
-
interface PointTokenDomainConfig {
|
|
33
|
-
name: string;
|
|
34
|
-
verifyingContract: Address;
|
|
35
|
-
chainId: number;
|
|
36
|
-
}
|
|
37
|
-
interface SignatureVerification {
|
|
38
|
-
isValid: boolean;
|
|
39
|
-
recoveredAddress: Address;
|
|
40
|
-
}
|
|
41
|
-
/** Auto-generated from Solidity struct — do not edit */
|
|
42
|
-
interface PathKey {
|
|
43
|
-
intermediateCurrency: Address;
|
|
44
|
-
fee: number;
|
|
45
|
-
tickSpacing: number;
|
|
46
|
-
hooks: Address;
|
|
47
|
-
hookData: Hex;
|
|
48
|
-
}
|
|
49
|
-
/** Auto-generated from Solidity struct — do not edit */
|
|
50
|
-
interface Issuer {
|
|
51
|
-
issuerAddress: Address;
|
|
52
|
-
signerAddress: Address;
|
|
53
|
-
name: string;
|
|
54
|
-
symbol: string;
|
|
55
|
-
declaredTotalSupply: bigint;
|
|
56
|
-
capBasisPoints: number;
|
|
57
|
-
active: boolean;
|
|
58
|
-
pointToken: Address;
|
|
59
|
-
mintingOracle: Address;
|
|
60
|
-
}
|
|
61
|
-
/** Auto-generated from Solidity struct — do not edit */
|
|
62
|
-
interface PoolKey {
|
|
63
|
-
currency0: Address;
|
|
64
|
-
currency1: Address;
|
|
65
|
-
fee: number;
|
|
66
|
-
tickSpacing: number;
|
|
67
|
-
hooks: Address;
|
|
68
|
-
}
|
|
69
|
-
interface ChainConfig {
|
|
70
|
-
name: string;
|
|
71
|
-
}
|
|
72
|
-
interface QuoteResult {
|
|
73
|
-
amountOut: bigint;
|
|
74
|
-
gasEstimate: bigint;
|
|
75
|
-
path: PathKey[];
|
|
76
|
-
}
|
|
77
|
-
interface BestQuote {
|
|
78
|
-
bestRoute: QuoteResult;
|
|
79
|
-
allRoutes: QuoteResult[];
|
|
80
|
-
}
|
|
81
|
-
interface PafiSDKConfig {
|
|
82
|
-
pointTokenAddress?: Address;
|
|
83
|
-
signer?: WalletClient;
|
|
84
|
-
provider?: PublicClient;
|
|
85
|
-
rpcUrl?: string;
|
|
86
|
-
chainId?: number;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export type { BestQuote as B, ChainConfig as C, EIP712Signature as E, Issuer as I, MintRequest as M, PoolKey as P, QuoteResult as Q, ReceiverConsent as R, SignatureVerification as S, PafiSDKConfig as a, PointTokenDomainConfig as b, BurnRequest as c, PathKey as d };
|
package/dist/types-b5_Tokjl.d.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { Address, Hex, WalletClient, PublicClient } from 'viem';
|
|
2
|
-
|
|
3
|
-
/** MintRequest(address to,uint256 amount,uint256 nonce,uint256 deadline) */
|
|
4
|
-
interface MintRequest {
|
|
5
|
-
to: Address;
|
|
6
|
-
amount: bigint;
|
|
7
|
-
nonce: bigint;
|
|
8
|
-
deadline: bigint;
|
|
9
|
-
}
|
|
10
|
-
/** BurnRequest(address from,uint256 amount,uint256 nonce,uint256 deadline) */
|
|
11
|
-
interface BurnRequest {
|
|
12
|
-
from: Address;
|
|
13
|
-
amount: bigint;
|
|
14
|
-
nonce: bigint;
|
|
15
|
-
deadline: bigint;
|
|
16
|
-
}
|
|
17
|
-
/** ReceiverConsent(address onBehalfOf,address originalReceiver,uint256 amount,uint256 nonce,uint256 deadline,bytes extData) */
|
|
18
|
-
interface ReceiverConsent {
|
|
19
|
-
onBehalfOf: Address;
|
|
20
|
-
originalReceiver: Address;
|
|
21
|
-
amount: bigint;
|
|
22
|
-
nonce: bigint;
|
|
23
|
-
deadline: bigint;
|
|
24
|
-
extData: Hex;
|
|
25
|
-
}
|
|
26
|
-
interface EIP712Signature {
|
|
27
|
-
v: number;
|
|
28
|
-
r: Hex;
|
|
29
|
-
s: Hex;
|
|
30
|
-
serialized: Hex;
|
|
31
|
-
}
|
|
32
|
-
interface PointTokenDomainConfig {
|
|
33
|
-
name: string;
|
|
34
|
-
verifyingContract: Address;
|
|
35
|
-
chainId: number;
|
|
36
|
-
}
|
|
37
|
-
interface SignatureVerification {
|
|
38
|
-
isValid: boolean;
|
|
39
|
-
recoveredAddress: Address;
|
|
40
|
-
}
|
|
41
|
-
/** Auto-generated from Solidity struct — do not edit */
|
|
42
|
-
interface PathKey {
|
|
43
|
-
intermediateCurrency: Address;
|
|
44
|
-
fee: number;
|
|
45
|
-
tickSpacing: number;
|
|
46
|
-
hooks: Address;
|
|
47
|
-
hookData: Hex;
|
|
48
|
-
}
|
|
49
|
-
/** Auto-generated from Solidity struct — do not edit */
|
|
50
|
-
interface Issuer {
|
|
51
|
-
issuerAddress: Address;
|
|
52
|
-
signerAddress: Address;
|
|
53
|
-
name: string;
|
|
54
|
-
symbol: string;
|
|
55
|
-
declaredTotalSupply: bigint;
|
|
56
|
-
capBasisPoints: number;
|
|
57
|
-
active: boolean;
|
|
58
|
-
pointToken: Address;
|
|
59
|
-
mintingOracle: Address;
|
|
60
|
-
}
|
|
61
|
-
/** Auto-generated from Solidity struct — do not edit */
|
|
62
|
-
interface PoolKey {
|
|
63
|
-
currency0: Address;
|
|
64
|
-
currency1: Address;
|
|
65
|
-
fee: number;
|
|
66
|
-
tickSpacing: number;
|
|
67
|
-
hooks: Address;
|
|
68
|
-
}
|
|
69
|
-
interface ChainConfig {
|
|
70
|
-
name: string;
|
|
71
|
-
}
|
|
72
|
-
interface QuoteResult {
|
|
73
|
-
amountOut: bigint;
|
|
74
|
-
gasEstimate: bigint;
|
|
75
|
-
path: PathKey[];
|
|
76
|
-
}
|
|
77
|
-
interface BestQuote {
|
|
78
|
-
bestRoute: QuoteResult;
|
|
79
|
-
allRoutes: QuoteResult[];
|
|
80
|
-
}
|
|
81
|
-
interface PafiSDKConfig {
|
|
82
|
-
pointTokenAddress?: Address;
|
|
83
|
-
signer?: WalletClient;
|
|
84
|
-
provider?: PublicClient;
|
|
85
|
-
rpcUrl?: string;
|
|
86
|
-
chainId?: number;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export type { BestQuote as B, ChainConfig as C, EIP712Signature as E, Issuer as I, MintRequest as M, PoolKey as P, QuoteResult as Q, ReceiverConsent as R, SignatureVerification as S, PafiSDKConfig as a, PointTokenDomainConfig as b, BurnRequest as c, PathKey as d };
|