wallaby-cash 2.0.1-rc.93 → 2.0.2
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/README.md +5 -3
- package/dist/base.d.ts +1 -1
- package/dist/generated/api.d.ts +5 -0
- package/dist/index.cjs.js +23 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +23 -10
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +23 -10
- package/dist/index.js.map +1 -1
- package/dist/lib/wallet/wallet-data.service.d.ts +2 -2
- package/dist/lib/wallet/wallet-handlers.service.d.ts +1 -1
- package/dist/package.json +12 -3
- package/dist/types/common.d.ts +9 -3
- package/dist/types/wallet.d.ts +4 -1
- package/package.json +12 -3
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ The SDK leverages Wallaby API as a gateway to web3 and the blockchain.
|
|
|
10
10
|
The SDK currently supports the following blockchains:
|
|
11
11
|
|
|
12
12
|
- Algorand
|
|
13
|
+
- Aptos
|
|
13
14
|
- Avalanche
|
|
14
15
|
- Base
|
|
15
16
|
- Binance chain
|
|
@@ -17,11 +18,12 @@ The SDK currently supports the following blockchains:
|
|
|
17
18
|
- Bsc
|
|
18
19
|
- Canton
|
|
19
20
|
- Ethereum
|
|
20
|
-
-
|
|
21
|
-
- Sui
|
|
21
|
+
- Hedera
|
|
22
22
|
- Injective
|
|
23
|
+
- Polygon
|
|
24
|
+
- Polymesh
|
|
23
25
|
- Sei
|
|
24
|
-
-
|
|
26
|
+
- Sui
|
|
25
27
|
|
|
26
28
|
## Install the SDK
|
|
27
29
|
|
package/dist/base.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WallabyConfig, RequestOptions, RequestRoute, WallabyConfigOptions
|
|
1
|
+
import { AuthType, WallabyConfig, RequestOptions, RequestRoute, WallabyConfigOptions } from './types';
|
|
2
2
|
import { StorageService } from './lib/utils/storage.service';
|
|
3
3
|
import { LocalStorage } from './types/storage';
|
|
4
4
|
import { LockManagerService } from './helpers/lock-manager.service';
|
package/dist/generated/api.d.ts
CHANGED
|
@@ -4685,6 +4685,11 @@ export interface UserDto {
|
|
|
4685
4685
|
* @example "6e464058-67c1-4273-a6a4-8aae522e34be"
|
|
4686
4686
|
*/
|
|
4687
4687
|
merchantId?: string;
|
|
4688
|
+
/**
|
|
4689
|
+
* User's Polymesh identity
|
|
4690
|
+
* @example "0x73ecca5cf1ecaa365a7d1f1e5dbc91737c73fe0a96b41386f574dfb915a913a7"
|
|
4691
|
+
*/
|
|
4692
|
+
polymeshDID: string;
|
|
4688
4693
|
/** @example "wallet_user" */
|
|
4689
4694
|
role: "super_admin" | "merchant_admin" | "merchant_user" | "wallet_user" | "contract_admin" | "reserve_admin" | "wallets_admin" | "transfer_admin" | "soft_burn_admin" | "mint_admin" | "automation_admin";
|
|
4690
4695
|
/**
|
package/dist/index.cjs.js
CHANGED
|
@@ -157,20 +157,23 @@ exports.BlockchainSlip44 = void 0;
|
|
|
157
157
|
BlockchainSlip44[BlockchainSlip44["INJ"] = 2525] = "INJ";
|
|
158
158
|
BlockchainSlip44[BlockchainSlip44["SEI"] = 19000118] = "SEI";
|
|
159
159
|
BlockchainSlip44[BlockchainSlip44["APT"] = 637] = "APT";
|
|
160
|
+
BlockchainSlip44[BlockchainSlip44["HBAR"] = 3030] = "HBAR";
|
|
161
|
+
BlockchainSlip44[BlockchainSlip44["POLYX"] = 595] = "POLYX";
|
|
160
162
|
})(exports.BlockchainSlip44 || (exports.BlockchainSlip44 = {}));
|
|
161
163
|
exports.BlockchainName = void 0;
|
|
162
164
|
(function (BlockchainName) {
|
|
163
165
|
BlockchainName["Algorand"] = "ALGORAND";
|
|
164
166
|
BlockchainName["Aptos"] = "APTOS";
|
|
165
167
|
BlockchainName["Avalanche"] = "AVALANCHE";
|
|
168
|
+
BlockchainName["Base"] = "BASE";
|
|
166
169
|
BlockchainName["Bitcoin"] = "BITCOIN";
|
|
170
|
+
BlockchainName["Bsc"] = "BSC";
|
|
167
171
|
BlockchainName["Canton"] = "CANTON";
|
|
168
172
|
BlockchainName["Ethereum"] = "ETHEREUM";
|
|
173
|
+
BlockchainName["Hedera"] = "HEDERA";
|
|
169
174
|
BlockchainName["Injective"] = "INJECTIVE";
|
|
170
175
|
BlockchainName["Polygon"] = "POLYGON";
|
|
171
176
|
BlockchainName["Polymesh"] = "POLYMESH";
|
|
172
|
-
BlockchainName["Bsc"] = "BSC";
|
|
173
|
-
BlockchainName["Base"] = "BASE";
|
|
174
177
|
BlockchainName["Sei"] = "SEI";
|
|
175
178
|
BlockchainName["Sui"] = "SUI";
|
|
176
179
|
})(exports.BlockchainName || (exports.BlockchainName = {}));
|
|
@@ -7015,7 +7018,7 @@ class Base {
|
|
|
7015
7018
|
* @returns Promise of <T> where T is the type of the response.
|
|
7016
7019
|
*/
|
|
7017
7020
|
async request(route, options) {
|
|
7018
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
7021
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
7019
7022
|
try {
|
|
7020
7023
|
let url;
|
|
7021
7024
|
if (typeof route.fullPath !== 'string') {
|
|
@@ -7037,8 +7040,15 @@ class Base {
|
|
|
7037
7040
|
headers,
|
|
7038
7041
|
});
|
|
7039
7042
|
http.interceptors.response.use((response) => response, (error) => {
|
|
7040
|
-
var _a;
|
|
7041
|
-
|
|
7043
|
+
var _a, _b, _c, _d, _e;
|
|
7044
|
+
if ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) {
|
|
7045
|
+
logger.info('SDK::Base::Interceptor::error.response.data', (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data);
|
|
7046
|
+
if (((_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.data.errorCode) && ((_d = error === null || error === void 0 ? void 0 : error.response) === null || _d === void 0 ? void 0 : _d.data.errorCode) !== exports.ErrorResponseCodes.user_already_exists) {
|
|
7047
|
+
return Promise.reject((_e = error === null || error === void 0 ? void 0 : error.response) === null || _e === void 0 ? void 0 : _e.data);
|
|
7048
|
+
}
|
|
7049
|
+
}
|
|
7050
|
+
logger.error('SDK::Base::Interceptor::error', error);
|
|
7051
|
+
return Promise.reject(error);
|
|
7042
7052
|
});
|
|
7043
7053
|
switch (route.method) {
|
|
7044
7054
|
case exports.RequestMethod.Get:
|
|
@@ -7066,6 +7076,9 @@ class Base {
|
|
|
7066
7076
|
if (((_e = error.response) === null || _e === void 0 ? void 0 : _e.data.errorCode) && error.response.data.errorCode === exports.ErrorResponseCodes.user_already_exists) {
|
|
7067
7077
|
return error.response.data;
|
|
7068
7078
|
}
|
|
7079
|
+
if (((_f = error.response) === null || _f === void 0 ? void 0 : _f.data.errorCode) && error.response.data.errorCode === exports.ErrorResponseCodes.user_already_exists) {
|
|
7080
|
+
return error.response.data;
|
|
7081
|
+
}
|
|
7069
7082
|
return Promise.reject(error.message);
|
|
7070
7083
|
}
|
|
7071
7084
|
logger.error('SDK::Base::RequestMethod.Post::error', error);
|
|
@@ -7079,8 +7092,8 @@ class Base {
|
|
|
7079
7092
|
}
|
|
7080
7093
|
catch (error) {
|
|
7081
7094
|
if (error instanceof axios.AxiosError) {
|
|
7082
|
-
logger.error('SDK::Base::RequestMethod.Put::error', (
|
|
7083
|
-
return Promise.reject((
|
|
7095
|
+
logger.error('SDK::Base::RequestMethod.Put::error', (_g = error.response) === null || _g === void 0 ? void 0 : _g.data);
|
|
7096
|
+
return Promise.reject((_h = error.response) === null || _h === void 0 ? void 0 : _h.data);
|
|
7084
7097
|
}
|
|
7085
7098
|
return Promise.reject(error === null || error === void 0 ? void 0 : error.message);
|
|
7086
7099
|
}
|
|
@@ -7092,8 +7105,8 @@ class Base {
|
|
|
7092
7105
|
}
|
|
7093
7106
|
catch (error) {
|
|
7094
7107
|
if (error instanceof axios.AxiosError) {
|
|
7095
|
-
logger.error('SDK::Base::RequestMethod.Put::AxiosError', (
|
|
7096
|
-
return Promise.reject((
|
|
7108
|
+
logger.error('SDK::Base::RequestMethod.Put::AxiosError', (_j = error.response) === null || _j === void 0 ? void 0 : _j.data);
|
|
7109
|
+
return Promise.reject((_k = error.response) === null || _k === void 0 ? void 0 : _k.data);
|
|
7097
7110
|
}
|
|
7098
7111
|
return Promise.reject(error === null || error === void 0 ? void 0 : error.message);
|
|
7099
7112
|
}
|
|
@@ -10053,7 +10066,7 @@ class WalletDataService extends Base {
|
|
|
10053
10066
|
* @public
|
|
10054
10067
|
* Fetches the balances for all tokens in a specific wallet.
|
|
10055
10068
|
* @param { string } walletId Wallet address
|
|
10056
|
-
* @returns { TokenBalanceResponse
|
|
10069
|
+
* @returns { TokenBalanceResponse } Returns an object containing the requested tokens balances.
|
|
10057
10070
|
*/
|
|
10058
10071
|
async getWalletBalances({ walletId }) {
|
|
10059
10072
|
try {
|