Skip to content
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: support multiple recipients in rpc send transfer method, closes #5174 #5178

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

alter-eggo
Copy link
Contributor

@alter-eggo alter-eggo commented Apr 8, 2024

Try out Leather build 6fd3bc3Extension build, Test report, Storybook, Chromatic

This pr supports multiple recipients in rpc send transfer method

@alter-eggo alter-eggo linked an issue Apr 8, 2024 that may be closed by this pull request
src/app/pages/rpc-send-transfer/use-rpc-send-transfer.ts Outdated Show resolved Hide resolved
src/app/pages/rpc-send-transfer/use-rpc-send-transfer.ts Outdated Show resolved Hide resolved
message: RpcRequest<'sendTransfer', RpcSendTransferParams | SendTransferRequestParams>,
port: chrome.runtime.Port
) {
let params = message.params as RpcSendTransferParams;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imperative coding style. How can we do without reassigning var?

Copy link
Contributor Author

@alter-eggo alter-eggo Apr 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactored a bit
but left variable, we need to assign somewhere converted params 🤔

@alter-eggo alter-eggo force-pushed the feat/add-multi-recipient branch 2 times, most recently from 38cdc52 to cbb7159 Compare April 9, 2024 11:09
@alter-eggo alter-eggo marked this pull request as ready for review April 9, 2024 11:09
@markmhendrickson
Copy link
Collaborator

@alter-eggo is there a way to test this in the test app or elsewhere?

@alter-eggo
Copy link
Contributor Author

@markmhendrickson yes, I've added btn to test app
Screenshot 2024-04-09 at 15 43 40

@kyranjamie
Copy link
Collaborator

Screenshot 2024-04-09 at 13 55 36

@alter-eggo
Copy link
Contributor Author

@kyranjamie fixed, problem is on current dev as well

@alter-eggo alter-eggo added this pull request to the merge queue Apr 10, 2024
Merged via the queue into dev with commit a470a57 Apr 10, 2024
29 checks passed
@alter-eggo alter-eggo deleted the feat/add-multi-recipient branch April 10, 2024 12:20
@markmhendrickson
Copy link
Collaborator

@alter-eggo For updating the docs: It seems the developer can continue passing a string address value as recipient or an array of string values as recipients, correct?

@alter-eggo
Copy link
Contributor Author

@markmhendrickson yes, it's backwards compatible

@markmhendrickson
Copy link
Collaborator

I'm seeing now that previously / currently we have amount as the parameter. So by backwards compatible, you mean both amount and recipient are still supported, correct? Do we have tests that enforce this?

@alter-eggo
Copy link
Contributor Author

alter-eggo commented Apr 11, 2024

by backwards compatible I mean even if you pass address and amount - it will work. there are tests, but it can be tested as well in test app.
this fn converts legacy params to new ones:

export function convertRpcSendTransferLegacyParamsToNew(params: RpcSendTransferParamsLegacy) {
  return {
    recipients: [{ address: params.address, amount: params.amount }],
    network: params.network,
    account: params.account,
  };
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple recipient bitcoin sends
4 participants