@firmachain/firma-js 0.2.30 → 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 (75) hide show
  1. package/dist/sdk/FirmaAuthzService.d.ts +41 -0
  2. package/dist/sdk/FirmaAuthzService.js +633 -0
  3. package/dist/sdk/FirmaBankService.d.ts +2 -1
  4. package/dist/sdk/FirmaBankService.js +4 -1
  5. package/dist/sdk/FirmaContractService.js +10 -12
  6. package/dist/sdk/FirmaCosmWasmService.d.ts +38 -0
  7. package/dist/sdk/FirmaCosmWasmService.js +667 -0
  8. package/dist/sdk/FirmaDistributionService.d.ts +2 -1
  9. package/dist/sdk/FirmaDistributionService.js +8 -5
  10. package/dist/sdk/FirmaFeeGrantService.js +3 -3
  11. package/dist/sdk/FirmaGovService.js +19 -19
  12. package/dist/sdk/FirmaIbcService.d.ts +15 -0
  13. package/dist/sdk/FirmaIbcService.js +144 -0
  14. package/dist/sdk/FirmaMobileSDK.d.ts +3 -1
  15. package/dist/sdk/FirmaMobileSDK.js +4 -1
  16. package/dist/sdk/FirmaNftService.js +6 -6
  17. package/dist/sdk/FirmaSDK.d.ts +7 -1
  18. package/dist/sdk/FirmaSDK.js +10 -1
  19. package/dist/sdk/FirmaStakingService.d.ts +18 -5
  20. package/dist/sdk/FirmaStakingService.js +20 -13
  21. package/dist/sdk/FirmaTokenService.js +12 -12
  22. package/dist/sdk/FirmaUtil.d.ts +18 -1
  23. package/dist/sdk/FirmaUtil.js +193 -0
  24. package/dist/sdk/FirmaWalletService.d.ts +3 -0
  25. package/dist/sdk/FirmaWalletService.js +18 -10
  26. package/dist/sdk/firmachain/amino/signer.d.ts +1 -2
  27. package/dist/sdk/firmachain/authz/AuthzQueryClient.d.ts +48 -0
  28. package/dist/sdk/firmachain/authz/AuthzQueryClient.js +142 -0
  29. package/dist/sdk/firmachain/authz/AuthzTxClient.d.ts +23 -0
  30. package/dist/sdk/firmachain/authz/AuthzTxClient.js +47 -0
  31. package/dist/sdk/firmachain/authz/AuthzTxTypes.d.ts +147 -0
  32. package/dist/sdk/firmachain/authz/AuthzTxTypes.js +358 -0
  33. package/dist/sdk/firmachain/authz/index.d.ts +3 -0
  34. package/dist/sdk/firmachain/authz/index.js +15 -0
  35. package/dist/sdk/firmachain/bank/BankTxClient.d.ts +4 -3
  36. package/dist/sdk/firmachain/bank/BankTxClient.js +5 -2
  37. package/dist/sdk/firmachain/common/ITxClient.d.ts +4 -1
  38. package/dist/sdk/firmachain/common/ITxClient.js +15 -0
  39. package/dist/sdk/firmachain/common/signingaminostargateclient.d.ts +50 -0
  40. package/dist/sdk/firmachain/common/signingaminostargateclient.js +267 -0
  41. package/dist/sdk/firmachain/common/signingstargateclient.d.ts +15 -8
  42. package/dist/sdk/firmachain/common/signingstargateclient.js +68 -9
  43. package/dist/sdk/firmachain/contract/ContractTxClient.d.ts +4 -3
  44. package/dist/sdk/firmachain/contract/ContractTxClient.js +5 -2
  45. package/dist/sdk/firmachain/cosmwasm/CosmWasmQueryClient.d.ts +52 -0
  46. package/dist/sdk/firmachain/cosmwasm/CosmWasmQueryClient.js +193 -0
  47. package/dist/sdk/firmachain/cosmwasm/CosmWasmTxClient.d.ts +38 -0
  48. package/dist/sdk/firmachain/cosmwasm/CosmWasmTxClient.js +59 -0
  49. package/dist/sdk/firmachain/cosmwasm/index.d.ts +3 -0
  50. package/dist/sdk/firmachain/cosmwasm/index.js +15 -0
  51. package/dist/sdk/firmachain/distribution/DistributionTxClient.d.ts +6 -5
  52. package/dist/sdk/firmachain/distribution/DistributionTxClient.js +7 -4
  53. package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.d.ts +4 -3
  54. package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.js +5 -2
  55. package/dist/sdk/firmachain/gov/GovTxClient.d.ts +5 -4
  56. package/dist/sdk/firmachain/gov/GovTxClient.js +6 -3
  57. package/dist/sdk/firmachain/ibc/IbcQueryClient.d.ts +34 -0
  58. package/dist/sdk/firmachain/ibc/IbcQueryClient.js +71 -0
  59. package/dist/sdk/firmachain/ibc/IbcTxClient.d.ts +13 -0
  60. package/dist/sdk/firmachain/ibc/IbcTxClient.js +39 -0
  61. package/dist/sdk/firmachain/ibc/index.d.ts +3 -0
  62. package/dist/sdk/firmachain/ibc/index.js +15 -0
  63. package/dist/sdk/firmachain/nft/NftTxClient.d.ts +5 -4
  64. package/dist/sdk/firmachain/nft/NftTxClient.js +6 -3
  65. package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +17 -4
  66. package/dist/sdk/firmachain/staking/StakingQueryClient.js +38 -18
  67. package/dist/sdk/firmachain/staking/StakingTxClient.d.ts +7 -6
  68. package/dist/sdk/firmachain/staking/StakingTxClient.js +8 -5
  69. package/dist/sdk/firmachain/token/TokenTxClient.d.ts +6 -5
  70. package/dist/sdk/firmachain/token/TokenTxClient.js +7 -4
  71. package/package.json +3 -1
  72. package/dist/sdk/firmachain/amino/secp256k1hdwallet.d.ts +0 -94
  73. package/dist/sdk/firmachain/amino/secp256k1hdwallet.js +0 -437
  74. package/dist/sdk/firmachain/amino/secp256k1wallet.d.ts +0 -23
  75. package/dist/sdk/firmachain/amino/secp256k1wallet.js +0 -141
