@lit-protocol/vincent-ability-aerodrome-swap 0.2.0-alpha1 → 0.2.0-alpha2

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 (70) hide show
  1. package/dist/package.json +1 -1
  2. package/package.json +3 -3
  3. package/dist/src/generated/vincent-bundled-ability.d.ts +0 -136
  4. package/dist/src/generated/vincent-bundled-ability.d.ts.map +0 -1
  5. package/dist/src/generated/vincent-bundled-ability.js +0 -11
  6. package/dist/src/generated/vincent-bundled-ability.js.map +0 -1
  7. package/dist/src/index.d.ts +0 -4
  8. package/dist/src/index.d.ts.map +0 -1
  9. package/dist/src/index.js +0 -3
  10. package/dist/src/index.js.map +0 -1
  11. package/dist/src/lib/ability-checks/check-erc20-allowance.d.ts +0 -10
  12. package/dist/src/lib/ability-checks/check-erc20-allowance.d.ts.map +0 -1
  13. package/dist/src/lib/ability-checks/check-erc20-allowance.js +0 -27
  14. package/dist/src/lib/ability-checks/check-erc20-allowance.js.map +0 -1
  15. package/dist/src/lib/ability-checks/check-erc20-balance.d.ts +0 -9
  16. package/dist/src/lib/ability-checks/check-erc20-balance.d.ts.map +0 -1
  17. package/dist/src/lib/ability-checks/check-erc20-balance.js +0 -21
  18. package/dist/src/lib/ability-checks/check-erc20-balance.js.map +0 -1
  19. package/dist/src/lib/ability-checks/check-native-token-balance.d.ts +0 -7
  20. package/dist/src/lib/ability-checks/check-native-token-balance.d.ts.map +0 -1
  21. package/dist/src/lib/ability-checks/check-native-token-balance.js +0 -14
  22. package/dist/src/lib/ability-checks/check-native-token-balance.js.map +0 -1
  23. package/dist/src/lib/ability-checks/index.d.ts +0 -4
  24. package/dist/src/lib/ability-checks/index.d.ts.map +0 -1
  25. package/dist/src/lib/ability-checks/index.js +0 -4
  26. package/dist/src/lib/ability-checks/index.js.map +0 -1
  27. package/dist/src/lib/ability-helpers/find-supported-token-on-base.d.ts +0 -18
  28. package/dist/src/lib/ability-helpers/find-supported-token-on-base.d.ts.map +0 -1
  29. package/dist/src/lib/ability-helpers/find-supported-token-on-base.js +0 -6
  30. package/dist/src/lib/ability-helpers/find-supported-token-on-base.js.map +0 -1
  31. package/dist/src/lib/ability-helpers/get-erc20-allowance.d.ts +0 -8
  32. package/dist/src/lib/ability-helpers/get-erc20-allowance.d.ts.map +0 -1
  33. package/dist/src/lib/ability-helpers/get-erc20-allowance.js +0 -6
  34. package/dist/src/lib/ability-helpers/get-erc20-allowance.js.map +0 -1
  35. package/dist/src/lib/ability-helpers/get-erc20-contract.d.ts +0 -4
  36. package/dist/src/lib/ability-helpers/get-erc20-contract.d.ts.map +0 -1
  37. package/dist/src/lib/ability-helpers/get-erc20-contract.js +0 -16
  38. package/dist/src/lib/ability-helpers/get-erc20-contract.js.map +0 -1
  39. package/dist/src/lib/ability-helpers/index.d.ts +0 -6
  40. package/dist/src/lib/ability-helpers/index.d.ts.map +0 -1
  41. package/dist/src/lib/ability-helpers/index.js +0 -6
  42. package/dist/src/lib/ability-helpers/index.js.map +0 -1
  43. package/dist/src/lib/ability-helpers/send-aerodrome-swap-tx.d.ts +0 -15
  44. package/dist/src/lib/ability-helpers/send-aerodrome-swap-tx.d.ts.map +0 -1
  45. package/dist/src/lib/ability-helpers/send-aerodrome-swap-tx.js +0 -75
  46. package/dist/src/lib/ability-helpers/send-aerodrome-swap-tx.js.map +0 -1
  47. package/dist/src/lib/ability-helpers/send-erc20-approval-tx.d.ts +0 -15
  48. package/dist/src/lib/ability-helpers/send-erc20-approval-tx.d.ts.map +0 -1
  49. package/dist/src/lib/ability-helpers/send-erc20-approval-tx.js +0 -82
  50. package/dist/src/lib/ability-helpers/send-erc20-approval-tx.js.map +0 -1
  51. package/dist/src/lib/ability-helpers/sign-tx.d.ts +0 -3
  52. package/dist/src/lib/ability-helpers/sign-tx.d.ts.map +0 -1
  53. package/dist/src/lib/ability-helpers/sign-tx.js +0 -24
  54. package/dist/src/lib/ability-helpers/sign-tx.js.map +0 -1
  55. package/dist/src/lib/lit-action.d.ts +0 -2
  56. package/dist/src/lib/lit-action.d.ts.map +0 -1
  57. package/dist/src/lib/lit-action.js +0 -14
  58. package/dist/src/lib/lit-action.js.map +0 -1
  59. package/dist/src/lib/schemas.d.ts +0 -139
  60. package/dist/src/lib/schemas.d.ts.map +0 -1
  61. package/dist/src/lib/schemas.js +0 -125
  62. package/dist/src/lib/schemas.js.map +0 -1
  63. package/dist/src/lib/types.d.ts +0 -43
  64. package/dist/src/lib/types.d.ts.map +0 -1
  65. package/dist/src/lib/types.js +0 -6
  66. package/dist/src/lib/types.js.map +0 -1
  67. package/dist/src/lib/vincent-ability.d.ts +0 -135
  68. package/dist/src/lib/vincent-ability.d.ts.map +0 -1
  69. package/dist/src/lib/vincent-ability.js +0 -355
  70. package/dist/src/lib/vincent-ability.js.map +0 -1
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lit-protocol/vincent-ability-aerodrome-swap",
3
- "version": "0.2.0",
3
+ "version": "0.2.0-alpha2",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@lit-protocol/vincent-ability-aerodrome-swap",
3
- "version": "0.2.0-alpha1",
3
+ "version": "0.2.0-alpha2",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
8
  "dependencies": {
9
- "@lit-protocol/vincent-ability-sdk": "2.3.1",
10
9
  "ethers": "^5.8.0",
11
10
  "sugar-sdk": "file:vendor/sugar-sdk-0.3.0.tgz",
12
11
  "tslib": "2.8.1",
13
- "zod": "^3.25.64"
12
+ "zod": "^3.25.64",
13
+ "@lit-protocol/vincent-ability-sdk": "2.3.1"
14
14
  },
