wallaby-cash 1.5.2 → 1.6.0
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/helpers/object-to-params.d.ts +7 -0
- package/dist/index.cjs.js +34 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +34 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +34 -8
- package/dist/index.js.map +1 -1
- package/dist/lib/wallet/index.d.ts +6 -4
- package/dist/types/common.d.ts +14 -0
- package/dist/types/wallet.d.ts +7 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -25,7 +25,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
25
25
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
26
26
|
PERFORMANCE OF THIS SOFTWARE.
|
|
27
27
|
***************************************************************************** */
|
|
28
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
28
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
29
29
|
|
|
30
30
|
var extendStatics = function(d, b) {
|
|
31
31
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -64,8 +64,8 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
function __generator(thisArg, body) {
|
|
67
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
68
|
-
return g =
|
|
67
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
68
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
69
69
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
70
70
|
function step(op) {
|
|
71
71
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -997,6 +997,8 @@ function requireBrowser () {
|
|
|
997
997
|
return false;
|
|
998
998
|
}
|
|
999
999
|
|
|
1000
|
+
let m;
|
|
1001
|
+
|
|
1000
1002
|
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
|
1001
1003
|
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
|
1002
1004
|
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
|
|
@@ -1004,7 +1006,7 @@ function requireBrowser () {
|
|
|
1004
1006
|
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
|
|
1005
1007
|
// Is firefox >= v31?
|
|
1006
1008
|
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
1007
|
-
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(
|
|
1009
|
+
(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
|
|
1008
1010
|
// Double check webkit in userAgent just in case we are in a worker
|
|
1009
1011
|
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
|
|
1010
1012
|
}
|
|
@@ -4927,6 +4929,22 @@ var StorageService = /** @class */ (function () {
|
|
|
4927
4929
|
return StorageService;
|
|
4928
4930
|
}());
|
|
4929
4931
|
|
|
4932
|
+
/**
|
|
4933
|
+
* Converts an object to query parameters string.
|
|
4934
|
+
*
|
|
4935
|
+
* @param obj - The object to convert.
|
|
4936
|
+
* @returns The query parameters string.
|
|
4937
|
+
*/
|
|
4938
|
+
function objectToQueryParams(obj) {
|
|
4939
|
+
var params = new URLSearchParams();
|
|
4940
|
+
for (var key in obj) {
|
|
4941
|
+
if (obj.hasOwnProperty(key) && obj[key] !== undefined && obj[key] !== null) {
|
|
4942
|
+
params.append(key, obj[key]);
|
|
4943
|
+
}
|
|
4944
|
+
}
|
|
4945
|
+
return params.toString();
|
|
4946
|
+
}
|
|
4947
|
+
|
|
4930
4948
|
var Base = /** @class */ (function () {
|
|
4931
4949
|
function Base(config) {
|
|
4932
4950
|
var _a;
|
|
@@ -5010,6 +5028,9 @@ var Base = /** @class */ (function () {
|
|
|
5010
5028
|
else {
|
|
5011
5029
|
url = route.fullPath;
|
|
5012
5030
|
}
|
|
5031
|
+
if (options === null || options === void 0 ? void 0 : options.queryParams) {
|
|
5032
|
+
url += "?".concat(objectToQueryParams(options.queryParams));
|
|
5033
|
+
}
|
|
5013
5034
|
return [4 /*yield*/, this.getRequestHeaders(route.requiresAccessToken)];
|
|
5014
5035
|
case 1:
|
|
5015
5036
|
headers = _d.sent();
|
|
@@ -6129,12 +6150,13 @@ var Wallet = /** @class */ (function (_super) {
|
|
|
6129
6150
|
*
|
|
6130
6151
|
* @description Get all user assets across all wallets by specifying user id
|
|
6131
6152
|
* @param userId Wallaby's user ID
|
|
6153
|
+
* @param queryOptions Optional query options
|
|
6132
6154
|
* @returns {UserWalletsResponse} Returns an array of user assets by specifying user id
|
|
6133
6155
|
*/
|
|
6134
6156
|
Wallet.prototype.getUserAssets = function (_a) {
|
|
6135
6157
|
return __awaiter(this, arguments, void 0, function (_b) {
|
|
6136
6158
|
var response, error_10;
|
|
6137
|
-
var userId = _b.userId;
|
|
6159
|
+
var userId = _b.userId, queryOptions = _b.queryOptions;
|
|
6138
6160
|
return __generator(this, function (_c) {
|
|
6139
6161
|
switch (_c.label) {
|
|
6140
6162
|
case 0:
|
|
@@ -6144,6 +6166,7 @@ var Wallet = /** @class */ (function (_super) {
|
|
|
6144
6166
|
payload: {
|
|
6145
6167
|
userId: userId,
|
|
6146
6168
|
},
|
|
6169
|
+
queryParams: queryOptions,
|
|
6147
6170
|
})];
|
|
6148
6171
|
case 1:
|
|
6149
6172
|
response = _c.sent();
|
|
@@ -6169,7 +6192,7 @@ var Wallet = /** @class */ (function (_super) {
|
|
|
6169
6192
|
Wallet.prototype.getUserWallets = function (_a) {
|
|
6170
6193
|
return __awaiter(this, arguments, void 0, function (_b) {
|
|
6171
6194
|
var response, error_11;
|
|
6172
|
-
var userId = _b.userId;
|
|
6195
|
+
var userId = _b.userId, queryOptions = _b.queryOptions;
|
|
6173
6196
|
return __generator(this, function (_c) {
|
|
6174
6197
|
switch (_c.label) {
|
|
6175
6198
|
case 0:
|
|
@@ -6179,6 +6202,7 @@ var Wallet = /** @class */ (function (_super) {
|
|
|
6179
6202
|
payload: {
|
|
6180
6203
|
userId: userId,
|
|
6181
6204
|
},
|
|
6205
|
+
queryParams: queryOptions,
|
|
6182
6206
|
})];
|
|
6183
6207
|
case 1:
|
|
6184
6208
|
response = _c.sent();
|
|
@@ -6199,12 +6223,13 @@ var Wallet = /** @class */ (function (_super) {
|
|
|
6199
6223
|
*
|
|
6200
6224
|
* @description Get all assets that exist in a certain wallet, by specifying a wallet ID
|
|
6201
6225
|
* @param walletId Wallaby's wallet ID
|
|
6202
|
-
* @
|
|
6226
|
+
* @param { BasicQueryOptions } queryOptions Optional query options
|
|
6227
|
+
* @returns { WalletAssetsResponse } Returns all assets belonging in a certain wallet ID
|
|
6203
6228
|
*/
|
|
6204
6229
|
Wallet.prototype.getWalletAssets = function (_a) {
|
|
6205
6230
|
return __awaiter(this, arguments, void 0, function (_b) {
|
|
6206
6231
|
var response, error_12;
|
|
6207
|
-
var walletId = _b.walletId;
|
|
6232
|
+
var walletId = _b.walletId, queryOptions = _b.queryOptions;
|
|
6208
6233
|
return __generator(this, function (_c) {
|
|
6209
6234
|
switch (_c.label) {
|
|
6210
6235
|
case 0:
|
|
@@ -6214,6 +6239,7 @@ var Wallet = /** @class */ (function (_super) {
|
|
|
6214
6239
|
payload: {
|
|
6215
6240
|
walletId: walletId,
|
|
6216
6241
|
},
|
|
6242
|
+
queryParams: queryOptions,
|
|
6217
6243
|
})];
|
|
6218
6244
|
case 1:
|
|
6219
6245
|
response = _c.sent();
|