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

Custom wallet API #163

Merged
merged 24 commits into from
Jun 9, 2023
Merged

Custom wallet API #163

merged 24 commits into from
Jun 9, 2023

Conversation

bartolomej
Copy link
Member

@bartolomej bartolomej commented Jun 7, 2023

This PR adds a concept of a "managed account", which is an account whose private keys are known by Flowser.

Managed accounts can be created and used to automatically authorize/send transactions through our new wallet API.

Changes

  • Implement a simple wallet API that allows us to:
    • execute transactions without manual authorization by the user (with fcl-dev-wallet we used previously)
    • create new managed accounts that can be used to authorize transactions automatically
  • automatically import managed accounts from project's flow.json config
  • other improvements & fixes

Wallet API

Create account

This creates a new "managed account" and returns its info.

http POST localhost:6061/api/wallets/accounts

Send a transaction

This will send a transaction given the authorizer/payer/proposer account addresses and Cadence source code.

All the provided account addresses must be "managed accounts".

http POST localhost:6061/api/wallets/accounts/transaction \
  proposerAddress=0x01cf0e2f2f715450 \
  payerAddress=0x01cf0e2f2f715450 \
  authorizerAddresses:='["0x01cf0e2f2f715450"]' \
  cadence='transaction { prepare(signer: AuthAccount) { log(signer.address) } }'

@bartolomej bartolomej changed the title Custom wallet Custom wallet API Jun 9, 2023
@bartolomej bartolomej merged commit b32d5b9 into main Jun 9, 2023
@bartolomej bartolomej deleted the custom_wallet branch June 9, 2023 13:05
@bartolomej
Copy link
Member Author

Implemented in the scope of onflow/developer-grants#150

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.

1 participant