@dubsdotapp/expo 0.2.16 → 0.2.18
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
CHANGED
|
@@ -889,7 +889,7 @@ var PhantomDeeplinkAdapter = class {
|
|
|
889
889
|
const dappPubBase58 = import_bs582.default.encode(this._dappKeyPair.publicKey);
|
|
890
890
|
console.log(TAG2, "Dapp public key:", dappPubBase58);
|
|
891
891
|
const requestId = nextRequestId();
|
|
892
|
-
const redirectLink =
|
|
892
|
+
const redirectLink = this.config.redirectUri;
|
|
893
893
|
console.log(TAG2, `connect() requestId=${requestId} redirectLink=${redirectLink}`);
|
|
894
894
|
const appUrl = this.config.appUrl || this.config.redirectUri;
|
|
895
895
|
console.log(TAG2, "Using app_url:", appUrl);
|
|
@@ -950,7 +950,7 @@ var PhantomDeeplinkAdapter = class {
|
|
|
950
950
|
this._sharedSecret
|
|
951
951
|
);
|
|
952
952
|
const requestId = nextRequestId();
|
|
953
|
-
const redirectLink =
|
|
953
|
+
const redirectLink = this.config.redirectUri;
|
|
954
954
|
console.log(TAG2, `signTransaction() requestId=${requestId}`);
|
|
955
955
|
const params = new URLSearchParams({
|
|
956
956
|
dapp_encryption_public_key: import_bs582.default.encode(this._dappKeyPair.publicKey),
|
|
@@ -982,7 +982,7 @@ var PhantomDeeplinkAdapter = class {
|
|
|
982
982
|
this._sharedSecret
|
|
983
983
|
);
|
|
984
984
|
const requestId = nextRequestId();
|
|
985
|
-
const redirectLink =
|
|
985
|
+
const redirectLink = this.config.redirectUri;
|
|
986
986
|
console.log(TAG2, `signAndSendTransaction() requestId=${requestId}`);
|
|
987
987
|
const params = new URLSearchParams({
|
|
988
988
|
dapp_encryption_public_key: import_bs582.default.encode(this._dappKeyPair.publicKey),
|
|
@@ -1005,13 +1005,27 @@ var PhantomDeeplinkAdapter = class {
|
|
|
1005
1005
|
async signMessage(message) {
|
|
1006
1006
|
this.assertConnected();
|
|
1007
1007
|
console.log(TAG2, "signMessage() \u2014 message length:", message.length);
|
|
1008
|
-
const
|
|
1009
|
-
|
|
1010
|
-
this.
|
|
1011
|
-
|
|
1008
|
+
const encodedMessage = import_bs582.default.encode(message);
|
|
1009
|
+
const payload = {
|
|
1010
|
+
session: this._sessionToken,
|
|
1011
|
+
message: encodedMessage
|
|
1012
|
+
};
|
|
1013
|
+
console.log(TAG2, "signMessage() payload keys:", Object.keys(payload).join(", "));
|
|
1014
|
+
console.log(TAG2, "signMessage() message (first 40 chars):", encodedMessage.substring(0, 40) + "...");
|
|
1015
|
+
console.log(TAG2, "signMessage() session (first 20 chars):", this._sessionToken?.substring(0, 20) + "...");
|
|
1016
|
+
console.log(TAG2, "signMessage() sharedSecret length:", this._sharedSecret.length);
|
|
1017
|
+
console.log(TAG2, "signMessage() dappPubKey:", import_bs582.default.encode(this._dappKeyPair.publicKey));
|
|
1018
|
+
const { nonce, ciphertext } = encryptPayload(payload, this._sharedSecret);
|
|
1019
|
+
console.log(TAG2, "signMessage() encrypted \u2014 nonce length:", import_bs582.default.decode(nonce).length, "ciphertext length:", import_bs582.default.decode(ciphertext).length);
|
|
1020
|
+
try {
|
|
1021
|
+
const selfTest = decryptPayload(ciphertext, nonce, this._sharedSecret);
|
|
1022
|
+
console.log(TAG2, "signMessage() self-test decrypt OK \u2014 keys:", Object.keys(selfTest).join(", "));
|
|
1023
|
+
} catch (err) {
|
|
1024
|
+
console.log(TAG2, "signMessage() SELF-TEST FAILED:", err instanceof Error ? err.message : err);
|
|
1025
|
+
}
|
|
1012
1026
|
const requestId = nextRequestId();
|
|
1013
|
-
const redirectLink =
|
|
1014
|
-
console.log(TAG2, `signMessage() requestId=${requestId}`);
|
|
1027
|
+
const redirectLink = this.config.redirectUri;
|
|
1028
|
+
console.log(TAG2, `signMessage() requestId=${requestId} redirectLink=${redirectLink}`);
|
|
1015
1029
|
const params = new URLSearchParams({
|
|
1016
1030
|
dapp_encryption_public_key: import_bs582.default.encode(this._dappKeyPair.publicKey),
|
|
1017
1031
|
nonce,
|
|
@@ -1019,6 +1033,7 @@ var PhantomDeeplinkAdapter = class {
|
|
|
1019
1033
|
redirect_link: redirectLink
|
|
1020
1034
|
});
|
|
1021
1035
|
const url = `https://phantom.app/ul/v1/signMessage?${params.toString()}`;
|
|
1036
|
+
console.log(TAG2, "signMessage() full URL length:", url.length);
|
|
1022
1037
|
console.log(TAG2, "Opening Phantom signMessage deeplink...");
|
|
1023
1038
|
const response = await this.handler.send(url, requestId, this.timeout);
|
|
1024
1039
|
console.log(TAG2, "Received signMessage response");
|