@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.d.cts
CHANGED
|
@@ -116,14 +116,13 @@ interface NetworkInfo {
|
|
|
116
116
|
* 토큰 잔액 정보
|
|
117
117
|
*/
|
|
118
118
|
interface TokenBalance {
|
|
119
|
-
/** 원본 값 (Wei) */
|
|
120
119
|
raw: string;
|
|
121
|
-
/** 변환된 값 */
|
|
122
120
|
formatted: string;
|
|
123
|
-
/** 소수점 자리수 */
|
|
124
121
|
decimals: number;
|
|
125
|
-
/** 토큰 심볼 */
|
|
126
122
|
symbol: string;
|
|
123
|
+
balanceWei?: string;
|
|
124
|
+
balance?: string;
|
|
125
|
+
result?: string;
|
|
127
126
|
}
|
|
128
127
|
/**
|
|
129
128
|
* 토큰 정보
|
package/dist/index.d.ts
CHANGED
|
@@ -116,14 +116,13 @@ interface NetworkInfo {
|
|
|
116
116
|
* 토큰 잔액 정보
|
|
117
117
|
*/
|
|
118
118
|
interface TokenBalance {
|
|
119
|
-
/** 원본 값 (Wei) */
|
|
120
119
|
raw: string;
|
|
121
|
-
/** 변환된 값 */
|
|
122
120
|
formatted: string;
|
|
123
|
-
/** 소수점 자리수 */
|
|
124
121
|
decimals: number;
|
|
125
|
-
/** 토큰 심볼 */
|
|
126
122
|
symbol: string;
|
|
123
|
+
balanceWei?: string;
|
|
124
|
+
balance?: string;
|
|
125
|
+
result?: string;
|
|
127
126
|
}
|
|
128
127
|
/**
|
|
129
128
|
* 토큰 정보
|
package/dist/index.js
CHANGED
|
@@ -104474,9 +104474,14 @@ var WalletService = class {
|
|
|
104474
104474
|
});
|
|
104475
104475
|
const network = await this.networkService.getCurrentNetwork();
|
|
104476
104476
|
const decimals = network?.decimals || DECIMALS.ETH;
|
|
104477
|
+
const formatted = TokenAmount.format(response.result, decimals);
|
|
104477
104478
|
return {
|
|
104478
104479
|
raw: response.result,
|
|
104479
|
-
|
|
104480
|
+
// aliases (helpful for apps that expect numeric fields)
|
|
104481
|
+
balanceWei: response.result,
|
|
104482
|
+
result: response.result,
|
|
104483
|
+
formatted,
|
|
104484
|
+
balance: formatted,
|
|
104480
104485
|
decimals,
|
|
104481
104486
|
symbol: network?.symbol || "ETH"
|
|
104482
104487
|
};
|
|
@@ -105018,7 +105023,12 @@ var UserClient = class {
|
|
|
105018
105023
|
try {
|
|
105019
105024
|
const res = await this.client.post(
|
|
105020
105025
|
`${this.baseUrl}/register-token`,
|
|
105021
|
-
body
|
|
105026
|
+
body,
|
|
105027
|
+
{
|
|
105028
|
+
// register-token 은 사용자 컨텍스트가 필요한 엔드포인트이므로
|
|
105029
|
+
// 반드시 Authorization: Bearer <JWT> 가 포함되어야 한다.
|
|
105030
|
+
needsAccessToken: true
|
|
105031
|
+
}
|
|
105022
105032
|
);
|
|
105023
105033
|
const coin = this.unwrapCoin(res);
|
|
105024
105034
|
if (!coin?.contractAddress) {
|
|
@@ -106795,6 +106805,22 @@ var KNOWN_NETWORKS = {
|
|
|
106795
106805
|
currencyDecimals: 18,
|
|
106796
106806
|
explorerUrl: "https://polygonscan.com",
|
|
106797
106807
|
isTestnet: false
|
|
106808
|
+
},
|
|
106809
|
+
43114: {
|
|
106810
|
+
chainId: 43114,
|
|
106811
|
+
currencySymbol: "AVAX",
|
|
106812
|
+
currencyName: "Avalanche",
|
|
106813
|
+
currencyDecimals: 18,
|
|
106814
|
+
explorerUrl: "https://snowtrace.io",
|
|
106815
|
+
isTestnet: false
|
|
106816
|
+
},
|
|
106817
|
+
43113: {
|
|
106818
|
+
chainId: 43113,
|
|
106819
|
+
currencySymbol: "AVAX",
|
|
106820
|
+
currencyName: "Avalanche Fuji",
|
|
106821
|
+
currencyDecimals: 18,
|
|
106822
|
+
explorerUrl: "https://testnet.snowtrace.io",
|
|
106823
|
+
isTestnet: true
|
|
106798
106824
|
}
|
|
106799
106825
|
};
|
|
106800
106826
|
var DEFAULT_NETWORK_PARAMS = {
|