@joai/warps-adapter-evm 1.2.0 → 1.3.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.
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +57 -48
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -197,10 +197,13 @@ declare class WarpEvmDataLoader implements AdapterWarpDataLoader {
|
|
|
197
197
|
private uniswapService;
|
|
198
198
|
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
199
199
|
private getRequiredConfirmations;
|
|
200
|
+
private static readonly ChainsWithoutNativeBalance;
|
|
201
|
+
private hasNativeBalance;
|
|
200
202
|
getAccount(address: string): Promise<WarpChainAccount>;
|
|
201
203
|
getAccountAssets(address: string): Promise<WarpChainAsset[]>;
|
|
202
204
|
getAsset(identifier: string): Promise<WarpChainAsset | null>;
|
|
203
205
|
getAction(identifier: string, awaitCompleted?: boolean): Promise<WarpChainAction | null>;
|
|
206
|
+
getAccountNfts(address: string, options?: WarpDataLoaderOptions): Promise<WarpChainAsset[]>;
|
|
204
207
|
getAccountActions(address: string, options?: WarpDataLoaderOptions): Promise<WarpChainAction[]>;
|
|
205
208
|
private getERC20TokenBalances;
|
|
206
209
|
private getTokenBalance;
|
package/dist/index.d.ts
CHANGED
|
@@ -197,10 +197,13 @@ declare class WarpEvmDataLoader implements AdapterWarpDataLoader {
|
|
|
197
197
|
private uniswapService;
|
|
198
198
|
constructor(config: WarpClientConfig, chain: WarpChainInfo);
|
|
199
199
|
private getRequiredConfirmations;
|
|
200
|
+
private static readonly ChainsWithoutNativeBalance;
|
|
201
|
+
private hasNativeBalance;
|
|
200
202
|
getAccount(address: string): Promise<WarpChainAccount>;
|
|
201
203
|
getAccountAssets(address: string): Promise<WarpChainAsset[]>;
|
|
202
204
|
getAsset(identifier: string): Promise<WarpChainAsset | null>;
|
|
203
205
|
getAction(identifier: string, awaitCompleted?: boolean): Promise<WarpChainAction | null>;
|
|
206
|
+
getAccountNfts(address: string, options?: WarpDataLoaderOptions): Promise<WarpChainAsset[]>;
|
|
204
207
|
getAccountActions(address: string, options?: WarpDataLoaderOptions): Promise<WarpChainAction[]>;
|
|
205
208
|
private getERC20TokenBalances;
|
|
206
209
|
private getTokenBalance;
|
package/dist/index.js
CHANGED
|
@@ -908,7 +908,7 @@ var ERC20_ABI = [
|
|
|
908
908
|
"function symbol() view returns (string)",
|
|
909
909
|
"function totalSupply() view returns (uint256)"
|
|
910
910
|
];
|
|
911
|
-
var
|
|
911
|
+
var _WarpEvmDataLoader = class _WarpEvmDataLoader {
|
|
912
912
|
constructor(config, chain) {
|
|
913
913
|
this.config = config;
|
|
914
914
|
this.chain = chain;
|
|
@@ -924,8 +924,11 @@ var WarpEvmDataLoader = class {
|
|
|
924
924
|
}
|
|
925
925
|
return 1;
|
|
926
926
|
}
|
|
927
|
+
hasNativeBalance() {
|
|
928
|
+
return !_WarpEvmDataLoader.ChainsWithoutNativeBalance.includes(this.chain.name);
|
|
929
|
+
}
|
|
927
930
|
async getAccount(address) {
|
|
928
|
-
const balance = await this.provider.getBalance(address);
|
|
931
|
+
const balance = this.hasNativeBalance() ? await this.provider.getBalance(address) : 0n;
|
|
929
932
|
return {
|
|
930
933
|
chain: this.chain.name,
|
|
931
934
|
address,
|
|
@@ -935,7 +938,7 @@ var WarpEvmDataLoader = class {
|
|
|
935
938
|
async getAccountAssets(address) {
|
|
936
939
|
const account = await this.getAccount(address);
|
|
937
940
|
const tokenBalances = await this.getERC20TokenBalances(address);
|
|
938
|
-
let assets = account.balance > 0 ? [{ ...this.chain.nativeToken, amount: account.balance }] : [];
|
|
941
|
+
let assets = this.hasNativeBalance() && account.balance > 0 ? [{ ...this.chain.nativeToken, amount: account.balance }] : [];
|
|
939
942
|
for (const tokenBalance of tokenBalances) {
|
|
940
943
|
if (tokenBalance.balance > 0n) {
|
|
941
944
|
assets.push({
|
|
@@ -1041,6 +1044,9 @@ var WarpEvmDataLoader = class {
|
|
|
1041
1044
|
return null;
|
|
1042
1045
|
}
|
|
1043
1046
|
}
|
|
1047
|
+
async getAccountNfts(address, options) {
|
|
1048
|
+
return [];
|
|
1049
|
+
}
|
|
1044
1050
|
async getAccountActions(address, options) {
|
|
1045
1051
|
return [];
|
|
1046
1052
|
}
|
|
@@ -1082,6 +1088,8 @@ var WarpEvmDataLoader = class {
|
|
|
1082
1088
|
};
|
|
1083
1089
|
}
|
|
1084
1090
|
};
|
|
1091
|
+
_WarpEvmDataLoader.ChainsWithoutNativeBalance = [import_warps16.WarpChainName.Tempo];
|
|
1092
|
+
var WarpEvmDataLoader = _WarpEvmDataLoader;
|
|
1085
1093
|
|
|
1086
1094
|
// src/WarpEvmExecutor.ts
|
|
1087
1095
|
var import_warps19 = require("@joai/warps");
|