@lit-protocol/vincent-ability-uniswap-swap 2.0.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +94 -83
  3. package/dist/CHANGELOG.md +15 -0
  4. package/dist/README.md +94 -83
  5. package/dist/package.json +6 -4
  6. package/dist/src/generated/lit-action-prepare.js +9 -0
  7. package/dist/src/generated/lit-action.js +2 -2
  8. package/dist/src/generated/vincent-ability-metadata.json +1 -1
  9. package/dist/src/generated/vincent-bundled-ability.d.ts +132 -946
  10. package/dist/src/generated/vincent-bundled-ability.d.ts.map +1 -1
  11. package/dist/src/generated/vincent-prepare-metadata.json +6 -0
  12. package/dist/src/index.d.ts +3 -0
  13. package/dist/src/index.d.ts.map +1 -1
  14. package/dist/src/index.js +5 -1
  15. package/dist/src/index.js.map +1 -1
  16. package/dist/src/lib/ability-checks/check-token-in-balance.d.ts +1 -1
  17. package/dist/src/lib/ability-checks/check-token-in-balance.d.ts.map +1 -1
  18. package/dist/src/lib/ability-checks/check-token-in-balance.js.map +1 -1
  19. package/dist/src/lib/ability-checks/index.d.ts +0 -1
  20. package/dist/src/lib/ability-checks/index.d.ts.map +1 -1
  21. package/dist/src/lib/ability-checks/index.js +0 -1
  22. package/dist/src/lib/ability-checks/index.js.map +1 -1
  23. package/dist/src/lib/ability-helpers/get-gas-params.d.ts +1 -1
  24. package/dist/src/lib/ability-helpers/get-gas-params.d.ts.map +1 -1
  25. package/dist/src/lib/ability-helpers/get-gas-params.js +5 -3
  26. package/dist/src/lib/ability-helpers/get-gas-params.js.map +1 -1
  27. package/dist/src/lib/ability-helpers/get-uniswap-quote.d.ts +6 -11
  28. package/dist/src/lib/ability-helpers/get-uniswap-quote.d.ts.map +1 -1
  29. package/dist/src/lib/ability-helpers/get-uniswap-quote.js +59 -104
  30. package/dist/src/lib/ability-helpers/get-uniswap-quote.js.map +1 -1
  31. package/dist/src/lib/ability-helpers/index.d.ts +0 -4
  32. package/dist/src/lib/ability-helpers/index.d.ts.map +1 -1
  33. package/dist/src/lib/ability-helpers/index.js +0 -4
  34. package/dist/src/lib/ability-helpers/index.js.map +1 -1
  35. package/dist/src/lib/ability-helpers/send-uniswap-tx.d.ts +8 -8
  36. package/dist/src/lib/ability-helpers/send-uniswap-tx.d.ts.map +1 -1
  37. package/dist/src/lib/ability-helpers/send-uniswap-tx.js +25 -53
  38. package/dist/src/lib/ability-helpers/send-uniswap-tx.js.map +1 -1
  39. package/dist/src/lib/prepare/get-signed-uniswap-quote.d.ts +9 -0
  40. package/dist/src/lib/prepare/get-signed-uniswap-quote.d.ts.map +1 -0
  41. package/dist/src/lib/prepare/get-signed-uniswap-quote.js +56 -0
  42. package/dist/src/lib/prepare/get-signed-uniswap-quote.js.map +1 -0
  43. package/dist/src/lib/prepare/lit-action.d.ts +2 -0
  44. package/dist/src/lib/prepare/lit-action.d.ts.map +1 -0
  45. package/dist/src/lib/prepare/lit-action.js +87 -0
  46. package/dist/src/lib/prepare/lit-action.js.map +1 -0
  47. package/dist/src/lib/prepare/types.d.ts +48 -0
  48. package/dist/src/lib/prepare/types.d.ts.map +1 -0
  49. package/dist/src/lib/prepare/types.js +3 -0
  50. package/dist/src/lib/prepare/types.js.map +1 -0
  51. package/dist/src/lib/prepare/validate-signed-uniswap-quote.d.ts +6 -0
  52. package/dist/src/lib/prepare/validate-signed-uniswap-quote.d.ts.map +1 -0
  53. package/dist/src/lib/prepare/validate-signed-uniswap-quote.js +22 -0
  54. package/dist/src/lib/prepare/validate-signed-uniswap-quote.js.map +1 -0
  55. package/dist/src/lib/schemas.d.ts +133 -62
  56. package/dist/src/lib/schemas.d.ts.map +1 -1
  57. package/dist/src/lib/schemas.js +26 -41
  58. package/dist/src/lib/schemas.js.map +1 -1
  59. package/dist/src/lib/vincent-ability.d.ts +132 -946
  60. package/dist/src/lib/vincent-ability.d.ts.map +1 -1
  61. package/dist/src/lib/vincent-ability.js +52 -122
  62. package/dist/src/lib/vincent-ability.js.map +1 -1
  63. package/package.json +8 -6
  64. package/dist/src/lib/ability-checks/check-uniswap-pool-exists.d.ts +0 -10
  65. package/dist/src/lib/ability-checks/check-uniswap-pool-exists.d.ts.map +0 -1
  66. package/dist/src/lib/ability-checks/check-uniswap-pool-exists.js +0 -24
  67. package/dist/src/lib/ability-checks/check-uniswap-pool-exists.js.map +0 -1
  68. package/dist/src/lib/ability-helpers/calculate-usd-value.d.ts +0 -7
  69. package/dist/src/lib/ability-helpers/calculate-usd-value.d.ts.map +0 -1
  70. package/dist/src/lib/ability-helpers/calculate-usd-value.js +0 -22
  71. package/dist/src/lib/ability-helpers/calculate-usd-value.js.map +0 -1
  72. package/dist/src/lib/ability-helpers/estimate-gas-for-swap.d.ts +0 -7
  73. package/dist/src/lib/ability-helpers/estimate-gas-for-swap.d.ts.map +0 -1
  74. package/dist/src/lib/ability-helpers/estimate-gas-for-swap.js +0 -24
  75. package/dist/src/lib/ability-helpers/estimate-gas-for-swap.js.map +0 -1
  76. package/dist/src/lib/ability-helpers/get-eth-usd-price.d.ts +0 -6
  77. package/dist/src/lib/ability-helpers/get-eth-usd-price.d.ts.map +0 -1
  78. package/dist/src/lib/ability-helpers/get-eth-usd-price.js +0 -22
  79. package/dist/src/lib/ability-helpers/get-eth-usd-price.js.map +0 -1
  80. package/dist/src/lib/ability-helpers/get-token-amount-in-usd.d.ts +0 -10
  81. package/dist/src/lib/ability-helpers/get-token-amount-in-usd.d.ts.map +0 -1
  82. package/dist/src/lib/ability-helpers/get-token-amount-in-usd.js +0 -68
  83. package/dist/src/lib/ability-helpers/get-token-amount-in-usd.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"vincent-ability.d.ts","sourceRoot":"","sources":["../../../src/lib/vincent-ability.ts"],"names":[],"mappings":"AAqCA,eAAO,MAAM,cAAc,GAAI,KAAK,GAAG,EAAE,OAAO,GAAG,QAElD,CAAC;AAEF,eAAO,MAAM,cA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":["../../../src/lib/vincent-ability.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,cAAc,GAAI,KAAK,GAAG,EAAE,OAAO,GAAG,QAElD,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8GzB,CAAC"}
