@vleap/warps-adapter-evm 0.2.0-alpha.24 → 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,32 +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
- }
90
-
91
- type KnownToken = {
92
- id: string;
93
- name: string;
94
- symbol: string;
95
- decimals: number;
96
- logoUrl?: string;
97
- };
98
- declare const KnownTokens: Record<string, Record<string, KnownToken[]>>;
99
- declare const findKnownTokenById: (chainName: string, id: string, env?: string) => KnownToken | null;
100
- declare const getKnownTokensForChain: (chainName: string, env?: string) => KnownToken[];
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[];
101
78
 
102
79
  interface TokenMetadata {
103
80
  name: string;
@@ -116,6 +93,29 @@ interface TokenInfo {
116
93
  logoURI?: string;
117
94
  decimals?: number;
118
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
+ }
119
119
  interface TokenListResponse {
120
120
  tokens: Array<{
121
121
  chainId: number;
@@ -131,6 +131,8 @@ declare class WarpEvmDataLoader implements AdapterWarpDataLoader {
131
131
  private readonly config;
132
132
  private readonly chain;
133
133
  private provider;
134
+ private cache;
135
+ private uniswapService;
134
136
  constructor(config: WarpClientConfig, chain: WarpChainInfo);
135
137
  getAccount(address: string): Promise<WarpChainAccount>;
136
138
  getAccountAssets(address: string): Promise<WarpChainAsset[]>;
@@ -140,8 +142,6 @@ declare class WarpEvmDataLoader implements AdapterWarpDataLoader {
140
142
  private getERC20TokenBalances;
141
143
  private getTokenBalance;
142
144
  private getTokenMetadata;
143
- private detectTokensFromEvents;
144
- private getLogoUrl;
145
145
  }
146
146
 
147
147
  declare class WarpEvmExecutor implements AdapterWarpExecutor {
@@ -157,7 +157,6 @@ declare class WarpEvmExecutor implements AdapterWarpExecutor {
157
157
  private createTokenTransferTransaction;
158
158
  private createSingleTokenTransfer;
159
159
  executeQuery(executable: WarpExecutable): Promise<WarpExecution>;
160
- preprocessInput(chain: WarpChainInfo, input: string, type: WarpActionInputType, value: string): Promise<string>;
161
160
  private estimateGasAndSetDefaults;
162
161
  signMessage(message: string, privateKey: string): Promise<string>;
163
162
  verifyMessage(message: string, signature: string): Promise<string>;
@@ -215,4 +214,20 @@ declare class WarpEvmSerializer implements AdapterWarpSerializer {
215
214
  private parseNativeValue;
216
215
  }
217
216
 
218
- export { ArbitrumExplorers, BaseExplorers, EthereumExplorers, EvmExplorers, EvmLogoService, type ExplorerName, ExplorerUrls, type KnownToken, KnownTokens, NativeTokenArb, NativeTokenBase, NativeTokenEth, type TokenBalance, type TokenInfo, type TokenListResponse, type TokenMetadata, WarpEvmConstants, WarpEvmDataLoader, WarpEvmExecutor, WarpEvmExplorer, WarpEvmResults, WarpEvmSerializer, createEvmAdapter, findKnownTokenById, getAllEvmAdapters, getAllEvmChainNames, getArbitrumAdapter, getBaseAdapter, getEthereumAdapter, getKnownTokensForChain };
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,32 +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
- }
90
-
91
- type KnownToken = {
92
- id: string;
93
- name: string;
94
- symbol: string;
95
- decimals: number;
96
- logoUrl?: string;
97
- };
98
- declare const KnownTokens: Record<string, Record<string, KnownToken[]>>;
99
- declare const findKnownTokenById: (chainName: string, id: string, env?: string) => KnownToken | null;
100
- declare const getKnownTokensForChain: (chainName: string, env?: string) => KnownToken[];
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[];
101
78
 
102
79
  interface TokenMetadata {
103
80
  name: string;
@@ -116,6 +93,29 @@ interface TokenInfo {
116
93
  logoURI?: string;
117
94
  decimals?: number;
118
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
+ }
119
119
  interface TokenListResponse {
120
120
  tokens: Array<{
121
121
  chainId: number;
@@ -131,6 +131,8 @@ declare class WarpEvmDataLoader implements AdapterWarpDataLoader {
131
131
  private readonly config;
132
132
  private readonly chain;
133
133
  private provider;
134
+ private cache;
135
+ private uniswapService;
134
136
  constructor(config: WarpClientConfig, chain: WarpChainInfo);
135
137
  getAccount(address: string): Promise<WarpChainAccount>;
136
138
  getAccountAssets(address: string): Promise<WarpChainAsset[]>;
@@ -140,8 +142,6 @@ declare class WarpEvmDataLoader implements AdapterWarpDataLoader {
140
142
  private getERC20TokenBalances;
141
143
  private getTokenBalance;
142
144
  private getTokenMetadata;
143
- private detectTokensFromEvents;
144
- private getLogoUrl;
145
145
  }
146
146
 
147
147
  declare class WarpEvmExecutor implements AdapterWarpExecutor {
@@ -157,7 +157,6 @@ declare class WarpEvmExecutor implements AdapterWarpExecutor {
157
157
  private createTokenTransferTransaction;
158
158
  private createSingleTokenTransfer;
159
159
  executeQuery(executable: WarpExecutable): Promise<WarpExecution>;
160
- preprocessInput(chain: WarpChainInfo, input: string, type: WarpActionInputType, value: string): Promise<string>;
161
160
  private estimateGasAndSetDefaults;
162
161
  signMessage(message: string, privateKey: string): Promise<string>;
163
162
  verifyMessage(message: string, signature: string): Promise<string>;
@@ -215,4 +214,20 @@ declare class WarpEvmSerializer implements AdapterWarpSerializer {
215
214
  private parseNativeValue;
216
215
  }
217
216
 
218
- export { ArbitrumExplorers, BaseExplorers, EthereumExplorers, EvmExplorers, EvmLogoService, type ExplorerName, ExplorerUrls, type KnownToken, KnownTokens, NativeTokenArb, NativeTokenBase, NativeTokenEth, type TokenBalance, type TokenInfo, type TokenListResponse, type TokenMetadata, WarpEvmConstants, WarpEvmDataLoader, WarpEvmExecutor, WarpEvmExplorer, WarpEvmResults, WarpEvmSerializer, createEvmAdapter, findKnownTokenById, getAllEvmAdapters, getAllEvmChainNames, getArbitrumAdapter, getBaseAdapter, getEthereumAdapter, getKnownTokensForChain };
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 };