Skip to content

Commit

Permalink
Defaulted to first account when signerId not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
amirsaran3 committed May 17, 2022
1 parent d270d9c commit 2a3837b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
5 changes: 2 additions & 3 deletions packages/ledger/src/lib/ledger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,12 @@ const Ledger: WalletBehaviourFactory<HardwareWallet> = async ({
await connectLedgerDevice();

const signedTransactions = await signTransactions(
[
transformTransactions([
{
receiverId,
actions,
signerId: signerId!,
},
],
]),
signer,
options.network.nodeUrl
);
Expand Down
11 changes: 8 additions & 3 deletions packages/math-wallet/src/lib/math-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,19 @@ const MathWallet: WalletBehaviourFactory<InjectedWallet> = async ({
}) {
logger.log("signAndSendTransaction", { signerId, receiverId, actions });

const account = getSignedInAccount();

if (!account) {
throw new Error("Not signed in");
}

const signedTransactions = await signTransactions(
[
transformTransactions([
{
receiverId,
actions,
signerId: signerId!,
},
],
]),
_state.wallet.signer,
options.network.nodeUrl
);
Expand Down

0 comments on commit 2a3837b

Please sign in to comment.