@tharsis/transactions
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -117,2 +117,29 @@ import { Chain, Fee, Sender } from './common'; | ||
}; | ||
export interface MsgMultipleWithdrawDelegatorRewardParams { | ||
validatorAddresses: string[]; | ||
} | ||
export declare function createTxMsgMultipleWithdrawDelegatorReward(chain: Chain, sender: Sender, fee: Fee, memo: string, params: MsgMultipleWithdrawDelegatorRewardParams): { | ||
signDirect: { | ||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody; | ||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo; | ||
signBytes: string; | ||
}; | ||
legacyAmino: { | ||
body: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.TxBody; | ||
authInfo: import("@tharsis/proto/dist/proto/cosmos/tx/v1beta1/tx").cosmos.tx.v1beta1.AuthInfo; | ||
signBytes: string; | ||
}; | ||
eipToSign: { | ||
types: object; | ||
primaryType: string; | ||
domain: { | ||
name: string; | ||
version: string; | ||
chainId: number; | ||
verifyingContract: string; | ||
salt: string; | ||
}; | ||
message: object; | ||
}; | ||
}; | ||
//# sourceMappingURL=staking.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createTxMsgWithdrawDelegatorReward = exports.createTxMsgUndelegate = exports.createTxMsgBeginRedelegate = exports.createTxMsgDelegate = void 0; | ||
exports.createTxMsgMultipleWithdrawDelegatorReward = exports.createTxMsgWithdrawDelegatorReward = exports.createTxMsgUndelegate = exports.createTxMsgBeginRedelegate = exports.createTxMsgDelegate = void 0; | ||
const proto_1 = require("@tharsis/proto"); | ||
@@ -66,2 +66,21 @@ const eip712_1 = require("@tharsis/eip712"); | ||
exports.createTxMsgWithdrawDelegatorReward = createTxMsgWithdrawDelegatorReward; | ||
function createTxMsgMultipleWithdrawDelegatorReward(chain, sender, fee, memo, params) { | ||
const feeObject = (0, eip712_1.generateFee)(fee.amount, fee.denom, fee.gas, sender.accountAddress); | ||
const types = (0, eip712_1.generateTypes)(eip712_1.MSG_WITHDRAW_DELEGATOR_REWARD_TYPES); | ||
const msgs = []; | ||
const protoMsgs = []; | ||
params.validatorAddresses.forEach((validator) => { | ||
msgs.push((0, eip712_1.createMsgWithdrawDelegatorReward)(sender.accountAddress, validator)); | ||
protoMsgs.push((0, proto_1.createMsgWithdrawDelegatorReward)(sender.accountAddress, validator)); | ||
}); | ||
const messages = (0, eip712_1.generateMessageWithMultipleTransactions)(sender.accountNumber.toString(), sender.sequence.toString(), chain.cosmosChainId, memo, feeObject, msgs); | ||
const eipToSign = (0, eip712_1.createEIP712)(types, chain.chainId, messages); | ||
const tx = (0, proto_1.createTransactionWithMultipleMessages)(protoMsgs, memo, fee.amount, fee.denom, parseInt(fee.gas, 10), 'ethsecp256', sender.pubkey, sender.sequence, sender.accountNumber, chain.cosmosChainId); | ||
return { | ||
signDirect: tx.signDirect, | ||
legacyAmino: tx.legacyAmino, | ||
eipToSign, | ||
}; | ||
} | ||
exports.createTxMsgMultipleWithdrawDelegatorReward = createTxMsgMultipleWithdrawDelegatorReward; | ||
//# sourceMappingURL=staking.js.map |
{ | ||
"name": "@tharsis/transactions", | ||
"description": "Transactions generator for EVMOS", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"license": "MIT", | ||
@@ -29,4 +29,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@tharsis/eip712": "^0.2.0", | ||
"@tharsis/proto": "^0.1.14", | ||
"@tharsis/eip712": "^0.2.1", | ||
"@tharsis/proto": "^0.1.15", | ||
"@types/node": "^17.0.21", | ||
@@ -36,3 +36,3 @@ "link-module-alias": "^1.2.0", | ||
}, | ||
"gitHead": "55dc1dc340a3c9c842803f502d480968a10ddb85" | ||
"gitHead": "9e7e24e5c9e8248a664bc72ca3032c5c355df901" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51538
485
Updated@tharsis/eip712@^0.2.1
Updated@tharsis/proto@^0.1.15