@bananapus/nana-sdk-core 1.9.4 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/v6/directPay.d.ts +69 -0
- package/dist/cjs/v6/directPay.d.ts.map +1 -0
- package/dist/cjs/v6/directPay.js +391 -0
- package/dist/cjs/v6/directPay.js.map +1 -0
- package/dist/cjs/v6/index.d.ts +2 -0
- package/dist/cjs/v6/index.d.ts.map +1 -1
- package/dist/cjs/v6/index.js +2 -0
- package/dist/cjs/v6/index.js.map +1 -1
- package/dist/cjs/v6/loans.d.ts +25 -0
- package/dist/cjs/v6/loans.d.ts.map +1 -1
- package/dist/cjs/v6/loans.js +42 -1
- package/dist/cjs/v6/loans.js.map +1 -1
- package/dist/cjs/v6/permit2.d.ts +169 -0
- package/dist/cjs/v6/permit2.d.ts.map +1 -0
- package/dist/cjs/v6/permit2.js +145 -0
- package/dist/cjs/v6/permit2.js.map +1 -0
- package/dist/esm/v6/directPay.d.ts +69 -0
- package/dist/esm/v6/directPay.d.ts.map +1 -0
- package/dist/esm/v6/directPay.js +385 -0
- package/dist/esm/v6/directPay.js.map +1 -0
- package/dist/esm/v6/index.d.ts +2 -0
- package/dist/esm/v6/index.d.ts.map +1 -1
- package/dist/esm/v6/index.js +2 -0
- package/dist/esm/v6/index.js.map +1 -1
- package/dist/esm/v6/loans.d.ts +25 -0
- package/dist/esm/v6/loans.d.ts.map +1 -1
- package/dist/esm/v6/loans.js +39 -0
- package/dist/esm/v6/loans.js.map +1 -1
- package/dist/esm/v6/permit2.d.ts +169 -0
- package/dist/esm/v6/permit2.d.ts.map +1 -0
- package/dist/esm/v6/permit2.js +136 -0
- package/dist/esm/v6/permit2.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import type { Address, Hex, PublicClient } from "viem";
|
|
2
|
+
import type { JBChainId } from "../types.js";
|
|
3
|
+
/** Canonical Permit2 deployment shared by supported EVM chains. */
|
|
4
|
+
export declare const PERMIT2_ADDRESS: `0x${string}`;
|
|
5
|
+
/** Permit2 methods used to inspect or establish Universal Router allowances. */
|
|
6
|
+
export declare const permit2Abi: readonly [{
|
|
7
|
+
readonly type: "function";
|
|
8
|
+
readonly name: "allowance";
|
|
9
|
+
readonly stateMutability: "view";
|
|
10
|
+
readonly inputs: readonly [{
|
|
11
|
+
readonly name: "owner";
|
|
12
|
+
readonly type: "address";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "token";
|
|
15
|
+
readonly type: "address";
|
|
16
|
+
}, {
|
|
17
|
+
readonly name: "spender";
|
|
18
|
+
readonly type: "address";
|
|
19
|
+
}];
|
|
20
|
+
readonly outputs: readonly [{
|
|
21
|
+
readonly name: "amount";
|
|
22
|
+
readonly type: "uint160";
|
|
23
|
+
}, {
|
|
24
|
+
readonly name: "expiration";
|
|
25
|
+
readonly type: "uint48";
|
|
26
|
+
}, {
|
|
27
|
+
readonly name: "nonce";
|
|
28
|
+
readonly type: "uint48";
|
|
29
|
+
}];
|
|
30
|
+
}, {
|
|
31
|
+
readonly type: "function";
|
|
32
|
+
readonly name: "approve";
|
|
33
|
+
readonly stateMutability: "nonpayable";
|
|
34
|
+
readonly inputs: readonly [{
|
|
35
|
+
readonly name: "token";
|
|
36
|
+
readonly type: "address";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "spender";
|
|
39
|
+
readonly type: "address";
|
|
40
|
+
}, {
|
|
41
|
+
readonly name: "amount";
|
|
42
|
+
readonly type: "uint160";
|
|
43
|
+
}, {
|
|
44
|
+
readonly name: "expiration";
|
|
45
|
+
readonly type: "uint48";
|
|
46
|
+
}];
|
|
47
|
+
readonly outputs: readonly [];
|
|
48
|
+
}];
|
|
49
|
+
/** EIP-712 types for Permit2's one-token, one-spender authorization. */
|
|
50
|
+
export declare const PERMIT2_TYPES: {
|
|
51
|
+
readonly PermitDetails: readonly [{
|
|
52
|
+
readonly name: "token";
|
|
53
|
+
readonly type: "address";
|
|
54
|
+
}, {
|
|
55
|
+
readonly name: "amount";
|
|
56
|
+
readonly type: "uint160";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "expiration";
|
|
59
|
+
readonly type: "uint48";
|
|
60
|
+
}, {
|
|
61
|
+
readonly name: "nonce";
|
|
62
|
+
readonly type: "uint48";
|
|
63
|
+
}];
|
|
64
|
+
readonly PermitSingle: readonly [{
|
|
65
|
+
readonly name: "details";
|
|
66
|
+
readonly type: "PermitDetails";
|
|
67
|
+
}, {
|
|
68
|
+
readonly name: "spender";
|
|
69
|
+
readonly type: "address";
|
|
70
|
+
}, {
|
|
71
|
+
readonly name: "sigDeadline";
|
|
72
|
+
readonly type: "uint256";
|
|
73
|
+
}];
|
|
74
|
+
};
|
|
75
|
+
export interface Permit2SignatureAuthorization {
|
|
76
|
+
chainId: JBChainId;
|
|
77
|
+
token: Address;
|
|
78
|
+
spender: Address;
|
|
79
|
+
amount: bigint;
|
|
80
|
+
expiration: number;
|
|
81
|
+
nonce: number;
|
|
82
|
+
sigDeadline: bigint;
|
|
83
|
+
}
|
|
84
|
+
export interface Permit2Allowance {
|
|
85
|
+
amount: bigint;
|
|
86
|
+
expiration: number;
|
|
87
|
+
nonce: number;
|
|
88
|
+
}
|
|
89
|
+
/** Build the exact typed-data payload a wallet signs for PermitSingle. */
|
|
90
|
+
export declare function permit2TypedData(authorization: Permit2SignatureAuthorization): {
|
|
91
|
+
domain: {
|
|
92
|
+
name: "Permit2";
|
|
93
|
+
chainId: 1 | 11155111 | 10 | 11155420 | 8453 | 84532 | 42161 | 421614;
|
|
94
|
+
verifyingContract: `0x${string}`;
|
|
95
|
+
};
|
|
96
|
+
types: {
|
|
97
|
+
readonly PermitDetails: readonly [{
|
|
98
|
+
readonly name: "token";
|
|
99
|
+
readonly type: "address";
|
|
100
|
+
}, {
|
|
101
|
+
readonly name: "amount";
|
|
102
|
+
readonly type: "uint160";
|
|
103
|
+
}, {
|
|
104
|
+
readonly name: "expiration";
|
|
105
|
+
readonly type: "uint48";
|
|
106
|
+
}, {
|
|
107
|
+
readonly name: "nonce";
|
|
108
|
+
readonly type: "uint48";
|
|
109
|
+
}];
|
|
110
|
+
readonly PermitSingle: readonly [{
|
|
111
|
+
readonly name: "details";
|
|
112
|
+
readonly type: "PermitDetails";
|
|
113
|
+
}, {
|
|
114
|
+
readonly name: "spender";
|
|
115
|
+
readonly type: "address";
|
|
116
|
+
}, {
|
|
117
|
+
readonly name: "sigDeadline";
|
|
118
|
+
readonly type: "uint256";
|
|
119
|
+
}];
|
|
120
|
+
};
|
|
121
|
+
primaryType: "PermitSingle";
|
|
122
|
+
message: {
|
|
123
|
+
details: {
|
|
124
|
+
token: `0x${string}`;
|
|
125
|
+
amount: bigint;
|
|
126
|
+
expiration: number;
|
|
127
|
+
nonce: number;
|
|
128
|
+
};
|
|
129
|
+
spender: `0x${string}`;
|
|
130
|
+
sigDeadline: bigint;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
/** Read an owner's Permit2 allowance, defaulting the spender to Universal Router. */
|
|
134
|
+
export declare function readPermit2Allowance(client: PublicClient, { chainId, owner, token, spender, }: {
|
|
135
|
+
chainId: JBChainId;
|
|
136
|
+
owner: Address;
|
|
137
|
+
token: Address;
|
|
138
|
+
spender?: Address;
|
|
139
|
+
}): Promise<Permit2Allowance>;
|
|
140
|
+
/** Whether an allowance is too small or expires inside the safety buffer. */
|
|
141
|
+
export declare function permit2AllowanceNeedsRefresh({ allowance, amount, now, expirationBufferSeconds, }: {
|
|
142
|
+
allowance: Pick<Permit2Allowance, "amount" | "expiration">;
|
|
143
|
+
amount: bigint;
|
|
144
|
+
now?: number;
|
|
145
|
+
expirationBufferSeconds?: number;
|
|
146
|
+
}): boolean;
|
|
147
|
+
/** Read whether an ERC-20 needs a fresh Permit2 authorization for Universal Router. */
|
|
148
|
+
export declare function needsPermit2Approval({ client, chainId, owner, token, amount, now, expirationBufferSeconds, }: {
|
|
149
|
+
client: PublicClient;
|
|
150
|
+
chainId: JBChainId;
|
|
151
|
+
owner: Address;
|
|
152
|
+
token: Address;
|
|
153
|
+
amount: bigint;
|
|
154
|
+
now?: number;
|
|
155
|
+
expirationBufferSeconds?: number;
|
|
156
|
+
}): Promise<boolean>;
|
|
157
|
+
/**
|
|
158
|
+
* Prefer a gasless Permit2 signature for EOAs. Contract wallets generally need
|
|
159
|
+
* the on-chain Permit2 approval path unless their integration handles ERC-1271.
|
|
160
|
+
*/
|
|
161
|
+
export declare function shouldUsePermit2Signature({ needsApproval, walletLookupSettled, walletBytecode, isSafe, }: {
|
|
162
|
+
needsApproval: boolean;
|
|
163
|
+
walletLookupSettled: boolean;
|
|
164
|
+
walletBytecode?: Hex;
|
|
165
|
+
isSafe: boolean;
|
|
166
|
+
}): boolean;
|
|
167
|
+
/** Fall back only for wallets that cannot sign typed data, never on rejection. */
|
|
168
|
+
export declare function permit2SignatureNeedsOnchainFallback(error: unknown): boolean;
|
|
169
|
+
//# sourceMappingURL=permit2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permit2.d.ts","sourceRoot":"","sources":["../../../src/v6/permit2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,mEAAmE;AACnE,eAAO,MAAM,eAAe,eAA0B,CAAC;AAEvD,gFAAgF;AAChF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4Bb,CAAC;AAEX,wEAAwE;AACxE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;CAYhB,CAAC;AAEX,MAAM,WAAW,6BAA6B;IAC5C,OAAO,EAAE,SAAS,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MA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CAAC,EAAE,MAAM,CAAC;IACb,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC,GAAG,OAAO,CAAC,OAAO,CAAC,CAanB;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,MAAM,GACP,EAAE;IACD,aAAa,EAAE,OAAO,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;CACjB,GAAG,OAAO,CAGV;AAED,kFAAkF;AAClF,wBAAgB,oCAAoC,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAgB5E"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { NATIVE_TOKEN } from "../constants.js";
|
|
2
|
+
import { UNISWAP_PERMIT2_ADDRESS, uniswapV4Deployment } from "./uniswapV4.js";
|
|
3
|
+
/** Canonical Permit2 deployment shared by supported EVM chains. */
|
|
4
|
+
export const PERMIT2_ADDRESS = UNISWAP_PERMIT2_ADDRESS;
|
|
5
|
+
/** Permit2 methods used to inspect or establish Universal Router allowances. */
|
|
6
|
+
export const permit2Abi = [
|
|
7
|
+
{
|
|
8
|
+
type: "function",
|
|
9
|
+
name: "allowance",
|
|
10
|
+
stateMutability: "view",
|
|
11
|
+
inputs: [
|
|
12
|
+
{ name: "owner", type: "address" },
|
|
13
|
+
{ name: "token", type: "address" },
|
|
14
|
+
{ name: "spender", type: "address" },
|
|
15
|
+
],
|
|
16
|
+
outputs: [
|
|
17
|
+
{ name: "amount", type: "uint160" },
|
|
18
|
+
{ name: "expiration", type: "uint48" },
|
|
19
|
+
{ name: "nonce", type: "uint48" },
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
type: "function",
|
|
24
|
+
name: "approve",
|
|
25
|
+
stateMutability: "nonpayable",
|
|
26
|
+
inputs: [
|
|
27
|
+
{ name: "token", type: "address" },
|
|
28
|
+
{ name: "spender", type: "address" },
|
|
29
|
+
{ name: "amount", type: "uint160" },
|
|
30
|
+
{ name: "expiration", type: "uint48" },
|
|
31
|
+
],
|
|
32
|
+
outputs: [],
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
/** EIP-712 types for Permit2's one-token, one-spender authorization. */
|
|
36
|
+
export const PERMIT2_TYPES = {
|
|
37
|
+
PermitDetails: [
|
|
38
|
+
{ name: "token", type: "address" },
|
|
39
|
+
{ name: "amount", type: "uint160" },
|
|
40
|
+
{ name: "expiration", type: "uint48" },
|
|
41
|
+
{ name: "nonce", type: "uint48" },
|
|
42
|
+
],
|
|
43
|
+
PermitSingle: [
|
|
44
|
+
{ name: "details", type: "PermitDetails" },
|
|
45
|
+
{ name: "spender", type: "address" },
|
|
46
|
+
{ name: "sigDeadline", type: "uint256" },
|
|
47
|
+
],
|
|
48
|
+
};
|
|
49
|
+
/** Build the exact typed-data payload a wallet signs for PermitSingle. */
|
|
50
|
+
export function permit2TypedData(authorization) {
|
|
51
|
+
return {
|
|
52
|
+
domain: {
|
|
53
|
+
name: "Permit2",
|
|
54
|
+
chainId: authorization.chainId,
|
|
55
|
+
verifyingContract: PERMIT2_ADDRESS,
|
|
56
|
+
},
|
|
57
|
+
types: PERMIT2_TYPES,
|
|
58
|
+
primaryType: "PermitSingle",
|
|
59
|
+
message: {
|
|
60
|
+
details: {
|
|
61
|
+
token: authorization.token,
|
|
62
|
+
amount: authorization.amount,
|
|
63
|
+
expiration: authorization.expiration,
|
|
64
|
+
nonce: authorization.nonce,
|
|
65
|
+
},
|
|
66
|
+
spender: authorization.spender,
|
|
67
|
+
sigDeadline: authorization.sigDeadline,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** Read an owner's Permit2 allowance, defaulting the spender to Universal Router. */
|
|
72
|
+
export async function readPermit2Allowance(client, { chainId, owner, token, spender, }) {
|
|
73
|
+
const resolvedSpender = spender ?? uniswapV4Deployment(chainId)?.universalRouter;
|
|
74
|
+
if (!resolvedSpender) {
|
|
75
|
+
throw new Error(`No supported Uniswap Universal Router on chain ${chainId}.`);
|
|
76
|
+
}
|
|
77
|
+
const [amount, expiration, nonce] = await client.readContract({
|
|
78
|
+
address: PERMIT2_ADDRESS,
|
|
79
|
+
abi: permit2Abi,
|
|
80
|
+
functionName: "allowance",
|
|
81
|
+
args: [owner, token, resolvedSpender],
|
|
82
|
+
});
|
|
83
|
+
return { amount, expiration, nonce };
|
|
84
|
+
}
|
|
85
|
+
/** Whether an allowance is too small or expires inside the safety buffer. */
|
|
86
|
+
export function permit2AllowanceNeedsRefresh({ allowance, amount, now = Math.floor(Date.now() / 1000), expirationBufferSeconds = 1_800, }) {
|
|
87
|
+
if (expirationBufferSeconds < 0) {
|
|
88
|
+
throw new Error("expirationBufferSeconds cannot be negative.");
|
|
89
|
+
}
|
|
90
|
+
return (allowance.amount < amount ||
|
|
91
|
+
allowance.expiration <= now + expirationBufferSeconds);
|
|
92
|
+
}
|
|
93
|
+
/** Read whether an ERC-20 needs a fresh Permit2 authorization for Universal Router. */
|
|
94
|
+
export async function needsPermit2Approval({ client, chainId, owner, token, amount, now, expirationBufferSeconds, }) {
|
|
95
|
+
if (token.toLowerCase() === NATIVE_TOKEN.toLowerCase())
|
|
96
|
+
return false;
|
|
97
|
+
const allowance = await readPermit2Allowance(client, {
|
|
98
|
+
chainId,
|
|
99
|
+
owner,
|
|
100
|
+
token,
|
|
101
|
+
});
|
|
102
|
+
return permit2AllowanceNeedsRefresh({
|
|
103
|
+
allowance,
|
|
104
|
+
amount,
|
|
105
|
+
now,
|
|
106
|
+
expirationBufferSeconds,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Prefer a gasless Permit2 signature for EOAs. Contract wallets generally need
|
|
111
|
+
* the on-chain Permit2 approval path unless their integration handles ERC-1271.
|
|
112
|
+
*/
|
|
113
|
+
export function shouldUsePermit2Signature({ needsApproval, walletLookupSettled, walletBytecode, isSafe, }) {
|
|
114
|
+
const isContract = !!walletBytecode && walletBytecode !== "0x";
|
|
115
|
+
return needsApproval && walletLookupSettled && !isContract && !isSafe;
|
|
116
|
+
}
|
|
117
|
+
/** Fall back only for wallets that cannot sign typed data, never on rejection. */
|
|
118
|
+
export function permit2SignatureNeedsOnchainFallback(error) {
|
|
119
|
+
const messages = [];
|
|
120
|
+
let current = error;
|
|
121
|
+
for (let depth = 0; current && depth < 5; depth += 1) {
|
|
122
|
+
if (typeof current !== "object")
|
|
123
|
+
break;
|
|
124
|
+
const value = current;
|
|
125
|
+
for (const key of ["code", "shortMessage", "message", "details"]) {
|
|
126
|
+
if (value[key] !== undefined)
|
|
127
|
+
messages.push(String(value[key]));
|
|
128
|
+
}
|
|
129
|
+
current = value.cause;
|
|
130
|
+
}
|
|
131
|
+
const text = messages.join(" ").toLowerCase();
|
|
132
|
+
if (/user rejected|rejected the request|denied|4001/.test(text))
|
|
133
|
+
return false;
|
|
134
|
+
return /(^|\s)-32602(\s|$)|(^|\s)-32601(\s|$)|(^|\s)4200(\s|$)|invalid parameters|method .*not supported|unsupported method|typed data.*not supported/.test(text);
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=permit2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permit2.js","sourceRoot":"","sources":["../../../src/v6/permit2.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE9E,mEAAmE;AACnE,MAAM,CAAC,MAAM,eAAe,GAAG,uBAAuB,CAAC;AAEvD,gFAAgF;AAChF,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,WAAW;QACjB,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,OAAO,EAAE,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