@hinkal/common 0.1.12 → 0.1.13

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.
Files changed (53) hide show
  1. package/_virtual/_commonjsHelpers.cjs +1 -0
  2. package/_virtual/_commonjsHelpers.mjs +6 -0
  3. package/_virtual/browser.cjs +1 -0
  4. package/_virtual/browser.mjs +4 -0
  5. package/_virtual/index.cjs +1 -0
  6. package/_virtual/index.mjs +4 -0
  7. package/_virtual/index2.cjs +1 -0
  8. package/_virtual/index2.mjs +4 -0
  9. package/_virtual/index3.cjs +1 -0
  10. package/_virtual/index3.mjs +4 -0
  11. package/crypto/preProcessing.cjs +1 -1
  12. package/crypto/preProcessing.mjs +8 -5
  13. package/data-structures/Hinkal/Hinkal.cjs +1 -1
  14. package/data-structures/Hinkal/Hinkal.mjs +4 -2
  15. package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
  16. package/data-structures/Hinkal/hinkalPrivateWallet.mjs +9 -7
  17. package/data-structures/event-service/AbstractAccessTokenSnapshotService.cjs +1 -1
  18. package/data-structures/event-service/AbstractAccessTokenSnapshotService.mjs +7 -5
  19. package/data-structures/event-service/AbstractCommitmentsSnapshotService.cjs +1 -1
  20. package/data-structures/event-service/AbstractCommitmentsSnapshotService.mjs +4 -2
  21. package/data-structures/snapshot/ClientAccessTokenSnapshotService.cjs +1 -1
  22. package/data-structures/snapshot/ClientAccessTokenSnapshotService.mjs +10 -8
  23. package/data-structures/snapshot/ClientCommitmentsSnapshotService.cjs +1 -1
  24. package/data-structures/snapshot/ClientCommitmentsSnapshotService.mjs +10 -8
  25. package/data-structures/snapshot/ClientNullifierSnapshotService.cjs +1 -1
  26. package/data-structures/snapshot/ClientNullifierSnapshotService.mjs +4 -2
  27. package/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
  28. package/functions/pre-transaction/outputUtxoProcessing.mjs +6 -4
  29. package/functions/pre-transaction/processAmountChanges.cjs +1 -1
  30. package/functions/pre-transaction/processAmountChanges.mjs +9 -7
  31. package/functions/protocols/pendle.helpers.cjs +1 -1
  32. package/functions/protocols/pendle.helpers.mjs +12 -10
  33. package/functions/staking/index.cjs +1 -1
  34. package/functions/staking/index.mjs +23 -21
  35. package/functions/utils/index.d.ts +1 -0
  36. package/functions/utils/polyfills.cjs +1 -0
  37. package/functions/utils/polyfills.d.ts +219 -0
  38. package/functions/utils/polyfills.mjs +40 -0
  39. package/functions/web3/odosAPI.cjs +1 -1
  40. package/functions/web3/odosAPI.mjs +11 -9
  41. package/functions/web3/oneInchAPI.cjs +1 -1
  42. package/functions/web3/oneInchAPI.mjs +4 -2
  43. package/functions/web3/runContractFunction.cjs +1 -1
  44. package/functions/web3/runContractFunction.mjs +17 -15
  45. package/functions/web3/uniswapAPI.cjs +1 -1
  46. package/functions/web3/uniswapAPI.mjs +4 -2
  47. package/index.cjs +1 -1
  48. package/index.mjs +205 -202
  49. package/package.json +1 -1
  50. package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
  51. package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
  52. package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
  53. package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("ethers"),y=require("../../data-structures/crypto-keys/keys.cjs"),s=require("libsodium-wrappers"),c=require("../../crypto/poseidon.cjs");require("circomlibjs");const f=(e,t,r)=>{const n=o.ethers.utils.defaultAbiCoder.encode(["uint256","address"],[e,t]),a=s.crypto_box_seal(n,o.ethers.utils.arrayify(r));return`0x${Buffer.from(a).toString("hex")}`},p=(e,t)=>{const r=Buffer.from(e.slice(2),"hex"),{publicKey:n,privateKey:a}=y.UserKeys.getEncryptionKeyPair(t.getShieldedPrivateKey());try{const i=s.crypto_box_seal_open(r,o.ethers.utils.arrayify(n),o.ethers.utils.arrayify(a)),d=Buffer.from(i).toString("utf-8"),[u,l]=o.ethers.utils.defaultAbiCoder.decode(["uint256","address"],d);return{stakeBlinding:u.toBigInt(),stakedTokenRecipient:l}}catch{console.log("failed to decrypt");return}},S=(e,t,r,n,a,i)=>BigInt(c.poseidonHash(...[e,t,r,n,a,i].map(BigInt))),k=(e,t)=>c.poseidonHash(e,t),g=(e,t,r,n,a)=>o.ethers.utils.defaultAbiCoder.encode(["uint8","uint256","address","bytes","bytes"],[e,t,r,n,a]);exports.calculateStakeNullifier=k;exports.createStakeCommitment=S;exports.decryptStake=p;exports.encodeHStakeMetadata=g;exports.encryptStake=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("ethers"),y=require("../../data-structures/crypto-keys/keys.cjs"),s=require("libsodium-wrappers"),c=require("../../crypto/poseidon.cjs");require("circomlibjs");require("../../node_modules/buffer/index.cjs");require("../../node_modules/process/browser.cjs");const f=(e,t,r)=>{const n=i.ethers.utils.defaultAbiCoder.encode(["uint256","address"],[e,t]),a=s.crypto_box_seal(n,i.ethers.utils.arrayify(r));return`0x${Buffer.from(a).toString("hex")}`},p=(e,t)=>{const r=Buffer.from(e.slice(2),"hex"),{publicKey:n,privateKey:a}=y.UserKeys.getEncryptionKeyPair(t.getShieldedPrivateKey());try{const o=s.crypto_box_seal_open(r,i.ethers.utils.arrayify(n),i.ethers.utils.arrayify(a)),d=Buffer.from(o).toString("utf-8"),[u,l]=i.ethers.utils.defaultAbiCoder.decode(["uint256","address"],d);return{stakeBlinding:u.toBigInt(),stakedTokenRecipient:l}}catch{console.log("failed to decrypt");return}},S=(e,t,r,n,a,o)=>BigInt(c.poseidonHash(...[e,t,r,n,a,o].map(BigInt))),k=(e,t)=>c.poseidonHash(e,t),g=(e,t,r,n,a)=>i.ethers.utils.defaultAbiCoder.encode(["uint8","uint256","address","bytes","bytes"],[e,t,r,n,a]);exports.calculateStakeNullifier=k;exports.createStakeCommitment=S;exports.decryptStake=p;exports.encodeHStakeMetadata=g;exports.encryptStake=f;
