Coder Social home page Coder Social logo

agoralabs-sh / avm-web-provider Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 1.8 MB

A TypeScript implementation that allows clients to connect and interact with web-based providers.

Home Page: https://avm-web-provider.agoralabs.sh

License: MIT License

JavaScript 7.48% Shell 2.44% TypeScript 90.08%
algorand algosdk arc0027 avm blockchain voi

avm-web-provider's People

Contributors

agoralabs-bot avatar kieranroneill avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

omahs

avm-web-provider's Issues

Add `avm-web-provider` to `use-wallet`

Summary

As TxnLab/use-wallet is used by many dApps, and the BroadcastChannel method has become deprecated, it is time to use the new avm-web-provider as an SDK.

Notes

  • Include instructions on how to install the new SDK.
  • UseWallet uses Node 18.20.3

Implement dApp and provider (wallet) initalization

Summary

The first part of the application will allow a dApp or provider (wallet) to initialize the SDK.

Acceptance criteria

Scenario 1: dApp initializes the SDK
GIVEN a dApp has installed the package
WHEN the dApp calls init
THEN the dApp can start using methods

Scenario 2: provider (wallet) initializes the SDK
GIVEN a provider (wallet) has installed the package
WHEN the provider (wallet) calls init
THEN the provider (wallet) can start using methods

Notes

  • Include a "Getting Started" section in the documentation.

Implement `discover` method

Summary

The discover method allows dApps to get information about a provider (wallet) including the supported methods and the supported networks.

Acceptance criteria

Scenario 1: dApp gets information about the Provider
GIVEN a dApp has initialized the SDK
AND a Provider as initialized the SDK
WHEN the dApp calls discover
THEN the Provider responds with information about itself

Notes

  • Include documentation for "Discovering Providers" in the "Clients" section
  • Include documentation for "Responding To A Dsicover Request" in the "Providers" section

Implement `disable` method

Summary

The disable method requests that a client be removed from a provider.

Acceptance criteria

Scenario 1: Provider receives receives a disable request
GIVEN a Client has initialized the SDK
AND a Provider as initialized the SDK
WHEN the Client calls disable
THEN the Provider responds to the disable request
AND the Client receives a response

Notes

  • Include documentation for "Disabling A Client" in the "Clients" section
  • Include documentation for "Responding To A Disable Request" in the "Providers" section

Implement `sign_message` method

Summary

The sign_message signs an arbitrary UTF-8 string.

Acceptance criteria

Scenario 1: Provider receives a sign message request
GIVEN a Client has initialized the SDK
AND a Provider as initialized the SDK
WHEN the Client calls sign_message
THEN the Provider receives the UTF-8 string to sign
AND the Provider returns the signature

Notes

  • Include documentation for "Signing A Message" in the "Clients" section
  • Include documentation for "Responding To A Sign Message Request" in the "Providers" section

Implement `sign_transactions` method

Summary

The sign_transactions method sends unsigned transactions to the provider to sign.

Acceptance criteria

Scenario 1: Provider receives unsigned transactions to sign
GIVEN a Client has initialized the SDK
AND a Provider as initialized the SDK
WHEN the Client calls sign_transactions
THEN the Provider receives a list of unsigned transactions

Notes

  • Include documentation for "Sign Transactions" in the "Clients" section
  • Include documentation for "Responding To A Sign Transactions Request" in the "Providers" section

Expose full request message to provider listener

Summary

As providers have been implemented, it is clear they need the full request message. This is especially true for BroadcastChannel as extensions tend to inject content scripts into each webpage and if multiple webpages of the same domain are open, a broadcast from one of these pages will be received to each content script.

Implement `enable` method

Summary

The enable method requests that clients get access to the provider's user-curated list of authorized accounts.

Acceptance criteria

Scenario 1: Client gets user-curated list of a Provider's authorized accounts
GIVEN a Client has initialized the SDK
AND a Provider as initialized the SDK
WHEN the Client calls enable
THEN the Provider responds with a user-curated list of authorized accounts

Notes

  • Include documentation for "Enabling A Client" in the "Clients" section
  • Include documentation for "Responding To An Enable Request" in the "Providers" section

Implement `post_transactions` method

Summary

The post_transactions method sends sign transactions to the provider to post to the network.

Acceptance criteria

Scenario 1: Provider receives signed transactions to post
GIVEN a Client has initialized the SDK
AND a Provider as initialized the SDK
WHEN the Client calls post_transactions
THEN the Provider receives a list of signed transactions

Notes

  • Include documentation for "Posting Transactions" in the "Clients" section
  • Include documentation for "Responding To A Post Transaction Request" in the "Providers" section

Implement `sign_and_post_transactions` method

Summary

The sign_and_post_transactions method sends unsigned transactions to the provider to sign and post to the network.

Acceptance criteria

Scenario 1: Provider receives unsigned transactions to sign and post
GIVEN a Client has initialized the SDK
AND a Provider as initialized the SDK
WHEN the Client calls sign_and_post_transactions
THEN the Provider receives a list of unsigned transactions

Notes

  • Include documentation for "Sign & Post Transactions" in the "Clients" section
  • Include documentation for "Responding To A Sign & Post Transaction Request" in the "Providers" section

Expose message entities

Summary

Message entities in the src/messages are helpful to construct messages and should be exposed for apps to use.

Setup repository and scaffolding

Summary

Setup the repository and the basic scaffolding.

Notes

  • At the very least, a "Hello World" app can be compiled and built.
  • Add CI/CD

Bundle single JavaScript file for non-package manager apps

Summary

For dApps that do not support package managers, there needs to be another way to install the SDK.

This can be done using the more traditional method of downloading the JavaScript from a CDN (GitHub release) and use a HTML script tag the HTML file.

Notes

  • Use webpack to bundle the code.
  • Use the release files to host the JavaScript file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.