@pushchain/core 1.1.40 → 2.0.1
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/CHANGELOG.md +7 -0
- package/package.json +3 -4
- package/src/index.js +2 -1
- package/src/index.js.map +1 -1
- package/src/lib/constants/abi/feeLocker.evm.js +10 -0
- package/src/lib/constants/abi/feeLocker.evm.js.map +1 -1
- package/src/lib/constants/abi/feeLocker.json +2133 -94
- package/src/lib/constants/abi/index.d.ts +0 -2
- package/src/lib/constants/abi/index.js +1 -5
- package/src/lib/constants/abi/index.js.map +1 -1
- package/src/lib/constants/chain.js +3 -3
- package/src/lib/constants/index.d.ts +0 -1
- package/src/lib/constants/index.js.map +1 -1
- package/src/lib/index.d.ts +0 -1
- package/src/lib/index.js.map +1 -1
- package/src/lib/orchestrator/orchestrator.d.ts +0 -18
- package/src/lib/orchestrator/orchestrator.js +46 -333
- package/src/lib/orchestrator/orchestrator.js.map +1 -1
- package/src/lib/orchestrator/orchestrator.types.d.ts +9 -14
- package/src/lib/price-fetch/price-fetch.js +1 -1
- package/src/lib/price-fetch/price-fetch.js.map +1 -1
- package/src/lib/progress-hook/progress-hook.js +0 -66
- package/src/lib/progress-hook/progress-hook.js.map +1 -1
- package/src/lib/progress-hook/progress-hook.types.d.ts +0 -9
- package/src/lib/progress-hook/progress-hook.types.js +0 -12
- package/src/lib/progress-hook/progress-hook.types.js.map +1 -1
- package/src/lib/push-chain/push-chain.d.ts +0 -17
- package/src/lib/push-chain/push-chain.js +0 -190
- package/src/lib/push-chain/push-chain.js.map +1 -1
- package/src/lib/utils.d.ts +2 -98
- package/src/lib/utils.js +8 -264
- package/src/lib/utils.js.map +1 -1
- package/src/lib/constants/abi/erc20.evm.d.ts +0 -36
- package/src/lib/constants/abi/erc20.evm.js +0 -26
- package/src/lib/constants/abi/erc20.evm.js.map +0 -1
- package/src/lib/constants/abi/universalGatewayV0.evm.d.ts +0 -31
- package/src/lib/constants/abi/universalGatewayV0.evm.js +0 -141
- package/src/lib/constants/abi/universalGatewayV0.evm.js.map +0 -1
- package/src/lib/constants/tokens.d.ts +0 -64
- package/src/lib/constants/tokens.js +0 -218
- package/src/lib/constants/tokens.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push-chain.js","sourceRoot":"","sources":["../../../../../../packages/core/src/lib/push-chain/push-chain.ts"],"names":[],"mappings":";;;;;AAAA,4CAAyC;AACzC,8CAA6D;AAC7D,8CAAgD;AAChD,+DAA4D;AAC5D,gDAA4D;AAK5D,oCAAiC;AACjC,8CAA0C;AAC1C,+BAA6E;AAE7E,wDAAoD;AACpD,gDAQ6B;AAE7B;;;;;GAKG;AACH,MAAa,SAAS;IAapB;;OAEG;IACK,MAAM,CAAC,kBAAkB,CAC/B,KAAyC;QAEzC,OAAO,CAAC,CAAC,aAAa,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,wBAAwB,IAAI,KAAK,CAAC,CAAC;IAC3E,CAAC;IAwDD,YACU,YAA0B,EAC1B,eAAgC,EAChC,cAAgD,EACjD,UAAmB;;QAHlB,iBAAY,GAAZ,YAAY,CAAc;QAC1B,oBAAe,GAAf,eAAe,CAAiB;QAChC,mBAAc,GAAd,cAAc,CAAkC;QACjD,eAAU,GAAV,UAAU,CAAS;QA4Y5B;;;;;;;;;;;WAWG;QACH,iBAAY,GAAG,CACb,eAAmD,EACnD,OAMC,EACmB,EAAE;;YACtB,MAAM,aAAa,GAAG;gBACpB,OAAO,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,mCAAI,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE;gBAC3D,OAAO,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,mCAAI,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE;gBAC3D,cAAc,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc,mCAAI,IAAI,CAAC,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AAM,cAAc,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc,mCAAI;gBAChD,CAAC,aAAK,CAAC,kBAAkB,CAAC,EAAE,CAAC,4BAA4B,CAAC;aAC3D,CAAC;YACF,MAAM,YAAY,GAAG,IAAI,2BAAY;YACnC;;eAEG;YACH,wBAAwB,EACxB,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,mCAAI,oBAAY,CAAC,aAAa,EAC9C,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,mCAAI,EAAE,EACtB,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,mCAAI,KAAK,EAC7B,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,CACtB,CAAC;YACF,OAAO,IAAI,EAAS,CAClB,YAAY,EACZ,wBAAwB,EACxB,cAAc,EACd,UAAU,CACX,CAAC;QACJ,CAAC;KAAA;;AArKH,8BAsOC;;AArOC;;;GAGG;AACW,mBAAS,GAAG,qBAAS,AAAZ,CAAa;AAEpC;;;GAGG;AACW,eAAK,GAAG,aAAK,AAAR,CAAS;AA4J5B;;;;;;;;;;;GAWG;AACI,oBAAU,GAAG,CAClB,eAAmD,EACnD,OAMC,EACmB,EAAE;IACtB,OAAO,EAAS,CAAC,cAAc,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;AAC5D,CAAC,CAAA,AAXgB,CAWf"}
|
package/src/lib/utils.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { convertOriginToExecutor, fromChainAgnostic, convertExecutorToOriginAccount, toChainAgnostic, toUniversal } from './universal/account';
|
|
2
2
|
import { construct, toUniversal as toUniversalSigner, toUniversalFromKeypair } from './universal/signer';
|
|
3
|
-
import { CHAIN } from './constants/enums';
|
|
4
|
-
import type { PushChain } from './push-chain/push-chain';
|
|
5
3
|
/**
|
|
6
4
|
* @dev - THESE UTILS ARE EXPORTED TO SDK CONSUMER
|
|
7
5
|
* @dev - Make sure each exported fn has good comments to help out sdk consumer
|
|
@@ -57,7 +55,7 @@ export declare class Utils {
|
|
|
57
55
|
* For example, converting "1.5" ETH to wei (18 decimals) would be parseUnits("1.5", 18).
|
|
58
56
|
*
|
|
59
57
|
* @param {string} value - The string representation of the number to multiply.
|
|
60
|
-
* @param {number
|
|
58
|
+
* @param {number} exponent - The exponent (number of decimal places).
|
|
61
59
|
* @returns {bigint} The result as a bigint.
|
|
62
60
|
*
|
|
63
61
|
* @example
|
|
@@ -67,101 +65,7 @@ export declare class Utils {
|
|
|
67
65
|
* @example
|
|
68
66
|
* Utils.helpers.parseUnits('1.5', 18)
|
|
69
67
|
* // → 1500000000000000000n
|
|
70
|
-
*
|
|
71
|
-
* @example
|
|
72
|
-
* Utils.helpers.parseUnits('1.5', {decimals: 18})
|
|
73
|
-
* // → 1500000000000000000n
|
|
74
68
|
*/
|
|
75
|
-
parseUnits(value: string, exponent: number
|
|
76
|
-
decimals: number;
|
|
77
|
-
}): bigint;
|
|
78
|
-
/**
|
|
79
|
-
* Formats a value from smallest units to human-readable string.
|
|
80
|
-
*
|
|
81
|
-
* Supports both EVM-style (like ethers/viem) and Push-style (options object) usage patterns.
|
|
82
|
-
* Always returns a string for UI safety.
|
|
83
|
-
*
|
|
84
|
-
* @param {bigint | string} value - The value in smallest units (e.g., "1500000" or 1500000000000000000n).
|
|
85
|
-
* @param {number | {decimals: number; precision?: number}} decimalsOrOptions - Token decimals or options object.
|
|
86
|
-
* @returns {string} Human-readable string (e.g., "1.5").
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* // EVM-style usage
|
|
90
|
-
* Utils.helpers.formatUnits(1500000000000000000n, 18)
|
|
91
|
-
* // → "1.5"
|
|
92
|
-
*
|
|
93
|
-
* @example
|
|
94
|
-
* // Push-style usage
|
|
95
|
-
* Utils.helpers.formatUnits("1500000", { decimals: 6 })
|
|
96
|
-
* // → "1.5"
|
|
97
|
-
*
|
|
98
|
-
* @example
|
|
99
|
-
* // With precision (truncate after 2 decimals)
|
|
100
|
-
* Utils.helpers.formatUnits("1234567", { decimals: 6, precision: 2 })
|
|
101
|
-
* // → "1.23"
|
|
102
|
-
*/
|
|
103
|
-
formatUnits(value: bigint | string, decimalsOrOptions: number | {
|
|
104
|
-
decimals: number;
|
|
105
|
-
precision?: number;
|
|
106
|
-
}): string;
|
|
107
|
-
/**
|
|
108
|
-
* Calculates the minimum amount out after applying slippage.
|
|
109
|
-
*
|
|
110
|
-
* Given an input amount and slippage in basis points, returns the minimum amount
|
|
111
|
-
* that should be received after accounting for slippage.
|
|
112
|
-
*
|
|
113
|
-
* @param {string} amount - The input amount in smallest units (e.g., "100000000" for 100 USDC with 6 decimals)
|
|
114
|
-
* @param {object} options - Configuration options
|
|
115
|
-
* @param {number} options.slippageBps - Slippage in basis points (100 = 1%, 50 = 0.5%)
|
|
116
|
-
* @returns {string} The minimum amount out in smallest units
|
|
117
|
-
*
|
|
118
|
-
* @example
|
|
119
|
-
* // Calculate minimum amount for 100 USDC with 1% slippage
|
|
120
|
-
* const amount = PushChain.utils.helpers.parseUnits("100", 6); // "100000000"
|
|
121
|
-
* const minOut = PushChain.utils.helpers.slippageToMinAmount(amount, {
|
|
122
|
-
* slippageBps: 100, // 1%
|
|
123
|
-
* });
|
|
124
|
-
* // => "99000000" (99 USDC in smallest units)
|
|
125
|
-
*
|
|
126
|
-
* @example
|
|
127
|
-
* // Simple case with whole numbers
|
|
128
|
-
* const minOut = PushChain.utils.helpers.slippageToMinAmount("100", {
|
|
129
|
-
* slippageBps: 100, // 1%
|
|
130
|
-
* });
|
|
131
|
-
* // => "99"
|
|
132
|
-
*/
|
|
133
|
-
slippageToMinAmount(amount: string, options: {
|
|
134
|
-
slippageBps: number;
|
|
135
|
-
}): string;
|
|
136
|
-
};
|
|
137
|
-
/**
|
|
138
|
-
* Returns supported moveable tokens as a flat list with chain info.
|
|
139
|
-
* - If a specific chain or a PushChain client is passed, returns only that chain's tokens
|
|
140
|
-
* - Otherwise returns tokens across all chains
|
|
141
|
-
*/
|
|
142
|
-
static getMoveableTokens(chainOrClient?: CHAIN | PushChain): {
|
|
143
|
-
tokens: Array<{
|
|
144
|
-
chain: CHAIN;
|
|
145
|
-
symbol: string;
|
|
146
|
-
decimals: number;
|
|
147
|
-
address: string;
|
|
148
|
-
}>;
|
|
149
|
-
};
|
|
150
|
-
/**
|
|
151
|
-
* Returns supported payable tokens as a flat list with chain info.
|
|
152
|
-
* - If a specific chain or a PushChain client is passed, returns only that chain's tokens
|
|
153
|
-
* - Otherwise returns tokens across all chains
|
|
154
|
-
*/
|
|
155
|
-
static getPayableTokens(chainOrClient?: CHAIN | PushChain): {
|
|
156
|
-
tokens: Array<{
|
|
157
|
-
chain: CHAIN;
|
|
158
|
-
symbol: string;
|
|
159
|
-
decimals: number;
|
|
160
|
-
address: string;
|
|
161
|
-
}>;
|
|
69
|
+
parseUnits(value: string, exponent: number): bigint;
|
|
162
70
|
};
|
|
163
|
-
/**
|
|
164
|
-
* Internal: resolves a CHAIN enum from either a CHAIN value or a PushChain client instance.
|
|
165
|
-
*/
|
|
166
|
-
private static resolveChainFromInput;
|
|
167
71
|
}
|
package/src/lib/utils.js
CHANGED
|
@@ -4,7 +4,6 @@ exports.Utils = void 0;
|
|
|
4
4
|
const account_1 = require("./universal/account");
|
|
5
5
|
const signer_1 = require("./universal/signer");
|
|
6
6
|
const enums_1 = require("./constants/enums");
|
|
7
|
-
const tokens_1 = require("./constants/tokens");
|
|
8
7
|
const ethers_1 = require("ethers");
|
|
9
8
|
/**
|
|
10
9
|
* @dev - THESE UTILS ARE EXPORTED TO SDK CONSUMER
|
|
@@ -15,92 +14,6 @@ const ethers_1 = require("ethers");
|
|
|
15
14
|
* and universal account conversions.
|
|
16
15
|
*/
|
|
17
16
|
class Utils {
|
|
18
|
-
/**
|
|
19
|
-
* Returns supported moveable tokens as a flat list with chain info.
|
|
20
|
-
* - If a specific chain or a PushChain client is passed, returns only that chain's tokens
|
|
21
|
-
* - Otherwise returns tokens across all chains
|
|
22
|
-
*/
|
|
23
|
-
static getMoveableTokens(chainOrClient) {
|
|
24
|
-
var _a;
|
|
25
|
-
const chain = Utils.resolveChainFromInput(chainOrClient);
|
|
26
|
-
if (chain) {
|
|
27
|
-
const list = (_a = tokens_1.MOVEABLE_TOKENS[chain]) !== null && _a !== void 0 ? _a : [];
|
|
28
|
-
return {
|
|
29
|
-
tokens: list.map((t) => ({
|
|
30
|
-
chain,
|
|
31
|
-
symbol: t.symbol,
|
|
32
|
-
decimals: t.decimals,
|
|
33
|
-
address: t.address,
|
|
34
|
-
})),
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
const tokens = [];
|
|
38
|
-
for (const [key, list] of Object.entries(tokens_1.MOVEABLE_TOKENS)) {
|
|
39
|
-
const k = key;
|
|
40
|
-
for (const t of list !== null && list !== void 0 ? list : []) {
|
|
41
|
-
tokens.push({
|
|
42
|
-
chain: k,
|
|
43
|
-
symbol: t.symbol,
|
|
44
|
-
decimals: t.decimals,
|
|
45
|
-
address: t.address,
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return { tokens };
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Returns supported payable tokens as a flat list with chain info.
|
|
53
|
-
* - If a specific chain or a PushChain client is passed, returns only that chain's tokens
|
|
54
|
-
* - Otherwise returns tokens across all chains
|
|
55
|
-
*/
|
|
56
|
-
static getPayableTokens(chainOrClient) {
|
|
57
|
-
var _a;
|
|
58
|
-
const chain = Utils.resolveChainFromInput(chainOrClient);
|
|
59
|
-
if (chain) {
|
|
60
|
-
const list = (_a = tokens_1.PAYABLE_TOKENS[chain]) !== null && _a !== void 0 ? _a : [];
|
|
61
|
-
return {
|
|
62
|
-
tokens: list.map((t) => ({
|
|
63
|
-
chain,
|
|
64
|
-
symbol: t.symbol,
|
|
65
|
-
decimals: t.decimals,
|
|
66
|
-
address: t.address,
|
|
67
|
-
})),
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
const tokens = [];
|
|
71
|
-
for (const [key, list] of Object.entries(tokens_1.PAYABLE_TOKENS)) {
|
|
72
|
-
const k = key;
|
|
73
|
-
for (const t of list !== null && list !== void 0 ? list : []) {
|
|
74
|
-
tokens.push({
|
|
75
|
-
chain: k,
|
|
76
|
-
symbol: t.symbol,
|
|
77
|
-
decimals: t.decimals,
|
|
78
|
-
address: t.address,
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return { tokens };
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Internal: resolves a CHAIN enum from either a CHAIN value or a PushChain client instance.
|
|
86
|
-
*/
|
|
87
|
-
static resolveChainFromInput(chainOrClient) {
|
|
88
|
-
var _a;
|
|
89
|
-
if (!chainOrClient)
|
|
90
|
-
return undefined;
|
|
91
|
-
if (typeof chainOrClient === 'string')
|
|
92
|
-
return chainOrClient;
|
|
93
|
-
// PushChain client → get origin chain from signer account
|
|
94
|
-
try {
|
|
95
|
-
const originAccount = (_a = chainOrClient.universal) === null || _a === void 0 ? void 0 : _a.origin;
|
|
96
|
-
if (originAccount && originAccount.chain)
|
|
97
|
-
return originAccount.chain;
|
|
98
|
-
}
|
|
99
|
-
catch (_b) {
|
|
100
|
-
// ignore
|
|
101
|
-
}
|
|
102
|
-
return undefined;
|
|
103
|
-
}
|
|
104
17
|
}
|
|
105
18
|
exports.Utils = Utils;
|
|
106
19
|
Utils.account = {
|
|
@@ -194,7 +107,7 @@ Utils.helpers = {
|
|
|
194
107
|
* For example, converting "1.5" ETH to wei (18 decimals) would be parseUnits("1.5", 18).
|
|
195
108
|
*
|
|
196
109
|
* @param {string} value - The string representation of the number to multiply.
|
|
197
|
-
* @param {number
|
|
110
|
+
* @param {number} exponent - The exponent (number of decimal places).
|
|
198
111
|
* @returns {bigint} The result as a bigint.
|
|
199
112
|
*
|
|
200
113
|
* @example
|
|
@@ -204,37 +117,16 @@ Utils.helpers = {
|
|
|
204
117
|
* @example
|
|
205
118
|
* Utils.helpers.parseUnits('1.5', 18)
|
|
206
119
|
* // → 1500000000000000000n
|
|
207
|
-
*
|
|
208
|
-
* @example
|
|
209
|
-
* Utils.helpers.parseUnits('1.5', {decimals: 18})
|
|
210
|
-
* // → 1500000000000000000n
|
|
211
120
|
*/
|
|
212
121
|
parseUnits(value, exponent) {
|
|
213
122
|
// Validate inputs
|
|
214
123
|
if (typeof value !== 'string') {
|
|
215
124
|
throw new Error('Value must be a string');
|
|
216
125
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
222
|
-
else if (typeof exponent === 'object' &&
|
|
223
|
-
exponent !== null &&
|
|
224
|
-
'decimals' in exponent) {
|
|
225
|
-
actualExponent = exponent.decimals;
|
|
226
|
-
}
|
|
227
|
-
else {
|
|
228
|
-
throw new Error('Exponent must be a number or an object with decimals property');
|
|
229
|
-
}
|
|
230
|
-
if (typeof actualExponent !== 'number') {
|
|
231
|
-
throw new Error('Exponent must be a number');
|
|
232
|
-
}
|
|
233
|
-
if (!Number.isInteger(actualExponent)) {
|
|
234
|
-
throw new Error('Exponent must be an integer');
|
|
235
|
-
}
|
|
236
|
-
if (actualExponent < 0) {
|
|
237
|
-
throw new Error('Exponent must be non-negative');
|
|
126
|
+
if (typeof exponent !== 'number' ||
|
|
127
|
+
!Number.isInteger(exponent) ||
|
|
128
|
+
exponent < 0) {
|
|
129
|
+
throw new Error('Exponent must be a non-negative integer');
|
|
238
130
|
}
|
|
239
131
|
// Handle empty string
|
|
240
132
|
if (value.trim() === '') {
|
|
@@ -258,11 +150,11 @@ Utils.helpers = {
|
|
|
258
150
|
const integerPart = parts[0] || '0';
|
|
259
151
|
const fractionalPart = parts[1] || '';
|
|
260
152
|
// Check if fractional part has more digits than the exponent allows
|
|
261
|
-
if (fractionalPart.length >
|
|
262
|
-
throw new Error(`Value has more decimal places (${fractionalPart.length}) than exponent allows (${
|
|
153
|
+
if (fractionalPart.length > exponent) {
|
|
154
|
+
throw new Error(`Value has more decimal places (${fractionalPart.length}) than exponent allows (${exponent})`);
|
|
263
155
|
}
|
|
264
156
|
// Pad fractional part with zeros to match exponent
|
|
265
|
-
const paddedFractionalPart = fractionalPart.padEnd(
|
|
157
|
+
const paddedFractionalPart = fractionalPart.padEnd(exponent, '0');
|
|
266
158
|
// Combine integer and fractional parts
|
|
267
159
|
const combinedValue = integerPart + paddedFractionalPart;
|
|
268
160
|
// Convert to bigint
|
|
@@ -276,153 +168,5 @@ Utils.helpers = {
|
|
|
276
168
|
throw new Error(`Failed to parse value '${value}': ${error instanceof Error ? error.message : 'Invalid number format'}`);
|
|
277
169
|
}
|
|
278
170
|
},
|
|
279
|
-
/**
|
|
280
|
-
* Formats a value from smallest units to human-readable string.
|
|
281
|
-
*
|
|
282
|
-
* Supports both EVM-style (like ethers/viem) and Push-style (options object) usage patterns.
|
|
283
|
-
* Always returns a string for UI safety.
|
|
284
|
-
*
|
|
285
|
-
* @param {bigint | string} value - The value in smallest units (e.g., "1500000" or 1500000000000000000n).
|
|
286
|
-
* @param {number | {decimals: number; precision?: number}} decimalsOrOptions - Token decimals or options object.
|
|
287
|
-
* @returns {string} Human-readable string (e.g., "1.5").
|
|
288
|
-
*
|
|
289
|
-
* @example
|
|
290
|
-
* // EVM-style usage
|
|
291
|
-
* Utils.helpers.formatUnits(1500000000000000000n, 18)
|
|
292
|
-
* // → "1.5"
|
|
293
|
-
*
|
|
294
|
-
* @example
|
|
295
|
-
* // Push-style usage
|
|
296
|
-
* Utils.helpers.formatUnits("1500000", { decimals: 6 })
|
|
297
|
-
* // → "1.5"
|
|
298
|
-
*
|
|
299
|
-
* @example
|
|
300
|
-
* // With precision (truncate after 2 decimals)
|
|
301
|
-
* Utils.helpers.formatUnits("1234567", { decimals: 6, precision: 2 })
|
|
302
|
-
* // → "1.23"
|
|
303
|
-
*/
|
|
304
|
-
formatUnits(value, decimalsOrOptions) {
|
|
305
|
-
// Validate inputs
|
|
306
|
-
if (typeof value !== 'bigint' && typeof value !== 'string') {
|
|
307
|
-
throw new Error('Value must be a bigint or string');
|
|
308
|
-
}
|
|
309
|
-
// Extract decimals and precision from the second parameter
|
|
310
|
-
let decimals;
|
|
311
|
-
let precision;
|
|
312
|
-
if (typeof decimalsOrOptions === 'number') {
|
|
313
|
-
// EVM-style: formatUnits(value, decimals)
|
|
314
|
-
decimals = decimalsOrOptions;
|
|
315
|
-
}
|
|
316
|
-
else if (typeof decimalsOrOptions === 'object' &&
|
|
317
|
-
decimalsOrOptions !== null &&
|
|
318
|
-
'decimals' in decimalsOrOptions) {
|
|
319
|
-
// Push-style: formatUnits(value, { decimals, precision? })
|
|
320
|
-
decimals = decimalsOrOptions.decimals;
|
|
321
|
-
precision = decimalsOrOptions.precision;
|
|
322
|
-
}
|
|
323
|
-
else {
|
|
324
|
-
throw new Error('Second parameter must be a number (decimals) or an object with decimals property');
|
|
325
|
-
}
|
|
326
|
-
// Validate decimals
|
|
327
|
-
if (typeof decimals !== 'number') {
|
|
328
|
-
throw new Error('Decimals must be a number');
|
|
329
|
-
}
|
|
330
|
-
if (!Number.isInteger(decimals)) {
|
|
331
|
-
throw new Error('Decimals must be an integer');
|
|
332
|
-
}
|
|
333
|
-
if (decimals < 0) {
|
|
334
|
-
throw new Error('Decimals must be non-negative');
|
|
335
|
-
}
|
|
336
|
-
// Validate precision if provided
|
|
337
|
-
if (precision !== undefined) {
|
|
338
|
-
if (typeof precision !== 'number') {
|
|
339
|
-
throw new Error('Precision must be a number');
|
|
340
|
-
}
|
|
341
|
-
if (!Number.isInteger(precision)) {
|
|
342
|
-
throw new Error('Precision must be an integer');
|
|
343
|
-
}
|
|
344
|
-
if (precision < 0) {
|
|
345
|
-
throw new Error('Precision must be non-negative');
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
try {
|
|
349
|
-
// Convert string to bigint if needed
|
|
350
|
-
const bigintValue = typeof value === 'string' ? BigInt(value) : value;
|
|
351
|
-
// Use ethers to format the units
|
|
352
|
-
const formatted = ethers_1.ethers.formatUnits(bigintValue, decimals);
|
|
353
|
-
// Apply precision if specified
|
|
354
|
-
if (precision !== undefined) {
|
|
355
|
-
const num = parseFloat(formatted);
|
|
356
|
-
const factor = Math.pow(10, precision);
|
|
357
|
-
const truncated = Math.floor(num * factor) / factor;
|
|
358
|
-
return truncated.toString();
|
|
359
|
-
}
|
|
360
|
-
return formatted;
|
|
361
|
-
}
|
|
362
|
-
catch (error) {
|
|
363
|
-
throw new Error(`Failed to format units: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
364
|
-
}
|
|
365
|
-
},
|
|
366
|
-
/**
|
|
367
|
-
* Calculates the minimum amount out after applying slippage.
|
|
368
|
-
*
|
|
369
|
-
* Given an input amount and slippage in basis points, returns the minimum amount
|
|
370
|
-
* that should be received after accounting for slippage.
|
|
371
|
-
*
|
|
372
|
-
* @param {string} amount - The input amount in smallest units (e.g., "100000000" for 100 USDC with 6 decimals)
|
|
373
|
-
* @param {object} options - Configuration options
|
|
374
|
-
* @param {number} options.slippageBps - Slippage in basis points (100 = 1%, 50 = 0.5%)
|
|
375
|
-
* @returns {string} The minimum amount out in smallest units
|
|
376
|
-
*
|
|
377
|
-
* @example
|
|
378
|
-
* // Calculate minimum amount for 100 USDC with 1% slippage
|
|
379
|
-
* const amount = PushChain.utils.helpers.parseUnits("100", 6); // "100000000"
|
|
380
|
-
* const minOut = PushChain.utils.helpers.slippageToMinAmount(amount, {
|
|
381
|
-
* slippageBps: 100, // 1%
|
|
382
|
-
* });
|
|
383
|
-
* // => "99000000" (99 USDC in smallest units)
|
|
384
|
-
*
|
|
385
|
-
* @example
|
|
386
|
-
* // Simple case with whole numbers
|
|
387
|
-
* const minOut = PushChain.utils.helpers.slippageToMinAmount("100", {
|
|
388
|
-
* slippageBps: 100, // 1%
|
|
389
|
-
* });
|
|
390
|
-
* // => "99"
|
|
391
|
-
*/
|
|
392
|
-
slippageToMinAmount(amount, options) {
|
|
393
|
-
// Validate inputs
|
|
394
|
-
if (typeof amount !== 'string') {
|
|
395
|
-
throw new Error('Amount must be a string');
|
|
396
|
-
}
|
|
397
|
-
if (typeof options.slippageBps !== 'number') {
|
|
398
|
-
throw new Error('slippageBps must be a number');
|
|
399
|
-
}
|
|
400
|
-
if (!Number.isInteger(options.slippageBps)) {
|
|
401
|
-
throw new Error('slippageBps must be an integer');
|
|
402
|
-
}
|
|
403
|
-
if (options.slippageBps < 0) {
|
|
404
|
-
throw new Error('slippageBps must be non-negative');
|
|
405
|
-
}
|
|
406
|
-
if (options.slippageBps > 10000) {
|
|
407
|
-
throw new Error('slippageBps cannot exceed 10000 (100%)');
|
|
408
|
-
}
|
|
409
|
-
// Handle empty string
|
|
410
|
-
if (amount.trim() === '') {
|
|
411
|
-
throw new Error('Amount cannot be empty');
|
|
412
|
-
}
|
|
413
|
-
try {
|
|
414
|
-
// Convert amount to BigInt for precise calculation
|
|
415
|
-
const amountBigInt = BigInt(amount);
|
|
416
|
-
// Calculate slippage factor: (10000 - slippageBps) / 10000
|
|
417
|
-
// For 1% slippage (100 bps): (10000 - 100) / 10000 = 0.99
|
|
418
|
-
const slippageFactor = BigInt(10000 - options.slippageBps);
|
|
419
|
-
// Calculate minimum amount: amount * slippageFactor / 10000
|
|
420
|
-
const minAmountBigInt = (amountBigInt * slippageFactor) / BigInt(10000);
|
|
421
|
-
return minAmountBigInt.toString();
|
|
422
|
-
}
|
|
423
|
-
catch (error) {
|
|
424
|
-
throw new Error(`Failed to calculate slippage: ${error instanceof Error ? error.message : 'Invalid amount format'}`);
|
|
425
|
-
}
|
|
426
|
-
},
|
|
427
171
|
};
|
|
428
172
|
//# sourceMappingURL=utils.js.map
|
package/src/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../packages/core/src/lib/utils.ts"],"names":[],"mappings":";;;AAAA,iDAM6B;AAC7B,+CAI4B;AAC5B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,KAAK,YAAY,KAAK;gBACtB,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EACxC,CAAC;gBACD,MAAM,KAAK,CAAC;YACd,CAAC;YACD,MAAM,IAAI,KAAK,CACb,0BAA0B,KAAK,MAC7B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,uBAC3C,EAAE,CACH,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export declare const ERC20_EVM: readonly [{
|
|
2
|
-
readonly type: "function";
|
|
3
|
-
readonly name: "allowance";
|
|
4
|
-
readonly inputs: readonly [{
|
|
5
|
-
readonly name: "owner";
|
|
6
|
-
readonly type: "address";
|
|
7
|
-
readonly internalType: "address";
|
|
8
|
-
}, {
|
|
9
|
-
readonly name: "spender";
|
|
10
|
-
readonly type: "address";
|
|
11
|
-
readonly internalType: "address";
|
|
12
|
-
}];
|
|
13
|
-
readonly outputs: readonly [{
|
|
14
|
-
readonly name: "";
|
|
15
|
-
readonly type: "uint256";
|
|
16
|
-
readonly internalType: "uint256";
|
|
17
|
-
}];
|
|
18
|
-
readonly stateMutability: "view";
|
|
19
|
-
}, {
|
|
20
|
-
readonly type: "function";
|
|
21
|
-
readonly name: "approve";
|
|
22
|
-
readonly inputs: readonly [{
|
|
23
|
-
readonly name: "spender";
|
|
24
|
-
readonly type: "address";
|
|
25
|
-
readonly internalType: "address";
|
|
26
|
-
}, {
|
|
27
|
-
readonly name: "amount";
|
|
28
|
-
readonly type: "uint256";
|
|
29
|
-
readonly internalType: "uint256";
|
|
30
|
-
}];
|
|
31
|
-
readonly outputs: readonly [{
|
|
32
|
-
readonly name: "";
|
|
33
|
-
readonly type: "bool";
|
|
34
|
-
}];
|
|
35
|
-
readonly stateMutability: "nonpayable";
|
|
36
|
-
}];
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ERC20_EVM = void 0;
|
|
4
|
-
exports.ERC20_EVM = [
|
|
5
|
-
{
|
|
6
|
-
type: 'function',
|
|
7
|
-
name: 'allowance',
|
|
8
|
-
inputs: [
|
|
9
|
-
{ name: 'owner', type: 'address', internalType: 'address' },
|
|
10
|
-
{ name: 'spender', type: 'address', internalType: 'address' },
|
|
11
|
-
],
|
|
12
|
-
outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
|
|
13
|
-
stateMutability: 'view',
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
type: 'function',
|
|
17
|
-
name: 'approve',
|
|
18
|
-
inputs: [
|
|
19
|
-
{ name: 'spender', type: 'address', internalType: 'address' },
|
|
20
|
-
{ name: 'amount', type: 'uint256', internalType: 'uint256' },
|
|
21
|
-
],
|
|
22
|
-
outputs: [{ name: '', type: 'bool' }],
|
|
23
|
-
stateMutability: 'nonpayable',
|
|
24
|
-
},
|
|
25
|
-
];
|
|
26
|
-
//# sourceMappingURL=erc20.evm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"erc20.evm.js","sourceRoot":"","sources":["../../../../../../../packages/core/src/lib/constants/abi/erc20.evm.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG;IACvB;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,WAAW;QACjB,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE;YAC3D,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE;SAC9D;QACD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;QACjE,eAAe,EAAE,MAAM;KACxB;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,SAAS;QACf,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE;YAC7D,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE;SAC7D;QACD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QACrC,eAAe,EAAE,YAAY;KAC9B;CACO,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export declare const UNIVERSAL_GATEWAY_V0: ({
|
|
2
|
-
type: string;
|
|
3
|
-
name: string;
|
|
4
|
-
inputs: never[];
|
|
5
|
-
outputs: {
|
|
6
|
-
name: string;
|
|
7
|
-
type: string;
|
|
8
|
-
internalType: string;
|
|
9
|
-
}[];
|
|
10
|
-
stateMutability: string;
|
|
11
|
-
} | {
|
|
12
|
-
type: string;
|
|
13
|
-
name: string;
|
|
14
|
-
inputs: ({
|
|
15
|
-
name: string;
|
|
16
|
-
type: string;
|
|
17
|
-
internalType: string;
|
|
18
|
-
components?: undefined;
|
|
19
|
-
} | {
|
|
20
|
-
name: string;
|
|
21
|
-
type: string;
|
|
22
|
-
internalType: string;
|
|
23
|
-
components: {
|
|
24
|
-
name: string;
|
|
25
|
-
type: string;
|
|
26
|
-
internalType: string;
|
|
27
|
-
}[];
|
|
28
|
-
})[];
|
|
29
|
-
outputs: never[];
|
|
30
|
-
stateMutability: string;
|
|
31
|
-
})[];
|