@weblock-wallet/sdk 0.1.36 → 0.1.38
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.cjs +11 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +12 -63
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -104361,7 +104361,6 @@ var WalletService = class {
|
|
|
104361
104361
|
async getTokenBalance(tokenAddress, walletAddress, chainId) {
|
|
104362
104362
|
const erc20 = new import_ethers2.Interface(ERC20_ABI);
|
|
104363
104363
|
const data = erc20.encodeFunctionData("balanceOf", [walletAddress]);
|
|
104364
|
-
console.log("getTokenBalance data:", data);
|
|
104365
104364
|
const rawBalance = await this.rpcClient.sendRpc({
|
|
104366
104365
|
chainId,
|
|
104367
104366
|
method: "eth_call" /* ETH_CALL */,
|
|
@@ -104373,9 +104372,7 @@ var WalletService = class {
|
|
|
104373
104372
|
"latest"
|
|
104374
104373
|
]
|
|
104375
104374
|
});
|
|
104376
|
-
console.log("getTokenBalance rawBalance:", rawBalance);
|
|
104377
104375
|
const decimalsData = erc20.encodeFunctionData("decimals", []);
|
|
104378
|
-
console.log("getTokenBalance decimalsData:", decimalsData);
|
|
104379
104376
|
const decimalsRes = await this.rpcClient.sendRpc({
|
|
104380
104377
|
chainId,
|
|
104381
104378
|
method: "eth_call" /* ETH_CALL */,
|
|
@@ -104387,11 +104384,8 @@ var WalletService = class {
|
|
|
104387
104384
|
"latest"
|
|
104388
104385
|
]
|
|
104389
104386
|
});
|
|
104390
|
-
console.log("getTokenBalance decimalsRes:", decimalsRes);
|
|
104391
104387
|
const decimals = parseInt(decimalsRes.result, 16);
|
|
104392
|
-
console.log("getTokenBalance decimals:", decimals);
|
|
104393
104388
|
const symbolData = erc20.encodeFunctionData("symbol", []);
|
|
104394
|
-
console.log("getTokenBalance symbolData:", symbolData);
|
|
104395
104389
|
const symbolRes = await this.rpcClient.sendRpc({
|
|
104396
104390
|
chainId,
|
|
104397
104391
|
method: "eth_call" /* ETH_CALL */,
|
|
@@ -104403,9 +104397,7 @@ var WalletService = class {
|
|
|
104403
104397
|
"latest"
|
|
104404
104398
|
]
|
|
104405
104399
|
});
|
|
104406
|
-
console.log("getTokenBalance symbolRes:", symbolRes);
|
|
104407
104400
|
const symbol = erc20.decodeFunctionResult("symbol", symbolRes.result)[0];
|
|
104408
|
-
console.log("getTokenBalance symbol:", symbol);
|
|
104409
104401
|
return {
|
|
104410
104402
|
raw: rawBalance.result,
|
|
104411
104403
|
formatted: TokenAmount.format(rawBalance.result, decimals),
|
|
@@ -106173,31 +106165,31 @@ var WalletModule = class {
|
|
|
106173
106165
|
address,
|
|
106174
106166
|
network.chainId
|
|
106175
106167
|
);
|
|
106176
|
-
console.log("\uB124\uC774\uD2F0\uBE0C \
|
|
106177
|
-
const wftBalance = await this.core.wallet.getTokenBalance(
|
|
106178
|
-
"0x6fa62Eda03956ef4E54f3C8597E8c3f3bE40A45B",
|
|
106179
|
-
address,
|
|
106180
|
-
network.chainId
|
|
106181
|
-
);
|
|
106182
|
-
console.log(">>>> wftBalance: ", wftBalance);
|
|
106168
|
+
console.log("\uB124\uC774\uD2F0\uBE0C \uCF54\uC778 \uC794\uC561:", nativeBalance);
|
|
106183
106169
|
const rbtBalance = await this.core.wallet.getTokenBalance(
|
|
106184
106170
|
"0xB10536cC40Cb6E6415f70d3a4C1AF7Fa638AE829",
|
|
106185
106171
|
address,
|
|
106186
106172
|
network.chainId
|
|
106187
106173
|
);
|
|
106188
|
-
console.log("
|
|
106174
|
+
console.log("RBT \uC794\uC561:", rbtBalance);
|
|
106189
106175
|
const usdrBalance = await this.core.wallet.getTokenBalance(
|
|
106190
106176
|
"0x8d335fe5B30e27F2B21F057a4766cf4BB8c30785",
|
|
106191
106177
|
address,
|
|
106192
106178
|
network.chainId
|
|
106193
106179
|
);
|
|
106194
|
-
console.log("
|
|
106180
|
+
console.log("USDR \uC794\uC561:", usdrBalance);
|
|
106181
|
+
const wftBalance = await this.core.wallet.getTokenBalance(
|
|
106182
|
+
"0x6fa62Eda03956ef4E54f3C8597E8c3f3bE40A45B",
|
|
106183
|
+
address,
|
|
106184
|
+
network.chainId
|
|
106185
|
+
);
|
|
106186
|
+
console.log("WFT \uC794\uC561:", wftBalance);
|
|
106195
106187
|
const usdtBalance = await this.core.wallet.getTokenBalance(
|
|
106196
106188
|
"0xfF54B9ebe777f528E64C74bc95c68433B7546038",
|
|
106197
106189
|
address,
|
|
106198
106190
|
network.chainId
|
|
106199
106191
|
);
|
|
106200
|
-
console.log("
|
|
106192
|
+
console.log("USDT \uC794\uC561:", usdtBalance);
|
|
106201
106193
|
console.log("5. \uCD5C\uADFC \uD2B8\uB79C\uC7AD\uC158 \uC870\uD68C \uC2DC\uC791");
|
|
106202
106194
|
const latestTransaction = await this.core.wallet.getLatestTransaction(
|
|
106203
106195
|
address,
|
|
@@ -106216,40 +106208,7 @@ var WalletModule = class {
|
|
|
106216
106208
|
balance: nativeBalance,
|
|
106217
106209
|
decimals: 18
|
|
106218
106210
|
},
|
|
106219
|
-
tokens: [
|
|
106220
|
-
{
|
|
106221
|
-
symbol: wftBalance.symbol,
|
|
106222
|
-
name: "WeBlock Foundation Token",
|
|
106223
|
-
address: "0x6fa62Eda03956ef4E54f3C8597E8c3f3bE40A45B",
|
|
106224
|
-
balance: wftBalance,
|
|
106225
|
-
decimals: wftBalance.decimals,
|
|
106226
|
-
totalSupply: wftBalance
|
|
106227
|
-
},
|
|
106228
|
-
{
|
|
106229
|
-
symbol: rbtBalance.symbol,
|
|
106230
|
-
name: "Real estate Backed Token",
|
|
106231
|
-
address: "0xB10536cC40Cb6E6415f70d3a4C1AF7Fa638AE829",
|
|
106232
|
-
balance: rbtBalance,
|
|
106233
|
-
decimals: rbtBalance.decimals,
|
|
106234
|
-
totalSupply: rbtBalance
|
|
106235
|
-
},
|
|
106236
|
-
{
|
|
106237
|
-
symbol: usdrBalance.symbol,
|
|
106238
|
-
name: "USD Real estate",
|
|
106239
|
-
address: "0x8d335fe5B30e27F2B21F057a4766cf4BB8c30785",
|
|
106240
|
-
balance: usdrBalance,
|
|
106241
|
-
decimals: usdrBalance.decimals,
|
|
106242
|
-
totalSupply: usdrBalance
|
|
106243
|
-
},
|
|
106244
|
-
{
|
|
106245
|
-
symbol: usdtBalance.symbol,
|
|
106246
|
-
name: "Temp USDT",
|
|
106247
|
-
address: "0xfF54B9ebe777f528E64C74bc95c68433B7546038",
|
|
106248
|
-
balance: usdtBalance,
|
|
106249
|
-
decimals: usdtBalance.decimals,
|
|
106250
|
-
totalSupply: usdtBalance
|
|
106251
|
-
}
|
|
106252
|
-
],
|
|
106211
|
+
tokens: [],
|
|
106253
106212
|
nfts: [],
|
|
106254
106213
|
securities: []
|
|
106255
106214
|
},
|
|
@@ -106269,9 +106228,6 @@ var WalletModule = class {
|
|
|
106269
106228
|
async getBalance(address, chainId) {
|
|
106270
106229
|
return this.core.wallet.getBalance(address, chainId);
|
|
106271
106230
|
}
|
|
106272
|
-
async getTokenBalance(address, tokenAddress, chainId) {
|
|
106273
|
-
return this.core.wallet.getTokenBalance(address, tokenAddress, chainId);
|
|
106274
|
-
}
|
|
106275
106231
|
async getTransactionCount(address, chainId) {
|
|
106276
106232
|
return this.core.wallet.getTransactionCount(address, chainId);
|
|
106277
106233
|
}
|
|
@@ -106451,13 +106407,6 @@ var WeBlockSDK = class {
|
|
|
106451
106407
|
getBalance: (address, chainId) => {
|
|
106452
106408
|
return this.walletModule.getBalance(address, chainId);
|
|
106453
106409
|
},
|
|
106454
|
-
getTokenBalance: (tokenAddress, walletAddress, chainId) => {
|
|
106455
|
-
return this.walletModule.getTokenBalance(
|
|
106456
|
-
tokenAddress,
|
|
106457
|
-
walletAddress,
|
|
106458
|
-
chainId
|
|
106459
|
-
);
|
|
106460
|
-
},
|
|
106461
106410
|
getTransactionCount: (address, chainId) => {
|
|
106462
106411
|
return this.walletModule.getTransactionCount(address, chainId);
|
|
106463
106412
|
},
|