Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stride MsgLiquidStake and MsgRedeemStake #10

Merged
merged 2 commits into from
Feb 23, 2023
Merged

Conversation

emidev98
Copy link
Contributor

@emidev98 emidev98 commented Feb 23, 2023

Basic Stride functionality to create an LSD from a native coin and redeem the native coin from the LSD. Code Example:

import { MsgLiquidStake, LCDClient, MnemonicKey, Wallet, isTxError } from "@terra-money/feather.js";

const lcd = new LCDClient({
    "stride-testnet-1": {
        "lcd": "https://stride.testnet-1.stridenet.co/api",
        "chainID": "stride-testnet-1",
        "gasAdjustment": 2,
        "gasPrices": {
            "ustrd": 0
        },
        "prefix": "stride",
    },
});
const acc = new MnemonicKey({
    mnemonic: "...",
    coinType: 118
});
const wallet = new Wallet(lcd, acc);

(async () => {
    const liquidStakeMsg = new MsgLiquidStake(
        "...",
        "100000",
        "uluna"
    );

    try {
        const lsdMsgTx = await wallet.createAndSignTx({
            msgs: [liquidStakeMsg],
            chainID: "stride-testnet-1",
        });
        const sendTxResult = await lcd.tx.broadcastAsync(lsdMsgTx, "stride-testnet-1");
        console.log(sendTxResult);
    } catch (e) {
        console.log(e);
    }
})();

Depends on terra-money/terra.proto#21

@alecande11 alecande11 merged commit 3761ee5 into main Feb 23, 2023
@alecande11 alecande11 deleted the feat/stride/msgs branch February 23, 2023 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants