@firmachain/firma-js 0.2.32 → 0.2.33

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.
Files changed (40) hide show
  1. package/dist/sdk/FirmaAuthzService.js +15 -15
  2. package/dist/sdk/FirmaBankService.js +1 -1
  3. package/dist/sdk/FirmaContractService.js +10 -12
  4. package/dist/sdk/FirmaCosmWasmService.js +18 -18
  5. package/dist/sdk/FirmaDistributionService.js +5 -5
  6. package/dist/sdk/FirmaFeeGrantService.js +3 -3
  7. package/dist/sdk/FirmaGovService.js +19 -19
  8. package/dist/sdk/FirmaIbcService.js +3 -3
  9. package/dist/sdk/FirmaNftService.js +6 -6
  10. package/dist/sdk/FirmaStakingService.js +5 -5
  11. package/dist/sdk/FirmaTokenService.js +12 -12
  12. package/dist/sdk/FirmaUtil.d.ts +11 -1
  13. package/dist/sdk/FirmaUtil.js +137 -11
  14. package/dist/sdk/firmachain/authz/AuthzTxClient.d.ts +5 -4
  15. package/dist/sdk/firmachain/authz/AuthzTxClient.js +6 -3
  16. package/dist/sdk/firmachain/bank/BankTxClient.d.ts +4 -3
  17. package/dist/sdk/firmachain/bank/BankTxClient.js +5 -2
  18. package/dist/sdk/firmachain/common/ITxClient.d.ts +3 -3
  19. package/dist/sdk/firmachain/common/ITxClient.js +14 -8
  20. package/dist/sdk/firmachain/common/signingstargateclient.d.ts +15 -8
  21. package/dist/sdk/firmachain/common/signingstargateclient.js +68 -9
  22. package/dist/sdk/firmachain/contract/ContractTxClient.d.ts +4 -3
  23. package/dist/sdk/firmachain/contract/ContractTxClient.js +5 -2
  24. package/dist/sdk/firmachain/cosmwasm/CosmWasmTxClient.d.ts +8 -7
  25. package/dist/sdk/firmachain/cosmwasm/CosmWasmTxClient.js +9 -6
  26. package/dist/sdk/firmachain/distribution/DistributionTxClient.d.ts +6 -5
  27. package/dist/sdk/firmachain/distribution/DistributionTxClient.js +7 -4
  28. package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.d.ts +4 -3
  29. package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.js +5 -2
  30. package/dist/sdk/firmachain/gov/GovTxClient.d.ts +5 -4
  31. package/dist/sdk/firmachain/gov/GovTxClient.js +6 -3
  32. package/dist/sdk/firmachain/ibc/IbcTxClient.d.ts +3 -2
  33. package/dist/sdk/firmachain/ibc/IbcTxClient.js +4 -1
  34. package/dist/sdk/firmachain/nft/NftTxClient.d.ts +5 -4
  35. package/dist/sdk/firmachain/nft/NftTxClient.js +6 -3
  36. package/dist/sdk/firmachain/staking/StakingTxClient.d.ts +7 -6
  37. package/dist/sdk/firmachain/staking/StakingTxClient.js +8 -5
  38. package/dist/sdk/firmachain/token/TokenTxClient.d.ts +6 -5
  39. package/dist/sdk/firmachain/token/TokenTxClient.js +7 -4
  40. package/package.json +3 -3
