2.0.9 • Published 4 years ago
@terra-money/core v2.0.9
Terra Javascript Library
This project provides Javascript & Node.js SDK library for Core of Terra.
Example
const mnemonic = terra.generateMnemonic()
const masterKey = terra.deriveMasterKeySync(mnemonic)
const keypair = terra.deriveKeypair(masterKey)
const accAddr = terra.getAccAddress(keypair.publicKey)
const msgSend = terra.buildSend([
{
"amount": "1000000",
"denom": "uluna"
}
], accAddr, "terra1ptdx6akgk7wwemlk5j73artt5t6j8am08ql3qv");
const stdTx = terra.buildStdTx([msgSend], {
"gas": "200000",
"amount": [
{
"amount": "1000",
"denom": "uluna"
}
]
}, "library test")
const jsonTx = stdTx.value
const txSignature = terra.sign(jsonTx, keypair, {
sequence: "0",
account_number: "167",
chain_id: "soju-0009"
})
const signedTx = terra.createSignedTx(stdTx.value, txSignature)
const broadcastBody = terra.createBroadcastBody(signedTx, "block")
// get txid
stdTx.value = signedTx
const txbytes = terra.getAminoDecodedTxBytes(stdTx)
const txhash = terra.getTxHash(txbytes)
console.log(accAddr, broadcastBody, txhash)
Functions for building various messages
- buildExchangeRatePrevote
- buildExchangeRateVote
- buildSend
- buildMultiSend
- buildSwap
- buildDelegate
- buildRedelegate
- buildSetWithdrawAddress
- buildUndelegate
- buildWithdrawDelegatorReward
- buildDeposit
- buildVote
2.0.9
4 years ago
2.0.8
4 years ago
2.0.7
4 years ago
2.0.6
4 years ago
2.0.5
4 years ago
2.0.4
4 years ago
2.0.3
4 years ago
2.0.2
4 years ago
2.0.1
4 years ago
2.0.0
4 years ago
2.0.0-alpha.3
4 years ago
2.0.0-alpha.2
5 years ago
2.0.0-alpha.1
5 years ago
1.0.16
5 years ago
1.0.15
5 years ago
1.0.14
5 years ago
1.0.13
5 years ago
1.0.12
5 years ago
1.0.11
5 years ago
1.0.10
5 years ago
1.0.9
5 years ago
1.0.8
5 years ago
1.0.7
5 years ago
1.0.6
5 years ago
1.0.5
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago