@firmachain/firma-js 0.2.13 → 0.2.17

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 (119) hide show
  1. package/package.json +1 -1
  2. package/dist/index.d.ts +0 -3
  3. package/dist/index.js +0 -15
  4. package/dist/sdk/FirmaBankService.d.ts +0 -15
  5. package/dist/sdk/FirmaBankService.js +0 -211
  6. package/dist/sdk/FirmaChainService.d.ts +0 -8
  7. package/dist/sdk/FirmaChainService.js +0 -86
  8. package/dist/sdk/FirmaConfig.d.ts +0 -16
  9. package/dist/sdk/FirmaConfig.js +0 -55
  10. package/dist/sdk/FirmaContractService.d.ts +0 -30
  11. package/dist/sdk/FirmaContractService.js +0 -394
  12. package/dist/sdk/FirmaDistributionService.d.ts +0 -27
  13. package/dist/sdk/FirmaDistributionService.js +0 -450
  14. package/dist/sdk/FirmaFeeGrantService.d.ts +0 -21
  15. package/dist/sdk/FirmaFeeGrantService.js +0 -341
  16. package/dist/sdk/FirmaGovService.d.ts +0 -35
  17. package/dist/sdk/FirmaGovService.js +0 -775
  18. package/dist/sdk/FirmaIpfsService.d.ts +0 -12
  19. package/dist/sdk/FirmaIpfsService.js +0 -185
  20. package/dist/sdk/FirmaNftService.d.ts +0 -28
  21. package/dist/sdk/FirmaNftService.js +0 -390
  22. package/dist/sdk/FirmaSDK.d.ts +0 -29
  23. package/dist/sdk/FirmaSDK.js +0 -48
  24. package/dist/sdk/FirmaSlashingService.d.ts +0 -9
  25. package/dist/sdk/FirmaSlashingService.js +0 -105
  26. package/dist/sdk/FirmaStakingService.d.ts +0 -34
  27. package/dist/sdk/FirmaStakingService.js +0 -604
  28. package/dist/sdk/FirmaTokenService.d.ts +0 -26
  29. package/dist/sdk/FirmaTokenService.js +0 -416
  30. package/dist/sdk/FirmaUtil.d.ts +0 -22
  31. package/dist/sdk/FirmaUtil.js +0 -151
  32. package/dist/sdk/FirmaWalletService.d.ts +0 -28
  33. package/dist/sdk/FirmaWalletService.js +0 -275
  34. package/dist/sdk/firmachain/bank/BankQueryClient.d.ts +0 -12
  35. package/dist/sdk/firmachain/bank/BankQueryClient.js +0 -116
  36. package/dist/sdk/firmachain/bank/BankTxClient.d.ts +0 -16
  37. package/dist/sdk/firmachain/bank/BankTxClient.js +0 -40
  38. package/dist/sdk/firmachain/bank/index.d.ts +0 -3
  39. package/dist/sdk/firmachain/bank/index.js +0 -15
  40. package/dist/sdk/firmachain/common/ITxClient.d.ts +0 -13
  41. package/dist/sdk/firmachain/common/ITxClient.js +0 -98
  42. package/dist/sdk/firmachain/common/QueryCommon.d.ts +0 -4
  43. package/dist/sdk/firmachain/common/QueryCommon.js +0 -2
  44. package/dist/sdk/firmachain/common/TendermintQueryClient.d.ts +0 -42
  45. package/dist/sdk/firmachain/common/TendermintQueryClient.js +0 -108
  46. package/dist/sdk/firmachain/common/TxCommon.d.ts +0 -94
  47. package/dist/sdk/firmachain/common/TxCommon.js +0 -34
  48. package/dist/sdk/firmachain/common/accounts.d.ts +0 -16
  49. package/dist/sdk/firmachain/common/accounts.js +0 -64
  50. package/dist/sdk/firmachain/common/index.d.ts +0 -2
  51. package/dist/sdk/firmachain/common/index.js +0 -14
  52. package/dist/sdk/firmachain/common/signing.d.ts +0 -10
  53. package/dist/sdk/firmachain/common/signing.js +0 -59
  54. package/dist/sdk/firmachain/common/signingstargateclient.d.ts +0 -37
  55. package/dist/sdk/firmachain/common/signingstargateclient.js +0 -282
  56. package/dist/sdk/firmachain/common/stargateclient.d.ts +0 -46
  57. package/dist/sdk/firmachain/common/stargateclient.js +0 -208
  58. package/dist/sdk/firmachain/contract/ContractQueryClient.d.ts +0 -31
  59. package/dist/sdk/firmachain/contract/ContractQueryClient.js +0 -141
  60. package/dist/sdk/firmachain/contract/ContractTxClient.d.ts +0 -16
  61. package/dist/sdk/firmachain/contract/ContractTxClient.js +0 -40
  62. package/dist/sdk/firmachain/contract/ContractTxTypes.d.ts +0 -69
  63. package/dist/sdk/firmachain/contract/ContractTxTypes.js +0 -442
  64. package/dist/sdk/firmachain/contract/index.d.ts +0 -3
  65. package/dist/sdk/firmachain/contract/index.js +0 -15
  66. package/dist/sdk/firmachain/distribution/DistributionQueryClient.d.ts +0 -18
  67. package/dist/sdk/firmachain/distribution/DistributionQueryClient.js +0 -167
  68. package/dist/sdk/firmachain/distribution/DistributionTxClient.d.ts +0 -26
  69. package/dist/sdk/firmachain/distribution/DistributionTxClient.js +0 -48
  70. package/dist/sdk/firmachain/distribution/index.d.ts +0 -3
  71. package/dist/sdk/firmachain/distribution/index.js +0 -16
  72. package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.d.ts +0 -17
  73. package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.js +0 -86
  74. package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.d.ts +0 -16
  75. package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.js +0 -40
  76. package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.d.ts +0 -76
  77. package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.js +0 -144
  78. package/dist/sdk/firmachain/feegrant/index.d.ts +0 -2
  79. package/dist/sdk/firmachain/feegrant/index.js +0 -15
  80. package/dist/sdk/firmachain/google/protobuf/any.d.ts +0 -128
  81. package/dist/sdk/firmachain/google/protobuf/any.js +0 -105
  82. package/dist/sdk/firmachain/google/protobuf/descriptor.d.ts +0 -996
  83. package/dist/sdk/firmachain/google/protobuf/descriptor.js +0 -4289
  84. package/dist/sdk/firmachain/google/protobuf/duration.d.ts +0 -91
  85. package/dist/sdk/firmachain/google/protobuf/duration.js +0 -107
  86. package/dist/sdk/firmachain/google/protobuf/timestamp.d.ts +0 -109
  87. package/dist/sdk/firmachain/google/protobuf/timestamp.js +0 -107
  88. package/dist/sdk/firmachain/gov/GovQueryClient.d.ts +0 -61
  89. package/dist/sdk/firmachain/gov/GovQueryClient.js +0 -152
  90. package/dist/sdk/firmachain/gov/GovTxClient.d.ts +0 -21
  91. package/dist/sdk/firmachain/gov/GovTxClient.js +0 -44
  92. package/dist/sdk/firmachain/gov/index.d.ts +0 -3
  93. package/dist/sdk/firmachain/gov/index.js +0 -16
  94. package/dist/sdk/firmachain/nft/NftQueryClient.d.ts +0 -17
  95. package/dist/sdk/firmachain/nft/NftQueryClient.js +0 -121
  96. package/dist/sdk/firmachain/nft/NftTxClient.d.ts +0 -21
  97. package/dist/sdk/firmachain/nft/NftTxClient.js +0 -44
  98. package/dist/sdk/firmachain/nft/NftTxTypes.d.ts +0 -86
  99. package/dist/sdk/firmachain/nft/NftTxTypes.js +0 -424
  100. package/dist/sdk/firmachain/nft/index.d.ts +0 -3
  101. package/dist/sdk/firmachain/nft/index.js +0 -15
  102. package/dist/sdk/firmachain/slashing/SlashingQueryClient.d.ts +0 -22
  103. package/dist/sdk/firmachain/slashing/SlashingQueryClient.js +0 -101
  104. package/dist/sdk/firmachain/slashing/index.d.ts +0 -2
  105. package/dist/sdk/firmachain/slashing/index.js +0 -14
  106. package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +0 -93
  107. package/dist/sdk/firmachain/staking/StakingQueryClient.js +0 -223
  108. package/dist/sdk/firmachain/staking/StakingTxClient.d.ts +0 -31
  109. package/dist/sdk/firmachain/staking/StakingTxClient.js +0 -52
  110. package/dist/sdk/firmachain/staking/index.d.ts +0 -3
  111. package/dist/sdk/firmachain/staking/index.js +0 -15
  112. package/dist/sdk/firmachain/token/TokenQueryClient.d.ts +0 -24
  113. package/dist/sdk/firmachain/token/TokenQueryClient.js +0 -106
  114. package/dist/sdk/firmachain/token/TokenTxClient.d.ts +0 -26
  115. package/dist/sdk/firmachain/token/TokenTxClient.js +0 -48
  116. package/dist/sdk/firmachain/token/TokenTxTypes.d.ts +0 -116
  117. package/dist/sdk/firmachain/token/TokenTxTypes.js +0 -685
  118. package/dist/sdk/firmachain/token/index.d.ts +0 -3
  119. package/dist/sdk/firmachain/token/index.js +0 -15
