@firmachain/firma-js 0.2.46 → 0.2.48
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/index.js +1 -5
- package/dist/sdk/FirmaAuthzService.js +5 -5
- package/dist/sdk/FirmaBankService.js +1 -1
- package/dist/sdk/FirmaChainService.d.ts +5 -0
- package/dist/sdk/FirmaChainService.js +44 -0
- package/dist/sdk/FirmaContractService.js +5 -5
- package/dist/sdk/FirmaCosmWasmCw20.d.ts +17 -0
- package/dist/sdk/FirmaCosmWasmCw20.js +269 -0
- package/dist/sdk/FirmaCosmWasmService.js +9 -9
- package/dist/sdk/FirmaDistributionService.js +5 -5
- package/dist/sdk/FirmaFeeGrantService.js +3 -3
- package/dist/sdk/FirmaGovService.js +7 -7
- package/dist/sdk/FirmaIbcService.js +1 -1
- package/dist/sdk/FirmaNftService.js +5 -5
- package/dist/sdk/FirmaSDK.d.ts +3 -1
- package/dist/sdk/FirmaSDK.js +4 -1
- package/dist/sdk/FirmaStakingService.js +5 -5
- package/dist/sdk/FirmaTokenService.js +4 -4
- package/dist/sdk/FirmaUtil.js +16 -20
- package/dist/sdk/FirmaWalletService.js +3 -3
- package/dist/sdk/firmachain/amino/addresses.js +11 -11
- package/dist/sdk/firmachain/amino/aminotypes.js +32 -36
- package/dist/sdk/firmachain/amino/encoding.js +26 -30
- package/dist/sdk/firmachain/amino/multisig.js +5 -5
- package/dist/sdk/firmachain/amino/signature.js +4 -4
- package/dist/sdk/firmachain/amino/signdoc.js +1 -1
- package/dist/sdk/firmachain/amino/wallet.js +10 -14
- package/dist/sdk/firmachain/authz/AuthzQueryClient.js +3 -3
- package/dist/sdk/firmachain/authz/index.js +1 -5
- package/dist/sdk/firmachain/bank/BankQueryClient.js +4 -4
- package/dist/sdk/firmachain/bank/index.js +1 -5
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.js +2 -2
- package/dist/sdk/firmachain/common/LedgerWallet.js +10 -14
- package/dist/sdk/firmachain/common/accounts.js +2 -2
- package/dist/sdk/firmachain/common/index.js +1 -5
- package/dist/sdk/firmachain/common/signing.js +5 -9
- package/dist/sdk/firmachain/common/signingaminostargateclient.js +16 -16
- package/dist/sdk/firmachain/common/signingstargateclient.js +14 -18
- package/dist/sdk/firmachain/common/stargateclient.js +6 -6
- package/dist/sdk/firmachain/contract/ContractQueryClient.js +2 -2
- package/dist/sdk/firmachain/contract/ContractTxTypes.d.ts +4 -4
- package/dist/sdk/firmachain/contract/index.js +1 -5
- package/dist/sdk/firmachain/cosmwasm/CosmWasmQueryClient.js +8 -8
- package/dist/sdk/firmachain/cosmwasm/index.js +1 -5
- package/dist/sdk/firmachain/distribution/DistributionQueryClient.js +5 -5
- package/dist/sdk/firmachain/distribution/index.js +1 -5
- package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.js +2 -2
- package/dist/sdk/firmachain/feegrant/index.js +1 -5
- package/dist/sdk/firmachain/google/protobuf/any.d.ts +1 -1
- package/dist/sdk/firmachain/google/protobuf/descriptor.d.ts +27 -27
- package/dist/sdk/firmachain/google/protobuf/duration.d.ts +1 -1
- package/dist/sdk/firmachain/google/protobuf/timestamp.d.ts +1 -1
- package/dist/sdk/firmachain/gov/GovQueryClient.js +2 -2
- package/dist/sdk/firmachain/gov/index.js +1 -5
- package/dist/sdk/firmachain/ibc/IbcQueryClient.js +1 -1
- package/dist/sdk/firmachain/ibc/index.js +1 -5
- package/dist/sdk/firmachain/mint/index.js +1 -5
- package/dist/sdk/firmachain/nft/NftTxTypes.d.ts +6 -6
- package/dist/sdk/firmachain/nft/index.js +1 -5
- package/dist/sdk/firmachain/slashing/index.js +1 -5
- package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +2 -2
- package/dist/sdk/firmachain/staking/StakingQueryClient.js +8 -8
- package/dist/sdk/firmachain/staking/index.js +1 -5
- package/dist/sdk/firmachain/token/TokenTxTypes.d.ts +8 -8
- package/dist/sdk/firmachain/token/index.js +1 -5
- package/package.json +24 -24
- package/dist/test/00.wallet.test.d.ts +0 -1
- package/dist/test/00.wallet.test.js +0 -87
- package/dist/test/000./354/227/220/354/226/264/353/223/234/353/236/215_/353/246/254/354/212/244/355/205/214/354/235/264/355/201/254.test.d.ts +0 -1
- package/dist/test/000./354/227/220/354/226/264/353/223/234/353/236/215_/353/246/254/354/212/244/355/205/214/354/235/264/355/201/254.test.js +0 -302
- package/dist/test/000./354/236/254/353/213/250/352/264/200/353/240/250.test.d.ts +0 -1
- package/dist/test/000./354/236/254/353/213/250/352/264/200/353/240/250.test.js +0 -436
- package/dist/test/01.contract_tx.test.d.ts +0 -1
- package/dist/test/01.contract_tx.test.js +0 -146
- package/dist/test/02.contract_query.test.d.ts +0 -1
- package/dist/test/02.contract_query.test.js +0 -219
- package/dist/test/03.contract_scenario.test.d.ts +0 -1
- package/dist/test/03.contract_scenario.test.js +0 -559
- package/dist/test/04.bank_tx.test.d.ts +0 -1
- package/dist/test/04.bank_tx.test.js +0 -124
- package/dist/test/05.bank_query.test.d.ts +0 -1
- package/dist/test/05.bank_query.test.js +0 -164
- package/dist/test/06.feegrant_tx.test.d.ts +0 -1
- package/dist/test/06.feegrant_tx.test.js +0 -173
- package/dist/test/07.feegrant_query.test.d.ts +0 -1
- package/dist/test/07.feegrant_query.test.js +0 -81
- package/dist/test/08.gas_estimate.test.d.ts +0 -1
- package/dist/test/08.gas_estimate.test.js +0 -702
- package/dist/test/09.ipfs.test.d.ts +0 -1
- package/dist/test/09.ipfs.test.js +0 -69
- package/dist/test/10.nft_tx.test.d.ts +0 -1
- package/dist/test/10.nft_tx.test.js +0 -137
- package/dist/test/11.nft_query.test.d.ts +0 -1
- package/dist/test/11.nft_query.test.js +0 -167
- package/dist/test/12.staking_tx.test.d.ts +0 -1
- package/dist/test/12.staking_tx.test.js +0 -213
- package/dist/test/13.staking_query.test.d.ts +0 -1
- package/dist/test/13.staking_query.test.js +0 -206
- package/dist/test/14.distribution_tx.test.d.ts +0 -1
- package/dist/test/14.distribution_tx.test.js +0 -176
- package/dist/test/15.distribution_query.test.d.ts +0 -1
- package/dist/test/15.distribution_query.test.js +0 -216
- package/dist/test/16.gov_tx.test.d.ts +0 -1
- package/dist/test/16.gov_tx.test.js +0 -237
- package/dist/test/17.gov_query.test.d.ts +0 -1
- package/dist/test/17.gov_query.test.js +0 -115
- package/dist/test/18.util.test.d.ts +0 -1
- package/dist/test/18.util.test.js +0 -246
- package/dist/test/19.chain.test.d.ts +0 -1
- package/dist/test/19.chain.test.js +0 -67
- package/dist/test/20.slashing_query.test.d.ts +0 -1
- package/dist/test/20.slashing_query.test.js +0 -82
- package/dist/test/21.token_tx.test.d.ts +0 -1
- package/dist/test/21.token_tx.test.js +0 -154
- package/dist/test/22.token_query.test.d.ts +0 -1
- package/dist/test/22.token_query.test.js +0 -96
- package/dist/test/23.authz_tx.test.d.ts +0 -1
- package/dist/test/23.authz_tx.test.js +0 -468
- package/dist/test/24.authz_query.test.d.ts +0 -1
- package/dist/test/24.authz_query.test.js +0 -140
- package/dist/test/25.cosmwasm_tx.test.d.ts +0 -1
- package/dist/test/25.cosmwasm_tx.test.js +0 -188
- package/dist/test/26.cosmwasm_query.test.d.ts +0 -1
- package/dist/test/26.cosmwasm_query.test.js +0 -167
- package/dist/test/27.arbitary_sign.test.d.ts +0 -1
- package/dist/test/27.arbitary_sign.test.js +0 -164
- package/dist/test/28.ibc_tx.test.d.ts +0 -1
- package/dist/test/28.ibc_tx.test.js +0 -83
- package/dist/test/29.mint_query.copy.d.ts +0 -1
- package/dist/test/29.mint_query.copy.js +0 -54
- package/dist/test/config_test.d.ts +0 -5
- package/dist/test/config_test.js +0 -27
|
@@ -1,219 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
var chai_1 = require("chai");
|
|
40
|
-
var FirmaSDK_1 = require("../sdk/FirmaSDK");
|
|
41
|
-
var FirmaUtil_1 = require("../sdk/FirmaUtil");
|
|
42
|
-
var config_test_1 = require("./config_test");
|
|
43
|
-
describe('[02. Contract Query Test]', function () {
|
|
44
|
-
var firma = new FirmaSDK_1.FirmaSDK(config_test_1.TestChainConfig);
|
|
45
|
-
it('Contract getContractLogAll-pagination', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
46
|
-
var result, total, totalItemList, index, i, i;
|
|
47
|
-
return __generator(this, function (_a) {
|
|
48
|
-
switch (_a.label) {
|
|
49
|
-
case 0: return [4 /*yield*/, firma.Contract.getContractLogAll()];
|
|
50
|
-
case 1:
|
|
51
|
-
result = _a.sent();
|
|
52
|
-
total = result.pagination.total;
|
|
53
|
-
totalItemList = [];
|
|
54
|
-
index = 0;
|
|
55
|
-
_a.label = 2;
|
|
56
|
-
case 2:
|
|
57
|
-
if (!(result.pagination.next_key != null)) return [3 /*break*/, 4];
|
|
58
|
-
for (i = 0; i < result.dataList.length; i++) {
|
|
59
|
-
totalItemList[index++] = result.dataList[i];
|
|
60
|
-
}
|
|
61
|
-
return [4 /*yield*/, firma.Contract.getContractLogAll(result.pagination.next_key)];
|
|
62
|
-
case 3:
|
|
63
|
-
result = _a.sent();
|
|
64
|
-
return [3 /*break*/, 2];
|
|
65
|
-
case 4:
|
|
66
|
-
for (i = 0; i < result.dataList.length; i++) {
|
|
67
|
-
totalItemList[index++] = result.dataList[i];
|
|
68
|
-
}
|
|
69
|
-
(0, chai_1.expect)(totalItemList.length).to.be.equal(total);
|
|
70
|
-
return [2 /*return*/];
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
}); });
|
|
74
|
-
it('Contract getContractLogAll', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
75
|
-
var contractLogList;
|
|
76
|
-
return __generator(this, function (_a) {
|
|
77
|
-
switch (_a.label) {
|
|
78
|
-
case 0: return [4 /*yield*/, firma.Contract.getContractLogAll()];
|
|
79
|
-
case 1:
|
|
80
|
-
contractLogList = _a.sent();
|
|
81
|
-
(0, chai_1.expect)(contractLogList.dataList.length).to.be.equal(contractLogList.dataList.length);
|
|
82
|
-
(0, chai_1.expect)(contractLogList.dataList.length).to.be.greaterThan(0);
|
|
83
|
-
return [2 /*return*/];
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
}); });
|
|
87
|
-
it('Contract getContractLog', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
88
|
-
var logId, contractLog;
|
|
89
|
-
return __generator(this, function (_a) {
|
|
90
|
-
switch (_a.label) {
|
|
91
|
-
case 0:
|
|
92
|
-
logId = "0";
|
|
93
|
-
return [4 /*yield*/, firma.Contract.getContractLog(logId)];
|
|
94
|
-
case 1:
|
|
95
|
-
contractLog = _a.sent();
|
|
96
|
-
(0, chai_1.expect)(contractLog.id).to.be.equal(logId);
|
|
97
|
-
return [2 /*return*/];
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}); });
|
|
101
|
-
it('Contract getContractFileAll-pagination', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
102
|
-
var result, total, totalItemList, index, i, i;
|
|
103
|
-
return __generator(this, function (_a) {
|
|
104
|
-
switch (_a.label) {
|
|
105
|
-
case 0: return [4 /*yield*/, firma.Contract.getContractFileAll()];
|
|
106
|
-
case 1:
|
|
107
|
-
result = _a.sent();
|
|
108
|
-
total = result.pagination.total;
|
|
109
|
-
totalItemList = [];
|
|
110
|
-
index = 0;
|
|
111
|
-
_a.label = 2;
|
|
112
|
-
case 2:
|
|
113
|
-
if (!(result.pagination.next_key != null)) return [3 /*break*/, 4];
|
|
114
|
-
for (i = 0; i < result.dataList.length; i++) {
|
|
115
|
-
totalItemList[index++] = result.dataList[i];
|
|
116
|
-
}
|
|
117
|
-
return [4 /*yield*/, firma.Contract.getContractFileAll(result.pagination.next_key)];
|
|
118
|
-
case 3:
|
|
119
|
-
result = _a.sent();
|
|
120
|
-
return [3 /*break*/, 2];
|
|
121
|
-
case 4:
|
|
122
|
-
for (i = 0; i < result.dataList.length; i++) {
|
|
123
|
-
totalItemList[index++] = result.dataList[i];
|
|
124
|
-
}
|
|
125
|
-
(0, chai_1.expect)(totalItemList.length).to.be.equal(total);
|
|
126
|
-
return [2 /*return*/];
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
}); });
|
|
130
|
-
it('Contract getContractFileAll', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
131
|
-
var contractFileList;
|
|
132
|
-
return __generator(this, function (_a) {
|
|
133
|
-
switch (_a.label) {
|
|
134
|
-
case 0: return [4 /*yield*/, firma.Contract.getContractFileAll()];
|
|
135
|
-
case 1:
|
|
136
|
-
contractFileList = _a.sent();
|
|
137
|
-
// for(var i = 0; i < contractFileList.length; i++){
|
|
138
|
-
// console.log(contractFileList[i]);
|
|
139
|
-
// }
|
|
140
|
-
//console.log("contractFileList:" + contractFileList.length);
|
|
141
|
-
(0, chai_1.expect)(contractFileList.dataList.length).to.be.equal(contractFileList.dataList.length);
|
|
142
|
-
(0, chai_1.expect)(contractFileList.dataList.length).to.be.greaterThan(0);
|
|
143
|
-
return [2 /*return*/];
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
}); });
|
|
147
|
-
it.skip('Contract getContractFile', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
148
|
-
var contractFileHash, contractFile;
|
|
149
|
-
return __generator(this, function (_a) {
|
|
150
|
-
switch (_a.label) {
|
|
151
|
-
case 0:
|
|
152
|
-
contractFileHash = "e3b0c44afbf4c8996fb92427ae41e4649b934ca495991b7852b85531231asddaqwqe";
|
|
153
|
-
return [4 /*yield*/, firma.Contract.getContractFile(contractFileHash)];
|
|
154
|
-
case 1:
|
|
155
|
-
contractFile = _a.sent();
|
|
156
|
-
(0, chai_1.expect)(contractFile.fileHash).to.be.equal(contractFileHash);
|
|
157
|
-
return [2 /*return*/];
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
}); });
|
|
161
|
-
it('Contract getContractListFromHash', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
162
|
-
var contractHash, idList, i, data;
|
|
163
|
-
return __generator(this, function (_a) {
|
|
164
|
-
switch (_a.label) {
|
|
165
|
-
case 0:
|
|
166
|
-
contractHash = "0xsalkdjfasldkjf2";
|
|
167
|
-
return [4 /*yield*/, firma.Contract.getContractListFromHash(contractHash)];
|
|
168
|
-
case 1:
|
|
169
|
-
idList = _a.sent();
|
|
170
|
-
i = 0;
|
|
171
|
-
_a.label = 2;
|
|
172
|
-
case 2:
|
|
173
|
-
if (!(i < idList.length)) return [3 /*break*/, 5];
|
|
174
|
-
return [4 /*yield*/, firma.Contract.getContractLog(idList[i])];
|
|
175
|
-
case 3:
|
|
176
|
-
data = _a.sent();
|
|
177
|
-
_a.label = 4;
|
|
178
|
-
case 4:
|
|
179
|
-
i++;
|
|
180
|
-
return [3 /*break*/, 2];
|
|
181
|
-
case 5:
|
|
182
|
-
(0, chai_1.expect)(idList.length).to.be.greaterThan(0);
|
|
183
|
-
return [2 /*return*/];
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
}); });
|
|
187
|
-
it.skip('Contract isContractOwner', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
188
|
-
var contractFileHash, owner1, owner2, isOwner;
|
|
189
|
-
return __generator(this, function (_a) {
|
|
190
|
-
switch (_a.label) {
|
|
191
|
-
case 0:
|
|
192
|
-
contractFileHash = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b85531231asddaqwqe";
|
|
193
|
-
owner1 = "firma1nssuz67am2uwc2hjgvphg0fmj3k9l6cx65ux9u0kdjaaldlq";
|
|
194
|
-
owner2 = "firma106a9nzxcxu526z4cx6nq4zqpx7ctrx65a020yk23kdjaaldlq";
|
|
195
|
-
return [4 /*yield*/, firma.Contract.isContractOwner(contractFileHash, owner1)];
|
|
196
|
-
case 1:
|
|
197
|
-
isOwner = _a.sent();
|
|
198
|
-
(0, chai_1.expect)(isOwner).to.be.equal(true);
|
|
199
|
-
return [4 /*yield*/, firma.Contract.isContractOwner(contractFileHash, owner2)];
|
|
200
|
-
case 2:
|
|
201
|
-
isOwner = _a.sent();
|
|
202
|
-
(0, chai_1.expect)(isOwner).to.be.equal(true);
|
|
203
|
-
return [2 /*return*/];
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
}); });
|
|
207
|
-
it('Contract getFileHash', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
208
|
-
var fileHash;
|
|
209
|
-
return __generator(this, function (_a) {
|
|
210
|
-
switch (_a.label) {
|
|
211
|
-
case 0: return [4 /*yield*/, FirmaUtil_1.FirmaUtil.getFileHash("./test/sample/sample_contract.pdf")];
|
|
212
|
-
case 1:
|
|
213
|
-
fileHash = _a.sent();
|
|
214
|
-
(0, chai_1.expect)(fileHash).to.be.equal("61faa15f52f19fc4c4e32e1f1208bf8d6d8134ac0a4b15bcfe05bc420e1aedb0");
|
|
215
|
-
return [2 /*return*/];
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
}); });
|
|
219
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|