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.
Files changed (39) hide show
  1. package/main/client/client.js +4 -6
  2. package/main/context/imports.js +1 -1
  3. package/main/message-composer/message-composer.js +3 -5
  4. package/main/react-query/react-query.js +4 -11
  5. package/main/utils/babel.js +1 -0
  6. package/main/utils/constants.js +25 -0
  7. package/main/utils/index.js +22 -1
  8. package/module/client/client.js +3 -4
  9. package/module/context/imports.js +1 -1
  10. package/module/message-composer/message-composer.js +4 -5
  11. package/module/react-query/react-query.js +5 -6
  12. package/module/utils/babel.js +1 -0
  13. package/module/utils/constants.js +6 -0
  14. package/module/utils/index.js +3 -1
  15. package/package.json +2 -2
  16. package/src/client/client.ts +235 -323
  17. package/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap +45 -45
  18. package/src/client/test/__snapshots__/ts-client.arrays-ref.spec.ts.snap +42 -42
  19. package/src/client/test/__snapshots__/ts-client.arrays.spec.ts.snap +3 -3
  20. package/src/client/test/__snapshots__/ts-client.cw-named-groups.test.ts.snap +9 -9
  21. package/src/client/test/__snapshots__/ts-client.cw-proposal-single.test.ts.snap +27 -27
  22. package/src/client/test/__snapshots__/ts-client.issue-101.spec.ts.snap +6 -6
  23. package/src/client/test/__snapshots__/ts-client.issue-71.test.ts.snap +30 -30
  24. package/src/client/test/__snapshots__/ts-client.issue-98.test.ts.snap +9 -9
  25. package/src/client/test/__snapshots__/ts-client.issues.test.ts.snap +78 -78
  26. package/src/client/test/__snapshots__/ts-client.overrides.spec.ts.snap +80 -80
  27. package/src/client/test/__snapshots__/ts-client.sg721.spec.ts.snap +24 -24
  28. package/src/client/test/__snapshots__/ts-client.spec.ts.snap +46 -46
  29. package/src/client/test/__snapshots__/ts-client.vectis.spec.ts.snap +24 -24
  30. package/src/client/test/__snapshots__/ts-client.wager.spec.ts.snap +8 -8
  31. package/src/context/context.ts +2 -0
  32. package/src/context/imports.ts +1 -1
  33. package/src/message-composer/__snapshots__/message-composer.spec.ts.snap +30 -30
  34. package/src/message-composer/message-composer.ts +216 -267
  35. package/src/react-query/react-query.ts +28 -25
  36. package/src/utils/babel.ts +4 -3
  37. package/src/utils/constants.ts +30 -0
  38. package/src/utils/index.ts +2 -0
  39. package/types/context/context.d.ts +2 -0
@@ -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: t.TSTypeAnnotation,
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
+ ];
@@ -1,3 +1,5 @@
1
1
  export * from './babel';
2
2
  export * from './types';
3
3
  export * from './ref';
4
+ export { OPTIONAL_FUNDS_PARAM } from './constants';
5
+ export { FIXED_EXECUTE_PARAMS } from './constants';
@@ -25,7 +25,9 @@ export interface RecoilOptions {
25
25
  }
26
26
  export interface TSTypesOptions {
27
27
  enabled?: boolean;
28
+ // deprecated
28
29
  aliasExecuteMsg?: boolean;
30
+ aliasEntryPoints?: boolean;
29
31
  }
30
32
  interface KeyedSchema {
31
33
  [key: string]: JSONSchema;