@@ -97,6 +97,9 @@ var SigningStargateClient = /** @class */ (function (_super) {
97
97
  _this.signer = signer;
98
98
  return _this;
99
99
  }
100
+ SigningStargateClient.prototype.getSigner = function () {
101
+ return this.signer;
102
+ };
100
103
  SigningStargateClient.connectWithSigner = function (endpoint, signer, registry) {
101
104
  return __awaiter(this, void 0, void 0, function () {
102
105
  var tmClient;
@@ -127,6 +130,38 @@ var SigningStargateClient = /** @class */ (function (_super) {
127
130
  });
128
131
  });
129
132
  };
133
+ SigningStargateClient.makeSignDocForSend = function (signerAddress, messages, fee, memo, serverUrl, chainId, registry) {
134
+ return __awaiter(this, void 0, void 0, function () {
135
+ var _a, accountNumber, sequence, account, rawSecp256k1Pubkey, pubkey, txBodyEncodeObject, txBodyBytes, gasLimit, authInfoBytes;
136
+ return __generator(this, function (_b) {
137
+ switch (_b.label) {
138
+ case 0:
139
+ SigningStargateClient._endpoint = serverUrl;
140
+ return [4 /*yield*/, SigningStargateClient.getSequence(signerAddress)];
141
+ case 1:
142
+ _a = _b.sent(), accountNumber = _a.accountNumber, sequence = _a.sequence;
143
+ return [4 /*yield*/, SigningStargateClient.getAccount(signerAddress)];
144
+ case 2:
145
+ account = _b.sent();
146
+ if (account == null)
147
+ throw new Error("Failed to retrieve account from signer");
148
+ rawSecp256k1Pubkey = encoding_1.fromBase64(account.pubkey.value);
149
+ pubkey = proto_signing_1.encodePubkey(encoding_3.encodeSecp256k1Pubkey(rawSecp256k1Pubkey));
150
+ txBodyEncodeObject = {
151
+ typeUrl: "/cosmos.tx.v1beta1.TxBody",
152
+ value: {
153
+ messages: messages,
154
+ memo: memo,
155
+ },
156
+ };
157
+ txBodyBytes = registry.encode(txBodyEncodeObject);
158
+ gasLimit = math_1.Int53.fromString(fee.gas).toNumber();
159
+ authInfoBytes = this.makeAuthInfoBytes([{ pubkey: pubkey, sequence: sequence }], fee.amount, gasLimit, fee.granter);
160
+ return [2 /*return*/, proto_signing_1.makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber)];
161
+ }
162
+ });
163
+ });
164
+ };
130
165
  SigningStargateClient.prototype.sign = function (signerAddress, messages, fee, memo, explicitSignerData) {
131
166
  return __awaiter(this, void 0, void 0, function () {
132
167
  var signerData, _a, accountNumber, sequence, chainId;
@@ -136,7 +171,7 @@ var SigningStargateClient = /** @class */ (function (_super) {
136
171
  if (!explicitSignerData) return [3 /*break*/, 1];
137
172
  signerData = explicitSignerData;
138
173
  return [3 /*break*/, 4];
139
- case 1: return [4 /*yield*/, this.getSequence(signerAddress)];
174
+ case 1: return [4 /*yield*/, SigningStargateClient.getSequence(signerAddress)];
140
175
  case 2:
141
176
  _a = _b.sent(), accountNumber = _a.accountNumber, sequence = _a.sequence;
142
177
  return [4 /*yield*/, this.getChainId()];
@@ -178,10 +213,10 @@ var SigningStargateClient = /** @class */ (function (_super) {
178
213
  * This is called AccAddress in Cosmos SDK, which is basically an alias for raw binary data.
179
214
  * The result is typically 20 bytes long but not restricted to that.
180
215
  */
181
- SigningStargateClient.prototype.toAccAddress = function (address) {
216
+ SigningStargateClient.toAccAddress = function (address) {
182
217
  return encoding_2.Bech32.decode(address).data;
183
218
  };
184
- SigningStargateClient.prototype.getAccount = function (address) {
219
+ SigningStargateClient.getAccount = function (address) {
185
220
  return __awaiter(this, void 0, void 0, function () {
186
221
  var accAddress, hexAccAddress, axios, path, result, finalData, account, finalAccount, error_1;
187
222
  return __generator(this, function (_a) {
@@ -213,7 +248,7 @@ var SigningStargateClient = /** @class */ (function (_super) {
213
248
  });
214
249
  });
215
250
  };
216
- SigningStargateClient.prototype.getSequence = function (address) {
251
+ SigningStargateClient.getSequence = function (address) {
217
252
  return __awaiter(this, void 0, void 0, function () {
218
253
  var account;
219
254
  return __generator(this, function (_a) {
@@ -232,7 +267,7 @@ var SigningStargateClient = /** @class */ (function (_super) {
232
267
  });
233
268
  });
234
269
  };
235
- SigningStargateClient.prototype.makeSignerInfos = function (signers, signMode) {
270
+ SigningStargateClient.makeSignerInfos = function (signers, signMode) {
236
271
  return signers.map(function (_a) {
237
272
  var pubkey = _a.pubkey, sequence = _a.sequence;
238
273
  return ({
@@ -244,7 +279,7 @@ var SigningStargateClient = /** @class */ (function (_super) {
244
279
  });
245
280
  });
246
281
  };
247
- SigningStargateClient.prototype.makeAuthInfoBytes = function (signers, feeAmount, gasLimit, granter, signMode) {
282
+ SigningStargateClient.makeAuthInfoBytes = function (signers, feeAmount, gasLimit, granter, signMode) {
248
283
  if (signMode === void 0) { signMode = signing_1.SignMode.SIGN_MODE_DIRECT; }
249
284
  var authInfo = {
250
285
  signerInfos: this.makeSignerInfos(signers, signMode),
@@ -262,7 +297,7 @@ var SigningStargateClient = /** @class */ (function (_super) {
262
297
  var accountFromSigner, pubkey, txBodyEncodeObject, txBodyBytes, gasLimit, authInfoBytes, signDoc, _b, signature, signed;
263
298
  return __generator(this, function (_c) {
264
299
  switch (_c.label) {
265
- case 0: return [4 /*yield*/, this.signer.getAccounts()];
300
+ case 0: return [4 /*yield*/, this.getSigner().getAccounts()];
266
301
  case 1:
267
302
  accountFromSigner = (_c.sent()).find(function (account) { return account.address === signerAddress; });
268
303
  if (!accountFromSigner) {
@@ -278,9 +313,9 @@ var SigningStargateClient = /** @class */ (function (_super) {
278
313
  };
279
314
  txBodyBytes = this.registry.encode(txBodyEncodeObject);
280
315
  gasLimit = math_1.Int53.fromString(fee.gas).toNumber();
281
- authInfoBytes = this.makeAuthInfoBytes([{ pubkey: pubkey, sequence: sequence }], fee.amount, gasLimit, fee.granter);
316
+ authInfoBytes = SigningStargateClient.makeAuthInfoBytes([{ pubkey: pubkey, sequence: sequence }], fee.amount, gasLimit, fee.granter);
282
317
  signDoc = proto_signing_1.makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber);
283
- return [4 /*yield*/, this.signer.signDirect(signerAddress, signDoc)];
318
+ return [4 /*yield*/, this.getSigner().signDirect(signerAddress, signDoc)];
284
319
  case 2:
285
320
  _b = _c.sent(), signature = _b.signature, signed = _b.signed;
286
321
  return [2 /*return*/, tx_1.TxRaw.fromPartial({
@@ -292,6 +327,30 @@ var SigningStargateClient = /** @class */ (function (_super) {
292
327
  });
293
328
  });
294
329
  };
330
+ SigningStargateClient.prototype.signDirectForSignDoc = function (signerAddress, signDoc) {
331
+ return __awaiter(this, void 0, void 0, function () {
332
+ var accountFromSigner, _a, signature, signed, txRaw;
333
+ return __generator(this, function (_b) {
334
+ switch (_b.label) {
335
+ case 0: return [4 /*yield*/, this.getSigner().getAccounts()];
336
+ case 1:
337
+ accountFromSigner = (_b.sent()).find(function (account) { return account.address === signerAddress; });
338
+ if (!accountFromSigner) {
339
+ throw new Error("Failed to retrieve account from signer");
340
+ }
341
+ return [4 /*yield*/, this.getSigner().signDirect(signerAddress, signDoc)];
342
+ case 2:
343
+ _a = _b.sent(), signature = _a.signature, signed = _a.signed;
344
+ txRaw = tx_1.TxRaw.fromPartial({
345
+ bodyBytes: signed.bodyBytes,
346
+ authInfoBytes: signed.authInfoBytes,
347
+ signatures: [encoding_1.fromBase64(signature.signature)],
348
+ });
349
+ return [2 /*return*/, { txRaw: txRaw, signature: signature.signature }];
350
+ }
351
+ });
352
+ });
353
+ };
295
354
  SigningStargateClient._endpoint = "";
296
355
  return SigningStargateClient;
297
356
  }(stargateclient_1.StargateClient));
@@ -1,4 +1,4 @@
1
- import { EncodeObject } from "@cosmjs/proto-signing";
1
+ import { Registry, EncodeObject } from "@cosmjs/proto-signing";
2
2
  import { MsgCreateContractFile, MsgAddContractLog } from "./ContractTxTypes";
3
3
  import { ITxClient } from "../common/ITxClient";
4
4
  import { FirmaWalletService } from "../../FirmaWalletService";
@@ -12,6 +12,7 @@ export interface MsgCreateContractFileEncodeObject extends EncodeObject {
12
12
  }
13
13
  export declare class ContractTxClient extends ITxClient {
14
14
  constructor(wallet: FirmaWalletService, serverUrl: string);
15
- msgAddContractLog(data: MsgAddContractLog): MsgAddContractLogEncodeObject;
16
- msgCreateContractFile(data: MsgCreateContractFile): MsgCreateContractFileEncodeObject;
15
+ static getRegistry(): Registry;
16
+ static msgAddContractLog(data: MsgAddContractLog): MsgAddContractLogEncodeObject;
17
+ static msgCreateContractFile(data: MsgCreateContractFile): MsgCreateContractFileEncodeObject;
17
18
  }
@@ -29,10 +29,13 @@ var ContractTxClient = /** @class */ (function (_super) {
29
29
  function ContractTxClient(wallet, serverUrl) {
30
30
  return _super.call(this, wallet, serverUrl, registry) || this;
31
31
  }
32
- ContractTxClient.prototype.msgAddContractLog = function (data) {
32
+ ContractTxClient.getRegistry = function () {
33
+ return registry;
34
+ };
35
+ ContractTxClient.msgAddContractLog = function (data) {
33
36
  return { typeUrl: "/firmachain.firmachain.contract.MsgAddContractLog", value: data };
34
37
  };
35
- ContractTxClient.prototype.msgCreateContractFile = function (data) {
38
+ ContractTxClient.msgCreateContractFile = function (data) {
36
39
  return { typeUrl: "/firmachain.firmachain.contract.MsgCreateContractFile", value: data };
37
40
  };
38
41
  return ContractTxClient;
@@ -1,4 +1,4 @@
1
- import { EncodeObject } from "@cosmjs/proto-signing";
1
+ import { Registry, EncodeObject } from "@cosmjs/proto-signing";
2
2
  import { ITxClient } from "../common/ITxClient";
3
3
  import { FirmaWalletService } from "../../FirmaWalletService";
4
4
  import { MsgClearAdmin, MsgExecuteContract, MsgMigrateContract, MsgStoreCode, MsgInstantiateContract, MsgUpdateAdmin } from "cosmjs-types/cosmwasm/wasm/v1/tx";
@@ -28,10 +28,11 @@ export interface MsgExecuteContractEncodeObject extends EncodeObject {
28
28
  }
29
29
  export declare class CosmWasmTxClient extends ITxClient {
30
30
  constructor(wallet: FirmaWalletService, serverUrl: string);
31
- msgStoreCode(data: MsgStoreCode): MsgStoreCodeEncodeObject;
32
- msgInstantiateContract(data: MsgInstantiateContract): MsgInstantiateContractEncodeObject;
33
- msgExecuteContract(data: MsgExecuteContract): MsgExecuteContractEncodeObject;
34
- msgUpdateAdmin(data: MsgUpdateAdmin): MsgUpdateAdminEncodeObject;
35
- msgClearAdmin(data: MsgClearAdmin): MsgClearAdminEncodeObject;
36
- msgMigrateContract(data: MsgMigrateContract): MsgMigrateContractEncodeObject;
31
+ static getRegistry(): Registry;
32
+ static msgStoreCode(data: MsgStoreCode): MsgStoreCodeEncodeObject;
33
+ static msgInstantiateContract(data: MsgInstantiateContract): MsgInstantiateContractEncodeObject;
34
+ static msgExecuteContract(data: MsgExecuteContract): MsgExecuteContractEncodeObject;
35
+ static msgUpdateAdmin(data: MsgUpdateAdmin): MsgUpdateAdminEncodeObject;
36
+ static msgClearAdmin(data: MsgClearAdmin): MsgClearAdminEncodeObject;
37
+ static msgMigrateContract(data: MsgMigrateContract): MsgMigrateContractEncodeObject;
37
38
  }
@@ -33,22 +33,25 @@ var CosmWasmTxClient = /** @class */ (function (_super) {
33
33
  function CosmWasmTxClient(wallet, serverUrl) {
34
34
  return _super.call(this, wallet, serverUrl, registry) || this;
35
35
  }
36
- CosmWasmTxClient.prototype.msgStoreCode = function (data) {
36
+ CosmWasmTxClient.getRegistry = function () {
37
+ return registry;
38
+ };
39
+ CosmWasmTxClient.msgStoreCode = function (data) {
37
40
  return { typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", value: data };
38
41
  };
39
- CosmWasmTxClient.prototype.msgInstantiateContract = function (data) {
42
+ CosmWasmTxClient.msgInstantiateContract = function (data) {
40
43
  return { typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", value: data };
41
44
  };
42
- CosmWasmTxClient.prototype.msgExecuteContract = function (data) {
45
+ CosmWasmTxClient.msgExecuteContract = function (data) {
43
46
  return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: data };
44
47
  };
45
- CosmWasmTxClient.prototype.msgUpdateAdmin = function (data) {
48
+ CosmWasmTxClient.msgUpdateAdmin = function (data) {
46
49
  return { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", value: data };
47
50
  };
48
- CosmWasmTxClient.prototype.msgClearAdmin = function (data) {
51
+ CosmWasmTxClient.msgClearAdmin = function (data) {
49
52
  return { typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", value: data };
50
53
  };
51
- CosmWasmTxClient.prototype.msgMigrateContract = function (data) {
54
+ CosmWasmTxClient.msgMigrateContract = function (data) {
52
55
  return { typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", value: data };
53
56
  };
54
57
  return CosmWasmTxClient;
@@ -1,4 +1,4 @@
1
- import { EncodeObject } from "@cosmjs/proto-signing";
1
+ import { Registry, EncodeObject } from "@cosmjs/proto-signing";
2
2
  import { MsgFundCommunityPool, MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission } from "cosmjs-types/cosmos/distribution/v1beta1/tx";
3
3
  import { FirmaWalletService } from "../../FirmaWalletService";
4
4
  import { ITxClient } from "../common/ITxClient";
@@ -20,8 +20,9 @@ export interface MsgWithdrawValidatorCommissionEncodeObject extends EncodeObject
20
20
  }
21
21
  export declare class DistributionTxClient extends ITxClient {
22
22
  constructor(wallet: FirmaWalletService, serverUrl: string);
23
- msgFundCommunityPool(data: MsgFundCommunityPool): MsgFundCommunityPoolEncodeObject;
24
- msgSetWithdrawAddress(data: MsgSetWithdrawAddress): MsgSetWithdrawAddressEncodeObject;
25
- msgWithdrawDelegatorReward(data: MsgWithdrawDelegatorReward): MsgWithdrawDelegatorRewardEncodeObject;
26
- msgWithdrawValidatorCommission(data: MsgWithdrawValidatorCommission): MsgWithdrawValidatorCommissionEncodeObject;
23
+ static getRegistry(): Registry;
24
+ static msgFundCommunityPool(data: MsgFundCommunityPool): MsgFundCommunityPoolEncodeObject;
25
+ static msgSetWithdrawAddress(data: MsgSetWithdrawAddress): MsgSetWithdrawAddressEncodeObject;
26
+ static msgWithdrawDelegatorReward(data: MsgWithdrawDelegatorReward): MsgWithdrawDelegatorRewardEncodeObject;
27
+ static msgWithdrawValidatorCommission(data: MsgWithdrawValidatorCommission): MsgWithdrawValidatorCommissionEncodeObject;
27
28
  }
@@ -31,16 +31,19 @@ var DistributionTxClient = /** @class */ (function (_super) {
31
31
  function DistributionTxClient(wallet, serverUrl) {
32
32
  return _super.call(this, wallet, serverUrl, registry) || this;
33
33
  }
34
- DistributionTxClient.prototype.msgFundCommunityPool = function (data) {
34
+ DistributionTxClient.getRegistry = function () {
35
+ return registry;
36
+ };
37
+ DistributionTxClient.msgFundCommunityPool = function (data) {
35
38
  return { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", value: data };
36
39
  };
37
- DistributionTxClient.prototype.msgSetWithdrawAddress = function (data) {
40
+ DistributionTxClient.msgSetWithdrawAddress = function (data) {
38
41
  return { typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", value: data };
39
42
  };
40
- DistributionTxClient.prototype.msgWithdrawDelegatorReward = function (data) {
43
+ DistributionTxClient.msgWithdrawDelegatorReward = function (data) {
41
44
  return { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", value: data };
42
45
  };
43
- DistributionTxClient.prototype.msgWithdrawValidatorCommission = function (data) {
46
+ DistributionTxClient.msgWithdrawValidatorCommission = function (data) {
44
47
  return { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", value: data };
45
48
  };
46
49
  return DistributionTxClient;
@@ -1,4 +1,4 @@
1
- import { EncodeObject } from "@cosmjs/proto-signing";
1
+ import { Registry, EncodeObject } from "@cosmjs/proto-signing";
2
2
  import { MsgGrantAllowance, MsgRevokeAllowance } from "./FeeGrantTxTypes";
3
3
  import { ITxClient } from "../common/ITxClient";
4
4
  import { FirmaWalletService } from "../../FirmaWalletService";
@@ -12,6 +12,7 @@ export interface MsgRevokeAllowanceEncodeObject extends EncodeObject {
12
12
  }
13
13
  export declare class FeeGrantTxClient extends ITxClient {
14
14
  constructor(wallet: FirmaWalletService, serverUrl: string);
15
- msgGrantAllowance(data: MsgGrantAllowance): MsgGrantAllowanceEncodeObject;
16
- msgRevokeAllowance(data: MsgRevokeAllowance): MsgRevokeAllowanceEncodeObject;
15
+ static getRegistry(): Registry;
16
+ static msgGrantAllowance(data: MsgGrantAllowance): MsgGrantAllowanceEncodeObject;
17
+ static msgRevokeAllowance(data: MsgRevokeAllowance): MsgRevokeAllowanceEncodeObject;
17
18
  }
@@ -29,10 +29,13 @@ var FeeGrantTxClient = /** @class */ (function (_super) {
29
29
  function FeeGrantTxClient(wallet, serverUrl) {
30
30
  return _super.call(this, wallet, serverUrl, registry) || this;
31
31
  }
32
- FeeGrantTxClient.prototype.msgGrantAllowance = function (data) {
32
+ FeeGrantTxClient.getRegistry = function () {
33
+ return registry;
34
+ };
35
+ FeeGrantTxClient.msgGrantAllowance = function (data) {
33
36
  return { typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", value: data };
34
37
  };
35
- FeeGrantTxClient.prototype.msgRevokeAllowance = function (data) {
38
+ FeeGrantTxClient.msgRevokeAllowance = function (data) {
36
39
  return { typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", value: data };
37
40
  };
38
41
  return FeeGrantTxClient;
@@ -1,4 +1,4 @@
1
- import { EncodeObject } from "@cosmjs/proto-signing";
1
+ import { Registry, EncodeObject } from "@cosmjs/proto-signing";
2
2
  import { MsgDeposit, MsgSubmitProposal, MsgVote } from "cosmjs-types/cosmos/gov/v1beta1/tx";
3
3
  import { FirmaWalletService } from "../../FirmaWalletService";
4
4
  import { ITxClient } from "../common/ITxClient";
@@ -16,7 +16,8 @@ export interface MsgVoteEncodeObject extends EncodeObject {
16
16
  }
17
17
  export declare class GovTxClient extends ITxClient {
18
18
  constructor(wallet: FirmaWalletService, serverUrl: string);
19
- msgDeposit(data: MsgDeposit): MsgDepositEncodeObject;
20
- msgSubmitProposal(data: MsgSubmitProposal): MsgSubmitProposalEncodeObject;
21
- msgVote(data: MsgVote): MsgVoteEncodeObject;
19
+ static getRegistry(): Registry;
20
+ static msgDeposit(data: MsgDeposit): MsgDepositEncodeObject;
21
+ static msgSubmitProposal(data: MsgSubmitProposal): MsgSubmitProposalEncodeObject;
22
+ static msgVote(data: MsgVote): MsgVoteEncodeObject;
22
23
  }
@@ -30,13 +30,16 @@ var GovTxClient = /** @class */ (function (_super) {
30
30
  function GovTxClient(wallet, serverUrl) {
31
31
  return _super.call(this, wallet, serverUrl, registry) || this;
32
32
  }
33
- GovTxClient.prototype.msgDeposit = function (data) {
33
+ GovTxClient.getRegistry = function () {
34
+ return registry;
35
+ };
36
+ GovTxClient.msgDeposit = function (data) {
34
37
  return { typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", value: data };
35
38
  };
36
- GovTxClient.prototype.msgSubmitProposal = function (data) {
39
+ GovTxClient.msgSubmitProposal = function (data) {
37
40
  return { typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", value: data };
38
41
  };
39
- GovTxClient.prototype.msgVote = function (data) {
42
+ GovTxClient.msgVote = function (data) {
40
43
  return { typeUrl: "/cosmos.gov.v1beta1.MsgVote", value: data };
41
44
  };
42
45
  return GovTxClient;
@@ -1,4 +1,4 @@
1
- import { EncodeObject } from "@cosmjs/proto-signing";
1
+ import { Registry, EncodeObject } from "@cosmjs/proto-signing";
2
2
  import { FirmaWalletService } from "../../FirmaWalletService";
3
3
  import { ITxClient } from "../common/ITxClient";
4
4
  import { MsgTransfer } from "cosmjs-types/ibc/applications/transfer/v1/tx";
@@ -8,5 +8,6 @@ export interface MsgTransferEncodeObject extends EncodeObject {
8
8
  }
9
9
  export declare class IbcTxClient extends ITxClient {
10
10
  constructor(wallet: FirmaWalletService, address: string);
11
- msgTransfer(data: MsgTransfer): MsgTransferEncodeObject;
11
+ static getRegistry(): Registry;
12
+ static msgTransfer(data: MsgTransfer): MsgTransferEncodeObject;
12
13
  }
@@ -28,7 +28,10 @@ var IbcTxClient = /** @class */ (function (_super) {
28
28
  function IbcTxClient(wallet, address) {
29
29
  return _super.call(this, wallet, address, registry) || this;
30
30
  }
31
- IbcTxClient.prototype.msgTransfer = function (data) {
31
+ IbcTxClient.getRegistry = function () {
32
+ return registry;
33
+ };
34
+ IbcTxClient.msgTransfer = function (data) {
32
35
  return { typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", value: data };
33
36
  };
34
37
  return IbcTxClient;
@@ -1,4 +1,4 @@
1
- import { EncodeObject } from "@cosmjs/proto-signing";
1
+ import { Registry, EncodeObject } from "@cosmjs/proto-signing";
2
2
  import { MsgTransfer, MsgMint, MsgBurn } from "./NftTxTypes";
3
3
  import { ITxClient } from "../common/ITxClient";
4
4
  import { FirmaWalletService } from "../../FirmaWalletService";
@@ -16,7 +16,8 @@ export interface MsgBurnEncodeObject extends EncodeObject {
16
16
  }
17
17
  export declare class NftTxClient extends ITxClient {
18
18
  constructor(wallet: FirmaWalletService, serverUrl: string);
19
- msgTransfer(data: MsgTransfer): MsgTransferEncodeObject;
20
- msgMint(data: MsgMint): MsgMintEncodeObject;
21
- msgBurn(data: MsgBurn): MsgBurnEncodeObject;
19
+ static getRegistry(): Registry;
20
+ static msgTransfer(data: MsgTransfer): MsgTransferEncodeObject;
21
+ static msgMint(data: MsgMint): MsgMintEncodeObject;
22
+ static msgBurn(data: MsgBurn): MsgBurnEncodeObject;
22
23
  }
@@ -30,13 +30,16 @@ var NftTxClient = /** @class */ (function (_super) {
30
30
  function NftTxClient(wallet, serverUrl) {
31
31
  return _super.call(this, wallet, serverUrl, registry) || this;
32
32
  }
33
- NftTxClient.prototype.msgTransfer = function (data) {
33
+ NftTxClient.getRegistry = function () {
34
+ return registry;
35
+ };
36
+ NftTxClient.msgTransfer = function (data) {
34
37
  return { typeUrl: "/firmachain.firmachain.nft.MsgTransfer", value: data };
35
38
  };
36
- NftTxClient.prototype.msgMint = function (data) {
39
+ NftTxClient.msgMint = function (data) {
37
40
  return { typeUrl: "/firmachain.firmachain.nft.MsgMint", value: data };
38
41
  };
39
- NftTxClient.prototype.msgBurn = function (data) {
42
+ NftTxClient.msgBurn = function (data) {
40
43
  return { typeUrl: "/firmachain.firmachain.nft.MsgBurn", value: data };
41
44
  };
42
45
  return NftTxClient;
@@ -1,4 +1,4 @@
1
- import { EncodeObject } from "@cosmjs/proto-signing";
1
+ import { Registry, EncodeObject } from "@cosmjs/proto-signing";
2
2
  import { MsgBeginRedelegate, MsgCreateValidator, MsgDelegate, MsgEditValidator, MsgUndelegate } from "cosmjs-types/cosmos/staking/v1beta1/tx";
3
3
  import { FirmaWalletService } from "../../FirmaWalletService";
4
4
  import { ITxClient } from "../common/ITxClient";
@@ -24,9 +24,10 @@ export interface MsgCreateValidatorEncodeObject extends EncodeObject {
24
24
  }
25
25
  export declare class StakingTxClient extends ITxClient {
26
26
  constructor(wallet: FirmaWalletService, serverUrl: string);
27
- msgDelegate(data: MsgDelegate): MsgDelegateEncodeObject;
28
- msgUndelegate(data: MsgUndelegate): MsgUndelegateEncodeObject;
29
- msgRedelegate(data: MsgBeginRedelegate): MsgRedelegateEncodeObject;
30
- msgEditValidator(data: MsgEditValidator): MsgEditValidatorEncodeObject;
31
- msgCreateValidator(data: MsgCreateValidator): MsgCreateValidatorEncodeObject;
27
+ static getRegistry(): Registry;
28
+ static msgDelegate(data: MsgDelegate): MsgDelegateEncodeObject;
29
+ static msgUndelegate(data: MsgUndelegate): MsgUndelegateEncodeObject;
30
+ static msgRedelegate(data: MsgBeginRedelegate): MsgRedelegateEncodeObject;
31
+ static msgEditValidator(data: MsgEditValidator): MsgEditValidatorEncodeObject;
32
+ static msgCreateValidator(data: MsgCreateValidator): MsgCreateValidatorEncodeObject;
32
33
  }
@@ -32,19 +32,22 @@ var StakingTxClient = /** @class */ (function (_super) {
32
32
  function StakingTxClient(wallet, serverUrl) {
33
33
  return _super.call(this, wallet, serverUrl, registry) || this;
34
34
  }
35
- StakingTxClient.prototype.msgDelegate = function (data) {
35
+ StakingTxClient.getRegistry = function () {
36
+ return registry;
37
+ };
38
+ StakingTxClient.msgDelegate = function (data) {
36
39
  return { typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", value: data };
37
40
  };
38
- StakingTxClient.prototype.msgUndelegate = function (data) {
41
+ StakingTxClient.msgUndelegate = function (data) {
39
42
  return { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", value: data };
40
43
  };
41
- StakingTxClient.prototype.msgRedelegate = function (data) {
44
+ StakingTxClient.msgRedelegate = function (data) {
42
45
  return { typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", value: data };
43
46
  };
44
- StakingTxClient.prototype.msgEditValidator = function (data) {
47
+ StakingTxClient.msgEditValidator = function (data) {
45
48
  return { typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", value: data };
46
49
  };
47
- StakingTxClient.prototype.msgCreateValidator = function (data) {
50
+ StakingTxClient.msgCreateValidator = function (data) {
48
51
  return { typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", value: data };
49
52
  };
50
53
  return StakingTxClient;
@@ -1,4 +1,4 @@
1
- import { EncodeObject } from "@cosmjs/proto-signing";
1
+ import { Registry, EncodeObject } from "@cosmjs/proto-signing";
2
2
  import { MsgUpdateTokenURI, MsgMint, MsgBurn, MsgCreateToken } from "./TokenTxTypes";
3
3
  import { ITxClient } from "../common/ITxClient";
4
4
  import { FirmaWalletService } from "../../FirmaWalletService";
@@ -20,8 +20,9 @@ export interface MsgBurnEncodeObject extends EncodeObject {
20
20
  }
21
21
  export declare class TokenTxClient extends ITxClient {
22
22
  constructor(wallet: FirmaWalletService, serverUrl: string);
23
- msgCreateToken(data: MsgCreateToken): MsgCreateTokenEncodeObject;
24
- msgUpdateTokenURI(data: MsgUpdateTokenURI): MsgUpdateTokenURIEncodeObject;
25
- msgMint(data: MsgMint): MsgMintEncodeObject;
26
- msgBurn(data: MsgBurn): MsgBurnEncodeObject;
23
+ static getRegistry(): Registry;
24
+ static msgCreateToken(data: MsgCreateToken): MsgCreateTokenEncodeObject;
25
+ static msgUpdateTokenURI(data: MsgUpdateTokenURI): MsgUpdateTokenURIEncodeObject;
26
+ static msgMint(data: MsgMint): MsgMintEncodeObject;
27
+ static msgBurn(data: MsgBurn): MsgBurnEncodeObject;
27
28
  }
@@ -31,16 +31,19 @@ var TokenTxClient = /** @class */ (function (_super) {
31
31
  function TokenTxClient(wallet, serverUrl) {
32
32
  return _super.call(this, wallet, serverUrl, registry) || this;
33
33
  }
34
- TokenTxClient.prototype.msgCreateToken = function (data) {
34
+ TokenTxClient.getRegistry = function () {
35
+ return registry;
36
+ };
37
+ TokenTxClient.msgCreateToken = function (data) {
35
38
  return { typeUrl: "/firmachain.firmachain.token.MsgCreateToken", value: data };
36
39
  };
37
- TokenTxClient.prototype.msgUpdateTokenURI = function (data) {
40
+ TokenTxClient.msgUpdateTokenURI = function (data) {
38
41
  return { typeUrl: "/firmachain.firmachain.token.MsgUpdateTokenURI", value: data };
39
42
  };
40
- TokenTxClient.prototype.msgMint = function (data) {
43
+ TokenTxClient.msgMint = function (data) {
41
44
  return { typeUrl: "/firmachain.firmachain.token.MsgMint", value: data };
42
45
  };
43
- TokenTxClient.prototype.msgBurn = function (data) {
46
+ TokenTxClient.msgBurn = function (data) {
44
47
  return { typeUrl: "/firmachain.firmachain.token.MsgBurn", value: data };
45
48
  };
46
49
  return TokenTxClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firmachain/firma-js",
3
- "version": "0.2.32",
3
+ "version": "0.2.33",
4
4
  "description": "The Official FirmaChain Javascript SDK written in Typescript",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -41,9 +41,9 @@
41
41
  "cosmjs-types": "^0.2.0",
42
42
  "crypto-js": "^4.1.1",
43
43
  "ipfs-http-client": "^52.0.5",
44
+ "pako": "^2.0.2",
44
45
  "protobufjs": "^6.10.2",
45
- "readline-sync": "^1.4.10",
46
- "pako": "^2.0.2"
46
+ "readline-sync": "^1.4.10"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/chai": "^4.2.21",