btc-wallet 0.5.9-beta → 0.5.11-beta
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/connector/injected.d.ts +0 -1
- package/dist/index.js +4 -33
- package/dist/index.js.map +2 -2
- package/esm/index.js +4 -33
- package/esm/index.js.map +2 -2
- package/package.json +1 -1
@@ -4,7 +4,6 @@ export declare abstract class InjectedConnector extends BaseConnector {
|
|
4
4
|
constructor(propertity: string);
|
5
5
|
isReady(): boolean;
|
6
6
|
requestAccounts(): Promise<string[]>;
|
7
|
-
private getUniversalLink;
|
8
7
|
getAccounts(): Promise<string[]>;
|
9
8
|
getPublicKey(): Promise<string>;
|
10
9
|
signMessage(signStr: string, type?: 'ecdsa' | 'bip322-simple'): Promise<string>;
|
package/dist/index.js
CHANGED
@@ -505,24 +505,6 @@ var InjectedConnector = class extends BaseConnector {
|
|
505
505
|
return accounts;
|
506
506
|
});
|
507
507
|
}
|
508
|
-
getUniversalLink(url) {
|
509
|
-
url = "https://www.deltatrade.ai/";
|
510
|
-
console.log(this.metadata.id);
|
511
|
-
switch (this.metadata.id) {
|
512
|
-
case "unisat":
|
513
|
-
return `unisat://dapp?url=${encodeURIComponent(url)}`;
|
514
|
-
case "okx":
|
515
|
-
return `okx://wallet/dapp/url?dappUrl=${encodeURIComponent(url)}`;
|
516
|
-
case "bitget":
|
517
|
-
return `https://bkcode.vip?action=dapp&url=${encodeURIComponent(url)}`;
|
518
|
-
case "binance":
|
519
|
-
return `binance://dapp?url=${encodeURIComponent(url)}`;
|
520
|
-
case "xverse":
|
521
|
-
return `https://connect.xverse.app/browser?url=${encodeURIComponent(url)}`;
|
522
|
-
default:
|
523
|
-
return url;
|
524
|
-
}
|
525
|
-
}
|
526
508
|
getAccounts() {
|
527
509
|
return __async(this, null, function* () {
|
528
510
|
const accounts = yield this.getProviderOrThrow().getAccounts();
|
@@ -801,18 +783,10 @@ var XverseConnector = class extends BaseConnector {
|
|
801
783
|
message: signStr,
|
802
784
|
protocol: "ECDSA"
|
803
785
|
});
|
804
|
-
const modifiedSig = Buffer.from(result.signature, "base64");
|
805
786
|
console.log("xverse walletType", address.walletType);
|
806
|
-
console.log("xverse raw sig", result.signature
|
807
|
-
|
808
|
-
|
809
|
-
modifiedSig[0] = 31 + (modifiedSig[0] - 39);
|
810
|
-
} else if (address.addressType === "p2sh") {
|
811
|
-
modifiedSig[0] = 31 + (modifiedSig[0] - 35);
|
812
|
-
}
|
813
|
-
} else {
|
814
|
-
modifiedSig[0] = 31 + (modifiedSig[0] - 31) % 4;
|
815
|
-
}
|
787
|
+
console.log("xverse raw sig", result.signature);
|
788
|
+
const modifiedSig = Buffer.from(result.signature, "base64");
|
789
|
+
modifiedSig[0] = 31 + (modifiedSig[0] - 31) % 4;
|
816
790
|
const sig = modifiedSig.toString("base64");
|
817
791
|
console.log("xverse modified sig", sig);
|
818
792
|
return sig;
|
@@ -4430,14 +4404,11 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
|
|
4430
4404
|
newActions,
|
4431
4405
|
(0, import_utils10.baseDecode)(header.hash)
|
4432
4406
|
);
|
4433
|
-
console.log("convertTransactionToTxHex transaction:", _transaction);
|
4434
4407
|
const txBytes = (0, import_transaction.encodeTransaction)(_transaction);
|
4435
4408
|
const txHex = Array.from(txBytes, (byte) => ("0" + (byte & 255).toString(16)).slice(-2)).join(
|
4436
4409
|
""
|
4437
4410
|
);
|
4438
|
-
console.log("convertTransactionToTxHex txHex:", txHex);
|
4439
4411
|
const hash = import_bs58.default.encode(new Uint8Array(import_js_sha256.sha256.array(txBytes)));
|
4440
|
-
console.log("convertTransactionToTxHex hash:", hash);
|
4441
4412
|
return { txBytes, txHex, hash };
|
4442
4413
|
});
|
4443
4414
|
}
|
@@ -4489,7 +4460,7 @@ function setupBTCWallet({
|
|
4489
4460
|
|
4490
4461
|
// src/index.ts
|
4491
4462
|
var getVersion = () => {
|
4492
|
-
return "0.5.
|
4463
|
+
return "0.5.11-beta";
|
4493
4464
|
};
|
4494
4465
|
if (typeof window !== "undefined") {
|
4495
4466
|
window.__BTC_WALLET_VERSION = getVersion();
|