@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.mjs
CHANGED
|
@@ -825,7 +825,7 @@ var PhantomDeeplinkAdapter = class {
|
|
|
825
825
|
const dappPubBase58 = bs582.encode(this._dappKeyPair.publicKey);
|
|
826
826
|
console.log(TAG2, "Dapp public key:", dappPubBase58);
|
|
827
827
|
const requestId = nextRequestId();
|
|
828
|
-
const redirectLink =
|
|
828
|
+
const redirectLink = this.config.redirectUri;
|
|
829
829
|
console.log(TAG2, `connect() requestId=${requestId} redirectLink=${redirectLink}`);
|
|
830
830
|
const appUrl = this.config.appUrl || this.config.redirectUri;
|
|
831
831
|
console.log(TAG2, "Using app_url:", appUrl);
|
|
@@ -886,7 +886,7 @@ var PhantomDeeplinkAdapter = class {
|
|
|
886
886
|
this._sharedSecret
|
|
887
887
|
);
|
|
888
888
|
const requestId = nextRequestId();
|
|
889
|
-
const redirectLink =
|
|
889
|
+
const redirectLink = this.config.redirectUri;
|
|
890
890
|
console.log(TAG2, `signTransaction() requestId=${requestId}`);
|
|
891
891
|
const params = new URLSearchParams({
|
|
892
892
|
dapp_encryption_public_key: bs582.encode(this._dappKeyPair.publicKey),
|
|
@@ -918,7 +918,7 @@ var PhantomDeeplinkAdapter = class {
|
|
|
918
918
|
this._sharedSecret
|
|
919
919
|
);
|
|
920
920
|
const requestId = nextRequestId();
|
|
921
|
-
const redirectLink =
|
|
921
|
+
const redirectLink = this.config.redirectUri;
|
|
922
922
|
console.log(TAG2, `signAndSendTransaction() requestId=${requestId}`);
|
|
923
923
|
const params = new URLSearchParams({
|
|
924
924
|
dapp_encryption_public_key: bs582.encode(this._dappKeyPair.publicKey),
|
|
@@ -941,13 +941,27 @@ var PhantomDeeplinkAdapter = class {
|
|
|
941
941
|
async signMessage(message) {
|
|
942
942
|
this.assertConnected();
|
|
943
943
|
console.log(TAG2, "signMessage() \u2014 message length:", message.length);
|
|
944
|
-
const
|
|
945
|
-
|
|
946
|
-
this.
|
|
947
|
-
|
|
944
|
+
const encodedMessage = bs582.encode(message);
|
|
945
|
+
const payload = {
|
|
946
|
+
session: this._sessionToken,
|
|
947
|
+
message: encodedMessage
|
|
948
|
+
};
|
|
949
|
+
console.log(TAG2, "signMessage() payload keys:", Object.keys(payload).join(", "));
|
|
950
|
+
console.log(TAG2, "signMessage() message (first 40 chars):", encodedMessage.substring(0, 40) + "...");
|
|
951
|
+
console.log(TAG2, "signMessage() session (first 20 chars):", this._sessionToken?.substring(0, 20) + "...");
|
|
952
|
+
console.log(TAG2, "signMessage() sharedSecret length:", this._sharedSecret.length);
|
|
953
|
+
console.log(TAG2, "signMessage() dappPubKey:", bs582.encode(this._dappKeyPair.publicKey));
|
|
954
|
+
const { nonce, ciphertext } = encryptPayload(payload, this._sharedSecret);
|
|
955
|
+
console.log(TAG2, "signMessage() encrypted \u2014 nonce length:", bs582.decode(nonce).length, "ciphertext length:", bs582.decode(ciphertext).length);
|
|
956
|
+
try {
|
|
957
|
+
const selfTest = decryptPayload(ciphertext, nonce, this._sharedSecret);
|
|
958
|
+
console.log(TAG2, "signMessage() self-test decrypt OK \u2014 keys:", Object.keys(selfTest).join(", "));
|
|
959
|
+
} catch (err) {
|
|
960
|
+
console.log(TAG2, "signMessage() SELF-TEST FAILED:", err instanceof Error ? err.message : err);
|
|
961
|
+
}
|
|
948
962
|
const requestId = nextRequestId();
|
|
949
|
-
const redirectLink =
|
|
950
|
-
console.log(TAG2, `signMessage() requestId=${requestId}`);
|
|
963
|
+
const redirectLink = this.config.redirectUri;
|
|
964
|
+
console.log(TAG2, `signMessage() requestId=${requestId} redirectLink=${redirectLink}`);
|
|
951
965
|
const params = new URLSearchParams({
|
|
952
966
|
dapp_encryption_public_key: bs582.encode(this._dappKeyPair.publicKey),
|
|
953
967
|
nonce,
|
|
@@ -955,6 +969,7 @@ var PhantomDeeplinkAdapter = class {
|
|
|
955
969
|
redirect_link: redirectLink
|
|
956
970
|
});
|
|
957
971
|
const url = `https://phantom.app/ul/v1/signMessage?${params.toString()}`;
|
|
972
|
+
console.log(TAG2, "signMessage() full URL length:", url.length);
|
|
958
973
|
console.log(TAG2, "Opening Phantom signMessage deeplink...");
|
|
959
974
|
const response = await this.handler.send(url, requestId, this.timeout);
|
|
960
975
|
console.log(TAG2, "Received signMessage response");
|