Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
Cosmos js (#1701)
Browse files Browse the repository at this point in the history
* increase gas amplifier

* fix payload construction

handle payload atomic construction

* More accurate gas amplifier

* increase gas amplifier

* use same node for calculation and broadcast

* fix amount payload

* fix fees/gas calculation

* fix signature

fix public key when account is derivate

* fix fees regression

* More accurate pubkey selection

* don't use extra.tx_bytes

* fix pubkey selection

* simplify hex serialization

* update transaction: more strict types

* many things

restruct operation builder
simulate now return int
prepareTransaction use patch format

* accuracy

more accuracy int value
small refactor

* remove useless isPreValidation

* fix strange edge effect of ledger live desktop

* Update xpub during sync

* temporary enable log for bot

Co-authored-by: Alexandre Alouit <[email protected]>
  • Loading branch information
wa-aal and alexalouit authored Feb 14, 2022
1 parent 92bbbf1 commit 56887dc
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 101 deletions.
6 changes: 3 additions & 3 deletions src/families/cosmos/api/Cosmos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export const getBlock = async (height: number): Promise<any> => {
}
};

export const simulate = async (tx_bytes: Array<any>): Promise<any> => {
export const simulate = async (tx_bytes: Array<any>): Promise<BigNumber> => {
try {
const { data } = await network({
method: "POST",
Expand All @@ -272,9 +272,9 @@ export const simulate = async (tx_bytes: Array<any>): Promise<any> => {
},
});

return data;
return new BigNumber(data?.gas_info?.gas_used || 0);
} catch (e) {
return undefined;
return new BigNumber(0);
}
};

Expand Down
39 changes: 5 additions & 34 deletions src/families/cosmos/js-buildTransaction.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,10 @@
import { Account } from "../../types";
import { Transaction } from "./types";
import { getAccount } from "./api/Cosmos";
import { encodePubkey, makeAuthInfoBytes } from "@cosmjs/proto-signing";
import { SignMode } from "cosmjs-types/cosmos/tx/signing/v1beta1/signing";
import BigNumber from "bignumber.js";

const buildTransaction = async (
account: Account,
transaction: Transaction,
pubKey?: string
transaction: Transaction
): Promise<any> => {
const defaultGas = new BigNumber(250000);
const defaultFees = new BigNumber(2500);

const { sequence } = await getAccount(account.freshAddress);

const pubkey = encodePubkey({
type: "tendermint/PubKeySecp256k1",
value: Buffer.from(pubKey || account.seedIdentifier, "hex").toString(
"base64"
),
});

const msg: Array<{ typeUrl: string; value: any }> = [];

// Ledger Live is able to build transaction atomically,
Expand Down Expand Up @@ -173,23 +156,11 @@ const buildTransaction = async (
break;
}

const authInfoBytes = makeAuthInfoBytes(
[{ pubkey, sequence }],
[
{
amount: transaction.fees?.toString() || defaultFees.toString(),
denom: account.currency.units[1].code,
},
],
transaction.gas?.toNumber() || defaultGas.toNumber(),
SignMode.SIGN_MODE_LEGACY_AMINO_JSON
);
if (!isComplete) {
return [];
}

return {
messages: msg,
auth: authInfoBytes,
isComplete,
};
return msg;
};

export default buildTransaction;
19 changes: 8 additions & 11 deletions src/families/cosmos/js-getTransactionStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ import { isValidRecipent } from "./api/Cosmos";

export const getTransactionStatus = async (
a: Account,
t: Transaction,
isPreValidation = false
t: Transaction
): Promise<TransactionStatus> => {
if (t.mode === "send") {
// We isolate the send transaction that it's a little bit different from the rest
return await getSendTransactionStatus(a, t, isPreValidation);
return await getSendTransactionStatus(a, t);
} else if (t.mode === "delegate") {
return await getDelegateTransactionStatus(a, t, isPreValidation);
return await getDelegateTransactionStatus(a, t);
}

const errors: StatusErrorMap = {};
Expand Down Expand Up @@ -87,7 +86,7 @@ export const getTransactionStatus = async (

const estimatedFees = t.fees || new BigNumber(0);

if (!isPreValidation && !t.fees) {
if (!t.fees) {
errors.fees = new FeeNotLoaded();
}

Expand Down Expand Up @@ -129,8 +128,7 @@ export const getTransactionStatus = async (

const getDelegateTransactionStatus = async (
a: Account,
t: Transaction,
isPreValidation = false
t: Transaction
): Promise<TransactionStatus> => {
const errors: StatusErrorMap = {};
const warnings: StatusErrorMap = {};
Expand Down Expand Up @@ -159,7 +157,7 @@ const getDelegateTransactionStatus = async (

const estimatedFees = t.fees || new BigNumber(0);

if (!isPreValidation && !t.fees) {
if (!t.fees) {
errors.fees = new FeeNotLoaded();
}

Expand Down Expand Up @@ -190,8 +188,7 @@ const getDelegateTransactionStatus = async (

const getSendTransactionStatus = async (
a: Account,
t: Transaction,
isPreValidation = false
t: Transaction
): Promise<TransactionStatus> => {
const errors: StatusErrorMap = {};
const warnings: StatusErrorMap = {};
Expand All @@ -216,7 +213,7 @@ const getSendTransactionStatus = async (

const estimatedFees = t.fees || new BigNumber(0);

if (!isPreValidation && (!t.fees || !t.fees.gt(0))) {
if (!t.fees || !t.fees.gt(0)) {
errors.fees = new FeeNotLoaded();
}

Expand Down
110 changes: 73 additions & 37 deletions src/families/cosmos/js-prepareTransaction.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { Account } from "../../types";
import { Transaction } from "./types";
import BigNumber from "bignumber.js";
import { simulate } from "./api/Cosmos";
import { Registry, TxBodyEncodeObject } from "@cosmjs/proto-signing";
import { getAccount, simulate } from "./api/Cosmos";
import {
encodePubkey,
makeAuthInfoBytes,
Registry,
TxBodyEncodeObject,
} from "@cosmjs/proto-signing";
import { SignMode } from "cosmjs-types/cosmos/tx/signing/v1beta1/signing";
import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";
import {
MsgDelegate,
Expand All @@ -18,64 +24,94 @@ const prepareTransaction = async (
account: Account,
transaction: Transaction
): Promise<Transaction> => {
const patch: Partial<Transaction> = {};

let gasQty = new BigNumber(250000);
const gasPrice = new BigNumber(getEnv("COSMOS_GAS_PRICE"));

if (transaction.useAllAmount) {
transaction.amount = getMaxEstimatedBalance(
patch.amount = getMaxEstimatedBalance(
account,
account.balance
.dividedBy(new BigNumber(getEnv("COSMOS_GAS_AMPLIFIER")))
.integerValue(BigNumber.ROUND_CEIL)
.integerValue()
);
}

if (transaction.mode !== "send" && !transaction.memo) {
transaction.memo = "Ledger Live";
patch.memo = "Ledger Live";
}

const unsignedPayload = await buildTransaction(account, transaction);

// be sure payload is complete
if (!unsignedPayload.isComplete) return transaction;
if (unsignedPayload) {
const txBodyFields: TxBodyEncodeObject = {
typeUrl: "/cosmos.tx.v1beta1.TxBody",
value: {
messages: unsignedPayload,
},
};

const txBodyFields: TxBodyEncodeObject = {
typeUrl: "/cosmos.tx.v1beta1.TxBody",
value: {
messages: unsignedPayload.messages,
},
};
const registry = new Registry([
["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate],
["/cosmos.staking.v1beta1.MsgUndelegate", MsgUndelegate],
["/cosmos.staking.v1beta1.MsgBeginRedelegate", MsgBeginRedelegate],
[
"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",
MsgWithdrawDelegatorReward,
],
]);

const registry = new Registry([
["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate],
["/cosmos.staking.v1beta1.MsgUndelegate", MsgUndelegate],
["/cosmos.staking.v1beta1.MsgBeginRedelegate", MsgBeginRedelegate],
[
"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",
MsgWithdrawDelegatorReward,
],
]);
const { sequence } = await getAccount(account.freshAddress);

const txBodyBytes = registry.encode(txBodyFields);
const pubkey = encodePubkey({
type: "tendermint/PubKeySecp256k1",
value: Buffer.from(account.seedIdentifier, "hex").toString("base64"),
});

const txRaw = TxRaw.fromPartial({
bodyBytes: txBodyBytes,
authInfoBytes: unsignedPayload.auth,
signatures: [new Uint8Array(Buffer.from(account.seedIdentifier, "hex"))],
});
const txBodyBytes = registry.encode(txBodyFields);

const tx_bytes = Array.from(Uint8Array.from(TxRaw.encode(txRaw).finish()));
const authInfoBytes = makeAuthInfoBytes(
[{ pubkey, sequence }],
[
{
amount:
transaction.fees?.toString() || new BigNumber(2500).toString(),
denom: account.currency.units[1].code,
},
],
transaction.gas?.toNumber() || new BigNumber(250000).toNumber(),
SignMode.SIGN_MODE_LEGACY_AMINO_JSON
);

const simulation = await simulate(tx_bytes);
const txRaw = TxRaw.fromPartial({
bodyBytes: txBodyBytes,
authInfoBytes,
signatures: [new Uint8Array(Buffer.from(account.seedIdentifier, "hex"))],
});

const gasPrice = new BigNumber(getEnv("COSMOS_GAS_PRICE"));
const tx_bytes = Array.from(Uint8Array.from(TxRaw.encode(txRaw).finish()));

const gasUsed = await simulate(tx_bytes);

if (gasUsed.gt(0)) {
gasQty = gasUsed
// Don't known what is going on,
// Ledger Live Desktop return half of what it should,
// Ledger Live Common CLI do the math correctly.
// Use coeff 2 as trick..
// .multipliedBy(new BigNumber(getEnv("COSMOS_GAS_AMPLIFIER")))
.multipliedBy(new BigNumber(getEnv("COSMOS_GAS_AMPLIFIER") * 2))
.integerValue();
}
}

transaction.gas = new BigNumber(simulation?.gas_info?.gas_used || 60000)
.multipliedBy(new BigNumber(getEnv("COSMOS_GAS_AMPLIFIER")))
.integerValue(BigNumber.ROUND_CEIL);
patch.gas = gasQty;

transaction.fees = gasPrice
.multipliedBy(transaction.gas)
.integerValue(BigNumber.ROUND_CEIL);
patch.fees = gasPrice.multipliedBy(gasQty).integerValue();

return transaction;
return { ...transaction, ...patch };
};

export default prepareTransaction;
50 changes: 36 additions & 14 deletions src/families/cosmos/js-signOperation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import type { Transaction } from "./types";
import { getAccount, getChainId } from "./api/Cosmos";
import { Observable } from "rxjs";
import { withDevice } from "../../hw/deviceAccess";
import { Registry, TxBodyEncodeObject } from "@cosmjs/proto-signing";
import {
encodePubkey,
makeAuthInfoBytes,
Registry,
TxBodyEncodeObject,
} from "@cosmjs/proto-signing";
import { SignMode } from "cosmjs-types/cosmos/tx/signing/v1beta1/signing";
import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";
import { encodeOperationId } from "../../operation";
import { LedgerSigner } from "@cosmjs/ledger-amino";
Expand All @@ -16,6 +22,8 @@ import {
MsgBeginRedelegate,
} from "cosmjs-types/cosmos/staking/v1beta1/tx";
import { MsgWithdrawDelegatorReward } from "cosmjs-types/cosmos/distribution/v1beta1/tx";
import BigNumber from "bignumber.js";
import { log } from "@ledgerhq/logs";

const aminoTypes = new AminoTypes({ prefix: "cosmos" });

Expand Down Expand Up @@ -61,21 +69,22 @@ const signOperation = ({

let pubkey;

log("engine", "look for pubkey for address", account.freshAddress);
log("engine", "path", account.freshAddressPath);

accounts.forEach((a) => {
if (a.address == account.freshAddress) {
pubkey = a.pubkey;
log("engine", "found pubkey with same address");
pubkey = encodePubkey({
type: "tendermint/PubKeySecp256k1",
value: Buffer.from(a.pubkey).toString("base64"),
});
}
});

const unsignedPayload = await buildTransaction(
account,
transaction,
Buffer.from(pubkey || null).toString("hex")
);
const unsignedPayload = await buildTransaction(account, transaction);

const msgs = unsignedPayload.messages.map((msg) =>
aminoTypes.toAmino(msg)
);
const msgs = unsignedPayload.map((msg) => aminoTypes.toAmino(msg));

// Note:
// We don't use Cosmos App,
Expand Down Expand Up @@ -109,17 +118,30 @@ const signOperation = ({

const txBodyBytes = registry.encode(txBodyFields);

const authInfoBytes = makeAuthInfoBytes(
[{ pubkey, sequence }],
[
{
amount:
transaction.fees?.toString() || new BigNumber(2500).toString(),
denom: account.currency.units[1].code,
},
],
transaction.gas?.toNumber() || new BigNumber(250000).toNumber(),
SignMode.SIGN_MODE_LEGACY_AMINO_JSON
);

const txRaw = TxRaw.fromPartial({
bodyBytes: txBodyBytes,
authInfoBytes: unsignedPayload.auth,
authInfoBytes,
signatures: [
new Uint8Array(Buffer.from(signed.signature.signature, "base64")),
],
});

const signature = Buffer.from(
Array.from(Uint8Array.from(TxRaw.encode(txRaw).finish()))
).toString("hex");
const signature = Buffer.from(TxRaw.encode(txRaw).finish()).toString(
"hex"
);

if (cancelled) {
return;
Expand Down
1 change: 1 addition & 0 deletions src/families/cosmos/js-synchronisation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export const getAccountShape: GetAccountShape = async (info) => {

const shape = {
id: accountId,
xpub: xpubOrAddress,
balance: balance,
spendableBalance,
operationsCount: operations.length,
Expand Down
Loading

1 comment on commit 56887dc

@github-actions
Copy link

Choose a reason for hiding this comment

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

❌ 4 txs ($34.27) for Bot 'Cosmos JS'

⚠️ 3 mutations uncovered

4 mutation errors
all accounts sync in 1962ms
▬ Cosmos 2.18.0 on nanoS 2.0.0-rc5
→ FROM Cosmos 1: 0.12537 ATOM (10ops) (cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er on 44'/118'/0'/0/0) #0 js:2:cosmos:cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er: (! sum of ops 0.133046 ATOM) 0.125376 ATOM spendable. 

max spendable ~0.11912
★ using mutation 'send some'
→ TO Cosmos 4: 0.29906 ATOM (4ops) (cosmos1ccemcd8p3r293e5rcv0awaj9hfnn6wmxkz520n on 44'/118'/3'/0/0) #3 js:2:cosmos:cosmos1ccemcd8p3r293e5rcv0awaj9hfnn6wmxkz520n:
✔️ transaction 
SEND  0.063358 ATOM
TO cosmos1ccemcd8p3r293e5rcv0awaj9hfnn6wmxkz520n

with fees=0.004302
  memo=LedgerLiveBot
STATUS (1382ms)
  amount: 0.063358 ATOM
  estimated fees: 0.004302 ATOM
  total spent: 0.06766 ATOM
✔️ has been signed! (2849ms) {"operation":{"id":"js:2:cosmos:cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er:--OUT","hash":"","type":"OUT","senders":["cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er"],"recipients":["cosmos1ccemcd8p3r293e5rcv0awaj9hfnn6wmxkz520n"],"accountId":"js:2:cosmos:cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er:","blockHash":null,"blockHeight":null,"extra":{},"date":"2022-02-14T16:03:47.140Z","value":"63358","fee":"4302"},"signature":"0a91010a8e010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e64126e0a2d636f736d6f73317a707674686533707876796a65377672637176326d36716532716775307238676b7a36346572122d636f736d6f73316363656d6364387033723239336535726376306177616a3968666e6e36776d786b7a3532306e1a0e0a057561746f6d1205363333353812670a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a21039e06365acbce5b7331f2867591be377de688057b75a42241d564046dec36f9c312040a02087f180a12130a0d0a057561746f6d12043433303210c0c00a1a40833df143fd5f5c728344309b1a9cfbca98bca8f386dc534277fdb5fda4408a5178722a4485595b3b4d9eb144c39a5b997ee67c6206a60bdf14f62849ab7fc0e4","expirationDate":null}
⚠️ Error: invalid broadcast return (code: 4, message: 'signature verification failed; please verify account number (749173), sequence (10) and chain-id (cosmoshub-4): unauthorized')

Error: invalid broadcast return (code: 4, message: 'signature verification failed; please verify account number (749173), sequence (10) and chain-id (cosmoshub-4): unauthorized')
all accounts sync in 2455ms
▬ Cosmos 2.18.0 on nanoS 2.0.0-rc5
→ FROM Cosmos 2: 0.29961 ATOM (8ops) (cosmos1zd0e8j9g9wur8up7j5aqahz233r4jmvqhyffnv on 44'/118'/1'/0/0) #1 js:2:cosmos:cosmos1zd0e8j9g9wur8up7j5aqahz233r4jmvqhyffnv: (! sum of ops 0.513635 ATOM) 0.26193 ATOM spendable. 0.037686 ATOM delegated. 
DELEGATIONS
  to cosmosvaloper1rpgtz9pskr5geavkjz02caqmeep7cwwpv73axj 0.012531 ATOM 
  to cosmosvaloper1cgh5ksjwy2sd407lyre4l3uj2fdrqhpkzp06e6 0.025155 ATOM 
  to cosmosvaloper1gjtvly9lel6zskvwtvlg5vhwpu9c9waw7sxzwx 0.00761 ATOM 
  to cosmosvaloper1rcp29q3hpd246n6qak7jluqep4v006cdsc2kkl 0.087313 ATOM 
  to cosmosvaloper146kwpzhmleafmhtaxulfptyhnvwxzlvm87hwnm 0.01132 ATOM 
  to cosmosvaloper1x8rr4hcf54nz6hfckyy2n05sxss54h8wz9puzg 0.017993 ATOM 
  to cosmosvaloper1sxx9mszve0gaedz5ld7qdkjkfv8z992ax69k08 0.004641 ATOM 
  to cosmosvaloper1wlagucxdxvsmvj6330864x8q3vxz4x02rmvmsu 0.061104 ATOM 
  to cosmosvaloper16qme5yxucnaj6snx35nmwze0wyxr8wfgqxsqfw 0.024038 ATOM 

max spendable ~0.25568
★ using mutation 'send max'
→ TO Cosmos 3: 0.25443 ATOM (5ops) (cosmos1uty5nf28emeahuhdg9runmzuluq9uj5uek4jk0 on 44'/118'/2'/0/0) #2 js:2:cosmos:cosmos1uty5nf28emeahuhdg9runmzuluq9uj5uek4jk0:
✔️ transaction 
SEND MAX
TO cosmos1uty5nf28emeahuhdg9runmzuluq9uj5uek4jk0

with fees=0.00625
STATUS (1082ms)
  amount: 0.25568 ATOM
  estimated fees: 0.00625 ATOM
  total spent: 0.26193 ATOM
  warnings: amount: RecommendUndelegation
✔️ has been signed! (2557ms) 
✔️ broadcasted! (98ms) optimistic operation: 
  -0.047919 ATOM     OUT        AD7EF6C182BB28FC395D3BD08C5D8D1FC91E3E2FD4BC3BA99B90B875CE54B84A 2022-02-14T16:03
(final state reached in 34.8s)
⚠️ Error: expect(received).toBe(expected) // Object.is equality

Expected: "0"
Received: "207761"

Error: expect(received).toBe(expected) // Object.is equality

Expected: "0"
Received: "207761"
all accounts sync in 1899ms
▬ Cosmos 2.18.0 on nanoS 2.0.0-rc5
→ FROM Cosmos 3: 0.30234 ATOM (6ops) (cosmos1uty5nf28emeahuhdg9runmzuluq9uj5uek4jk0 on 44'/118'/2'/0/0) #2 js:2:cosmos:cosmos1uty5nf28emeahuhdg9runmzuluq9uj5uek4jk0: 0.302349 ATOM spendable. 

max spendable ~0.29609
★ using mutation 'delegate new validators'
✔️ transaction 
DELEGATE 
TO 
  0.012004 -> cosmosvaloper1s7jnk7t6yqzensdgpvkvkag022udk842qdjdtd
  0.032479 -> cosmosvaloper157v7tczs40axfgejp2m43kwuzqe0wsy0rv8puv
  0.039771 -> cosmosvaloper1wlagucxdxvsmvj6330864x8q3vxz4x02rmvmsu
  0.005397 -> cosmosvaloper1dt93l3qgmhhlp97srjyqyendrgu9nx0suxtwe8
  0.03044 -> cosmosvaloper1v5y0tg0jllvxf5c3afml8s3awue0ymju89frut
with fees=0.026122
  memo=LedgerLiveBot
STATUS (2109ms)
  amount: 0.120091 ATOM
  estimated fees: 0.026122 ATOM
  total spent: 0.146213 ATOM
✔️ has been signed! (5s) {"operation":{"id":"js:2:cosmos:cosmos1uty5nf28emeahuhdg9runmzuluq9uj5uek4jk0:--OUT","hash":"","type":"OUT","senders":["cosmos1uty5nf28emeahuhdg9runmzuluq9uj5uek4jk0"],"recipients":[""],"accountId":"js:2:cosmos:cosmos1uty5nf28emeahuhdg9runmzuluq9uj5uek4jk0:","blockHash":null,"blockHeight":null,"extra":{},"date":"2022-02-14T16:04:42.454Z","value":"0","fee":"26122"},"signature":"0a9a060a9c010a232f636f736d6f732e7374616b696e672e763162657461312e4d736744656c656761746512750a2d636f736d6f7331757479356e663238656d656168756864673972756e6d7a756c757139756a3575656b346a6b301234636f736d6f7376616c6f7065723173376a6e6b37743679717a656e73646770766b766b616730323275646b38343271646a6474641a0e0a057561746f6d120531323030340a9c010a232f636f736d6f732e7374616b696e672e763162657461312e4d736744656c656761746512750a2d636f736d6f7331757479356e663238656d656168756864673972756e6d7a756c757139756a3575656b346a6b301234636f736d6f7376616c6f706572313537763774637a73343061786667656a70326d34336b77757a716530777379307276387075761a0e0a057561746f6d120533323437390a9c010a232f636f736d6f732e7374616b696e672e763162657461312e4d736744656c656761746512750a2d636f736d6f7331757479356e663238656d656168756864673972756e6d7a756c757139756a3575656b346a6b301234636f736d6f7376616c6f70657231776c6167756378647876736d766a363333303836347838713376787a34783032726d766d73751a0e0a057561746f6d120533393737310a9b010a232f636f736d6f732e7374616b696e672e763162657461312e4d736744656c656761746512740a2d636f736d6f7331757479356e663238656d656168756864673972756e6d7a756c757139756a3575656b346a6b301234636f736d6f7376616c6f70657231647439336c3371676d68686c70393773726a797179656e64726775396e7830737578747765381a0d0a057561746f6d1204353339370a9c010a232f636f736d6f732e7374616b696e672e763162657461312e4d736744656c656761746512750a2d636f736d6f7331757479356e663238656d656168756864673972756e6d7a756c757139756a3575656b346a6b301234636f736d6f7376616c6f70657231763579307467306a6c6c76786635633361666d6c3873336177756530796d6a753839667275741a0e0a057561746f6d1205333034343012680a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2103c68ba6b137ff35a958669075452f350250f2b82123e865729fbdc1240285b82012040a02087f180212140a0e0a057561746f6d120532363132321081e33f1a40c9af461b18a8bf9e048e9d169cc6c6d91cb8ea22e681c06409342de0894df9bc03b1a9fc55dc2cdbbebd0d9dc5388f08ebf1db7c94a8c0d4fb238ab521117f1a","expirationDate":null}
⚠️ Error: invalid broadcast return (code: 4, message: 'signature verification failed; please verify account number (751597), sequence (2) and chain-id (cosmoshub-4): unauthorized')

Error: invalid broadcast return (code: 4, message: 'signature verification failed; please verify account number (751597), sequence (2) and chain-id (cosmoshub-4): unauthorized')
all accounts sync in 1644ms
▬ Cosmos 2.18.0 on nanoS 2.0.0-rc5
→ FROM Cosmos 4: 0.29906 ATOM (4ops) (cosmos1ccemcd8p3r293e5rcv0awaj9hfnn6wmxkz520n on 44'/118'/3'/0/0) #3 js:2:cosmos:cosmos1ccemcd8p3r293e5rcv0awaj9hfnn6wmxkz520n: 0.299061 ATOM spendable. 

max spendable ~0.29281
★ using mutation 'send some'
→ TO Cosmos 1: 0.12537 ATOM (10ops) (cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er on 44'/118'/0'/0/0) #0 js:2:cosmos:cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er:
✔️ transaction 
SEND  0.173094 ATOM
TO cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er

with fees=0.004305
  memo=LedgerLiveBot
STATUS (1670ms)
  amount: 0.173094 ATOM
  estimated fees: 0.004305 ATOM
  total spent: 0.177399 ATOM
✔️ has been signed! (2914ms) {"operation":{"id":"js:2:cosmos:cosmos1ccemcd8p3r293e5rcv0awaj9hfnn6wmxkz520n:--OUT","hash":"","type":"OUT","senders":["cosmos1ccemcd8p3r293e5rcv0awaj9hfnn6wmxkz520n"],"recipients":["cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er"],"accountId":"js:2:cosmos:cosmos1ccemcd8p3r293e5rcv0awaj9hfnn6wmxkz520n:","blockHash":null,"blockHeight":null,"extra":{},"date":"2022-02-14T16:04:51.428Z","value":"173094","fee":"4305"},"signature":"0a92010a8f010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e64126f0a2d636f736d6f73316363656d6364387033723239336535726376306177616a3968666e6e36776d786b7a3532306e122d636f736d6f73317a707674686533707876796a65377672637176326d36716532716775307238676b7a363465721a0f0a057561746f6d120631373330393412670a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a21037b14abc40458ff33a77f2e6462ac78eae4a7148b872153bf5aa92d3134b586e212040a02087f180212130a0d0a057561746f6d12043433303510b0c10a1a403f61cae9547166c4d26f9d1d847cf3549b065d3427e01276283b1942cab719880670e29f5b83d298c8300f5963a7b45873f34d2fbd54e085c9c229e329e44632","expirationDate":null}
⚠️ Error: invalid broadcast return (code: 4, message: 'signature verification failed; please verify account number (754002), sequence (2) and chain-id (cosmoshub-4): unauthorized')

Error: invalid broadcast return (code: 4, message: 'signature verification failed; please verify account number (754002), sequence (2) and chain-id (cosmoshub-4): unauthorized')
Details of the 4 mutations

Spec Cosmos (7)

Spec Cosmos found 7 Cosmos accounts (preload: 261ms). Will use Cosmos 2.18.0 on nanoS 2.0.0-rc5
(818ms) Cosmos 1: 0.12537 ATOM (10ops) (cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er on 44'/118'/0'/0/0) #0 js:2:cosmos:cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er:
(537ms) Cosmos 2: 0.5136 ATOM (8ops) (cosmos1zd0e8j9g9wur8up7j5aqahz233r4jmvqhyffnv on 44'/118'/1'/0/0) #1 js:2:cosmos:cosmos1zd0e8j9g9wur8up7j5aqahz233r4jmvqhyffnv:
(601ms) Cosmos 3: 0.25443 ATOM (5ops) (cosmos1uty5nf28emeahuhdg9runmzuluq9uj5uek4jk0 on 44'/118'/2'/0/0) #2 js:2:cosmos:cosmos1uty5nf28emeahuhdg9runmzuluq9uj5uek4jk0:
(1085ms) Cosmos 4: 0.29906 ATOM (4ops) (cosmos1ccemcd8p3r293e5rcv0awaj9hfnn6wmxkz520n on 44'/118'/3'/0/0) #3 js:2:cosmos:cosmos1ccemcd8p3r293e5rcv0awaj9hfnn6wmxkz520n:
(1478ms) Cosmos 5: 0.1038 ATOM (3ops) (cosmos1mvk3fwxgdfac4yjmgl9hdz0555q8gljydzvjtu on 44'/118'/4'/0/0) #4 js:2:cosmos:cosmos1mvk3fwxgdfac4yjmgl9hdz0555q8gljydzvjtu:
(820ms) Cosmos 6: 0.04732 ATOM (1ops) (cosmos1draxuzz0aukggx63m852wm8mlxqpus2009cs97 on 44'/118'/5'/0/0) #5 js:2:cosmos:cosmos1draxuzz0aukggx63m852wm8mlxqpus2009cs97:
(1419ms) Cosmos 7: 0 ATOM (0ops) (cosmos14k7faf4cvxlflta4hytxavx3p7vj6uw69lgf03 on 44'/118'/6'/0/0) #6 js:2:cosmos:cosmos14k7faf4cvxlflta4hytxavx3p7vj6uw69lgf03:
all accounts sync in 1962ms
▬ Cosmos 2.18.0 on nanoS 2.0.0-rc5
→ FROM Cosmos 1: 0.12537 ATOM (10ops) (cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er on 44'/118'/0'/0/0) #0 js:2:cosmos:cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er: (! sum of ops 0.133046 ATOM) 0.125376 ATOM spendable. 

max spendable ~0.11912
★ using mutation 'send some'
→ TO Cosmos 4: 0.29906 ATOM (4ops) (cosmos1ccemcd8p3r293e5rcv0awaj9hfnn6wmxkz520n on 44'/118'/3'/0/0) #3 js:2:cosmos:cosmos1ccemcd8p3r293e5rcv0awaj9hfnn6wmxkz520n:
✔️ transaction 
SEND  0.063358 ATOM
TO cosmos1ccemcd8p3r293e5rcv0awaj9hfnn6wmxkz520n

with fees=0.004302
  memo=LedgerLiveBot
STATUS (1382ms)
  amount: 0.063358 ATOM
  estimated fees: 0.004302 ATOM
  total spent: 0.06766 ATOM
✔️ has been signed! (2849ms) {"operation":{"id":"js:2:cosmos:cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er:--OUT","hash":"","type":"OUT","senders":["cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er"],"recipients":["cosmos1ccemcd8p3r293e5rcv0awaj9hfnn6wmxkz520n"],"accountId":"js:2:cosmos:cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er:","blockHash":null,"blockHeight":null,"extra":{},"date":"2022-02-14T16:03:47.140Z","value":"63358","fee":"4302"},"signature":"0a91010a8e010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e64126e0a2d636f736d6f73317a707674686533707876796a65377672637176326d36716532716775307238676b7a36346572122d636f736d6f73316363656d6364387033723239336535726376306177616a3968666e6e36776d786b7a3532306e1a0e0a057561746f6d1205363333353812670a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a21039e06365acbce5b7331f2867591be377de688057b75a42241d564046dec36f9c312040a02087f180a12130a0d0a057561746f6d12043433303210c0c00a1a40833df143fd5f5c728344309b1a9cfbca98bca8f386dc534277fdb5fda4408a5178722a4485595b3b4d9eb144c39a5b997ee67c6206a60bdf14f62849ab7fc0e4","expirationDate":null}
⚠️ Error: invalid broadcast return (code: 4, message: 'signature verification failed; please verify account number (749173), sequence (10) and chain-id (cosmoshub-4): unauthorized')

all accounts sync in 2455ms
▬ Cosmos 2.18.0 on nanoS 2.0.0-rc5
→ FROM Cosmos 2: 0.29961 ATOM (8ops) (cosmos1zd0e8j9g9wur8up7j5aqahz233r4jmvqhyffnv on 44'/118'/1'/0/0) #1 js:2:cosmos:cosmos1zd0e8j9g9wur8up7j5aqahz233r4jmvqhyffnv: (! sum of ops 0.513635 ATOM) 0.26193 ATOM spendable. 0.037686 ATOM delegated. 
DELEGATIONS
  to cosmosvaloper1rpgtz9pskr5geavkjz02caqmeep7cwwpv73axj 0.012531 ATOM 
  to cosmosvaloper1cgh5ksjwy2sd407lyre4l3uj2fdrqhpkzp06e6 0.025155 ATOM 
  to cosmosvaloper1gjtvly9lel6zskvwtvlg5vhwpu9c9waw7sxzwx 0.00761 ATOM 
  to cosmosvaloper1rcp29q3hpd246n6qak7jluqep4v006cdsc2kkl 0.087313 ATOM 
  to cosmosvaloper146kwpzhmleafmhtaxulfptyhnvwxzlvm87hwnm 0.01132 ATOM 
  to cosmosvaloper1x8rr4hcf54nz6hfckyy2n05sxss54h8wz9puzg 0.017993 ATOM 
  to cosmosvaloper1sxx9mszve0gaedz5ld7qdkjkfv8z992ax69k08 0.004641 ATOM 
  to cosmosvaloper1wlagucxdxvsmvj6330864x8q3vxz4x02rmvmsu 0.061104 ATOM 
  to cosmosvaloper16qme5yxucnaj6snx35nmwze0wyxr8wfgqxsqfw 0.024038 ATOM 

max spendable ~0.25568
★ using mutation 'send max'
→ TO Cosmos 3: 0.25443 ATOM (5ops) (cosmos1uty5nf28emeahuhdg9runmzuluq9uj5uek4jk0 on 44'/118'/2'/0/0) #2 js:2:cosmos:cosmos1uty5nf28emeahuhdg9runmzuluq9uj5uek4jk0:
✔️ transaction 
SEND MAX
TO cosmos1uty5nf28emeahuhdg9runmzuluq9uj5uek4jk0

with fees=0.00625
STATUS (1082ms)
  amount: 0.25568 ATOM
  estimated fees: 0.00625 ATOM
  total spent: 0.26193 ATOM
  warnings: amount: RecommendUndelegation
✔️ has been signed! (2557ms) 
✔️ broadcasted! (98ms) optimistic operation: 
  -0.047919 ATOM     OUT        AD7EF6C182BB28FC395D3BD08C5D8D1FC91E3E2FD4BC3BA99B90B875CE54B84A 2022-02-14T16:03
(final state reached in 34.8s)
⚠️ Error: expect(received).toBe(expected) // Object.is equality

Expected: "0"
Received: "207761"

all accounts sync in 1899ms
▬ Cosmos 2.18.0 on nanoS 2.0.0-rc5
→ FROM Cosmos 3: 0.30234 ATOM (6ops) (cosmos1uty5nf28emeahuhdg9runmzuluq9uj5uek4jk0 on 44'/118'/2'/0/0) #2 js:2:cosmos:cosmos1uty5nf28emeahuhdg9runmzuluq9uj5uek4jk0: 0.302349 ATOM spendable. 

max spendable ~0.29609
★ using mutation 'delegate new validators'
✔️ transaction 
DELEGATE 
TO 
  0.012004 -> cosmosvaloper1s7jnk7t6yqzensdgpvkvkag022udk842qdjdtd
  0.032479 -> cosmosvaloper157v7tczs40axfgejp2m43kwuzqe0wsy0rv8puv
  0.039771 -> cosmosvaloper1wlagucxdxvsmvj6330864x8q3vxz4x02rmvmsu
  0.005397 -> cosmosvaloper1dt93l3qgmhhlp97srjyqyendrgu9nx0suxtwe8
  0.03044 -> cosmosvaloper1v5y0tg0jllvxf5c3afml8s3awue0ymju89frut
with fees=0.026122
  memo=LedgerLiveBot
STATUS (2109ms)
  amount: 0.120091 ATOM
  estimated fees: 0.026122 ATOM
  total spent: 0.146213 ATOM
✔️ has been signed! (5s) {"operation":{"id":"js:2:cosmos:cosmos1uty5nf28emeahuhdg9runmzuluq9uj5uek4jk0:--OUT","hash":"","type":"OUT","senders":["cosmos1uty5nf28emeahuhdg9runmzuluq9uj5uek4jk0"],"recipients":[""],"accountId":"js:2:cosmos:cosmos1uty5nf28emeahuhdg9runmzuluq9uj5uek4jk0:","blockHash":null,"blockHeight":null,"extra":{},"date":"2022-02-14T16:04:42.454Z","value":"0","fee":"26122"},"signature":"0a9a060a9c010a232f636f736d6f732e7374616b696e672e763162657461312e4d736744656c656761746512750a2d636f736d6f7331757479356e663238656d656168756864673972756e6d7a756c757139756a3575656b346a6b301234636f736d6f7376616c6f7065723173376a6e6b37743679717a656e73646770766b766b616730323275646b38343271646a6474641a0e0a057561746f6d120531323030340a9c010a232f636f736d6f732e7374616b696e672e763162657461312e4d736744656c656761746512750a2d636f736d6f7331757479356e663238656d656168756864673972756e6d7a756c757139756a3575656b346a6b301234636f736d6f7376616c6f706572313537763774637a73343061786667656a70326d34336b77757a716530777379307276387075761a0e0a057561746f6d120533323437390a9c010a232f636f736d6f732e7374616b696e672e763162657461312e4d736744656c656761746512750a2d636f736d6f7331757479356e663238656d656168756864673972756e6d7a756c757139756a3575656b346a6b301234636f736d6f7376616c6f70657231776c6167756378647876736d766a363333303836347838713376787a34783032726d766d73751a0e0a057561746f6d120533393737310a9b010a232f636f736d6f732e7374616b696e672e763162657461312e4d736744656c656761746512740a2d636f736d6f7331757479356e663238656d656168756864673972756e6d7a756c757139756a3575656b346a6b301234636f736d6f7376616c6f70657231647439336c3371676d68686c70393773726a797179656e64726775396e7830737578747765381a0d0a057561746f6d1204353339370a9c010a232f636f736d6f732e7374616b696e672e763162657461312e4d736744656c656761746512750a2d636f736d6f7331757479356e663238656d656168756864673972756e6d7a756c757139756a3575656b346a6b301234636f736d6f7376616c6f70657231763579307467306a6c6c76786635633361666d6c3873336177756530796d6a753839667275741a0e0a057561746f6d1205333034343012680a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2103c68ba6b137ff35a958669075452f350250f2b82123e865729fbdc1240285b82012040a02087f180212140a0e0a057561746f6d120532363132321081e33f1a40c9af461b18a8bf9e048e9d169cc6c6d91cb8ea22e681c06409342de0894df9bc03b1a9fc55dc2cdbbebd0d9dc5388f08ebf1db7c94a8c0d4fb238ab521117f1a","expirationDate":null}
⚠️ Error: invalid broadcast return (code: 4, message: 'signature verification failed; please verify account number (751597), sequence (2) and chain-id (cosmoshub-4): unauthorized')

all accounts sync in 1644ms
▬ Cosmos 2.18.0 on nanoS 2.0.0-rc5
→ FROM Cosmos 4: 0.29906 ATOM (4ops) (cosmos1ccemcd8p3r293e5rcv0awaj9hfnn6wmxkz520n on 44'/118'/3'/0/0) #3 js:2:cosmos:cosmos1ccemcd8p3r293e5rcv0awaj9hfnn6wmxkz520n: 0.299061 ATOM spendable. 

max spendable ~0.29281
★ using mutation 'send some'
→ TO Cosmos 1: 0.12537 ATOM (10ops) (cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er on 44'/118'/0'/0/0) #0 js:2:cosmos:cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er:
✔️ transaction 
SEND  0.173094 ATOM
TO cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er

with fees=0.004305
  memo=LedgerLiveBot
STATUS (1670ms)
  amount: 0.173094 ATOM
  estimated fees: 0.004305 ATOM
  total spent: 0.177399 ATOM
✔️ has been signed! (2914ms) {"operation":{"id":"js:2:cosmos:cosmos1ccemcd8p3r293e5rcv0awaj9hfnn6wmxkz520n:--OUT","hash":"","type":"OUT","senders":["cosmos1ccemcd8p3r293e5rcv0awaj9hfnn6wmxkz520n"],"recipients":["cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er"],"accountId":"js:2:cosmos:cosmos1ccemcd8p3r293e5rcv0awaj9hfnn6wmxkz520n:","blockHash":null,"blockHeight":null,"extra":{},"date":"2022-02-14T16:04:51.428Z","value":"173094","fee":"4305"},"signature":"0a92010a8f010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e64126f0a2d636f736d6f73316363656d6364387033723239336535726376306177616a3968666e6e36776d786b7a3532306e122d636f736d6f73317a707674686533707876796a65377672637176326d36716532716775307238676b7a363465721a0f0a057561746f6d120631373330393412670a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a21037b14abc40458ff33a77f2e6462ac78eae4a7148b872153bf5aa92d3134b586e212040a02087f180212130a0d0a057561746f6d12043433303510b0c10a1a403f61cae9547166c4d26f9d1d847cf3549b065d3427e01276283b1942cab719880670e29f5b83d298c8300f5963a7b45873f34d2fbd54e085c9c229e329e44632","expirationDate":null}
⚠️ Error: invalid broadcast return (code: 4, message: 'signature verification failed; please verify account number (754002), sequence (2) and chain-id (cosmoshub-4): unauthorized')


Details of the 3 uncovered mutations

Spec Cosmos (3)

  • undelegate: balance is too low (3)
  • redelegate: balance is too low (3)
  • claim rewards: balance is too low (3)

Portfolio ($34.27)

Details of the 1 currencies
Spec (accounts) Operations Balance funds?
Cosmos (6) 33 (+2) 1.0919 ATOM (- 0.00625) ($34.27) ⚠️ cosmos1zpvthe3pxvyje7vrcqv2m6qe2qgu0r8gkz64er

Please sign in to comment.