algodex / algodex-sdk

Client-side JavaScript SDK for Algodex as an npm package
https://docs-sdk.algodex.com
Mozilla Public License 2.0
8 stars 2 forks source link

♻ Refactor: Standard TEAL Interfaces #125

Closed PhearZero closed 2 years ago

PhearZero commented 2 years ago

ℹ Overview

Refactor of interfaces to mirror the integration tests process. This combines the API and TEAL test helpers to share the same logic and splits the contract compilation, structuring of transactions, and signing.

Standard Operating Procedure

This pattern has surfaced from development and is now the Standard Operating Procedure(SOP) for interacting with contracts. The pattern follows four distinct steps (Compile, Structure, Sign, and Propagate).

🏗 Compile (lsig, program):

Compile step takes the template arguments, generates a template and LogicSignature. This creates the inital "ContractState"

🗃 Structure (outerTxns aka structures):

Creates lists of Algorand Transactions based on the Compile step's lsig output.

🔑 Sign (wallet)

Signs the list of outerTxns(aka a transaction structure) from the structure step

🚀 Propagate (algod)

Sends the signed structures to the blockchain

create-issue-branch[bot] commented 2 years ago

Branch issue-125-♻_Refactor_Standard_TEAL_Interfaces created!