Developer Tools: Abstract
Last updated
Was this helpful?
Last updated
Was this helpful?
Abstract is an application development platform specially built for applications that are chain-agnostic (or abstracted š). The best place to read more about Abstract would be their documentation at:
In this page we will be introducing the tools provided by Abstracted that can help you speedrun through development on Xion
If youāre a brand new dev, Abstract infrastructure may be overwhelming to start with, so we recommend just checking out the and starting with the basic .
Abstract provides tools to build a re-usable or a standalone contract. Re-usable contracts are also referred as "Modules".
Spin up a new project using:
cw-orchestrator is an advanced testing and deployment tool for CosmWasm smart-contracts. Itās designed to make it easy to test and deploy contracts in a variety of environments including cw-multi-test, local, testnet, and mainnet.
If you bootstrap the codebase using the Abstract module template mentioned above you should have cw-orchestrator setu up already.
just schema
`just
is a command line tool to manage and execute project specific commands. A project bootstrapped using Abstract Module Template (above) comes with handy just
commands defined. eg., just schema
will generate schema files in the project (should be executed if any changes are made to messages and responses)
See /justfile
in project root for all commands
Abstract's JS SDK works well with both Xion's meta-accounts and EOAs.
Abstract provides templates to build and debug using regular EOAs on the Xion chain. However in production environment we highly recommend using meta-accounts to be able to leverage the true power of the chain and UX :)
Notes:
This example has a ādev modeā which uses EOAs as the executor using grazProvider
. This should be used when developing the application else you will run into permissions errors.
The example also demonstrates a āuser modeā using the XION modal. We recommend having separate AbstractProvider
s for developer and user routes.
Codegen
When your contract devs have defined the messages for your contracts, run just schema
to make the schemas available for codegen.
Ensure that the abstract.config.js
is configured with the proper folders
Use the autogenerated module code to interact with the contracts
Get ready to publish
Add a seed phrase in the TEST_MNEMONIC
in .env
Publish your contract onchain with just publish
Publish your schemas with just publish-schemas <namespace> <name> <version>
. This will give your contract auto-generated UIs in the Console.
The Abstract Module Template is a starting point for developing composable smart-contracts, or "Modules" on the Abstract platform. To learn more about Abstract Accounts, please see the . To read more about modules, please see the .
Refer the for latest updates and instructions on spinning up. This documentation and the repository's updates might go out of sync.
The includes a frontend folder scaffolded with React, next.js, and graz as the Cosmos wallet connector.
An example frontend of a betting app deployed on XION can be found here:
Run abstract generate
(CLI docs ).
Use the generated code (src/_generated
) to interact with your app. There is already an example for use of cw20
contract. Refer the wagemos
examples:
This can be from Keplr or another Cosmos Wallet. Add XION or by connecting to the .
Ensure that you have funds in the address. On testnet, new XION Meta accounts all have 1 XION so sign-in and send funds to this address.
This will create a new Abstract Account, claim the namespace (configured in your app), and publish the contracts on-chain to the .