btc-wallet 0.4.3-beta → 0.4.4-beta
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +11 -46
- package/dist/index.js.map +2 -2
- package/esm/index.js +11 -46
- package/esm/index.js.map +2 -2
- package/package.json +1 -1
package/esm/index.js
CHANGED
@@ -418,39 +418,11 @@ var XverseConnector = class extends BaseConnector {
|
|
418
418
|
if (!provider) {
|
419
419
|
throw new Error(`${this.metadata.name} is not install!`);
|
420
420
|
}
|
421
|
-
const {
|
422
|
-
|
423
|
-
if (addresses.length === 0) {
|
424
|
-
throw new Error(`${this.metadata.name} not connected!`);
|
425
|
-
}
|
426
|
-
const result = yield new Promise((resolve, reject) => {
|
427
|
-
const sendBtcOptions = {
|
428
|
-
payload: {
|
429
|
-
network: {
|
430
|
-
type: __privateGet(this, _network)
|
431
|
-
},
|
432
|
-
recipients: [
|
433
|
-
{
|
434
|
-
address: toAddress,
|
435
|
-
amountSats: BigInt(satoshis)
|
436
|
-
}
|
437
|
-
],
|
438
|
-
senderAddress: addresses[0]
|
439
|
-
},
|
440
|
-
onFinish: (response) => {
|
441
|
-
resolve(response);
|
442
|
-
},
|
443
|
-
onCancel: () => {
|
444
|
-
reject({
|
445
|
-
code: 4001,
|
446
|
-
message: "User rejected the request."
|
447
|
-
});
|
448
|
-
}
|
449
|
-
};
|
450
|
-
console.log("\u{1F680} ~ XverseConnector ~ sendBitcoin ~ sendBtcOptions:", sendBtcOptions);
|
451
|
-
sendBtcTransaction(sendBtcOptions).catch((e) => reject(e));
|
421
|
+
const { result } = yield provider.request("sendTransfer", {
|
422
|
+
recipients: [{ address: toAddress, amount: satoshis }]
|
452
423
|
});
|
453
|
-
|
424
|
+
console.log("\u{1F680} ~ XverseConnector ~ sendBitcoin ~ res:", result);
|
425
|
+
return result.txid;
|
454
426
|
});
|
455
427
|
}
|
456
428
|
disconnect() {
|
@@ -3450,18 +3422,11 @@ function executeBTCDepositAndAction(_0) {
|
|
3450
3422
|
gas: GAS_LIMIT
|
3451
3423
|
}));
|
3452
3424
|
}
|
3453
|
-
if (action
|
3454
|
-
newActions.push(
|
3455
|
-
|
3456
|
-
|
3457
|
-
|
3458
|
-
}) : {
|
3459
|
-
receiver_id: config.accountContractId,
|
3460
|
-
amount: MINIMUM_DEPOSIT_AMOUNT_BASE.toString(),
|
3461
|
-
msg: JSON.stringify("Deposit"),
|
3462
|
-
gas: GAS_LIMIT
|
3463
|
-
}
|
3464
|
-
);
|
3425
|
+
if (action) {
|
3426
|
+
newActions.push(__spreadProps(__spreadValues({}, action), {
|
3427
|
+
amount: (arrearsAction == null ? void 0 : arrearsAction.amount) && !fixedAmount ? new Big(receiveAmount).minus(arrearsAction.amount).toString() : receiveAmount.toString(),
|
3428
|
+
gas: GAS_LIMIT
|
3429
|
+
}));
|
3465
3430
|
}
|
3466
3431
|
const storageDepositMsg = {};
|
3467
3432
|
const registerRes = yield nearCall((action == null ? void 0 : action.receiver_id) || config.token, "storage_balance_of", {
|
@@ -3845,7 +3810,7 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
|
|
3845
3810
|
args: {
|
3846
3811
|
receiver_id: currentConfig.accountContractId,
|
3847
3812
|
amount,
|
3848
|
-
msg: JSON.stringify("
|
3813
|
+
msg: JSON.stringify("Repay")
|
3849
3814
|
},
|
3850
3815
|
gas: new Big2(50).mul(__pow(10, 12)).toFixed(0),
|
3851
3816
|
deposit: "1"
|
@@ -4014,7 +3979,7 @@ function setupBTCWallet({
|
|
4014
3979
|
|
4015
3980
|
// src/index.ts
|
4016
3981
|
var getVersion = () => {
|
4017
|
-
return "0.4.
|
3982
|
+
return "0.4.4-beta";
|
4018
3983
|
};
|
4019
3984
|
if (typeof window !== "undefined") {
|
4020
3985
|
window.__BTC_WALLET_VERSION = getVersion();
|