Skip to content

Latest commit

 

History

History
18 lines (11 loc) · 1.99 KB

README.md

File metadata and controls

18 lines (11 loc) · 1.99 KB

Example transaction submission to Althea-L1 using Metamask and altheajs

This site is a simple React page with the ability to query an account on Althea-L1 / submit a bank MsgSend or microtx MsgLiquify transaction signed by MetaMask to Althea-L1.

Message submission flow

The UI for message submission is nested under a simple tab-based interface and consists of one of two components: SubmitMsgSend or SubmitMsgLiquify. Any message to be submitted must have a @bufbuild-based protobuf definition (note that hosting using buf.build is optional, Althea-L1 currently uses both hosted and github-based proto definitions), see the microtx module's defintions here. Additionally, the message must implement the LegacyAmino LegacyMsg interface, so check that the Msgs have Type() and GetSignBytes() implemented.

The message generation starts after the user has verified their pubkey by signing a simple string "Verify Public Key" defined in the metamask service. One of the SubmitMsg* components will then present several simple text input fields which will be used to populate the associated Msg. Once the user clicks SubmitTx the parameters are collected, formatted, and packed for use by the SignEIP712CosmosTx() function and the result is then passed to BroadcastEIP712Tx() in the broadcast service.

Resources

See altheajs for more info about the javascript/typescript libraries used.

See Althea-L1 for proto source definitions, chain logic, solidity contracts, and more!