-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change signature of ClientOption.signTransaction to be able to pass KeyPair #1079
Changes from 2 commits
3bf1526
df4113c
5bfb067
4094085
239feeb
4066b92
bb5bfbf
f096839
0cffc53
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -18,10 +18,18 @@ export const basicNodeSigner = ( | |||||
networkPassphrase: string, | ||||||
) => ({ | ||||||
// eslint-disable-next-line require-await | ||||||
signTransaction: async (tx: string) => { | ||||||
const t = TransactionBuilder.fromXDR(tx, networkPassphrase); | ||||||
t.sign(keypair); | ||||||
return t.toXDR(); | ||||||
signTransaction: async (tx: string, signer?: () | KeyPair, opts?: { | ||||||
network?: string; | ||||||
networkPassphrase?: string; | ||||||
accountToSign?: string;) => { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. neither is |
||||||
if(signer instanceof KeyPair){ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. formatting nit:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We've had issues in the past with using |
||||||
const basicSigner = basicNodeSigner(signer, opts.networkPassphrase); | ||||||
return basicSigner.signTransaction(tx); | ||||||
} else{ | ||||||
const t = TransactionBuilder.fromXDR(tx, networkPassphrase); | ||||||
t.sign(keypair); | ||||||
return t.toXDR(); | ||||||
} | ||||||
}, | ||||||
// eslint-disable-next-line require-await | ||||||
signAuthEntry: async (entryXdr: string): Promise<string> => | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
network
doesn't appear to be used here