@keplr-wallet/stores 0.12.5 → 0.12.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { AppCurrency, Keplr, KeplrSignOptions, StdFee } from "@keplr-wallet/types";
1
+ import { AppCurrency, Keplr } from "@keplr-wallet/types";
2
2
  import { ChainGetter } from "../chain";
3
3
  import { MakeTxResponse } from "./types";
4
4
  import { AccountSharedContext } from "./context";
@@ -37,21 +37,12 @@ export declare class AccountSetBase {
37
37
  protected _txTypeInProgress: string;
38
38
  protected _pubKey: Uint8Array;
39
39
  protected hasInited: boolean;
40
- protected sendTokenFns: ((amount: string, currency: AppCurrency, recipient: string, memo: string, stdFee: Partial<StdFee>, signOptions?: KeplrSignOptions, onTxEvents?: ((tx: any) => void) | {
41
- onBroadcastFailed?: (e?: Error) => void;
42
- onBroadcasted?: (txHash: Uint8Array) => void;
43
- onFulfill?: (tx: any) => void;
44
- }) => Promise<boolean>)[];
45
40
  protected makeSendTokenTxFns: ((amount: string, currency: AppCurrency, recipient: string) => MakeTxResponse | undefined)[];
46
41
  constructor(eventListener: {
47
42
  addEventListener: (type: string, fn: () => unknown) => void;
48
43
  removeEventListener: (type: string, fn: () => unknown) => void;
49
44
  }, chainGetter: ChainGetter, chainId: string, sharedContext: AccountSharedContext, opts: AccountSetOpts);
50
45
  getKeplr(): Promise<Keplr | undefined>;
51
- registerSendTokenFn(fn: (amount: string, currency: AppCurrency, recipient: string, memo: string, stdFee: Partial<StdFee>, signOptions?: KeplrSignOptions, onTxEvents?: ((tx: any) => void) | {
52
- onBroadcasted?: (txHash: Uint8Array) => void;
53
- onFulfill?: (tx: any) => void;
54
- }) => Promise<boolean>): void;
55
46
  registerMakeSendTokenFn(fn: (amount: string, currency: AppCurrency, recipient: string) => MakeTxResponse | undefined): void;
56
47
  protected enable(chainId: string): Promise<void>;
57
48
  private readonly handleInit;
@@ -64,10 +55,6 @@ export declare class AccountSetBase {
64
55
  */
65
56
  get isReadyToSendMsgs(): boolean;
66
57
  makeSendTokenTx(amount: string, currency: AppCurrency, recipient: string): MakeTxResponse;
67
- sendToken(amount: string, currency: AppCurrency, recipient: string, memo?: string, stdFee?: Partial<StdFee>, signOptions?: KeplrSignOptions, onTxEvents?: ((tx: any) => void) | {
68
- onBroadcasted?: (txHash: Uint8Array) => void;
69
- onFulfill?: (tx: any) => void;
70
- }): Promise<void>;
71
58
  get walletStatus(): WalletStatus;
72
59
  get rejectionReason(): Error | undefined;
73
60
  get name(): string;
@@ -43,7 +43,6 @@ class AccountSetBase {
43
43
  this._isKeystone = false;
44
44
  this._txTypeInProgress = "";
45
45
  this.hasInited = false;
46
- this.sendTokenFns = [];
47
46
  this.makeSendTokenTxFns = [];
48
47
  this.handleInit = () => this.init();
49
48
  (0, mobx_1.makeObservable)(this);
@@ -55,9 +54,6 @@ class AccountSetBase {
55
54
  getKeplr() {
56
55
  return this.sharedContext.getKeplr();
57
56
  }
58
- registerSendTokenFn(fn) {
59
- this.sendTokenFns.push(fn);
60
- }
61
57
  registerMakeSendTokenFn(fn) {
62
58
  this.makeSendTokenTxFns.push(fn);
63
59
  }
@@ -174,18 +170,6 @@ class AccountSetBase {
174
170
  const denomHelper = new common_1.DenomHelper(currency.coinMinimalDenom);
175
171
  throw new Error(`Unsupported type of currency (${denomHelper.type})`);
176
172
  }
177
- sendToken(amount, currency, recipient, memo = "", stdFee = {}, signOptions, onTxEvents) {
178
- return __awaiter(this, void 0, void 0, function* () {
179
- for (let i = 0; i < this.sendTokenFns.length; i++) {
180
- const fn = this.sendTokenFns[i];
181
- if (yield fn(amount, currency, recipient, memo, stdFee, signOptions, onTxEvents)) {
182
- return;
183
- }
184
- }
185
- const denomHelper = new common_1.DenomHelper(currency.coinMinimalDenom);
186
- throw new Error(`Unsupported type of currency (${denomHelper.type})`);
187
- });
188
- }
189
173
  get walletStatus() {
190
174
  return this._walletStatus;
191
175
  }
@@ -1 +1 @@
1
- {"version":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YAAY,CAAC,mBAAmB,CACzE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;CACF;AAlRC;IADC,iBAAU;sDAC8C;AAGzD;IADC,iBAAU;qDACkD;AAG7D;IADC,iBAAU,CAAC,GAAG;wDAC2C;AAG1D;IADC,iBAAU;6CACkB;AAG7B;IADC,iBAAU;sDAC2B;AAEtC;IADC,iBAAU;qDAC8B;AAEzC;IADC,iBAAU;mDAC4B;AAGvC;IADC,iBAAU;yDAC8B;AAsEzC;IADC,WAAI;0CAkEJ;AAGD;IADC,aAAM;gDAcN;AAOD;IADC,eAAQ;qDAKR;AAMD;IADC,eAAQ;uDAKR;AAyED;IADC,eAAQ;wDAUR;AAnRH,wCAoRC;AAED,MAAa,mBAAoB,SAAQ,cAAc;IACrD,YAAY,GAAG,MAAoD;QACjE,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC;QAEjB,IAAA,qBAAc,EAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAGD,mBAAmB,CAAC,IAAY;QAC9B,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAChC,CAAC;CACF;AAHC;IADC,aAAM;8DAGN;AAVH,kDAWC"}
@@ -52,7 +52,6 @@ export declare class CosmosAccountImpl {
52
52
  onFulfill?: (chainId: string, tx: any) => void;
53
53
  };
54
54
  };
55
- broadcastMode: "sync" | "async" | "block";
56
55
  constructor(base: AccountSetBaseSuper, chainGetter: ChainGetter, chainId: string, queriesStore: IQueriesStore<CosmosQueries>, _msgOpts: CosmosMsgOpts, txOpts: {
57
56
  wsObject?: new (url: string, protocols?: string | string[]) => WebSocket;
58
57
  preTxEvents?: {
@@ -66,19 +65,12 @@ export declare class CosmosAccountImpl {
66
65
  */
67
66
  get msgOpts(): CosmosMsgOpts;
68
67
  protected processMakeSendTokenTx(amount: string, currency: AppCurrency, recipient: string): MakeTxResponse | undefined;
69
- /**
70
- * @deprecated
71
- */
72
- protected processSendToken(amount: string, currency: AppCurrency, recipient: string, memo: string, stdFee: Partial<StdFee>, signOptions?: KeplrSignOptions, onTxEvents?: ((tx: any) => void) | {
73
- onBroadcasted?: (txHash: Uint8Array) => void;
74
- onFulfill?: (tx: any) => void;
75
- }): Promise<boolean>;
76
68
  sendMsgs(type: string | "unknown", msgs: ProtoMsgsOrWithAminoMsgs | (() => Promise<ProtoMsgsOrWithAminoMsgs> | ProtoMsgsOrWithAminoMsgs), memo: string | undefined, fee: StdFee, signOptions?: KeplrSignOptionsWithAltSignMethods, onTxEvents?: ((tx: any) => void) | {
77
69
  onBroadcastFailed?: (e?: Error) => void;
78
70
  onBroadcasted?: (txHash: Uint8Array) => void;
79
71
  onFulfill?: (tx: any) => void;
80
72
  }): Promise<void>;
81
- protected broadcastMsgs(msgs: ProtoMsgsOrWithAminoMsgs, fee: StdFee, memo?: string, signOptions?: KeplrSignOptionsWithAltSignMethods, mode?: "block" | "async" | "sync"): Promise<{
73
+ protected broadcastMsgs(msgs: ProtoMsgsOrWithAminoMsgs, fee: StdFee, memo?: string, signOptions?: KeplrSignOptionsWithAltSignMethods): Promise<{
82
74
  txHash: Uint8Array;
83
75
  signDoc: StdSignDoc;
84
76
  }>;
@@ -103,6 +95,7 @@ export declare class CosmosAccountImpl {
103
95
  gasUsed: number;
104
96
  }>;
105
97
  makeTx(type: string | "unknown", msgs: ProtoMsgsOrWithAminoMsgs | (() => Promise<ProtoMsgsOrWithAminoMsgs>), preOnTxEvents?: ((tx: any) => void) | {
98
+ onBroadcastFailed?: (e?: Error) => void;
106
99
  onBroadcasted?: (txHash: Uint8Array) => void;
107
100
  onFulfill?: (tx: any) => void;
108
101
  }): MakeTxResponse;
@@ -134,49 +127,8 @@ export declare class CosmosAccountImpl {
134
127
  onFulfill?: (tx: any) => void;
135
128
  }): Promise<void>;
136
129
  makeUndelegateTx(amount: string, validatorAddress: string): MakeTxResponse;
137
- /**
138
- * @deprecated
139
- * Send `MsgUndelegate` msg to the chain.
140
- * @param amount Decimal number used by humans.
141
- * If amount is 0.1 and the stake currenct is uatom, actual amount will be changed to the 100000uatom.
142
- * @param validatorAddress
143
- * @param memo
144
- * @param onFulfill
145
- */
146
- sendUndelegateMsg(amount: string, validatorAddress: string, memo?: string, stdFee?: Partial<StdFee>, signOptions?: KeplrSignOptions, onTxEvents?: ((tx: any) => void) | {
147
- onBroadcasted?: (txHash: Uint8Array) => void;
148
- onFulfill?: (tx: any) => void;
149
- }): Promise<void>;
150
130
  makeBeginRedelegateTx(amount: string, srcValidatorAddress: string, dstValidatorAddress: string): MakeTxResponse;
151
- /**
152
- * @deprecated
153
- * Send `MsgBeginRedelegate` msg to the chain.
154
- * @param amount Decimal number used by humans.
155
- * If amount is 0.1 and the stake currenct is uatom, actual amount will be changed to the 100000uatom.
156
- * @param srcValidatorAddress
157
- * @param dstValidatorAddress
158
- * @param memo
159
- * @param onFulfill
160
- */
161
- sendBeginRedelegateMsg(amount: string, srcValidatorAddress: string, dstValidatorAddress: string, memo?: string, stdFee?: Partial<StdFee>, signOptions?: KeplrSignOptions, onTxEvents?: ((tx: any) => void) | {
162
- onBroadcasted?: (txHash: Uint8Array) => void;
163
- onFulfill?: (tx: any) => void;
164
- }): Promise<void>;
165
131
  makeWithdrawDelegationRewardTx(validatorAddresses: string[]): MakeTxResponse;
166
- /**
167
- * @deprecated
168
- */
169
- sendWithdrawDelegationRewardMsgs(validatorAddresses: string[], memo?: string, stdFee?: Partial<StdFee>, signOptions?: KeplrSignOptions, onTxEvents?: ((tx: any) => void) | {
170
- onBroadcasted?: (txHash: Uint8Array) => void;
171
- onFulfill?: (tx: any) => void;
172
- }): Promise<void>;
173
132
  makeGovVoteTx(proposalId: string, option: "Yes" | "No" | "Abstain" | "NoWithVeto"): MakeTxResponse;
174
- /**
175
- * @deprecated
176
- */
177
- sendGovVoteMsg(proposalId: string, option: "Yes" | "No" | "Abstain" | "NoWithVeto", memo?: string, stdFee?: Partial<StdFee>, signOptions?: KeplrSignOptions, onTxEvents?: ((tx: any) => void) | {
178
- onBroadcasted?: (txHash: Uint8Array) => void;
179
- onFulfill?: (tx: any) => void;
180
- }): Promise<void>;
181
133
  protected get queries(): DeepReadonly<QueriesSetBase & CosmosQueries>;
182
134
  }
@@ -89,9 +89,7 @@ class CosmosAccountImpl {
89
89
  this.queriesStore = queriesStore;
90
90
  this._msgOpts = _msgOpts;
91
91
  this.txOpts = txOpts;
92
- this.broadcastMode = "sync";
93
92
  this.base.registerMakeSendTokenFn(this.processMakeSendTokenTx.bind(this));
94
- this.base.registerSendTokenFn(this.processSendToken.bind(this));
95
93
  }
96
94
  /**
97
95
  * @deprecated Predict gas through simulation rather than using a fixed gas.
@@ -159,66 +157,6 @@ class CosmosAccountImpl {
159
157
  });
160
158
  }
161
159
  }
162
- /**
163
- * @deprecated
164
- */
165
- processSendToken(amount, currency, recipient, memo, stdFee, signOptions, onTxEvents) {
166
- var _a, _b;
167
- return __awaiter(this, void 0, void 0, function* () {
168
- const denomHelper = new common_1.DenomHelper(currency.coinMinimalDenom);
169
- switch (denomHelper.type) {
170
- case "native":
171
- const actualAmount = (() => {
172
- let dec = new unit_1.Dec(amount);
173
- dec = dec.mul(unit_1.DecUtils.getPrecisionDec(currency.coinDecimals));
174
- return dec.truncate().toString();
175
- })();
176
- const msg = {
177
- type: this.msgOpts.send.native.type,
178
- value: {
179
- from_address: this.base.bech32Address,
180
- to_address: recipient,
181
- amount: [
182
- {
183
- denom: currency.coinMinimalDenom,
184
- amount: actualAmount,
185
- },
186
- ],
187
- },
188
- };
189
- yield this.sendMsgs("send", {
190
- aminoMsgs: [msg],
191
- protoMsgs: [
192
- {
193
- typeUrl: "/cosmos.bank.v1beta1.MsgSend",
194
- value: tx_2.MsgSend.encode({
195
- fromAddress: msg.value.from_address,
196
- toAddress: msg.value.to_address,
197
- amount: msg.value.amount,
198
- }).finish(),
199
- },
200
- ],
201
- }, memo, {
202
- amount: (_a = stdFee.amount) !== null && _a !== void 0 ? _a : [],
203
- gas: (_b = stdFee.gas) !== null && _b !== void 0 ? _b : this.msgOpts.send.native.gas.toString(),
204
- }, signOptions, (0, utils_1.txEventsWithPreOnFulfill)(onTxEvents, (tx) => {
205
- if (tx.code == null || tx.code === 0) {
206
- // After succeeding to send token, refresh the balance.
207
- const queryBalance = this.queries.queryBalances
208
- .getQueryBech32Address(this.base.bech32Address)
209
- .balances.find((bal) => {
210
- return (bal.currency.coinMinimalDenom === currency.coinMinimalDenom);
211
- });
212
- if (queryBalance) {
213
- queryBalance.fetch();
214
- }
215
- }
216
- }));
217
- return true;
218
- }
219
- return false;
220
- });
221
- }
222
160
  sendMsgs(type, msgs, memo = "", fee, signOptions, onTxEvents) {
223
161
  var _a, _b;
224
162
  return __awaiter(this, void 0, void 0, function* () {
@@ -229,7 +167,7 @@ class CosmosAccountImpl {
229
167
  if (typeof msgs === "function") {
230
168
  msgs = yield msgs();
231
169
  }
232
- const result = yield this.broadcastMsgs(msgs, fee, memo, signOptions, this.broadcastMode);
170
+ const result = yield this.broadcastMsgs(msgs, fee, memo, signOptions);
233
171
  txHash = result.txHash;
234
172
  signDoc = result.signDoc;
235
173
  }
@@ -292,7 +230,7 @@ class CosmosAccountImpl {
292
230
  });
293
231
  }
294
232
  // Return the tx hash.
295
- broadcastMsgs(msgs, fee, memo = "", signOptions, mode = "async") {
233
+ broadcastMsgs(msgs, fee, memo = "", signOptions) {
296
234
  var _a;
297
235
  return __awaiter(this, void 0, void 0, function* () {
298
236
  if (this.base.walletStatus !== base_1.WalletStatus.Loaded) {
@@ -432,7 +370,7 @@ class CosmosAccountImpl {
432
370
  sendTx = signOptions.sendTx;
433
371
  }
434
372
  return {
435
- txHash: yield sendTx(this.chainId, signedTx, mode),
373
+ txHash: yield sendTx(this.chainId, signedTx, "sync"),
436
374
  signDoc: signResponse.signed,
437
375
  };
438
376
  });
@@ -978,66 +916,6 @@ class CosmosAccountImpl {
978
916
  }
979
917
  });
980
918
  }
981
- /**
982
- * @deprecated
983
- * Send `MsgUndelegate` msg to the chain.
984
- * @param amount Decimal number used by humans.
985
- * If amount is 0.1 and the stake currenct is uatom, actual amount will be changed to the 100000uatom.
986
- * @param validatorAddress
987
- * @param memo
988
- * @param onFulfill
989
- */
990
- sendUndelegateMsg(amount, validatorAddress, memo = "", stdFee = {}, signOptions, onTxEvents) {
991
- var _a, _b;
992
- return __awaiter(this, void 0, void 0, function* () {
993
- const currency = this.chainGetter.getChain(this.chainId).stakeCurrency;
994
- let dec = new unit_1.Dec(amount);
995
- dec = dec.mulTruncate(unit_1.DecUtils.getPrecisionDec(currency.coinDecimals));
996
- const msg = {
997
- type: this.msgOpts.undelegate.type,
998
- value: {
999
- delegator_address: this.base.bech32Address,
1000
- validator_address: validatorAddress,
1001
- amount: {
1002
- denom: currency.coinMinimalDenom,
1003
- amount: dec.truncate().toString(),
1004
- },
1005
- },
1006
- };
1007
- yield this.sendMsgs("undelegate", {
1008
- aminoMsgs: [msg],
1009
- protoMsgs: [
1010
- {
1011
- typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate",
1012
- value: tx_4.MsgUndelegate.encode({
1013
- delegatorAddress: msg.value.delegator_address,
1014
- validatorAddress: msg.value.validator_address,
1015
- amount: msg.value.amount,
1016
- }).finish(),
1017
- },
1018
- ],
1019
- }, memo, {
1020
- amount: (_a = stdFee.amount) !== null && _a !== void 0 ? _a : [],
1021
- gas: (_b = stdFee.gas) !== null && _b !== void 0 ? _b : this.msgOpts.undelegate.gas.toString(),
1022
- }, signOptions, (0, utils_1.txEventsWithPreOnFulfill)(onTxEvents, (tx) => {
1023
- if (tx.code == null || tx.code === 0) {
1024
- // After succeeding to unbond, refresh the validators and delegations, unbonding delegations, rewards.
1025
- this.queries.cosmos.queryValidators
1026
- .getQueryStatus(types_1.BondStatus.Bonded)
1027
- .fetch();
1028
- this.queries.cosmos.queryDelegations
1029
- .getQueryBech32Address(this.base.bech32Address)
1030
- .fetch();
1031
- this.queries.cosmos.queryUnbondingDelegations
1032
- .getQueryBech32Address(this.base.bech32Address)
1033
- .fetch();
1034
- this.queries.cosmos.queryRewards
1035
- .getQueryBech32Address(this.base.bech32Address)
1036
- .fetch();
1037
- }
1038
- }));
1039
- });
1040
- }
1041
919
  makeBeginRedelegateTx(amount, srcValidatorAddress, dstValidatorAddress) {
1042
920
  cosmos_1.Bech32Address.validate(srcValidatorAddress, this.chainGetter.getChain(this.chainId).bech32Config.bech32PrefixValAddr);
1043
921
  cosmos_1.Bech32Address.validate(dstValidatorAddress, this.chainGetter.getChain(this.chainId).bech32Config.bech32PrefixValAddr);
@@ -1096,66 +974,6 @@ class CosmosAccountImpl {
1096
974
  }
1097
975
  });
1098
976
  }
1099
- /**
1100
- * @deprecated
1101
- * Send `MsgBeginRedelegate` msg to the chain.
1102
- * @param amount Decimal number used by humans.
1103
- * If amount is 0.1 and the stake currenct is uatom, actual amount will be changed to the 100000uatom.
1104
- * @param srcValidatorAddress
1105
- * @param dstValidatorAddress
1106
- * @param memo
1107
- * @param onFulfill
1108
- */
1109
- sendBeginRedelegateMsg(amount, srcValidatorAddress, dstValidatorAddress, memo = "", stdFee = {}, signOptions, onTxEvents) {
1110
- var _a, _b;
1111
- return __awaiter(this, void 0, void 0, function* () {
1112
- const currency = this.chainGetter.getChain(this.chainId).stakeCurrency;
1113
- let dec = new unit_1.Dec(amount);
1114
- dec = dec.mulTruncate(unit_1.DecUtils.getPrecisionDec(currency.coinDecimals));
1115
- const msg = {
1116
- type: this.msgOpts.redelegate.type,
1117
- value: {
1118
- delegator_address: this.base.bech32Address,
1119
- validator_src_address: srcValidatorAddress,
1120
- validator_dst_address: dstValidatorAddress,
1121
- amount: {
1122
- denom: currency.coinMinimalDenom,
1123
- amount: dec.truncate().toString(),
1124
- },
1125
- },
1126
- };
1127
- yield this.sendMsgs("redelegate", {
1128
- aminoMsgs: [msg],
1129
- protoMsgs: [
1130
- {
1131
- typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate",
1132
- value: tx_4.MsgBeginRedelegate.encode({
1133
- delegatorAddress: msg.value.delegator_address,
1134
- validatorSrcAddress: msg.value.validator_src_address,
1135
- validatorDstAddress: msg.value.validator_dst_address,
1136
- amount: msg.value.amount,
1137
- }).finish(),
1138
- },
1139
- ],
1140
- }, memo, {
1141
- amount: (_a = stdFee.amount) !== null && _a !== void 0 ? _a : [],
1142
- gas: (_b = stdFee.gas) !== null && _b !== void 0 ? _b : this.msgOpts.redelegate.gas.toString(),
1143
- }, signOptions, (0, utils_1.txEventsWithPreOnFulfill)(onTxEvents, (tx) => {
1144
- if (tx.code == null || tx.code === 0) {
1145
- // After succeeding to redelegate, refresh the validators and delegations, rewards.
1146
- this.queries.cosmos.queryValidators
1147
- .getQueryStatus(types_1.BondStatus.Bonded)
1148
- .fetch();
1149
- this.queries.cosmos.queryDelegations
1150
- .getQueryBech32Address(this.base.bech32Address)
1151
- .fetch();
1152
- this.queries.cosmos.queryRewards
1153
- .getQueryBech32Address(this.base.bech32Address)
1154
- .fetch();
1155
- }
1156
- }));
1157
- });
1158
- }
1159
977
  makeWithdrawDelegationRewardTx(validatorAddresses) {
1160
978
  for (const validatorAddress of validatorAddresses) {
1161
979
  cosmos_1.Bech32Address.validate(validatorAddress, this.chainGetter.getChain(this.chainId).bech32Config.bech32PrefixValAddr);
@@ -1195,45 +1013,6 @@ class CosmosAccountImpl {
1195
1013
  }
1196
1014
  });
1197
1015
  }
1198
- /**
1199
- * @deprecated
1200
- */
1201
- sendWithdrawDelegationRewardMsgs(validatorAddresses, memo = "", stdFee = {}, signOptions, onTxEvents) {
1202
- var _a, _b;
1203
- return __awaiter(this, void 0, void 0, function* () {
1204
- const msgs = validatorAddresses.map((validatorAddress) => {
1205
- return {
1206
- type: this.msgOpts.withdrawRewards.type,
1207
- value: {
1208
- delegator_address: this.base.bech32Address,
1209
- validator_address: validatorAddress,
1210
- },
1211
- };
1212
- });
1213
- yield this.sendMsgs("withdrawRewards", {
1214
- aminoMsgs: msgs,
1215
- protoMsgs: msgs.map((msg) => {
1216
- return {
1217
- typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",
1218
- value: tx_5.MsgWithdrawDelegatorReward.encode({
1219
- delegatorAddress: msg.value.delegator_address,
1220
- validatorAddress: msg.value.validator_address,
1221
- }).finish(),
1222
- };
1223
- }),
1224
- }, memo, {
1225
- amount: (_a = stdFee.amount) !== null && _a !== void 0 ? _a : [],
1226
- gas: (_b = stdFee.gas) !== null && _b !== void 0 ? _b : (this.msgOpts.withdrawRewards.gas * validatorAddresses.length).toString(),
1227
- }, signOptions, (0, utils_1.txEventsWithPreOnFulfill)(onTxEvents, (tx) => {
1228
- if (tx.code == null || tx.code === 0) {
1229
- // After succeeding to withdraw rewards, refresh rewards.
1230
- this.queries.cosmos.queryRewards
1231
- .getQueryBech32Address(this.base.bech32Address)
1232
- .fetch();
1233
- }
1234
- }));
1235
- });
1236
- }
1237
1016
  makeGovVoteTx(proposalId, option) {
1238
1017
  const voteOption = (() => {
1239
1018
  switch (option) {
@@ -1299,73 +1078,6 @@ class CosmosAccountImpl {
1299
1078
  }
1300
1079
  });
1301
1080
  }
1302
- /**
1303
- * @deprecated
1304
- */
1305
- sendGovVoteMsg(proposalId, option, memo = "", stdFee = {}, signOptions, onTxEvents) {
1306
- var _a, _b;
1307
- return __awaiter(this, void 0, void 0, function* () {
1308
- const voteOption = (() => {
1309
- switch (option) {
1310
- case "Yes":
1311
- return 1;
1312
- case "Abstain":
1313
- return 2;
1314
- case "No":
1315
- return 3;
1316
- case "NoWithVeto":
1317
- return 4;
1318
- }
1319
- })();
1320
- const msg = {
1321
- type: this.msgOpts.govVote.type,
1322
- value: {
1323
- option: voteOption,
1324
- proposal_id: proposalId,
1325
- voter: this.base.bech32Address,
1326
- },
1327
- };
1328
- yield this.sendMsgs("govVote", {
1329
- aminoMsgs: [msg],
1330
- protoMsgs: [
1331
- {
1332
- typeUrl: "/cosmos.gov.v1beta1.MsgVote",
1333
- value: tx_6.MsgVote.encode({
1334
- proposalId: msg.value.proposal_id,
1335
- voter: msg.value.voter,
1336
- option: (() => {
1337
- switch (msg.value.option) {
1338
- case 1:
1339
- return gov_1.VoteOption.VOTE_OPTION_YES;
1340
- case 2:
1341
- return gov_1.VoteOption.VOTE_OPTION_ABSTAIN;
1342
- case 3:
1343
- return gov_1.VoteOption.VOTE_OPTION_NO;
1344
- case 4:
1345
- return gov_1.VoteOption.VOTE_OPTION_NO_WITH_VETO;
1346
- default:
1347
- return gov_1.VoteOption.VOTE_OPTION_UNSPECIFIED;
1348
- }
1349
- })(),
1350
- }).finish(),
1351
- },
1352
- ],
1353
- }, memo, {
1354
- amount: (_a = stdFee.amount) !== null && _a !== void 0 ? _a : [],
1355
- gas: (_b = stdFee.gas) !== null && _b !== void 0 ? _b : this.msgOpts.govVote.gas.toString(),
1356
- }, signOptions, (0, utils_1.txEventsWithPreOnFulfill)(onTxEvents, (tx) => {
1357
- if (tx.code == null || tx.code === 0) {
1358
- // After succeeding to vote, refresh the proposal.
1359
- const proposal = this.queries.cosmos.queryGovernance.proposals.find((proposal) => proposal.id === proposalId);
1360
- if (proposal) {
1361
- proposal.fetch();
1362
- }
1363
- const vote = this.queries.cosmos.queryProposalVote.getVote(proposalId, this.base.bech32Address);
1364
- vote.fetch();
1365
- }
1366
- }));
1367
- });
1368
- }
1369
1081
  get queries() {
1370
1082
  return this.queriesStore.get(this.chainId);
1371
1083
  }