@firmachain/firma-js 0.2.62 → 0.2.64
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/FirmaCosmWasmCw721.d.ts +18 -0
- package/dist/sdk/FirmaCosmWasmCw721.js +25 -0
- package/dist/test/00.wallet.test.d.ts +1 -0
- package/dist/test/00.wallet.test.js +90 -0
- package/dist/test/01.contract_tx.test.d.ts +1 -0
- package/dist/test/01.contract_tx.test.js +149 -0
- package/dist/test/02.contract_query.test.d.ts +1 -0
- package/dist/test/02.contract_query.test.js +222 -0
- package/dist/test/03.contract_scenario.test.d.ts +1 -0
- package/dist/test/03.contract_scenario.test.js +562 -0
- package/dist/test/04.bank_tx.test.d.ts +1 -0
- package/dist/test/04.bank_tx.test.js +127 -0
- package/dist/test/05.bank_query.test.d.ts +1 -0
- package/dist/test/05.bank_query.test.js +167 -0
- package/dist/test/06.feegrant_tx.test.d.ts +1 -0
- package/dist/test/06.feegrant_tx.test.js +176 -0
- package/dist/test/07.feegrant_query.test.d.ts +1 -0
- package/dist/test/07.feegrant_query.test.js +84 -0
- package/dist/test/08.gas_estimate.test.d.ts +1 -0
- package/dist/test/08.gas_estimate.test.js +703 -0
- package/dist/test/09.ipfs.test.d.ts +1 -0
- package/dist/test/09.ipfs.test.js +72 -0
- package/dist/test/10.nft_tx.test.d.ts +1 -0
- package/dist/test/10.nft_tx.test.js +177 -0
- package/dist/test/11.nft_query.test.d.ts +1 -0
- package/dist/test/11.nft_query.test.js +170 -0
- package/dist/test/12.staking_tx.test.d.ts +1 -0
- package/dist/test/12.staking_tx.test.js +216 -0
- package/dist/test/13.staking_query.test.d.ts +1 -0
- package/dist/test/13.staking_query.test.js +209 -0
- package/dist/test/14.distribution_tx.test.d.ts +1 -0
- package/dist/test/14.distribution_tx.test.js +179 -0
- package/dist/test/15.distribution_query.test.d.ts +1 -0
- package/dist/test/15.distribution_query.test.js +219 -0
- package/dist/test/16.gov_tx.test.d.ts +1 -0
- package/dist/test/16.gov_tx.test.js +240 -0
- package/dist/test/17.gov_query.test.d.ts +1 -0
- package/dist/test/17.gov_query.test.js +118 -0
- package/dist/test/18.util.test.d.ts +1 -0
- package/dist/test/18.util.test.js +246 -0
- package/dist/test/19.chain.test.d.ts +1 -0
- package/dist/test/19.chain.test.js +81 -0
- package/dist/test/20.slashing_query.test.d.ts +1 -0
- package/dist/test/20.slashing_query.test.js +82 -0
- package/dist/test/21.token_tx.test.d.ts +1 -0
- package/dist/test/21.token_tx.test.js +157 -0
- package/dist/test/22.token_query.test.d.ts +1 -0
- package/dist/test/22.token_query.test.js +99 -0
- package/dist/test/23.authz_tx.test.d.ts +1 -0
- package/dist/test/23.authz_tx.test.js +471 -0
- package/dist/test/24.authz_query.test.d.ts +1 -0
- package/dist/test/24.authz_query.test.js +143 -0
- package/dist/test/25.cosmwasm_tx.test.d.ts +1 -0
- package/dist/test/25.cosmwasm_tx.test.js +191 -0
- package/dist/test/26.cosmwasm_query.test.d.ts +1 -0
- package/dist/test/26.cosmwasm_query.test.js +169 -0
- package/dist/test/27.arbitary_sign.test.d.ts +1 -0
- package/dist/test/27.arbitary_sign.test.js +167 -0
- package/dist/test/28.ibc_tx.test.d.ts +1 -0
- package/dist/test/28.ibc_tx.test.js +86 -0
- package/dist/test/29.mint_query.test.d.ts +1 -0
- package/dist/test/29.mint_query.test.js +57 -0
- package/dist/test/30.cw20_tx.test.d.ts +1 -0
- package/dist/test/30.cw20_tx.test.js +515 -0
- package/dist/test/31.cw20_query.test.d.ts +1 -0
- package/dist/test/31.cw20_query.test.js +187 -0
- package/dist/test/32.cw721_tx.test.d.ts +1 -0
- package/dist/test/32.cw721_tx.test.js +433 -0
- package/dist/test/33.cw721_query.test.d.ts +1 -0
- package/dist/test/33.cw721_query.test.js +219 -0
- package/dist/test/34.cw_bridge_tx.test.d.ts +1 -0
- package/dist/test/34.cw_bridge_tx.test.js +365 -0
- package/dist/test/35.cw_bridge_tx_low.test.d.ts +1 -0
- package/dist/test/35.cw_bridge_tx_low.test.js +258 -0
- package/dist/test/36.cw_bridge_query.test.d.ts +1 -0
- package/dist/test/36.cw_bridge_query.test.js +182 -0
- package/dist/test/37.cw_marketplace_tx.test.d.ts +1 -0
- package/dist/test/37.cw_marketplace_tx.test.js +794 -0
- package/dist/test/38.cw_marketplace_query.test.d.ts +1 -0
- package/dist/test/38.cw_marketplace_query.test.js +128 -0
- package/dist/test/config_test.d.ts +5 -0
- package/dist/test/config_test.js +20 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,128 @@
|
|
|
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 FirmaConfig_1 = require("../sdk/FirmaConfig");
|
|
40
|
+
var FirmaSDK_1 = require("../sdk/FirmaSDK");
|
|
41
|
+
var config_test_1 = require("./config_test");
|
|
42
|
+
describe('[37. Marketplace tx Test]', function () {
|
|
43
|
+
var firma;
|
|
44
|
+
var aliceWallet;
|
|
45
|
+
var bobWallet;
|
|
46
|
+
var aliceAddress;
|
|
47
|
+
var bobAddress;
|
|
48
|
+
beforeEach(function () {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
50
|
+
return __generator(this, function (_a) {
|
|
51
|
+
switch (_a.label) {
|
|
52
|
+
case 0:
|
|
53
|
+
firma = new FirmaSDK_1.FirmaSDK(FirmaConfig_1.FirmaConfig.TestNetConfig);
|
|
54
|
+
return [4 /*yield*/, firma.Wallet.fromMnemonic(config_test_1.aliceMnemonic)];
|
|
55
|
+
case 1:
|
|
56
|
+
aliceWallet = _a.sent();
|
|
57
|
+
return [4 /*yield*/, firma.Wallet.fromMnemonic(config_test_1.bobMnemonic)];
|
|
58
|
+
case 2:
|
|
59
|
+
bobWallet = _a.sent();
|
|
60
|
+
return [4 /*yield*/, aliceWallet.getAddress()];
|
|
61
|
+
case 3:
|
|
62
|
+
aliceAddress = _a.sent();
|
|
63
|
+
return [4 /*yield*/, bobWallet.getAddress()];
|
|
64
|
+
case 4:
|
|
65
|
+
bobAddress = _a.sent();
|
|
66
|
+
return [2 /*return*/];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
var cw721ContractAddress = "firma1mp3dl27wwhdkhkyed5d4ypaq7h5dewazqkqhny98sxcy2cpu23ls369adt";
|
|
72
|
+
var cw20ContractAddress = "firma1w8jfdyfdwf39w8x3j0hs5zd70upfx3ez05sty0xf9ueewsxa9w5qd9t4cr";
|
|
73
|
+
var marketplaceContractAddress = "firma1z5msu5fdzh5sux8r77gex9920jpte2jmv0v3su0cltzs9m5e6a9st2l35f";
|
|
74
|
+
it.skip('Cw marketplace get config', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
75
|
+
var data;
|
|
76
|
+
return __generator(this, function (_a) {
|
|
77
|
+
switch (_a.label) {
|
|
78
|
+
case 0: return [4 /*yield*/, firma.CwMarketplace.getConfig(marketplaceContractAddress)];
|
|
79
|
+
case 1:
|
|
80
|
+
data = _a.sent();
|
|
81
|
+
console.log(data);
|
|
82
|
+
return [2 /*return*/];
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}); }),
|
|
86
|
+
it.skip('Cw marketplace get owner', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
87
|
+
var data;
|
|
88
|
+
return __generator(this, function (_a) {
|
|
89
|
+
switch (_a.label) {
|
|
90
|
+
case 0: return [4 /*yield*/, firma.CwMarketplace.getOwner(marketplaceContractAddress)];
|
|
91
|
+
case 1:
|
|
92
|
+
data = _a.sent();
|
|
93
|
+
console.log(data);
|
|
94
|
+
return [2 /*return*/];
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}); }),
|
|
98
|
+
it.skip('Cw marketplace get register list', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
99
|
+
var limit, start_after, data;
|
|
100
|
+
return __generator(this, function (_a) {
|
|
101
|
+
switch (_a.label) {
|
|
102
|
+
case 0:
|
|
103
|
+
limit = 10;
|
|
104
|
+
start_after = "59";
|
|
105
|
+
return [4 /*yield*/, firma.CwMarketplace.getRegisterList(marketplaceContractAddress, limit, start_after)];
|
|
106
|
+
case 1:
|
|
107
|
+
data = _a.sent();
|
|
108
|
+
console.log(data);
|
|
109
|
+
return [2 /*return*/];
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}); }),
|
|
113
|
+
it.skip('Cw marketplace get item', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
114
|
+
var limit, start_after, data;
|
|
115
|
+
return __generator(this, function (_a) {
|
|
116
|
+
switch (_a.label) {
|
|
117
|
+
case 0:
|
|
118
|
+
limit = 10;
|
|
119
|
+
start_after = "59";
|
|
120
|
+
return [4 /*yield*/, firma.CwMarketplace.getRegisterListByAddress(marketplaceContractAddress, aliceAddress, limit, start_after)];
|
|
121
|
+
case 1:
|
|
122
|
+
data = _a.sent();
|
|
123
|
+
console.log(data);
|
|
124
|
+
return [2 /*return*/];
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}); });
|
|
128
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FirmaConfig } from "../sdk/FirmaConfig";
|
|
2
|
+
export declare let TestChainConfig: FirmaConfig;
|
|
3
|
+
export declare const validatorMnemonic = "patrol three crash inmate myself soon hold merge tortoise leopard celery pill affair fall second print case ignore truly interest hammer mail short kit";
|
|
4
|
+
export declare const aliceMnemonic = "pizza venue kangaroo desert faculty circle benefit next snap buzz gas elite speed depart clown vicious country life game choice venture wealth shrimp fault";
|
|
5
|
+
export declare const bobMnemonic = "hope tip sick hour stamp submit coach crisp fragile plunge bargain print detect bitter lecture mouse addict until great barrel truck toilet chapter double";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bobMnemonic = exports.aliceMnemonic = exports.validatorMnemonic = exports.TestChainConfig = void 0;
|
|
4
|
+
exports.TestChainConfig = {
|
|
5
|
+
chainID: "imperium-4",
|
|
6
|
+
rpcAddress: "http://127.0.0.1:26657",
|
|
7
|
+
restApiAddress: "http://127.0.0.1:1317",
|
|
8
|
+
ipfsNodeAddress: "https://ipfs-dev.firmachain.dev",
|
|
9
|
+
ipfsNodePort: 5001,
|
|
10
|
+
ipfsWebApiAddress: "https://ipfs-dev.firmachain.dev",
|
|
11
|
+
hdPath: "m/44'/7777777'/",
|
|
12
|
+
prefix: "firma",
|
|
13
|
+
denom: "ufct",
|
|
14
|
+
isShowLog: true,
|
|
15
|
+
defaultFee: 20000,
|
|
16
|
+
defaultGas: 200000
|
|
17
|
+
};
|
|
18
|
+
exports.validatorMnemonic = "patrol three crash inmate myself soon hold merge tortoise leopard celery pill affair fall second print case ignore truly interest hammer mail short kit";
|
|
19
|
+
exports.aliceMnemonic = "pizza venue kangaroo desert faculty circle benefit next snap buzz gas elite speed depart clown vicious country life game choice venture wealth shrimp fault";
|
|
20
|
+
exports.bobMnemonic = "hope tip sick hour stamp submit coach crisp fragile plunge bargain print detect bitter lecture mouse addict until great barrel truck toilet chapter double";
|