@coinbase/agentkit 0.1.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 (148) hide show
  1. package/README.md +305 -0
  2. package/dist/action-providers/actionDecorator.d.ts +69 -0
  3. package/dist/action-providers/actionDecorator.js +96 -0
  4. package/dist/action-providers/actionProvider.d.ts +48 -0
  5. package/dist/action-providers/actionProvider.js +62 -0
  6. package/dist/action-providers/basename/basenameActionProvider.d.ts +30 -0
  7. package/dist/action-providers/basename/basenameActionProvider.js +109 -0
  8. package/dist/action-providers/basename/basenameActionProvider.test.d.ts +1 -0
  9. package/dist/action-providers/basename/basenameActionProvider.test.js +146 -0
  10. package/dist/action-providers/basename/constants.d.ts +52 -0
  11. package/dist/action-providers/basename/constants.js +81 -0
  12. package/dist/action-providers/basename/index.d.ts +2 -0
  13. package/dist/action-providers/basename/index.js +18 -0
  14. package/dist/action-providers/basename/schemas.d.ts +14 -0
  15. package/dist/action-providers/basename/schemas.js +14 -0
  16. package/dist/action-providers/cdp/cdpApiActionProvider.d.ts +41 -0
  17. package/dist/action-providers/cdp/cdpApiActionProvider.js +111 -0
  18. package/dist/action-providers/cdp/cdpApiActionProvider.test.d.ts +1 -0
  19. package/dist/action-providers/cdp/cdpApiActionProvider.test.js +134 -0
  20. package/dist/action-providers/cdp/cdpWalletActionProvider.d.ts +58 -0
  21. package/dist/action-providers/cdp/cdpWalletActionProvider.js +218 -0
  22. package/dist/action-providers/cdp/cdpWalletActionProvider.test.d.ts +1 -0
  23. package/dist/action-providers/cdp/cdpWalletActionProvider.test.js +259 -0
  24. package/dist/action-providers/cdp/constants.d.ts +31 -0
  25. package/dist/action-providers/cdp/constants.js +34 -0
  26. package/dist/action-providers/cdp/index.d.ts +3 -0
  27. package/dist/action-providers/cdp/index.js +19 -0
  28. package/dist/action-providers/cdp/schemas.d.ts +91 -0
  29. package/dist/action-providers/cdp/schemas.js +77 -0
  30. package/dist/action-providers/customActionProvider.d.ts +30 -0
  31. package/dist/action-providers/customActionProvider.js +66 -0
  32. package/dist/action-providers/erc20/constants.d.ts +135 -0
  33. package/dist/action-providers/erc20/constants.js +191 -0
  34. package/dist/action-providers/erc20/erc20ActionProvider.d.ts +38 -0
  35. package/dist/action-providers/erc20/erc20ActionProvider.js +118 -0
  36. package/dist/action-providers/erc20/erc20ActionProvider.test.d.ts +1 -0
  37. package/dist/action-providers/erc20/erc20ActionProvider.test.js +117 -0
  38. package/dist/action-providers/erc20/index.d.ts +1 -0
  39. package/dist/action-providers/erc20/index.js +17 -0
  40. package/dist/action-providers/erc20/schemas.d.ts +27 -0
  41. package/dist/action-providers/erc20/schemas.js +26 -0
  42. package/dist/action-providers/erc721/constants.d.ts +236 -0
  43. package/dist/action-providers/erc721/constants.js +301 -0
  44. package/dist/action-providers/erc721/erc721ActionProvider.d.ts +46 -0
  45. package/dist/action-providers/erc721/erc721ActionProvider.js +164 -0
  46. package/dist/action-providers/erc721/erc721ActionProvider.test.d.ts +1 -0
  47. package/dist/action-providers/erc721/erc721ActionProvider.test.js +137 -0
  48. package/dist/action-providers/erc721/index.d.ts +1 -0
  49. package/dist/action-providers/erc721/index.js +17 -0
  50. package/dist/action-providers/erc721/schemas.d.ts +46 -0
  51. package/dist/action-providers/erc721/schemas.js +44 -0
  52. package/dist/action-providers/farcaster/farcasterActionProvider.d.ts +57 -0
  53. package/dist/action-providers/farcaster/farcasterActionProvider.js +142 -0
  54. package/dist/action-providers/farcaster/farcasterActionProvider.test.d.ts +1 -0
  55. package/dist/action-providers/farcaster/farcasterActionProvider.test.js +143 -0
  56. package/dist/action-providers/farcaster/index.d.ts +2 -0
  57. package/dist/action-providers/farcaster/index.js +18 -0
  58. package/dist/action-providers/farcaster/schemas.d.ts +15 -0
  59. package/dist/action-providers/farcaster/schemas.js +20 -0
  60. package/dist/action-providers/index.d.ts +13 -0
  61. package/dist/action-providers/index.js +29 -0
  62. package/dist/action-providers/morpho/constants.d.ts +16 -0
  63. package/dist/action-providers/morpho/constants.js +27 -0
  64. package/dist/action-providers/morpho/index.d.ts +2 -0
  65. package/dist/action-providers/morpho/index.js +18 -0
  66. package/dist/action-providers/morpho/morphoActionProvider.d.ts +39 -0
  67. package/dist/action-providers/morpho/morphoActionProvider.js +147 -0
  68. package/dist/action-providers/morpho/morphoActionProvider.test.d.ts +1 -0
  69. package/dist/action-providers/morpho/morphoActionProvider.test.js +126 -0
  70. package/dist/action-providers/morpho/schemas.d.ts +36 -0
  71. package/dist/action-providers/morpho/schemas.js +47 -0
  72. package/dist/action-providers/pyth/index.d.ts +2 -0
  73. package/dist/action-providers/pyth/index.js +18 -0
  74. package/dist/action-providers/pyth/pythActionProvider.d.ts +33 -0
  75. package/dist/action-providers/pyth/pythActionProvider.js +121 -0
  76. package/dist/action-providers/pyth/schemas.d.ts +21 -0
  77. package/dist/action-providers/pyth/schemas.js +20 -0
  78. package/dist/action-providers/twitter/index.d.ts +2 -0
  79. package/dist/action-providers/twitter/index.js +18 -0
  80. package/dist/action-providers/twitter/schemas.d.ts +38 -0
  81. package/dist/action-providers/twitter/schemas.js +44 -0
  82. package/dist/action-providers/twitter/twitterActionProvider.d.ts +82 -0
  83. package/dist/action-providers/twitter/twitterActionProvider.js +204 -0
  84. package/dist/action-providers/twitter/twitterActionProvider.test.d.ts +1 -0
  85. package/dist/action-providers/twitter/twitterActionProvider.test.js +185 -0
  86. package/dist/action-providers/wallet/index.d.ts +1 -0
  87. package/dist/action-providers/wallet/index.js +17 -0
  88. package/dist/action-providers/wallet/schemas.d.ts +19 -0
  89. package/dist/action-providers/wallet/schemas.js +19 -0
  90. package/dist/action-providers/wallet/walletActionProvider.d.ts +44 -0
  91. package/dist/action-providers/wallet/walletActionProvider.js +127 -0
  92. package/dist/action-providers/wallet/walletActionProvider.test.d.ts +1 -0
  93. package/dist/action-providers/wallet/walletActionProvider.test.js +116 -0
  94. package/dist/action-providers/weth/constants.d.ts +19 -0
  95. package/dist/action-providers/weth/constants.js +29 -0
  96. package/dist/action-providers/weth/index.d.ts +1 -0
  97. package/dist/action-providers/weth/index.js +17 -0
  98. package/dist/action-providers/weth/schemas.d.ts +8 -0
  99. package/dist/action-providers/weth/schemas.js +10 -0
  100. package/dist/action-providers/weth/wethActionProvider.d.ts +30 -0
  101. package/dist/action-providers/weth/wethActionProvider.js +89 -0
  102. package/dist/action-providers/weth/wethActionProvider.test.d.ts +1 -0
  103. package/dist/action-providers/weth/wethActionProvider.test.js +92 -0
  104. package/dist/action-providers/wow/constants.d.ts +15 -0
  105. package/dist/action-providers/wow/constants.js +844 -0
  106. package/dist/action-providers/wow/index.d.ts +2 -0
  107. package/dist/action-providers/wow/index.js +18 -0
  108. package/dist/action-providers/wow/schemas.d.ts +43 -0
  109. package/dist/action-providers/wow/schemas.js +47 -0
  110. package/dist/action-providers/wow/uniswap/constants.d.ts +3 -0
  111. package/dist/action-providers/wow/uniswap/constants.js +100 -0
  112. package/dist/action-providers/wow/uniswap/utils.d.ts +82 -0
  113. package/dist/action-providers/wow/uniswap/utils.js +226 -0
  114. package/dist/action-providers/wow/utils.d.ts +27 -0
  115. package/dist/action-providers/wow/utils.js +63 -0
  116. package/dist/action-providers/wow/wowActionProvider.d.ts +46 -0
  117. package/dist/action-providers/wow/wowActionProvider.js +223 -0
  118. package/dist/action-providers/wow/wowActionProvider.test.d.ts +1 -0
  119. package/dist/action-providers/wow/wowActionProvider.test.js +287 -0
  120. package/dist/agentkit.d.ts +45 -0
  121. package/dist/agentkit.js +60 -0
  122. package/dist/analytics/index.d.ts +1 -0
  123. package/dist/analytics/index.js +17 -0
  124. package/dist/analytics/sendAnalyticsEvent.d.ts +31 -0
  125. package/dist/analytics/sendAnalyticsEvent.js +51 -0
  126. package/dist/index.d.ts +3 -0
  127. package/dist/index.js +22 -0
  128. package/dist/network/index.d.ts +1 -0
  129. package/dist/network/index.js +17 -0
  130. package/dist/network/network.d.ts +13 -0
  131. package/dist/network/network.js +41 -0
  132. package/dist/network/types.d.ts +17 -0
  133. package/dist/network/types.js +2 -0
  134. package/dist/utils.d.ts +11 -0
  135. package/dist/utils.js +43 -0
  136. package/dist/utils.test.d.ts +1 -0
  137. package/dist/utils.test.js +50 -0
  138. package/dist/wallet-providers/cdpWalletProvider.d.ts +218 -0
  139. package/dist/wallet-providers/cdpWalletProvider.js +362 -0
  140. package/dist/wallet-providers/evmWalletProvider.d.ts +51 -0
  141. package/dist/wallet-providers/evmWalletProvider.js +14 -0
  142. package/dist/wallet-providers/index.d.ts +4 -0
  143. package/dist/wallet-providers/index.js +20 -0
  144. package/dist/wallet-providers/viemWalletProvider.d.ts +89 -0
  145. package/dist/wallet-providers/viemWalletProvider.js +187 -0
  146. package/dist/wallet-providers/walletProvider.d.ts +48 -0
  147. package/dist/wallet-providers/walletProvider.js +41 -0
  148. package/package.json +65 -0