@@ -1,40 +1,42 @@
1
- import { ethers as i } from "ethers";
2
- import { UserKeys as f } from "../../data-structures/crypto-keys/keys.mjs";
1
+ import { ethers as n } from "ethers";
2
+ import { UserKeys as y } from "../../data-structures/crypto-keys/keys.mjs";
3
3
  import s from "libsodium-wrappers";
4
4
  import { poseidonHash as c } from "../../crypto/poseidon.mjs";
5
5
  import "circomlibjs";
6
- const S = (t, e, r) => {
7
- const o = i.utils.defaultAbiCoder.encode(
6
+ import "../../node_modules/buffer/index.mjs";
7
+ import "../../node_modules/process/browser.mjs";
8
+ const B = (t, e, r) => {
9
+ const o = n.utils.defaultAbiCoder.encode(
8
10
  ["uint256", "address"],
9
11
  [t, e]
10
- ), n = s.crypto_box_seal(o, i.utils.arrayify(r));
11
- return `0x${Buffer.from(n).toString("hex")}`;
12
- }, k = (t, e) => {
13
- const r = Buffer.from(t.slice(2), "hex"), { publicKey: o, privateKey: n } = f.getEncryptionKeyPair(e.getShieldedPrivateKey());
12
+ ), i = s.crypto_box_seal(o, n.utils.arrayify(r));
13
+ return `0x${Buffer.from(i).toString("hex")}`;
14
+ }, h = (t, e) => {
15
+ const r = Buffer.from(t.slice(2), "hex"), { publicKey: o, privateKey: i } = y.getEncryptionKeyPair(e.getShieldedPrivateKey());
14
16
  try {
15
17
  const a = s.crypto_box_seal_open(
16
18
  r,
17
- i.utils.arrayify(o),
18
- i.utils.arrayify(n)
19
- ), d = Buffer.from(a).toString("utf-8"), [u, y] = i.utils.defaultAbiCoder.decode(
19
+ n.utils.arrayify(o),
20
+ n.utils.arrayify(i)
21
+ ), d = Buffer.from(a).toString("utf-8"), [u, p] = n.utils.defaultAbiCoder.decode(
20
22
  ["uint256", "address"],
21
23
  d
22
24
  );
23
- return { stakeBlinding: u.toBigInt(), stakedTokenRecipient: y };
25
+ return { stakeBlinding: u.toBigInt(), stakedTokenRecipient: p };
24
26
  } catch {
25
27
  console.log("failed to decrypt");
26
28
  return;
27
29
  }
28
- }, B = (t, e, r, o, n, a) => BigInt(
29
- c(...[t, e, r, o, n, a].map(BigInt))
30
- ), h = (t, e) => c(t, e), x = (t, e, r, o, n) => i.utils.defaultAbiCoder.encode(
30
+ }, x = (t, e, r, o, i, a) => BigInt(
31
+ c(...[t, e, r, o, i, a].map(BigInt))
32
+ ), K = (t, e) => c(t, e), _ = (t, e, r, o, i) => n.utils.defaultAbiCoder.encode(
31
33
  ["uint8", "uint256", "address", "bytes", "bytes"],
32
- [t, e, r, o, n]
34
+ [t, e, r, o, i]
33
35
  );
34
36
  export {
35
- h as calculateStakeNullifier,
36
- B as createStakeCommitment,
37
- k as decryptStake,
38
- x as encodeHStakeMetadata,
39
- S as encryptStake
37
+ K as calculateStakeNullifier,
38
+ x as createStakeCommitment,
39
+ h as decryptStake,
40
+ _ as encodeHStakeMetadata,
41
+ B as encryptStake
40
42
  };
@@ -17,3 +17,4 @@ export * from './nickname.utils';
17
17
  export * from './caseInsensitive.utils';
18
18
  export * from './time.utils';
19
19
  export * from './volatile-patcher.utils';
20
+ export * from './polyfills';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class r extends Uint8Array{length;prototype}class s{env;platform;versions;constructor(){this.env={},this.platform="browser",this.versions={}}nextTick(t,...o){}uptime(){return 0}memoryUsage(){return{rss:0,heapTotal:0,heapUsed:0,external:0}}cpuUsage(){return{user:0,system:0}}_start}exports.Buffer=r;exports.ProcessPolyfill=s;
@@ -0,0 +1,219 @@
1
+ export declare class Buffer extends Uint8Array {
2
+ length: number;
3
+ write(string: string, offset?: number, length?: number, encoding?: string): number;
4
+ toString(encoding?: string, start?: number, end?: number): string;
5
+ toJSON(): {
6
+ type: 'Buffer';
7
+ data: any[];
8
+ };
9
+ equals(otherBuffer: Buffer): boolean;
10
+ compare(otherBuffer: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
11
+ copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
12
+ slice(start?: number, end?: number): Buffer;
13
+ writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
14
+ writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
15
+ writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
16
+ writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
17
+ readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
18
+ readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
19
+ readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
20
+ readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
21
+ readUInt8(offset: number, noAssert?: boolean): number;
22
+ readUInt16LE(offset: number, noAssert?: boolean): number;
23
+ readUInt16BE(offset: number, noAssert?: boolean): number;
24
+ readUInt32LE(offset: number, noAssert?: boolean): number;
25
+ readUInt32BE(offset: number, noAssert?: boolean): number;
26
+ readBigUInt64LE(offset: number): BigInt;
27
+ readBigUInt64BE(offset: number): BigInt;
28
+ readInt8(offset: number, noAssert?: boolean): number;
29
+ readInt16LE(offset: number, noAssert?: boolean): number;
30
+ readInt16BE(offset: number, noAssert?: boolean): number;
31
+ readInt32LE(offset: number, noAssert?: boolean): number;
32
+ readInt32BE(offset: number, noAssert?: boolean): number;
33
+ readBigInt64LE(offset: number): BigInt;
34
+ readBigInt64BE(offset: number): BigInt;
35
+ readFloatLE(offset: number, noAssert?: boolean): number;
36
+ readFloatBE(offset: number, noAssert?: boolean): number;
37
+ readDoubleLE(offset: number, noAssert?: boolean): number;
38
+ readDoubleBE(offset: number, noAssert?: boolean): number;
39
+ reverse(): this;
40
+ swap16(): Buffer;
41
+ swap32(): Buffer;
42
+ swap64(): Buffer;
43
+ writeUInt8(value: number, offset: number, noAssert?: boolean): number;
44
+ writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
45
+ writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
46
+ writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
47
+ writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
48
+ writeBigUInt64LE(value: number, offset: number): BigInt;
49
+ writeBigUInt64BE(value: number, offset: number): BigInt;
50
+ writeInt8(value: number, offset: number, noAssert?: boolean): number;
51
+ writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
52
+ writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
53
+ writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
54
+ writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
55
+ writeBigInt64LE(value: number, offset: number): BigInt;
56
+ writeBigInt64BE(value: number, offset: number): BigInt;
57
+ writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
58
+ writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
59
+ writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
60
+ writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
61
+ fill(value: any, offset?: number, end?: number): this;
62
+ indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
63
+ lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
64
+ includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean;
65
+ /**
66
+ * Allocates a new buffer containing the given {str}.
67
+ *
68
+ * @param str String to store in buffer.
69
+ * @param encoding encoding to use, optional. Default is 'utf8'
70
+ */
71
+ constructor(str: string, encoding?: string);
72
+ /**
73
+ * Allocates a new buffer of {size} octets.
74
+ *
75
+ * @param size count of octets to allocate.
76
+ */
77
+ constructor(size: number);
78
+ /**
79
+ * Allocates a new buffer containing the given {array} of octets.
80
+ *
81
+ * @param array The octets to store.
82
+ */
83
+ constructor(array: Uint8Array);
84
+ /**
85
+ * Produces a Buffer backed by the same allocated memory as
86
+ * the given {ArrayBuffer}.
87
+ *
88
+ *
89
+ * @param arrayBuffer The ArrayBuffer with which to share memory.
90
+ */
91
+ constructor(arrayBuffer: ArrayBuffer);
92
+ /**
93
+ * Allocates a new buffer containing the given {array} of octets.
94
+ *
95
+ * @param array The octets to store.
96
+ */
97
+ constructor(array: any[]);
98
+ /**
99
+ * Copies the passed {buffer} data onto a new {Buffer} instance.
100
+ *
101
+ * @param buffer The buffer to copy.
102
+ */
103
+ constructor(buffer: Buffer);
104
+ prototype: Buffer;
105
+ /**
106
+ * Allocates a new Buffer using an {array} of octets.
107
+ *
108
+ * @param array
109
+ */
110
+ static from(array: any[]): Buffer;
111
+ /**
112
+ * When passed a reference to the .buffer property of a TypedArray instance,
113
+ * the newly created Buffer will share the same allocated memory as the TypedArray.
114
+ * The optional {byteOffset} and {length} arguments specify a memory range
115
+ * within the {arrayBuffer} that will be shared by the Buffer.
116
+ *
117
+ * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
118
+ * @param byteOffset
119
+ * @param length
120
+ */
121
+ static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
122
+ /**
123
+ * Copies the passed {buffer} data onto a new Buffer instance.
124
+ *
125
+ * @param buffer
126
+ */
127
+ static from(buffer: Buffer | Uint8Array): Buffer;
128
+ /**
129
+ * Creates a new Buffer containing the given JavaScript string {str}.
130
+ * If provided, the {encoding} parameter identifies the character encoding.
131
+ * If not provided, {encoding} defaults to 'utf8'.
132
+ *
133
+ * @param str
134
+ */
135
+ static from(str: string, encoding?: string): Buffer;
136
+ /**
137
+ * Returns true if {obj} is a Buffer
138
+ *
139
+ * @param obj object to test.
140
+ */
141
+ static isBuffer(obj: any): obj is Buffer;
142
+ /**
143
+ * Returns true if {encoding} is a valid encoding argument.
144
+ * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
145
+ *
146
+ * @param encoding string to test.
147
+ */
148
+ static isEncoding(encoding: string): boolean;
149
+ /**
150
+ * Gives the actual byte length of a string. encoding defaults to 'utf8'.
151
+ * This is not the same as String.prototype.length since that returns the number of characters in a string.
152
+ *
153
+ * @param string string to test.
154
+ * @param encoding encoding used to evaluate (defaults to 'utf8')
155
+ */
156
+ static byteLength(string: string, encoding?: string): number;
157
+ /**
158
+ * Returns a buffer which is the result of concatenating all the buffers in the list together.
159
+ *
160
+ * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
161
+ * If the list has exactly one item, then the first item of the list is returned.
162
+ * If the list has more than one item, then a new Buffer is created.
163
+ *
164
+ * @param list An array of Buffer objects to concatenate
165
+ * @param totalLength Total length of the buffers when concatenated.
166
+ * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
167
+ */
168
+ static concat(list: Uint8Array[], totalLength?: number): Buffer;
169
+ /**
170
+ * The same as buf1.compare(buf2).
171
+ */
172
+ static compare(buf1: Uint8Array, buf2: Uint8Array): number;
173
+ /**
174
+ * Allocates a new buffer of {size} octets.
175
+ *
176
+ * @param size count of octets to allocate.
177
+ * @param fill if specified, buffer will be initialized by calling buf.fill(fill).
178
+ * If parameter is omitted, buffer will be filled with zeros.
179
+ * @param encoding encoding used for call to buf.fill while initializing
180
+ */
181
+ static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;
182
+ /**
183
+ * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
184
+ * of the newly created Buffer are unknown and may contain sensitive data.
185
+ *
186
+ * @param size count of octets to allocate
187
+ */
188
+ static allocUnsafe(size: number): Buffer;
189
+ /**
190
+ * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
191
+ * of the newly created Buffer are unknown and may contain sensitive data.
192
+ *
193
+ * @param size count of octets to allocate
194
+ */
195
+ static allocUnsafeSlow(size: number): Buffer;
196
+ }
197
+ export declare class ProcessPolyfill {
198
+ env: {
199
+ [key: string]: string;
200
+ };
201
+ platform: string;
202
+ versions: {
203
+ [key: string]: string;
204
+ };
205
+ constructor();
206
+ nextTick(callback: Function, ...args: any[]): void;
207
+ uptime(): number;
208
+ memoryUsage(): {
209
+ rss: number;
210
+ heapTotal: number;
211
+ heapUsed: number;
212
+ external: number;
213
+ };
214
+ cpuUsage(): {
215
+ user: number;
216
+ system: number;
217
+ };
218
+ _start?: number;
219
+ }
@@ -0,0 +1,40 @@
1
+ class t extends Uint8Array {
2
+ length;
3
+ prototype;
4
+ }
5
+ class a {
6
+ env;
7
+ // Environment variables
8
+ platform;
9
+ // Simulates `process.platform`
10
+ versions;
11
+ // Simulates `process.versions`
12
+ constructor() {
13
+ this.env = {}, this.platform = "browser", this.versions = {};
14
+ }
15
+ nextTick(r, ...s) {
16
+ }
17
+ uptime() {
18
+ return 0;
19
+ }
20
+ memoryUsage() {
21
+ return {
22
+ rss: 0,
23
+ heapTotal: 0,
24
+ heapUsed: 0,
25
+ external: 0
26
+ };
27
+ }
28
+ cpuUsage() {
29
+ return {
30
+ user: 0,
31
+ system: 0
32
+ };
33
+ }
34
+ _start;
35
+ // To track when the application started
36
+ }
37
+ export {
38
+ t as Buffer,
39
+ a as ProcessPolyfill
40
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../API/callOdosAPI.cjs"),n=require("../../constants/chains.constants.cjs");require("../../constants/vite.constants.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");const d=require("../../constants/protocol.constants.cjs");require("../../constants/coingecko.constants.cjs");require("../../constants/axelar.constants.cjs");require("../../constants/rewards.constants.cjs");require("../../constants/reorg-depths.constants.cjs");const a=require("../../error-handling/error-codes.constants.cjs"),q=require("./etherFunctions.cjs");require("axios");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");require("circomlibjs");require("ethers");const A=async(r,e,o,u)=>{try{const t={chainId:r.getCurrentChainId()!==31337?r.getCurrentChainId():n.localhostNetwork,inputTokens:[{tokenAddress:e?.wrappedErc20TokenAddress??e.erc20TokenAddress,amount:q.getAmountInWei(e,u).toString()}],outputTokens:[{tokenAddress:o?.wrappedErc20TokenAddress??o.erc20TokenAddress,proportion:1}],userAddr:n.networkRegistry[r.getCurrentChainId()].contractData.odosExternalActionInstanceAddress||d.zeroAddress,slippageLimitPercent:10,disableRFQs:!0},{odosResponse:s,status:c}=await i.callOdosAPI(r.getCurrentChainId(),t);if(c!=="success")throw Error("Odos API Fetch Error");return{outSwapAmountValue:BigInt(s.outputTokens[0].amount),odosDataValue:s.transaction.data}}catch(t){throw console.log({error:t}),Error(a.transactionErrorCodes.NO_ODOS_PRICE)}};exports.getOdosPrice=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../API/callOdosAPI.cjs"),n=require("../../constants/chains.constants.cjs");require("../../constants/vite.constants.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");const d=require("../../constants/protocol.constants.cjs");require("../../constants/coingecko.constants.cjs");require("../../constants/axelar.constants.cjs");require("../../constants/rewards.constants.cjs");require("../../constants/reorg-depths.constants.cjs");const a=require("../../error-handling/error-codes.constants.cjs"),q=require("./etherFunctions.cjs");require("axios");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");require("circomlibjs");require("ethers");require("../../node_modules/buffer/index.cjs");require("../../node_modules/process/browser.cjs");const A=async(r,e,o,u)=>{try{const t={chainId:r.getCurrentChainId()!==31337?r.getCurrentChainId():n.localhostNetwork,inputTokens:[{tokenAddress:e?.wrappedErc20TokenAddress??e.erc20TokenAddress,amount:q.getAmountInWei(e,u).toString()}],outputTokens:[{tokenAddress:o?.wrappedErc20TokenAddress??o.erc20TokenAddress,proportion:1}],userAddr:n.networkRegistry[r.getCurrentChainId()].contractData.odosExternalActionInstanceAddress||d.zeroAddress,slippageLimitPercent:10,disableRFQs:!0},{odosResponse:s,status:i}=await c.callOdosAPI(r.getCurrentChainId(),t);if(i!=="success")throw Error("Odos API Fetch Error");return{outSwapAmountValue:BigInt(s.outputTokens[0].amount),odosDataValue:s.transaction.data}}catch(t){throw console.log({error:t}),Error(a.transactionErrorCodes.NO_ODOS_PRICE)}};exports.getOdosPrice=A;
@@ -1,9 +1,9 @@
1
- import { callOdosAPI as i } from "../../API/callOdosAPI.mjs";
2
- import { localhostNetwork as a, networkRegistry as p } from "../../constants/chains.constants.mjs";
1
+ import { callOdosAPI as d } from "../../API/callOdosAPI.mjs";
2
+ import { localhostNetwork as p, networkRegistry as m } from "../../constants/chains.constants.mjs";
3
3
  import "../../constants/vite.constants.mjs";
4
4
  import "../../constants/contracts.constants.mjs";
5
5
  import "../../constants/kyc.constants.mjs";
6
- import { zeroAddress as m } from "../../constants/protocol.constants.mjs";
6
+ import { zeroAddress as a } from "../../constants/protocol.constants.mjs";
7
7
  import "../../constants/coingecko.constants.mjs";
8
8
  import "../../constants/axelar.constants.mjs";
9
9
  import "../../constants/rewards.constants.mjs";
@@ -16,10 +16,12 @@ import "../../types/transactions.types.mjs";
16
16
  import "../../types/curve.types.mjs";
17
17
  import "circomlibjs";
18
18
  import "ethers";
19
- const N = async (r, t, e, n) => {
19
+ import "../../node_modules/buffer/index.mjs";
20
+ import "../../node_modules/process/browser.mjs";
21
+ const _ = async (r, t, e, n) => {
20
22
  try {
21
23
  const o = {
22
- chainId: r.getCurrentChainId() !== 31337 ? r.getCurrentChainId() : a,
24
+ chainId: r.getCurrentChainId() !== 31337 ? r.getCurrentChainId() : p,
23
25
  inputTokens: [
24
26
  {
25
27
  tokenAddress: t?.wrappedErc20TokenAddress ?? t.erc20TokenAddress,
@@ -32,15 +34,15 @@ const N = async (r, t, e, n) => {
32
34
  proportion: 1
33
35
  }
34
36
  ],
35
- userAddr: p[r.getCurrentChainId()].contractData.odosExternalActionInstanceAddress || m,
37
+ userAddr: m[r.getCurrentChainId()].contractData.odosExternalActionInstanceAddress || a,
36
38
  slippageLimitPercent: 10,
37
39
  disableRFQs: !0
38
40
  // sometimes swap fails because of RFQs
39
- }, { odosResponse: s, status: d } = await i(
41
+ }, { odosResponse: s, status: i } = await d(
40
42
  r.getCurrentChainId(),
41
43
  o
42
44
  );
43
- if (d !== "success")
45
+ if (i !== "success")
44
46
  throw Error("Odos API Fetch Error");
45
47
  return {
46
48
  outSwapAmountValue: BigInt(s.outputTokens[0].amount),
@@ -51,5 +53,5 @@ const N = async (r, t, e, n) => {
51
53
  }
52
54
  };
53
55
  export {
54
- N as getOdosPrice
56
+ _ as getOdosPrice
55
57
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../API/callOneInchAPI.cjs");require("../../constants/chains.constants.cjs");require("../../constants/vite.constants.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");const e=require("../../constants/protocol.constants.cjs");require("../../constants/coingecko.constants.cjs");require("../../constants/axelar.constants.cjs");require("../../constants/rewards.constants.cjs");require("../../constants/reorg-depths.constants.cjs");const d=require("../../error-handling/error-codes.constants.cjs"),u=require("./etherFunctions.cjs");require("axios");require("../../types/circom-data.types.cjs");const a=require("../../types/ethereum-network.types.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");require("circomlibjs");require("ethers");const l=async(s,t,n,c)=>{try{const o={fromTokenAddress:t.erc20TokenAddress!==e.zeroAddress?t.erc20TokenAddress:e.oneInchZeroAddress,toTokenAddress:n.erc20TokenAddress!==e.zeroAddress?n.erc20TokenAddress:e.oneInchZeroAddress,fromAddress:e.zeroAddress,destReceiver:s.getContractMetadata(a.ContractType.OneInchExternalActionContract).address,amount:u.getAmountInWei(t,c),slippage:10,disableEstimate:!0,allowPartialFill:!1},r=await i.callOneInchAPI(s.getCurrentChainId(),o);if(!r||!r.tx)throw Error("OneInch API price fetch error");return{outSwapAmountValue:BigInt(r.toAmount),oneInchDataValue:r.tx.data}}catch(o){throw console.log({error:o}),Error(d.transactionErrorCodes.NO_ONEINCH_PRICE)}};exports.getOneInchPrice=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../API/callOneInchAPI.cjs");require("../../constants/chains.constants.cjs");require("../../constants/vite.constants.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");const e=require("../../constants/protocol.constants.cjs");require("../../constants/coingecko.constants.cjs");require("../../constants/axelar.constants.cjs");require("../../constants/rewards.constants.cjs");require("../../constants/reorg-depths.constants.cjs");const u=require("../../error-handling/error-codes.constants.cjs"),d=require("./etherFunctions.cjs");require("axios");require("../../types/circom-data.types.cjs");const a=require("../../types/ethereum-network.types.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");require("circomlibjs");require("ethers");require("../../node_modules/buffer/index.cjs");require("../../node_modules/process/browser.cjs");const q=async(s,t,n,c)=>{try{const o={fromTokenAddress:t.erc20TokenAddress!==e.zeroAddress?t.erc20TokenAddress:e.oneInchZeroAddress,toTokenAddress:n.erc20TokenAddress!==e.zeroAddress?n.erc20TokenAddress:e.oneInchZeroAddress,fromAddress:e.zeroAddress,destReceiver:s.getContractMetadata(a.ContractType.OneInchExternalActionContract).address,amount:d.getAmountInWei(t,c),slippage:10,disableEstimate:!0,allowPartialFill:!1},r=await i.callOneInchAPI(s.getCurrentChainId(),o);if(!r||!r.tx)throw Error("OneInch API price fetch error");return{outSwapAmountValue:BigInt(r.toAmount),oneInchDataValue:r.tx.data}}catch(o){throw console.log({error:o}),Error(u.transactionErrorCodes.NO_ONEINCH_PRICE)}};exports.getOneInchPrice=q;
@@ -17,7 +17,9 @@ import "../../types/transactions.types.mjs";
17
17
  import "../../types/curve.types.mjs";
18
18
  import "circomlibjs";
19
19
  import "ethers";
20
- const _ = async (s, t, n, m) => {
20
+ import "../../node_modules/buffer/index.mjs";
21
+ import "../../node_modules/process/browser.mjs";
22
+ const q = async (s, t, n, m) => {
21
23
  try {
22
24
  const o = {
23
25
  fromTokenAddress: t.erc20TokenAddress !== e ? t.erc20TokenAddress : i,
@@ -47,5 +49,5 @@ const _ = async (s, t, n, m) => {
47
49
  }
48
50
  };
49
51
  export {
50
- _ as getOneInchPrice
52
+ q as getOneInchPrice
51
53
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../error-handling/error-codes.constants.cjs");require("ethers");const T=require("../../error-handling/get-error.message.cjs");require("axios");require("../../constants/chains.constants.cjs");require("../../constants/vite.constants.cjs");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");require("circomlibjs");require("../../constants/reorg-depths.constants.cjs");const d=5e4,m=1,w=11,q=15,g=async(s,o)=>{try{const r=await s.getFeeData(),n=o===0?w:q,e=r.gasPrice?.mul(n).div(10)??void 0;return console.log("getGasPrice , ",e?.toBigInt(),{gasPremiumType:o}),e}catch(r){console.log("getGasPrice error: ",{err:r});return}},E=(s,o,r)=>new Promise((n,e)=>{const a=setTimeout(()=>{e(new Error(c.transactionErrorCodes.TRANSACTION_TIMEOUT))},r);s.wait(o).then(t=>{clearTimeout(a),n(t)}).catch(t=>{clearTimeout(a),e(t)})}),l=async({contractFunction:s,args:o,gasPrice:r,gasLimit:n,nonce:e,confirmations:a,waitTime:t})=>{const i=await s(...o,{type:0,gasLimit:n,gasPrice:r,nonce:e});return console.log("runTransaction: ",i?.hash),await E(i,a??m,t??d)},P=async({provider:s,contractFunction:o,args:r,gasLimit:n,nonce:e,confirmations:a})=>{try{const t=await g(s,0);return await l({contractFunction:o,args:r,gasPrice:t,gasLimit:n,nonce:e,confirmations:a})}catch(t){const i=T.getErrorMessage(t);if(i===c.UserFriendlyErrorCodes.MAX_FEE_GAS_ERROR||i===c.transactionErrorCodes.TRANSACTION_TIMEOUT){console.log("Timeout Hit: Increase gas");const u=await g(s,1);return await l({contractFunction:o,args:r,gasPrice:u,gasLimit:n,nonce:e,confirmations:a})}throw t}};exports.runContractFunction=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../error-handling/error-codes.constants.cjs");require("ethers");const T=require("../../error-handling/get-error.message.cjs");require("axios");require("../../constants/chains.constants.cjs");require("../../constants/vite.constants.cjs");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");require("circomlibjs");require("../../node_modules/buffer/index.cjs");require("../../node_modules/process/browser.cjs");require("../../constants/reorg-depths.constants.cjs");const d=5e4,m=1,q=11,w=15,g=async(s,o)=>{try{const r=await s.getFeeData(),n=o===0?q:w,e=r.gasPrice?.mul(n).div(10)??void 0;return console.log("getGasPrice , ",e?.toBigInt(),{gasPremiumType:o}),e}catch(r){console.log("getGasPrice error: ",{err:r});return}},E=(s,o,r)=>new Promise((n,e)=>{const a=setTimeout(()=>{e(new Error(c.transactionErrorCodes.TRANSACTION_TIMEOUT))},r);s.wait(o).then(t=>{clearTimeout(a),n(t)}).catch(t=>{clearTimeout(a),e(t)})}),l=async({contractFunction:s,args:o,gasPrice:r,gasLimit:n,nonce:e,confirmations:a,waitTime:t})=>{const i=await s(...o,{type:0,gasLimit:n,gasPrice:r,nonce:e});return console.log("runTransaction: ",i?.hash),await E(i,a??m,t??d)},P=async({provider:s,contractFunction:o,args:r,gasLimit:n,nonce:e,confirmations:a})=>{try{const t=await g(s,0);return await l({contractFunction:o,args:r,gasPrice:t,gasLimit:n,nonce:e,confirmations:a})}catch(t){const i=T.getErrorMessage(t);if(i===c.UserFriendlyErrorCodes.MAX_FEE_GAS_ERROR||i===c.transactionErrorCodes.TRANSACTION_TIMEOUT){console.log("Timeout Hit: Increase gas");const u=await g(s,1);return await l({contractFunction:o,args:r,gasPrice:u,gasLimit:n,nonce:e,confirmations:a})}throw t}};exports.runContractFunction=P;
@@ -8,6 +8,8 @@ import "../../types/circom-data.types.mjs";
8
8
  import "../../types/transactions.types.mjs";
9
9
  import "../../types/curve.types.mjs";
10
10
  import "circomlibjs";
11
+ import "../../node_modules/buffer/index.mjs";
12
+ import "../../node_modules/process/browser.mjs";
11
13
  import "../../constants/reorg-depths.constants.mjs";
12
14
  const p = 5e4, w = 1, P = 11, d = 15, m = async (a, e) => {
13
15
  try {
@@ -18,13 +20,13 @@ const p = 5e4, w = 1, P = 11, d = 15, m = async (a, e) => {
18
20
  return;
19
21
  }
20
22
  }, E = (a, e, t) => new Promise((s, r) => {
21
- const n = setTimeout(() => {
23
+ const i = setTimeout(() => {
22
24
  r(new Error(g.TRANSACTION_TIMEOUT));
23
25
  }, t);
24
26
  a.wait(e).then((o) => {
25
- clearTimeout(n), s(o);
27
+ clearTimeout(i), s(o);
26
28
  }).catch((o) => {
27
- clearTimeout(n), r(o);
29
+ clearTimeout(i), r(o);
28
30
  });
29
31
  }), u = async ({
30
32
  contractFunction: a,
@@ -32,27 +34,27 @@ const p = 5e4, w = 1, P = 11, d = 15, m = async (a, e) => {
32
34
  gasPrice: t,
33
35
  gasLimit: s,
34
36
  nonce: r,
35
- confirmations: n,
37
+ confirmations: i,
36
38
  waitTime: o
37
39
  }) => {
38
- const i = await a(...e, {
40
+ const n = await a(...e, {
39
41
  type: 0,
40
42
  gasLimit: s,
41
43
  gasPrice: t,
42
44
  nonce: r
43
45
  });
44
- return console.log("runTransaction: ", i?.hash), await E(
45
- i,
46
- n ?? w,
46
+ return console.log("runTransaction: ", n?.hash), await E(
47
+ n,
48
+ i ?? w,
47
49
  o ?? p
48
50
  );
49
- }, N = async ({
51
+ }, S = async ({
50
52
  provider: a,
51
53
  contractFunction: e,
52
54
  args: t,
53
55
  gasLimit: s,
54
56
  nonce: r,
55
- confirmations: n
57
+ confirmations: i
56
58
  }) => {
57
59
  try {
58
60
  const o = await m(
@@ -60,21 +62,21 @@ const p = 5e4, w = 1, P = 11, d = 15, m = async (a, e) => {
60
62
  0
61
63
  /* Initial */
62
64
  );
63
- return await u({ contractFunction: e, args: t, gasPrice: o, gasLimit: s, nonce: r, confirmations: n });
65
+ return await u({ contractFunction: e, args: t, gasPrice: o, gasLimit: s, nonce: r, confirmations: i });
64
66
  } catch (o) {
65
- const i = T(o);
66
- if (i === l.MAX_FEE_GAS_ERROR || i === g.TRANSACTION_TIMEOUT) {
67
+ const n = T(o);
68
+ if (n === l.MAX_FEE_GAS_ERROR || n === g.TRANSACTION_TIMEOUT) {
67
69
  console.log("Timeout Hit: Increase gas");
68
70
  const c = await m(
69
71
  a,
70
72
  1
71
73
  /* Secondary */
72
74
  );
73
- return await u({ contractFunction: e, args: t, gasPrice: c, gasLimit: s, nonce: r, confirmations: n });
75
+ return await u({ contractFunction: e, args: t, gasPrice: c, gasLimit: s, nonce: r, confirmations: i });
74
76
  }
75
77
  throw o;
76
78
  }
77
79
  };
78
80
  export {
79
- N as runContractFunction
81
+ S as runContractFunction
80
82
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("ethers"),d=require("../../constants/chains.constants.cjs");require("../../constants/vite.constants.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");const C=require("../../constants/protocol.constants.cjs");require("../../constants/coingecko.constants.cjs");require("../../constants/axelar.constants.cjs");require("../../constants/rewards.constants.cjs");require("../../constants/reorg-depths.constants.cjs");const l=require("../../error-handling/error-codes.constants.cjs"),y=require("./etherFunctions.cjs");require("axios");require("../../types/circom-data.types.cjs");const u=require("../../types/ethereum-network.types.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");require("circomlibjs");const h=require("../../error-handling/logError.cjs"),w=async(t,c,r,o)=>{const n=(await Promise.all([100,500,3e3,1e4].map(async e=>({poolAddress:await c.getPool(r,o,e),fee:e})))).filter(({poolAddress:e})=>e!==C.zeroAddress),s=await Promise.all(n.map(async e=>({poolAddress:e.poolAddress,fee:e.fee,token1Balance:(await t.balanceOf(e.poolAddress)).toBigInt()}))),i=s.map(e=>e.token1Balance).reduce((e,p)=>p>=e?p:e,0n);if(i===0n)throw new Error(l.transactionErrorCodes.UNISWAP_NOT_ENOUGH_LIQUIDITY);return s.find(e=>e.token1Balance===i)},g=async(t,c,r,o,n)=>{try{if(!d.networkRegistry[t.getCurrentChainId()].quoterV2Address)throw Error("No Quoter Contract Provided");return(await t.getContractWithFetcher(u.ContractType.UniswapV3QuoterContract,d.networkRegistry[t.getCurrentChainId()].quoterV2Address).callStatic.quoteExactInputSingle({tokenIn:c.wrappedErc20TokenAddress??c.erc20TokenAddress,tokenOut:r.wrappedErc20TokenAddress??r.erc20TokenAddress,fee:o,amountIn:n,sqrtPriceLimitX96:0})).amountOut.toBigInt()}catch(s){throw h.logError(s),s}},A=async(t,c,r)=>{try{const o=t.getCurrentChainId(),n=t.getContractWithFetcher(u.ContractType.UniswapV3FactoryContract,d.networkRegistry[o].uniswapV3FactoryAddress),s=t.getContractWithFetcher(u.ContractType.ERC20Contract,r.wrappedErc20TokenAddress??r.erc20TokenAddress),{fee:a}=await w(s,n,c.wrappedErc20TokenAddress??c.erc20TokenAddress,r.wrappedErc20TokenAddress??r.erc20TokenAddress);return a}catch(o){throw console.log("Error in getUniswapFee",o),o}},P=async(t,c,r,o)=>{try{const n=await A(t,r,o),s=q.utils.defaultAbiCoder.encode(["uint24"],[n]),a=y.getAmountInWei(r,c);return{tokenPrice:await g(t,r,o,n,a),poolFee:s}}catch(n){throw console.log({error:n}),Error(l.transactionErrorCodes.NO_UNISWAP_PRICE)}};exports.getUniswapFee=A;exports.getUniswapPrice=P;exports.getUniswapPriceHelper=g;exports.searchPoolAndFee=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("ethers"),d=require("../../constants/chains.constants.cjs");require("../../constants/vite.constants.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");const C=require("../../constants/protocol.constants.cjs");require("../../constants/coingecko.constants.cjs");require("../../constants/axelar.constants.cjs");require("../../constants/rewards.constants.cjs");require("../../constants/reorg-depths.constants.cjs");const l=require("../../error-handling/error-codes.constants.cjs"),y=require("./etherFunctions.cjs");require("axios");require("../../types/circom-data.types.cjs");const u=require("../../types/ethereum-network.types.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");require("circomlibjs");require("../../node_modules/buffer/index.cjs");require("../../node_modules/process/browser.cjs");const h=require("../../error-handling/logError.cjs"),w=async(t,c,r,o)=>{const n=(await Promise.all([100,500,3e3,1e4].map(async e=>({poolAddress:await c.getPool(r,o,e),fee:e})))).filter(({poolAddress:e})=>e!==C.zeroAddress),s=await Promise.all(n.map(async e=>({poolAddress:e.poolAddress,fee:e.fee,token1Balance:(await t.balanceOf(e.poolAddress)).toBigInt()}))),i=s.map(e=>e.token1Balance).reduce((e,p)=>p>=e?p:e,0n);if(i===0n)throw new Error(l.transactionErrorCodes.UNISWAP_NOT_ENOUGH_LIQUIDITY);return s.find(e=>e.token1Balance===i)},g=async(t,c,r,o,n)=>{try{if(!d.networkRegistry[t.getCurrentChainId()].quoterV2Address)throw Error("No Quoter Contract Provided");return(await t.getContractWithFetcher(u.ContractType.UniswapV3QuoterContract,d.networkRegistry[t.getCurrentChainId()].quoterV2Address).callStatic.quoteExactInputSingle({tokenIn:c.wrappedErc20TokenAddress??c.erc20TokenAddress,tokenOut:r.wrappedErc20TokenAddress??r.erc20TokenAddress,fee:o,amountIn:n,sqrtPriceLimitX96:0})).amountOut.toBigInt()}catch(s){throw h.logError(s),s}},q=async(t,c,r)=>{try{const o=t.getCurrentChainId(),n=t.getContractWithFetcher(u.ContractType.UniswapV3FactoryContract,d.networkRegistry[o].uniswapV3FactoryAddress),s=t.getContractWithFetcher(u.ContractType.ERC20Contract,r.wrappedErc20TokenAddress??r.erc20TokenAddress),{fee:a}=await w(s,n,c.wrappedErc20TokenAddress??c.erc20TokenAddress,r.wrappedErc20TokenAddress??r.erc20TokenAddress);return a}catch(o){throw console.log("Error in getUniswapFee",o),o}},P=async(t,c,r,o)=>{try{const n=await q(t,r,o),s=A.utils.defaultAbiCoder.encode(["uint24"],[n]),a=y.getAmountInWei(r,c);return{tokenPrice:await g(t,r,o,n,a),poolFee:s}}catch(n){throw console.log({error:n}),Error(l.transactionErrorCodes.NO_UNISWAP_PRICE)}};exports.getUniswapFee=q;exports.getUniswapPrice=P;exports.getUniswapPriceHelper=g;exports.searchPoolAndFee=w;
@@ -16,6 +16,8 @@ import { ContractType as p } from "../../types/ethereum-network.types.mjs";
16
16
  import "../../types/transactions.types.mjs";
17
17
  import "../../types/curve.types.mjs";
18
18
  import "circomlibjs";
19
+ import "../../node_modules/buffer/index.mjs";
20
+ import "../../node_modules/process/browser.mjs";
19
21
  import { logError as C } from "../../error-handling/logError.mjs";
20
22
  const g = async (e, c, t, o) => {
21
23
  const n = (await Promise.all(
@@ -68,7 +70,7 @@ const g = async (e, c, t, o) => {
68
70
  } catch (o) {
69
71
  throw console.log("Error in getUniswapFee", o), o;
70
72
  }
71
- }, L = async (e, c, t, o) => {
73
+ }, z = async (e, c, t, o) => {
72
74
  try {
73
75
  const n = await I(e, t, o), s = l.defaultAbiCoder.encode(["uint24"], [n]), a = A(t, c);
74
76
  return { tokenPrice: await f(e, t, o, n, a), poolFee: s };
@@ -78,7 +80,7 @@ const g = async (e, c, t, o) => {
78
80
  };
79
81
  export {
80
82
  I as getUniswapFee,
81
- L as getUniswapPrice,
83
+ z as getUniswapPrice,
82
84
  f as getUniswapPriceHelper,
83
85
  g as searchPoolAndFee
84
86
  };