@kimafinance/kima-transaction-widget 1.2.62-beta.1 → 1.2.64-beta.1
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.js +33 -30
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +29 -29
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3328,9 +3328,8 @@ var TransactionWidget = function TransactionWidget(_ref) {
|
|
|
3328
3328
|
return Promise.resolve(_catch(function () {
|
|
3329
3329
|
var data;
|
|
3330
3330
|
var isLP = dAppOption === exports.DAppOptions.LPAdd || dAppOption === exports.DAppOptions.LPDrain;
|
|
3331
|
-
console.log(graphqlProviderQuery, txId);
|
|
3332
3331
|
return Promise.resolve(fetchWrapper.post(graphqlProviderQuery, JSON.stringify({
|
|
3333
|
-
query: "query TransactionDetailsKima($txId: String) {\n " + (isLP ? 'liquidity_transaction_data' : 'transaction_data') + "(where: { tx_id: { _eq: " + txId.toString() + " } }, limit: 1) {\n failreason\n pullfailcount\n pullhash\n releasefailcount\n releasehash\n txstatus\n amount\n creator\n fee\n originaddress\n originchain\n
|
|
3332
|
+
query: "query TransactionDetailsKima($txId: String) {\n " + (isLP ? 'liquidity_transaction_data' : 'transaction_data') + "(where: { tx_id: { _eq: " + txId.toString() + " } }, limit: 1) {\n failreason\n pullfailcount\n pullhash\n releasefailcount\n releasehash\n txstatus\n amount\n creator\n fee\n originaddress\n originchain\n originsymbol\n targetsymbol\n targetaddress\n targetchain\n tx_id\n }\n }"
|
|
3334
3333
|
}))).then(function (result) {
|
|
3335
3334
|
var _result$data, _result$data$transact;
|
|
3336
3335
|
if (!(result !== null && result !== void 0 && (_result$data = result.data) !== null && _result$data !== void 0 && (_result$data$transact = _result$data.transaction_data) !== null && _result$data$transact !== void 0 && _result$data$transact.length)) {
|
|
@@ -3341,33 +3340,32 @@ var TransactionWidget = function TransactionWidget(_ref) {
|
|
|
3341
3340
|
} else {
|
|
3342
3341
|
data = result === null || result === void 0 ? void 0 : result.data.transaction_data[0];
|
|
3343
3342
|
}
|
|
3344
|
-
console.log(data);
|
|
3345
3343
|
if (!data) return;
|
|
3346
3344
|
if (isLP) {
|
|
3347
3345
|
setData({
|
|
3348
|
-
status: data.
|
|
3349
|
-
sourceChain: data.
|
|
3350
|
-
targetChain: data.
|
|
3351
|
-
tssPullHash: dAppOption === exports.DAppOptions.LPAdd ? data.
|
|
3352
|
-
tssReleaseHash: dAppOption === exports.DAppOptions.LPDrain ? data.
|
|
3353
|
-
failReason: data.
|
|
3346
|
+
status: data.txstatus,
|
|
3347
|
+
sourceChain: data.originchain,
|
|
3348
|
+
targetChain: data.targetchain,
|
|
3349
|
+
tssPullHash: dAppOption === exports.DAppOptions.LPAdd ? data.releaseHash : '',
|
|
3350
|
+
tssReleaseHash: dAppOption === exports.DAppOptions.LPDrain ? data.releaseHash : '',
|
|
3351
|
+
failReason: data.failreason,
|
|
3354
3352
|
amount: +data.amount,
|
|
3355
|
-
sourceSymbol: data.
|
|
3356
|
-
targetSymbol: data.
|
|
3357
|
-
kimaTxHash: data.
|
|
3353
|
+
sourceSymbol: data.originsymbol,
|
|
3354
|
+
targetSymbol: data.targetsymbol,
|
|
3355
|
+
kimaTxHash: data.kimahash
|
|
3358
3356
|
});
|
|
3359
3357
|
} else {
|
|
3360
3358
|
setData({
|
|
3361
|
-
status: data.
|
|
3362
|
-
sourceChain: data.
|
|
3363
|
-
targetChain: data.
|
|
3364
|
-
tssPullHash: data.
|
|
3365
|
-
tssReleaseHash: data.
|
|
3366
|
-
failReason: data.
|
|
3359
|
+
status: data.txstatus,
|
|
3360
|
+
sourceChain: data.originchain,
|
|
3361
|
+
targetChain: data.targetchain,
|
|
3362
|
+
tssPullHash: data.pullhash,
|
|
3363
|
+
tssReleaseHash: data.releasehash,
|
|
3364
|
+
failReason: data.failreason,
|
|
3367
3365
|
amount: +data.amount,
|
|
3368
|
-
sourceSymbol: data.
|
|
3369
|
-
targetSymbol: data.
|
|
3370
|
-
kimaTxHash: data.
|
|
3366
|
+
sourceSymbol: data.originsymbol,
|
|
3367
|
+
targetSymbol: data.targetsymbol,
|
|
3368
|
+
kimaTxHash: data.kimahash
|
|
3371
3369
|
});
|
|
3372
3370
|
}
|
|
3373
3371
|
if (data.status === TransactionStatus.COMPLETED) {
|
|
@@ -7940,7 +7938,7 @@ function output(out, instance) {
|
|
|
7940
7938
|
exports.output = output;
|
|
7941
7939
|
const assert = { number, bool, bytes, hash, exists, output };
|
|
7942
7940
|
exports.default = assert;
|
|
7943
|
-
|
|
7941
|
+
//# sourceMappingURL=_assert.js.map
|
|
7944
7942
|
});
|
|
7945
7943
|
|
|
7946
7944
|
unwrapExports(_assert);
|
|
@@ -7949,7 +7947,7 @@ var crypto = createCommonjsModule(function (module, exports) {
|
|
|
7949
7947
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7950
7948
|
exports.crypto = void 0;
|
|
7951
7949
|
exports.crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;
|
|
7952
|
-
|
|
7950
|
+
//# sourceMappingURL=crypto.js.map
|
|
7953
7951
|
});
|
|
7954
7952
|
|
|
7955
7953
|
unwrapExports(crypto);
|
|
@@ -8151,7 +8149,7 @@ function randomBytes(bytesLength = 32) {
|
|
|
8151
8149
|
throw new Error('crypto.getRandomValues must be defined');
|
|
8152
8150
|
}
|
|
8153
8151
|
exports.randomBytes = randomBytes;
|
|
8154
|
-
|
|
8152
|
+
//# sourceMappingURL=utils.js.map
|
|
8155
8153
|
});
|
|
8156
8154
|
|
|
8157
8155
|
unwrapExports(utils);
|
|
@@ -8273,7 +8271,7 @@ class SHA2 extends utils.Hash {
|
|
|
8273
8271
|
}
|
|
8274
8272
|
}
|
|
8275
8273
|
exports.SHA2 = SHA2;
|
|
8276
|
-
|
|
8274
|
+
//# sourceMappingURL=_sha2.js.map
|
|
8277
8275
|
});
|
|
8278
8276
|
|
|
8279
8277
|
unwrapExports(_sha2);
|
|
@@ -8406,7 +8404,7 @@ class SHA224 extends SHA256 {
|
|
|
8406
8404
|
*/
|
|
8407
8405
|
exports.sha256 = (0, utils.wrapConstructor)(() => new SHA256());
|
|
8408
8406
|
exports.sha224 = (0, utils.wrapConstructor)(() => new SHA224());
|
|
8409
|
-
|
|
8407
|
+
//# sourceMappingURL=sha256.js.map
|
|
8410
8408
|
});
|
|
8411
8409
|
|
|
8412
8410
|
unwrapExports(sha256);
|
|
@@ -12017,11 +12015,11 @@ var TransferWidget = function TransferWidget(_ref) {
|
|
|
12017
12015
|
for (var i = 0; i < poolBalance.length; i++) {
|
|
12018
12016
|
if (poolBalance[i].chainName === targetChain) {
|
|
12019
12017
|
for (var j = 0; j < poolBalance[i].balance.length; j++) {
|
|
12020
|
-
if (poolBalance[i].balance[j].tokenSymbol !==
|
|
12018
|
+
if (poolBalance[i].balance[j].tokenSymbol !== targetCurrency) continue;
|
|
12021
12019
|
if (+poolBalance[i].balance[j].amount >= +amount + fee) {
|
|
12022
12020
|
return true;
|
|
12023
12021
|
}
|
|
12024
|
-
var symbol =
|
|
12022
|
+
var symbol = targetCurrency;
|
|
12025
12023
|
var errorString = "Tried to transfer " + amount + " " + symbol + ", but " + CHAIN_NAMES_TO_STRING[targetChain] + " pool has only " + +poolBalance[i].balance[j].amount + " " + symbol;
|
|
12026
12024
|
console.log(errorString);
|
|
12027
12025
|
toast.toast.error(errorString);
|
|
@@ -12174,7 +12172,10 @@ var TransferWidget = function TransferWidget(_ref) {
|
|
|
12174
12172
|
var handleSubmit = function handleSubmit() {
|
|
12175
12173
|
try {
|
|
12176
12174
|
var _temp8 = function _temp8(_result2) {
|
|
12177
|
-
|
|
12175
|
+
var _exit2 = false;
|
|
12176
|
+
if (_exit) return _result2;
|
|
12177
|
+
return _catch(function () {
|
|
12178
|
+
var _exit3 = false;
|
|
12178
12179
|
if (sourceChain === exports.SupportNetworks.FIAT || targetChain === exports.SupportNetworks.FIAT) return;
|
|
12179
12180
|
setSubmitting(true);
|
|
12180
12181
|
if (dAppOption === exports.DAppOptions.LPDrain || dAppOption === exports.DAppOptions.LPAdd) {
|
|
@@ -12184,6 +12185,8 @@ var TransferWidget = function TransferWidget(_ref) {
|
|
|
12184
12185
|
return Promise.resolve(checkPoolBalance()).then(function (_checkPoolBalance) {
|
|
12185
12186
|
if (!_checkPoolBalance) {
|
|
12186
12187
|
setSubmitting(false);
|
|
12188
|
+
_exit2 = true;
|
|
12189
|
+
return;
|
|
12187
12190
|
}
|
|
12188
12191
|
var params;
|
|
12189
12192
|
var feeParam;
|
|
@@ -12744,7 +12747,7 @@ var polygonAmoy = {
|
|
|
12744
12747
|
name: 'Amoy',
|
|
12745
12748
|
currency: 'MATIC',
|
|
12746
12749
|
explorerUrl: 'https://www.oklink.com/amoy',
|
|
12747
|
-
rpcUrl: 'https://rpc
|
|
12750
|
+
rpcUrl: 'https://polygon-rpc.com/'
|
|
12748
12751
|
};
|
|
12749
12752
|
var polygon = {
|
|
12750
12753
|
chainId: 137,
|