@weblock-wallet/sdk 0.1.31 → 0.1.33
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 +67 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +67 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -104586,6 +104586,9 @@ var NetworkService = class {
|
|
|
104586
104586
|
throw new SDKError("Failed to switch network", "NETWORK_ERROR" /* NETWORK_ERROR */);
|
|
104587
104587
|
}
|
|
104588
104588
|
}
|
|
104589
|
+
async getRegisteredTokenList(blockchainId) {
|
|
104590
|
+
return await this.userClient.getRegisteredCoins(blockchainId);
|
|
104591
|
+
}
|
|
104589
104592
|
/**
|
|
104590
104593
|
* 현재 네트워크 초기화
|
|
104591
104594
|
*/
|
|
@@ -106006,7 +106009,8 @@ var InternalCoreImpl = class {
|
|
|
106006
106009
|
getRegisteredNetworks: () => this.networkService.getRegisteredNetworks(),
|
|
106007
106010
|
registerNetwork: (params) => this.networkService.registerNetwork(params),
|
|
106008
106011
|
switchNetwork: (networkId) => this.networkService.switchNetwork(networkId),
|
|
106009
|
-
getCurrentNetwork: () => this.networkService.getCurrentNetwork()
|
|
106012
|
+
getCurrentNetwork: () => this.networkService.getCurrentNetwork(),
|
|
106013
|
+
getRegisteredTokenList: (networkId) => this.networkService.getRegisteredTokenList(networkId)
|
|
106010
106014
|
};
|
|
106011
106015
|
this.asset = {
|
|
106012
106016
|
transfer: (params) => this.assetService.transfer(params),
|
|
@@ -106124,9 +106128,9 @@ var WalletModule = class {
|
|
|
106124
106128
|
this.options = options;
|
|
106125
106129
|
this.core = core;
|
|
106126
106130
|
}
|
|
106127
|
-
async getInfo(
|
|
106131
|
+
async getInfo() {
|
|
106128
106132
|
try {
|
|
106129
|
-
console.log("1. \uB85C\uADF8\uC778 \uC0C1\uD0DC \uD655\uC778 \uC2DC\uC791
|
|
106133
|
+
console.log("1. \uB85C\uADF8\uC778 \uC0C1\uD0DC \uD655\uC778 \uC2DC\uC791");
|
|
106130
106134
|
const isLoggedIn = await this.core.auth.isLoggedIn();
|
|
106131
106135
|
console.log("\uB85C\uADF8\uC778 \uC0C1\uD0DC:", isLoggedIn);
|
|
106132
106136
|
if (!isLoggedIn) {
|
|
@@ -106166,12 +106170,30 @@ var WalletModule = class {
|
|
|
106166
106170
|
network.chainId
|
|
106167
106171
|
);
|
|
106168
106172
|
console.log("\uB124\uC774\uD2F0\uBE0C \uD1A0\uD070 \uC794\uC561:", nativeBalance);
|
|
106169
|
-
const
|
|
106173
|
+
const wftBalance = await this.core.wallet.getTokenBalance(
|
|
106170
106174
|
"0x6fa62Eda03956ef4E54f3C8597E8c3f3bE40A45B",
|
|
106171
|
-
|
|
106175
|
+
address,
|
|
106172
106176
|
network.chainId
|
|
106173
106177
|
);
|
|
106174
|
-
console.log(">>>>
|
|
106178
|
+
console.log(">>>> wftBalance: ", wftBalance);
|
|
106179
|
+
const rbtBalance = await this.core.wallet.getTokenBalance(
|
|
106180
|
+
"0xB10536cC40Cb6E6415f70d3a4C1AF7Fa638AE829",
|
|
106181
|
+
address,
|
|
106182
|
+
network.chainId
|
|
106183
|
+
);
|
|
106184
|
+
console.log(">>>> rbtBalance: ", rbtBalance);
|
|
106185
|
+
const usdrBalance = await this.core.wallet.getTokenBalance(
|
|
106186
|
+
"0x8d335fe5B30e27F2B21F057a4766cf4BB8c30785",
|
|
106187
|
+
address,
|
|
106188
|
+
network.chainId
|
|
106189
|
+
);
|
|
106190
|
+
console.log(">>>> usdrBalance: ", usdrBalance);
|
|
106191
|
+
const usdtBalance = await this.core.wallet.getTokenBalance(
|
|
106192
|
+
"0xfF54B9ebe777f528E64C74bc95c68433B7546038",
|
|
106193
|
+
address,
|
|
106194
|
+
network.chainId
|
|
106195
|
+
);
|
|
106196
|
+
console.log(">>>> usdtBalance: ", usdtBalance);
|
|
106175
106197
|
console.log("5. \uCD5C\uADFC \uD2B8\uB79C\uC7AD\uC158 \uC870\uD68C \uC2DC\uC791");
|
|
106176
106198
|
const latestTransaction = await this.core.wallet.getLatestTransaction(
|
|
106177
106199
|
address,
|
|
@@ -106190,7 +106212,40 @@ var WalletModule = class {
|
|
|
106190
106212
|
balance: nativeBalance,
|
|
106191
106213
|
decimals: 18
|
|
106192
106214
|
},
|
|
106193
|
-
tokens: [
|
|
106215
|
+
tokens: [
|
|
106216
|
+
{
|
|
106217
|
+
symbol: wftBalance.symbol,
|
|
106218
|
+
name: "WeBlock Foundation Token",
|
|
106219
|
+
address: "0x6fa62Eda03956ef4E54f3C8597E8c3f3bE40A45B",
|
|
106220
|
+
balance: wftBalance,
|
|
106221
|
+
decimals: wftBalance.decimals,
|
|
106222
|
+
totalSupply: wftBalance
|
|
106223
|
+
},
|
|
106224
|
+
{
|
|
106225
|
+
symbol: rbtBalance.symbol,
|
|
106226
|
+
name: "Real estate Backed Token",
|
|
106227
|
+
address: "0xB10536cC40Cb6E6415f70d3a4C1AF7Fa638AE829",
|
|
106228
|
+
balance: rbtBalance,
|
|
106229
|
+
decimals: rbtBalance.decimals,
|
|
106230
|
+
totalSupply: rbtBalance
|
|
106231
|
+
},
|
|
106232
|
+
{
|
|
106233
|
+
symbol: usdrBalance.symbol,
|
|
106234
|
+
name: "USD Real estate",
|
|
106235
|
+
address: "0x8d335fe5B30e27F2B21F057a4766cf4BB8c30785",
|
|
106236
|
+
balance: usdrBalance,
|
|
106237
|
+
decimals: usdrBalance.decimals,
|
|
106238
|
+
totalSupply: usdrBalance
|
|
106239
|
+
},
|
|
106240
|
+
{
|
|
106241
|
+
symbol: usdtBalance.symbol,
|
|
106242
|
+
name: "Temp USDT",
|
|
106243
|
+
address: "0xfF54B9ebe777f528E64C74bc95c68433B7546038",
|
|
106244
|
+
balance: usdtBalance,
|
|
106245
|
+
decimals: usdtBalance.decimals,
|
|
106246
|
+
totalSupply: usdtBalance
|
|
106247
|
+
}
|
|
106248
|
+
],
|
|
106194
106249
|
nfts: [],
|
|
106195
106250
|
securities: []
|
|
106196
106251
|
},
|
|
@@ -106359,6 +106414,9 @@ var NetworkModule = class {
|
|
|
106359
106414
|
async switchNetwork(networkId) {
|
|
106360
106415
|
await this.core.network.switchNetwork(networkId);
|
|
106361
106416
|
}
|
|
106417
|
+
async getRegisteredTokenList(blockchainId) {
|
|
106418
|
+
return this.core.network.getRegisteredTokenList(blockchainId);
|
|
106419
|
+
}
|
|
106362
106420
|
};
|
|
106363
106421
|
|
|
106364
106422
|
// src/index.ts
|
|
@@ -106380,8 +106438,8 @@ var WeBlockSDK = class {
|
|
|
106380
106438
|
}
|
|
106381
106439
|
};
|
|
106382
106440
|
this.wallet = {
|
|
106383
|
-
getInfo: async (
|
|
106384
|
-
return this.walletModule.getInfo(
|
|
106441
|
+
getInfo: async () => {
|
|
106442
|
+
return this.walletModule.getInfo();
|
|
106385
106443
|
},
|
|
106386
106444
|
onWalletUpdate: (callback) => {
|
|
106387
106445
|
return this.walletModule.onWalletUpdate(callback);
|