@@ -1,442 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.MsgClientImpl = exports.MsgAddContractLogResponse = exports.MsgAddContractLog = exports.MsgCreateContractFileResponse = exports.MsgCreateContractFile = exports.protobufPackage = void 0;
15
- /* eslint-disable */
16
- var minimal_1 = require("protobufjs/minimal");
17
- exports.protobufPackage = "firmachain.firmachain.contract";
18
- var baseMsgCreateContractFile = {
19
- creator: "",
20
- fileHash: "",
21
- timeStamp: 0,
22
- ownerList: "",
23
- metaDataJsonString: "",
24
- };
25
- exports.MsgCreateContractFile = {
26
- encode: function (message, writer) {
27
- if (writer === void 0) { writer = minimal_1.Writer.create(); }
28
- if (message.creator !== "") {
29
- writer.uint32(10).string(message.creator);
30
- }
31
- if (message.fileHash !== "") {
32
- writer.uint32(18).string(message.fileHash);
33
- }
34
- if (message.timeStamp !== 0) {
35
- writer.uint32(24).uint64(message.timeStamp);
36
- }
37
- for (var _i = 0, _a = message.ownerList; _i < _a.length; _i++) {
38
- var v = _a[_i];
39
- writer.uint32(34).string(v);
40
- }
41
- if (message.metaDataJsonString !== "") {
42
- writer.uint32(42).string(message.metaDataJsonString);
43
- }
44
- return writer;
45
- },
46
- decode: function (input, length) {
47
- var reader = input instanceof Uint8Array ? new minimal_1.Reader(input) : input;
48
- var end = length === undefined ? reader.len : reader.pos + length;
49
- var message = __assign({}, baseMsgCreateContractFile);
50
- message.ownerList = [];
51
- while (reader.pos < end) {
52
- var tag = reader.uint32();
53
- switch (tag >>> 3) {
54
- case 1:
55
- message.creator = reader.string();
56
- break;
57
- case 2:
58
- message.fileHash = reader.string();
59
- break;
60
- case 3:
61
- message.timeStamp = longToNumber(reader.uint64());
62
- break;
63
- case 4:
64
- message.ownerList.push(reader.string());
65
- break;
66
- case 5:
67
- message.metaDataJsonString = reader.string();
68
- break;
69
- default:
70
- reader.skipType(tag & 7);
71
- break;
72
- }
73
- }
74
- return message;
75
- },
76
- fromJSON: function (object) {
77
- var message = __assign({}, baseMsgCreateContractFile);
78
- message.ownerList = [];
79
- if (object.creator !== undefined && object.creator !== null) {
80
- message.creator = String(object.creator);
81
- }
82
- else {
83
- message.creator = "";
84
- }
85
- if (object.fileHash !== undefined && object.fileHash !== null) {
86
- message.fileHash = String(object.fileHash);
87
- }
88
- else {
89
- message.fileHash = "";
90
- }
91
- if (object.timeStamp !== undefined && object.timeStamp !== null) {
92
- message.timeStamp = Number(object.timeStamp);
93
- }
94
- else {
95
- message.timeStamp = 0;
96
- }
97
- if (object.ownerList !== undefined && object.ownerList !== null) {
98
- for (var _i = 0, _a = object.ownerList; _i < _a.length; _i++) {
99
- var e = _a[_i];
100
- message.ownerList.push(String(e));
101
- }
102
- }
103
- if (object.metaDataJsonString !== undefined &&
104
- object.metaDataJsonString !== null) {
105
- message.metaDataJsonString = String(object.metaDataJsonString);
106
- }
107
- else {
108
- message.metaDataJsonString = "";
109
- }
110
- return message;
111
- },
112
- toJSON: function (message) {
113
- var obj = {};
114
- message.creator !== undefined && (obj.creator = message.creator);
115
- message.fileHash !== undefined && (obj.fileHash = message.fileHash);
116
- message.timeStamp !== undefined && (obj.timeStamp = message.timeStamp);
117
- if (message.ownerList) {
118
- obj.ownerList = message.ownerList.map(function (e) { return e; });
119
- }
120
- else {
121
- obj.ownerList = [];
122
- }
123
- message.metaDataJsonString !== undefined &&
124
- (obj.metaDataJsonString = message.metaDataJsonString);
125
- return obj;
126
- },
127
- fromPartial: function (object) {
128
- var message = __assign({}, baseMsgCreateContractFile);
129
- message.ownerList = [];
130
- if (object.creator !== undefined && object.creator !== null) {
131
- message.creator = object.creator;
132
- }
133
- else {
134
- message.creator = "";
135
- }
136
- if (object.fileHash !== undefined && object.fileHash !== null) {
137
- message.fileHash = object.fileHash;
138
- }
139
- else {
140
- message.fileHash = "";
141
- }
142
- if (object.timeStamp !== undefined && object.timeStamp !== null) {
143
- message.timeStamp = object.timeStamp;
144
- }
145
- else {
146
- message.timeStamp = 0;
147
- }
148
- if (object.ownerList !== undefined && object.ownerList !== null) {
149
- for (var _i = 0, _a = object.ownerList; _i < _a.length; _i++) {
150
- var e = _a[_i];
151
- message.ownerList.push(e);
152
- }
153
- }
154
- if (object.metaDataJsonString !== undefined &&
155
- object.metaDataJsonString !== null) {
156
- message.metaDataJsonString = object.metaDataJsonString;
157
- }
158
- else {
159
- message.metaDataJsonString = "";
160
- }
161
- return message;
162
- },
163
- };
164
- var baseMsgCreateContractFileResponse = {};
165
- exports.MsgCreateContractFileResponse = {
166
- encode: function (_, writer) {
167
- if (writer === void 0) { writer = minimal_1.Writer.create(); }
168
- return writer;
169
- },
170
- decode: function (input, length) {
171
- var reader = input instanceof Uint8Array ? new minimal_1.Reader(input) : input;
172
- var end = length === undefined ? reader.len : reader.pos + length;
173
- var message = __assign({}, baseMsgCreateContractFileResponse);
174
- while (reader.pos < end) {
175
- var tag = reader.uint32();
176
- switch (tag >>> 3) {
177
- default:
178
- reader.skipType(tag & 7);
179
- break;
180
- }
181
- }
182
- return message;
183
- },
184
- fromJSON: function (_) {
185
- var message = __assign({}, baseMsgCreateContractFileResponse);
186
- return message;
187
- },
188
- toJSON: function (_) {
189
- var obj = {};
190
- return obj;
191
- },
192
- fromPartial: function (_) {
193
- var message = __assign({}, baseMsgCreateContractFileResponse);
194
- return message;
195
- },
196
- };
197
- var baseMsgAddContractLog = {
198
- creator: "",
199
- contractHash: "",
200
- timeStamp: 0,
201
- eventName: "",
202
- ownerAddress: "",
203
- jsonString: "",
204
- };
205
- exports.MsgAddContractLog = {
206
- encode: function (message, writer) {
207
- if (writer === void 0) { writer = minimal_1.Writer.create(); }
208
- if (message.creator !== "") {
209
- writer.uint32(10).string(message.creator);
210
- }
211
- if (message.contractHash !== "") {
212
- writer.uint32(18).string(message.contractHash);
213
- }
214
- if (message.timeStamp !== 0) {
215
- writer.uint32(24).uint64(message.timeStamp);
216
- }
217
- if (message.eventName !== "") {
218
- writer.uint32(34).string(message.eventName);
219
- }
220
- if (message.ownerAddress !== "") {
221
- writer.uint32(42).string(message.ownerAddress);
222
- }
223
- if (message.jsonString !== "") {
224
- writer.uint32(50).string(message.jsonString);
225
- }
226
- return writer;
227
- },
228
- decode: function (input, length) {
229
- var reader = input instanceof Uint8Array ? new minimal_1.Reader(input) : input;
230
- var end = length === undefined ? reader.len : reader.pos + length;
231
- var message = __assign({}, baseMsgAddContractLog);
232
- while (reader.pos < end) {
233
- var tag = reader.uint32();
234
- switch (tag >>> 3) {
235
- case 1:
236
- message.creator = reader.string();
237
- break;
238
- case 2:
239
- message.contractHash = reader.string();
240
- break;
241
- case 3:
242
- message.timeStamp = longToNumber(reader.uint64());
243
- break;
244
- case 4:
245
- message.eventName = reader.string();
246
- break;
247
- case 5:
248
- message.ownerAddress = reader.string();
249
- break;
250
- case 6:
251
- message.jsonString = reader.string();
252
- break;
253
- default:
254
- reader.skipType(tag & 7);
255
- break;
256
- }
257
- }
258
- return message;
259
- },
260
- fromJSON: function (object) {
261
- var message = __assign({}, baseMsgAddContractLog);
262
- if (object.creator !== undefined && object.creator !== null) {
263
- message.creator = String(object.creator);
264
- }
265
- else {
266
- message.creator = "";
267
- }
268
- if (object.contractHash !== undefined && object.contractHash !== null) {
269
- message.contractHash = String(object.contractHash);
270
- }
271
- else {
272
- message.contractHash = "";
273
- }
274
- if (object.timeStamp !== undefined && object.timeStamp !== null) {
275
- message.timeStamp = Number(object.timeStamp);
276
- }
277
- else {
278
- message.timeStamp = 0;
279
- }
280
- if (object.eventName !== undefined && object.eventName !== null) {
281
- message.eventName = String(object.eventName);
282
- }
283
- else {
284
- message.eventName = "";
285
- }
286
- if (object.ownerAddress !== undefined && object.ownerAddress !== null) {
287
- message.ownerAddress = String(object.ownerAddress);
288
- }
289
- else {
290
- message.ownerAddress = "";
291
- }
292
- if (object.jsonString !== undefined && object.jsonString !== null) {
293
- message.jsonString = String(object.jsonString);
294
- }
295
- else {
296
- message.jsonString = "";
297
- }
298
- return message;
299
- },
300
- toJSON: function (message) {
301
- var obj = {};
302
- message.creator !== undefined && (obj.creator = message.creator);
303
- message.contractHash !== undefined &&
304
- (obj.contractHash = message.contractHash);
305
- message.timeStamp !== undefined && (obj.timeStamp = message.timeStamp);
306
- message.eventName !== undefined && (obj.eventName = message.eventName);
307
- message.ownerAddress !== undefined &&
308
- (obj.ownerAddress = message.ownerAddress);
309
- message.jsonString !== undefined && (obj.jsonString = message.jsonString);
310
- return obj;
311
- },
312
- fromPartial: function (object) {
313
- var message = __assign({}, baseMsgAddContractLog);
314
- if (object.creator !== undefined && object.creator !== null) {
315
- message.creator = object.creator;
316
- }
317
- else {
318
- message.creator = "";
319
- }
320
- if (object.contractHash !== undefined && object.contractHash !== null) {
321
- message.contractHash = object.contractHash;
322
- }
323
- else {
324
- message.contractHash = "";
325
- }
326
- if (object.timeStamp !== undefined && object.timeStamp !== null) {
327
- message.timeStamp = object.timeStamp;
328
- }
329
- else {
330
- message.timeStamp = 0;
331
- }
332
- if (object.eventName !== undefined && object.eventName !== null) {
333
- message.eventName = object.eventName;
334
- }
335
- else {
336
- message.eventName = "";
337
- }
338
- if (object.ownerAddress !== undefined && object.ownerAddress !== null) {
339
- message.ownerAddress = object.ownerAddress;
340
- }
341
- else {
342
- message.ownerAddress = "";
343
- }
344
- if (object.jsonString !== undefined && object.jsonString !== null) {
345
- message.jsonString = object.jsonString;
346
- }
347
- else {
348
- message.jsonString = "";
349
- }
350
- return message;
351
- },
352
- };
353
- var baseMsgAddContractLogResponse = { id: 0 };
354
- exports.MsgAddContractLogResponse = {
355
- encode: function (message, writer) {
356
- if (writer === void 0) { writer = minimal_1.Writer.create(); }
357
- if (message.id !== 0) {
358
- writer.uint32(8).uint64(message.id);
359
- }
360
- return writer;
361
- },
362
- decode: function (input, length) {
363
- var reader = input instanceof Uint8Array ? new minimal_1.Reader(input) : input;
364
- var end = length === undefined ? reader.len : reader.pos + length;
365
- var message = __assign({}, baseMsgAddContractLogResponse);
366
- while (reader.pos < end) {
367
- var tag = reader.uint32();
368
- switch (tag >>> 3) {
369
- case 1:
370
- message.id = longToNumber(reader.uint64());
371
- break;
372
- default:
373
- reader.skipType(tag & 7);
374
- break;
375
- }
376
- }
377
- return message;
378
- },
379
- fromJSON: function (object) {
380
- var message = __assign({}, baseMsgAddContractLogResponse);
381
- if (object.id !== undefined && object.id !== null) {
382
- message.id = Number(object.id);
383
- }
384
- else {
385
- message.id = 0;
386
- }
387
- return message;
388
- },
389
- toJSON: function (message) {
390
- var obj = {};
391
- message.id !== undefined && (obj.id = message.id);
392
- return obj;
393
- },
394
- fromPartial: function (object) {
395
- var message = __assign({}, baseMsgAddContractLogResponse);
396
- if (object.id !== undefined && object.id !== null) {
397
- message.id = object.id;
398
- }
399
- else {
400
- message.id = 0;
401
- }
402
- return message;
403
- },
404
- };
405
- var MsgClientImpl = /** @class */ (function () {
406
- function MsgClientImpl(rpc) {
407
- this.rpc = rpc;
408
- }
409
- MsgClientImpl.prototype.CreateContractFile = function (request) {
410
- var data = exports.MsgCreateContractFile.encode(request).finish();
411
- var promise = this.rpc.request("firmachain.firmachain.contract.Msg", "CreateContractFile", data);
412
- return promise.then(function (data) {
413
- return exports.MsgCreateContractFileResponse.decode(new minimal_1.Reader(data));
414
- });
415
- };
416
- MsgClientImpl.prototype.AddContractLog = function (request) {
417
- var data = exports.MsgAddContractLog.encode(request).finish();
418
- var promise = this.rpc.request("firmachain.firmachain.contract.Msg", "AddContractLog", data);
419
- return promise.then(function (data) {
420
- return exports.MsgAddContractLogResponse.decode(new minimal_1.Reader(data));
421
- });
422
- };
423
- return MsgClientImpl;
424
- }());
425
- exports.MsgClientImpl = MsgClientImpl;
426
- var globalThis = (function () {
427
- if (typeof globalThis !== "undefined")
428
- return globalThis;
429
- if (typeof self !== "undefined")
430
- return self;
431
- if (typeof window !== "undefined")
432
- return window;
433
- if (typeof global !== "undefined")
434
- return global;
435
- throw "Unable to locate global object";
436
- })();
437
- function longToNumber(long) {
438
- if (long.gt(Number.MAX_SAFE_INTEGER)) {
439
- throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
440
- }
441
- return long.toNumber();
442
- }
@@ -1,3 +0,0 @@
1
- export * from './ContractTxClient';
2
- export * from './ContractQueryClient';
3
- export * from '../common';
@@ -1,15 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./ContractTxClient"), exports);
14
- __exportStar(require("./ContractQueryClient"), exports);
15
- __exportStar(require("../common"), exports);
@@ -1,18 +0,0 @@
1
- import { Coin } from "cosmjs-types/cosmos/base/v1beta1/coin";
2
- export interface TotalRewardInfo {
3
- rewards: {
4
- validator_address: string;
5
- amount: string;
6
- }[];
7
- total: string;
8
- }
9
- export declare class DistributionQueryClient {
10
- private readonly axios;
11
- constructor(baseUrl: string);
12
- queryGetRewardInfo(address: string, validatorAddress: string): Promise<string>;
13
- queryGetValidatorOutStandingReward(address: string): Promise<Coin[]>;
14
- queryGetValidatorCommission(address: string): Promise<Coin[]>;
15
- queryGetTotalRewardInfo(address: string): Promise<TotalRewardInfo>;
16
- queryGetCommunityPool(): Promise<string>;
17
- queryGetWithdrawAddress(address: string): Promise<string>;
18
- }
@@ -1,167 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.DistributionQueryClient = void 0;
43
- var axios_1 = __importDefault(require("axios"));
44
- var DistributionQueryClient = /** @class */ (function () {
45
- function DistributionQueryClient(baseUrl) {
46
- this.axios = axios_1.default.create({
47
- baseURL: baseUrl,
48
- headers: {
49
- Accept: "application/json",
50
- },
51
- timeout: 15000,
52
- });
53
- }
54
- DistributionQueryClient.prototype.queryGetRewardInfo = function (address, validatorAddress) {
55
- return __awaiter(this, void 0, void 0, function () {
56
- var path, result;
57
- return __generator(this, function (_a) {
58
- switch (_a.label) {
59
- case 0:
60
- path = "/cosmos/distribution/v1beta1/delegators/" + address + "/rewards/" + validatorAddress;
61
- return [4 /*yield*/, this.axios.get(path)];
62
- case 1:
63
- result = _a.sent();
64
- if (result.data.rewards.length === 0) {
65
- return [2 /*return*/, "0"];
66
- }
67
- // reward array is very important for refactoring and other functions.
68
- return [2 /*return*/, result.data.rewards[0].amount];
69
- }
70
- });
71
- });
72
- };
73
- DistributionQueryClient.prototype.queryGetValidatorOutStandingReward = function (address) {
74
- return __awaiter(this, void 0, void 0, function () {
75
- var path, result;
76
- return __generator(this, function (_a) {
77
- switch (_a.label) {
78
- case 0:
79
- path = "/cosmos/distribution/v1beta1/validators/" + address + "/outstanding_rewards";
80
- return [4 /*yield*/, this.axios.get(path)];
81
- case 1:
82
- result = _a.sent();
83
- return [2 /*return*/, result.data.rewards.rewards];
84
- }
85
- });
86
- });
87
- };
88
- DistributionQueryClient.prototype.queryGetValidatorCommission = function (address) {
89
- return __awaiter(this, void 0, void 0, function () {
90
- var path, result;
91
- return __generator(this, function (_a) {
92
- switch (_a.label) {
93
- case 0:
94
- path = "/cosmos/distribution/v1beta1/validators/" + address + "/commission";
95
- return [4 /*yield*/, this.axios.get(path)];
96
- case 1:
97
- result = _a.sent();
98
- return [2 /*return*/, result.data.commission.commission];
99
- }
100
- });
101
- });
102
- };
103
- DistributionQueryClient.prototype.queryGetTotalRewardInfo = function (address) {
104
- return __awaiter(this, void 0, void 0, function () {
105
- var path, result, data, finalData, i, amount, tempData;
106
- return __generator(this, function (_a) {
107
- switch (_a.label) {
108
- case 0:
109
- path = "/cosmos/distribution/v1beta1/delegators/" + address + "/rewards";
110
- return [4 /*yield*/, this.axios.get(path)];
111
- case 1:
112
- result = _a.sent();
113
- data = result.data;
114
- finalData = {
115
- rewards: [],
116
- total: ""
117
- };
118
- for (i = 0; i < data.rewards.length; i++) {
119
- amount = "0";
120
- if (data.rewards[i].reward.length !== 0) {
121
- amount = data.rewards[i].reward[0].amount;
122
- }
123
- tempData = { validator_address: data.rewards[i].validator_address, amount: amount };
124
- finalData.rewards.push(tempData);
125
- }
126
- ;
127
- if (data.total.length > 0) {
128
- finalData.total = data.total[0].amount;
129
- }
130
- return [2 /*return*/, finalData];
131
- }
132
- });
133
- });
134
- };
135
- DistributionQueryClient.prototype.queryGetCommunityPool = function () {
136
- return __awaiter(this, void 0, void 0, function () {
137
- var path, result;
138
- return __generator(this, function (_a) {
139
- switch (_a.label) {
140
- case 0:
141
- path = "/cosmos/distribution/v1beta1/community_pool";
142
- return [4 /*yield*/, this.axios.get(path)];
143
- case 1:
144
- result = _a.sent();
145
- return [2 /*return*/, result.data.pool[0].amount];
146
- }
147
- });
148
- });
149
- };
150
- DistributionQueryClient.prototype.queryGetWithdrawAddress = function (address) {
151
- return __awaiter(this, void 0, void 0, function () {
152
- var path, result;
153
- return __generator(this, function (_a) {
154
- switch (_a.label) {
155
- case 0:
156
- path = "/cosmos/distribution/v1beta1/delegators/" + address + "/withdraw_address";
157
- return [4 /*yield*/, this.axios.get(path)];
158
- case 1:
159
- result = _a.sent();
160
- return [2 /*return*/, result.data.withdraw_address];
161
- }
162
- });
163
- });
164
- };
165
- return DistributionQueryClient;
166
- }());
167
- exports.DistributionQueryClient = DistributionQueryClient;
@@ -1,26 +0,0 @@
1
- import { EncodeObject, OfflineDirectSigner } from "@cosmjs/proto-signing";
2
- import { MsgFundCommunityPool, MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission } from "cosmjs-types/cosmos/distribution/v1beta1/tx";
3
- import { ITxClient } from "../common/ITxClient";
4
- export interface MsgFundCommunityPoolEncodeObject extends EncodeObject {
5
- readonly typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool";
6
- readonly value: Partial<MsgFundCommunityPool>;
7
- }
8
- export interface MsgSetWithdrawAddressEncodeObject extends EncodeObject {
9
- readonly typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress";
10
- readonly value: Partial<MsgSetWithdrawAddress>;
11
- }
12
- export interface MsgWithdrawDelegatorRewardEncodeObject extends EncodeObject {
13
- readonly typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward";
14
- readonly value: Partial<MsgWithdrawDelegatorReward>;
15
- }
16
- export interface MsgWithdrawValidatorCommissionEncodeObject extends EncodeObject {
17
- readonly typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission";
18
- readonly value: Partial<MsgWithdrawValidatorCommission>;
19
- }
20
- export declare class DistributionTxClient extends ITxClient {
21
- constructor(wallet: OfflineDirectSigner, serverUrl: string);
22
- msgFundCommunityPool(data: MsgFundCommunityPool): MsgFundCommunityPoolEncodeObject;
23
- msgSetWithdrawAddress(data: MsgSetWithdrawAddress): MsgSetWithdrawAddressEncodeObject;
24
- msgWithdrawDelegatorReward(data: MsgWithdrawDelegatorReward): MsgWithdrawDelegatorRewardEncodeObject;
25
- msgWithdrawValidatorCommission(data: MsgWithdrawValidatorCommission): MsgWithdrawValidatorCommissionEncodeObject;
26
- }