@@ -0,0 +1,38 @@
1
+ import { z } from "zod";
2
+ import { ActionProvider } from "../actionProvider";
3
+ import { Network } from "../../network";
4
+ import { GetBalanceSchema, TransferSchema } from "./schemas";
5
+ import { EvmWalletProvider } from "../../wallet-providers";
6
+ /**
7
+ * ERC20ActionProvider is an action provider for ERC20 tokens.
8
+ */
9
+ export declare class ERC20ActionProvider extends ActionProvider {
10
+ /**
11
+ * Constructor for the ERC20ActionProvider.
12
+ */
13
+ constructor();
14
+ /**
15
+ * Gets the balance of an ERC20 token.
16
+ *
17
+ * @param walletProvider - The wallet provider to get the balance from.
18
+ * @param args - The input arguments for the action.
19
+ * @returns A message containing the balance.
20
+ */
21
+ getBalance(walletProvider: EvmWalletProvider, args: z.infer<typeof GetBalanceSchema>): Promise<string>;
22
+ /**
23
+ * Transfers a specified amount of an ERC20 token to a destination onchain.
24
+ *
25
+ * @param walletProvider - The wallet provider to transfer the asset from.
26
+ * @param args - The input arguments for the action.
27
+ * @returns A message containing the transfer details.
28
+ */
29
+ transfer(walletProvider: EvmWalletProvider, args: z.infer<typeof TransferSchema>): Promise<string>;
30
+ /**
31
+ * Checks if the ERC20 action provider supports the given network.
32
+ *
33
+ * @param _ - The network to check.
34
+ * @returns True if the ERC20 action provider supports the network, false otherwise.
35
+ */
36
+ supportsNetwork: (_: Network) => boolean;
37
+ }
38
+ export declare const erc20ActionProvider: () => ERC20ActionProvider;
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.erc20ActionProvider = exports.ERC20ActionProvider = void 0;
13
+ const zod_1 = require("zod");
14
+ const actionProvider_1 = require("../actionProvider");
15
+ const actionDecorator_1 = require("../actionDecorator");
16
+ const schemas_1 = require("./schemas");
17
+ const constants_1 = require("./constants");
18
+ const viem_1 = require("viem");
19
+ const wallet_providers_1 = require("../../wallet-providers");
20
+ /**
21
+ * ERC20ActionProvider is an action provider for ERC20 tokens.
22
+ */
23
+ class ERC20ActionProvider extends actionProvider_1.ActionProvider {
24
+ /**
25
+ * Constructor for the ERC20ActionProvider.
26
+ */
27
+ constructor() {
28
+ super("erc20", []);
29
+ /**
30
+ * Checks if the ERC20 action provider supports the given network.
31
+ *
32
+ * @param _ - The network to check.
33
+ * @returns True if the ERC20 action provider supports the network, false otherwise.
34
+ */
35
+ this.supportsNetwork = (_) => true;
36
+ }
37
+ /**
38
+ * Gets the balance of an ERC20 token.
39
+ *
40
+ * @param walletProvider - The wallet provider to get the balance from.
41
+ * @param args - The input arguments for the action.
42
+ * @returns A message containing the balance.
43
+ */
44
+ async getBalance(walletProvider, args) {
45
+ try {
46
+ const balance = await walletProvider.readContract({
47
+ address: args.contractAddress,
48
+ abi: constants_1.abi,
49
+ functionName: "balanceOf",
50
+ args: [walletProvider.getAddress()],
51
+ });
52
+ return `Balance of ${args.contractAddress} is ${balance}`;
53
+ }
54
+ catch (error) {
55
+ return `Error getting balance: ${error}`;
56
+ }
57
+ }
58
+ /**
59
+ * Transfers a specified amount of an ERC20 token to a destination onchain.
60
+ *
61
+ * @param walletProvider - The wallet provider to transfer the asset from.
62
+ * @param args - The input arguments for the action.
63
+ * @returns A message containing the transfer details.
64
+ */
65
+ async transfer(walletProvider, args) {
66
+ try {
67
+ const hash = await walletProvider.sendTransaction({
68
+ to: args.contractAddress,
69
+ data: (0, viem_1.encodeFunctionData)({
70
+ abi: constants_1.abi,
71
+ functionName: "transfer",
72
+ args: [args.destination, BigInt(args.amount)],
73
+ }),
74
+ });
75
+ await walletProvider.waitForTransactionReceipt(hash);
76
+ return `Transferred ${args.amount} of ${args.contractAddress} to ${args.destination}.\nTransaction hash for the transfer: ${hash}`;
77
+ }
78
+ catch (error) {
79
+ return `Error transferring the asset: ${error}`;
80
+ }
81
+ }
82
+ }
83
+ exports.ERC20ActionProvider = ERC20ActionProvider;
84
+ __decorate([
85
+ (0, actionDecorator_1.CreateAction)({
86
+ name: "get_balance",
87
+ description: `
88
+ This tool will get the balance of an ERC20 asset in the wallet. It takes the contract address as input.
89
+ `,
90
+ schema: schemas_1.GetBalanceSchema,
91
+ }),
92
+ __metadata("design:type", Function),
93
+ __metadata("design:paramtypes", [wallet_providers_1.EvmWalletProvider, void 0]),
94
+ __metadata("design:returntype", Promise)
95
+ ], ERC20ActionProvider.prototype, "getBalance", null);
96
+ __decorate([
97
+ (0, actionDecorator_1.CreateAction)({
98
+ name: "transfer",
99
+ description: `
100
+ This tool will transfer an ERC20 token from the wallet to another onchain address.
101
+
102
+ It takes the following inputs:
103
+ - amount: The amount to transfer
104
+ - contractAddress: The contract address of the token to transfer
105
+ - destination: Where to send the funds (can be an onchain address, ENS 'example.eth', or Basename 'example.base.eth')
106
+
107
+ Important notes:
108
+ - Ensure sufficient balance of the input asset before transferring
109
+ - When sending native assets (e.g. 'eth' on base-mainnet), ensure there is sufficient balance for the transfer itself AND the gas cost of this transfer
110
+ `,
111
+ schema: schemas_1.TransferSchema,
112
+ }),
113
+ __metadata("design:type", Function),
114
+ __metadata("design:paramtypes", [wallet_providers_1.EvmWalletProvider, void 0]),
115
+ __metadata("design:returntype", Promise)
116
+ ], ERC20ActionProvider.prototype, "transfer", null);
117
+ const erc20ActionProvider = () => new ERC20ActionProvider();
118
+ exports.erc20ActionProvider = erc20ActionProvider;
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const erc20ActionProvider_1 = require("./erc20ActionProvider");
4
+ const schemas_1 = require("./schemas");
5
+ const viem_1 = require("viem");
6
+ const constants_1 = require("./constants");
7
+ const MOCK_AMOUNT = 15;
8
+ const MOCK_CONTRACT_ADDRESS = "0x1234567890123456789012345678901234567890";
9
+ const MOCK_DESTINATION = "0x9876543210987654321098765432109876543210";
10
+ const MOCK_ADDRESS = "0x1234567890123456789012345678901234567890";
11
+ describe("Transfer Schema", () => {
12
+ it("should successfully parse valid input", () => {
13
+ const validInput = {
14
+ amount: MOCK_AMOUNT,
15
+ contractAddress: MOCK_CONTRACT_ADDRESS,
16
+ destination: MOCK_DESTINATION,
17
+ };
18
+ const result = schemas_1.TransferSchema.safeParse(validInput);
19
+ expect(result.success).toBe(true);
20
+ expect(result.data).toEqual(validInput);
21
+ });
22
+ it("should fail parsing empty input", () => {
23
+ const emptyInput = {};
24
+ const result = schemas_1.TransferSchema.safeParse(emptyInput);
25
+ expect(result.success).toBe(false);
26
+ });
27
+ });
28
+ describe("Get Balance Action", () => {
29
+ let mockWallet;
30
+ const actionProvider = (0, erc20ActionProvider_1.erc20ActionProvider)();
31
+ beforeEach(async () => {
32
+ mockWallet = {
33
+ getAddress: jest.fn().mockReturnValue(MOCK_ADDRESS),
34
+ readContract: jest.fn(),
35
+ };
36
+ mockWallet.readContract.mockResolvedValue(MOCK_AMOUNT);
37
+ });
38
+ it("should successfully respond", async () => {
39
+ const args = {
40
+ contractAddress: MOCK_CONTRACT_ADDRESS,
41
+ };
42
+ const response = await actionProvider.getBalance(mockWallet, args);
43
+ expect(mockWallet.readContract).toHaveBeenCalledWith({
44
+ address: args.contractAddress,
45
+ abi: constants_1.abi,
46
+ functionName: "balanceOf",
47
+ args: [mockWallet.getAddress()],
48
+ });
49
+ expect(response).toContain(`Balance of ${MOCK_CONTRACT_ADDRESS} is ${MOCK_AMOUNT}`);
50
+ });
51
+ it("should fail with an error", async () => {
52
+ const args = {
53
+ contractAddress: MOCK_CONTRACT_ADDRESS,
54
+ };
55
+ const error = new Error("Failed to get balance");
56
+ mockWallet.readContract.mockRejectedValue(error);
57
+ const response = await actionProvider.getBalance(mockWallet, args);
58
+ expect(mockWallet.readContract).toHaveBeenCalledWith({
59
+ address: args.contractAddress,
60
+ abi: constants_1.abi,
61
+ functionName: "balanceOf",
62
+ args: [mockWallet.getAddress()],
63
+ });
64
+ expect(response).toContain(`Error getting balance: ${error}`);
65
+ });
66
+ });
67
+ describe("Transfer Action", () => {
68
+ const TRANSACTION_HASH = "0xghijkl987654321";
69
+ let mockWallet;
70
+ const actionProvider = (0, erc20ActionProvider_1.erc20ActionProvider)();
71
+ beforeEach(async () => {
72
+ mockWallet = {
73
+ sendTransaction: jest.fn(),
74
+ waitForTransactionReceipt: jest.fn(),
75
+ };
76
+ mockWallet.sendTransaction.mockResolvedValue(TRANSACTION_HASH);
77
+ mockWallet.waitForTransactionReceipt.mockResolvedValue({});
78
+ });
79
+ it("should successfully respond", async () => {
80
+ const args = {
81
+ amount: BigInt(MOCK_AMOUNT),
82
+ contractAddress: MOCK_CONTRACT_ADDRESS,
83
+ destination: MOCK_DESTINATION,
84
+ };
85
+ const response = await actionProvider.transfer(mockWallet, args);
86
+ expect(mockWallet.sendTransaction).toHaveBeenCalledWith({
87
+ to: args.contractAddress,
88
+ data: (0, viem_1.encodeFunctionData)({
89
+ abi: constants_1.abi,
90
+ functionName: "transfer",
91
+ args: [args.destination, BigInt(args.amount)],
92
+ }),
93
+ });
94
+ expect(mockWallet.waitForTransactionReceipt).toHaveBeenCalledWith(TRANSACTION_HASH);
95
+ expect(response).toContain(`Transferred ${MOCK_AMOUNT} of ${MOCK_CONTRACT_ADDRESS} to ${MOCK_DESTINATION}`);
96
+ expect(response).toContain(`Transaction hash for the transfer: ${TRANSACTION_HASH}`);
97
+ });
98
+ it("should fail with an error", async () => {
99
+ const args = {
100
+ amount: BigInt(MOCK_AMOUNT),
101
+ contractAddress: MOCK_CONTRACT_ADDRESS,
102
+ destination: MOCK_DESTINATION,
103
+ };
104
+ const error = new Error("Failed to execute transfer");
105
+ mockWallet.sendTransaction.mockRejectedValue(error);
106
+ const response = await actionProvider.transfer(mockWallet, args);
107
+ expect(mockWallet.sendTransaction).toHaveBeenCalledWith({
108
+ to: args.contractAddress,
109
+ data: (0, viem_1.encodeFunctionData)({
110
+ abi: constants_1.abi,
111
+ functionName: "transfer",
112
+ args: [args.destination, BigInt(args.amount)],
113
+ }),
114
+ });
115
+ expect(response).toContain(`Error transferring the asset: ${error}`);
116
+ });
117
+ });
@@ -0,0 +1 @@
1
+ export * from "./erc20ActionProvider";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./erc20ActionProvider"), exports);
@@ -0,0 +1,27 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Input schema for transfer action.
4
+ */
5
+ export declare const TransferSchema: z.ZodObject<{
6
+ amount: z.ZodType<bigint, z.ZodTypeDef, bigint>;
7
+ contractAddress: z.ZodString;
8
+ destination: z.ZodString;
9
+ }, "strip", z.ZodTypeAny, {
10
+ amount: bigint;
11
+ contractAddress: string;
12
+ destination: string;
13
+ }, {
14
+ amount: bigint;
15
+ contractAddress: string;
16
+ destination: string;
17
+ }>;
18
+ /**
19
+ * Input schema for get balance action.
20
+ */
21
+ export declare const GetBalanceSchema: z.ZodObject<{
22
+ contractAddress: z.ZodString;
23
+ }, "strip", z.ZodTypeAny, {
24
+ contractAddress: string;
25
+ }, {
26
+ contractAddress: string;
27
+ }>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetBalanceSchema = exports.TransferSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Input schema for transfer action.
7
+ */
8
+ exports.TransferSchema = zod_1.z
9
+ .object({
10
+ amount: zod_1.z.custom().describe("The amount of the asset to transfer"),
11
+ contractAddress: zod_1.z.string().describe("The contract address of the token to transfer"),
12
+ destination: zod_1.z.string().describe("The destination to transfer the funds"),
13
+ })
14
+ .strip()
15
+ .describe("Instructions for transferring assets");
16
+ /**
17
+ * Input schema for get balance action.
18
+ */
19
+ exports.GetBalanceSchema = zod_1.z
20
+ .object({
21
+ contractAddress: zod_1.z
22
+ .string()
23
+ .describe("The contract address of the token to get the balance for"),
24
+ })
25
+ .strip()
26
+ .describe("Instructions for getting wallet balance");
@@ -0,0 +1,236 @@
1
+ export declare const ERC721_ABI: readonly [{
2
+ readonly inputs: readonly [{
3
+ readonly internalType: "address";
4
+ readonly name: "to";
5
+ readonly type: "address";
6
+ }, {
7
+ readonly internalType: "uint256";
8
+ readonly name: "tokenId";
9
+ readonly type: "uint256";
10
+ }];
11
+ readonly name: "mint";
12
+ readonly outputs: readonly [];
13
+ readonly payable: false;
14
+ readonly stateMutability: "nonpayable";
15
+ readonly type: "function";
16
+ }, {
17
+ readonly inputs: readonly [{
18
+ readonly internalType: "bytes4";
19
+ readonly name: "interfaceId";
20
+ readonly type: "bytes4";
21
+ }];
22
+ readonly name: "supportsInterface";
23
+ readonly outputs: readonly [{
24
+ readonly internalType: "bool";
25
+ readonly name: "";
26
+ readonly type: "bool";
27
+ }];
28
+ readonly stateMutability: "view";
29
+ readonly type: "function";
30
+ }, {
31
+ readonly anonymous: false;
32
+ readonly inputs: readonly [{
33
+ readonly indexed: true;
34
+ readonly internalType: "address";
35
+ readonly name: "from";
36
+ readonly type: "address";
37
+ }, {
38
+ readonly indexed: true;
39
+ readonly internalType: "address";
40
+ readonly name: "to";
41
+ readonly type: "address";
42
+ }, {
43
+ readonly indexed: true;
44
+ readonly internalType: "uint256";
45
+ readonly name: "tokenId";
46
+ readonly type: "uint256";
47
+ }];
48
+ readonly name: "Transfer";
49
+ readonly type: "event";
50
+ }, {
51
+ readonly anonymous: false;
52
+ readonly inputs: readonly [{
53
+ readonly indexed: true;
54
+ readonly internalType: "address";
55
+ readonly name: "owner";
56
+ readonly type: "address";
57
+ }, {
58
+ readonly indexed: true;
59
+ readonly internalType: "address";
60
+ readonly name: "approved";
61
+ readonly type: "address";
62
+ }, {
63
+ readonly indexed: true;
64
+ readonly internalType: "uint256";
65
+ readonly name: "tokenId";
66
+ readonly type: "uint256";
67
+ }];
68
+ readonly name: "Approval";
69
+ readonly type: "event";
70
+ }, {
71
+ readonly anonymous: false;
72
+ readonly inputs: readonly [{
73
+ readonly indexed: true;
74
+ readonly internalType: "address";
75
+ readonly name: "owner";
76
+ readonly type: "address";
77
+ }, {
78
+ readonly indexed: true;
79
+ readonly internalType: "address";
80
+ readonly name: "operator";
81
+ readonly type: "address";
82
+ }, {
83
+ readonly indexed: false;
84
+ readonly internalType: "bool";
85
+ readonly name: "approved";
86
+ readonly type: "bool";
87
+ }];
88
+ readonly name: "ApprovalForAll";
89
+ readonly type: "event";
90
+ }, {
91
+ readonly inputs: readonly [{
92
+ readonly internalType: "address";
93
+ readonly name: "owner";
94
+ readonly type: "address";
95
+ }];
96
+ readonly name: "balanceOf";
97
+ readonly outputs: readonly [{
98
+ readonly internalType: "uint256";
99
+ readonly name: "balance";
100
+ readonly type: "uint256";
101
+ }];
102
+ readonly stateMutability: "view";
103
+ readonly type: "function";
104
+ }, {
105
+ readonly inputs: readonly [{
106
+ readonly internalType: "uint256";
107
+ readonly name: "tokenId";
108
+ readonly type: "uint256";
109
+ }];
110
+ readonly name: "ownerOf";
111
+ readonly outputs: readonly [{
112
+ readonly internalType: "address";
113
+ readonly name: "owner";
114
+ readonly type: "address";
115
+ }];
116
+ readonly stateMutability: "view";
117
+ readonly type: "function";
118
+ }, {
119
+ readonly inputs: readonly [{
120
+ readonly internalType: "address";
121
+ readonly name: "from";
122
+ readonly type: "address";
123
+ }, {
124
+ readonly internalType: "address";
125
+ readonly name: "to";
126
+ readonly type: "address";
127
+ }, {
128
+ readonly internalType: "uint256";
129
+ readonly name: "tokenId";
130
+ readonly type: "uint256";
131
+ }, {
132
+ readonly internalType: "bytes";
133
+ readonly name: "data";
134
+ readonly type: "bytes";
135
+ }];
136
+ readonly name: "safeTransferFrom";
137
+ readonly outputs: readonly [];
138
+ readonly stateMutability: "nonpayable";
139
+ readonly type: "function";
140
+ }, {
141
+ readonly inputs: readonly [{
142
+ readonly internalType: "address";
143
+ readonly name: "from";
144
+ readonly type: "address";
145
+ }, {
146
+ readonly internalType: "address";
147
+ readonly name: "to";
148
+ readonly type: "address";
149
+ }, {
150
+ readonly internalType: "uint256";
151
+ readonly name: "tokenId";
152
+ readonly type: "uint256";
153
+ }];
154
+ readonly name: "safeTransferFrom";
155
+ readonly outputs: readonly [];
156
+ readonly stateMutability: "nonpayable";
157
+ readonly type: "function";
158
+ }, {
159
+ readonly inputs: readonly [{
160
+ readonly internalType: "address";
161
+ readonly name: "from";
162
+ readonly type: "address";
163
+ }, {
164
+ readonly internalType: "address";
165
+ readonly name: "to";
166
+ readonly type: "address";
167
+ }, {
168
+ readonly internalType: "uint256";
169
+ readonly name: "tokenId";
170
+ readonly type: "uint256";
171
+ }];
172
+ readonly name: "transferFrom";
173
+ readonly outputs: readonly [];
174
+ readonly stateMutability: "nonpayable";
175
+ readonly type: "function";
176
+ }, {
177
+ readonly inputs: readonly [{
178
+ readonly internalType: "address";
179
+ readonly name: "to";
180
+ readonly type: "address";
181
+ }, {
182
+ readonly internalType: "uint256";
183
+ readonly name: "tokenId";
184
+ readonly type: "uint256";
185
+ }];
186
+ readonly name: "approve";
187
+ readonly outputs: readonly [];
188
+ readonly stateMutability: "nonpayable";
189
+ readonly type: "function";
190
+ }, {
191
+ readonly inputs: readonly [{
192
+ readonly internalType: "address";
193
+ readonly name: "operator";
194
+ readonly type: "address";
195
+ }, {
196
+ readonly internalType: "bool";
197
+ readonly name: "approved";
198
+ readonly type: "bool";
199
+ }];
200
+ readonly name: "setApprovalForAll";
201
+ readonly outputs: readonly [];
202
+ readonly stateMutability: "nonpayable";
203
+ readonly type: "function";
204
+ }, {
205
+ readonly inputs: readonly [{
206
+ readonly internalType: "uint256";
207
+ readonly name: "tokenId";
208
+ readonly type: "uint256";
209
+ }];
210
+ readonly name: "getApproved";
211
+ readonly outputs: readonly [{
212
+ readonly internalType: "address";
213
+ readonly name: "operator";
214
+ readonly type: "address";
215
+ }];
216
+ readonly stateMutability: "view";
217
+ readonly type: "function";
218
+ }, {
219
+ readonly inputs: readonly [{
220
+ readonly internalType: "address";
221
+ readonly name: "owner";
222
+ readonly type: "address";
223
+ }, {
224
+ readonly internalType: "address";
225
+ readonly name: "operator";
226
+ readonly type: "address";
227
+ }];
228
+ readonly name: "isApprovedForAll";
229
+ readonly outputs: readonly [{
230
+ readonly internalType: "bool";
231
+ readonly name: "";
232
+ readonly type: "bool";
233
+ }];
234
+ readonly stateMutability: "view";
235
+ readonly type: "function";
236
+ }];