Skip to content

トランザクション作成#3

Open
Dragon-taro wants to merge 6 commits intomasterfrom
feature/create-tx
Open

トランザクション作成#3
Dragon-taro wants to merge 6 commits intomasterfrom
feature/create-tx

Conversation

@Dragon-taro
Copy link
Copy Markdown
Contributor

No description provided.

base_req: {
from: DELEGATOR_ADDRESS,
memo: "",
chain_id: sdk.chainID,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

base_req""でいいっぽい

@Dragon-taro
Copy link
Copy Markdown
Contributor Author

cosmos-clientを0.4.2にしたら動きますが、push忘れました、、😭
ちなみにCORSで引っ掛かりました

Copy link
Copy Markdown
Contributor Author

@Dragon-taro Dragon-taro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lcnemのライブラリのバグ?

server{
charset utf-8;

location / {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CORS回避

src/App.tsx Outdated
const unsinedTxs = await staking.postDelegation(
sdk,
AccAddress.fromBech32(DELEGATOR_ADDRESS),
delegationReq
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jsonのparseでこける

TypeError: this is not a constructor
    at Object.t.fromJSON [as cosmos-sdk/MsgDelegate] (msg-delegate.js:38)
    at Array.<anonymous> (amino.js:36)
    at JSON.parse (<anonymous>)
    at Object.t.fromJSONString (amino.js:32)
    at e.<anonymous> (cosmos-sdk.js:105)
    at cosmos-sdk.js:33
    at Object.next (cosmos-sdk.js:14)
    at a (cosmos-sdk.js:5)

ちなみにjson自体は想定通りのものが返ってきてた↓↓

{
  "type": "cosmos-sdk/StdTx",
  "value": {
    "msg": [
      {
        "type": "cosmos-sdk/MsgDelegate",
        "value": {
          "delegator_address": "cosmos1z52hq26g5n3la3m8sucrpessx33dgedw3cgvn0",
          "validator_address": "cosmosvaloper1qdxmyqkvt8jsxpn5pp45a38ngs36mn2604cqk9",
          "amount": {
            "denom": "uatom",
            "amount": "1"
          }
        }
      }
    ],
    "fee": {
      "amount": [],
      "gas": "200000"
    },
    "signatures": null,
    "memo": ""
  }
}

src/App.tsx Outdated
const signedTxs = {
tx: {
...unsinedTxs.value,
signatures,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bad requestらしい

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.

1 participant