@vleap/warps-adapter-evm 0.2.0-alpha.23 → 0.2.0-alpha.25

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/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { WarpChainAsset, AdapterFactory, WarpClientConfig, Adapter, WarpChain, WarpChainEnv, WarpChainInfo, AdapterWarpDataLoader, WarpChainAccount, WarpChainAction, WarpDataLoaderOptions, AdapterWarpExecutor, WarpExecutable, WarpExecution, WarpActionInputType, AdapterWarpExplorer, AdapterWarpResults, Warp, ResolvedInput, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpNativeValue, BaseWarpActionInputType, WarpAdapterGenericType } from '@vleap/warps';
1
+ import { WarpChainAsset, AdapterFactory, WarpClientConfig, Adapter, WarpChain, WarpChainEnv, WarpChainInfo, AdapterWarpDataLoader, WarpChainAccount, WarpChainAction, WarpDataLoaderOptions, AdapterWarpExecutor, WarpExecutable, WarpExecution, AdapterWarpExplorer, AdapterWarpResults, Warp, ResolvedInput, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpActionInputType, WarpNativeValue, BaseWarpActionInputType, WarpAdapterGenericType, WarpCache } from '@vleap/warps';
2
2
  import { ethers } from 'ethers';
3
3
 
4
4
  declare const NativeTokenArb: WarpChainAsset;
@@ -72,21 +72,9 @@ declare const EvmExplorers: {
72
72
  };
73
73
  declare const ExplorerUrls: Record<ExplorerName, string>;
74
74
 
75
- interface TokenInfo$1 {
76
- name?: string;
77
- symbol?: string;
78
- logoURI?: string;
79
- decimals?: number;
80
- }
81
- declare class EvmLogoService {
82
- static getTokenInfo(chainName: string, tokenAddress: string): Promise<TokenInfo$1>;
83
- static getLogoUrl(chainName: string, tokenAddress: string, tokenName?: string, tokenSymbol?: string): Promise<string>;
84
- private static fetchFromTokenLists;
85
- private static fetchFromDefiLlama;
86
- private static fetchFromTrustWallet;
87
- static clearCache(): void;
88
- static getCacheSize(): number;
89
- }
75
+ declare const KnownTokens: Record<WarpChain, Record<string, WarpChainAsset[]>>;
76
+ declare const findKnownTokenById: (chain: WarpChain, env: WarpChainEnv, id: string) => WarpChainAsset | null;
77
+ declare const getKnownTokensForChain: (chainName: string, env?: string) => WarpChainAsset[];
90
78
 
