Access Guide To access TRS-SDK development, developers need to follow these steps:
Build front/back end projects that support TypeScript.
Install Solana dependencies, Solana network connections, and Solana wallet connections.
Copy TRS-SDK files to the project.
Implement business logic according to interface document. These four steps are described in detail below. (This document code is based on the development of TypeScript+Vue project.)
Step 1:Build front/back end projects that support TypeScript.
Front-end projects support the three major front-end frameworks Vue, React, and Angular, while front/back end projects must support TypeScript.
Create a new tool file solana.ts, which contains network connections, wallet connections, methods to get USDC address , and other components that can be imported to call methods. Solana Wallet is based on Phantom Wallet, and the token supported is USDC.The API reference address of Phantom Wallet: https://docs.phantom.app/integrating/establishing-a-connection Store is a state management library based on the Vuex and allows multiple components to share state.
###Step 3:Copy TRS-SDK files to the project. TRS-SDK GitHub Adrress: https://github.com/jdj1027/solana-trs-sdk Project Demo creates a new utils/solana file, and places solana.ts and the copied files in step 2 in the solana directory as shown below: ###Step 4:Implement business logic according to interface document. TRS-SDK interface document address:: http://1.14.142.22:8553/web/#/29/329 For example, 1.4 User Adding a Product Request URL: trs.ts/addProduct means to call the addProduct method in utils/solana/ TRS /trs.ts For example, 1.5 User Subscribing to the product Request URL: trs.ts/buyTrs means to call the buyTrs method in utils/solana/ TRS /trs.ts Project Demo code