wasm-ast-types 0.21.0 → 0.23.0
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/main/client/client.js +4 -6
- package/main/context/imports.js +1 -1
- package/main/message-composer/message-composer.js +3 -5
- package/main/react-query/react-query.js +4 -11
- package/main/utils/babel.js +1 -0
- package/main/utils/constants.js +25 -0
- package/main/utils/index.js +22 -1
- package/module/client/client.js +3 -4
- package/module/context/imports.js +1 -1
- package/module/message-composer/message-composer.js +4 -5
- package/module/react-query/react-query.js +5 -6
- package/module/utils/babel.js +1 -0
- package/module/utils/constants.js +6 -0
- package/module/utils/index.js +3 -1
- package/package.json +2 -2
- package/src/client/client.ts +235 -323
- package/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap +45 -45
- package/src/client/test/__snapshots__/ts-client.arrays-ref.spec.ts.snap +42 -42
- package/src/client/test/__snapshots__/ts-client.arrays.spec.ts.snap +3 -3
- package/src/client/test/__snapshots__/ts-client.cw-named-groups.test.ts.snap +9 -9
- package/src/client/test/__snapshots__/ts-client.cw-proposal-single.test.ts.snap +27 -27
- package/src/client/test/__snapshots__/ts-client.issue-101.spec.ts.snap +6 -6
- package/src/client/test/__snapshots__/ts-client.issue-71.test.ts.snap +30 -30
- package/src/client/test/__snapshots__/ts-client.issue-98.test.ts.snap +9 -9
- package/src/client/test/__snapshots__/ts-client.issues.test.ts.snap +78 -78
- package/src/client/test/__snapshots__/ts-client.overrides.spec.ts.snap +80 -80
- package/src/client/test/__snapshots__/ts-client.sg721.spec.ts.snap +24 -24
- package/src/client/test/__snapshots__/ts-client.spec.ts.snap +46 -46
- package/src/client/test/__snapshots__/ts-client.vectis.spec.ts.snap +24 -24
- package/src/client/test/__snapshots__/ts-client.wager.spec.ts.snap +8 -8
- package/src/context/context.ts +2 -0
- package/src/context/imports.ts +1 -1
- package/src/message-composer/__snapshots__/message-composer.spec.ts.snap +30 -30
- package/src/message-composer/message-composer.ts +216 -267
- package/src/react-query/react-query.ts +28 -25
- package/src/utils/babel.ts +4 -3
- package/src/utils/constants.ts +30 -0
- package/src/utils/index.ts +2 -0
- package/types/context/context.d.ts +2 -0
package/src/utils/babel.ts
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
import * as t from '@babel/types';
|
2
2
|
import { snake } from "case";
|
3
3
|
import { Field, QueryMsg, ExecuteMsg } from '../types';
|
4
|
-
import { TSTypeAnnotation, TSExpressionWithTypeArguments } from '@babel/types';
|
4
|
+
import { TSTypeAnnotation, TSExpressionWithTypeArguments, Noop, TypeAnnotation } from '@babel/types';
|
5
5
|
import { refLookup } from './ref';
|
6
6
|
|
7
7
|
// t.TSPropertySignature - kind?
|
8
8
|
export const propertySignature = (
|
9
9
|
name: string,
|
10
|
-
typeAnnotation:
|
10
|
+
typeAnnotation: TSTypeAnnotation,
|
11
11
|
optional: boolean = false
|
12
|
-
) => {
|
12
|
+
): t.TSPropertySignature => {
|
13
13
|
return {
|
14
14
|
type: 'TSPropertySignature',
|
15
15
|
key: t.identifier(name),
|
16
|
+
kind: 'get',
|
16
17
|
typeAnnotation,
|
17
18
|
optional
|
18
19
|
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { identifier } from './babel';
|
2
|
+
import * as t from '@babel/types';
|
3
|
+
|
4
|
+
export const OPTIONAL_FUNDS_PARAM = identifier(
|
5
|
+
'_funds',
|
6
|
+
t.tsTypeAnnotation(t.tsArrayType(t.tsTypeReference(t.identifier('Coin')))),
|
7
|
+
true
|
8
|
+
);
|
9
|
+
export const OPTIONAL_FEE_PARAM = identifier(
|
10
|
+
'fee',
|
11
|
+
t.tsTypeAnnotation(
|
12
|
+
t.tsUnionType([
|
13
|
+
t.tsNumberKeyword(),
|
14
|
+
t.tsTypeReference(t.identifier('StdFee')),
|
15
|
+
t.tsLiteralType(t.stringLiteral('auto'))
|
16
|
+
])
|
17
|
+
),
|
18
|
+
true
|
19
|
+
);
|
20
|
+
export const OPTIONAL_MEMO_PARAM = identifier(
|
21
|
+
'memo',
|
22
|
+
t.tsTypeAnnotation(t.tsStringKeyword()),
|
23
|
+
true
|
24
|
+
);
|
25
|
+
|
26
|
+
export const FIXED_EXECUTE_PARAMS = [
|
27
|
+
OPTIONAL_FEE_PARAM,
|
28
|
+
OPTIONAL_MEMO_PARAM,
|
29
|
+
OPTIONAL_FUNDS_PARAM
|
30
|
+
];
|
package/src/utils/index.ts
CHANGED