@heyanon/sdk 2.4.4 → 2.4.6
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.
- package/dist/adapter/index.d.ts +0 -1
- package/dist/adapter/types.d.ts +2 -4
- package/dist/blockchain/constants/chains.d.ts +1 -5
- package/dist/blockchain/evm/constants/chains.d.ts +0 -4
- package/dist/blockchain/evm/constants/weth9.d.ts +0 -4
- package/dist/index.js +0 -28
- package/dist/index.mjs +2 -29
- package/package.json +1 -1
- package/dist/adapter/misc.d.ts +0 -49
package/dist/adapter/index.d.ts
CHANGED
package/dist/adapter/types.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { OpenAI } from 'openai';
|
|
|
2
2
|
import { EVM, Solana, TON, WalletType, Chain } from '../blockchain';
|
|
3
3
|
import { PublicClient, SignMessageReturnType, SignTypedDataReturnType, Address } from 'viem';
|
|
4
4
|
import { Connection, PublicKey, Transaction as SolanaTransaction, VersionedTransaction as SolanaVersionedTransaction } from '@solana/web3.js';
|
|
5
|
-
import { AdapterTag } from './misc';
|
|
6
5
|
import { Address as TonAddress } from '@ton/ton';
|
|
7
6
|
import { DeployContractProps, SignMessagesProps, SignTypedDatasProps } from '../blockchain/evm/types';
|
|
8
7
|
import { Exchange, exchanges } from 'ccxt';
|
|
@@ -160,7 +159,6 @@ export interface FunctionOptions {
|
|
|
160
159
|
* ```typescript
|
|
161
160
|
* const myAdapter: AdapterExport = {
|
|
162
161
|
* chains: [Chain.Ethereum, Chain.Polygon],
|
|
163
|
-
* tags: [AdapterTag.DeFi, AdapterTag.DEX],
|
|
164
162
|
* description: "Swap tokens on decentralized exchanges",
|
|
165
163
|
* functions: {
|
|
166
164
|
* swap: async (args, options) => ({ success: true, data: "Swap completed" })
|
|
@@ -173,8 +171,8 @@ export interface FunctionOptions {
|
|
|
173
171
|
export interface AdapterExport {
|
|
174
172
|
/** Supported blockchain networks */
|
|
175
173
|
readonly chains: Chain[];
|
|
176
|
-
/** Adapter
|
|
177
|
-
readonly
|
|
174
|
+
/** Adapter name */
|
|
175
|
+
readonly name: string;
|
|
178
176
|
/** Adapter description */
|
|
179
177
|
readonly description: string;
|
|
180
178
|
/** Available adapter functions */
|
|
@@ -37,10 +37,6 @@ export declare enum Chain {
|
|
|
37
37
|
SONIC = "sonic",
|
|
38
38
|
/** zkSync Era */
|
|
39
39
|
ZKSYNC = "zksync",
|
|
40
|
-
/** Metis Andromeda */
|
|
41
|
-
METIS = "metis",
|
|
42
|
-
/** Kava EVM */
|
|
43
|
-
KAVA_EVM = "kava_evm",
|
|
44
40
|
/** Base Layer 2 */
|
|
45
41
|
BASE = "base",
|
|
46
42
|
/** Avalanche C-Chain */
|
|
@@ -116,4 +112,4 @@ export declare const allChains: Chain[];
|
|
|
116
112
|
* };
|
|
117
113
|
* ```
|
|
118
114
|
*/
|
|
119
|
-
export declare const allEvmChains: (Chain.ETHEREUM | Chain.OPTIMISM | Chain.BSC | Chain.GNOSIS | Chain.POLYGON | Chain.SONIC | Chain.ZKSYNC | Chain.
|
|
115
|
+
export declare const allEvmChains: (Chain.ETHEREUM | Chain.OPTIMISM | Chain.BSC | Chain.GNOSIS | Chain.POLYGON | Chain.SONIC | Chain.ZKSYNC | Chain.BASE | Chain.AVALANCHE | Chain.ARBITRUM | Chain.SCROLL | Chain.HYPEREVM | Chain.PLASMA | Chain.MONAD | Chain.ROBINHOOD)[];
|
|
@@ -54,10 +54,6 @@ export declare const ChainIds: {
|
|
|
54
54
|
sonic: number;
|
|
55
55
|
/** zkSync Era - Chain ID: 324 */
|
|
56
56
|
zksync: number;
|
|
57
|
-
/** Metis Andromeda - Chain ID: 1088 */
|
|
58
|
-
metis: number;
|
|
59
|
-
/** Kava EVM - Chain ID: 2222 */
|
|
60
|
-
kava_evm: number;
|
|
61
57
|
/** Base - Chain ID: 8453 */
|
|
62
58
|
base: number;
|
|
63
59
|
/** Avalanche C-Chain - Chain ID: 43114 */
|
|
@@ -73,14 +73,10 @@ export declare const WETH9: {
|
|
|
73
73
|
polygon: Token;
|
|
74
74
|
/** Wrapped Ether (WETH) on zkSync Era */
|
|
75
75
|
zksync: Token;
|
|
76
|
-
/** Wrapped KAVA (WKAVA) on Kava EVM */
|
|
77
|
-
kava_evm: Token;
|
|
78
76
|
/** Wrapped AVAX (WAVAX) on Avalanche */
|
|
79
77
|
avalanche: Token;
|
|
80
78
|
/** Wrapped Ether (WETH) on Arbitrum */
|
|
81
79
|
arbitrum: Token;
|
|
82
|
-
/** Wrapped METIS (WMETIS) on Metis */
|
|
83
|
-
metis: Token;
|
|
84
80
|
/** Wrapped Ether (WETH) on Base */
|
|
85
81
|
base: Token;
|
|
86
82
|
/** Wrapped S (WS) on Sonic */
|
package/dist/index.js
CHANGED
|
@@ -126,8 +126,6 @@ var Chain = /* @__PURE__ */ ((Chain2) => {
|
|
|
126
126
|
Chain2["POLYGON"] = "polygon";
|
|
127
127
|
Chain2["SONIC"] = "sonic";
|
|
128
128
|
Chain2["ZKSYNC"] = "zksync";
|
|
129
|
-
Chain2["METIS"] = "metis";
|
|
130
|
-
Chain2["KAVA_EVM"] = "kava_evm";
|
|
131
129
|
Chain2["BASE"] = "base";
|
|
132
130
|
Chain2["AVALANCHE"] = "avalanche";
|
|
133
131
|
Chain2["ARBITRUM"] = "arbitrum";
|
|
@@ -167,10 +165,6 @@ var ChainIds = {
|
|
|
167
165
|
["sonic" /* SONIC */]: 146,
|
|
168
166
|
/** zkSync Era - Chain ID: 324 */
|
|
169
167
|
["zksync" /* ZKSYNC */]: 324,
|
|
170
|
-
/** Metis Andromeda - Chain ID: 1088 */
|
|
171
|
-
["metis" /* METIS */]: 1088,
|
|
172
|
-
/** Kava EVM - Chain ID: 2222 */
|
|
173
|
-
["kava_evm" /* KAVA_EVM */]: 2222,
|
|
174
168
|
/** Base - Chain ID: 8453 */
|
|
175
169
|
["base" /* BASE */]: 8453,
|
|
176
170
|
/** Avalanche C-Chain - Chain ID: 43114 */
|
|
@@ -201,14 +195,10 @@ var WETH9 = {
|
|
|
201
195
|
["polygon" /* POLYGON */]: sdk.polygonTokens.wpol,
|
|
202
196
|
/** Wrapped Ether (WETH) on zkSync Era */
|
|
203
197
|
["zksync" /* ZKSYNC */]: sdk.zkSyncTokens.weth,
|
|
204
|
-
/** Wrapped KAVA (WKAVA) on Kava EVM */
|
|
205
|
-
["kava_evm" /* KAVA_EVM */]: sdk.kavaTokens.wkava,
|
|
206
198
|
/** Wrapped AVAX (WAVAX) on Avalanche */
|
|
207
199
|
["avalanche" /* AVALANCHE */]: sdk.avalancheTokens.wavax,
|
|
208
200
|
/** Wrapped Ether (WETH) on Arbitrum */
|
|
209
201
|
["arbitrum" /* ARBITRUM */]: sdk.arbitrumTokens.weth,
|
|
210
|
-
/** Wrapped METIS (WMETIS) on Metis */
|
|
211
|
-
["metis" /* METIS */]: sdk.metisTokens.wmetis,
|
|
212
202
|
/** Wrapped Ether (WETH) on Base */
|
|
213
203
|
["base" /* BASE */]: sdk.baseTokens.weth,
|
|
214
204
|
/** Wrapped S (WS) on Sonic */
|
|
@@ -1235,24 +1225,6 @@ function toResult(data, error = false) {
|
|
|
1235
1225
|
};
|
|
1236
1226
|
}
|
|
1237
1227
|
|
|
1238
|
-
// src/adapter/misc.ts
|
|
1239
|
-
var AdapterTag = /* @__PURE__ */ ((AdapterTag2) => {
|
|
1240
|
-
AdapterTag2["ALM"] = "ALM";
|
|
1241
|
-
AdapterTag2["STAKE"] = "Stake";
|
|
1242
|
-
AdapterTag2["LENDING"] = "Lending";
|
|
1243
|
-
AdapterTag2["FARM"] = "Farm";
|
|
1244
|
-
AdapterTag2["PERPETUALS"] = "Perpetuals";
|
|
1245
|
-
AdapterTag2["BRIDGE"] = "Bridge";
|
|
1246
|
-
AdapterTag2["LIMIT_ORDER"] = "Limit orders";
|
|
1247
|
-
AdapterTag2["DEX"] = "DEX";
|
|
1248
|
-
AdapterTag2["LP"] = "LP";
|
|
1249
|
-
AdapterTag2["GAMES"] = "Games";
|
|
1250
|
-
AdapterTag2["CEX"] = "CEX";
|
|
1251
|
-
AdapterTag2["LAUNCHPAD"] = "Launchpad";
|
|
1252
|
-
return AdapterTag2;
|
|
1253
|
-
})(AdapterTag || {});
|
|
1254
|
-
|
|
1255
|
-
exports.AdapterTag = AdapterTag;
|
|
1256
1228
|
exports.Chain = Chain;
|
|
1257
1229
|
exports.EVM = evm_exports;
|
|
1258
1230
|
exports.MessagesReleaser = MessagesReleaser;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { erc20Abi, getAddress, encodeFunctionData, isAddress as isAddress$1 } from 'viem';
|
|
2
|
-
import { ethereumTokens, optimismTokens, bscTokens, polygonTokens, zkSyncTokens,
|
|
2
|
+
import { ethereumTokens, optimismTokens, bscTokens, polygonTokens, zkSyncTokens, avalancheTokens, arbitrumTokens, baseTokens, sonicTokens, Token } from '@real-wagmi/sdk';
|
|
3
3
|
import { TransactionMessage, VersionedTransaction, PublicKey } from '@solana/web3.js';
|
|
4
4
|
import { Address } from '@ton/ton';
|
|
5
5
|
|
|
@@ -124,8 +124,6 @@ var Chain = /* @__PURE__ */ ((Chain2) => {
|
|
|
124
124
|
Chain2["POLYGON"] = "polygon";
|
|
125
125
|
Chain2["SONIC"] = "sonic";
|
|
126
126
|
Chain2["ZKSYNC"] = "zksync";
|
|
127
|
-
Chain2["METIS"] = "metis";
|
|
128
|
-
Chain2["KAVA_EVM"] = "kava_evm";
|
|
129
127
|
Chain2["BASE"] = "base";
|
|
130
128
|
Chain2["AVALANCHE"] = "avalanche";
|
|
131
129
|
Chain2["ARBITRUM"] = "arbitrum";
|
|
@@ -165,10 +163,6 @@ var ChainIds = {
|
|
|
165
163
|
["sonic" /* SONIC */]: 146,
|
|
166
164
|
/** zkSync Era - Chain ID: 324 */
|
|
167
165
|
["zksync" /* ZKSYNC */]: 324,
|
|
168
|
-
/** Metis Andromeda - Chain ID: 1088 */
|
|
169
|
-
["metis" /* METIS */]: 1088,
|
|
170
|
-
/** Kava EVM - Chain ID: 2222 */
|
|
171
|
-
["kava_evm" /* KAVA_EVM */]: 2222,
|
|
172
166
|
/** Base - Chain ID: 8453 */
|
|
173
167
|
["base" /* BASE */]: 8453,
|
|
174
168
|
/** Avalanche C-Chain - Chain ID: 43114 */
|
|
@@ -199,14 +193,10 @@ var WETH9 = {
|
|
|
199
193
|
["polygon" /* POLYGON */]: polygonTokens.wpol,
|
|
200
194
|
/** Wrapped Ether (WETH) on zkSync Era */
|
|
201
195
|
["zksync" /* ZKSYNC */]: zkSyncTokens.weth,
|
|
202
|
-
/** Wrapped KAVA (WKAVA) on Kava EVM */
|
|
203
|
-
["kava_evm" /* KAVA_EVM */]: kavaTokens.wkava,
|
|
204
196
|
/** Wrapped AVAX (WAVAX) on Avalanche */
|
|
205
197
|
["avalanche" /* AVALANCHE */]: avalancheTokens.wavax,
|
|
206
198
|
/** Wrapped Ether (WETH) on Arbitrum */
|
|
207
199
|
["arbitrum" /* ARBITRUM */]: arbitrumTokens.weth,
|
|
208
|
-
/** Wrapped METIS (WMETIS) on Metis */
|
|
209
|
-
["metis" /* METIS */]: metisTokens.wmetis,
|
|
210
200
|
/** Wrapped Ether (WETH) on Base */
|
|
211
201
|
["base" /* BASE */]: baseTokens.weth,
|
|
212
202
|
/** Wrapped S (WS) on Sonic */
|
|
@@ -1233,21 +1223,4 @@ function toResult(data, error = false) {
|
|
|
1233
1223
|
};
|
|
1234
1224
|
}
|
|
1235
1225
|
|
|
1236
|
-
|
|
1237
|
-
var AdapterTag = /* @__PURE__ */ ((AdapterTag2) => {
|
|
1238
|
-
AdapterTag2["ALM"] = "ALM";
|
|
1239
|
-
AdapterTag2["STAKE"] = "Stake";
|
|
1240
|
-
AdapterTag2["LENDING"] = "Lending";
|
|
1241
|
-
AdapterTag2["FARM"] = "Farm";
|
|
1242
|
-
AdapterTag2["PERPETUALS"] = "Perpetuals";
|
|
1243
|
-
AdapterTag2["BRIDGE"] = "Bridge";
|
|
1244
|
-
AdapterTag2["LIMIT_ORDER"] = "Limit orders";
|
|
1245
|
-
AdapterTag2["DEX"] = "DEX";
|
|
1246
|
-
AdapterTag2["LP"] = "LP";
|
|
1247
|
-
AdapterTag2["GAMES"] = "Games";
|
|
1248
|
-
AdapterTag2["CEX"] = "CEX";
|
|
1249
|
-
AdapterTag2["LAUNCHPAD"] = "Launchpad";
|
|
1250
|
-
return AdapterTag2;
|
|
1251
|
-
})(AdapterTag || {});
|
|
1252
|
-
|
|
1253
|
-
export { AdapterTag, Chain, evm_exports as EVM, MessagesReleaser, solana_exports as Solana, ton_exports as TON, TryStepsExecutor, WalletType, WorkflowAction, WorkflowBreakError, WorkflowContext, WorkflowResult, WorkflowRetry, allChains, allEvmChains, getTimestamp, isAddress, normalizeAddress, retry, sleep, stringify, toResult };
|
|
1226
|
+
export { Chain, evm_exports as EVM, MessagesReleaser, solana_exports as Solana, ton_exports as TON, TryStepsExecutor, WalletType, WorkflowAction, WorkflowBreakError, WorkflowContext, WorkflowResult, WorkflowRetry, allChains, allEvmChains, getTimestamp, isAddress, normalizeAddress, retry, sleep, stringify, toResult };
|
package/package.json
CHANGED
package/dist/adapter/misc.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tags for categorizing different types of adapters in the ecosystem
|
|
3
|
-
* @enum AdapterTag
|
|
4
|
-
* @example
|
|
5
|
-
* ```typescript
|
|
6
|
-
* // Using in adapter configuration
|
|
7
|
-
* const swapAdapter: AdapterExport = {
|
|
8
|
-
* tags: [AdapterTag.DEX, AdapterTag.LP],
|
|
9
|
-
* // ... other properties
|
|
10
|
-
* };
|
|
11
|
-
*
|
|
12
|
-
* // Filtering adapters by tag
|
|
13
|
-
* const dexAdapters = adapters.filter(adapter =>
|
|
14
|
-
* adapter.tags.includes(AdapterTag.DEX)
|
|
15
|
-
* );
|
|
16
|
-
*
|
|
17
|
-
* // Multiple tags for complex protocols
|
|
18
|
-
* const compoundAdapter = {
|
|
19
|
-
* tags: [AdapterTag.LENDING, AdapterTag.FARM],
|
|
20
|
-
* // ... other properties
|
|
21
|
-
* };
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export declare enum AdapterTag {
|
|
25
|
-
/** Automated Liquidity Management protocols */
|
|
26
|
-
ALM = "ALM",
|
|
27
|
-
/** Staking protocols and validators */
|
|
28
|
-
STAKE = "Stake",
|
|
29
|
-
/** Lending and borrowing protocols */
|
|
30
|
-
LENDING = "Lending",
|
|
31
|
-
/** Yield farming and liquidity mining */
|
|
32
|
-
FARM = "Farm",
|
|
33
|
-
/** Perpetual trading and derivatives */
|
|
34
|
-
PERPETUALS = "Perpetuals",
|
|
35
|
-
/** Cross-chain bridges */
|
|
36
|
-
BRIDGE = "Bridge",
|
|
37
|
-
/** Limit order protocols */
|
|
38
|
-
LIMIT_ORDER = "Limit orders",
|
|
39
|
-
/** Decentralized exchanges */
|
|
40
|
-
DEX = "DEX",
|
|
41
|
-
/** Liquidity provision protocols */
|
|
42
|
-
LP = "LP",
|
|
43
|
-
/** Gaming and GameFi protocols */
|
|
44
|
-
GAMES = "Games",
|
|
45
|
-
/** Centralized exchange integrations */
|
|
46
|
-
CEX = "CEX",
|
|
47
|
-
/** Token launchpads and IDO platforms */
|
|
48
|
-
LAUNCHPAD = "Launchpad"
|
|
49
|
-
}
|