wasm-ast-types 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- package/main/{wasm.js → client/client.js} +54 -40
- package/main/client/index.js +18 -0
- package/main/client/test/ts-client.arrays.spec.js +25 -0
- package/main/client/test/ts-client.cw-named-groups.test.js +25 -0
- package/main/client/test/ts-client.cw-proposal-single.test.js +30 -0
- package/main/client/test/ts-client.empty-enums.spec.js +19 -0
- package/main/client/test/ts-client.sg721.spec.js +25 -0
- package/main/client/test/ts-client.spec.js +106 -0
- package/main/client/test/ts-client.vectis.spec.js +56 -0
- package/main/context/context.js +48 -0
- package/main/context/index.js +18 -0
- package/main/{messages.js → from-partial/from-partial.js} +17 -60
- package/main/from-partial/from-partial.spec.js +20 -0
- package/main/from-partial/index.js +18 -0
- package/main/index.js +34 -8
- package/main/react-query/index.js +18 -0
- package/main/{react-query.js → react-query/react-query.js} +39 -64
- package/main/{react-query.spec.js → react-query/react-query.spec.js} +33 -43
- package/main/recoil/index.js +18 -0
- package/main/{recoil.js → recoil/recoil.js} +7 -26
- package/main/{recoil.spec.js → recoil/recoil.spec.js} +9 -14
- package/main/utils/babel.spec.js +7 -15
- package/main/utils/index.js +13 -0
- package/main/utils/types.js +34 -32
- package/module/{wasm.js → client/client.js} +43 -33
- package/module/client/index.js +1 -0
- package/module/client/test/ts-client.arrays.spec.js +17 -0
- package/module/client/test/ts-client.cw-named-groups.test.js +17 -0
- package/module/client/test/ts-client.cw-proposal-single.test.js +21 -0
- package/module/client/test/ts-client.empty-enums.spec.js +11 -0
- package/module/client/test/ts-client.sg721.spec.js +17 -0
- package/module/client/test/ts-client.spec.js +85 -0
- package/module/client/test/ts-client.vectis.spec.js +44 -0
- package/module/context/context.js +25 -0
- package/module/context/index.js +1 -0
- package/module/{messages.js → from-partial/from-partial.js} +16 -57
- package/module/from-partial/from-partial.spec.js +12 -0
- package/module/from-partial/index.js +1 -0
- package/module/index.js +5 -3
- package/module/react-query/index.js +1 -0
- package/module/{react-query.js → react-query/react-query.js} +30 -49
- package/module/react-query/react-query.spec.js +53 -0
- package/module/recoil/index.js +1 -0
- package/module/{recoil.js → recoil/recoil.js} +6 -20
- package/module/recoil/recoil.spec.js +15 -0
- package/module/utils/babel.spec.js +1 -10
- package/module/utils/index.js +2 -1
- package/module/utils/types.js +32 -30
- package/package.json +4 -3
- package/types/src/client/client.d.ts +17 -0
- package/types/src/client/index.d.ts +1 -0
- package/types/src/client/test/ts-client.cw-named-groups.test.d.ts +1 -0
- package/types/src/client/test/ts-client.cw-proposal-single.test.d.ts +1 -0
- package/types/src/context/context.d.ts +20 -0
- package/types/src/context/index.d.ts +1 -0
- package/types/src/from-partial/from-partial.d.ts +4 -0
- package/types/src/from-partial/index.d.ts +1 -0
- package/types/src/index.d.ts +7 -0
- package/types/src/react-query/index.d.ts +1 -0
- package/types/src/react-query/react-query.d.ts +81 -0
- package/types/src/recoil/index.d.ts +1 -0
- package/types/{recoil.d.ts → src/recoil/recoil.d.ts} +5 -5
- package/types/{types.d.ts → src/types.d.ts} +17 -0
- package/types/{utils.d.ts → src/utils/babel.d.ts} +21 -1
- package/types/src/utils/index.d.ts +2 -0
- package/types/src/utils/types.d.ts +18 -0
- package/types/test-utils/index.d.ts +2 -0
- package/main/messages.spec.js +0 -24
- package/main/wasm.arrays.spec.js +0 -30
- package/main/wasm.cw-named-groups.test.js +0 -30
- package/main/wasm.cw-proposal-single.test.js +0 -32
- package/main/wasm.empty-enums.spec.js +0 -24
- package/main/wasm.sg721.spec.js +0 -30
- package/main/wasm.spec.js +0 -95
- package/main/wasm.vectis.spec.js +0 -53
- package/module/messages.spec.js +0 -18
- package/module/react-query.spec.js +0 -65
- package/module/recoil.spec.js +0 -22
- package/module/wasm.arrays.spec.js +0 -24
- package/module/wasm.cw-named-groups.test.js +0 -24
- package/module/wasm.cw-proposal-single.test.js +0 -25
- package/module/wasm.empty-enums.spec.js +0 -18
- package/module/wasm.sg721.spec.js +0 -24
- package/module/wasm.spec.js +0 -76
- package/module/wasm.vectis.spec.js +0 -43
- package/types/amino/amino-interfaces.d.ts +0 -6
- package/types/amino/from-amino.d.ts +0 -13
- package/types/amino/index.d.ts +0 -3
- package/types/amino/to-amino.d.ts +0 -11
- package/types/index.d.ts +0 -5
- package/types/messages.d.ts +0 -4
- package/types/react-query.d.ts +0 -70
- package/types/wasm.d.ts +0 -24
package/main/wasm.spec.js
DELETED
@@ -1,95 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
|
-
var _generator = _interopRequireDefault(require("@babel/generator"));
|
6
|
-
|
7
|
-
var _execute_msg = _interopRequireDefault(require("./../../../__fixtures__/daodao/cw-named-groups/execute_msg.json"));
|
8
|
-
|
9
|
-
var _query_msg = _interopRequireDefault(require("./../../../__fixtures__/basic/query_msg.json"));
|
10
|
-
|
11
|
-
var _execute_msg_for__empty = _interopRequireDefault(require("./../../../__fixtures__/basic/execute_msg_for__empty.json"));
|
12
|
-
|
13
|
-
var _approval_response = _interopRequireDefault(require("./../../../__fixtures__/basic/approval_response.json"));
|
14
|
-
|
15
|
-
var _all_nft_info_response = _interopRequireDefault(require("./../../../__fixtures__/basic/all_nft_info_response.json"));
|
16
|
-
|
17
|
-
var _approvals_response = _interopRequireDefault(require("./../../../__fixtures__/basic/approvals_response.json"));
|
18
|
-
|
19
|
-
var _collection_info_response = _interopRequireDefault(require("./../../../__fixtures__/basic/collection_info_response.json"));
|
20
|
-
|
21
|
-
var _contract_info_response = _interopRequireDefault(require("./../../../__fixtures__/basic/contract_info_response.json"));
|
22
|
-
|
23
|
-
var _instantiate_msg = _interopRequireDefault(require("./../../../__fixtures__/basic/instantiate_msg.json"));
|
24
|
-
|
25
|
-
var _nft_info_response = _interopRequireDefault(require("./../../../__fixtures__/basic/nft_info_response.json"));
|
26
|
-
|
27
|
-
var _num_tokens_response = _interopRequireDefault(require("./../../../__fixtures__/basic/num_tokens_response.json"));
|
28
|
-
|
29
|
-
var _operators_response = _interopRequireDefault(require("./../../../__fixtures__/basic/operators_response.json"));
|
30
|
-
|
31
|
-
var _owner_of_response = _interopRequireDefault(require("./../../../__fixtures__/basic/owner_of_response.json"));
|
32
|
-
|
33
|
-
var _tokens_response = _interopRequireDefault(require("./../../../__fixtures__/basic/tokens_response.json"));
|
34
|
-
|
35
|
-
var _wasm = require("./wasm");
|
36
|
-
|
37
|
-
var expectCode = function expectCode(ast) {
|
38
|
-
expect((0, _generator["default"])(ast).code).toMatchSnapshot();
|
39
|
-
};
|
40
|
-
|
41
|
-
var printCode = function printCode(ast) {
|
42
|
-
console.log((0, _generator["default"])(ast).code);
|
43
|
-
};
|
44
|
-
|
45
|
-
it('approval_response', function () {
|
46
|
-
expectCode((0, _wasm.createTypeInterface)(_approval_response["default"]));
|
47
|
-
});
|
48
|
-
it('all_nft_info_response', function () {
|
49
|
-
expectCode((0, _wasm.createTypeInterface)(_all_nft_info_response["default"]));
|
50
|
-
});
|
51
|
-
it('approvals_response', function () {
|
52
|
-
expectCode((0, _wasm.createTypeInterface)(_approvals_response["default"]));
|
53
|
-
});
|
54
|
-
it('collection_info_response', function () {
|
55
|
-
expectCode((0, _wasm.createTypeInterface)(_collection_info_response["default"]));
|
56
|
-
});
|
57
|
-
it('contract_info_response', function () {
|
58
|
-
expectCode((0, _wasm.createTypeInterface)(_contract_info_response["default"]));
|
59
|
-
});
|
60
|
-
it('instantiate_msg', function () {
|
61
|
-
expectCode((0, _wasm.createTypeInterface)(_instantiate_msg["default"]));
|
62
|
-
});
|
63
|
-
it('nft_info_response', function () {
|
64
|
-
expectCode((0, _wasm.createTypeInterface)(_nft_info_response["default"]));
|
65
|
-
});
|
66
|
-
it('num_tokens_response', function () {
|
67
|
-
expectCode((0, _wasm.createTypeInterface)(_num_tokens_response["default"]));
|
68
|
-
});
|
69
|
-
it('operators_response', function () {
|
70
|
-
expectCode((0, _wasm.createTypeInterface)(_operators_response["default"]));
|
71
|
-
});
|
72
|
-
it('owner_of_response', function () {
|
73
|
-
expectCode((0, _wasm.createTypeInterface)(_owner_of_response["default"]));
|
74
|
-
});
|
75
|
-
it('tokens_response', function () {
|
76
|
-
expectCode((0, _wasm.createTypeInterface)(_tokens_response["default"]));
|
77
|
-
});
|
78
|
-
it('query classes', function () {
|
79
|
-
expectCode((0, _wasm.createQueryClass)('SG721QueryClient', 'SG721ReadOnlyInstance', _query_msg["default"]));
|
80
|
-
});
|
81
|
-
it('execute classes', function () {
|
82
|
-
expectCode((0, _wasm.createExecuteClass)('SG721Client', 'SG721Instance', 'SG721QueryClient', _execute_msg_for__empty["default"]));
|
83
|
-
});
|
84
|
-
it('execute classes no extends', function () {
|
85
|
-
expectCode((0, _wasm.createExecuteClass)('SG721Client', 'SG721Instance', null, _execute_msg_for__empty["default"]));
|
86
|
-
});
|
87
|
-
it('execute classes array types', function () {
|
88
|
-
expectCode((0, _wasm.createExecuteClass)('SG721Client', 'SG721Instance', null, _execute_msg["default"]));
|
89
|
-
});
|
90
|
-
it('execute interfaces no extends', function () {
|
91
|
-
expectCode((0, _wasm.createExecuteInterface)('SG721Instance', null, _execute_msg_for__empty["default"]));
|
92
|
-
});
|
93
|
-
it('query interfaces', function () {
|
94
|
-
expectCode((0, _wasm.createQueryInterface)('SG721ReadOnlyInstance', _query_msg["default"]));
|
95
|
-
});
|
package/main/wasm.vectis.spec.js
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
|
-
var _generator = _interopRequireDefault(require("@babel/generator"));
|
6
|
-
|
7
|
-
var _cosmos_msg_for__empty = _interopRequireDefault(require("./../../../__fixtures__/vectis/govec/cosmos_msg_for__empty.json"));
|
8
|
-
|
9
|
-
var _execute_msg_for__empty = _interopRequireDefault(require("./../../../__fixtures__/vectis/govec/execute_msg_for__empty.json"));
|
10
|
-
|
11
|
-
var _can_execute_relay_response = _interopRequireDefault(require("./../../../__fixtures__/vectis/govec/can_execute_relay_response.json"));
|
12
|
-
|
13
|
-
var _info_response = _interopRequireDefault(require("./../../../__fixtures__/vectis/govec/info_response.json"));
|
14
|
-
|
15
|
-
var _relay_transaction = _interopRequireDefault(require("./../../../__fixtures__/vectis/govec/relay_transaction.json"));
|
16
|
-
|
17
|
-
var _wasm = require("./wasm");
|
18
|
-
|
19
|
-
var expectCode = function expectCode(ast) {
|
20
|
-
expect((0, _generator["default"])(ast).code).toMatchSnapshot();
|
21
|
-
};
|
22
|
-
|
23
|
-
var printCode = function printCode(ast) {
|
24
|
-
console.log((0, _generator["default"])(ast).code);
|
25
|
-
};
|
26
|
-
|
27
|
-
it('cosmos_msg_for__empty', function () {
|
28
|
-
expectCode((0, _wasm.createTypeInterface)(_cosmos_msg_for__empty["default"]));
|
29
|
-
});
|
30
|
-
it('execute_msg_for__empty', function () {
|
31
|
-
expectCode((0, _wasm.createTypeInterface)(_execute_msg_for__empty["default"]));
|
32
|
-
});
|
33
|
-
it('can_execute_relay_response', function () {
|
34
|
-
expectCode((0, _wasm.createTypeInterface)(_can_execute_relay_response["default"]));
|
35
|
-
});
|
36
|
-
it('info_response', function () {
|
37
|
-
expectCode((0, _wasm.createTypeInterface)(_info_response["default"]));
|
38
|
-
});
|
39
|
-
it('relay_transaction', function () {
|
40
|
-
expectCode((0, _wasm.createTypeInterface)(_relay_transaction["default"]));
|
41
|
-
});
|
42
|
-
it('query classes', function () {
|
43
|
-
expectCode((0, _wasm.createQueryClass)('SG721QueryClient', 'SG721ReadOnlyInstance', _cosmos_msg_for__empty["default"]));
|
44
|
-
});
|
45
|
-
it('query classes', function () {
|
46
|
-
expectCode((0, _wasm.createQueryClass)('SG721QueryClient', 'SG721ReadOnlyInstance', _execute_msg_for__empty["default"]));
|
47
|
-
});
|
48
|
-
it('execute classes array types', function () {
|
49
|
-
expectCode((0, _wasm.createExecuteClass)('SG721Client', 'SG721Instance', null, _execute_msg_for__empty["default"]));
|
50
|
-
});
|
51
|
-
it('execute interfaces no extends', function () {
|
52
|
-
expectCode((0, _wasm.createExecuteInterface)('SG721Instance', null, _execute_msg_for__empty["default"]));
|
53
|
-
});
|
package/module/messages.spec.js
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
import generate from '@babel/generator';
|
2
|
-
import execute_msg from './../../../__fixtures__/basic/execute_msg_for__empty.json';
|
3
|
-
import { createFromPartialClass, createFromPartialInterface } from './messages';
|
4
|
-
|
5
|
-
const expectCode = ast => {
|
6
|
-
expect(generate(ast).code).toMatchSnapshot();
|
7
|
-
};
|
8
|
-
|
9
|
-
const printCode = ast => {
|
10
|
-
console.log(generate(ast).code);
|
11
|
-
};
|
12
|
-
|
13
|
-
it('execute classes', () => {
|
14
|
-
expectCode(createFromPartialClass('SG721MessageComposer', 'SG721Message', execute_msg));
|
15
|
-
});
|
16
|
-
it('createFromPartialInterface', () => {
|
17
|
-
expectCode(createFromPartialInterface('SG721Message', execute_msg));
|
18
|
-
});
|
@@ -1,65 +0,0 @@
|
|
1
|
-
import generate from '@babel/generator';
|
2
|
-
import * as t from '@babel/types';
|
3
|
-
import query_msg from './../../../__fixtures__/basic/query_msg.json';
|
4
|
-
import execute_msg from './../../../__fixtures__/basic/execute_msg_for__empty.json';
|
5
|
-
import { createReactQueryHooks, createReactQueryMutationHooks } from './react-query';
|
6
|
-
|
7
|
-
const expectCode = ast => {
|
8
|
-
expect(generate(ast).code).toMatchSnapshot();
|
9
|
-
};
|
10
|
-
|
11
|
-
const printCode = ast => {
|
12
|
-
console.log(generate(ast).code);
|
13
|
-
}; // it('createReactQueryHook', () => {
|
14
|
-
// printCode(createReactQueryHook({
|
15
|
-
// methodName: 'allNftInfo',
|
16
|
-
// hookName: 'useSg721AllNftInfoQuery',
|
17
|
-
// hookParamsTypeName: 'Sg721CollectionInfoQuery',
|
18
|
-
// responseType: 'AllNftInfoResponse',
|
19
|
-
// hookKeyName: 'Sg721AllNftInfo'
|
20
|
-
// }))
|
21
|
-
// });
|
22
|
-
|
23
|
-
|
24
|
-
it('createReactQueryHooks', () => {
|
25
|
-
expectCode(t.program(createReactQueryHooks({
|
26
|
-
queryMsg: query_msg,
|
27
|
-
contractName: 'Sg721',
|
28
|
-
QueryClient: 'Sg721QueryClient'
|
29
|
-
})));
|
30
|
-
expectCode(t.program(createReactQueryHooks({
|
31
|
-
queryMsg: query_msg,
|
32
|
-
contractName: 'Sg721',
|
33
|
-
QueryClient: 'Sg721QueryClient'
|
34
|
-
})));
|
35
|
-
expectCode(t.program(createReactQueryHooks({
|
36
|
-
queryMsg: query_msg,
|
37
|
-
contractName: 'Sg721',
|
38
|
-
QueryClient: 'Sg721QueryClient',
|
39
|
-
options: {
|
40
|
-
optionalClient: true
|
41
|
-
}
|
42
|
-
})));
|
43
|
-
expectCode(t.program(createReactQueryHooks({
|
44
|
-
queryMsg: query_msg,
|
45
|
-
contractName: 'Sg721',
|
46
|
-
QueryClient: 'Sg721QueryClient',
|
47
|
-
options: {
|
48
|
-
v4: true
|
49
|
-
}
|
50
|
-
})));
|
51
|
-
expectCode(t.program(createReactQueryHooks({
|
52
|
-
queryMsg: query_msg,
|
53
|
-
contractName: 'Sg721',
|
54
|
-
QueryClient: 'Sg721QueryClient',
|
55
|
-
options: {
|
56
|
-
optionalClient: true,
|
57
|
-
v4: true
|
58
|
-
}
|
59
|
-
})));
|
60
|
-
expectCode(t.program(createReactQueryMutationHooks({
|
61
|
-
execMsg: execute_msg,
|
62
|
-
contractName: 'Sg721',
|
63
|
-
ExecuteClient: 'Sg721Client'
|
64
|
-
})));
|
65
|
-
});
|
package/module/recoil.spec.js
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
import generate from '@babel/generator';
|
2
|
-
import * as t from '@babel/types';
|
3
|
-
import query_msg from './../../../__fixtures__/basic/query_msg.json';
|
4
|
-
import { createRecoilSelector, createRecoilSelectors, createRecoilQueryClient } from './recoil';
|
5
|
-
|
6
|
-
const expectCode = ast => {
|
7
|
-
expect(generate(ast).code).toMatchSnapshot();
|
8
|
-
};
|
9
|
-
|
10
|
-
const printCode = ast => {
|
11
|
-
console.log(generate(ast).code);
|
12
|
-
};
|
13
|
-
|
14
|
-
it('selector', () => {
|
15
|
-
expectCode(createRecoilSelector('SG721', 'SG721QueryClient', 'governanceModules'));
|
16
|
-
});
|
17
|
-
it('selectors', () => {
|
18
|
-
expectCode(t.program(createRecoilSelectors('SG721', 'SG721QueryClient', query_msg)));
|
19
|
-
});
|
20
|
-
it('client', () => {
|
21
|
-
expectCode(createRecoilQueryClient('SG721', 'SG721QueryClient'));
|
22
|
-
});
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import generate from '@babel/generator';
|
2
|
-
import message from './../../../__fixtures__/misc/schema/arrays.json';
|
3
|
-
import { createQueryClass, createExecuteClass, createExecuteInterface, createTypeInterface } from './wasm';
|
4
|
-
|
5
|
-
const expectCode = ast => {
|
6
|
-
expect(generate(ast).code).toMatchSnapshot();
|
7
|
-
};
|
8
|
-
|
9
|
-
const printCode = ast => {
|
10
|
-
console.log(generate(ast).code);
|
11
|
-
};
|
12
|
-
|
13
|
-
it('execute_msg_for__empty', () => {
|
14
|
-
expectCode(createTypeInterface(message));
|
15
|
-
});
|
16
|
-
it('query classes', () => {
|
17
|
-
expectCode(createQueryClass('SG721QueryClient', 'SG721ReadOnlyInstance', message));
|
18
|
-
});
|
19
|
-
it('execute classes array types', () => {
|
20
|
-
expectCode(createExecuteClass('SG721Client', 'SG721Instance', null, message));
|
21
|
-
});
|
22
|
-
it('execute interfaces no extends', () => {
|
23
|
-
expectCode(createExecuteInterface('SG721Instance', null, message));
|
24
|
-
});
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import generate from '@babel/generator';
|
2
|
-
import execute_msg from './../../../__fixtures__/daodao/cw-named-groups/execute_msg.json';
|
3
|
-
import { createQueryClass, createExecuteClass, createExecuteInterface, createTypeInterface } from './wasm';
|
4
|
-
|
5
|
-
const expectCode = ast => {
|
6
|
-
expect(generate(ast).code).toMatchSnapshot();
|
7
|
-
};
|
8
|
-
|
9
|
-
const printCode = ast => {
|
10
|
-
console.log(generate(ast).code);
|
11
|
-
};
|
12
|
-
|
13
|
-
it('execute_msg', () => {
|
14
|
-
expectCode(createTypeInterface(execute_msg));
|
15
|
-
});
|
16
|
-
it('query classes', () => {
|
17
|
-
expectCode(createQueryClass('SG721QueryClient', 'SG721ReadOnlyInstance', execute_msg));
|
18
|
-
});
|
19
|
-
it('execute classes array types', () => {
|
20
|
-
expectCode(createExecuteClass('SG721Client', 'SG721Instance', null, execute_msg));
|
21
|
-
});
|
22
|
-
it('execute interfaces no extends', () => {
|
23
|
-
expectCode(createExecuteInterface('SG721Instance', null, execute_msg));
|
24
|
-
});
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import generate from '@babel/generator';
|
2
|
-
import execute_msg from './../../../__fixtures__/daodao/cw-proposal-single/execute_msg.json';
|
3
|
-
import query_msg from './../../../__fixtures__/daodao/cw-proposal-single/query_msg.json';
|
4
|
-
import { createQueryClass, createExecuteClass, createExecuteInterface, createTypeInterface } from './wasm';
|
5
|
-
|
6
|
-
const expectCode = ast => {
|
7
|
-
expect(generate(ast).code).toMatchSnapshot();
|
8
|
-
};
|
9
|
-
|
10
|
-
const printCode = ast => {
|
11
|
-
console.log(generate(ast).code);
|
12
|
-
};
|
13
|
-
|
14
|
-
it('execute_msg_for', () => {
|
15
|
-
expectCode(createTypeInterface(execute_msg));
|
16
|
-
});
|
17
|
-
it('query classes', () => {
|
18
|
-
expectCode(createQueryClass('SG721QueryClient', 'SG721ReadOnlyInstance', query_msg));
|
19
|
-
});
|
20
|
-
it('execute classes array types', () => {
|
21
|
-
expectCode(createExecuteClass('SG721Client', 'SG721Instance', null, execute_msg));
|
22
|
-
});
|
23
|
-
it('execute interfaces no extends', () => {
|
24
|
-
expectCode(createExecuteInterface('SG721Instance', null, execute_msg));
|
25
|
-
});
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import generate from '@babel/generator';
|
2
|
-
import query_msg from './../../../__fixtures__/daodao/cw-admin-factory/query_msg.json';
|
3
|
-
import { createQueryClass, createQueryInterface } from './wasm';
|
4
|
-
|
5
|
-
const expectCode = ast => {
|
6
|
-
expect(generate(ast).code).toMatchSnapshot();
|
7
|
-
};
|
8
|
-
|
9
|
-
const printCode = ast => {
|
10
|
-
console.log(generate(ast).code);
|
11
|
-
};
|
12
|
-
|
13
|
-
it('query classes', () => {
|
14
|
-
expectCode(createQueryClass('SG721QueryClient', 'SG721ReadOnlyInstance', query_msg));
|
15
|
-
});
|
16
|
-
it('query interface', () => {
|
17
|
-
expectCode(createQueryInterface('ReadOnlyInstance', query_msg));
|
18
|
-
});
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import generate from '@babel/generator';
|
2
|
-
import execute_msg_for__empty from './../../../__fixtures__/sg721/execute_msg_for__empty.json';
|
3
|
-
import { createQueryClass, createExecuteClass, createExecuteInterface, createTypeInterface } from './wasm';
|
4
|
-
|
5
|
-
const expectCode = ast => {
|
6
|
-
expect(generate(ast).code).toMatchSnapshot();
|
7
|
-
};
|
8
|
-
|
9
|
-
const printCode = ast => {
|
10
|
-
console.log(generate(ast).code);
|
11
|
-
};
|
12
|
-
|
13
|
-
it('execute_msg_for__empty', () => {
|
14
|
-
expectCode(createTypeInterface(execute_msg_for__empty));
|
15
|
-
});
|
16
|
-
it('query classes', () => {
|
17
|
-
expectCode(createQueryClass('SG721QueryClient', 'SG721ReadOnlyInstance', execute_msg_for__empty));
|
18
|
-
});
|
19
|
-
it('execute classes array types', () => {
|
20
|
-
expectCode(createExecuteClass('SG721Client', 'SG721Instance', null, execute_msg_for__empty));
|
21
|
-
});
|
22
|
-
it('execute interfaces no extends', () => {
|
23
|
-
expectCode(createExecuteInterface('SG721Instance', null, execute_msg_for__empty));
|
24
|
-
});
|
package/module/wasm.spec.js
DELETED
@@ -1,76 +0,0 @@
|
|
1
|
-
import generate from '@babel/generator';
|
2
|
-
import execute_msg_named_groups from './../../../__fixtures__/daodao/cw-named-groups/execute_msg.json';
|
3
|
-
import query_msg from './../../../__fixtures__/basic/query_msg.json';
|
4
|
-
import execute_msg from './../../../__fixtures__/basic/execute_msg_for__empty.json';
|
5
|
-
import approval_response from './../../../__fixtures__/basic/approval_response.json';
|
6
|
-
import all_nft_info_response from './../../../__fixtures__/basic/all_nft_info_response.json';
|
7
|
-
import approvals_response from './../../../__fixtures__/basic/approvals_response.json';
|
8
|
-
import collection_info_response from './../../../__fixtures__/basic/collection_info_response.json';
|
9
|
-
import contract_info_response from './../../../__fixtures__/basic/contract_info_response.json';
|
10
|
-
import instantiate_msg from './../../../__fixtures__/basic/instantiate_msg.json';
|
11
|
-
import nft_info_response from './../../../__fixtures__/basic/nft_info_response.json';
|
12
|
-
import num_tokens_response from './../../../__fixtures__/basic/num_tokens_response.json';
|
13
|
-
import operators_response from './../../../__fixtures__/basic/operators_response.json';
|
14
|
-
import owner_of_response from './../../../__fixtures__/basic/owner_of_response.json';
|
15
|
-
import tokens_response from './../../../__fixtures__/basic/tokens_response.json';
|
16
|
-
import { createQueryClass, createQueryInterface, createExecuteClass, createExecuteInterface, createTypeInterface } from './wasm';
|
17
|
-
|
18
|
-
const expectCode = ast => {
|
19
|
-
expect(generate(ast).code).toMatchSnapshot();
|
20
|
-
};
|
21
|
-
|
22
|
-
const printCode = ast => {
|
23
|
-
console.log(generate(ast).code);
|
24
|
-
};
|
25
|
-
|
26
|
-
it('approval_response', () => {
|
27
|
-
expectCode(createTypeInterface(approval_response));
|
28
|
-
});
|
29
|
-
it('all_nft_info_response', () => {
|
30
|
-
expectCode(createTypeInterface(all_nft_info_response));
|
31
|
-
});
|
32
|
-
it('approvals_response', () => {
|
33
|
-
expectCode(createTypeInterface(approvals_response));
|
34
|
-
});
|
35
|
-
it('collection_info_response', () => {
|
36
|
-
expectCode(createTypeInterface(collection_info_response));
|
37
|
-
});
|
38
|
-
it('contract_info_response', () => {
|
39
|
-
expectCode(createTypeInterface(contract_info_response));
|
40
|
-
});
|
41
|
-
it('instantiate_msg', () => {
|
42
|
-
expectCode(createTypeInterface(instantiate_msg));
|
43
|
-
});
|
44
|
-
it('nft_info_response', () => {
|
45
|
-
expectCode(createTypeInterface(nft_info_response));
|
46
|
-
});
|
47
|
-
it('num_tokens_response', () => {
|
48
|
-
expectCode(createTypeInterface(num_tokens_response));
|
49
|
-
});
|
50
|
-
it('operators_response', () => {
|
51
|
-
expectCode(createTypeInterface(operators_response));
|
52
|
-
});
|
53
|
-
it('owner_of_response', () => {
|
54
|
-
expectCode(createTypeInterface(owner_of_response));
|
55
|
-
});
|
56
|
-
it('tokens_response', () => {
|
57
|
-
expectCode(createTypeInterface(tokens_response));
|
58
|
-
});
|
59
|
-
it('query classes', () => {
|
60
|
-
expectCode(createQueryClass('SG721QueryClient', 'SG721ReadOnlyInstance', query_msg));
|
61
|
-
});
|
62
|
-
it('execute classes', () => {
|
63
|
-
expectCode(createExecuteClass('SG721Client', 'SG721Instance', 'SG721QueryClient', execute_msg));
|
64
|
-
});
|
65
|
-
it('execute classes no extends', () => {
|
66
|
-
expectCode(createExecuteClass('SG721Client', 'SG721Instance', null, execute_msg));
|
67
|
-
});
|
68
|
-
it('execute classes array types', () => {
|
69
|
-
expectCode(createExecuteClass('SG721Client', 'SG721Instance', null, execute_msg_named_groups));
|
70
|
-
});
|
71
|
-
it('execute interfaces no extends', () => {
|
72
|
-
expectCode(createExecuteInterface('SG721Instance', null, execute_msg));
|
73
|
-
});
|
74
|
-
it('query interfaces', () => {
|
75
|
-
expectCode(createQueryInterface('SG721ReadOnlyInstance', query_msg));
|
76
|
-
});
|
@@ -1,43 +0,0 @@
|
|
1
|
-
import generate from '@babel/generator';
|
2
|
-
import cosmos_msg_for__empty from './../../../__fixtures__/vectis/govec/cosmos_msg_for__empty.json';
|
3
|
-
import execute_msg_for__empty from './../../../__fixtures__/vectis/govec/execute_msg_for__empty.json';
|
4
|
-
import can_execute_relay_response from './../../../__fixtures__/vectis/govec/can_execute_relay_response.json';
|
5
|
-
import info_response from './../../../__fixtures__/vectis/govec/info_response.json';
|
6
|
-
import relay_transaction from './../../../__fixtures__/vectis/govec/relay_transaction.json';
|
7
|
-
import { createQueryClass, createExecuteClass, createExecuteInterface, createTypeInterface } from './wasm';
|
8
|
-
|
9
|
-
const expectCode = ast => {
|
10
|
-
expect(generate(ast).code).toMatchSnapshot();
|
11
|
-
};
|
12
|
-
|
13
|
-
const printCode = ast => {
|
14
|
-
console.log(generate(ast).code);
|
15
|
-
};
|
16
|
-
|
17
|
-
it('cosmos_msg_for__empty', () => {
|
18
|
-
expectCode(createTypeInterface(cosmos_msg_for__empty));
|
19
|
-
});
|
20
|
-
it('execute_msg_for__empty', () => {
|
21
|
-
expectCode(createTypeInterface(execute_msg_for__empty));
|
22
|
-
});
|
23
|
-
it('can_execute_relay_response', () => {
|
24
|
-
expectCode(createTypeInterface(can_execute_relay_response));
|
25
|
-
});
|
26
|
-
it('info_response', () => {
|
27
|
-
expectCode(createTypeInterface(info_response));
|
28
|
-
});
|
29
|
-
it('relay_transaction', () => {
|
30
|
-
expectCode(createTypeInterface(relay_transaction));
|
31
|
-
});
|
32
|
-
it('query classes', () => {
|
33
|
-
expectCode(createQueryClass('SG721QueryClient', 'SG721ReadOnlyInstance', cosmos_msg_for__empty));
|
34
|
-
});
|
35
|
-
it('query classes', () => {
|
36
|
-
expectCode(createQueryClass('SG721QueryClient', 'SG721ReadOnlyInstance', execute_msg_for__empty));
|
37
|
-
});
|
38
|
-
it('execute classes array types', () => {
|
39
|
-
expectCode(createExecuteClass('SG721Client', 'SG721Instance', null, execute_msg_for__empty));
|
40
|
-
});
|
41
|
-
it('execute interfaces no extends', () => {
|
42
|
-
expectCode(createExecuteInterface('SG721Instance', null, execute_msg_for__empty));
|
43
|
-
});
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import * as t from '@babel/types';
|
2
|
-
import { Enum, Field, Interface, MessageSchema } from '../types';
|
3
|
-
export declare const makeAminoConverterItem: (schema: MessageSchema, enums: Enum[], interfaces: Interface[]) => t.ObjectProperty;
|
4
|
-
export declare const aminoConverter: (schemas: MessageSchema[], enums: Enum[], interfaces: Interface[]) => t.ExportNamedDeclaration;
|
5
|
-
export declare const renderAminoField: (field: Field, enums: Enum[], interfaces?: any[], imports?: any[]) => any;
|
6
|
-
export declare const makeAminoTypeInterface: (schema: MessageSchema, enums: Enum[], interfaces?: any[], imports?: any[]) => t.ExportNamedDeclaration;
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import * as t from '@babel/types';
|
2
|
-
import { Enum, Field, Interface, MessageSchema } from '../types';
|
3
|
-
export declare const fromAminoStringToLong: (prop: string, scope: string[]) => t.ObjectProperty;
|
4
|
-
export declare const fromAminoFromArrayCall: (prop: string, scope: string[]) => t.ObjectProperty;
|
5
|
-
export declare const fromAminoSnakeToCamel: (prop: string, scope: string[]) => t.ObjectProperty;
|
6
|
-
export declare const fromAminoHeight: (prop: string, scope: string[]) => t.ObjectProperty;
|
7
|
-
export declare const fromAminoDuration: (prop: string, scope: string[]) => t.ObjectProperty;
|
8
|
-
export declare const fromAminoEnum: (val: Enum, field: Field, scope: string[]) => t.ObjectProperty;
|
9
|
-
export declare const fromAminoEnumArray: (val: Enum, field: Field, scope: string[]) => t.ObjectProperty;
|
10
|
-
export declare const fromAminoInterface: (field: Field, ival: Interface, enums: Enum[], interfaces: Interface[], scope: string[], nested: number) => any;
|
11
|
-
export declare const fromAminoInterfaceArray: (field: Field, ival: Interface, enums: Enum[], interfaces: Interface[], scope: string[], nested: number) => t.ObjectProperty;
|
12
|
-
export declare const fromAminoParseField: (field: Field, enums: Enum[], interfaces: Interface[], scope?: any[], nested?: number) => any;
|
13
|
-
export declare const fromAmino: (schema: MessageSchema, enums: Enum[], interfaces: Interface[]) => t.ArrowFunctionExpression;
|
package/types/amino/index.d.ts
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
import * as t from '@babel/types';
|
2
|
-
import { Enum, Field, Interface, MessageSchema } from '../types';
|
3
|
-
export declare const toAminoDuration: (prop: string, scope: string[]) => t.ObjectProperty;
|
4
|
-
export declare const toAminoSnakeToCamel: (prop: string, scope: string[]) => t.ObjectProperty;
|
5
|
-
export declare const toAminoInterface: (field: Field, ival: Interface, enums: Enum[], interfaces: Interface[], scope: string[], nested: number) => any;
|
6
|
-
export declare const toAminoInterfaceArray: (field: Field, ival: Interface, enums: Enum[], interfaces: Interface[], scope: string[], nested: number) => t.ObjectProperty;
|
7
|
-
export declare const toAminoLongToString: (prop: string, scope: string[]) => t.ObjectProperty;
|
8
|
-
export declare const toAminoCoin: (prop: string, scope: string[]) => t.ObjectProperty;
|
9
|
-
export declare const toAminoHeight: (prop: string, scope: string[]) => t.ObjectProperty;
|
10
|
-
export declare const toAminoParseField: (field: Field, enums: Enum[], interfaces: Interface[], scope?: any[], nested?: number) => any;
|
11
|
-
export declare const toAmino: (schema: MessageSchema, enums: Enum[], interfaces: Interface[]) => t.ArrowFunctionExpression;
|
package/types/index.d.ts
DELETED
package/types/messages.d.ts
DELETED
@@ -1,4 +0,0 @@
|
|
1
|
-
import * as t from '@babel/types';
|
2
|
-
import { ExecuteMsg } from './types';
|
3
|
-
export declare const createFromPartialClass: (className: string, implementsClassName: string, execMsg: ExecuteMsg) => t.ExportNamedDeclaration;
|
4
|
-
export declare const createFromPartialInterface: (className: string, execMsg: ExecuteMsg) => t.ExportNamedDeclaration;
|
package/types/react-query.d.ts
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
import * as t from '@babel/types';
|
2
|
-
import { QueryMsg, ExecuteMsg } from './types';
|
3
|
-
|
4
|
-
interface ReactQueryHooks {
|
5
|
-
queryMsg: QueryMsg
|
6
|
-
contractName: string
|
7
|
-
QueryClient: string
|
8
|
-
options?: ReactQueryOptions
|
9
|
-
}
|
10
|
-
interface ReactQueryHookQuery {
|
11
|
-
hookName: string;
|
12
|
-
hookParamsTypeName: string;
|
13
|
-
hookKeyName: string;
|
14
|
-
responseType: string;
|
15
|
-
methodName: string;
|
16
|
-
jsonschema: any;
|
17
|
-
}
|
18
|
-
|
19
|
-
export declare interface ReactQueryOptions {
|
20
|
-
optionalClient?: boolean
|
21
|
-
v4?: boolean
|
22
|
-
mutations?: boolean
|
23
|
-
}
|
24
|
-
export declare const createReactQueryHooks: ({ queryMsg, contractName, QueryClient, options }: ReactQueryHooks) => any;
|
25
|
-
export declare const createReactQueryHook: ({ hookName, hookParamsTypeName, responseType, hookKeyName, methodName, jsonschema }: ReactQueryHookQuery) => t.ExportNamedDeclaration;
|
26
|
-
interface ReactQueryHookQueryInterface {
|
27
|
-
QueryClient: string;
|
28
|
-
hookParamsTypeName: string;
|
29
|
-
responseType: string;
|
30
|
-
jsonschema: any;
|
31
|
-
}
|
32
|
-
export declare const createReactQueryHookInterface: ({ QueryClient, hookParamsTypeName, responseType, jsonschema }: ReactQueryHookQueryInterface) => t.ExportNamedDeclaration;
|
33
|
-
|
34
|
-
interface ReactQueryMutationHooks {
|
35
|
-
execMsg: ExecuteMsg
|
36
|
-
contractName: string
|
37
|
-
ExecuteClient: string
|
38
|
-
options?: ReactQueryOptions
|
39
|
-
}
|
40
|
-
export declare const createReactQueryMutationHooks: ({ execMsg, contractName, ExecuteClient, options }: ReactQueryMutationHooks) => any
|
41
|
-
|
42
|
-
interface ReactQueryMutationHook {
|
43
|
-
mutationHookName: string;
|
44
|
-
mutationHookParamsTypeName: string;
|
45
|
-
execMethodName: string;
|
46
|
-
execArgs: t.ObjectProperty[]
|
47
|
-
options?: ReactQueryOptions
|
48
|
-
}
|
49
|
-
|
50
|
-
export declare const createReactQueryMutationHook: ({
|
51
|
-
mutationHookName,
|
52
|
-
mutationHookParamsTypeName,
|
53
|
-
execMethodName,
|
54
|
-
execArgs,
|
55
|
-
options,
|
56
|
-
}: ReactQueryMutationHook) => any
|
57
|
-
|
58
|
-
interface ReactQueryMutationHookInterface {
|
59
|
-
ExecuteClient: string
|
60
|
-
mutationHookParamsTypeName: string;
|
61
|
-
jsonschema: any
|
62
|
-
}
|
63
|
-
|
64
|
-
export declare const createReactQueryMutationArgsInterface: ({
|
65
|
-
ExecuteClient,
|
66
|
-
mutationHookParamsTypeName,
|
67
|
-
jsonschema
|
68
|
-
}: ReactQueryMutationHookInterface) => t.ExportNamedDeclaration;
|
69
|
-
|
70
|
-
export { };
|
package/types/wasm.d.ts
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
import * as t from '@babel/types';
|
2
|
-
import { QueryMsg, ExecuteMsg } from './types';
|
3
|
-
export declare const identifier: (name: string, typeAnnotation: t.TSTypeAnnotation, optional?: boolean) => t.Identifier;
|
4
|
-
export declare const getPropertyType: (schema: any, prop: any) => {
|
5
|
-
type: any;
|
6
|
-
optional: any;
|
7
|
-
};
|
8
|
-
export declare const createWasmQueryMethod: (jsonschema: any) => t.ClassProperty;
|
9
|
-
export declare const createQueryClass: (className: string, implementsClassName: string, queryMsg: QueryMsg) => t.ExportNamedDeclaration;
|
10
|
-
export declare const createWasmExecMethod: (jsonschema: any) => t.ClassProperty;
|
11
|
-
export declare const createExecuteClass: (className: string, implementsClassName: string, extendsClassName: string, execMsg: ExecuteMsg) => t.ExportNamedDeclaration;
|
12
|
-
export declare const createExecuteInterface: (className: string, extendsClassName: string | null, execMsg: ExecuteMsg) => t.ExportNamedDeclaration;
|
13
|
-
export declare const propertySignature: (name: string, typeAnnotation: t.TSTypeAnnotation, optional?: boolean) => {
|
14
|
-
type: string;
|
15
|
-
key: t.Identifier;
|
16
|
-
typeAnnotation: t.TSTypeAnnotation;
|
17
|
-
optional: boolean;
|
18
|
-
};
|
19
|
-
export declare const createTypedObjectParams: (jsonschema: any, camelize?: boolean) => t.ObjectPattern;
|
20
|
-
export declare const createPropertyFunctionWithObjectParams: (methodName: string, responseType: string, jsonschema: any) => t.TSPropertySignature;
|
21
|
-
export declare const createPropertyFunctionWithObjectParamsForExec: (methodName: string, responseType: string, jsonschema: any) => t.TSPropertySignature;
|
22
|
-
export declare const createQueryInterface: (className: string, queryMsg: QueryMsg) => t.ExportNamedDeclaration;
|
23
|
-
export declare const createTypeOrInterface: (Type: string, jsonschema: any) => t.ExportNamedDeclaration;
|
24
|
-
export declare const createTypeInterface: (jsonschema: any) => t.ExportNamedDeclaration;
|