Skip to content

Commit

Permalink
chore: revert signMessage type change and override in signAccountLabe…
Browse files Browse the repository at this point in the history
…lMemo
  • Loading branch information
chambaz committed Oct 20, 2024
1 parent 0119743 commit ad6b824
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/marginfi-v2-ui-state/src/lib/firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ async function signAccountLabelMemo(wallet: Wallet, account: string, label: stri
if (signatureResult instanceof Uint8Array) {
signatureArray = signatureResult;
} else {
signatureArray = new Uint8Array(signatureResult.signature);
const phantomSignatureResult = signatureResult as { signature: ArrayBuffer };
signatureArray = new Uint8Array(phantomSignatureResult.signature);
}

const signedData = JSON.stringify({
Expand Down
4 changes: 1 addition & 3 deletions packages/mrgn-common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ export type Amount = BigNumber | number | string;

export type Wallet = Pick<SignerWalletAdapter, "signAllTransactions" | "signTransaction"> & {
publicKey: PublicKey;
// phantom window provider returns { signature: ArrayBuffer }
// wallet adapter returns Uint8Array
signMessage?: (message: Uint8Array) => Promise<Uint8Array | { signature: ArrayBuffer }>;
signMessage?: (message: Uint8Array) => Promise<Uint8Array>;
};

export interface TransactionOptions extends ConfirmOptions {
Expand Down

0 comments on commit ad6b824

Please sign in to comment.