Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import React from "react";
import "./App.css";

import Cosmos from "@lunie/cosmos-js";

const STARGATE_URL = "https://cosmos-mainnet-s-001.k80s.net/";
const ADDRESS = "cosmos1z52hq26g5n3la3m8sucrpessx33dgedw3cgvn0";
const cosmos = new Cosmos(STARGATE_URL, ADDRESS);

function App() {
console.log(cosmos);

/*
{
url: "https://cosmos-mainnet-s-001.k80s.net/",
get: {
url: "https://cosmos-mainnet-s-001.k80s.net/",
connected: ƒ,
nodeVersion: ƒ,
account: ƒ,
txs: ƒ
},
accounts: {},
chainId: "cosmos1z52hq26g5n3la3m8sucrpessx33dgedw3cgvn0",
MsgSend: ƒ(t, e),
MsgDelegate: ƒ(t, e),
MsgUndelegate: ƒ(t, e),
MsgRedelegate: ƒ(t, e),
MsgSubmitProposal: ƒ(t, e),
MsgVote: ƒ(t, e),
MsgDeposit: ƒ(t, e),
MsgWithdrawDelegationReward: ƒ(t, e),
default: ƒ(t, e),
MultiMessage: ƒ(t)
}
*/

const handleDelegation = async () => {
const msg = cosmos.MsgDelegate(ADDRESS, {
validator_address: "cosmosvaloper1qdxmyqkvt8jsxpn5pp45a38ngs36mn2604cqk9",
amount: 0.01,
denom: "STAKE"
});

console.log(msg);

/*
{
message: {
type: "cosmos-sdk/MsgDelegate",
value: {
type: "cosmos-sdk/MsgDelegate"
value:{
delegator_address: "cosmos1z52hq26g5n3la3m8sucrpessx33dgedw3cgvn0",
validator_address: "cosmosvaloper1qdxmyqkvt8jsxpn5pp45a38ngs36mn2604cqk9"
}
amount: {amount: "0.01", denom: "STAKE"}
}
},
simulate: ƒ(e),
send: ƒ(e, o)
};
*/
};

return (
<div>
hello
<button onClick={handleDelegation}>テスト</button>
</div>
);
}

export default App;
26 changes: 0 additions & 26 deletions src/App.tsx

This file was deleted.