-
Notifications
You must be signed in to change notification settings - Fork 300
feat(express): migrated sendmany as type route #7398
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
base: master
Are you sure you want to change the base?
feat(express): migrated sendmany as type route #7398
Conversation
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.
LGTM
7abc5ce
4f0014c to
7abc5ce
Compare
| * @param req | ||
| */ | ||
| async function handleV2SendMany(req: express.Request) { | ||
| async function handleV2SendMany(req: ExpressApiRouteRequest<'express.v2.wallet.sendmany', 'post'>) { |
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.
While this works, we lose the type saftey of api-ts when using things like createTSSSendParams and createSendParams. Can we have a follow up to fix these?
As long as we have those two utilities, the codec and the actual request body we are acting on won't be aligned.
| * This endpoint supports the full set of parameters available in the BitGo SDK | ||
| * for building, signing, and sending transactions to multiple recipients. | ||
| */ | ||
| export const SendManyRequestBody = { |
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.
How can everything be optional?
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.
These codecs will eventually generate our api-docs, so it will be an issue if we advertise params as required, then change to optional, then back to required.
| /** Transaction request object */ | ||
| txRequest: t.unknown, |
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.
This will look like a breaking change in our docs.
Please cross-reference https://developers.bitgo.com/reference/expresswalletsendmany to ensure we aren't introducing breaking changes, and if we are, we should only be introducing them to match what the code is currently doing.
Ticket: WP-5427