@dubsdotapp/expo 0.2.24 → 0.2.25
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.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/wallet/mwa-adapter.ts +7 -3
package/dist/index.d.mts
CHANGED
|
@@ -577,6 +577,8 @@ declare class MwaWalletAdapter implements WalletAdapter {
|
|
|
577
577
|
private _publicKey;
|
|
578
578
|
private _connected;
|
|
579
579
|
private _authToken;
|
|
580
|
+
/** The raw base64-encoded address from MWA authorize — needed for signMessages */
|
|
581
|
+
private _mwaAddress;
|
|
580
582
|
private readonly config;
|
|
581
583
|
private readonly transact;
|
|
582
584
|
constructor(config: MwaAdapterConfig);
|
package/dist/index.d.ts
CHANGED
|
@@ -577,6 +577,8 @@ declare class MwaWalletAdapter implements WalletAdapter {
|
|
|
577
577
|
private _publicKey;
|
|
578
578
|
private _connected;
|
|
579
579
|
private _authToken;
|
|
580
|
+
/** The raw base64-encoded address from MWA authorize — needed for signMessages */
|
|
581
|
+
private _mwaAddress;
|
|
580
582
|
private readonly config;
|
|
581
583
|
private readonly transact;
|
|
582
584
|
constructor(config: MwaAdapterConfig);
|
package/dist/index.js
CHANGED
|
@@ -577,6 +577,8 @@ var MwaWalletAdapter = class {
|
|
|
577
577
|
this._publicKey = null;
|
|
578
578
|
this._connected = false;
|
|
579
579
|
this._authToken = null;
|
|
580
|
+
/** The raw base64-encoded address from MWA authorize — needed for signMessages */
|
|
581
|
+
this._mwaAddress = null;
|
|
580
582
|
this.config = config;
|
|
581
583
|
this.transact = config.transact;
|
|
582
584
|
}
|
|
@@ -601,7 +603,8 @@ var MwaWalletAdapter = class {
|
|
|
601
603
|
identity: this.config.appIdentity,
|
|
602
604
|
cluster: this.config.cluster || "mainnet-beta"
|
|
603
605
|
});
|
|
604
|
-
this.
|
|
606
|
+
this._mwaAddress = authResult.accounts[0].address;
|
|
607
|
+
this._publicKey = toPublicKey(this._mwaAddress);
|
|
605
608
|
this._authToken = authResult.auth_token;
|
|
606
609
|
this._connected = true;
|
|
607
610
|
this.config.onAuthTokenChange?.(this._authToken);
|
|
@@ -614,6 +617,7 @@ var MwaWalletAdapter = class {
|
|
|
614
617
|
this._publicKey = null;
|
|
615
618
|
this._connected = false;
|
|
616
619
|
this._authToken = null;
|
|
620
|
+
this._mwaAddress = null;
|
|
617
621
|
this.config.onAuthTokenChange?.(null);
|
|
618
622
|
}
|
|
619
623
|
async signTransaction(transaction) {
|
|
@@ -630,13 +634,13 @@ var MwaWalletAdapter = class {
|
|
|
630
634
|
return signed;
|
|
631
635
|
}
|
|
632
636
|
async signMessage(message) {
|
|
633
|
-
if (!this._connected || !this._publicKey) throw new Error("Wallet not connected");
|
|
637
|
+
if (!this._connected || !this._publicKey || !this._mwaAddress) throw new Error("Wallet not connected");
|
|
634
638
|
const sig = await this.transact(async (wallet) => {
|
|
635
639
|
const reauth = await wallet.reauthorize({ auth_token: this._authToken });
|
|
636
640
|
this._authToken = reauth.auth_token;
|
|
637
641
|
this.config.onAuthTokenChange?.(this._authToken);
|
|
638
642
|
const result = await wallet.signMessages({
|
|
639
|
-
addresses: [this.
|
|
643
|
+
addresses: [this._mwaAddress],
|
|
640
644
|
payloads: [message]
|
|
641
645
|
});
|
|
642
646
|
return result[0];
|