宇宙API
Cosmos API是用于与基于Cosmos SDK构建的应用程序进行交互的库。
安装
yarn add @lunie/cosmos-js
用
如何发送令牌的简单示例。
import Cosmos from "@lunie/cosmos-js"
const STARGATE_URL = "https://stargate.cosmos.network"
const ADDRESS = "cosmos1abcd1234"
const cosmos = Cosmos ( STARGATE_URL , ADDRESS )
// create the transaction object
const msg = cosmos
. MsgSend ( { toAddress : 'cosmos1abcd09876' , amounts : [ { denom : 'stake'
1