@@ -1,26 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.vincentAbility = exports.bigintReplacer = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const vincent_ability_sdk_1 = require("@lit-protocol/vincent-ability-sdk");
5
- const vincent_policy_spending_limit_1 = require("@lit-protocol/vincent-policy-spending-limit");
6
- const sdk_core_1 = require("@uniswap/sdk-core");
6
+ const ethers_1 = require("ethers");
7
7
  const ability_helpers_1 = require("./ability-helpers");
8
8
  const ability_checks_1 = require("./ability-checks");
9
9
  const schemas_1 = require("./schemas");
10
- const ethers_1 = require("ethers");
11
10
  const check_erc20_allowance_1 = require("./ability-checks/check-erc20-allowance");
12
- const SpendingLimitPolicy = (0, vincent_ability_sdk_1.createVincentAbilityPolicy)({
13
- abilityParamsSchema: schemas_1.abilityParamsSchema,
14
- bundledVincentPolicy: vincent_policy_spending_limit_1.bundledVincentPolicy,
15
- abilityParameterMappings: {
16
- rpcUrlForUniswap: 'rpcUrlForUniswap',
17
- chainIdForUniswap: 'chainIdForUniswap',
18
- ethRpcUrl: 'ethRpcUrl',
19
- tokenInAddress: 'tokenAddress',
20
- tokenInDecimals: 'tokenDecimals',
21
- tokenInAmount: 'buyAmount',
22
- },
23
- });
11
+ const validate_signed_uniswap_quote_1 = require("./prepare/validate-signed-uniswap-quote");
12
+ const vincent_prepare_metadata_json_1 = tslib_1.__importDefault(require("../generated/vincent-prepare-metadata.json"));
24
13
  const bigintReplacer = (key, value) => {
25
14
  return typeof value === 'bigint' ? value.toString() : value;
26
15
  };
