@paxoslabs/amplify-sdk 0.2.0-alpha.0 → 0.2.0-alpha.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.
Files changed (35) hide show
  1. package/dist/{chunk-BOW2QPQC.mjs → chunk-4ORV7PFT.mjs} +3 -3
  2. package/dist/{chunk-BOW2QPQC.mjs.map → chunk-4ORV7PFT.mjs.map} +1 -1
  3. package/dist/{chunk-XUS6KI3G.js → chunk-76SRRIGW.js} +8 -8
  4. package/dist/{chunk-XUS6KI3G.js.map → chunk-76SRRIGW.js.map} +1 -1
  5. package/dist/{chunk-UMRTU75Q.js → chunk-EWJDKRSY.js} +15 -16
  6. package/dist/chunk-EWJDKRSY.js.map +1 -0
  7. package/dist/{chunk-E7R7TL7J.mjs → chunk-LJPJWJ2Y.mjs} +4 -4
  8. package/dist/{chunk-E7R7TL7J.mjs.map → chunk-LJPJWJ2Y.mjs.map} +1 -1
  9. package/dist/{chunk-5VOI4WPL.js → chunk-SMIA4ULA.js} +19 -19
  10. package/dist/{chunk-5VOI4WPL.js.map → chunk-SMIA4ULA.js.map} +1 -1
  11. package/dist/{chunk-4NQCOMCZ.js → chunk-TF3S7T6P.js} +8 -8
  12. package/dist/{chunk-4NQCOMCZ.js.map → chunk-TF3S7T6P.js.map} +1 -1
  13. package/dist/{chunk-7PCUTZF6.mjs → chunk-UURNMLRT.mjs} +3 -3
  14. package/dist/{chunk-7PCUTZF6.mjs.map → chunk-UURNMLRT.mjs.map} +1 -1
  15. package/dist/{chunk-KB4EPCK2.js → chunk-WWTNCRXX.js} +4 -4
  16. package/dist/{chunk-KB4EPCK2.js.map → chunk-WWTNCRXX.js.map} +1 -1
  17. package/dist/{chunk-5Y7M43XN.mjs → chunk-Y3QNUDV6.mjs} +3 -3
  18. package/dist/{chunk-5Y7M43XN.mjs.map → chunk-Y3QNUDV6.mjs.map} +1 -1
  19. package/dist/{chunk-IMS2HBJ7.mjs → chunk-YDMFT2R7.mjs} +15 -16
  20. package/dist/chunk-YDMFT2R7.mjs.map +1 -0
  21. package/dist/core.js +14 -14
  22. package/dist/core.mjs +4 -4
  23. package/dist/display.js +12 -12
  24. package/dist/display.mjs +4 -4
  25. package/dist/index.d.mts +9 -8
  26. package/dist/index.d.ts +9 -8
  27. package/dist/index.js +115 -115
  28. package/dist/index.js.map +1 -1
  29. package/dist/index.mjs +6 -6
  30. package/dist/index.mjs.map +1 -1
  31. package/dist/utils.js +5 -5
  32. package/dist/utils.mjs +2 -2
  33. package/package.json +1 -1
  34. package/dist/chunk-IMS2HBJ7.mjs.map +0 -1
  35. package/dist/chunk-UMRTU75Q.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { getClient, TellerAbi, AccountantAbi } from './chunk-5Y7M43XN.mjs';
1
+ import { getClient, TellerAbi, AccountantAbi } from './chunk-Y3QNUDV6.mjs';
2
2
  import 'viem';
3
3
 
