Add makeStdTx and used signed document from signers
This commit is contained in:
@@ -74,13 +74,8 @@ const signDoc = makeSignDoc(
|
||||
account_number,
|
||||
sequence,
|
||||
);
|
||||
const { signature } = await wallet.sign(faucetAddress, signDoc);
|
||||
const signedTx: StdTx = {
|
||||
msg: [sendTokensMsg],
|
||||
fee: defaultFee,
|
||||
memo: memo,
|
||||
signatures: [signature],
|
||||
};
|
||||
const { signed, signature } = await wallet.sign(faucetAddress, signDoc);
|
||||
const signedTx = makeStdTx(signed, signature);
|
||||
const broadcastResult = await client.broadcastTx(signedTx);
|
||||
```
|
||||
|
||||
|
||||
@@ -28,13 +28,8 @@ const { accountNumber, sequence } = await client.getSequence(senderAddress);
|
||||
console.log("Account/sequence:", accountNumber, sequence);
|
||||
|
||||
const signDoc = makeSignDoc([msg], fee, chainId, memo, accountNumber, sequence);
|
||||
const { signature } = await wallet.sign(senderAddress, signDoc);
|
||||
const signedTx: StdTx = {
|
||||
msg: [msg],
|
||||
fee: fee,
|
||||
memo: memo,
|
||||
signatures: [signature],
|
||||
};
|
||||
const { signed, signature } = await wallet.sign(senderAddress, signDoc);
|
||||
const signedTx = makeStdTx(signed, signature);
|
||||
|
||||
const result = await client.broadcastTx(signedTx);
|
||||
console.log("Broadcast result:", result);
|
||||
|
||||
@@ -99,6 +99,7 @@ export async function main(originalArgs: readonly string[]): Promise<void> {
|
||||
"logs",
|
||||
"makeCosmoshubPath",
|
||||
"makeSignDoc",
|
||||
"makeStdTx",
|
||||
"IndexedTx",
|
||||
"BroadcastTxResult",
|
||||
"Coin",
|
||||
|
||||
Reference in New Issue
Block a user