15
15
  "peerDependencies": {
16
16
  "@lit-protocol/vincent-app-sdk": "^2.2.3"
@@ -1,136 +0,0 @@
1
- /**
2
- * DO NOT EDIT THIS FILE. IT IS GENERATED ON BUILD.
3
- */
4
- export declare const bundledVincentAbility: import("@lit-protocol/vincent-ability-sdk").BundledVincentAbility<import("@lit-protocol/vincent-ability-sdk").VincentAbility<import("zod").ZodObject<{
5
- action: import("zod").ZodEnum<["approve", "swap"]>;
6
- rpcUrl: import("zod").ZodString;
7
- tokenInAddress: import("zod").ZodString;
8
- tokenOutAddress: import("zod").ZodString;
9
- amountIn: import("zod").ZodString;
10
- slippage: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodNumber>>;
11
- gasBufferPercentage: import("zod").ZodOptional<import("zod").ZodNumber>;
12
- baseFeePerGasBufferPercentage: import("zod").ZodOptional<import("zod").ZodNumber>;
13
- alchemyGasSponsor: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
14
- alchemyGasSponsorApiKey: import("zod").ZodOptional<import("zod").ZodString>;
15
- alchemyGasSponsorPolicyId: import("zod").ZodOptional<import("zod").ZodString>;
16
- }, "strip", import("zod").ZodTypeAny, {
17
- action: "approve" | "swap";
18
- rpcUrl: string;
19
- tokenInAddress: string;
20
- tokenOutAddress: string;
21
- amountIn: string;
22
- alchemyGasSponsor: boolean;
23
- slippage?: number | undefined;
24
- gasBufferPercentage?: number | undefined;
25
- baseFeePerGasBufferPercentage?: number | undefined;
26
- alchemyGasSponsorApiKey?: string | undefined;
27
- alchemyGasSponsorPolicyId?: string | undefined;
28
- }, {
29
- action: "approve" | "swap";
30
- rpcUrl: string;
31
- tokenInAddress: string;
32
- tokenOutAddress: string;
33
- amountIn: string;
34
- slippage?: number | undefined;
35
- gasBufferPercentage?: number | undefined;
36
- baseFeePerGasBufferPercentage?: number | undefined;
37
- alchemyGasSponsor?: boolean | undefined;
38
- alchemyGasSponsorApiKey?: string | undefined;
39
- alchemyGasSponsorPolicyId?: string | undefined;
40
- }>, string, import("node_modules/@lit-protocol/vincent-ability-sdk/dist/src/lib/abilityCore/helpers").AbilityPolicyMap<readonly [], never>, {}, import("zod").ZodObject<{
41
- swapTxHash: import("zod").ZodOptional<import("zod").ZodString>;
42
- swapTxUserOperationHash: import("zod").ZodOptional<import("zod").ZodString>;
43
- approvalTxHash: import("zod").ZodOptional<import("zod").ZodString>;
44
- approvalTxUserOperationHash: import("zod").ZodOptional<import("zod").ZodString>;
45
- currentAllowance: import("zod").ZodOptional<import("zod").ZodString>;
46
- requiredAllowance: import("zod").ZodOptional<import("zod").ZodString>;
47
- }, "strip", import("zod").ZodTypeAny, {
48
- currentAllowance?: string | undefined;
49
- requiredAllowance?: string | undefined;
50
- swapTxHash?: string | undefined;
51
- swapTxUserOperationHash?: string | undefined;
52
- approvalTxHash?: string | undefined;
53
- approvalTxUserOperationHash?: string | undefined;
54
- }, {
55
- currentAllowance?: string | undefined;
56
- requiredAllowance?: string | undefined;
57
- swapTxHash?: string | undefined;
58
- swapTxUserOperationHash?: string | undefined;
59
- approvalTxHash?: string | undefined;
60
- approvalTxUserOperationHash?: string | undefined;
61
- }>, import("zod").ZodObject<{
62
- reason: import("zod").ZodOptional<import("zod").ZodString>;
63
- }, "strip", import("zod").ZodTypeAny, {
64
- reason?: string | undefined;
65
- }, {
66
- reason?: string | undefined;
67
- }>, import("zod").ZodObject<{
68
- nativeTokenBalance: import("zod").ZodOptional<import("zod").ZodString>;
69
- tokenInAddress: import("zod").ZodOptional<import("zod").ZodString>;
70
- tokenInBalance: import("zod").ZodOptional<import("zod").ZodString>;
71
- currentTokenInAllowanceForSpender: import("zod").ZodString;
72
- spenderAddress: import("zod").ZodString;
73
- requiredTokenInAllowance: import("zod").ZodOptional<import("zod").ZodString>;
74
- quote: import("zod").ZodOptional<import("zod").ZodObject<{
75
- tokenInAmount: import("zod").ZodString;
76
- tokenOutAmount: import("zod").ZodString;
77
- priceImpact: import("zod").ZodString;
78
- }, "strip", import("zod").ZodTypeAny, {
79
- tokenInAmount: string;
80
- tokenOutAmount: string;
81
- priceImpact: string;
82
- }, {
83
- tokenInAmount: string;
84
- tokenOutAmount: string;
85
- priceImpact: string;
86
- }>>;
87
- }, "strip", import("zod").ZodTypeAny, {
88
- currentTokenInAllowanceForSpender: string;
89
- spenderAddress: string;
90
- tokenInAddress?: string | undefined;
91
- nativeTokenBalance?: string | undefined;
92
- tokenInBalance?: string | undefined;
93
- requiredTokenInAllowance?: string | undefined;
94
- quote?: {
95
- tokenInAmount: string;
96
- tokenOutAmount: string;
97
- priceImpact: string;
98
- } | undefined;
99
- }, {
100
- currentTokenInAllowanceForSpender: string;
101
- spenderAddress: string;
102
- tokenInAddress?: string | undefined;
103
- nativeTokenBalance?: string | undefined;
104
- tokenInBalance?: string | undefined;
105
- requiredTokenInAllowance?: string | undefined;
106
- quote?: {
107
- tokenInAmount: string;
108
- tokenOutAmount: string;
109
- priceImpact: string;
110
- } | undefined;
111
- }>, import("zod").ZodObject<{
112
- reason: import("zod").ZodString;
113
- spenderAddress: import("zod").ZodOptional<import("zod").ZodString>;
114
- tokenAddress: import("zod").ZodOptional<import("zod").ZodString>;
115
- requiredTokenAmount: import("zod").ZodOptional<import("zod").ZodString>;
116
- tokenBalance: import("zod").ZodOptional<import("zod").ZodString>;
117
- currentAllowance: import("zod").ZodOptional<import("zod").ZodString>;
118
- requiredAllowance: import("zod").ZodOptional<import("zod").ZodString>;
119
- }, "strip", import("zod").ZodTypeAny, {
120
- reason: string;
121
- spenderAddress?: string | undefined;
122
- tokenAddress?: string | undefined;
123
- requiredTokenAmount?: string | undefined;
124
- tokenBalance?: string | undefined;
125
- currentAllowance?: string | undefined;
126
- requiredAllowance?: string | undefined;
127
- }, {
128
- reason: string;
129
- spenderAddress?: string | undefined;
130
- tokenAddress?: string | undefined;
131
- requiredTokenAmount?: string | undefined;
132
- tokenBalance?: string | undefined;
133
- currentAllowance?: string | undefined;
134
- requiredAllowance?: string | undefined;
135
- }>>, string>;
136
- //# sourceMappingURL=vincent-bundled-ability.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vincent-bundled-ability.d.ts","sourceRoot":"","sources":["../../../src/generated/vincent-bundled-ability.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAA4D,CAAC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * DO NOT EDIT THIS FILE. IT IS GENERATED ON BUILD.
3
- */
4
- import { asBundledVincentAbility } from '@lit-protocol/vincent-ability-sdk';
5
- import { vincentAbility } from '../lib/vincent-ability';
6
- import metadata from './vincent-ability-metadata.json';
7
- if (!metadata.ipfsCid) {
8
- throw new Error('ipfsCid is not defined in metadata JSON file');
9
- }
10
- export const bundledVincentAbility = asBundledVincentAbility(vincentAbility, metadata.ipfsCid);
11
- //# sourceMappingURL=vincent-bundled-ability.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vincent-bundled-ability.js","sourceRoot":"","sources":["../../../src/generated/vincent-bundled-ability.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AAEvD,IAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;IACrB,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;AAClE,CAAC;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC,cAAc,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export { bundledVincentAbility } from './generated/vincent-bundled-ability';
2
- export type { CheckNativeTokenBalanceResult, CheckNativeTokenBalanceResultSuccess, CheckNativeTokenBalanceResultFailure, CheckErc20BalanceResult, CheckErc20BalanceResultSuccess, CheckErc20BalanceResultFailure, CheckErc20AllowanceResult, CheckErc20AllowanceResultSuccess, CheckErc20AllowanceResultFailure, } from './lib/types';
3
- export { AbilityAction } from './lib/types';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,YAAY,EACV,6BAA6B,EAC7B,oCAAoC,EACpC,oCAAoC,EACpC,uBAAuB,EACvB,8BAA8B,EAC9B,8BAA8B,EAC9B,yBAAyB,EACzB,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
package/dist/src/index.js DELETED
@@ -1,3 +0,0 @@
1
- export { bundledVincentAbility } from './generated/vincent-bundled-ability.js';
2
- export { AbilityAction } from './lib/types.js';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAY5E,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
@@ -1,10 +0,0 @@
1
- import { ethers } from 'ethers';
2
- import { CheckErc20AllowanceResult } from '../types';
3
- export declare const checkErc20Allowance: ({ provider, tokenAddress, owner, spender, requiredAllowance, }: {
4
- provider: ethers.providers.StaticJsonRpcProvider;
5
- tokenAddress: string;
6
- owner: string;
7
- spender: string;
8
- requiredAllowance: ethers.BigNumber;
9
- }) => Promise<CheckErc20AllowanceResult>;
10
- //# sourceMappingURL=check-erc20-allowance.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-erc20-allowance.d.ts","sourceRoot":"","sources":["../../../../src/lib/ability-checks/check-erc20-allowance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAErD,eAAO,MAAM,mBAAmB,GAAU,gEAMvC;IACD,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,qBAAqB,CAAC;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC,SAAS,CAAC;CACrC,KAAG,OAAO,CAAC,yBAAyB,CA0BpC,CAAC"}
@@ -1,27 +0,0 @@
1
- import { getErc20Allowance } from '../ability-helpers/get-erc20-allowance';
2
- export const checkErc20Allowance = async ({ provider, tokenAddress, owner, spender, requiredAllowance, }) => {
3
- const currentAllowance = await getErc20Allowance({
4
- provider,
5
- tokenAddress,
6
- owner,
7
- spender,
8
- });
9
- if (currentAllowance.lt(requiredAllowance)) {
10
- return {
11
- success: false,
12
- reason: `[checkErc20Allowance] Address ${owner} has insufficient ERC20 allowance for spender ${spender} for token ${tokenAddress}`,
13
- spenderAddress: spender,
14
- tokenAddress: tokenAddress,
15
- requiredAllowance,
16
- currentAllowance,
17
- };
18
- }
19
- return {
20
- success: true,
21
- spenderAddress: spender,
22
- tokenAddress: tokenAddress,
23
- requiredAllowance,
24
- currentAllowance,
25
- };
26
- };
27
- //# sourceMappingURL=check-erc20-allowance.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-erc20-allowance.js","sourceRoot":"","sources":["../../../../src/lib/ability-checks/check-erc20-allowance.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAG3E,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EAAE,EACxC,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,OAAO,EACP,iBAAiB,GAOlB,EAAsC,EAAE;IACvC,MAAM,gBAAgB,GAAG,MAAM,iBAAiB,CAAC;QAC/C,QAAQ;QACR,YAAY;QACZ,KAAK;QACL,OAAO;KACR,CAAC,CAAC;IAEH,IAAI,gBAAgB,CAAC,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC;QAC3C,OAAO;YACL,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,iCAAiC,KAAK,iDAAiD,OAAO,cAAc,YAAY,EAAE;YAClI,cAAc,EAAE,OAAO;YACvB,YAAY,EAAE,YAAY;YAC1B,iBAAiB;YACjB,gBAAgB;SACjB,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI;QACb,cAAc,EAAE,OAAO;QACvB,YAAY,EAAE,YAAY;QAC1B,iBAAiB;QACjB,gBAAgB;KACjB,CAAC;AACJ,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- import { ethers } from 'ethers';
2
- import { CheckErc20BalanceResult } from '../types';
3
- export declare const checkErc20Balance: ({ provider, pkpEthAddress, tokenAddress, requiredTokenAmount, }: {
4
- provider: ethers.providers.StaticJsonRpcProvider;
5
- pkpEthAddress: string;
6
- tokenAddress: string;
7
- requiredTokenAmount: ethers.BigNumber;
8
- }) => Promise<CheckErc20BalanceResult>;
9
- //# sourceMappingURL=check-erc20-balance.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-erc20-balance.d.ts","sourceRoot":"","sources":["../../../../src/lib/ability-checks/check-erc20-balance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAEnD,eAAO,MAAM,iBAAiB,GAAU,iEAKrC;IACD,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,qBAAqB,CAAC;IACjD,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,CAAC,SAAS,CAAC;CACvC,KAAG,OAAO,CAAC,uBAAuB,CAqBlC,CAAC"}
@@ -1,21 +0,0 @@
1
- import { getErc20Contract } from '../ability-helpers/get-erc20-contract';
2
- export const checkErc20Balance = async ({ provider, pkpEthAddress, tokenAddress, requiredTokenAmount, }) => {
3
- const contract = getErc20Contract(tokenAddress, provider);
4
- const tokenBalance = await contract.balanceOf(pkpEthAddress);
5
- if (tokenBalance.lt(requiredTokenAmount)) {
6
- return {
7
- success: false,
8
- reason: `pkpEthAddress (${pkpEthAddress}) has insufficient balance of fromToken (${tokenAddress}). Wanted ${requiredTokenAmount}, but only have ${tokenBalance}`,
9
- tokenAddress,
10
- requiredTokenAmount,
11
- tokenBalance,
12
- };
13
- }
14
- return {
15
- success: true,
16
- tokenAddress,
17
- requiredTokenAmount,
18
- tokenBalance,
19
- };
20
- };
21
- //# sourceMappingURL=check-erc20-balance.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-erc20-balance.js","sourceRoot":"","sources":["../../../../src/lib/ability-checks/check-erc20-balance.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAGzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,EACtC,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,mBAAmB,GAMpB,EAAoC,EAAE;IACrC,MAAM,QAAQ,GAAG,gBAAgB,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IAE1D,MAAM,YAAY,GAAqB,MAAM,QAAQ,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IAE/E,IAAI,YAAY,CAAC,EAAE,CAAC,mBAAmB,CAAC,EAAE,CAAC;QACzC,OAAO;YACL,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,kBAAkB,aAAa,4CAA4C,YAAY,aAAa,mBAAmB,mBAAmB,YAAY,EAAE;YAChK,YAAY;YACZ,mBAAmB;YACnB,YAAY;SACb,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI;QACb,YAAY;QACZ,mBAAmB;QACnB,YAAY;KACb,CAAC;AACJ,CAAC,CAAC"}
@@ -1,7 +0,0 @@
1
- import { ethers } from 'ethers';
2
- import { CheckNativeTokenBalanceResult } from '../types';
3
- export declare const checkNativeTokenBalance: ({ provider, pkpEthAddress, }: {
4
- provider: ethers.providers.Provider;
5
- pkpEthAddress: string;
6
- }) => Promise<CheckNativeTokenBalanceResult>;
7
- //# sourceMappingURL=check-native-token-balance.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-native-token-balance.d.ts","sourceRoot":"","sources":["../../../../src/lib/ability-checks/check-native-token-balance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAEzD,eAAO,MAAM,uBAAuB,GAAU,8BAG3C;IACD,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;IACpC,aAAa,EAAE,MAAM,CAAC;CACvB,KAAG,OAAO,CAAC,6BAA6B,CAcxC,CAAC"}
@@ -1,14 +0,0 @@
1
- export const checkNativeTokenBalance = async ({ provider, pkpEthAddress, }) => {
2
- const ethBalance = await provider.getBalance(pkpEthAddress);
3
- if (ethBalance.isZero()) {
4
- return {
5
- success: false,
6
- reason: `pkpEthAddress (${pkpEthAddress}) has zero native token balance (AerodromeSwapAbilityPrecheck)`,
7
- };
8
- }
9
- return {
10
- success: true,
11
- ethBalance,
12
- };
13
- };
14
- //# sourceMappingURL=check-native-token-balance.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-native-token-balance.js","sourceRoot":"","sources":["../../../../src/lib/ability-checks/check-native-token-balance.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,EAAE,EAC5C,QAAQ,EACR,aAAa,GAId,EAA0C,EAAE;IAC3C,MAAM,UAAU,GAAG,MAAM,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IAE5D,IAAI,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC;QACxB,OAAO;YACL,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,kBAAkB,aAAa,gEAAgE;SACxG,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI;QACb,UAAU;KACX,CAAC;AACJ,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from './check-erc20-allowance';
2
- export * from './check-erc20-balance';
3
- export * from './check-native-token-balance';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/ability-checks/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from './check-erc20-allowance';
2
- export * from './check-erc20-balance';
3
- export * from './check-native-token-balance';
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/ability-checks/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC"}
@@ -1,18 +0,0 @@
1
- import { type SugarWagmiConfig } from 'sugar-sdk';
2
- export declare const findSupportedTokenOnBase: ({ config, chainId, tokenAddress, }: {
3
- config: SugarWagmiConfig;
4
- chainId: number;
5
- tokenAddress: string;
6
- }) => Promise<Readonly<{
7
- chainId: number;
8
- address: `0x${string}`;
9
- name?: string;
10
- symbol: string;
11
- listed: boolean;
12
- decimals: number;
13
- balance: bigint;
14
- price: bigint;
15
- balanceValue: bigint;
16
- wrappedAddress?: `0x${string}`;
17
- }> | undefined>;
18
- //# sourceMappingURL=find-supported-token-on-base.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-supported-token-on-base.d.ts","sourceRoot":"","sources":["../../../../src/lib/ability-helpers/find-supported-token-on-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAEnE,eAAO,MAAM,wBAAwB,GAAU,oCAI5C;IACD,MAAM,EAAE,gBAAgB,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB;;;;;;;;;;;eAMA,CAAC"}
@@ -1,6 +0,0 @@
1
- import { getListedTokens } from 'sugar-sdk';
2
- export const findSupportedTokenOnBase = async ({ config, chainId, tokenAddress, }) => {
3
- const allTokensSupportedOnBaseMainnet = await getListedTokens({ config });
4
- return allTokensSupportedOnBaseMainnet.find((token) => token.address.toLowerCase() === tokenAddress.toLowerCase() && token.chainId === chainId);
5
- };
6
- //# sourceMappingURL=find-supported-token-on-base.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-supported-token-on-base.js","sourceRoot":"","sources":["../../../../src/lib/ability-helpers/find-supported-token-on-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAyB,MAAM,WAAW,CAAC;AAEnE,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,EAAE,EAC7C,MAAM,EACN,OAAO,EACP,YAAY,GAKb,EAAE,EAAE;IACH,MAAM,+BAA+B,GAAG,MAAM,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAC1E,OAAO,+BAA+B,CAAC,IAAI,CACzC,CAAC,KAAK,EAAE,EAAE,CACR,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,YAAY,CAAC,WAAW,EAAE,IAAI,KAAK,CAAC,OAAO,KAAK,OAAO,CAC1F,CAAC;AACJ,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- import { ethers } from 'ethers';
2
- export declare const getErc20Allowance: ({ provider, tokenAddress, owner, spender, }: {
3
- provider: ethers.providers.JsonRpcProvider;
4
- tokenAddress: string;
5
- owner: string;
6
- spender: string;
7
- }) => Promise<ethers.BigNumber>;
8
- //# sourceMappingURL=get-erc20-allowance.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-erc20-allowance.d.ts","sourceRoot":"","sources":["../../../../src/lib/ability-helpers/get-erc20-allowance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,eAAO,MAAM,iBAAiB,GAAU,6CAKrC;IACD,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC;IAC3C,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,KAAG,OAAO,CAAC,MAAM,CAAC,SAAS,CAG3B,CAAC"}
@@ -1,6 +0,0 @@
1
- import { getErc20Contract } from './get-erc20-contract';
2
- export const getErc20Allowance = async ({ provider, tokenAddress, owner, spender, }) => {
3
- const contract = getErc20Contract(tokenAddress, provider);
4
- return await contract.allowance(owner, spender);
5
- };
6
- //# sourceMappingURL=get-erc20-allowance.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-erc20-allowance.js","sourceRoot":"","sources":["../../../../src/lib/ability-helpers/get-erc20-allowance.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,EACtC,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,OAAO,GAMR,EAA6B,EAAE;IAC9B,MAAM,QAAQ,GAAG,gBAAgB,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IAC1D,OAAO,MAAM,QAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAClD,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- import { ethers } from 'ethers';
2
- export declare const ERC20_ABI: string[];
3
- export declare function getErc20Contract(tokenAddress: string, provider: ethers.providers.JsonRpcProvider): ethers.Contract;
4
- //# sourceMappingURL=get-erc20-contract.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-erc20-contract.d.ts","sourceRoot":"","sources":["../../../../src/lib/ability-helpers/get-erc20-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,eAAO,MAAM,SAAS,UAUrB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,eAAe,mBAEhG"}
@@ -1,16 +0,0 @@
1
- import { ethers } from 'ethers';
2
- export const ERC20_ABI = [
3
- 'function balanceOf(address owner) external view returns (uint256)',
4
- 'function approve(address spender, uint256 amount) external returns (bool)',
5
- 'function allowance(address owner, address spender) external view returns (uint256)',
6
- 'function decimals() view returns (uint8)',
7
- 'function totalSupply() external view returns (uint256)',
8
- 'function transfer(address to, uint256 amount) external returns (bool)',
9
- 'function transferFrom(address from, address to, uint256 amount) external returns (bool)',
10
- 'function name() external view returns (string)',
11
- 'function symbol() external view returns (string)',
12
- ];
13
- export function getErc20Contract(tokenAddress, provider) {
14
- return new ethers.Contract(tokenAddress, ERC20_ABI, provider);
15
- }
16
- //# sourceMappingURL=get-erc20-contract.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-erc20-contract.js","sourceRoot":"","sources":["../../../../src/lib/ability-helpers/get-erc20-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,mEAAmE;IACnE,2EAA2E;IAC3E,oFAAoF;IACpF,0CAA0C;IAC1C,wDAAwD;IACxD,uEAAuE;IACvE,yFAAyF;IACzF,gDAAgD;IAChD,kDAAkD;CACnD,CAAC;AAEF,MAAM,UAAU,gBAAgB,CAAC,YAAoB,EAAE,QAA0C;IAC/F,OAAO,IAAI,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAChE,CAAC"}
@@ -1,6 +0,0 @@
1
- export * from './get-erc20-allowance';
2
- export * from './get-erc20-contract';
3
- export * from './send-aerodrome-swap-tx';
4
- export * from './send-erc20-approval-tx';
5
- export * from './sign-tx';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/ability-helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,WAAW,CAAC"}
@@ -1,6 +0,0 @@
1
- export * from './get-erc20-allowance';
2
- export * from './get-erc20-contract';
3
- export * from './send-aerodrome-swap-tx';
4
- export * from './send-erc20-approval-tx';
5
- export * from './sign-tx';
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/ability-helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,WAAW,CAAC"}
@@ -1,15 +0,0 @@
1
- export declare const sendAerodromeSwapTx: ({ rpcUrl, chainId, pkpEthAddress, pkpPublicKey, to, value, calldata, gasBufferPercentage, baseFeePerGasBufferPercentage, alchemyGasSponsor, alchemyGasSponsorApiKey, alchemyGasSponsorPolicyId, }: {
2
- rpcUrl: string;
3
- chainId: number;
4
- pkpEthAddress: string;
5
- pkpPublicKey: string;
6
- to: string;
7
- value: string;
8
- calldata: string;
9
- gasBufferPercentage?: number;
10
- baseFeePerGasBufferPercentage?: number;
11
- alchemyGasSponsor?: boolean;
12
- alchemyGasSponsorApiKey?: string;
13
- alchemyGasSponsorPolicyId?: string;
14
- }) => Promise<string>;
15
- //# sourceMappingURL=send-aerodrome-swap-tx.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"send-aerodrome-swap-tx.d.ts","sourceRoot":"","sources":["../../../../src/lib/ability-helpers/send-aerodrome-swap-tx.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,mBAAmB,GAAU,mMAavC;IACD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC,KAAG,OAAO,CAAC,MAAM,CAyFjB,CAAC"}
@@ -1,75 +0,0 @@
1
- import { ethers } from 'ethers';
2
- import { populateTransaction, sponsoredGasRawTransaction } from '@lit-protocol/vincent-ability-sdk';
3
- import { signTx } from './sign-tx';
4
- export const sendAerodromeSwapTx = async ({ rpcUrl, chainId, pkpEthAddress, pkpPublicKey, to, value, calldata, gasBufferPercentage, baseFeePerGasBufferPercentage, alchemyGasSponsor, alchemyGasSponsorApiKey, alchemyGasSponsorPolicyId, }) => {
5
- if (alchemyGasSponsor) {
6
- console.log('[sendAerodromeSwapTx] Alchemy gas sponsor is enabled');
7
- if (!alchemyGasSponsorApiKey || !alchemyGasSponsorPolicyId) {
8
- throw new Error('[sendAerodromeSwapTx] Alchemy gas sponsor is enabled, but API key or policy ID is not provided.');
9
- }
10
- return await sponsoredGasRawTransaction({
11
- pkpPublicKey,
12
- to,
13
- value,
14
- data: calldata,
15
- chainId,
16
- eip7702AlchemyApiKey: alchemyGasSponsorApiKey,
17
- eip7702AlchemyPolicyId: alchemyGasSponsorPolicyId,
18
- });
19
- }
20
- console.log('Estimating gas for Aerodrome swap transaction (sendAerodromeSwapTx)');
21
- const populateTxResponse = await Lit.Actions.runOnce({ waitForResponse: true, name: 'Aerodrome swap tx gas estimation' }, async () => {
22
- try {
23
- return JSON.stringify({
24
- status: 'success',
25
- populatedTransaction: await populateTransaction({
26
- to,
27
- from: pkpEthAddress,
28
- value,
29
- data: calldata,
30
- rpcUrl,
31
- chainId,
32
- gasBufferPercentage,
33
- baseFeePerGasBufferPercentage,
34
- }),
35
- });
36
- }
37
- catch (error) {
38
- return JSON.stringify({
39
- status: 'error',
40
- error: error instanceof Error ? error.message : String(error),
41
- });
42
- }
43
- });
44
- const parsedPopulateTxResponse = JSON.parse(populateTxResponse);
45
- if (parsedPopulateTxResponse.status === 'error') {
46
- throw new Error(`[sendAerodromeSwapTx] Error populating transaction for swap: ${parsedPopulateTxResponse.error}`);
47
- }
48
- const { populatedTransaction } = parsedPopulateTxResponse;
49
- const signedSwapTx = await signTx(pkpPublicKey, populatedTransaction, 'aerodromeSwapSig');
50
- console.log(`Broadcasting Aerodrome swap transaction (sendAerodromeSwapTx)`);
51
- const swapTxResponse = await Lit.Actions.runOnce({ waitForResponse: true, name: 'aerodromeSwapTxSender' }, async () => {
52
- try {
53
- const rpcProvider = new ethers.providers.StaticJsonRpcProvider(rpcUrl);
54
- const receipt = await rpcProvider.sendTransaction(signedSwapTx);
55
- return JSON.stringify({
56
- status: 'success',
57
- txHash: receipt.hash,
58
- });
59
- }
60
- catch (error) {
61
- return JSON.stringify({
62
- status: 'error',
63
- error: error instanceof Error ? error.message : String(error),
64
- });
65
- }
66
- });
67
- const parsedSwapTxResponse = JSON.parse(swapTxResponse);
68
- if (parsedSwapTxResponse.status === 'error') {
69
- throw new Error(`Error broadcasting Aerodrome swap transaction: ${parsedSwapTxResponse.error} (sendAerodromeSwapTx)`);
70
- }
71
- const { txHash } = parsedSwapTxResponse;
72
- console.log(`Aerodrome swap transaction broadcasted (sendAerodromeSwapTx): ${txHash}`);
73
- return txHash;
74
- };
75
- //# sourceMappingURL=send-aerodrome-swap-tx.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"send-aerodrome-swap-tx.js","sourceRoot":"","sources":["../../../../src/lib/ability-helpers/send-aerodrome-swap-tx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA4B,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAEpG,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAcnC,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EAAE,EACxC,MAAM,EACN,OAAO,EACP,aAAa,EACb,YAAY,EACZ,EAAE,EACF,KAAK,EACL,QAAQ,EACR,mBAAmB,EACnB,6BAA6B,EAC7B,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,GAc1B,EAAmB,EAAE;IACpB,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,sDAAsD,CAAC,CAAC;QAEpE,IAAI,CAAC,uBAAuB,IAAI,CAAC,yBAAyB,EAAE,CAAC;YAC3D,MAAM,IAAI,KAAK,CACb,iGAAiG,CAClG,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,0BAA0B,CAAC;YACtC,YAAY;YACZ,EAAE;YACF,KAAK;YACL,IAAI,EAAE,QAAQ;YACd,OAAO;YACP,oBAAoB,EAAE,uBAAuB;YAC7C,sBAAsB,EAAE,yBAAyB;SAClD,CAAC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,qEAAqE,CAAC,CAAC;IAEnF,MAAM,kBAAkB,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,OAAO,CAClD,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,kCAAkC,EAAE,EACnE,KAAK,IAAI,EAAE;QACT,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,SAAS,CAAC;gBACpB,MAAM,EAAE,SAAS;gBACjB,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;oBAC9C,EAAE;oBACF,IAAI,EAAE,aAAa;oBACnB,KAAK;oBACL,IAAI,EAAE,QAAQ;oBACd,MAAM;oBACN,OAAO;oBACP,mBAAmB;oBACnB,6BAA6B;iBAC9B,CAAC;aACH,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,SAAS,CAAC;gBACpB,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAC9D,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CACF,CAAC;IAEF,MAAM,wBAAwB,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IAChE,IAAI,wBAAwB,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CACb,gEAAgE,wBAAwB,CAAC,KAAK,EAAE,CACjG,CAAC;IACJ,CAAC;IACD,MAAM,EAAE,oBAAoB,EAAE,GAC5B,wBAAwB,CAAC;IAE3B,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC,YAAY,EAAE,oBAAoB,EAAE,kBAAkB,CAAC,CAAC;IAE1F,OAAO,CAAC,GAAG,CAAC,+DAA+D,CAAC,CAAC;IAC7E,MAAM,cAAc,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,OAAO,CAC9C,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,uBAAuB,EAAE,EACxD,KAAK,IAAI,EAAE;QACT,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;YACvE,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;YAChE,OAAO,IAAI,CAAC,SAAS,CAAC;gBACpB,MAAM,EAAE,SAAS;gBACjB,MAAM,EAAE,OAAO,CAAC,IAAI;aACrB,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,SAAS,CAAC;gBACpB,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAC9D,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CACF,CAAC;IAEF,MAAM,oBAAoB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACxD,IAAI,oBAAoB,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CACb,kDAAkD,oBAAoB,CAAC,KAAK,wBAAwB,CACrG,CAAC;IACJ,CAAC;IACD,MAAM,EAAE,MAAM,EAAE,GAAG,oBAAoB,CAAC;IACxC,OAAO,CAAC,GAAG,CAAC,iEAAiE,MAAM,EAAE,CAAC,CAAC;IAEvF,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- export declare const sendErc20ApprovalTx: ({ rpcUrl, chainId, pkpPublicKey, pkpEthAddress, erc20TokenAddress, spenderAddress, allowanceAmount, gasBufferPercentage, baseFeePerGasBufferPercentage, alchemyGasSponsor, alchemyGasSponsorApiKey, alchemyGasSponsorPolicyId, }: {
2
- rpcUrl: string;
3
- chainId: number;
4
- pkpPublicKey: string;
5
- pkpEthAddress: string;
6
- erc20TokenAddress: string;
7
- spenderAddress: string;
8
- allowanceAmount: string;
9
- gasBufferPercentage?: number;
10
- baseFeePerGasBufferPercentage?: number;
11
- alchemyGasSponsor: boolean;
12
- alchemyGasSponsorApiKey?: string;
13
- alchemyGasSponsorPolicyId?: string;
14
- }) => Promise<string>;
15
- //# sourceMappingURL=send-erc20-approval-tx.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"send-erc20-approval-tx.d.ts","sourceRoot":"","sources":["../../../../src/lib/ability-helpers/send-erc20-approval-tx.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,mBAAmB,GAAU,kOAavC;IACD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC,KAAG,OAAO,CAAC,MAAM,CA+FjB,CAAC"}