@firmachain/firma-js 0.2.5 → 0.2.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.
- package/dist/sdk/FirmaBankService.d.ts +5 -5
- package/dist/sdk/FirmaBankService.js +30 -30
- package/dist/sdk/FirmaConfig.d.ts +3 -3
- package/dist/sdk/FirmaContractService.d.ts +5 -5
- package/dist/sdk/FirmaContractService.js +19 -19
- package/dist/sdk/FirmaDistributionService.d.ts +10 -6
- package/dist/sdk/FirmaDistributionService.js +159 -75
- package/dist/sdk/FirmaFeeGrantService.d.ts +8 -5
- package/dist/sdk/FirmaFeeGrantService.js +125 -50
- package/dist/sdk/FirmaGovService.d.ts +16 -10
- package/dist/sdk/FirmaGovService.js +296 -127
- package/dist/sdk/FirmaIpfsService.d.ts +4 -4
- package/dist/sdk/FirmaIpfsService.js +14 -14
- package/dist/sdk/FirmaNftService.d.ts +4 -4
- package/dist/sdk/FirmaNftService.js +18 -20
- package/dist/sdk/FirmaSDK.js +2 -1
- package/dist/sdk/FirmaStakingService.d.ts +7 -6
- package/dist/sdk/FirmaStakingService.js +141 -103
- package/dist/sdk/FirmaUtil.d.ts +3 -2
- package/dist/sdk/FirmaUtil.js +16 -11
- package/dist/sdk/FirmaWalletService.d.ts +6 -6
- package/dist/sdk/FirmaWalletService.js +22 -22
- package/dist/sdk/firmachain/bank/BankQueryClient.d.ts +1 -1
- package/dist/sdk/firmachain/bank/BankQueryClient.js +4 -4
- package/dist/sdk/firmachain/bank/BankTxClient.d.ts +3 -4
- package/dist/sdk/firmachain/bank/BankTxClient.js +2 -2
- package/dist/sdk/firmachain/common/ITxClient.d.ts +5 -5
- package/dist/sdk/firmachain/common/ITxClient.js +7 -7
- package/dist/sdk/firmachain/common/TendermintQueryClient.d.ts +1 -1
- package/dist/sdk/firmachain/common/TendermintQueryClient.js +5 -4
- package/dist/sdk/firmachain/common/accounts.js +25 -20
- package/dist/sdk/firmachain/common/signingstargateclient.js +3 -3
- package/dist/sdk/firmachain/contract/ContractQueryClient.d.ts +2 -2
- package/dist/sdk/firmachain/contract/ContractQueryClient.js +17 -11
- package/dist/sdk/firmachain/contract/ContractTxClient.d.ts +3 -4
- package/dist/sdk/firmachain/contract/ContractTxClient.js +3 -3
- package/dist/sdk/firmachain/distribution/DistributionQueryClient.d.ts +2 -1
- package/dist/sdk/firmachain/distribution/DistributionQueryClient.js +30 -15
- package/dist/sdk/firmachain/distribution/DistributionTxClient.d.ts +5 -6
- package/dist/sdk/firmachain/distribution/DistributionTxClient.js +3 -3
- package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.d.ts +2 -2
- package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.js +4 -4
- package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.d.ts +3 -4
- package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.js +2 -2
- package/dist/sdk/firmachain/gov/GovQueryClient.d.ts +1 -1
- package/dist/sdk/firmachain/gov/GovQueryClient.js +8 -8
- package/dist/sdk/firmachain/gov/GovTxClient.d.ts +4 -5
- package/dist/sdk/firmachain/gov/GovTxClient.js +3 -3
- package/dist/sdk/firmachain/nft/NftQueryClient.d.ts +2 -2
- package/dist/sdk/firmachain/nft/NftQueryClient.js +11 -8
- package/dist/sdk/firmachain/nft/NftTxClient.d.ts +4 -5
- package/dist/sdk/firmachain/nft/NftTxClient.js +3 -3
- package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +1 -1
- package/dist/sdk/firmachain/staking/StakingQueryClient.js +20 -20
- package/dist/sdk/firmachain/staking/StakingTxClient.d.ts +6 -7
- package/dist/sdk/firmachain/staking/StakingTxClient.js +2 -2
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { TxMisc } from
|
|
1
|
+
import { TxMisc } from "./firmachain/bank";
|
|
2
2
|
import { FirmaWalletService } from "./FirmaWalletService";
|
|
3
3
|
import { FirmaConfig } from "./FirmaConfig";
|
|
4
|
-
import { BroadcastTxResponse } from
|
|
4
|
+
import { BroadcastTxResponse } from "./firmachain/common/stargateclient";
|
|
5
5
|
export declare class FirmaBankService {
|
|
6
|
-
private
|
|
7
|
-
constructor(
|
|
6
|
+
private readonly config;
|
|
7
|
+
constructor(config: FirmaConfig);
|
|
8
8
|
getGasEstimationSend(wallet: FirmaWalletService, targetAddress: string, amount: number, txMisc?: TxMisc): Promise<number>;
|
|
9
|
-
private getSignedTxSend;
|
|
10
9
|
send(wallet: FirmaWalletService, targetAddress: string, amount: number, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
|
|
11
10
|
getBalance(address: string): Promise<string>;
|
|
11
|
+
private getSignedTxSend;
|
|
12
12
|
}
|
|
@@ -40,8 +40,8 @@ exports.FirmaBankService = void 0;
|
|
|
40
40
|
var bank_1 = require("./firmachain/bank");
|
|
41
41
|
var FirmaUtil_1 = require("./FirmaUtil");
|
|
42
42
|
var FirmaBankService = /** @class */ (function () {
|
|
43
|
-
function FirmaBankService(
|
|
44
|
-
this.
|
|
43
|
+
function FirmaBankService(config) {
|
|
44
|
+
this.config = config;
|
|
45
45
|
}
|
|
46
46
|
FirmaBankService.prototype.getGasEstimationSend = function (wallet, targetAddress, amount, txMisc) {
|
|
47
47
|
if (txMisc === void 0) { txMisc = bank_1.DefaultTxMisc; }
|
|
@@ -65,21 +65,19 @@ var FirmaBankService = /** @class */ (function () {
|
|
|
65
65
|
});
|
|
66
66
|
});
|
|
67
67
|
};
|
|
68
|
-
FirmaBankService.prototype.
|
|
68
|
+
FirmaBankService.prototype.send = function (wallet, targetAddress, amount, txMisc) {
|
|
69
69
|
if (txMisc === void 0) { txMisc = bank_1.DefaultTxMisc; }
|
|
70
70
|
return __awaiter(this, void 0, void 0, function () {
|
|
71
|
-
var
|
|
71
|
+
var txRaw, bankTxClient, error_2;
|
|
72
72
|
return __generator(this, function (_a) {
|
|
73
73
|
switch (_a.label) {
|
|
74
74
|
case 0:
|
|
75
75
|
_a.trys.push([0, 3, , 4]);
|
|
76
|
-
|
|
77
|
-
return [4 /*yield*/, wallet.getAddress()];
|
|
76
|
+
return [4 /*yield*/, this.getSignedTxSend(wallet, targetAddress, amount, txMisc)];
|
|
78
77
|
case 1:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
return [4 /*yield*/, bankTxClient.sign([message], bank_1.getSignAndBroadcastOption(this._config.denom, txMisc))];
|
|
78
|
+
txRaw = _a.sent();
|
|
79
|
+
bankTxClient = new bank_1.BankTxClient(wallet.getRawWallet(), this.config.rpcAddress);
|
|
80
|
+
return [4 /*yield*/, bankTxClient.broadcast(txRaw)];
|
|
83
81
|
case 2: return [2 /*return*/, _a.sent()];
|
|
84
82
|
case 3:
|
|
85
83
|
error_2 = _a.sent();
|
|
@@ -90,46 +88,48 @@ var FirmaBankService = /** @class */ (function () {
|
|
|
90
88
|
});
|
|
91
89
|
});
|
|
92
90
|
};
|
|
93
|
-
FirmaBankService.prototype.
|
|
94
|
-
if (txMisc === void 0) { txMisc = bank_1.DefaultTxMisc; }
|
|
91
|
+
FirmaBankService.prototype.getBalance = function (address) {
|
|
95
92
|
return __awaiter(this, void 0, void 0, function () {
|
|
96
|
-
var
|
|
93
|
+
var bankQueryClient, result, error_3;
|
|
97
94
|
return __generator(this, function (_a) {
|
|
98
95
|
switch (_a.label) {
|
|
99
96
|
case 0:
|
|
100
|
-
_a.trys.push([0,
|
|
101
|
-
|
|
97
|
+
_a.trys.push([0, 2, , 3]);
|
|
98
|
+
bankQueryClient = new bank_1.BankQueryClient(this.config.restApiAddress);
|
|
99
|
+
return [4 /*yield*/, bankQueryClient.queryBalance(address, this.config.denom)];
|
|
102
100
|
case 1:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
107
|
-
case 3:
|
|
101
|
+
result = _a.sent();
|
|
102
|
+
return [2 /*return*/, result];
|
|
103
|
+
case 2:
|
|
108
104
|
error_3 = _a.sent();
|
|
109
105
|
FirmaUtil_1.FirmaUtil.printLog(error_3);
|
|
110
106
|
throw error_3;
|
|
111
|
-
case
|
|
107
|
+
case 3: return [2 /*return*/];
|
|
112
108
|
}
|
|
113
109
|
});
|
|
114
110
|
});
|
|
115
111
|
};
|
|
116
|
-
FirmaBankService.prototype.
|
|
112
|
+
FirmaBankService.prototype.getSignedTxSend = function (wallet, targetAddress, amount, txMisc) {
|
|
113
|
+
if (txMisc === void 0) { txMisc = bank_1.DefaultTxMisc; }
|
|
117
114
|
return __awaiter(this, void 0, void 0, function () {
|
|
118
|
-
var
|
|
115
|
+
var bankTxClient, address, sendAmount, message, error_4;
|
|
119
116
|
return __generator(this, function (_a) {
|
|
120
117
|
switch (_a.label) {
|
|
121
118
|
case 0:
|
|
122
|
-
_a.trys.push([0,
|
|
123
|
-
|
|
124
|
-
return [4 /*yield*/,
|
|
119
|
+
_a.trys.push([0, 3, , 4]);
|
|
120
|
+
bankTxClient = new bank_1.BankTxClient(wallet.getRawWallet(), this.config.rpcAddress);
|
|
121
|
+
return [4 /*yield*/, wallet.getAddress()];
|
|
125
122
|
case 1:
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
123
|
+
address = _a.sent();
|
|
124
|
+
sendAmount = { denom: this.config.denom, amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(amount) };
|
|
125
|
+
message = bankTxClient.msgSend({ fromAddress: address, toAddress: targetAddress, amount: [sendAmount] });
|
|
126
|
+
return [4 /*yield*/, bankTxClient.sign([message], bank_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
127
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
128
|
+
case 3:
|
|
129
129
|
error_4 = _a.sent();
|
|
130
130
|
FirmaUtil_1.FirmaUtil.printLog(error_4);
|
|
131
131
|
throw error_4;
|
|
132
|
-
case
|
|
132
|
+
case 4: return [2 /*return*/];
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
135
|
});
|
|
@@ -10,7 +10,7 @@ export declare class FirmaConfig {
|
|
|
10
10
|
denom: string;
|
|
11
11
|
isShowLog: boolean;
|
|
12
12
|
constructor(chainID: string, rpcAddress: string, restApiAddress: string, ipfsNodeAddress: string, ipfsNodePort: number, ipfsWebApiAddress: string, hdPath: string, prefix: string, denom: string, isShowLog: boolean);
|
|
13
|
-
static DevNetConfig: FirmaConfig;
|
|
14
|
-
static TestNetConfig: FirmaConfig;
|
|
15
|
-
static MainNetConfig: FirmaConfig;
|
|
13
|
+
static readonly DevNetConfig: FirmaConfig;
|
|
14
|
+
static readonly TestNetConfig: FirmaConfig;
|
|
15
|
+
static readonly MainNetConfig: FirmaConfig;
|
|
16
16
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ContractLogType, ContractFileType, Pagination, TxMisc } from
|
|
2
|
-
import { EncodeObject } from
|
|
1
|
+
import { ContractLogType, ContractFileType, Pagination, TxMisc } from "./firmachain/contract";
|
|
2
|
+
import { EncodeObject } from "@cosmjs/proto-signing";
|
|
3
3
|
import { FirmaConfig } from "./FirmaConfig";
|
|
4
4
|
import { FirmaWalletService } from "./FirmaWalletService";
|
|
5
|
-
import { BroadcastTxResponse } from
|
|
5
|
+
import { BroadcastTxResponse } from "./firmachain/common/stargateclient";
|
|
6
6
|
export declare class ContractService {
|
|
7
|
-
private
|
|
8
|
-
constructor(
|
|
7
|
+
private readonly config;
|
|
8
|
+
constructor(config: FirmaConfig);
|
|
9
9
|
getContractLogAll(paginationKey?: string): Promise<{
|
|
10
10
|
dataList: ContractLogType[];
|
|
11
11
|
pagination: Pagination;
|
|
@@ -40,8 +40,8 @@ exports.ContractService = void 0;
|
|
|
40
40
|
var contract_1 = require("./firmachain/contract");
|
|
41
41
|
var FirmaUtil_1 = require("./FirmaUtil");
|
|
42
42
|
var ContractService = /** @class */ (function () {
|
|
43
|
-
function ContractService(
|
|
44
|
-
this.
|
|
43
|
+
function ContractService(config) {
|
|
44
|
+
this.config = config;
|
|
45
45
|
}
|
|
46
46
|
ContractService.prototype.getContractLogAll = function (paginationKey) {
|
|
47
47
|
if (paginationKey === void 0) { paginationKey = ""; }
|
|
@@ -51,7 +51,7 @@ var ContractService = /** @class */ (function () {
|
|
|
51
51
|
switch (_a.label) {
|
|
52
52
|
case 0:
|
|
53
53
|
_a.trys.push([0, 2, , 3]);
|
|
54
|
-
contractQueryClient = new contract_1.ContractQueryClient(this.
|
|
54
|
+
contractQueryClient = new contract_1.ContractQueryClient(this.config.restApiAddress);
|
|
55
55
|
return [4 /*yield*/, contractQueryClient.queryContractLogAll(paginationKey)];
|
|
56
56
|
case 1: return [2 /*return*/, _a.sent()];
|
|
57
57
|
case 2:
|
|
@@ -71,7 +71,7 @@ var ContractService = /** @class */ (function () {
|
|
|
71
71
|
switch (_a.label) {
|
|
72
72
|
case 0:
|
|
73
73
|
_a.trys.push([0, 2, , 3]);
|
|
74
|
-
contractQueryClient = new contract_1.ContractQueryClient(this.
|
|
74
|
+
contractQueryClient = new contract_1.ContractQueryClient(this.config.restApiAddress);
|
|
75
75
|
return [4 /*yield*/, contractQueryClient.queryContractFileAll(paginationKey)];
|
|
76
76
|
case 1: return [2 /*return*/, _a.sent()];
|
|
77
77
|
case 2:
|
|
@@ -90,7 +90,7 @@ var ContractService = /** @class */ (function () {
|
|
|
90
90
|
switch (_a.label) {
|
|
91
91
|
case 0:
|
|
92
92
|
_a.trys.push([0, 2, , 3]);
|
|
93
|
-
contractQueryClient = new contract_1.ContractQueryClient(this.
|
|
93
|
+
contractQueryClient = new contract_1.ContractQueryClient(this.config.restApiAddress);
|
|
94
94
|
return [4 /*yield*/, contractQueryClient.queryContractFile(fileHash)];
|
|
95
95
|
case 1: return [2 /*return*/, _a.sent()];
|
|
96
96
|
case 2:
|
|
@@ -109,7 +109,7 @@ var ContractService = /** @class */ (function () {
|
|
|
109
109
|
switch (_a.label) {
|
|
110
110
|
case 0:
|
|
111
111
|
_a.trys.push([0, 2, , 3]);
|
|
112
|
-
contractQueryClient = new contract_1.ContractQueryClient(this.
|
|
112
|
+
contractQueryClient = new contract_1.ContractQueryClient(this.config.restApiAddress);
|
|
113
113
|
return [4 /*yield*/, contractQueryClient.queryIsContractOwner(fileHash, ownerAddress)];
|
|
114
114
|
case 1: return [2 /*return*/, _a.sent()];
|
|
115
115
|
case 2:
|
|
@@ -128,7 +128,7 @@ var ContractService = /** @class */ (function () {
|
|
|
128
128
|
switch (_a.label) {
|
|
129
129
|
case 0:
|
|
130
130
|
_a.trys.push([0, 2, , 3]);
|
|
131
|
-
contractQueryClient = new contract_1.ContractQueryClient(this.
|
|
131
|
+
contractQueryClient = new contract_1.ContractQueryClient(this.config.restApiAddress);
|
|
132
132
|
return [4 /*yield*/, contractQueryClient.queryContractLog(logId)];
|
|
133
133
|
case 1: return [2 /*return*/, _a.sent()];
|
|
134
134
|
case 2:
|
|
@@ -148,8 +148,8 @@ var ContractService = /** @class */ (function () {
|
|
|
148
148
|
switch (_a.label) {
|
|
149
149
|
case 0:
|
|
150
150
|
_a.trys.push([0, 3, , 4]);
|
|
151
|
-
contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.
|
|
152
|
-
return [4 /*yield*/, contractTxClient.sign(txList, contract_1.getSignAndBroadcastOption(this.
|
|
151
|
+
contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.config.rpcAddress);
|
|
152
|
+
return [4 /*yield*/, contractTxClient.sign(txList, contract_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
153
153
|
case 1:
|
|
154
154
|
txRaw = _a.sent();
|
|
155
155
|
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
|
|
@@ -195,7 +195,7 @@ var ContractService = /** @class */ (function () {
|
|
|
195
195
|
return [4 /*yield*/, wallet.getAddress()];
|
|
196
196
|
case 1:
|
|
197
197
|
address = _a.sent();
|
|
198
|
-
contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.
|
|
198
|
+
contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.config.rpcAddress);
|
|
199
199
|
return [2 /*return*/, contractTxClient.msgCreateContractFile({
|
|
200
200
|
creator: address,
|
|
201
201
|
fileHash: fileHash,
|
|
@@ -223,7 +223,7 @@ var ContractService = /** @class */ (function () {
|
|
|
223
223
|
return [4 /*yield*/, wallet.getAddress()];
|
|
224
224
|
case 1:
|
|
225
225
|
address = _a.sent();
|
|
226
|
-
contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.
|
|
226
|
+
contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.config.rpcAddress);
|
|
227
227
|
message = contractTxClient.msgCreateContractFile({
|
|
228
228
|
creator: address,
|
|
229
229
|
fileHash: fileHash,
|
|
@@ -231,7 +231,7 @@ var ContractService = /** @class */ (function () {
|
|
|
231
231
|
ownerList: ownerList,
|
|
232
232
|
metaDataJsonString: metaDataJsonString
|
|
233
233
|
});
|
|
234
|
-
return [4 /*yield*/, contractTxClient.sign([message], contract_1.getSignAndBroadcastOption(this.
|
|
234
|
+
return [4 /*yield*/, contractTxClient.sign([message], contract_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
235
235
|
case 2: return [2 /*return*/, _a.sent()];
|
|
236
236
|
case 3:
|
|
237
237
|
error_9 = _a.sent();
|
|
@@ -253,7 +253,7 @@ var ContractService = /** @class */ (function () {
|
|
|
253
253
|
return [4 /*yield*/, this.getSignedTxCreateContractFile(wallet, fileHash, timeStamp, ownerList, metaDataJsonString, txMisc)];
|
|
254
254
|
case 1:
|
|
255
255
|
txRaw = _a.sent();
|
|
256
|
-
contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.
|
|
256
|
+
contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.config.rpcAddress);
|
|
257
257
|
return [4 /*yield*/, contractTxClient.broadcast(txRaw)];
|
|
258
258
|
case 2: return [2 /*return*/, _a.sent()];
|
|
259
259
|
case 3:
|
|
@@ -298,7 +298,7 @@ var ContractService = /** @class */ (function () {
|
|
|
298
298
|
return [4 /*yield*/, wallet.getAddress()];
|
|
299
299
|
case 1:
|
|
300
300
|
address = _a.sent();
|
|
301
|
-
contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.
|
|
301
|
+
contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.config.rpcAddress);
|
|
302
302
|
message = contractTxClient.msgAddContractLog({
|
|
303
303
|
creator: address,
|
|
304
304
|
contractHash: contractHash,
|
|
@@ -307,7 +307,7 @@ var ContractService = /** @class */ (function () {
|
|
|
307
307
|
ownerAddress: ownerAddress,
|
|
308
308
|
jsonString: jsonString
|
|
309
309
|
});
|
|
310
|
-
return [4 /*yield*/, contractTxClient.sign([message], contract_1.getSignAndBroadcastOption(this.
|
|
310
|
+
return [4 /*yield*/, contractTxClient.sign([message], contract_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
311
311
|
case 2: return [2 /*return*/, _a.sent()];
|
|
312
312
|
case 3:
|
|
313
313
|
error_12 = _a.sent();
|
|
@@ -329,7 +329,7 @@ var ContractService = /** @class */ (function () {
|
|
|
329
329
|
return [4 /*yield*/, this.getSignedTxAddContractLog(wallet, contractHash, timeStamp, eventName, ownerAddress, jsonString, txMisc)];
|
|
330
330
|
case 1:
|
|
331
331
|
txRaw = _a.sent();
|
|
332
|
-
contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.
|
|
332
|
+
contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.config.rpcAddress);
|
|
333
333
|
return [4 /*yield*/, contractTxClient.broadcast(txRaw)];
|
|
334
334
|
case 2: return [2 /*return*/, _a.sent()];
|
|
335
335
|
case 3:
|
|
@@ -351,7 +351,7 @@ var ContractService = /** @class */ (function () {
|
|
|
351
351
|
return [4 /*yield*/, wallet.getAddress()];
|
|
352
352
|
case 1:
|
|
353
353
|
address = _a.sent();
|
|
354
|
-
contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.
|
|
354
|
+
contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.config.rpcAddress);
|
|
355
355
|
return [2 /*return*/, contractTxClient.msgAddContractLog({
|
|
356
356
|
creator: address,
|
|
357
357
|
contractHash: contractHash,
|
|
@@ -377,8 +377,8 @@ var ContractService = /** @class */ (function () {
|
|
|
377
377
|
switch (_a.label) {
|
|
378
378
|
case 0:
|
|
379
379
|
_a.trys.push([0, 2, , 3]);
|
|
380
|
-
contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.
|
|
381
|
-
return [4 /*yield*/, contractTxClient.signAndBroadcast(msgList, contract_1.getSignAndBroadcastOption(this.
|
|
380
|
+
contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.config.rpcAddress);
|
|
381
|
+
return [4 /*yield*/, contractTxClient.signAndBroadcast(msgList, contract_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
382
382
|
case 1: return [2 /*return*/, _a.sent()];
|
|
383
383
|
case 2:
|
|
384
384
|
error_15 = _a.sent();
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { TxMisc, TotalRewardInfo } from
|
|
1
|
+
import { TxMisc, TotalRewardInfo } from "./firmachain/distribution";
|
|
2
2
|
import { FirmaWalletService } from "./FirmaWalletService";
|
|
3
3
|
import { FirmaConfig } from "./FirmaConfig";
|
|
4
|
-
import { BroadcastTxResponse } from
|
|
5
|
-
import { Coin } from
|
|
4
|
+
import { BroadcastTxResponse } from "./firmachain/common/stargateclient";
|
|
5
|
+
import { Coin } from "cosmjs-types/cosmos/base/v1beta1/coin";
|
|
6
6
|
export declare class FirmaDistributionService {
|
|
7
|
-
private
|
|
8
|
-
constructor(
|
|
9
|
-
|
|
7
|
+
private readonly config;
|
|
8
|
+
constructor(config: FirmaConfig);
|
|
9
|
+
getGasEstimationSetWithdrawAddress(wallet: FirmaWalletService, withdrawAddress: string, txMisc?: TxMisc): Promise<number>;
|
|
10
|
+
getGasEstimationFundCommunityPool(wallet: FirmaWalletService, amount: number, txMisc?: TxMisc): Promise<number>;
|
|
11
|
+
getGasEstimationWithdrawValidatorCommission(wallet: FirmaWalletService, validatorAddress: string, txMisc?: TxMisc): Promise<number>;
|
|
12
|
+
getGasEstimationWithdrawAllRewards(wallet: FirmaWalletService, validatorAddress: string, txMisc?: TxMisc): Promise<number>;
|
|
10
13
|
private getSignedTxWithdrawAllRewards;
|
|
11
14
|
private getSignedTxSetWithdrawAddress;
|
|
12
15
|
private getSignedTxFundCommunityPool;
|
|
@@ -20,4 +23,5 @@ export declare class FirmaDistributionService {
|
|
|
20
23
|
getValidatorCommission(validatorAddress: string): Promise<Coin[]>;
|
|
21
24
|
getTotalRewardInfo(address: string): Promise<TotalRewardInfo>;
|
|
22
25
|
getCommunityPool(): Promise<string>;
|
|
26
|
+
getWithdrawAddress(address: string): Promise<string>;
|
|
23
27
|
}
|