Stack Exchange
Call: failed decoding staking.bond
I am getting the following error when I try to decode unsigned transaction
rawTxId
    "message": "createType(Extrinsic):: createType(ExtrinsicV4):: createType(Call):: Call: failed decoding staking.bond:: Struct: failed on args: {\"value\":\"Lookup54\",\"payee\":\"{\\\"_enum\\\":{\\\"Staked\\\":\\\"Null\\\",\\\"Stash\\\":\\\"Null\\\",\\\"Controller\\\":\\\"Null\\\",\\\"Account\\\":\\\"AccountId32\\\",\\\"None\\\":\\\"Null\\\"}}\"}:: decodeU8aStruct: failed at 0x3ab6ce09551c5ee90f74d01e53ad9a6d… on payee (index 2/2): {\"_enum\":{\"Staked\":\"Null\",\"Stash\":\"Null\",\"Controller\":\"Null\",\"Account\":\"AccountId32\",\"None\":\"Null\"}}:: Unable to create Enum via index 58, in Staked, Stash, Controller, Account, None"

My structure on building is the following
    staking.bond(
            {
              controller: address,
              value: '1000000',
              payee: {
                Account: address,
              },
            },
            txMetadata,
            {
              metadataRpc: metadata,
              registry,
            },
          );
        }


I guess you are using the newer polkadot version (v1.0.0 or newer)
bond method is now having 2 parameters ( value , payee)
https://github.com/paritytech/substrate/blob/polkadot-v1.0.0/frame/staking/src/pallet/mod.rs#L834

