@weblock-wallet/sdk 0.1.54 → 0.1.56
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 +28 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -4
- package/dist/index.d.ts +3 -4
- package/dist/index.js +28 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -104519,9 +104519,14 @@ var WalletService = class {
|
|
|
104519
104519
|
});
|
|
104520
104520
|
const network = await this.networkService.getCurrentNetwork();
|
|
104521
104521
|
const decimals = network?.decimals || DECIMALS.ETH;
|
|
104522
|
+
const formatted = TokenAmount.format(response.result, decimals);
|
|
104522
104523
|
return {
|
|
104523
104524
|
raw: response.result,
|
|
104524
|
-
|
|
104525
|
+
// aliases (helpful for apps that expect numeric fields)
|
|
104526
|
+
balanceWei: response.result,
|
|
104527
|
+
result: response.result,
|
|
104528
|
+
formatted,
|
|
104529
|
+
balance: formatted,
|
|
104525
104530
|
decimals,
|
|
104526
104531
|
symbol: network?.symbol || "ETH"
|
|
104527
104532
|
};
|
|
@@ -105059,7 +105064,12 @@ var UserClient = class {
|
|
|
105059
105064
|
try {
|
|
105060
105065
|
const res = await this.client.post(
|
|
105061
105066
|
`${this.baseUrl}/register-token`,
|
|
105062
|
-
body
|
|
105067
|
+
body,
|
|
105068
|
+
{
|
|
105069
|
+
// register-token 은 사용자 컨텍스트가 필요한 엔드포인트이므로
|
|
105070
|
+
// 반드시 Authorization: Bearer <JWT> 가 포함되어야 한다.
|
|
105071
|
+
needsAccessToken: true
|
|
105072
|
+
}
|
|
105063
105073
|
);
|
|
105064
105074
|
const coin = this.unwrapCoin(res);
|
|
105065
105075
|
if (!coin?.contractAddress) {
|
|
@@ -106836,6 +106846,22 @@ var KNOWN_NETWORKS = {
|
|
|
106836
106846
|
currencyDecimals: 18,
|
|
106837
106847
|
explorerUrl: "https://polygonscan.com",
|
|
106838
106848
|
isTestnet: false
|
|
106849
|
+
},
|
|
106850
|
+
43114: {
|
|
106851
|
+
chainId: 43114,
|
|
106852
|
+
currencySymbol: "AVAX",
|
|
106853
|
+
currencyName: "Avalanche",
|
|
106854
|
+
currencyDecimals: 18,
|
|
106855
|
+
explorerUrl: "https://snowtrace.io",
|
|
106856
|
+
isTestnet: false
|
|
106857
|
+
},
|
|
106858
|
+
43113: {
|
|
106859
|
+
chainId: 43113,
|
|
106860
|
+
currencySymbol: "AVAX",
|
|
106861
|
+
currencyName: "Avalanche Fuji",
|
|
106862
|
+
currencyDecimals: 18,
|
|
106863
|
+
explorerUrl: "https://testnet.snowtrace.io",
|
|
106864
|
+
isTestnet: true
|
|
106839
106865
|
}
|
|
106840
106866
|
};
|
|
106841
106867
|
var DEFAULT_NETWORK_PARAMS = {
|