@@ -29,55 +18,47 @@ exports.vincentAbility = (0, vincent_ability_sdk_1.createVincentAbility)({
29
18
  packageName: '@lit-protocol/vincent-ability-uniswap-swap',
30
19
  abilityDescription: 'Performs a swap between two ERC20 tokens using Uniswap',
31
20
  abilityParamsSchema: schemas_1.abilityParamsSchema,
32
- supportedPolicies: (0, vincent_ability_sdk_1.supportedPoliciesForAbility)([SpendingLimitPolicy]),
21
+ supportedPolicies: (0, vincent_ability_sdk_1.supportedPoliciesForAbility)([]),
33
22
  executeSuccessSchema: schemas_1.executeSuccessSchema,
34
23
  executeFailSchema: schemas_1.executeFailSchema,
35
24
  precheckFailSchema: schemas_1.precheckFailSchema,
36
25
  precheck: async ({ abilityParams }, { succeed, fail, delegation: { delegatorPkpInfo } }) => {
37
- // TODO: Rewrite checks to use `createAllowResult` and `createDenyResult` so we always know when we get a runtime err
38
- const { rpcUrlForUniswap, chainIdForUniswap, tokenInAddress, tokenInDecimals, tokenInAmount, tokenOutAddress, tokenOutDecimals, } = abilityParams;
39
26
  console.log('Prechecking UniswapSwapAbility', JSON.stringify(abilityParams, exports.bigintReplacer, 2));
40
- const delegatorPkpAddress = delegatorPkpInfo.ethAddress;
41
- const provider = new ethers_1.ethers.providers.JsonRpcProvider(rpcUrlForUniswap);
27
+ // TODO: Rewrite checks to use `createAllowResult` and `createDenyResult` so we always know when we get a runtime err
28
+ const { rpcUrlForUniswap, signedUniswapQuote } = abilityParams;
29
+ const { quote } = signedUniswapQuote;
42
30
  try {
43
- await (0, ability_checks_1.checkNativeTokenBalance)({
44
- provider,
45
- pkpEthAddress: delegatorPkpAddress,
31
+ (0, validate_signed_uniswap_quote_1.validateSignedUniswapQuote)({
32
+ prepareSuccessResult: signedUniswapQuote,
33
+ expectedSignerEthAddress: vincent_prepare_metadata_json_1.default.pkpEthAddress,
46
34
  });
47
35
  }
48
- catch (err) {
36
+ catch (error) {
49
37
  return fail({
50
- reason: `Native token balance error: ${err instanceof Error ? err.message : String(err)}`,
38
+ reason: `Uniswap quote validation failed: ${error instanceof Error ? error.message : String(error)}`,
51
39
  });
52
40
  }
53
- const uniswapRouterAddress = sdk_core_1.CHAIN_TO_ADDRESSES_MAP[chainIdForUniswap].swapRouter02Address;
54
- if (uniswapRouterAddress === undefined) {
55
- return fail({
56
- reason: `Uniswap router address not found for chainId ${chainIdForUniswap} (UniswapSwapAbilityPrecheck)`,
57
- });
58
- }
59
- const requiredAmount = ethers_1.ethers.utils
60
- .parseUnits(tokenInAmount.toString(), tokenInDecimals)
61
- .toBigInt();
41
+ const delegatorPkpAddress = delegatorPkpInfo.ethAddress;
42
+ const provider = new ethers_1.ethers.providers.StaticJsonRpcProvider(rpcUrlForUniswap);
62
43
  try {
63
- await (0, check_erc20_allowance_1.checkErc20Allowance)({
44
+ await (0, ability_checks_1.checkNativeTokenBalance)({
64
45
  provider,
65
- tokenAddress: tokenInAddress,
66
- owner: delegatorPkpAddress,
67
- spender: uniswapRouterAddress,
68
- tokenAmount: requiredAmount,
46
+ pkpEthAddress: delegatorPkpAddress,
69
47
  });
70
48
  }
71
49
  catch (err) {
72
50
  return fail({
73
- reason: `ERC20 allowance check error: ${err instanceof Error ? err.message : String(err)}`,
51
+ reason: `Native token balance error: ${err instanceof Error ? err.message : String(err)}`,
74
52
  });
75
53
  }
54
+ const requiredAmount = ethers_1.ethers.utils
55
+ .parseUnits(quote.amountIn, quote.tokenInDecimals)
56
+ .toBigInt();
76
57
  try {
77
58
  await (0, ability_checks_1.checkTokenInBalance)({
78
59
  provider,
79
60
  pkpEthAddress: delegatorPkpAddress,
80
- tokenInAddress: tokenInAddress,
61
+ tokenInAddress: quote.tokenIn,
81
62
  tokenInAmount: requiredAmount,
82
63
  });
83
64
  }
@@ -86,102 +67,51 @@ exports.vincentAbility = (0, vincent_ability_sdk_1.createVincentAbility)({
86
67
  reason: `tokenIn balance check error: ${err instanceof Error ? err.message : String(err)}`,
87
68
  });
88
69
  }
70
+ // Check ERC20 allowance for the router specified in the route
89
71
  try {
90
- await (0, ability_checks_1.checkUniswapPoolExists)({
91
- rpcUrl: rpcUrlForUniswap,
92
- chainId: chainIdForUniswap,
93
- tokenInAddress: tokenInAddress,
94
- tokenInDecimals,
95
- tokenInAmount,
96
- tokenOutAddress: tokenOutAddress,
97
- tokenOutDecimals,
72
+ await (0, check_erc20_allowance_1.checkErc20Allowance)({
73
+ provider,
74
+ tokenAddress: quote.tokenIn,
75
+ owner: delegatorPkpAddress,
76
+ spender: quote.to,
77
+ tokenAmount: requiredAmount,
98
78
  });
99
79
  }
100
80
  catch (err) {
101
81
  return fail({
102
- reason: `Check uniswap pool exists error: ${err instanceof Error ? err.message : String(err)}`,
82
+ reason: `ERC20 allowance check error: ${err instanceof Error ? err.message : String(err)}`,
83
+ erc20SpenderAddress: quote.to,
103
84
  });
104
85
  }
105
86
  return succeed();
106
87
  },
107
- execute: async ({ abilityParams }, { succeed, fail, policiesContext, delegation: { delegatorPkpInfo } }) => {
88
+ execute: async ({ abilityParams }, { succeed, fail, delegation: { delegatorPkpInfo } }) => {
108
89
  console.log('Executing UniswapSwapAbility', JSON.stringify(abilityParams, exports.bigintReplacer, 2));
109
- const { ethAddress: delegatorPkpAddress, publicKey: delegatorPublicKey } = delegatorPkpInfo;
110
- const { ethRpcUrl, rpcUrlForUniswap, chainIdForUniswap, tokenInAddress, tokenInDecimals, tokenInAmount, tokenOutAddress, tokenOutDecimals, } = abilityParams;
111
- // Commit spending limit before we submit the TX. We'd rather the tx fail and we count the spend erroneously
112
- // than to have the commit fail but the tx succeed, and we erroneously don't track the spend!
113
- const spendingLimitPolicyContext = policiesContext.allowedPolicies['@lit-protocol/vincent-policy-spending-limit'];
114
- let spendLimitCommitTxHash;
115
- if (spendingLimitPolicyContext !== undefined) {
116
- const tokenInAmountInUsd = await (0, ability_helpers_1.getTokenAmountInUsd)({
117
- ethRpcUrl,
118
- rpcUrlForUniswap,
119
- chainIdForUniswap,
120
- tokenAddress: tokenInAddress,
121
- tokenAmount: tokenInAmount,
122
- tokenDecimals: tokenInDecimals,
90
+ const { rpcUrlForUniswap, signedUniswapQuote } = abilityParams;
91
+ const { quote } = signedUniswapQuote;
92
+ try {
93
+ (0, validate_signed_uniswap_quote_1.validateSignedUniswapQuote)({
94
+ prepareSuccessResult: signedUniswapQuote,
95
+ expectedSignerEthAddress: vincent_prepare_metadata_json_1.default.pkpEthAddress,
96
+ });
97
+ }
98
+ catch (error) {
99
+ return fail({
100
+ reason: `Uniswap quote validation failed: ${error instanceof Error ? error.message : String(error)}`,
123
101
  });
124
- const { maxSpendingLimitInUsd } = spendingLimitPolicyContext.result;
125
- console.log('Spending limit policy commit', JSON.stringify(spendingLimitPolicyContext, exports.bigintReplacer, 2));
126
- try {
127
- const commitResult = await spendingLimitPolicyContext.commit({
128
- amountSpentUsd: tokenInAmountInUsd.toNumber(),
129
- maxSpendingLimitInUsd,
130
- });
131
- console.log('Spending limit policy commit result', JSON.stringify(commitResult, exports.bigintReplacer, 2));
132
- if (commitResult.allow) {
133
- spendLimitCommitTxHash = commitResult.result.spendTxHash;
134
- }
135
- else {
136
- if (commitResult.runtimeError) {
137
- // Handle either an error that was `throw()`n from the commit method and wrapped by the sdk
138
- // Or an explicit schema validation error on input params or output result
139
- return fail({
140
- reason: 'Commit spending limit policy spending limit adjustment due to un-structured error response.',
141
- spendingLimitCommitFail: {
142
- runtimeError: commitResult.runtimeError,
143
- schemaValidationError: commitResult.schemaValidationError,
144
- },
145
- });
146
- }
147
- // In this case we should have a result that is the shape of the commitDenyResultSchema from the policy to return
148
- return fail({
149
- reason: 'Commit spending limit policy spending limit adjustment denied with structured result',
150
- spendingLimitCommitFail: {
151
- structuredCommitFailureReason: commitResult.result,
152
- runtimeError: commitResult.runtimeError,
153
- schemaValidationError: commitResult.schemaValidationError,
154
- },
155
- });
156
- }
157
- console.log(`Committed spending limit policy for transaction: ${spendLimitCommitTxHash} (UniswapSwapAbilityExecute)`);
158
- }
159
- catch (commitErr) {
160
- // Commit methods are wrapped in code so that this should only happen if we encounter an error
161
- // _inside_ the wrapping code in the vincent-ability-sdk -- but let's handle it Just In Case :tm:
162
- return fail({
163
- reason: 'Commit spending limit policy spending limit adjustment due to unexpected runtime error.',
164
- spendingLimitCommitFail: {
165
- runtimeError: commitErr instanceof Error ? commitErr.message : String(commitErr),
166
- },
167
- });
168
- }
169
102
  }
170
103
  const swapTxHash = await (0, ability_helpers_1.sendUniswapTx)({
171
104
  rpcUrl: rpcUrlForUniswap,
172
- chainId: chainIdForUniswap,
173
- pkpEthAddress: delegatorPkpAddress,
174
- pkpPublicKey: delegatorPublicKey,
175
- tokenInAddress: tokenInAddress,
176
- tokenOutAddress: tokenOutAddress,
177
- tokenInDecimals,
178
- tokenOutDecimals,
179
- tokenInAmount,
180
- });
181
- return succeed({
182
- swapTxHash,
183
- spendTxHash: spendLimitCommitTxHash,
105
+ chainId: quote.chainId,
106
+ pkpEthAddress: delegatorPkpInfo.ethAddress,
107
+ pkpPublicKey: delegatorPkpInfo.publicKey,
108
+ uniswapTxData: {
109
+ to: quote.to,
110
+ calldata: quote.calldata,
111
+ estimatedGasUsed: quote.estimatedGasUsed,
112
+ },
184
113
  });
114
+ return succeed({ swapTxHash });
185
115
  },
186
116
  });
187
117
  //# sourceMappingURL=vincent-ability.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"vincent-ability.js","sourceRoot":"","sources":["../../../src/lib/vincent-ability.ts"],"names":[],"mappings":";;;AAAA,2EAI2C;AAC3C,+FAAmF;AAEnF,gDAA2D;AAE3D,uDAAuE;AACvE,qDAI0B;AAC1B,uCAKmB;AACnB,mCAAgC;AAChC,kFAA6E;AAE7E,MAAM,mBAAmB,GAAG,IAAA,gDAA0B,EAAC;IACrD,mBAAmB,EAAnB,6BAAmB;IACnB,oBAAoB,EAApB,oDAAoB;IACpB,wBAAwB,EAAE;QACxB,gBAAgB,EAAE,kBAAkB;QACp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wBACxF,uBAAuB,EAAE;4BACvB,6BAA6B,EAAE,YAAY,CAAC,MAAM;4BAClD,YAAY,EAAE,YAAY,CAAC,YAAY;4BACvC,qBAAqB,EAAE,YAAY,CAAC,qBAAqB;yBAC1D;qBACF,CAAC,CAAC;gBACL,CAAC;gBAED,OAAO,CAAC,GAAG,CACT,oDAAoD,sBAAsB,8BAA8B,CACzG,CAAC;YACJ,CAAC;YAAC,OAAO,SAAS,EAAE,CAAC;gBACnB,8FAA8F;gBAC9F,iGAAiG;gBACjG,OAAO,IAAI,CAAC;oBACV,MAAM,EACJ,yFAAyF;oBAC3F,uBAAuB,EAAE;wBACvB,YAAY,EAAE,SAAS,YAAY,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC;qBACjF;iBACF,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,MAAM,UAAU,GAAG,MAAM,IAAA,+BAAa,EAAC;YACrC,MAAM,EAAE,gBAAgB;YACxB,OAAO,EAAE,iBAAiB;YAC1B,aAAa,EAAE,mBAAoC;YACnD,YAAY,EAAE,kBAAkB;YAChC,cAAc,EAAE,cAA+B;YAC/C,eAAe,EAAE,eAAgC;YACjD,eAAe;YACf,gBAAgB;YAChB,aAAa;SACd,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;YACb,UAAU;YACV,WAAW,EAAE,sBAAsB;SACpC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"vincent-ability.js","sourceRoot":"","sources":["../../../src/lib/vincent-ability.ts"],"names":[],"mappings":";;;;AAAA,2EAG2C;AAC3C,mCAAgC;AAEhC,uDAAkD;AAClD,qDAAgF;AAChF,uCAKmB;AACnB,kFAA6E;AAC7E,2FAAqF;AACrF,uHAAgF;AAEzE,MAAM,cAAc,GAAG,CAAC,GAAQ,EAAE,KAAU,EAAE,EAAE;IACrD,OAAO,OAAO,KAAK,KAAK,QAAQ,CAA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KAAK,CAAC,gBAAgB;aACzC;SACF,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC;IACjC,CAAC;CACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,28 +1,30 @@
1
1
  {
2
2
  "name": "@lit-protocol/vincent-ability-uniswap-swap",
3
- "version": "2.0.1",
3
+ "version": "3.0.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "dependencies": {
8
+ "@lit-protocol/lit-node-client": "^7.2.3",
8
9
  "@uniswap/sdk-core": "^7.7.2",
10
+ "@uniswap/smart-order-router": "^4.22.9",
9
11
  "ethers": "^5.8.0",
12
+ "json-stable-stringify": "^1.3.0",
10
13
  "tslib": "2.8.1",
11
14
  "zod": "^3.25.64",
12
- "@lit-protocol/vincent-policy-spending-limit": "2.0.1",
13
- "@lit-protocol/vincent-ability-sdk": "2.0.1"
15
+ "@lit-protocol/vincent-ability-sdk": "2.1.0",
16
+ "@lit-protocol/vincent-app-sdk": "2.1.0"
14
17
  },
15
18
  "peerDependencies": {
16
- "@lit-protocol/vincent-app-sdk": "^2.0.1"
19
+ "@lit-protocol/vincent-app-sdk": "^2.1.0"
17
20
  },
18
21
  "devDependencies": {
19
22
  "@dotenvx/dotenvx": "^1.44.2",
20
23
  "@lit-protocol/auth-helpers": "^7.2.3",
21
24
  "@lit-protocol/constants": "^7.2.3",
22
25
  "@lit-protocol/contracts-sdk": "^7.2.3",
23
- "@lit-protocol/lit-node-client": "^7.2.3",
26
+ "@lit-protocol/esbuild-plugin-polyfill-node": "^0.3.0",
24
27
  "esbuild": "^0.19.12",
25
- "esbuild-plugin-polyfill-node": "^0.3.0",
26
28
  "ipfs-only-hash": "^4.0.0",
27
29
  "viem": "^2.28.0"
28
30
  },
@@ -1,10 +0,0 @@
1
- export declare const checkUniswapPoolExists: ({ rpcUrl, chainId, tokenInAddress, tokenInDecimals, tokenInAmount, tokenOutAddress, tokenOutDecimals, }: {
2
- rpcUrl: string;
3
- chainId: number;
4
- tokenInAddress: `0x${string}`;
5
- tokenInDecimals: number;
6
- tokenInAmount: number;
7
- tokenOutAddress: `0x${string}`;
8
- tokenOutDecimals: number;
9
- }) => Promise<boolean>;
10
- //# sourceMappingURL=check-uniswap-pool-exists.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-uniswap-pool-exists.d.ts","sourceRoot":"","sources":["../../../../src/lib/ability-checks/check-uniswap-pool-exists.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,GAAU,yGAQ1C;IACD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,KAAK,MAAM,EAAE,CAAC;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,KAAK,MAAM,EAAE,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;CAC1B,qBAiBA,CAAC"}
@@ -1,24 +0,0 @@
1
- "use strict";
2
- // import { FeeAmount } from '@uniswap/v3-sdk';
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.checkUniswapPoolExists = void 0;
5
- const get_uniswap_quote_1 = require("../ability-helpers/get-uniswap-quote");
6
- const checkUniswapPoolExists = async ({ rpcUrl, chainId, tokenInAddress, tokenInDecimals, tokenInAmount, tokenOutAddress, tokenOutDecimals, }) => {
7
- try {
8
- await (0, get_uniswap_quote_1.getUniswapQuote)({
9
- rpcUrl,
10
- chainId,
11
- tokenInAddress,
12
- tokenInDecimals,
13
- tokenInAmount,
14
- tokenOutAddress,
15
- tokenOutDecimals,
16
- });
17
- return true;
18
- }
19
- catch (error) {
20
- throw new Error(`No valid Uniswap V3 pool found for token pair tokenInAddress: ${tokenInAddress}, tokenOutAddress: ${tokenOutAddress} with sufficient liquidity for amount tokenInAmount: ${tokenInAmount}: ${error instanceof Error ? error.message : String(error)}`);
21
- }
22
- };
23
- exports.checkUniswapPoolExists = checkUniswapPoolExists;
24
- //# sourceMappingURL=check-uniswap-pool-exists.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-uniswap-pool-exists.js","sourceRoot":"","sources":["../../../../src/lib/ability-checks/check-uniswap-pool-exists.ts"],"names":[],"mappings":";AAAA,+CAA+C;;;AAE/C,4EAAuE;AAEhE,MAAM,sBAAsB,GAAG,KAAK,EAAE,EAC3C,MAAM,EACN,OAAO,EACP,cAAc,EACd,eAAe,EACf,aAAa,EACb,eAAe,EACf,gBAAgB,GASjB,EAAE,EAAE;IACH,IAAI,CAAC;QACH,MAAM,IAAA,mCAAe,EAAC;YACpB,MAAM;YACN,OAAO;YACP,cAAc;YACd,eAAe;YACf,aAAa;YACb,eAAe;YACf,gBAAgB;SACjB,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,iEAAiE,cAAc,sBAAsB,eAAe,wDAAwD,aAAa,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACvP,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAjCW,QAAA,sBAAsB,0BAiCjC"}
@@ -1,7 +0,0 @@
1
- import { ethers } from 'ethers';
2
- export declare const calculateUsdValue: ({ ethRpcUrl, chainlinkPriceFeedAddress, amountInWeth, }: {
3
- ethRpcUrl: string;
4
- chainlinkPriceFeedAddress: string;
5
- amountInWeth: ethers.BigNumber;
6
- }) => Promise<ethers.BigNumber>;
7
- //# sourceMappingURL=calculate-usd-value.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calculate-usd-value.d.ts","sourceRoot":"","sources":["../../../../src/lib/ability-helpers/calculate-usd-value.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,eAAO,MAAM,iBAAiB,GAAU,yDAIrC;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,yBAAyB,EAAE,MAAM,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC,SAAS,CAAC;CAChC,KAAG,OAAO,CAAC,MAAM,CAAC,SAAS,CAgB3B,CAAC"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.calculateUsdValue = void 0;
4
- const ethers_1 = require("ethers");
5
- const get_eth_usd_price_1 = require("./get-eth-usd-price");
6
- const calculateUsdValue = async ({ ethRpcUrl, chainlinkPriceFeedAddress, amountInWeth, }) => {
7
- const ethPriceInUsd = await (0, get_eth_usd_price_1.getEthUsdPriceFromChainlink)({ ethRpcUrl, chainlinkPriceFeedAddress });
8
- // Calculate USD value (8 decimals precision)
9
- const CHAINLINK_DECIMALS = 8;
10
- const WETH_DECIMALS = 18; // WETH decimals
11
- const amountInUsd = amountInWeth
12
- .mul(ethPriceInUsd)
13
- .div(ethers_1.ethers.utils.parseUnits('1', WETH_DECIMALS));
14
- console.log(`Calculate token amount in USDC (calculateUsdValue)`, {
15
- tokenAmountInWeth: ethers_1.ethers.utils.formatUnits(amountInWeth, WETH_DECIMALS),
16
- ethPriceInUsd: ethers_1.ethers.utils.formatUnits(ethPriceInUsd, CHAINLINK_DECIMALS),
17
- tokenAmountInUsd: ethers_1.ethers.utils.formatUnits(amountInUsd, CHAINLINK_DECIMALS),
18
- });
19
- return amountInUsd;
20
- };
21
- exports.calculateUsdValue = calculateUsdValue;
22
- //# sourceMappingURL=calculate-usd-value.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calculate-usd-value.js","sourceRoot":"","sources":["../../../../src/lib/ability-helpers/calculate-usd-value.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAEhC,2DAAkE;AAE3D,MAAM,iBAAiB,GAAG,KAAK,EAAE,EACtC,SAAS,EACT,yBAAyB,EACzB,YAAY,GAKb,EAA6B,EAAE;IAC9B,MAAM,aAAa,GAAG,MAAM,IAAA,+CAA2B,EAAC,EAAE,SAAS,EAAE,yBAAyB,EAAE,CAAC,CAAC;IAElG,6CAA6C;IAC7C,MAAM,kBAAkB,GAAG,CAAC,CAAC;IAC7B,MAAM,aAAa,GAAG,EAAE,CAAC,CAAC,gBAAgB;IAC1C,MAAM,WAAW,GAAG,YAAY;SAC7B,GAAG,CAAC,aAAa,CAAC;SAClB,GAAG,CAAC,eAAM,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC;IACpD,OAAO,CAAC,GAAG,CAAC,oDAAoD,EAAE;QAChE,iBAAiB,EAAE,eAAM,CAAC,KAAK,CAAC,WAAW,CAAC,YAAY,EAAE,aAAa,CAAC;QACxE,aAAa,EAAE,eAAM,CAAC,KAAK,CAAC,WAAW,CAAC,aAAa,EAAE,kBAAkB,CAAC;QAC1E,gBAAgB,EAAE,eAAM,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,EAAE,kBAAkB,CAAC;KAC5E,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAxBW,QAAA,iBAAiB,qBAwB5B"}
@@ -1,7 +0,0 @@
1
- import { ethers } from 'ethers';
2
- export declare const estimateGasForSwap: (uniswapV3RouterContract: ethers.Contract, tokenInAddress: string, tokenOutAddress: string, uniswapV3PoolFee: number, pkpEthAddress: string, amountInSmallestUnit: ethers.BigNumber, amountOutMin: ethers.BigNumber) => Promise<{
3
- estimatedGas: ethers.BigNumber;
4
- maxFeePerGas: ethers.BigNumber;
5
- maxPriorityFeePerGas: ethers.BigNumber;
6
- }>;
7
- //# sourceMappingURL=estimate-gas-for-swap.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"estimate-gas-for-swap.d.ts","sourceRoot":"","sources":["../../../../src/lib/ability-helpers/estimate-gas-for-swap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,eAAO,MAAM,kBAAkB,GAC7B,yBAAyB,MAAM,CAAC,QAAQ,EACxC,gBAAgB,MAAM,EACtB,iBAAiB,MAAM,EACvB,kBAAkB,MAAM,EACxB,eAAe,MAAM,EACrB,sBAAsB,MAAM,CAAC,SAAS,EACtC,cAAc,MAAM,CAAC,SAAS;;;;EAsB/B,CAAC"}
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.estimateGasForSwap = void 0;
4
- const get_gas_params_1 = require("./get-gas-params");
5
- const estimateGasForSwap = async (uniswapV3RouterContract, tokenInAddress, tokenOutAddress, uniswapV3PoolFee, pkpEthAddress, amountInSmallestUnit, amountOutMin) => {
6
- const [block, feeData, estimatedGas] = await Promise.all([
7
- uniswapV3RouterContract.provider.getBlock('latest'),
8
- uniswapV3RouterContract.provider.getFeeData(),
9
- uniswapV3RouterContract.estimateGas.exactInputSingle([
10
- tokenInAddress,
11
- tokenOutAddress,
12
- uniswapV3PoolFee,
13
- pkpEthAddress,
14
- amountInSmallestUnit,
15
- amountOutMin,
16
- 0,
17
- ], { from: pkpEthAddress }),
18
- ]);
19
- return {
20
- ...(await (0, get_gas_params_1.getGasParams)(uniswapV3RouterContract.provider, block, feeData, estimatedGas)),
21
- };
22
- };
23
- exports.estimateGasForSwap = estimateGasForSwap;
24
- //# sourceMappingURL=estimate-gas-for-swap.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"estimate-gas-for-swap.js","sourceRoot":"","sources":["../../../../src/lib/ability-helpers/estimate-gas-for-swap.ts"],"names":[],"mappings":";;;AAEA,qDAAgD;AAEzC,MAAM,kBAAkB,GAAG,KAAK,EACrC,uBAAwC,EACxC,cAAsB,EACtB,eAAuB,EACvB,gBAAwB,EACxB,aAAqB,EACrB,oBAAsC,EACtC,YAA8B,EAC9B,EAAE;IACF,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACvD,uBAAuB,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC;QACnD,uBAAuB,CAAC,QAAQ,CAAC,UAAU,EAAE;QAC7C,uBAAuB,CAAC,WAAW,CAAC,gBAAgB,CAClD;YACE,cAAc;YACd,eAAe;YACf,gBAAgB;YAChB,aAAa;YACb,oBAAoB;YACpB,YAAY;YACZ,CAAC;SACF,EACD,EAAE,IAAI,EAAE,aAAa,EAAE,CACxB;KACF,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,CAAC,MAAM,IAAA,6BAAY,EAAC,uBAAuB,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;KACxF,CAAC;AACJ,CAAC,CAAC;AA7BW,QAAA,kBAAkB,sBA6B7B"}
@@ -1,6 +0,0 @@
1
- import { ethers } from 'ethers';
2
- export declare const getEthUsdPriceFromChainlink: ({ chainlinkPriceFeedAddress, ethRpcUrl, }: {
3
- chainlinkPriceFeedAddress: string;
4
- ethRpcUrl: string;
5
- }) => Promise<ethers.BigNumber>;
6
- //# sourceMappingURL=get-eth-usd-price.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-eth-usd-price.d.ts","sourceRoot":"","sources":["../../../../src/lib/ability-helpers/get-eth-usd-price.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAMhC,eAAO,MAAM,2BAA2B,GAAU,2CAG/C;IACD,yBAAyB,EAAE,MAAM,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;CACnB,KAAG,OAAO,CAAC,MAAM,CAAC,SAAS,CAiB3B,CAAC"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEthUsdPriceFromChainlink = void 0;
4
- const ethers_1 = require("ethers");
5
- const CHAINLINK_AGGREGATOR_ABI = [
6
- 'function latestRoundData() external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)',
7
- ];
8
- const getEthUsdPriceFromChainlink = async ({ chainlinkPriceFeedAddress, ethRpcUrl, }) => {
9
- console.log(`Getting ETH price in USD from Chainlink (getEthUsdPriceFromChainlink)`, {
10
- chainlinkPriceFeedAddress,
11
- ethRpcUrl,
12
- });
13
- const provider = new ethers_1.ethers.providers.StaticJsonRpcProvider(ethRpcUrl);
14
- const contract = new ethers_1.ethers.Contract(chainlinkPriceFeedAddress, CHAINLINK_AGGREGATOR_ABI, provider);
15
- const [_, answer] = await contract.latestRoundData();
16
- console.log(`Got ETH price in USD (getEthUsdPriceFromChainlink)`, {
17
- ethPriceInUsd: ethers_1.ethers.utils.formatUnits(answer, 8),
18
- });
19
- return answer;
20
- };
21
- exports.getEthUsdPriceFromChainlink = getEthUsdPriceFromChainlink;
22
- //# sourceMappingURL=get-eth-usd-price.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-eth-usd-price.js","sourceRoot":"","sources":["../../../../src/lib/ability-helpers/get-eth-usd-price.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAEhC,MAAM,wBAAwB,GAAG;IAC/B,gJAAgJ;CACjJ,CAAC;AAEK,MAAM,2BAA2B,GAAG,KAAK,EAAE,EAChD,yBAAyB,EACzB,SAAS,GAIV,EAA6B,EAAE;IAC9B,OAAO,CAAC,GAAG,CAAC,uEAAuE,EAAE;QACnF,yBAAyB;QACzB,SAAS;KACV,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,IAAI,eAAM,CAAC,SAAS,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC;IACvE,MAAM,QAAQ,GAAG,IAAI,eAAM,CAAC,QAAQ,CAClC,yBAAyB,EACzB,wBAAwB,EACxB,QAAQ,CACT,CAAC;IACF,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,MAAM,QAAQ,CAAC,eAAe,EAAE,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,oDAAoD,EAAE;QAChE,aAAa,EAAE,eAAM,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;KACnD,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAvBW,QAAA,2BAA2B,+BAuBtC"}
@@ -1,10 +0,0 @@
1
- import { ethers } from 'ethers';
2
- export declare const getTokenAmountInUsd: ({ ethRpcUrl, rpcUrlForUniswap, chainIdForUniswap, tokenAddress, tokenAmount, tokenDecimals, }: {
3
- ethRpcUrl: string;
4
- rpcUrlForUniswap: string;
5
- chainIdForUniswap: number;
6
- tokenAddress: string;
7
- tokenDecimals: number;
8
- tokenAmount: number;
9
- }) => Promise<ethers.BigNumber>;
10
- //# sourceMappingURL=get-token-amount-in-usd.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-token-amount-in-usd.d.ts","sourceRoot":"","sources":["../../../../src/lib/ability-helpers/get-token-amount-in-usd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAWhC,eAAO,MAAM,mBAAmB,GAAU,+FAOvC;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,KAAG,OAAO,CAAC,MAAM,CAAC,SAAS,CAgE3B,CAAC"}
@@ -1,68 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTokenAmountInUsd = void 0;
4
- const ethers_1 = require("ethers");
5
- const calculate_usd_value_1 = require("./calculate-usd-value");
6
- const get_uniswap_quote_1 = require("./get-uniswap-quote");
7
- const ETH_MAINNET_WETH_ADDRESS = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2';
8
- /**
9
- * Source: https://docs.chain.link/data-feeds/price-feeds/addresses/?network=ethereum&page=1&search=ETH%2FUSD
10
- */
11
- const ETH_MAINNET_ETH_USD_CHAINLINK_FEED = '0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419';
12
- const getTokenAmountInUsd = async ({ ethRpcUrl, rpcUrlForUniswap, chainIdForUniswap, tokenAddress, tokenAmount, tokenDecimals, }) => {
13
- console.log(`Getting token amount in USD (getTokenAmountInUsd)`, {
14
- ethRpcUrl,
15
- rpcUrlForUniswap,
16
- chainIdForUniswap,
17
- tokenAddress,
18
- tokenAmount,
19
- tokenDecimals,
20
- ethMainnetWethAddress: ETH_MAINNET_WETH_ADDRESS,
21
- ethMainnetEthUsdChainlinkFeed: ETH_MAINNET_ETH_USD_CHAINLINK_FEED,
22
- });
23
- const provider = new ethers_1.ethers.providers.JsonRpcProvider(rpcUrlForUniswap);
24
- const tokenInContract = new ethers_1.ethers.Contract(tokenAddress, ['function symbol() view returns (string)'], provider);
25
- const tokenInSymbol = await tokenInContract.symbol();
26
- console.log(`tokenInSymbol: ${tokenInSymbol} (getTokenAmountInUsd)`);
27
- // Special case for WETH - no need to get a quote since it's already in ETH terms
28
- if (tokenInSymbol.toUpperCase() === 'WETH') {
29
- console.log(`Token is WETH, using amount directly: ${tokenAmount} (getTokenAmountInUsd)`);
30
- const amountInWeth = ethers_1.ethers.utils.parseUnits(tokenAmount.toString(), tokenDecimals);
31
- return (0, calculate_usd_value_1.calculateUsdValue)({
32
- ethRpcUrl,
33
- chainlinkPriceFeedAddress: ETH_MAINNET_ETH_USD_CHAINLINK_FEED,
34
- amountInWeth,
35
- });
36
- }
37
- console.log(`Getting price in WETH from Uniswap (getTokenAmountInUsd)`, {
38
- tokenInAddress: tokenAddress,
39
- tokenInDecimals: tokenDecimals,
40
- tokenInAmount: tokenAmount,
41
- tokenOutAddress: ETH_MAINNET_WETH_ADDRESS,
42
- tokenOutDecimals: 18,
43
- rpcUrl: rpcUrlForUniswap,
44
- chainId: chainIdForUniswap,
45
- });
46
- const amountInWeth = await (0, get_uniswap_quote_1.getUniswapQuote)({
47
- tokenInAddress: tokenAddress,
48
- tokenInDecimals: tokenDecimals,
49
- tokenInAmount: tokenAmount,
50
- tokenOutAddress: ETH_MAINNET_WETH_ADDRESS,
51
- tokenOutDecimals: 18,
52
- rpcUrl: rpcUrlForUniswap,
53
- chainId: chainIdForUniswap,
54
- });
55
- // Convert WETH amount to USD
56
- const amountInUsdc = await (0, calculate_usd_value_1.calculateUsdValue)({
57
- ethRpcUrl,
58
- chainlinkPriceFeedAddress: ETH_MAINNET_ETH_USD_CHAINLINK_FEED,
59
- amountInWeth: amountInWeth.bestQuote,
60
- });
61
- console.log('Calculated token amount in USDC (getTokenAmountInUsd)', {
62
- amountInWeth: ethers_1.ethers.utils.formatUnits(amountInWeth.bestQuote, 18),
63
- amountInUsdc: ethers_1.ethers.utils.formatUnits(amountInUsdc, 8),
64
- });
65
- return amountInUsdc;
66
- };
67
- exports.getTokenAmountInUsd = getTokenAmountInUsd;
68
- //# sourceMappingURL=get-token-amount-in-usd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-token-amount-in-usd.js","sourceRoot":"","sources":["../../../../src/lib/ability-helpers/get-token-amount-in-usd.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAEhC,+DAA0D;AAC1D,2DAAsD;AAEtD,MAAM,wBAAwB,GAAG,4CAA4C,CAAC;AAC9E;;GAEG;AACH,MAAM,kCAAkC,GAAG,4CAA4C,CAAC;AAEjF,MAAM,mBAAmB,GAAG,KAAK,EAAE,EACxC,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,aAAa,GAQd,EAA6B,EAAE;IAC9B,OAAO,CAAC,GAAG,CAAC,mDAAmD,EAAE;QAC/D,SAAS;QACT,gBAAgB;QAChB,iBAAiB;QACjB,YAAY;QACZ,WAAW;QACX,aAAa;QACb,qBAAqB,EAAE,wBAAwB;QAC/C,6BAA6B,EAAE,kCAAkC;KAClE,CAAC,CAAC;IAEH,MAAM,Q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