Skip to content

Commit e20aec2

Browse files
committed
Install Buffer so we can correctly parse response from Freighter
1 parent 158d407 commit e20aec2

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@stellar/freighter-api": "3.0.0",
4646
"@walletconnect/modal": "2.6.2",
4747
"@walletconnect/sign-client": "2.11.2",
48-
"events": "3.3.0",
48+
"buffer": "6.0.3",
4949
"lit": "3.2.0",
5050
"rxjs": "7.8.1"
5151
},

pnpm-lock.yaml

Lines changed: 12 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/modules/freighter.module.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
} from '@stellar/freighter-api';
99
import { ModuleInterface, ModuleType } from '../types';
1010
import { parseError } from '../utils';
11+
import { Buffer } from 'buffer';
1112

1213
export const FREIGHTER_ID = 'freighter';
1314

@@ -87,7 +88,7 @@ export class FreighterModule implements ModuleInterface {
8788

8889
if (error || !signedAuthEntry) throw error;
8990

90-
return { signedAuthEntry: signedAuthEntry.toString('base64'), signerAddress: signerAddress };
91+
return { signedAuthEntry: Buffer.from(signedAuthEntry).toString('base64'), signerAddress: signerAddress };
9192
})
9293
.catch(e => {
9394
throw parseError(e);
@@ -111,7 +112,7 @@ export class FreighterModule implements ModuleInterface {
111112

112113
if (error || !signedMessage) throw error;
113114

114-
return { signedMessage: signedMessage.toString('base64'), signerAddress: signerAddress };
115+
return { signedMessage: Buffer.from(signedMessage).toString('base64'), signerAddress: signerAddress };
115116
})
116117
.catch(e => {
117118
throw parseError(e);

0 commit comments

Comments
 (0)