91
79
  interface TokenMetadata {
92
80
  name: string;
@@ -105,6 +93,29 @@ interface TokenInfo {
105
93
  logoURI?: string;
106
94
  decimals?: number;
107
95
  }
96
+ interface UniswapToken {
97
+ chainId: number;
98
+ address: string;
99
+ name: string;
100
+ symbol: string;
101
+ decimals: number;
102
+ logoURI: string;
103
+ extensions?: {
104
+ bridgeInfo?: Record<string, {
105
+ tokenAddress: string;
106
+ }>;
107
+ };
108
+ }
109
+ interface UniswapTokenList {
110
+ name: string;
111
+ timestamp: string;
112
+ version: {
113
+ major: number;
114
+ minor: number;
115
+ patch: number;
116
+ };
117
+ tokens: UniswapToken[];
118
+ }
108
119
  interface TokenListResponse {
109
120
  tokens: Array<{
110
121
  chainId: number;
@@ -120,6 +131,8 @@ declare class WarpEvmDataLoader implements AdapterWarpDataLoader {
120
131
  private readonly config;
121
132
  private readonly chain;
122
133
  private provider;
134
+ private cache;
135
+ private uniswapService;
123
136
  constructor(config: WarpClientConfig, chain: WarpChainInfo);
124
137
  getAccount(address: string): Promise<WarpChainAccount>;
125
138
  getAccountAssets(address: string): Promise<WarpChainAsset[]>;
@@ -129,8 +142,6 @@ declare class WarpEvmDataLoader implements AdapterWarpDataLoader {
129
142
  private getERC20TokenBalances;
130
143
  private getTokenBalance;
131
144
  private getTokenMetadata;
132
- private detectTokensFromEvents;
133
- private getLogoUrl;
134
145
  }
135
146
 
136
147
  declare class WarpEvmExecutor implements AdapterWarpExecutor {
@@ -146,7 +157,6 @@ declare class WarpEvmExecutor implements AdapterWarpExecutor {
146
157
  private createTokenTransferTransaction;
147
158
  private createSingleTokenTransfer;
148
159
  executeQuery(executable: WarpExecutable): Promise<WarpExecution>;
149
- preprocessInput(chain: WarpChainInfo, input: string, type: WarpActionInputType, value: string): Promise<string>;
150
160
  private estimateGasAndSetDefaults;
151
161
  signMessage(message: string, privateKey: string): Promise<string>;
152
162
  verifyMessage(message: string, signature: string): Promise<string>;
@@ -204,4 +214,20 @@ declare class WarpEvmSerializer implements AdapterWarpSerializer {
204
214
  private parseNativeValue;
205
215
  }
206
216
 
207
- export { ArbitrumExplorers, BaseExplorers, EthereumExplorers, EvmExplorers, EvmLogoService, type ExplorerName, ExplorerUrls, NativeTokenArb, NativeTokenBase, NativeTokenEth, type TokenBalance, type TokenInfo, type TokenListResponse, type TokenMetadata, WarpEvmConstants, WarpEvmDataLoader, WarpEvmExecutor, WarpEvmExplorer, WarpEvmResults, WarpEvmSerializer, createEvmAdapter, getAllEvmAdapters, getAllEvmChainNames, getArbitrumAdapter, getBaseAdapter, getEthereumAdapter };
217
+ declare class UniswapService {
218
+ private static readonly UNISWAP_TOKEN_LIST_URL;
219
+ private cache;
220
+ private chainId;
221
+ constructor(cache: WarpCache, chainId: number);
222
+ getTokenList(): Promise<UniswapTokenList>;
223
+ findToken(address: string): Promise<UniswapToken | null>;
224
+ getTokenMetadata(address: string): Promise<{
225
+ name: string;
226
+ symbol: string;
227
+ decimals: number;
228
+ logoUrl: string;
229
+ } | null>;
230
+ getBridgeInfo(address: string): Promise<Record<string, string> | null>;
231
+ }
232
+
233
+ export { ArbitrumExplorers, BaseExplorers, EthereumExplorers, EvmExplorers, type ExplorerName, ExplorerUrls, KnownTokens, NativeTokenArb, NativeTokenBase, NativeTokenEth, type TokenBalance, type TokenInfo, type TokenListResponse, type TokenMetadata, UniswapService, type UniswapToken, type UniswapTokenList, WarpEvmConstants, WarpEvmDataLoader, WarpEvmExecutor, WarpEvmExplorer, WarpEvmResults, WarpEvmSerializer, createEvmAdapter, findKnownTokenById, getAllEvmAdapters, getAllEvmChainNames, getArbitrumAdapter, getBaseAdapter, getEthereumAdapter, getKnownTokensForChain };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { WarpChainAsset, AdapterFactory, WarpClientConfig, Adapter, WarpChain, WarpChainEnv, WarpChainInfo, AdapterWarpDataLoader, WarpChainAccount, WarpChainAction, WarpDataLoaderOptions, AdapterWarpExecutor, WarpExecutable, WarpExecution, WarpActionInputType, AdapterWarpExplorer, AdapterWarpResults, Warp, ResolvedInput, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpNativeValue, BaseWarpActionInputType, WarpAdapterGenericType } from '@vleap/warps';
1
+ import { WarpChainAsset, AdapterFactory, WarpClientConfig, Adapter, WarpChain, WarpChainEnv, WarpChainInfo, AdapterWarpDataLoader, WarpChainAccount, WarpChainAction, WarpDataLoaderOptions, AdapterWarpExecutor, WarpExecutable, WarpExecution, AdapterWarpExplorer, AdapterWarpResults, Warp, ResolvedInput, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpActionInputType, WarpNativeValue, BaseWarpActionInputType, WarpAdapterGenericType, WarpCache } from '@vleap/warps';
2
2
  import { ethers } from 'ethers';
3
3
 
4
4
  declare const NativeTokenArb: WarpChainAsset;
@@ -72,21 +72,9 @@ declare const EvmExplorers: {
72
72
  };
73
73
  declare const ExplorerUrls: Record<ExplorerName, string>;
74
74
 
75
- interface TokenInfo$1 {
76
- name?: string;
77
- symbol?: string;
78
- logoURI?: string;
79
- decimals?: number;
80
- }
81
- declare class EvmLogoService {
82
- static getTokenInfo(chainName: string, tokenAddress: string): Promise<TokenInfo$1>;
83
- static getLogoUrl(chainName: string, tokenAddress: string, tokenName?: string, tokenSymbol?: string): Promise<string>;
84
- private static fetchFromTokenLists;
85
- private static fetchFromDefiLlama;
86
- private static fetchFromTrustWallet;
87
- static clearCache(): void;
88
- static getCacheSize(): number;
89
- }
75
+ declare const KnownTokens: Record<WarpChain, Record<string, WarpChainAsset[]>>;
76
+ declare const findKnownTokenById: (chain: WarpChain, env: WarpChainEnv, id: string) => WarpChainAsset | null;
77
+ declare const getKnownTokensForChain: (chainName: string, env?: string) => WarpChainAsset[];
90
78
 
91
79
  interface TokenMetadata {
92
80
  name: string;
@@ -105,6 +93,29 @@ interface TokenInfo {
105
93
  logoURI?: string;
106
94
  decimals?: number;
107
95
  }
96
+ interface UniswapToken {
97
+ chainId: number;
98
+ address: string;
99
+ name: string;
100
+ symbol: string;
101
+ decimals: number;
102
+ logoURI: string;
103
+ extensions?: {
104
+ bridgeInfo?: Record<string, {
105
+ tokenAddress: string;
106
+ }>;
107
+ };
108
+ }
109
+ interface UniswapTokenList {
110
+ name: string;
111
+ timestamp: string;
112
+ version: {
113
+ major: number;
114
+ minor: number;
115
+ patch: number;
116
+ };
117
+ tokens: UniswapToken[];
118
+ }
108
119
  interface TokenListResponse {
109
120
  tokens: Array<{
110
121
  chainId: number;
@@ -120,6 +131,8 @@ declare class WarpEvmDataLoader implements AdapterWarpDataLoader {
120
131
  private readonly config;
121
132
  private readonly chain;
122
133
  private provider;
134
+ private cache;
135
+ private uniswapService;
123
136
  constructor(config: WarpClientConfig, chain: WarpChainInfo);
124
137
  getAccount(address: string): Promise<WarpChainAccount>;
125
138
  getAccountAssets(address: string): Promise<WarpChainAsset[]>;
@@ -129,8 +142,6 @@ declare class WarpEvmDataLoader implements AdapterWarpDataLoader {
129
142
  private getERC20TokenBalances;
130
143
  private getTokenBalance;
131
144
  private getTokenMetadata;
132
- private detectTokensFromEvents;
133
- private getLogoUrl;
134
145
  }
135
146
 
136
147
  declare class WarpEvmExecutor implements AdapterWarpExecutor {
@@ -146,7 +157,6 @@ declare class WarpEvmExecutor implements AdapterWarpExecutor {
146
157
  private createTokenTransferTransaction;
147
158
  private createSingleTokenTransfer;
148
159
  executeQuery(executable: WarpExecutable): Promise<WarpExecution>;
149
- preprocessInput(chain: WarpChainInfo, input: string, type: WarpActionInputType, value: string): Promise<string>;
150
160
  private estimateGasAndSetDefaults;
151
161
  signMessage(message: string, privateKey: string): Promise<string>;
152
162
  verifyMessage(message: string, signature: string): Promise<string>;
@@ -204,4 +214,20 @@ declare class WarpEvmSerializer implements AdapterWarpSerializer {
204
214
  private parseNativeValue;
205
215
  }
206
216
 
207
- export { ArbitrumExplorers, BaseExplorers, EthereumExplorers, EvmExplorers, EvmLogoService, type ExplorerName, ExplorerUrls, NativeTokenArb, NativeTokenBase, NativeTokenEth, type TokenBalance, type TokenInfo, type TokenListResponse, type TokenMetadata, WarpEvmConstants, WarpEvmDataLoader, WarpEvmExecutor, WarpEvmExplorer, WarpEvmResults, WarpEvmSerializer, createEvmAdapter, getAllEvmAdapters, getAllEvmChainNames, getArbitrumAdapter, getBaseAdapter, getEthereumAdapter };
217
+ declare class UniswapService {
218
+ private static readonly UNISWAP_TOKEN_LIST_URL;
219
+ private cache;
220
+ private chainId;
221
+ constructor(cache: WarpCache, chainId: number);
222
+ getTokenList(): Promise<UniswapTokenList>;
223
+ findToken(address: string): Promise<UniswapToken | null>;
224
+ getTokenMetadata(address: string): Promise<{
225
+ name: string;
226
+ symbol: string;
227
+ decimals: number;
228
+ logoUrl: string;
229
+ } | null>;
230
+ getBridgeInfo(address: string): Promise<Record<string, string> | null>;
231
+ }
232
+
233
+ export { ArbitrumExplorers, BaseExplorers, EthereumExplorers, EvmExplorers, type ExplorerName, ExplorerUrls, KnownTokens, NativeTokenArb, NativeTokenBase, NativeTokenEth, type TokenBalance, type TokenInfo, type TokenListResponse, type TokenMetadata, UniswapService, type UniswapToken, type UniswapTokenList, WarpEvmConstants, WarpEvmDataLoader, WarpEvmExecutor, WarpEvmExplorer, WarpEvmResults, WarpEvmSerializer, createEvmAdapter, findKnownTokenById, getAllEvmAdapters, getAllEvmChainNames, getArbitrumAdapter, getBaseAdapter, getEthereumAdapter, getKnownTokensForChain };