@ref-finance/ref-sdk 1.4.8 → 1.4.9
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/ref-sdk.cjs.development.js +12 -19
- package/dist/ref-sdk.cjs.development.js.map +1 -1
- package/dist/ref-sdk.cjs.production.min.js +1 -1
- package/dist/ref-sdk.cjs.production.min.js.map +1 -1
- package/dist/ref-sdk.esm.js +12 -19
- package/dist/ref-sdk.esm.js.map +1 -1
- package/dist/ref-sdk.umd.development.js +12 -19
- package/dist/ref-sdk.umd.development.js.map +1 -1
- package/dist/ref-sdk.umd.production.min.js +1 -1
- package/dist/ref-sdk.umd.production.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -4181,22 +4181,18 @@
|
|
|
4181
4181
|
}();
|
|
4182
4182
|
var getAccountNearBalance = /*#__PURE__*/function () {
|
|
4183
4183
|
var _ref11 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(accountId) {
|
|
4184
|
-
var provider;
|
|
4185
4184
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
4186
4185
|
while (1) {
|
|
4187
4186
|
switch (_context9.prev = _context9.next) {
|
|
4188
4187
|
case 0:
|
|
4189
|
-
|
|
4190
|
-
url: getConfig().nodeUrl
|
|
4191
|
-
});
|
|
4192
|
-
return _context9.abrupt("return", provider.query({
|
|
4188
|
+
return _context9.abrupt("return", near.connection.provider.query({
|
|
4193
4189
|
request_type: 'view_account',
|
|
4194
4190
|
finality: 'final',
|
|
4195
4191
|
account_id: accountId
|
|
4196
4192
|
}).then(function (data) {
|
|
4197
4193
|
return data.amount;
|
|
4198
4194
|
}));
|
|
4199
|
-
case
|
|
4195
|
+
case 1:
|
|
4200
4196
|
case "end":
|
|
4201
4197
|
return _context9.stop();
|
|
4202
4198
|
}
|
|
@@ -4272,44 +4268,41 @@
|
|
|
4272
4268
|
};
|
|
4273
4269
|
var getMinStorageBalance = /*#__PURE__*/function () {
|
|
4274
4270
|
var _ref14 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(nep141Address) {
|
|
4275
|
-
var
|
|
4271
|
+
var result, balance;
|
|
4276
4272
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
4277
4273
|
while (1) {
|
|
4278
4274
|
switch (_context11.prev = _context11.next) {
|
|
4279
4275
|
case 0:
|
|
4280
4276
|
_context11.prev = 0;
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
});
|
|
4284
|
-
_context11.next = 4;
|
|
4285
|
-
return provider.query({
|
|
4277
|
+
_context11.next = 3;
|
|
4278
|
+
return near.connection.provider.query({
|
|
4286
4279
|
request_type: 'call_function',
|
|
4287
4280
|
account_id: nep141Address,
|
|
4288
4281
|
method_name: 'storage_balance_bounds',
|
|
4289
4282
|
args_base64: '',
|
|
4290
4283
|
finality: 'optimistic'
|
|
4291
4284
|
});
|
|
4292
|
-
case
|
|
4285
|
+
case 3:
|
|
4293
4286
|
result = _context11.sent;
|
|
4294
4287
|
balance = JSON.parse(Buffer.from(result.result).toString());
|
|
4295
4288
|
if (!(!balance || !balance.min)) {
|
|
4296
|
-
_context11.next =
|
|
4289
|
+
_context11.next = 7;
|
|
4297
4290
|
break;
|
|
4298
4291
|
}
|
|
4299
4292
|
return _context11.abrupt("return", FT_MINIMUM_STORAGE_BALANCE_LARGE);
|
|
4300
|
-
case
|
|
4293
|
+
case 7:
|
|
4301
4294
|
return _context11.abrupt("return", balance.min);
|
|
4302
|
-
case
|
|
4303
|
-
_context11.prev =
|
|
4295
|
+
case 10:
|
|
4296
|
+
_context11.prev = 10;
|
|
4304
4297
|
_context11.t0 = _context11["catch"](0);
|
|
4305
4298
|
console.error(_context11.t0, nep141Address);
|
|
4306
4299
|
return _context11.abrupt("return", FT_MINIMUM_STORAGE_BALANCE_LARGE);
|
|
4307
|
-
case
|
|
4300
|
+
case 14:
|
|
4308
4301
|
case "end":
|
|
4309
4302
|
return _context11.stop();
|
|
4310
4303
|
}
|
|
4311
4304
|
}
|
|
4312
|
-
}, _callee11, null, [[0,
|
|
4305
|
+
}, _callee11, null, [[0, 10]]);
|
|
4313
4306
|
}));
|
|
4314
4307
|
return function getMinStorageBalance(_x13) {
|
|
4315
4308
|
return _ref14.apply(this, arguments);
|