Agoric / documentation

User documentation
https://agoric.com/documentation/
Apache License 2.0
14 stars 38 forks source link

Page 3 - Create dapp-Orchestration-Basics dapp #943

Open sufyaankhan opened 5 months ago

sufyaankhan commented 5 months ago

Product Requirements Document (PRD) for Dapp-Orchestration-Basics

Goal: To create dapp-orchestration-basics dapp that allows Developer to deploy locally and play with cross-chain swap e.g. how to swap assets cross-chain. e.g. Swap ETH to BLD

Screenshot 2024-02-20 at 1 06 42 PM

1. Introduction

1.1 Purpose

The Dapp-Orchestration-Basics aims to leverage Agoric's Orchestration API to facilitate a seamless cross-chain swap of assets, specifically enabling users to exchange IST (Interchain Standard Token) for Osmosis tokens.

1.2 Scope

This document outlines the functional and design specifications for the Dapp-Orchestration-Basics. It covers features such as wallet connection, asset display, cross-chain swapping, and wallet updates utilizing the Agoric Orchestration API.

1.3 Document Conventions

Agoric follows the Agoric Company Style Guide for UI elements and design principles.

2. Stakeholders

Key stakeholders for this Dapp are users interested in cross-chain asset swaps, with a focus on the Agoric platform and its Orchestration API.

3. Functional Requirements

3.1 Wallet Connection

3.1.1 Connect Wallet Button Upon launching the Dapp, a "Connect Wallet" button should be prominently displayed, allowing users to log in and connect their Kepler wallet.

3.1.2 Asset Balances Once the Kepler wallet is connected, the Dapp should display the amount of IST owned by the user.

3.2 Cross-Chain Swapping

3.2.1 Asset Selection Users should be able to select IST as the asset they want to swap and choose Osmosis tokens as the desired asset.

3.2.2 Swap Execution The Dapp should have a "SWAP" button that, when clicked, interacts with Agoric's Orchestration API to execute a cross-chain swap of the specified assets.

3.2.3 Confirmation Provide a confirmation message to the user after a successful cross-chain swap, displaying details such as the amount swapped and relevant transaction information.

3.2.4 Insufficient Assets Handling If there are not enough IST in the wallet, display a graceful error message instructing the user to acquire more IST.

3.3 Wallet and Balance Update

3.3.1 Wallet/Balance Display The UI should show the updated wallet and balance information after a successful cross-chain swap.

3.4 Click and Learn

3.4.1 Sample Code The Dapp should provide a section displaying sample code for interacting with Agoric's Orchestration API for cross-chain swaps.

3.4.2 Reference Docs Include links to reference documentation guiding users on wallet interactions, cross-chain swapping, and related functionalities using Agoric's Orchestration API.

dckc commented 3 months ago

for this swap scenario, some corresponding design stuff: