wallaby-cash 1.7.9 → 1.7.10
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.js +64 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +64 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +64 -4
- package/dist/index.js.map +1 -1
- package/dist/lib/wallet/index.d.ts +15 -1
- package/dist/routes/wallet.d.ts +5 -0
- package/dist/types/common.d.ts +2 -1
- package/dist/types/wallet.d.ts +10 -0
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -54,6 +54,18 @@ var __assign = function() {
|
|
|
54
54
|
return __assign.apply(this, arguments);
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
+
function __rest(s, e) {
|
|
58
|
+
var t = {};
|
|
59
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
60
|
+
t[p] = s[p];
|
|
61
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
62
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
63
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
64
|
+
t[p[i]] = s[p[i]];
|
|
65
|
+
}
|
|
66
|
+
return t;
|
|
67
|
+
}
|
|
68
|
+
|
|
57
69
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
58
70
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
59
71
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -5243,6 +5255,11 @@ var WalletRoutes = {
|
|
|
5243
5255
|
method: exports.RequestMethod.Post,
|
|
5244
5256
|
requiresAccessToken: true,
|
|
5245
5257
|
},
|
|
5258
|
+
updateAsset: {
|
|
5259
|
+
fullPath: '/wallets/asset/update',
|
|
5260
|
+
method: exports.RequestMethod.Put,
|
|
5261
|
+
requiresAccessToken: true,
|
|
5262
|
+
},
|
|
5246
5263
|
getUserWallets: {
|
|
5247
5264
|
fullPath: function (_a) {
|
|
5248
5265
|
var userId = _a.userId;
|
|
@@ -6503,9 +6520,52 @@ var Wallet = /** @class */ (function (_super) {
|
|
|
6503
6520
|
});
|
|
6504
6521
|
});
|
|
6505
6522
|
};
|
|
6523
|
+
/**
|
|
6524
|
+
* Updates a wallet asset.
|
|
6525
|
+
*
|
|
6526
|
+
* @param {string} params.assetConfigId - Config ID for the user asset.
|
|
6527
|
+
* @param {string} params.walletId - Wallet ID to which the asset belongs.
|
|
6528
|
+
* @param {string} params.assetName - Asset name.
|
|
6529
|
+
* @param {boolean} params.isVisible - Asset visibility toggle.
|
|
6530
|
+
* @param {string} params.assetSymbol - Asset symbol.
|
|
6531
|
+
*
|
|
6532
|
+
* @returns {Promise<UpdateAssetResponse>} The response from updating the wallet token.
|
|
6533
|
+
*
|
|
6534
|
+
* @throws {Error} If required parameters are missing or invalid.
|
|
6535
|
+
*/
|
|
6536
|
+
Wallet.prototype.updateAsset = function (_a) {
|
|
6537
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
6538
|
+
var response, error_17;
|
|
6539
|
+
var assetConfigId = _a.assetConfigId, walletId = _a.walletId, assetConfig = __rest(_a, ["assetConfigId", "walletId"]);
|
|
6540
|
+
return __generator(this, function (_b) {
|
|
6541
|
+
switch (_b.label) {
|
|
6542
|
+
case 0:
|
|
6543
|
+
_b.trys.push([0, 2, , 3]);
|
|
6544
|
+
if (!assetConfigId || !walletId) {
|
|
6545
|
+
throw new Error('Missing required parameters');
|
|
6546
|
+
}
|
|
6547
|
+
return [4 /*yield*/, this.request(WalletRoutes.updateAsset, {
|
|
6548
|
+
method: WalletRoutes.updateAsset.method,
|
|
6549
|
+
payload: __assign({ assetConfigId: assetConfigId, walletId: walletId }, assetConfig),
|
|
6550
|
+
})];
|
|
6551
|
+
case 1:
|
|
6552
|
+
response = _b.sent();
|
|
6553
|
+
if (!response || response.errors) {
|
|
6554
|
+
throw new Error(response.errors);
|
|
6555
|
+
}
|
|
6556
|
+
return [2 /*return*/, response];
|
|
6557
|
+
case 2:
|
|
6558
|
+
error_17 = _b.sent();
|
|
6559
|
+
logger('SDK::Wallet::updateAsset::error', error_17);
|
|
6560
|
+
return [2 /*return*/, Promise.reject(error_17)];
|
|
6561
|
+
case 3: return [2 /*return*/];
|
|
6562
|
+
}
|
|
6563
|
+
});
|
|
6564
|
+
});
|
|
6565
|
+
};
|
|
6506
6566
|
Wallet.prototype.initRecoveryFlow = function (_a) {
|
|
6507
6567
|
return __awaiter(this, arguments, void 0, function (_b) {
|
|
6508
|
-
var initRecovery,
|
|
6568
|
+
var initRecovery, error_18;
|
|
6509
6569
|
var clientAuthPubKey = _b.clientAuthPubKey;
|
|
6510
6570
|
return __generator(this, function (_c) {
|
|
6511
6571
|
switch (_c.label) {
|
|
@@ -6525,9 +6585,9 @@ var Wallet = /** @class */ (function (_super) {
|
|
|
6525
6585
|
}
|
|
6526
6586
|
return [2 /*return*/, { signatureMessage: initRecovery.signatureMessage, wallabyAuthPubKey: initRecovery.wallabyAuthPubKey }];
|
|
6527
6587
|
case 2:
|
|
6528
|
-
|
|
6529
|
-
logger('SDK::Wallet::initRecoveryFlow::error',
|
|
6530
|
-
return [2 /*return*/, Promise.reject(
|
|
6588
|
+
error_18 = _c.sent();
|
|
6589
|
+
logger('SDK::Wallet::initRecoveryFlow::error', error_18);
|
|
6590
|
+
return [2 /*return*/, Promise.reject(error_18)];
|
|
6531
6591
|
case 3: return [2 /*return*/];
|
|
6532
6592
|
}
|
|
6533
6593
|
});
|