Skip to content

Commit

Permalink
Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
r-n-o committed Jan 18, 2024
1 parent 73b0b55 commit 9b20af6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
13 changes: 3 additions & 10 deletions examples/with-solana/src/createSolanaTransfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,9 @@ export async function createAndSignTransfer(input: {
toAddress: string;
amount: number;
turnkeyOrganizationId: string;
turnkeySolAddress: string;
}): Promise<Buffer> {
const {
client,
fromAddress,
toAddress,
amount,
turnkeyOrganizationId,
turnkeySolAddress,
} = input;
const { client, fromAddress, toAddress, amount, turnkeyOrganizationId } =
input;
const fromKey = new PublicKey(fromAddress);
const toKey = new PublicKey(toAddress);

Expand All @@ -47,6 +40,6 @@ export async function createAndSignTransfer(input: {
organizationId: turnkeyOrganizationId,
client,
});
await signer.addSignature(transferTransaction, turnkeySolAddress);
await signer.addSignature(transferTransaction, fromAddress);
return transferTransaction.serialize();
}
1 change: 0 additions & 1 deletion examples/with-solana/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ async function main() {
toAddress: destination,
amount: Number(amount),
turnkeyOrganizationId: organizationId,
turnkeySolAddress: solAddress,
});

// Broadcast the signed payload on devnet
Expand Down
2 changes: 0 additions & 2 deletions packages/solana/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ export class TurnkeySigner {
});
}

// TODO: handle other failure types here (500? 400? How is that surfaced?)

const signature = `${result.signRawPayloadResult?.r}${result.signRawPayloadResult?.s}`;

tx.addSignature(fromKey, Buffer.from(signature, "hex"));
Expand Down

0 comments on commit 9b20af6

Please sign in to comment.