4
4
  var getPausedStates = async ({
@@ -42,5 +42,5 @@ var getPreviewFee = async ({
42
42
  };
43
43
 
44
44
  export { getPausedStates, getPreviewFee };
45
- //# sourceMappingURL=chunk-7PCUTZF6.mjs.map
46
- //# sourceMappingURL=chunk-7PCUTZF6.mjs.map
45
+ //# sourceMappingURL=chunk-UURNMLRT.mjs.map
46
+ //# sourceMappingURL=chunk-UURNMLRT.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/api/multi-call.ts","../src/api/teller.ts"],"names":[],"mappings":";;;AA2CA,IAAM,kBAAkB,OAAO;AAAA,EAC7B,iBAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAAA,KAAyB;AACvB,EAAA,MAAM,MAAA,GAAS,MAAM,SAAA,CAAU,OAAO,CAAA;AAEtC,EAAA,MAAM,OAAA,GAAU,MAAM,MAAA,CAAO,SAAA,CAAU;AAAA,IACrC,SAAA,EAAW;AAAA,MACT;AAAA,QACE,GAAA,EAAK,SAAA;AAAA,QACL,OAAA,EAAS,aAAA;AAAA,QACT,YAAA,EAAc;AAAA,OAChB;AAAA,MACA;AAAA,QACE,GAAA,EAAK,aAAA;AAAA,QACL,OAAA,EAAS,iBAAA;AAAA,QACT,YAAA,EAAc;AAAA;AAChB;AACF,GACD,CAAA;AACD,EAAA,OAAO,OAAA;AACT;;;ACjCA,IAAM,gBAAgB,OAAO;AAAA,EAC3B,WAAA;AAAA,EACA,UAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAA,KAA2C;AACzC,EAAA,MAAM,MAAA,GAAS,MAAM,SAAA,CAAU,OAAO,CAAA;AAEtC,EAAA,MAAM,IAAA,GAAO,MAAM,MAAA,CAAO,YAAA,CAAa;AAAA,IACrC,GAAA,EAAK,SAAA;AAAA,IACL,OAAA,EAAS,eAAA;AAAA,IACT,YAAA,EAAc,YAAA;AAAA,IACd,IAAA,EAAM,CAAC,WAAA,EAAa,UAAU;AAAA,GAC/B,CAAA;AAED,EAAA,OAAO,IAAA;AACT","file":"chunk-7PCUTZF6.mjs","sourcesContent":["import { type Address, erc20Abi } from \"viem\";\nimport { AccountantAbi } from \"../abi/accountant-abi\";\nimport { TellerAbi } from \"../abi/teller-abi\";\nimport { getClient } from \"../lib/viem/client\";\nimport type { ChainId } from \"./vault-config\";\n\ntype RateInQuoteWithAssetDecimalsProps = {\n assetAddress: Address;\n accountantAddress: Address;\n chainId: ChainId;\n};\n\nconst getRateInQuoteWithAssetDecimals = async ({\n assetAddress,\n accountantAddress,\n chainId,\n}: RateInQuoteWithAssetDecimalsProps) => {\n const client = await getClient(chainId);\n\n const results = await client.multicall({\n contracts: [\n {\n abi: erc20Abi,\n address: assetAddress,\n functionName: \"decimals\",\n },\n {\n abi: AccountantAbi,\n address: accountantAddress,\n functionName: \"getRateInQuote\",\n args: [assetAddress],\n },\n ],\n });\n return results;\n};\n\ntype PausedStatusProps = {\n accountantAddress: Address;\n tellerAddress: Address;\n chainId: ChainId;\n};\n\nconst getPausedStates = async ({\n accountantAddress,\n tellerAddress,\n chainId,\n}: PausedStatusProps) => {\n const client = await getClient(chainId);\n\n const results = await client.multicall({\n contracts: [\n {\n abi: TellerAbi,\n address: tellerAddress,\n functionName: \"isPaused\",\n },\n {\n abi: AccountantAbi,\n address: accountantAddress,\n functionName: \"accountantState\",\n },\n ],\n });\n return results;\n};\n\nexport { getPausedStates, getRateInQuoteWithAssetDecimals };\n","/**\n * @fileoverview Functions for interacting with the Teller contract\n */\nimport type { Address } from \"viem\";\nimport { TellerAbi } from \"../abi/teller-abi\";\nimport { getClient } from \"../lib/viem/client\";\nimport type { ChainId } from \"./vault-config\";\n\n/**\n * Arguments required by the bridge contract for cross-chain transfers\n * @interface BridgeData\n * @property {number} chainSelector - Unique identifier for the destination chain\n * @property {Address} destinationChainReceiver - Address that will receive the bridged tokens\n * @property {Address} bridgeFeeToken - Token used to pay the bridge fee\n * @property {bigint} messageGas - Amount of gas allocated for the cross-chain message\n * @property {`0x${string}`} data - Additional data required for the bridge operation (hex encoded)\n */\nexport type BridgeData = {\n chainSelector: number;\n destinationChainReceiver: Address;\n bridgeFeeToken: Address;\n messageGas: bigint;\n data: `0x${string}`;\n};\n\ntype GetPreviewFeeProps = {\n shareAmount: bigint;\n bridgeData: BridgeData;\n contractAddress: Address;\n chainId: ChainId;\n};\n\nconst getPreviewFee = async ({\n shareAmount,\n bridgeData,\n contractAddress,\n chainId,\n}: GetPreviewFeeProps): Promise<bigint> => {\n const client = await getClient(chainId);\n\n const rate = await client.readContract({\n abi: TellerAbi,\n address: contractAddress,\n functionName: \"previewFee\",\n args: [shareAmount, bridgeData],\n });\n\n return rate;\n};\n\nexport { getPreviewFee };\n"]}
1
+ {"version":3,"sources":["../src/api/multi-call.ts","../src/api/teller.ts"],"names":[],"mappings":";;;AA2CA,IAAM,kBAAkB,OAAO;AAAA,EAC7B,iBAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAAA,KAAyB;AACvB,EAAA,MAAM,MAAA,GAAS,MAAM,SAAA,CAAU,OAAO,CAAA;AAEtC,EAAA,MAAM,OAAA,GAAU,MAAM,MAAA,CAAO,SAAA,CAAU;AAAA,IACrC,SAAA,EAAW;AAAA,MACT;AAAA,QACE,GAAA,EAAK,SAAA;AAAA,QACL,OAAA,EAAS,aAAA;AAAA,QACT,YAAA,EAAc;AAAA,OAChB;AAAA,MACA;AAAA,QACE,GAAA,EAAK,aAAA;AAAA,QACL,OAAA,EAAS,iBAAA;AAAA,QACT,YAAA,EAAc;AAAA;AAChB;AACF,GACD,CAAA;AACD,EAAA,OAAO,OAAA;AACT;;;ACjCA,IAAM,gBAAgB,OAAO;AAAA,EAC3B,WAAA;AAAA,EACA,UAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAA,KAA2C;AACzC,EAAA,MAAM,MAAA,GAAS,MAAM,SAAA,CAAU,OAAO,CAAA;AAEtC,EAAA,MAAM,IAAA,GAAO,MAAM,MAAA,CAAO,YAAA,CAAa;AAAA,IACrC,GAAA,EAAK,SAAA;AAAA,IACL,OAAA,EAAS,eAAA;AAAA,IACT,YAAA,EAAc,YAAA;AAAA,IACd,IAAA,EAAM,CAAC,WAAA,EAAa,UAAU;AAAA,GAC/B,CAAA;AAED,EAAA,OAAO,IAAA;AACT","file":"chunk-UURNMLRT.mjs","sourcesContent":["import { type Address, erc20Abi } from \"viem\";\nimport { AccountantAbi } from \"../abi/accountant-abi\";\nimport { TellerAbi } from \"../abi/teller-abi\";\nimport { getClient } from \"../lib/viem/client\";\nimport type { ChainId } from \"./vault-config\";\n\ntype RateInQuoteWithAssetDecimalsProps = {\n assetAddress: Address;\n accountantAddress: Address;\n chainId: ChainId;\n};\n\nconst getRateInQuoteWithAssetDecimals = async ({\n assetAddress,\n accountantAddress,\n chainId,\n}: RateInQuoteWithAssetDecimalsProps) => {\n const client = await getClient(chainId);\n\n const results = await client.multicall({\n contracts: [\n {\n abi: erc20Abi,\n address: assetAddress,\n functionName: \"decimals\",\n },\n {\n abi: AccountantAbi,\n address: accountantAddress,\n functionName: \"getRateInQuote\",\n args: [assetAddress],\n },\n ],\n });\n return results;\n};\n\ntype PausedStatusProps = {\n accountantAddress: Address;\n tellerAddress: Address;\n chainId: ChainId;\n};\n\nconst getPausedStates = async ({\n accountantAddress,\n tellerAddress,\n chainId,\n}: PausedStatusProps) => {\n const client = await getClient(chainId);\n\n const results = await client.multicall({\n contracts: [\n {\n abi: TellerAbi,\n address: tellerAddress,\n functionName: \"isPaused\",\n },\n {\n abi: AccountantAbi,\n address: accountantAddress,\n functionName: \"accountantState\",\n },\n ],\n });\n return results;\n};\n\nexport { getPausedStates, getRateInQuoteWithAssetDecimals };\n","/**\n * @fileoverview Functions for interacting with the Teller contract\n */\nimport type { Address } from \"viem\";\nimport { TellerAbi } from \"../abi/teller-abi\";\nimport { getClient } from \"../lib/viem/client\";\nimport type { ChainId } from \"./vault-config\";\n\n/**\n * Arguments required by the bridge contract for cross-chain transfers\n * @interface BridgeData\n * @property {number} chainSelector - Unique identifier for the destination chain\n * @property {Address} destinationChainReceiver - Address that will receive the bridged tokens\n * @property {Address} bridgeFeeToken - Token used to pay the bridge fee\n * @property {bigint} messageGas - Amount of gas allocated for the cross-chain message\n * @property {`0x${string}`} data - Additional data required for the bridge operation (hex encoded)\n */\nexport type BridgeData = {\n chainSelector: number;\n destinationChainReceiver: Address;\n bridgeFeeToken: Address;\n messageGas: bigint;\n data: `0x${string}`;\n};\n\ntype GetPreviewFeeProps = {\n shareAmount: bigint;\n bridgeData: BridgeData;\n contractAddress: Address;\n chainId: ChainId;\n};\n\nconst getPreviewFee = async ({\n shareAmount,\n bridgeData,\n contractAddress,\n chainId,\n}: GetPreviewFeeProps): Promise<bigint> => {\n const client = await getClient(chainId);\n\n const rate = await client.readContract({\n abi: TellerAbi,\n address: contractAddress,\n functionName: \"previewFee\",\n args: [shareAmount, bridgeData],\n });\n\n return rate;\n};\n\nexport { getPreviewFee };\n"]}
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkUMRTU75Q_js = require('./chunk-UMRTU75Q.js');
3
+ var chunkEWJDKRSY_js = require('./chunk-EWJDKRSY.js');
4
4
 
5
5
  // src/utils/time.ts
6
- var calculateDeadline = (daysFromNow = chunkUMRTU75Q_js.DEFAULT_DEADLINE) => {
6
+ var calculateDeadline = (daysFromNow = chunkEWJDKRSY_js.DEFAULT_DEADLINE) => {
7
7
  const daysInSeconds = daysFromNow * 24 * 60 * 60;
8
8
  const currentTimeStamp = Math.floor(Date.now() / 1e3);
9
9
  const deadline = currentTimeStamp + daysInSeconds;
@@ -11,5 +11,5 @@ var calculateDeadline = (daysFromNow = chunkUMRTU75Q_js.DEFAULT_DEADLINE) => {
11
11
  };
12
12
 
13
13
  exports.calculateDeadline = calculateDeadline;
14
- //# sourceMappingURL=chunk-KB4EPCK2.js.map
15
- //# sourceMappingURL=chunk-KB4EPCK2.js.map
14
+ //# sourceMappingURL=chunk-WWTNCRXX.js.map
15
+ //# sourceMappingURL=chunk-WWTNCRXX.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/time.ts"],"names":["DEFAULT_DEADLINE"],"mappings":";;;;;AAoBO,IAAM,iBAAA,GAAoB,CAAC,WAAA,GAAcA,iCAAA,KAAqB;AAEnE,EAAA,MAAM,aAAA,GAAgB,WAAA,GAAc,EAAA,GAAK,EAAA,GAAK,EAAA;AAG9C,EAAA,MAAM,mBAAmB,IAAA,CAAK,KAAA,CAAM,IAAA,CAAK,GAAA,KAAQ,GAAI,CAAA;AAGrD,EAAA,MAAM,WAAW,gBAAA,GAAmB,aAAA;AAEpC,EAAA,OAAO,OAAO,QAAQ,CAAA;AACxB","file":"chunk-KB4EPCK2.js","sourcesContent":["/**\n * @fileoverview Utility functions for time-related operations\n */\n\nimport { DEFAULT_DEADLINE } from \"../constants\";\n\n/**\n * Calculates a deadline timestamp in seconds from the current time\n *\n * @param {number} [daysFromNow=DEFAULT_DEADLINE] - Number of days from now to set the deadline\n * @returns {number} Unix timestamp in seconds representing the deadline\n *\n * @example\n * // Returns a timestamp 3 days from now (in seconds)\n * const threeDay = calculateDeadline();\n *\n * @example\n * // Returns a timestamp 7 days from now (in seconds)\n * const weekDeadline = calculateDeadline(7);\n */\nexport const calculateDeadline = (daysFromNow = DEFAULT_DEADLINE) => {\n // Get days in seconds\n const daysInSeconds = daysFromNow * 24 * 60 * 60;\n\n // Get current timestamp in seconds\n const currentTimeStamp = Math.floor(Date.now() / 1000);\n\n // Calculate deadline (current time + 3 days in seconds)\n const deadline = currentTimeStamp + daysInSeconds;\n\n return BigInt(deadline);\n};\n"]}
1
+ {"version":3,"sources":["../src/utils/time.ts"],"names":["DEFAULT_DEADLINE"],"mappings":";;;;;AAoBO,IAAM,iBAAA,GAAoB,CAAC,WAAA,GAAcA,iCAAA,KAAqB;AAEnE,EAAA,MAAM,aAAA,GAAgB,WAAA,GAAc,EAAA,GAAK,EAAA,GAAK,EAAA;AAG9C,EAAA,MAAM,mBAAmB,IAAA,CAAK,KAAA,CAAM,IAAA,CAAK,GAAA,KAAQ,GAAI,CAAA;AAGrD,EAAA,MAAM,WAAW,gBAAA,GAAmB,aAAA;AAEpC,EAAA,OAAO,OAAO,QAAQ,CAAA;AACxB","file":"chunk-WWTNCRXX.js","sourcesContent":["/**\n * @fileoverview Utility functions for time-related operations\n */\n\nimport { DEFAULT_DEADLINE } from \"../constants\";\n\n/**\n * Calculates a deadline timestamp in seconds from the current time\n *\n * @param {number} [daysFromNow=DEFAULT_DEADLINE] - Number of days from now to set the deadline\n * @returns {number} Unix timestamp in seconds representing the deadline\n *\n * @example\n * // Returns a timestamp 3 days from now (in seconds)\n * const threeDay = calculateDeadline();\n *\n * @example\n * // Returns a timestamp 7 days from now (in seconds)\n * const weekDeadline = calculateDeadline(7);\n */\nexport const calculateDeadline = (daysFromNow = DEFAULT_DEADLINE) => {\n // Get days in seconds\n const daysInSeconds = daysFromNow * 24 * 60 * 60;\n\n // Get current timestamp in seconds\n const currentTimeStamp = Math.floor(Date.now() / 1000);\n\n // Calculate deadline (current time + 3 days in seconds)\n const deadline = currentTimeStamp + daysInSeconds;\n\n return BigInt(deadline);\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import { toChainId } from './chunk-J3662HYT.mjs';
2
- import { getChainFromConfig, fetchVaults, APIError } from './chunk-IMS2HBJ7.mjs';
2
+ import { getChainFromConfig, fetchVaults, APIError } from './chunk-YDMFT2R7.mjs';
3
3
  import { createPublicClient, http, erc20Abi } from 'viem';
4
4
 
5
5
  // src/abi/erc2612-abi.ts
@@ -2186,5 +2186,5 @@ var TellerAbi = [
2186
2186
  ];
2187
2187
 
2188
2188
  export { AccountantAbi, BoringVaultAbi, TellerAbi, erc2612Abi, getClient, getErc20Allowance, getErc20AllowanceWithDecimals, getErc20Balance, getErc20Decimals, getRateInQuoteAndSharesAndWantAssetDecimals, getRateInQuoteWithAssetDecimals, getTokenPermitInfoWithAllowance };
2189
- //# sourceMappingURL=chunk-5Y7M43XN.mjs.map
2190
- //# sourceMappingURL=chunk-5Y7M43XN.mjs.map
2189
+ //# sourceMappingURL=chunk-Y3QNUDV6.mjs.map
2190
+ //# sourceMappingURL=chunk-Y3QNUDV6.mjs.map