-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: send tokens #30
base: master
Are you sure you want to change the base?
Conversation
34535b3
to
464124a
Compare
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.
NIT: change the pincode string to a more meaningful variable
const sendTransaction = await wallet.sendManyOutputsSendTransaction(sendTransactionOutputs, { | ||
inputs: params.inputs || [], | ||
changeAddress: params.changeAddress, | ||
pinCode: '111111', |
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.
Magic string here. Assign a variable that holds the meaning of it.
IE stubPinCode
or dumbPinCode
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.
Done! Thanks
4cdf462
to
1d56a1b
Compare
network: z.string().min(1), | ||
outputs: z.array(z.object({ | ||
address: z.string().optional(), | ||
value: z.string().transform(val => BigInt(val)), |
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.
Isn't it optional when it's a data output?
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.
It is, changed it to optional and added a better refine method to make it required only when not data output
if (typedOutput.type === 'data') { | ||
(typedOutput as unknown as { value: bigint }).value = BigInt(1); | ||
typedOutput.token = '00'; | ||
} |
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.
Do you need this? I think the lib method already handles it in case of a data output
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.
We actually do need it because prepareTxData
doesn't add the 1 HTR to data outputs.
Acceptance Criteria
sendTransaction
RPC request properlyChecklist
master
, confirm this code is production-ready and can be included in future releases as soon as it gets merged