@weblock-wallet/sdk 0.1.32 → 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.d.cts CHANGED
@@ -422,7 +422,7 @@ declare class WeBlockSDK {
422
422
  signOut: () => Promise<void>;
423
423
  };
424
424
  readonly wallet: {
425
- getInfo: (str: string) => Promise<WalletInfo>;
425
+ getInfo: () => Promise<WalletInfo>;
426
426
  onWalletUpdate: (callback: (wallet: WalletInfo) => void) => (() => void);
427
427
  onTransactionUpdate: (callback: (tx: Transaction | undefined) => void) => (() => void);
428
428
  getBalance: (address: string, chainId: number) => Promise<TokenBalance>;
package/dist/index.d.ts CHANGED
@@ -422,7 +422,7 @@ declare class WeBlockSDK {
422
422
  signOut: () => Promise<void>;
423
423
  };
424
424
  readonly wallet: {
425
- getInfo: (str: string) => Promise<WalletInfo>;
425
+ getInfo: () => Promise<WalletInfo>;
426
426
  onWalletUpdate: (callback: (wallet: WalletInfo) => void) => (() => void);
427
427
  onTransactionUpdate: (callback: (tx: Transaction | undefined) => void) => (() => void);
428
428
  getBalance: (address: string, chainId: number) => Promise<TokenBalance>;
package/dist/index.js CHANGED
@@ -104541,6 +104541,9 @@ var NetworkService = class {
104541
104541
  throw new SDKError("Failed to switch network", "NETWORK_ERROR" /* NETWORK_ERROR */);
104542
104542
  }
104543
104543
  }
104544
+ async getRegisteredTokenList(blockchainId) {
104545
+ return await this.userClient.getRegisteredCoins(blockchainId);
104546
+ }
104544
104547
  /**
104545
104548
  * 현재 네트워크 초기화
104546
104549
  */
@@ -105965,7 +105968,8 @@ var InternalCoreImpl = class {
105965
105968
  getRegisteredNetworks: () => this.networkService.getRegisteredNetworks(),
105966
105969
  registerNetwork: (params) => this.networkService.registerNetwork(params),
105967
105970
  switchNetwork: (networkId) => this.networkService.switchNetwork(networkId),
105968
- getCurrentNetwork: () => this.networkService.getCurrentNetwork()
105971
+ getCurrentNetwork: () => this.networkService.getCurrentNetwork(),
105972
+ getRegisteredTokenList: (networkId) => this.networkService.getRegisteredTokenList(networkId)
105969
105973
  };
105970
105974
  this.asset = {
105971
105975
  transfer: (params) => this.assetService.transfer(params),
@@ -106083,9 +106087,9 @@ var WalletModule = class {
106083
106087
  this.options = options;
106084
106088
  this.core = core;
106085
106089
  }
106086
- async getInfo(str) {
106090
+ async getInfo() {
106087
106091
  try {
106088
- console.log("1. \uB85C\uADF8\uC778 \uC0C1\uD0DC \uD655\uC778 \uC2DC\uC791: ", str);
106092
+ console.log("1. \uB85C\uADF8\uC778 \uC0C1\uD0DC \uD655\uC778 \uC2DC\uC791");
106089
106093
  const isLoggedIn = await this.core.auth.isLoggedIn();
106090
106094
  console.log("\uB85C\uADF8\uC778 \uC0C1\uD0DC:", isLoggedIn);
106091
106095
  if (!isLoggedIn) {
@@ -106125,12 +106129,30 @@ var WalletModule = class {
106125
106129
  network.chainId
106126
106130
  );
106127
106131
  console.log("\uB124\uC774\uD2F0\uBE0C \uD1A0\uD070 \uC794\uC561:", nativeBalance);
106128
- const tokenBalance = await this.core.wallet.getTokenBalance(
106132
+ const wftBalance = await this.core.wallet.getTokenBalance(
106129
106133
  "0x6fa62Eda03956ef4E54f3C8597E8c3f3bE40A45B",
106130
- "0x57a0799F04246DC7119AEd7c64fD2675b769FEff",
106134
+ address,
106131
106135
  network.chainId
106132
106136
  );
106133
- console.log(">>>> tokenBalance: ", tokenBalance);
106137
+ console.log(">>>> wftBalance: ", wftBalance);
106138
+ const rbtBalance = await this.core.wallet.getTokenBalance(
106139
+ "0xB10536cC40Cb6E6415f70d3a4C1AF7Fa638AE829",
106140
+ address,
106141
+ network.chainId
106142
+ );
106143
+ console.log(">>>> rbtBalance: ", rbtBalance);
106144
+ const usdrBalance = await this.core.wallet.getTokenBalance(
106145
+ "0x8d335fe5B30e27F2B21F057a4766cf4BB8c30785",
106146
+ address,
106147
+ network.chainId
106148
+ );
106149
+ console.log(">>>> usdrBalance: ", usdrBalance);
106150
+ const usdtBalance = await this.core.wallet.getTokenBalance(
106151
+ "0xfF54B9ebe777f528E64C74bc95c68433B7546038",
106152
+ address,
106153
+ network.chainId
106154
+ );
106155
+ console.log(">>>> usdtBalance: ", usdtBalance);
106134
106156
  console.log("5. \uCD5C\uADFC \uD2B8\uB79C\uC7AD\uC158 \uC870\uD68C \uC2DC\uC791");
106135
106157
  const latestTransaction = await this.core.wallet.getLatestTransaction(
106136
106158
  address,
@@ -106149,7 +106171,40 @@ var WalletModule = class {
106149
106171
  balance: nativeBalance,
106150
106172
  decimals: 18
106151
106173
  },
106152
- tokens: [],
106174
+ tokens: [
106175
+ {
106176
+ symbol: wftBalance.symbol,
106177
+ name: "WeBlock Foundation Token",
106178
+ address: "0x6fa62Eda03956ef4E54f3C8597E8c3f3bE40A45B",
106179
+ balance: wftBalance,
106180
+ decimals: wftBalance.decimals,
106181
+ totalSupply: wftBalance
106182
+ },
106183
+ {
106184
+ symbol: rbtBalance.symbol,
106185
+ name: "Real estate Backed Token",
106186
+ address: "0xB10536cC40Cb6E6415f70d3a4C1AF7Fa638AE829",
106187
+ balance: rbtBalance,
106188
+ decimals: rbtBalance.decimals,
106189
+ totalSupply: rbtBalance
106190
+ },
106191
+ {
106192
+ symbol: usdrBalance.symbol,
106193
+ name: "USD Real estate",
106194
+ address: "0x8d335fe5B30e27F2B21F057a4766cf4BB8c30785",
106195
+ balance: usdrBalance,
106196
+ decimals: usdrBalance.decimals,
106197
+ totalSupply: usdrBalance
106198
+ },
106199
+ {
106200
+ symbol: usdtBalance.symbol,
106201
+ name: "Temp USDT",
106202
+ address: "0xfF54B9ebe777f528E64C74bc95c68433B7546038",
106203
+ balance: usdtBalance,
106204
+ decimals: usdtBalance.decimals,
106205
+ totalSupply: usdtBalance
106206
+ }
106207
+ ],
106153
106208
  nfts: [],
106154
106209
  securities: []
106155
106210
  },
@@ -106318,6 +106373,9 @@ var NetworkModule = class {
106318
106373
  async switchNetwork(networkId) {
106319
106374
  await this.core.network.switchNetwork(networkId);
106320
106375
  }
106376
+ async getRegisteredTokenList(blockchainId) {
106377
+ return this.core.network.getRegisteredTokenList(blockchainId);
106378
+ }
106321
106379
  };
106322
106380
 
106323
106381
  // src/index.ts
@@ -106339,8 +106397,8 @@ var WeBlockSDK = class {
106339
106397
  }
106340
106398
  };
106341
106399
  this.wallet = {
106342
- getInfo: async (str) => {
106343
- return this.walletModule.getInfo(str);
106400
+ getInfo: async () => {
106401
+ return this.walletModule.getInfo();
106344
106402
  },
106345
106403
  onWalletUpdate: (callback) => {
106346
106404
  return this.walletModule.onWalletUpdate(callback);