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

SCP-3069: Hello world demo app integrating Nami wallet with the PAB #196

Merged
merged 1 commit into from
Dec 16, 2021

Conversation

koslambrou
Copy link
Contributor

@koslambrou koslambrou commented Dec 15, 2021

Very simple demo app which demonstrates how to integrate the PAB with a light wallet (Nami in this case, but should work with other light wallets which respect the CIP-0030 standard.).

Pre-submit checklist:

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
    • Relevant tickets are mentioned in commit messages
    • Formatting, materialized Nix files, PNG optimization, etc. are updated
  • PR
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

@szg251
Copy link
Contributor

szg251 commented Dec 15, 2021

Would love to see a more involved transaction, with validator scripts, datums etc. Is it also planned?

@koslambrou
Copy link
Contributor Author

@gege251 Yes, that will be the next step. This PR is more about a "hello world" type example for setting everything up.

@koslambrou koslambrou force-pushed the scp-3069-pab-nami-demo branch 2 times, most recently from 0973bb8 to 0bae4d4 Compare December 16, 2021 13:00
Co-authored-by: Jamie Bertram <jamie.bertram@tweag.io>
@koslambrou koslambrou marked this pull request as ready for review December 16, 2021 15:06
@koslambrou koslambrou merged commit 7bb80c0 into main Dec 16, 2021
@koslambrou koslambrou deleted the scp-3069-pab-nami-demo branch December 16, 2021 20:27
Comment on lines +11 to +19
exports.getWalletIdImpl = () => {
return Promise.all([window.cardano.getUsedAddresses(), window.cardano.getUnusedAddresses()])
.then(([walletUsedAddresses, walletUnusedAddresses]) => {
const addresses = walletUnusedAddresses.concat(walletUsedAddresses)
return require('blake2b')(20)
.update(Buffer.from(addresses.map(a => a.to_bech32).join('')))
.digest('hex')
})
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@koslambrou does this generate a WalletId compatible with the WBE?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes this uses the same hash algorithm as the one used in WBE

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.

4 participants