@kimafinance/kima-transaction-widget 1.0.7 → 1.0.8
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 +13 -11
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +5 -2
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1441,6 +1441,7 @@ var WalletSelect = function WalletSelect() {
|
|
|
1441
1441
|
};
|
|
1442
1442
|
|
|
1443
1443
|
const version = "logger/5.7.0";
|
|
1444
|
+
//# sourceMappingURL=_version.js.map
|
|
1444
1445
|
|
|
1445
1446
|
let _permanentCensorErrors = false;
|
|
1446
1447
|
let _censorErrors = false;
|
|
@@ -1790,8 +1791,10 @@ class Logger {
|
|
|
1790
1791
|
}
|
|
1791
1792
|
Logger.errors = ErrorCode;
|
|
1792
1793
|
Logger.levels = LogLevel;
|
|
1794
|
+
//# sourceMappingURL=index.js.map
|
|
1793
1795
|
|
|
1794
1796
|
const version$1 = "bytes/5.7.0";
|
|
1797
|
+
//# sourceMappingURL=_version.js.map
|
|
1795
1798
|
|
|
1796
1799
|
const logger = new Logger(version$1);
|
|
1797
1800
|
///////////////////////////////
|
|
@@ -1902,6 +1905,7 @@ function hexStripZeros(value) {
|
|
|
1902
1905
|
}
|
|
1903
1906
|
return "0x" + value.substring(offset);
|
|
1904
1907
|
}
|
|
1908
|
+
//# sourceMappingURL=index.js.map
|
|
1905
1909
|
|
|
1906
1910
|
var createWalletStatus = function createWalletStatus(isReady, statusMessage, forceNetworkSwitch, walletAddress) {
|
|
1907
1911
|
if (statusMessage === void 0) {
|
|
@@ -6597,17 +6601,15 @@ function useAllowance() {
|
|
|
6597
6601
|
var mint = new web3_js.PublicKey(tokenAddress);
|
|
6598
6602
|
var toPublicKey = new web3_js.PublicKey(targetAddress);
|
|
6599
6603
|
return Promise.resolve(getOrCreateAssociatedTokenAccount(connection, publicKey, mint, publicKey, signTransaction)).then(function (fromTokenAccount) {
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
return Promise.resolve(
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
dispatch(setApproving(false));
|
|
6610
|
-
});
|
|
6604
|
+
var transaction = new web3_js.Transaction().add(createApproveTransferInstruction(fromTokenAccount.address, toPublicKey, publicKey, (amount + serviceFee) * Math.pow(10, COIN_LIST['USDK'].decimals), [], splToken.TOKEN_PROGRAM_ID));
|
|
6605
|
+
return Promise.resolve(connection.getLatestBlockhash()).then(function (blockHash) {
|
|
6606
|
+
transaction.feePayer = publicKey;
|
|
6607
|
+
return Promise.resolve(blockHash.blockhash).then(function (_blockHash$blockhash) {
|
|
6608
|
+
transaction.recentBlockhash = _blockHash$blockhash;
|
|
6609
|
+
return Promise.resolve(signTransaction(transaction)).then(function (signed) {
|
|
6610
|
+
return Promise.resolve(connection.sendRawTransaction(signed.serialize())).then(function () {
|
|
6611
|
+
dispatch(setSplAllowance(amount + serviceFee));
|
|
6612
|
+
dispatch(setApproving(false));
|
|
6611
6613
|
});
|
|
6612
6614
|
});
|
|
6613
6615
|
});
|