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.
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.
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
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
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
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
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.
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
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
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