@@ -1,10 +1,11 @@
1
- import { TxMisc, Token } from "./firmachain/bank";
1
+ import { BankTxClient, TxMisc, Token } from "./firmachain/bank";
2
2
  import { FirmaWalletService } from "./FirmaWalletService";
3
3
  import { FirmaConfig } from "./FirmaConfig";
4
4
  import { BroadcastTxResponse } from "./firmachain/common/stargateclient";
5
5
  export declare class FirmaBankService {
6
6
  private readonly config;
7
7
  constructor(config: FirmaConfig);
8
+ getTxClient(wallet: FirmaWalletService): BankTxClient;
8
9
  getGasEstimationSend(wallet: FirmaWalletService, targetAddress: string, amount: number, txMisc?: TxMisc): Promise<number>;
9
10
  getGasEstimationSendToken(wallet: FirmaWalletService, targetAddress: string, tokenID: string, amount: number, decimal: number, txMisc?: TxMisc): Promise<number>;
10
11
  sendToken(wallet: FirmaWalletService, targetAddress: string, tokenID: string, amount: number, decimal: number, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
@@ -43,6 +43,9 @@ var FirmaBankService = /** @class */ (function () {
43
43
  function FirmaBankService(config) {
44
44
  this.config = config;
45
45
  }
46
+ FirmaBankService.prototype.getTxClient = function (wallet) {
47
+ return new bank_1.BankTxClient(wallet, this.config.rpcAddress);
48
+ };
46
49
  FirmaBankService.prototype.getGasEstimationSend = function (wallet, targetAddress, amount, txMisc) {
47
50
  if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
48
51
  return __awaiter(this, void 0, void 0, function () {
@@ -216,7 +219,7 @@ var FirmaBankService = /** @class */ (function () {
216
219
  case 1:
217
220
  address = _a.sent();
218
221
  sendAmount = { denom: denom, amount: amount };
219
- message = bankTxClient.msgSend({ fromAddress: address, toAddress: targetAddress, amount: [sendAmount] });
222
+ message = bank_1.BankTxClient.msgSend({ fromAddress: address, toAddress: targetAddress, amount: [sendAmount] });
220
223
  return [4 /*yield*/, bankTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
221
224
  case 2: return [2 /*return*/, _a.sent()];
222
225
  case 3:
@@ -206,7 +206,7 @@ var ContractService = /** @class */ (function () {
206
206
  };
207
207
  ContractService.prototype.getUnsignedTxCreateContractFile = function (wallet, fileHash, timeStamp, ownerList, metaDataJsonString) {
208
208
  return __awaiter(this, void 0, void 0, function () {
209
- var address, contractTxClient, error_9;
209
+ var address, error_9;
210
210
  return __generator(this, function (_a) {
211
211
  switch (_a.label) {
212
212
  case 0:
@@ -214,8 +214,7 @@ var ContractService = /** @class */ (function () {
214
214
  return [4 /*yield*/, wallet.getAddress()];
215
215
  case 1:
216
216
  address = _a.sent();
217
- contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
218
- return [2 /*return*/, contractTxClient.msgCreateContractFile({
217
+ return [2 /*return*/, contract_1.ContractTxClient.msgCreateContractFile({
219
218
  creator: address,
220
219
  fileHash: fileHash,
221
220
  timeStamp: timeStamp,
@@ -234,7 +233,7 @@ var ContractService = /** @class */ (function () {
234
233
  ContractService.prototype.getSignedTxCreateContractFile = function (wallet, fileHash, timeStamp, ownerList, metaDataJsonString, txMisc) {
235
234
  if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
236
235
  return __awaiter(this, void 0, void 0, function () {
237
- var address, contractTxClient, message, error_10;
236
+ var address, message, contractTxClient, error_10;
238
237
  return __generator(this, function (_a) {
239
238
  switch (_a.label) {
240
239
  case 0:
@@ -242,14 +241,14 @@ var ContractService = /** @class */ (function () {
242
241
  return [4 /*yield*/, wallet.getAddress()];
243
242
  case 1:
244
243
  address = _a.sent();
245
- contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
246
- message = contractTxClient.msgCreateContractFile({
244
+ message = contract_1.ContractTxClient.msgCreateContractFile({
247
245
  creator: address,
248
246
  fileHash: fileHash,
249
247
  timeStamp: timeStamp,
250
248
  ownerList: ownerList,
251
249
  metaDataJsonString: metaDataJsonString
252
250
  });
251
+ contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
253
252
  return [4 /*yield*/, contractTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
254
253
  case 2: return [2 /*return*/, _a.sent()];
255
254
  case 3:
@@ -309,7 +308,7 @@ var ContractService = /** @class */ (function () {
309
308
  ContractService.prototype.getSignedTxAddContractLog = function (wallet, contractHash, timeStamp, eventName, ownerAddress, jsonString, txMisc) {
310
309
  if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
311
310
  return __awaiter(this, void 0, void 0, function () {
312
- var address, contractTxClient, message, error_13;
311
+ var address, message, contractTxClient, error_13;
313
312
  return __generator(this, function (_a) {
314
313
  switch (_a.label) {
315
314
  case 0:
@@ -317,8 +316,7 @@ var ContractService = /** @class */ (function () {
317
316
  return [4 /*yield*/, wallet.getAddress()];
318
317
  case 1:
319
318
  address = _a.sent();
320
- contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
321
- message = contractTxClient.msgAddContractLog({
319
+ message = contract_1.ContractTxClient.msgAddContractLog({
322
320
  creator: address,
323
321
  contractHash: contractHash,
324
322
  timeStamp: timeStamp,
@@ -326,6 +324,7 @@ var ContractService = /** @class */ (function () {
326
324
  ownerAddress: ownerAddress,
327
325
  jsonString: jsonString
328
326
  });
327
+ contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
329
328
  return [4 /*yield*/, contractTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
330
329
  case 2: return [2 /*return*/, _a.sent()];
331
330
  case 3:
@@ -362,7 +361,7 @@ var ContractService = /** @class */ (function () {
362
361
  };
363
362
  ContractService.prototype.getUnsignedTxAddContractLog = function (wallet, contractHash, timeStamp, eventName, ownerAddress, jsonString) {
364
363
  return __awaiter(this, void 0, void 0, function () {
365
- var address, contractTxClient, error_15;
364
+ var address, error_15;
366
365
  return __generator(this, function (_a) {
367
366
  switch (_a.label) {
368
367
  case 0:
@@ -370,8 +369,7 @@ var ContractService = /** @class */ (function () {
370
369
  return [4 /*yield*/, wallet.getAddress()];
371
370
  case 1:
372
371
  address = _a.sent();
373
- contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
374
- return [2 /*return*/, contractTxClient.msgAddContractLog({
372
+ return [2 /*return*/, contract_1.ContractTxClient.msgAddContractLog({
375
373
  creator: address,
376
374
  contractHash: contractHash,
377
375
  timeStamp: timeStamp,
@@ -0,0 +1,38 @@
1
+ import { CosmWasmTxClient, TxMisc, CodeInfo, CodeData, ContractInfo, ContractHistoryInfo, ContractStateInfo } from "./firmachain/cosmwasm";
2
+ import { FirmaWalletService } from "./FirmaWalletService";
3
+ import { FirmaConfig } from "./FirmaConfig";
4
+ import { BroadcastTxResponse } from "./firmachain/common/stargateclient";
5
+ import { Coin } from "cosmjs-types/cosmos/base/v1beta1/coin";
6
+ import { AccessConfig } from "cosmjs-types/cosmwasm/wasm/v1/types";
7
+ export declare class FirmaCosmWasmService {
8
+ private readonly config;
9
+ constructor(config: FirmaConfig);
10
+ getTxClient(wallet: FirmaWalletService): CosmWasmTxClient;
11
+ getGasEstimationStoreCode(wallet: FirmaWalletService, wasmCode: Uint8Array, accessConfig: AccessConfig, txMisc?: TxMisc): Promise<number>;
12
+ storeCode(wallet: FirmaWalletService, wasmCode: Uint8Array, accessConfig: AccessConfig, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
13
+ getGasEstimationUpdateAdmin(wallet: FirmaWalletService, contractAddress: string, adminAddress: string, txMisc?: TxMisc): Promise<number>;
14
+ updateAdmin(wallet: FirmaWalletService, contractAddress: string, adminAddress: string, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
15
+ getGasEstimationClearAdmin(wallet: FirmaWalletService, contractAddress: string, txMisc?: TxMisc): Promise<number>;
16
+ clearAdmin(wallet: FirmaWalletService, contractAddress: string, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
17
+ getGasEstimationMigrateContract(wallet: FirmaWalletService, contractAddress: string, codeId: string, msg: string, txMisc?: TxMisc): Promise<number>;
18
+ migrateContract(wallet: FirmaWalletService, contractAddress: string, codeId: string, msg: string, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
19
+ getGasEstimationExecuteContract(wallet: FirmaWalletService, contractAddress: string, msg: string, funds?: Coin[], txMisc?: TxMisc): Promise<number>;
20
+ executeContract(wallet: FirmaWalletService, contractAddress: string, msg: string, funds?: Coin[], txMisc?: TxMisc): Promise<BroadcastTxResponse>;
21
+ getGasEstimationInstantiateContract(wallet: FirmaWalletService, admin: string, codeId: string, label: string, msg: string, funds: Coin[], txMisc?: TxMisc): Promise<number>;
22
+ instantiateContract(wallet: FirmaWalletService, admin: string, codeId: string, label: string, msg: string, funds: Coin[], txMisc?: TxMisc): Promise<BroadcastTxResponse>;
23
+ private getSignedTxInstantiateContract;
24
+ private getSignedTxUpdateAdmin;
25
+ private getSignedTxClearAdmin;
26
+ private getSignedTxMigrateContract;
27
+ private getSignedTxExecuteContract;
28
+ private getSignedTxStoreCode;
29
+ getCodeList(): Promise<CodeInfo[]>;
30
+ getCodeData(codeId: string): Promise<CodeData>;
31
+ getContractListFromCodeId(codeId: string): Promise<string[]>;
32
+ getContractInfo(codeId: string): Promise<ContractInfo>;
33
+ getContractHistory(codeId: string): Promise<ContractHistoryInfo[]>;
34
+ getContractRawQueryData(contractAddress: string, hexString: string): Promise<string>;
35
+ getContractSmartQueryData(contractAddress: string, query: string): Promise<string>;
36
+ getContractState(codeId: string): Promise<ContractStateInfo[]>;
37
+ getPinnedCodeList(): Promise<string[]>;
38
+ }