@reyaxyz/common 0.258.2 → 0.258.3

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.
@@ -58,8 +58,8 @@ var txHelpers_1 = require("./txHelpers");
58
58
  var utils_1 = require("../utils");
59
59
  var ethers_2 = require("ethers");
60
60
  exports.reyaChainIdRPCMapper = (_a = {},
61
- _a[types_1.ReyaChainId.reyaNetwork] = 'https://rpc.reya.network',
62
- _a[types_1.ReyaChainId.reyaCronos] = 'https://rpc.reya-cronos.gelato.digital',
61
+ _a[types_1.ReyaChainId.reyaNetwork] = 'https://rpc.reya.network/263e76b89da84d478fd2b6e8783a1cfe',
62
+ _a[types_1.ReyaChainId.reyaCronos] = 'https://rpc.reya-cronos.gelato.digital/263e76b89da84d478fd2b6e8783a1cfe',
63
63
  _a);
64
64
  var errorDecoder = ethers_decode_error_1.ErrorDecoder.create([Errors_json_1.abi]);
65
65
  function estimateGas(signer, data, value, chainId, targetContract) {
@@ -1 +1 @@
1
- {"version":3,"file":"executeTransaction.js","sourceRoot":"/","sources":["transactions/executeTransaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAuD;AACvD,kCAA0D;AAC1D,yDAA+D;AAC/D,kDAAyC;AACzC,2DAAmD;AAEnD,yCAA2C;AAC3C,kCAAmD;AACnD,iCAAmC;AAEtB,QAAA,oBAAoB;IAC/B,GAAC,mBAAW,CAAC,WAAW,IAAG,0BAA0B;IACrD,GAAC,mBAAW,CAAC,UAAU,IAAG,wCAAwC;QAClE;AAQF,IAAM,YAAY,GAAG,kCAAY,CAAC,MAAM,CAAC,CAAC,iBAAG,CAAC,CAAC,CAAC;AAEhD,SAAsB,WAAW,CAC/B,MAA8B,EAC9B,IAAY,EACZ,KAAa,EACb,OAAe,EACf,cAAqC;;;;;wBAQd,qBAAM,MAAM,CAAC,UAAU,EAAE,EAAA;;oBAA1C,cAA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,GAAG,CAAC,CAAC;AAClD,CAAC;AAED,SAAsB,gBAAgB,CAAC,UAAkB;;;;YACjD,SAAS,GAAG,IAAI,kBAAS,CAAC,iBAAG,CAAC,CAAC;YAC/B,YAAY,GAAG,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;YACtD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YAC1B,sBAAO,UAAG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,eAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,CAAE,IAAI,iBAAiB,EAAC;;;CAC5E;AALD,4CAKC","sourcesContent":["import { ethers, JsonRpcSigner, Signer } from 'ethers';\nimport { MoneyInOutChainId, ReyaChainId } from '../types';\nimport { ContractType, getAddress } from './contractAddresses';\nimport { abi } from './abis/Errors.json';\nimport { ErrorDecoder } from 'ethers-decode-error';\nimport type { DecodedError } from 'ethers-decode-error';\nimport { getGasBuffer } from './txHelpers';\nimport { getPublicRpcUrlsOrThrow } from '../utils';\nimport { Interface } from 'ethers';\n\nexport const reyaChainIdRPCMapper: { [key: number]: string } = {\n [ReyaChainId.reyaNetwork]: 'https://rpc.reya.network',\n [ReyaChainId.reyaCronos]: 'https://rpc.reya-cronos.gelato.digital',\n};\n\nexport type Transaction = {\n from: string;\n to: string;\n data: string;\n value?: string;\n};\nconst errorDecoder = ErrorDecoder.create([abi]);\n\nexport async function estimateGas(\n signer: Signer | JsonRpcSigner,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n): Promise<\n Transaction & {\n gasLimit: bigint;\n maxPriorityFeePerGas?: bigint;\n maxFeePerGas?: bigint;\n }\n> {\n const accountAddress = await signer.getAddress();\n\n return estimateGasGivenAddress(\n accountAddress,\n data,\n value,\n chainId,\n targetContract,\n );\n}\n\nexport async function estimateGasGivenAddress(\n accountAddress: string,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n): Promise<\n Transaction & {\n gasLimit: bigint;\n maxPriorityFeePerGas?: bigint;\n maxFeePerGas?: bigint;\n }\n> {\n const contractAddress = Object.values(ContractType).includes(\n targetContract as ContractType,\n )\n ? getAddress(chainId, targetContract as ContractType)\n : targetContract;\n\n const tx = {\n from: accountAddress, // @todo Update with relayer address\n to: contractAddress,\n data,\n ...(value && value !== '0' ? { value: value } : {}),\n };\n\n const gasLimit: bigint = BigInt('5000000'); // hardcode to 5m gas limit if fails to get estimate\n\n try {\n const provider = ethers.getDefaultProvider(reyaChainIdRPCMapper[chainId]);\n await provider.call(tx);\n } catch (error) {\n const decodedError = await errorDecoder.decode(error);\n const reason = customReasonMapper(decodedError);\n console.error(\n `Error simulating transaction account address ${accountAddress} reason ${decodedError?.name} ${decodedError} ${error}`,\n );\n throw new Error(reason);\n }\n\n if (Object.values(ReyaChainId).includes(chainId as ReyaChainId)) {\n const maxPriorityFeePerGas: bigint = BigInt('0');\n const maxFeePerGas: bigint = BigInt('100000000');\n return { ...tx, gasLimit, maxPriorityFeePerGas, maxFeePerGas };\n }\n\n return { ...tx, gasLimit };\n}\n\nexport async function estimateGasFromTxAndChainId(\n chainId: ReyaChainId | MoneyInOutChainId,\n tx: ethers.TransactionRequest,\n): Promise<bigint> {\n const rpcUrls = getPublicRpcUrlsOrThrow(chainId);\n let lastError = null;\n\n for (const url of rpcUrls) {\n try {\n const provider = new ethers.JsonRpcProvider(url);\n const estimation = await provider.estimateGas(tx);\n return addGasBuffer(estimation);\n } catch (error) {\n lastError = error;\n }\n }\n\n throw new Error('All RPC URLs failed; last error: ' + lastError);\n}\n\nexport async function estimateGasWithoutHardcoding(\n signer: Signer | JsonRpcSigner,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n): Promise<\n Transaction & {\n gasLimit: bigint;\n maxPriorityFeePerGas?: bigint;\n maxFeePerGas?: bigint;\n }\n> {\n const accountAddress = await signer.getAddress();\n\n const contractAddress = Object.values(ContractType).includes(\n targetContract as ContractType,\n )\n ? getAddress(chainId, targetContract as ContractType)\n : targetContract;\n const tx = {\n from: accountAddress, // @todo Update with relayer address\n to: contractAddress,\n data,\n ...(value && value !== '0' ? { value: value } : {}),\n };\n\n let gasLimit: bigint = BigInt('5000000'); // hardcode to 5m gas limit if fails to get estimate\n\n try {\n const provider = ethers.getDefaultProvider(reyaChainIdRPCMapper[chainId]);\n const estimation = await provider.estimateGas(tx);\n gasLimit = addGasBuffer(estimation);\n } catch (error) {\n const decodedError = await errorDecoder.decode(error);\n const reason = customReasonMapper(decodedError);\n console.error(\n `Error simulating transaction account address ${accountAddress} reason ${decodedError?.name} ${decodedError} ${error}`,\n );\n throw new Error(reason);\n }\n\n if (Object.values(ReyaChainId).includes(chainId as ReyaChainId)) {\n const maxPriorityFeePerGas: bigint = BigInt('0');\n const maxFeePerGas: bigint = BigInt('100000000');\n return { ...tx, gasLimit, maxPriorityFeePerGas, maxFeePerGas };\n }\n\n return { ...tx, gasLimit };\n}\n\nasync function estimateGasExternalChains(\n signer: Signer | JsonRpcSigner,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n): Promise<\n Transaction & {\n gasLimit: bigint;\n maxPriorityFeePerGas?: bigint;\n maxFeePerGas?: bigint;\n }\n> {\n const accountAddress = await signer.getAddress();\n\n const contractAddress = Object.values(ContractType).includes(\n targetContract as ContractType,\n )\n ? getAddress(chainId, targetContract as ContractType)\n : targetContract;\n const tx = {\n from: accountAddress,\n to: contractAddress,\n data,\n ...(value && value !== '0' ? { value: value } : {}),\n };\n\n let gasLimit: bigint = BigInt('5000000'); // hardcode to 5m gas limit if fails to get estimate\n\n try {\n const gasEstimate = await signer.estimateGas(tx);\n gasLimit = getGasBuffer(gasEstimate);\n } catch (error) {\n const decodedError = await errorDecoder.decode(error);\n const reason = customReasonMapper(decodedError);\n console.error(\n `Error simulating external transaction account address ${accountAddress} reason ${decodedError?.name} ${decodedError} ${error}`,\n );\n throw new Error(reason);\n }\n\n if (Object.values(ReyaChainId).includes(chainId as ReyaChainId)) {\n const maxPriorityFeePerGas: bigint = BigInt('0');\n const maxFeePerGas: bigint = BigInt('100000000');\n return { ...tx, gasLimit, maxPriorityFeePerGas, maxFeePerGas };\n }\n\n return { ...tx, gasLimit };\n}\nexport async function executeTransaction(\n signer: Signer | JsonRpcSigner,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n) {\n const txData = await estimateGasExternalChains(\n signer,\n data,\n value,\n chainId,\n targetContract,\n );\n\n try {\n const txResponse = await signer.sendTransaction(txData);\n const txReceipt = await txResponse.wait();\n return txReceipt;\n } catch (error) {\n console.warn(error);\n throw new Error('Transaction Execution Error');\n }\n}\nconst customReasonMapper = ({ name, reason }: DecodedError): string => {\n switch (name) {\n case 'SignatureInvalid':\n return `Invalid signature. Please refresh page and try again`;\n case 'StalePriceDetected':\n return `Price not updated, please try again a bit later`;\n case 'SmallOrderSize':\n return `Order size below minimum`;\n case 'DustyOrderSize':\n return `Order amount is not divisible by trade size spacing`;\n case 'AccountBelowIM':\n return `Account below required margin`;\n default:\n // This handles the non-custom errors\n return reason ?? 'Error executing transaction';\n }\n};\n\nfunction addGasBuffer(estimation: bigint): bigint {\n return (estimation * BigInt(120)) / BigInt(100);\n}\n\nexport async function decodeErrorBytes(returnData: string): Promise<string> {\n const INTERFACE = new Interface(abi);\n const decodedError = INTERFACE.parseError(returnData);\n console.log(decodedError);\n return `${decodedError?.name}: ${decodedError?.args}` || 'Error not found';\n}\n"]}
1
+ {"version":3,"file":"executeTransaction.js","sourceRoot":"/","sources":["transactions/executeTransaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAuD;AACvD,kCAA0D;AAC1D,yDAA+D;AAC/D,kDAAyC;AACzC,2DAAmD;AAEnD,yCAA2C;AAC3C,kCAAmD;AACnD,iCAAmC;AAEtB,QAAA,oBAAoB;IAC/B,GAAC,mBAAW,CAAC,WAAW,IACtB,2DAA2D;IAC7D,GAAC,mBAA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D,KAAK,gBAAgB;YACnB,OAAO,+BAA+B,CAAC;QACzC;YACE,qCAAqC;YACrC,OAAO,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,6BAA6B,CAAC;IACnD,CAAC;AACH,CAAC,CAAC;AAEF,SAAS,YAAY,CAAC,UAAkB;IACtC,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAClD,CAAC;AAED,SAAsB,gBAAgB,CAAC,UAAkB;;;;YACjD,SAAS,GAAG,IAAI,kBAAS,CAAC,iBAAG,CAAC,CAAC;YAC/B,YAAY,GAAG,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;YACtD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YAC1B,sBAAO,UAAG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,eAAK,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,CAAE,IAAI,iBAAiB,EAAC;;;CAC5E;AALD,4CAKC","sourcesContent":["import { ethers, JsonRpcSigner, Signer } from 'ethers';\nimport { MoneyInOutChainId, ReyaChainId } from '../types';\nimport { ContractType, getAddress } from './contractAddresses';\nimport { abi } from './abis/Errors.json';\nimport { ErrorDecoder } from 'ethers-decode-error';\nimport type { DecodedError } from 'ethers-decode-error';\nimport { getGasBuffer } from './txHelpers';\nimport { getPublicRpcUrlsOrThrow } from '../utils';\nimport { Interface } from 'ethers';\n\nexport const reyaChainIdRPCMapper: { [key: number]: string } = {\n [ReyaChainId.reyaNetwork]:\n 'https://rpc.reya.network/263e76b89da84d478fd2b6e8783a1cfe',\n [ReyaChainId.reyaCronos]:\n 'https://rpc.reya-cronos.gelato.digital/263e76b89da84d478fd2b6e8783a1cfe',\n};\n\nexport type Transaction = {\n from: string;\n to: string;\n data: string;\n value?: string;\n};\nconst errorDecoder = ErrorDecoder.create([abi]);\n\nexport async function estimateGas(\n signer: Signer | JsonRpcSigner,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n): Promise<\n Transaction & {\n gasLimit: bigint;\n maxPriorityFeePerGas?: bigint;\n maxFeePerGas?: bigint;\n }\n> {\n const accountAddress = await signer.getAddress();\n\n return estimateGasGivenAddress(\n accountAddress,\n data,\n value,\n chainId,\n targetContract,\n );\n}\n\nexport async function estimateGasGivenAddress(\n accountAddress: string,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n): Promise<\n Transaction & {\n gasLimit: bigint;\n maxPriorityFeePerGas?: bigint;\n maxFeePerGas?: bigint;\n }\n> {\n const contractAddress = Object.values(ContractType).includes(\n targetContract as ContractType,\n )\n ? getAddress(chainId, targetContract as ContractType)\n : targetContract;\n\n const tx = {\n from: accountAddress, // @todo Update with relayer address\n to: contractAddress,\n data,\n ...(value && value !== '0' ? { value: value } : {}),\n };\n\n const gasLimit: bigint = BigInt('5000000'); // hardcode to 5m gas limit if fails to get estimate\n\n try {\n const provider = ethers.getDefaultProvider(reyaChainIdRPCMapper[chainId]);\n await provider.call(tx);\n } catch (error) {\n const decodedError = await errorDecoder.decode(error);\n const reason = customReasonMapper(decodedError);\n console.error(\n `Error simulating transaction account address ${accountAddress} reason ${decodedError?.name} ${decodedError} ${error}`,\n );\n throw new Error(reason);\n }\n\n if (Object.values(ReyaChainId).includes(chainId as ReyaChainId)) {\n const maxPriorityFeePerGas: bigint = BigInt('0');\n const maxFeePerGas: bigint = BigInt('100000000');\n return { ...tx, gasLimit, maxPriorityFeePerGas, maxFeePerGas };\n }\n\n return { ...tx, gasLimit };\n}\n\nexport async function estimateGasFromTxAndChainId(\n chainId: ReyaChainId | MoneyInOutChainId,\n tx: ethers.TransactionRequest,\n): Promise<bigint> {\n const rpcUrls = getPublicRpcUrlsOrThrow(chainId);\n let lastError = null;\n\n for (const url of rpcUrls) {\n try {\n const provider = new ethers.JsonRpcProvider(url);\n const estimation = await provider.estimateGas(tx);\n return addGasBuffer(estimation);\n } catch (error) {\n lastError = error;\n }\n }\n\n throw new Error('All RPC URLs failed; last error: ' + lastError);\n}\n\nexport async function estimateGasWithoutHardcoding(\n signer: Signer | JsonRpcSigner,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n): Promise<\n Transaction & {\n gasLimit: bigint;\n maxPriorityFeePerGas?: bigint;\n maxFeePerGas?: bigint;\n }\n> {\n const accountAddress = await signer.getAddress();\n\n const contractAddress = Object.values(ContractType).includes(\n targetContract as ContractType,\n )\n ? getAddress(chainId, targetContract as ContractType)\n : targetContract;\n const tx = {\n from: accountAddress, // @todo Update with relayer address\n to: contractAddress,\n data,\n ...(value && value !== '0' ? { value: value } : {}),\n };\n\n let gasLimit: bigint = BigInt('5000000'); // hardcode to 5m gas limit if fails to get estimate\n\n try {\n const provider = ethers.getDefaultProvider(reyaChainIdRPCMapper[chainId]);\n const estimation = await provider.estimateGas(tx);\n gasLimit = addGasBuffer(estimation);\n } catch (error) {\n const decodedError = await errorDecoder.decode(error);\n const reason = customReasonMapper(decodedError);\n console.error(\n `Error simulating transaction account address ${accountAddress} reason ${decodedError?.name} ${decodedError} ${error}`,\n );\n throw new Error(reason);\n }\n\n if (Object.values(ReyaChainId).includes(chainId as ReyaChainId)) {\n const maxPriorityFeePerGas: bigint = BigInt('0');\n const maxFeePerGas: bigint = BigInt('100000000');\n return { ...tx, gasLimit, maxPriorityFeePerGas, maxFeePerGas };\n }\n\n return { ...tx, gasLimit };\n}\n\nasync function estimateGasExternalChains(\n signer: Signer | JsonRpcSigner,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n): Promise<\n Transaction & {\n gasLimit: bigint;\n maxPriorityFeePerGas?: bigint;\n maxFeePerGas?: bigint;\n }\n> {\n const accountAddress = await signer.getAddress();\n\n const contractAddress = Object.values(ContractType).includes(\n targetContract as ContractType,\n )\n ? getAddress(chainId, targetContract as ContractType)\n : targetContract;\n const tx = {\n from: accountAddress,\n to: contractAddress,\n data,\n ...(value && value !== '0' ? { value: value } : {}),\n };\n\n let gasLimit: bigint = BigInt('5000000'); // hardcode to 5m gas limit if fails to get estimate\n\n try {\n const gasEstimate = await signer.estimateGas(tx);\n gasLimit = getGasBuffer(gasEstimate);\n } catch (error) {\n const decodedError = await errorDecoder.decode(error);\n const reason = customReasonMapper(decodedError);\n console.error(\n `Error simulating external transaction account address ${accountAddress} reason ${decodedError?.name} ${decodedError} ${error}`,\n );\n throw new Error(reason);\n }\n\n if (Object.values(ReyaChainId).includes(chainId as ReyaChainId)) {\n const maxPriorityFeePerGas: bigint = BigInt('0');\n const maxFeePerGas: bigint = BigInt('100000000');\n return { ...tx, gasLimit, maxPriorityFeePerGas, maxFeePerGas };\n }\n\n return { ...tx, gasLimit };\n}\nexport async function executeTransaction(\n signer: Signer | JsonRpcSigner,\n data: string,\n value: string,\n chainId: number,\n targetContract: ContractType | string,\n) {\n const txData = await estimateGasExternalChains(\n signer,\n data,\n value,\n chainId,\n targetContract,\n );\n\n try {\n const txResponse = await signer.sendTransaction(txData);\n const txReceipt = await txResponse.wait();\n return txReceipt;\n } catch (error) {\n console.warn(error);\n throw new Error('Transaction Execution Error');\n }\n}\nconst customReasonMapper = ({ name, reason }: DecodedError): string => {\n switch (name) {\n case 'SignatureInvalid':\n return `Invalid signature. Please refresh page and try again`;\n case 'StalePriceDetected':\n return `Price not updated, please try again a bit later`;\n case 'SmallOrderSize':\n return `Order size below minimum`;\n case 'DustyOrderSize':\n return `Order amount is not divisible by trade size spacing`;\n case 'AccountBelowIM':\n return `Account below required margin`;\n default:\n // This handles the non-custom errors\n return reason ?? 'Error executing transaction';\n }\n};\n\nfunction addGasBuffer(estimation: bigint): bigint {\n return (estimation * BigInt(120)) / BigInt(100);\n}\n\nexport async function decodeErrorBytes(returnData: string): Promise<string> {\n const INTERFACE = new Interface(abi);\n const decodedError = INTERFACE.parseError(returnData);\n console.log(decodedError);\n return `${decodedError?.name}: ${decodedError?.args}` || 'Error not found';\n}\n"]}
@@ -1 +1 @@
1
- {"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AM,GAAG,OAAO,CAAC,MAAM,CAAC,CAK1E"}
@@ -1 +1 @@
1
- {"version":3,"file":"network.d.ts","sourceRoot":"/","sources":["utils/network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE1E,wBAAgB,cAAc,CAAC,GAAG,EAAE,cAAc,GAAG,WAAW,CAK/D;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,cAAc,GAClB,iBAAiB,EAAE,CAkBrB;AAED,wBAAgB,mCAAmC,CACjD,iBAAiB,EAAE,iBAAiB,GACnC,WAAW,CAab;AAED,wBAAgB,oCAAoC,CAClD,WAAW,EAAE,WAAW,GACvB,iBAAiB,EAAE,CAWrB;AAED,eAAO,MAAM,oBAAoB,EAAE;KAChC,GAAG,IAAI,iBAAiB,GAAG,WAAW,GAAG,MAAM;CAYjD,CAAC;AAGF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,iBAAiB,GAAG,WAAW,EAAE,MAAM,EAAE,CA2D1E,CAAC;AAgBF,eAAO,MAAM,gBAAgB,WACnB,MAAM,WACL,iBAAiB,KACzB,MAAM,GAAG,IAQX,CAAC;AAEF,eAAO,MAAM,gBAAgB,YAClB,iBAAiB,GAAG,WAAW,KACvC,MAAM,EAQR,CAAC;AAEF,eAAO,MAAM,uBAAuB,YACzB,iBAAiB,GAAG,WAAW,KACvC,MAAM,EAQR,CAAC"}
1
+ {"version":3,"file":"network.d.ts","sourceRoot":"/","sources":["utils/network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE1E,wBAAgB,cAAc,CAAC,GAAG,EAAE,cAAc,GAAG,WAAW,CAK/D;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,cAAc,GAClB,iBAAiB,EAAE,CAkBrB;AAED,wBAAgB,mCAAmC,CACjD,iBAAiB,EAAE,iBAAiB,GACnC,WAAW,CAab;AAED,wBAAgB,oCAAoC,CAClD,WAAW,EAAE,WAAW,GACvB,iBAAiB,EAAE,CAWrB;AAED,eAAO,MAAM,oBAAoB,EAAE;KAChC,GAAG,IAAI,iBAAiB,GAAG,WAAW,GAAG,MAAM;CAYjD,CAAC;AAGF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,iBAAiB,GAAG,WAAW,EAAE,MAAM,EAAE,CA+D1E,CAAC;AAgBF,eAAO,MAAM,gBAAgB,WACnB,MAAM,WACL,iBAAiB,KACzB,MAAM,GAAG,IAQX,CAAC;AAEF,eAAO,MAAM,gBAAgB,YAClB,iBAAiB,GAAG,WAAW,KACvC,MAAM,EAQR,CAAC;AAEF,eAAO,MAAM,uBAAuB,YACzB,iBAAiB,GAAG,WAAW,KACvC,MAAM,EAQR,CAAC"}
@@ -63,7 +63,9 @@ exports.chainIdToExplorerURL = (_a = {},
63
63
  _a);
64
64
  // TODO: make this non-export
65
65
  exports.ChainRpcUrls = (_b = {},
66
- _b[types_1.ReyaChainId.reyaNetwork] = ['https://rpc.reya.network'],
66
+ _b[types_1.ReyaChainId.reyaNetwork] = [
67
+ 'https://rpc.reya.network/263e76b89da84d478fd2b6e8783a1cfe',
68
+ ],
67
69
  _b[types_1.MoneyInOutChainId.ethereumMainnet] = [
68
70
  'https://mainnet.gateway.tenderly.co',
69
71
  'https://eth.llamarpc.com',
@@ -105,7 +107,9 @@ exports.ChainRpcUrls = (_b = {},
105
107
  'https://base.gateway.tenderly.co/2LHAD54IBvgXiVQdhE9mIF',
106
108
  ],
107
109
  // Add the rest of the mainnet URLs above
108
- _b[types_1.ReyaChainId.reyaCronos] = ['https://rpc.reya-cronos.gelato.digital'],
110
+ _b[types_1.ReyaChainId.reyaCronos] = [
111
+ 'https://rpc.reya-cronos.gelato.digital/263e76b89da84d478fd2b6e8783a1cfe',
112
+ ],
109
113
  _b[types_1.MoneyInOutChainId.arbitrumSepolia] = [
110
114
  'https://sepolia-rollup.arbitrum.io/rpc',
111
115
  'https://endpoints.omniatech.io/v1/arbitrum/sepolia/public',
@@ -1 +1 @@
1
- {"version":3,"file":"network.js","sourceRoot":"/","sources":["utils/network.ts"],"names":[],"mappings":";;;;AAAA,kCAA0E;AAE1E,SAAgB,cAAc,CAAC,GAAmB;IAChD,IAAI,GAAG,KAAK,YAAY;QAAE,OAAO,mBAAW,CAAC,WAAW,CAAC;IACzD,IAAI,GAAG,KAAK,MAAM;QAAE,OAAO,mBAAW,CAAC,UAAU,CAAC;IAElD,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;AACpD,CAAC;AALD,wCAKC;AAED,SAAgB,qBAAqB,CACnC,GAAmB;IAEnB,IAAI,GAAG,KAAK,YAAY;QACtB,OAAO;YACL,yBAAiB,CAAC,eAAe;YACjC,yBAAiB,CAAC,SAAS;YAC3B,yBAAiB,CAAC,cAAc;YAChC,yBAAiB,CAAC,WAAW;YAC7B,yBAAiB,CAAC,WAAW;SAC9B,CAAC;IAEJ,IAAI,GAAG,KAAK,MAAM;QAChB,OAAO;YACL,yBAAiB,CAAC,eAAe;YACjC,yBAAiB,CAAC,SAAS;YAC3B,yBAAiB,CAAC,eAAe;SAClC,CAAC;IAEJ,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;AAC3D,CAAC;AApBD,sDAoBC;AAED,SAAgB,mCAAmC,CACjD,iBAAoC;IAEpC,IACE,qBAAqB,CAAC,sBAAc,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAC5E,CAAC;QACD,OAAO,cAAc,CAAC,sBAAc,CAAC,UAAU,CAAC,CAAC;IACnD,CAAC;IACD,IAAI,qBAAqB,CAAC,sBAAc,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC;QAC3E,OAAO,cAAc,CAAC,sBAAc,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,IAAI,KAAK,CACb,+EA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,CAAC,eAAe,IAAG,sCAAsC;OAC5E,CAAC;AAEK,IAAM,gBAAgB,GAAG,UAC9B,MAAc,EACd,OAA0B;IAE1B,IAAM,MAAM,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAE7C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,UAAG,MAAM,cAAI,MAAM,CAAE,CAAC;AAC/B,CAAC,CAAC;AAXW,QAAA,gBAAgB,oBAW3B;AAEK,IAAM,gBAAgB,GAAG,UAC9B,OAAwC;IAExC,IAAM,OAAO,GAAG,oBAAY,CAAC,OAAO,CAAC,CAAC;IAEtC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAVW,QAAA,gBAAgB,oBAU3B;AAEK,IAAM,uBAAuB,GAAG,UACrC,OAAwC;IAExC,IAAM,OAAO,GAAG,IAAA,wBAAgB,EAAC,OAAO,CAAC,CAAC;IAE1C,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,+CAA+C,GAAG,OAAO,CAAC,CAAC;IAC7E,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAVW,QAAA,uBAAuB,2BAUlC","sourcesContent":["import { ApplicationEnv, MoneyInOutChainId, ReyaChainId } from '../types';\n\nexport function getReyaNetwork(env: ApplicationEnv): ReyaChainId {\n if (env === 'production') return ReyaChainId.reyaNetwork;\n if (env === 'test') return ReyaChainId.reyaCronos;\n\n throw new Error('Unknown env for getReyaNetwork');\n}\n\nexport function getMoneyInOutNetworks(\n env: ApplicationEnv,\n): MoneyInOutChainId[] {\n if (env === 'production')\n return [\n MoneyInOutChainId.ethereumMainnet,\n MoneyInOutChainId.opMainnet,\n MoneyInOutChainId.polygonMainnet,\n MoneyInOutChainId.arbitrumOne,\n MoneyInOutChainId.baseMainnet,\n ];\n\n if (env === 'test')\n return [\n MoneyInOutChainId.ethereumSepolia,\n MoneyInOutChainId.opSepolia,\n MoneyInOutChainId.arbitrumSepolia,\n ];\n\n throw new Error('Unknown env for getMoneyInOutNetworks');\n}\n\nexport function getReyaNetworkFromMoneyInOutChainId(\n moneyInOutChainId: MoneyInOutChainId,\n): ReyaChainId {\n if (\n getMoneyInOutNetworks(ApplicationEnv.PRODUCTION).includes(moneyInOutChainId)\n ) {\n return getReyaNetwork(ApplicationEnv.PRODUCTION);\n }\n if (getMoneyInOutNetworks(ApplicationEnv.TEST).includes(moneyInOutChainId)) {\n return getReyaNetwork(ApplicationEnv.TEST);\n }\n\n throw new Error(\n `Unknown money in out network in getReyaNetworkFromMoneyInOutChainId: ${moneyInOutChainId}`,\n );\n}\n\nexport function getMoneyInOutNetworksFromReyaChainId(\n reyaChainId: ReyaChainId,\n): MoneyInOutChainId[] {\n if (getReyaNetwork(ApplicationEnv.PRODUCTION) === reyaChainId) {\n return getMoneyInOutNetworks(ApplicationEnv.PRODUCTION);\n }\n if (getReyaNetwork(ApplicationEnv.TEST) === reyaChainId) {\n return getMoneyInOutNetworks(ApplicationEnv.TEST);\n }\n\n throw new Error(\n `Unknown money in out network in getMoneyInOutNetworksFromReyaChainId: ${reyaChainId}`,\n );\n}\n\nexport const chainIdToExplorerURL: {\n [key in MoneyInOutChainId | ReyaChainId]: string;\n} = {\n [MoneyInOutChainId.ethereumMainnet]: 'https://etherscan.io',\n [MoneyInOutChainId.opMainnet]: 'https://optimistic.etherscan.io',\n [MoneyInOutChainId.polygonMainnet]: 'https://polygonscan.com',\n [MoneyInOutChainId.arbitrumOne]: 'https://arbiscan.io',\n [MoneyInOutChainId.baseMainnet]: 'https://basescan.org',\n [MoneyInOutChainId.arbitrumSepolia]: 'https://sepolia.arbiscan.io',\n [MoneyInOutChainId.opSepolia]: 'https://sepolia-optimism.etherscan.io',\n [MoneyInOutChainId.ethereumSepolia]: 'https://sepolia.etherscan.io',\n [ReyaChainId.reyaNetwork]: 'https://explorer.reya.network',\n [ReyaChainId.reyaCronos]: 'https://reya-cronos.blockscout.com',\n};\n\n// TODO: make this non-export\nexport const ChainRpcUrls: Record<MoneyInOutChainId | ReyaChainId, string[]> = {\n [ReyaChainId.reyaNetwork]: ['https://rpc.reya.network'],\n [MoneyInOutChainId.ethereumMainnet]: [\n 'https://mainnet.gateway.tenderly.co',\n 'https://eth.llamarpc.com',\n 'https://eth-mainnet.g.alchemy.com/v2/Tkk3-2tTcsCLnFa4dSSUkpZsDyOH55Ar',\n 'https://eth-mainnet.g.alchemy.com/v2/Bin_D_qtJLCqvFyzt-0SxZRWTL423_tg',\n 'https://eth-mainnet.g.alchemy.com/v2/A21_W1GwGu775PCAoQbj_pJgBPzIgAzv',\n 'https://mainnet.gateway.tenderly.co/69U6LoF0URUv5CfuIU7FdL',\n ],\n [MoneyInOutChainId.opMainnet]: [\n 'https://mainnet.optimism.io',\n 'https://optimism.llamarpc.com',\n 'https://opt-mainnet.g.alchemy.com/v2/Tkk3-2tTcsCLnFa4dSSUkpZsDyOH55Ar',\n 'https://opt-mainnet.g.alchemy.com/v2/Bin_D_qtJLCqvFyzt-0SxZRWTL423_tg',\n 'https://opt-mainnet.g.alchemy.com/v2/A21_W1GwGu775PCAoQbj_pJgBPzIgAzv',\n 'https://optimism.gateway.tenderly.co/69LkAPTI3LODcBAdtz9wQC',\n ],\n [MoneyInOutChainId.polygonMainnet]: [\n 'https://polygon-rpc.com',\n 'https://gateway.tenderly.co/public/polygon',\n 'https://polygon-mainnet.g.alchemy.com/v2/Tkk3-2tTcsCLnFa4dSSUkpZsDyOH55Ar',\n 'https://polygon-mainnet.g.alchemy.com/v2/Bin_D_qtJLCqvFyzt-0SxZRWTL423_tg',\n 'https://polygon-mainnet.g.alchemy.com/v2/A21_W1GwGu775PCAoQbj_pJgBPzIgAzv',\n 'https://polygon.gateway.tenderly.co/7Qw4fTY4kf3v02LjJjWyvZ',\n ],\n [MoneyInOutChainId.arbitrumOne]: [\n 'https://arb1.arbitrum.io/rpc',\n 'https://arbitrum.llamarpc.com',\n 'https://arb-mainnet.g.alchemy.com/v2/Tkk3-2tTcsCLnFa4dSSUkpZsDyOH55Ar',\n 'https://arb-mainnet.g.alchemy.com/v2/Bin_D_qtJLCqvFyzt-0SxZRWTL423_tg',\n 'https://arb-mainnet.g.alchemy.com/v2/A21_W1GwGu775PCAoQbj_pJgBPzIgAzv',\n 'https://arbitrum.gateway.tenderly.co/1wQGK6nNPTbSc7asucAbzA',\n ],\n [MoneyInOutChainId.baseMainnet]: [\n 'https://mainnet.base.org',\n 'https://base.llamarpc.com',\n 'https://base-mainnet.g.alchemy.com/v2/Tkk3-2tTcsCLnFa4dSSUkpZsDyOH55Ar',\n 'https://base-mainnet.g.alchemy.com/v2/Bin_D_qtJLCqvFyzt-0SxZRWTL423_tg',\n 'https://base-mainnet.g.alchemy.com/v2/A21_W1GwGu775PCAoQbj_pJgBPzIgAzv',\n 'https://base.gateway.tenderly.co/2LHAD54IBvgXiVQdhE9mIF',\n ],\n // Add the rest of the mainnet URLs above\n [ReyaChainId.reyaCronos]: ['https://rpc.reya-cronos.gelato.digital'],\n [MoneyInOutChainId.arbitrumSepolia]: [\n 'https://sepolia-rollup.arbitrum.io/rpc',\n 'https://endpoints.omniatech.io/v1/arbitrum/sepolia/public',\n 'https://arbitrum-sepolia.gateway.tenderly.co/4YMRN8fKu2SV1JSNsGlbMZ',\n ],\n [MoneyInOutChainId.opSepolia]: [\n 'https://sepolia.optimism.io',\n 'https://optimism-sepolia.blockpi.network/v1/rpc/public',\n 'https://optimism-sepolia.gateway.tenderly.co/2nXBEGPk57CotvTJMjIMK7',\n ],\n [MoneyInOutChainId.ethereumSepolia]: [\n 'https://sepolia.gateway.tenderly.co',\n 'https://ethereum-sepolia.blockpi.network/v1/rpc/public',\n 'https://sepolia.gateway.tenderly.co/1u2yZV1rdVLpgOeHwD1Z8M',\n ],\n};\n\nconst ALCHEMY_BASE_RPC_URL: Record<MoneyInOutChainId, string> = {\n // mainnet\n [MoneyInOutChainId.ethereumMainnet]: 'https://eth-mainnet.g.alchemy.com/v2',\n [MoneyInOutChainId.opMainnet]: 'https://opt-mainnet.g.alchemy.com/v2',\n [MoneyInOutChainId.polygonMainnet]:\n 'https://polygon-mainnet.g.alchemy.com/v2',\n [MoneyInOutChainId.arbitrumOne]: 'https://arb-mainnet.g.alchemy.com/v2',\n [MoneyInOutChainId.baseMainnet]: 'https://base-mainnet.g.alchemy.com/v2',\n // testnet\n [MoneyInOutChainId.arbitrumSepolia]: 'https://arb-sepolia.g.alchemy.com/v2',\n [MoneyInOutChainId.opSepolia]: 'https://opt-sepolia.g.alchemy.com/v2',\n [MoneyInOutChainId.ethereumSepolia]: 'https://eth-sepolia.g.alchemy.com/v2',\n};\n\nexport const getAlchemyRpcUrl = (\n apiKey: string,\n chainId: MoneyInOutChainId,\n): string | null => {\n const rpcUrl = ALCHEMY_BASE_RPC_URL[chainId];\n\n if (!rpcUrl) {\n return null;\n }\n\n return `${rpcUrl}/${apiKey}`;\n};\n\nexport const getPublicRpcUrls = (\n chainId: MoneyInOutChainId | ReyaChainId,\n): string[] => {\n const rpcUrls = ChainRpcUrls[chainId];\n\n if (!rpcUrls) {\n return [];\n }\n\n return rpcUrls;\n};\n\nexport const getPublicRpcUrlsOrThrow = (\n chainId: MoneyInOutChainId | ReyaChainId,\n): string[] => {\n const rpcUrls = getPublicRpcUrls(chainId);\n\n if (rpcUrls.length === 0) {\n throw new Error('No public RPC URLs configured for the chain: ' + chainId);\n }\n\n return rpcUrls;\n};\n"]}
1
+ {"version":3,"file":"network.js","sourceRoot":"/","sources":["utils/network.ts"],"names":[],"mappings":";;;;AAAA,kCAA0E;AAE1E,SAAgB,cAAc,CAAC,GAAmB;IAChD,IAAI,GAAG,KAAK,YAAY;QAAE,OAAO,mBAAW,CAAC,WAAW,CAAC;IACzD,IAAI,GAAG,KAAK,MAAM;QAAE,OAAO,mBAAW,CAAC,U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AW3B;AAEK,IAAM,gBAAgB,GAAG,UAC9B,OAAwC;IAExC,IAAM,OAAO,GAAG,oBAAY,CAAC,OAAO,CAAC,CAAC;IAEtC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAVW,QAAA,gBAAgB,oBAU3B;AAEK,IAAM,uBAAuB,GAAG,UACrC,OAAwC;IAExC,IAAM,OAAO,GAAG,IAAA,wBAAgB,EAAC,OAAO,CAAC,CAAC;IAE1C,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,+CAA+C,GAAG,OAAO,CAAC,CAAC;IAC7E,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAVW,QAAA,uBAAuB,2BAUlC","sourcesContent":["import { ApplicationEnv, MoneyInOutChainId, ReyaChainId } from '../types';\n\nexport function getReyaNetwork(env: ApplicationEnv): ReyaChainId {\n if (env === 'production') return ReyaChainId.reyaNetwork;\n if (env === 'test') return ReyaChainId.reyaCronos;\n\n throw new Error('Unknown env for getReyaNetwork');\n}\n\nexport function getMoneyInOutNetworks(\n env: ApplicationEnv,\n): MoneyInOutChainId[] {\n if (env === 'production')\n return [\n MoneyInOutChainId.ethereumMainnet,\n MoneyInOutChainId.opMainnet,\n MoneyInOutChainId.polygonMainnet,\n MoneyInOutChainId.arbitrumOne,\n MoneyInOutChainId.baseMainnet,\n ];\n\n if (env === 'test')\n return [\n MoneyInOutChainId.ethereumSepolia,\n MoneyInOutChainId.opSepolia,\n MoneyInOutChainId.arbitrumSepolia,\n ];\n\n throw new Error('Unknown env for getMoneyInOutNetworks');\n}\n\nexport function getReyaNetworkFromMoneyInOutChainId(\n moneyInOutChainId: MoneyInOutChainId,\n): ReyaChainId {\n if (\n getMoneyInOutNetworks(ApplicationEnv.PRODUCTION).includes(moneyInOutChainId)\n ) {\n return getReyaNetwork(ApplicationEnv.PRODUCTION);\n }\n if (getMoneyInOutNetworks(ApplicationEnv.TEST).includes(moneyInOutChainId)) {\n return getReyaNetwork(ApplicationEnv.TEST);\n }\n\n throw new Error(\n `Unknown money in out network in getReyaNetworkFromMoneyInOutChainId: ${moneyInOutChainId}`,\n );\n}\n\nexport function getMoneyInOutNetworksFromReyaChainId(\n reyaChainId: ReyaChainId,\n): MoneyInOutChainId[] {\n if (getReyaNetwork(ApplicationEnv.PRODUCTION) === reyaChainId) {\n return getMoneyInOutNetworks(ApplicationEnv.PRODUCTION);\n }\n if (getReyaNetwork(ApplicationEnv.TEST) === reyaChainId) {\n return getMoneyInOutNetworks(ApplicationEnv.TEST);\n }\n\n throw new Error(\n `Unknown money in out network in getMoneyInOutNetworksFromReyaChainId: ${reyaChainId}`,\n );\n}\n\nexport const chainIdToExplorerURL: {\n [key in MoneyInOutChainId | ReyaChainId]: string;\n} = {\n [MoneyInOutChainId.ethereumMainnet]: 'https://etherscan.io',\n [MoneyInOutChainId.opMainnet]: 'https://optimistic.etherscan.io',\n [MoneyInOutChainId.polygonMainnet]: 'https://polygonscan.com',\n [MoneyInOutChainId.arbitrumOne]: 'https://arbiscan.io',\n [MoneyInOutChainId.baseMainnet]: 'https://basescan.org',\n [MoneyInOutChainId.arbitrumSepolia]: 'https://sepolia.arbiscan.io',\n [MoneyInOutChainId.opSepolia]: 'https://sepolia-optimism.etherscan.io',\n [MoneyInOutChainId.ethereumSepolia]: 'https://sepolia.etherscan.io',\n [ReyaChainId.reyaNetwork]: 'https://explorer.reya.network',\n [ReyaChainId.reyaCronos]: 'https://reya-cronos.blockscout.com',\n};\n\n// TODO: make this non-export\nexport const ChainRpcUrls: Record<MoneyInOutChainId | ReyaChainId, string[]> = {\n [ReyaChainId.reyaNetwork]: [\n 'https://rpc.reya.network/263e76b89da84d478fd2b6e8783a1cfe',\n ],\n [MoneyInOutChainId.ethereumMainnet]: [\n 'https://mainnet.gateway.tenderly.co',\n 'https://eth.llamarpc.com',\n 'https://eth-mainnet.g.alchemy.com/v2/Tkk3-2tTcsCLnFa4dSSUkpZsDyOH55Ar',\n 'https://eth-mainnet.g.alchemy.com/v2/Bin_D_qtJLCqvFyzt-0SxZRWTL423_tg',\n 'https://eth-mainnet.g.alchemy.com/v2/A21_W1GwGu775PCAoQbj_pJgBPzIgAzv',\n 'https://mainnet.gateway.tenderly.co/69U6LoF0URUv5CfuIU7FdL',\n ],\n [MoneyInOutChainId.opMainnet]: [\n 'https://mainnet.optimism.io',\n 'https://optimism.llamarpc.com',\n 'https://opt-mainnet.g.alchemy.com/v2/Tkk3-2tTcsCLnFa4dSSUkpZsDyOH55Ar',\n 'https://opt-mainnet.g.alchemy.com/v2/Bin_D_qtJLCqvFyzt-0SxZRWTL423_tg',\n 'https://opt-mainnet.g.alchemy.com/v2/A21_W1GwGu775PCAoQbj_pJgBPzIgAzv',\n 'https://optimism.gateway.tenderly.co/69LkAPTI3LODcBAdtz9wQC',\n ],\n [MoneyInOutChainId.polygonMainnet]: [\n 'https://polygon-rpc.com',\n 'https://gateway.tenderly.co/public/polygon',\n 'https://polygon-mainnet.g.alchemy.com/v2/Tkk3-2tTcsCLnFa4dSSUkpZsDyOH55Ar',\n 'https://polygon-mainnet.g.alchemy.com/v2/Bin_D_qtJLCqvFyzt-0SxZRWTL423_tg',\n 'https://polygon-mainnet.g.alchemy.com/v2/A21_W1GwGu775PCAoQbj_pJgBPzIgAzv',\n 'https://polygon.gateway.tenderly.co/7Qw4fTY4kf3v02LjJjWyvZ',\n ],\n [MoneyInOutChainId.arbitrumOne]: [\n 'https://arb1.arbitrum.io/rpc',\n 'https://arbitrum.llamarpc.com',\n 'https://arb-mainnet.g.alchemy.com/v2/Tkk3-2tTcsCLnFa4dSSUkpZsDyOH55Ar',\n 'https://arb-mainnet.g.alchemy.com/v2/Bin_D_qtJLCqvFyzt-0SxZRWTL423_tg',\n 'https://arb-mainnet.g.alchemy.com/v2/A21_W1GwGu775PCAoQbj_pJgBPzIgAzv',\n 'https://arbitrum.gateway.tenderly.co/1wQGK6nNPTbSc7asucAbzA',\n ],\n [MoneyInOutChainId.baseMainnet]: [\n 'https://mainnet.base.org',\n 'https://base.llamarpc.com',\n 'https://base-mainnet.g.alchemy.com/v2/Tkk3-2tTcsCLnFa4dSSUkpZsDyOH55Ar',\n 'https://base-mainnet.g.alchemy.com/v2/Bin_D_qtJLCqvFyzt-0SxZRWTL423_tg',\n 'https://base-mainnet.g.alchemy.com/v2/A21_W1GwGu775PCAoQbj_pJgBPzIgAzv',\n 'https://base.gateway.tenderly.co/2LHAD54IBvgXiVQdhE9mIF',\n ],\n // Add the rest of the mainnet URLs above\n [ReyaChainId.reyaCronos]: [\n 'https://rpc.reya-cronos.gelato.digital/263e76b89da84d478fd2b6e8783a1cfe',\n ],\n [MoneyInOutChainId.arbitrumSepolia]: [\n 'https://sepolia-rollup.arbitrum.io/rpc',\n 'https://endpoints.omniatech.io/v1/arbitrum/sepolia/public',\n 'https://arbitrum-sepolia.gateway.tenderly.co/4YMRN8fKu2SV1JSNsGlbMZ',\n ],\n [MoneyInOutChainId.opSepolia]: [\n 'https://sepolia.optimism.io',\n 'https://optimism-sepolia.blockpi.network/v1/rpc/public',\n 'https://optimism-sepolia.gateway.tenderly.co/2nXBEGPk57CotvTJMjIMK7',\n ],\n [MoneyInOutChainId.ethereumSepolia]: [\n 'https://sepolia.gateway.tenderly.co',\n 'https://ethereum-sepolia.blockpi.network/v1/rpc/public',\n 'https://sepolia.gateway.tenderly.co/1u2yZV1rdVLpgOeHwD1Z8M',\n ],\n};\n\nconst ALCHEMY_BASE_RPC_URL: Record<MoneyInOutChainId, string> = {\n // mainnet\n [MoneyInOutChainId.ethereumMainnet]: 'https://eth-mainnet.g.alchemy.com/v2',\n [MoneyInOutChainId.opMainnet]: 'https://opt-mainnet.g.alchemy.com/v2',\n [MoneyInOutChainId.polygonMainnet]:\n 'https://polygon-mainnet.g.alchemy.com/v2',\n [MoneyInOutChainId.arbitrumOne]: 'https://arb-mainnet.g.alchemy.com/v2',\n [MoneyInOutChainId.baseMainnet]: 'https://base-mainnet.g.alchemy.com/v2',\n // testnet\n [MoneyInOutChainId.arbitrumSepolia]: 'https://arb-sepolia.g.alchemy.com/v2',\n [MoneyInOutChainId.opSepolia]: 'https://opt-sepolia.g.alchemy.com/v2',\n [MoneyInOutChainId.ethereumSepolia]: 'https://eth-sepolia.g.alchemy.com/v2',\n};\n\nexport const getAlchemyRpcUrl = (\n apiKey: string,\n chainId: MoneyInOutChainId,\n): string | null => {\n const rpcUrl = ALCHEMY_BASE_RPC_URL[chainId];\n\n if (!rpcUrl) {\n return null;\n }\n\n return `${rpcUrl}/${apiKey}`;\n};\n\nexport const getPublicRpcUrls = (\n chainId: MoneyInOutChainId | ReyaChainId,\n): string[] => {\n const rpcUrls = ChainRpcUrls[chainId];\n\n if (!rpcUrls) {\n return [];\n }\n\n return rpcUrls;\n};\n\nexport const getPublicRpcUrlsOrThrow = (\n chainId: MoneyInOutChainId | ReyaChainId,\n): string[] => {\n const rpcUrls = getPublicRpcUrls(chainId);\n\n if (rpcUrls.length === 0) {\n throw new Error('No public RPC URLs configured for the chain: ' + chainId);\n }\n\n return rpcUrls;\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reyaxyz/common",
3
- "version": "0.258.2",
3
+ "version": "0.258.3",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -44,5 +44,5 @@
44
44
  "generate:coverage-badges": "npx istanbul-badges-readme --silent"
45
45
  },
46
46
  "packageManager": "pnpm@8.3.1",
47
- "gitHead": "89681cc59978865f94679b02ce077f552af105f2"
47
+ "gitHead": "cd300c6a473312df240cc12ea1c30c5cabc4c425"
48
48
  }
@@ -9,8 +9,10 @@ import { getPublicRpcUrlsOrThrow } from '../utils';
9
9
  import { Interface } from 'ethers';
10
10
 
11
11
  export const reyaChainIdRPCMapper: { [key: number]: string } = {
12
- [ReyaChainId.reyaNetwork]: 'https://rpc.reya.network',
13
- [ReyaChainId.reyaCronos]: 'https://rpc.reya-cronos.gelato.digital',
12
+ [ReyaChainId.reyaNetwork]:
13
+ 'https://rpc.reya.network/263e76b89da84d478fd2b6e8783a1cfe',
14
+ [ReyaChainId.reyaCronos]:
15
+ 'https://rpc.reya-cronos.gelato.digital/263e76b89da84d478fd2b6e8783a1cfe',
14
16
  };
15
17
 
16
18
  export type Transaction = {
@@ -78,7 +78,9 @@ export const chainIdToExplorerURL: {
78
78
 
79
79
  // TODO: make this non-export
80
80
  export const ChainRpcUrls: Record<MoneyInOutChainId | ReyaChainId, string[]> = {
81
- [ReyaChainId.reyaNetwork]: ['https://rpc.reya.network'],
81
+ [ReyaChainId.reyaNetwork]: [
82
+ 'https://rpc.reya.network/263e76b89da84d478fd2b6e8783a1cfe',
83
+ ],
82
84
  [MoneyInOutChainId.ethereumMainnet]: [
83
85
  'https://mainnet.gateway.tenderly.co',
84
86
  'https://eth.llamarpc.com',
@@ -120,7 +122,9 @@ export const ChainRpcUrls: Record<MoneyInOutChainId | ReyaChainId, string[]> = {
120
122
  'https://base.gateway.tenderly.co/2LHAD54IBvgXiVQdhE9mIF',
121
123
  ],
122
124
  // Add the rest of the mainnet URLs above
123
- [ReyaChainId.reyaCronos]: ['https://rpc.reya-cronos.gelato.digital'],
125
+ [ReyaChainId.reyaCronos]: [
126
+ 'https://rpc.reya-cronos.gelato.digital/263e76b89da84d478fd2b6e8783a1cfe',
127
+ ],
124
128
  [MoneyInOutChainId.arbitrumSepolia]: [
125
129
  'https://sepolia-rollup.arbitrum.io/rpc',
126
130
  'https://endpoints.omniatech.io/v1/arbitrum/sepolia/public',