From d14e6a7ed50d03d7f470182de0b8ce7f1c5a702c Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Mon, 22 Aug 2022 11:10:12 +0200 Subject: [PATCH 001/287] Inital version of react query keys --- .../Factory.react-query.ts | 126 +++++++++ .../factory-query-keys/Factory.react-query.ts | 114 ++++++++ .../ts-codegen/__tests__/ts-codegen.test.ts | 15 + packages/ts-codegen/src/commands/generate.ts | 13 +- .../wasm-ast-types/src/context/context.ts | 6 +- .../src/react-query/react-query.ts | 264 +++++++++++++++--- .../wasm-ast-types/types/context/context.d.ts | 1 + 7 files changed, 489 insertions(+), 50 deletions(-) create mode 100644 __output__/vectis/factory-query-keys-optional-client/Factory.react-query.ts create mode 100644 __output__/vectis/factory-query-keys/Factory.react-query.ts diff --git a/__output__/vectis/factory-query-keys-optional-client/Factory.react-query.ts b/__output__/vectis/factory-query-keys-optional-client/Factory.react-query.ts new file mode 100644 index 00000000..4b292ea0 --- /dev/null +++ b/__output__/vectis/factory-query-keys-optional-client/Factory.react-query.ts @@ -0,0 +1,126 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions, useQuery } from "react-query"; +import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; +import { FactoryQueryClient } from "./Factory.client"; +export const factoryQueryKeys = { + contract: ([{ + contract: "factory" + }] as const), + address: (contractAddress: string | undefined) => ([{ ...factoryQueryKeys.contract[0], + address: contractAddress + }] as const), + wallets: (contractAddress: string | undefined, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + method: "wallets", + args + }] as const), + walletsOf: (contractAddress: string | undefined, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + method: "wallets_of", + args + }] as const), + codeId: (contractAddress: string | undefined, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + method: "code_id", + args + }] as const), + fee: (contractAddress: string | undefined, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + method: "fee", + args + }] as const), + govecAddr: (contractAddress: string | undefined, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + method: "govec_addr", + args + }] as const), + adminAddr: (contractAddress: string | undefined, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + method: "admin_addr", + args + }] as const) +}; +export interface FactoryReactQuery { + client: FactoryQueryClient | undefined; + options?: UseQueryOptions; +} +export interface FactoryAdminAddrQuery extends FactoryReactQuery {} +export function useFactoryAdminAddrQuery({ + client, + options +}: FactoryAdminAddrQuery) { + return useQuery(["factoryAdminAddr", client?.contractAddress], () => client ? client.adminAddr() : Promise.reject(new Error("Invalid client")), { ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }); +} +export interface FactoryGovecAddrQuery extends FactoryReactQuery {} +export function useFactoryGovecAddrQuery({ + client, + options +}: FactoryGovecAddrQuery) { + return useQuery(["factoryGovecAddr", client?.contractAddress], () => client ? client.govecAddr() : Promise.reject(new Error("Invalid client")), { ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }); +} +export interface FactoryFeeQuery extends FactoryReactQuery {} +export function useFactoryFeeQuery({ + client, + options +}: FactoryFeeQuery) { + return useQuery(["factoryFee", client?.contractAddress], () => client ? client.fee() : Promise.reject(new Error("Invalid client")), { ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }); +} +export interface FactoryCodeIdQuery extends FactoryReactQuery { + args: { + ty: CodeIdType; + }; +} +export function useFactoryCodeIdQuery({ + client, + args, + options +}: FactoryCodeIdQuery) { + return useQuery(["factoryCodeId", client?.contractAddress, JSON.stringify(args)], () => client ? client.codeId({ + ty: args.ty + }) : Promise.reject(new Error("Invalid client")), { ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }); +} +export interface FactoryWalletsOfQuery extends FactoryReactQuery { + args: { + limit?: number; + startAfter?: string; + user: string; + }; +} +export function useFactoryWalletsOfQuery({ + client, + args, + options +}: FactoryWalletsOfQuery) { + return useQuery(["factoryWalletsOf", client?.contractAddress, JSON.stringify(args)], () => client ? client.walletsOf({ + limit: args.limit, + startAfter: args.startAfter, + user: args.user + }) : Promise.reject(new Error("Invalid client")), { ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }); +} +export interface FactoryWalletsQuery extends FactoryReactQuery { + args: { + limit?: number; + startAfter?: WalletQueryPrefix; + }; +} +export function useFactoryWalletsQuery({ + client, + args, + options +}: FactoryWalletsQuery) { + return useQuery(["factoryWallets", client?.contractAddress, JSON.stringify(args)], () => client ? client.wallets({ + limit: args.limit, + startAfter: args.startAfter + }) : Promise.reject(new Error("Invalid client")), { ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }); +} \ No newline at end of file diff --git a/__output__/vectis/factory-query-keys/Factory.react-query.ts b/__output__/vectis/factory-query-keys/Factory.react-query.ts new file mode 100644 index 00000000..41c30fb5 --- /dev/null +++ b/__output__/vectis/factory-query-keys/Factory.react-query.ts @@ -0,0 +1,114 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions, useQuery } from "react-query"; +import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; +import { FactoryQueryClient } from "./Factory.client"; +export const factoryQueryKeys = { + contract: ([{ + contract: "factory" + }] as const), + address: (contractAddress: string) => ([{ ...factoryQueryKeys.contract[0], + address: contractAddress + }] as const), + wallets: (contractAddress: string, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + method: "wallets", + args + }] as const), + walletsOf: (contractAddress: string, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + method: "wallets_of", + args + }] as const), + codeId: (contractAddress: string, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + method: "code_id", + args + }] as const), + fee: (contractAddress: string, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + method: "fee", + args + }] as const), + govecAddr: (contractAddress: string, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + method: "govec_addr", + args + }] as const), + adminAddr: (contractAddress: string, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + method: "admin_addr", + args + }] as const) +}; +export interface FactoryReactQuery { + client: FactoryQueryClient; + options?: UseQueryOptions; +} +export interface FactoryAdminAddrQuery extends FactoryReactQuery {} +export function useFactoryAdminAddrQuery({ + client, + options +}: FactoryAdminAddrQuery) { + return useQuery(["factoryAdminAddr", client.contractAddress], () => client.adminAddr(), options); +} +export interface FactoryGovecAddrQuery extends FactoryReactQuery {} +export function useFactoryGovecAddrQuery({ + client, + options +}: FactoryGovecAddrQuery) { + return useQuery(["factoryGovecAddr", client.contractAddress], () => client.govecAddr(), options); +} +export interface FactoryFeeQuery extends FactoryReactQuery {} +export function useFactoryFeeQuery({ + client, + options +}: FactoryFeeQuery) { + return useQuery(["factoryFee", client.contractAddress], () => client.fee(), options); +} +export interface FactoryCodeIdQuery extends FactoryReactQuery { + args: { + ty: CodeIdType; + }; +} +export function useFactoryCodeIdQuery({ + client, + args, + options +}: FactoryCodeIdQuery) { + return useQuery(["factoryCodeId", client.contractAddress, JSON.stringify(args)], () => client.codeId({ + ty: args.ty + }), options); +} +export interface FactoryWalletsOfQuery extends FactoryReactQuery { + args: { + limit?: number; + startAfter?: string; + user: string; + }; +} +export function useFactoryWalletsOfQuery({ + client, + args, + options +}: FactoryWalletsOfQuery) { + return useQuery(["factoryWalletsOf", client.contractAddress, JSON.stringify(args)], () => client.walletsOf({ + limit: args.limit, + startAfter: args.startAfter, + user: args.user + }), options); +} +export interface FactoryWalletsQuery extends FactoryReactQuery { + args: { + limit?: number; + startAfter?: WalletQueryPrefix; + }; +} +export function useFactoryWalletsQuery({ + client, + args, + options +}: FactoryWalletsQuery) { + return useQuery(["factoryWallets", client.contractAddress, JSON.stringify(args)], () => client.wallets({ + limit: args.limit, + startAfter: args.startAfter + }), options); +} \ No newline at end of file diff --git a/packages/ts-codegen/__tests__/ts-codegen.test.ts b/packages/ts-codegen/__tests__/ts-codegen.test.ts index d2874bde..6977bd3d 100644 --- a/packages/ts-codegen/__tests__/ts-codegen.test.ts +++ b/packages/ts-codegen/__tests__/ts-codegen.test.ts @@ -22,6 +22,21 @@ it('v4Query', async () => { await generateReactQuery('Factory', schemas, outopt, { version: 'v4' }); }) +it('queryKeys', async () => { + const outopt = OUTPUT_DIR + '/vectis/factory-query-keys'; + const schemaDir = FIXTURE_DIR + '/vectis/factory/'; + const schemas = await readSchemas({ schemaDir, schemaOptions: {} }); + await generateReactQuery('Factory', schemas, outopt, { queryKeys: true }); +}) + + +it('queryKeysOptionalClient', async () => { + const outopt = OUTPUT_DIR + '/vectis/factory-query-keys-optional-client'; + const schemaDir = FIXTURE_DIR + '/vectis/factory/'; + const schemas = await readSchemas({ schemaDir, schemaOptions: {} }); + await generateReactQuery('Factory', schemas, outopt, { queryKeys: true, optionalClient: true }); +}) + it('useMutations', async () => { const outopt = OUTPUT_DIR + '/vectis/factory-w-mutations'; const schemaDir = FIXTURE_DIR + '/vectis/factory/'; diff --git a/packages/ts-codegen/src/commands/generate.ts b/packages/ts-codegen/src/commands/generate.ts index 15f79484..c7343bc7 100644 --- a/packages/ts-codegen/src/commands/generate.ts +++ b/packages/ts-codegen/src/commands/generate.ts @@ -65,10 +65,16 @@ export default async (argv) => { message: 'which react-query version?', default: 'v3', choices: ['v3', 'v4'] - } + }, + { + type: 'confirm', + name: 'queryKeys', + message: 'queryKeys?', + default: false + }, ]) }; - const { optionalClient, version } = await prompt(questions2, argv); + const { optionalClient, version, queryKeys } = await prompt(questions2, argv); const questions3 = []; if (version === 'v4') { [].push.apply(questions3, [ @@ -120,6 +126,7 @@ export default async (argv) => { reactQuery: { enabled: plugin.includes('react-query'), optionalClient, + queryKeys, version, mutations }, @@ -146,4 +153,4 @@ export default async (argv) => { outPath: out, options }) -}; \ No newline at end of file +}; diff --git a/packages/wasm-ast-types/src/context/context.ts b/packages/wasm-ast-types/src/context/context.ts index ac6b270a..6d81dd74 100644 --- a/packages/wasm-ast-types/src/context/context.ts +++ b/packages/wasm-ast-types/src/context/context.ts @@ -9,6 +9,7 @@ export interface ReactQueryOptions { version?: 'v3' | 'v4'; mutations?: boolean; camelize?: boolean; + queryKeys?: boolean } export interface TSClientOptions { @@ -58,7 +59,8 @@ export const defaultOptions: RenderOptions = { optionalClient: false, version: 'v3', mutations: false, - camelize: true + camelize: true, + queryKeys: false } }; @@ -87,4 +89,4 @@ export class RenderContext implements RenderContext { ) ); } -} \ No newline at end of file +} diff --git a/packages/wasm-ast-types/src/react-query/react-query.ts b/packages/wasm-ast-types/src/react-query/react-query.ts index 22981e73..548b8fea 100644 --- a/packages/wasm-ast-types/src/react-query/react-query.ts +++ b/packages/wasm-ast-types/src/react-query/react-query.ts @@ -11,15 +11,17 @@ import { typeRefOrUnionWithUndefined } from '../utils/babel'; import { getParamsTypeAnnotation, getPropertyType } from '../utils/types'; -import { RenderContext } from '../context'; +import { ReactQueryOptions, RenderContext } from '../context'; import { JSONSchema } from '../types'; import { FIXED_EXECUTE_PARAMS } from '../client'; +import { ArgumentPlaceholder, JSXNamespacedName, SpreadElement } from '@babel/types'; interface ReactQueryHookQuery { context: RenderContext, hookName: string; hookParamsTypeName: string; hookKeyName: string; + queryKeysName: string responseType: string; methodName: string; jsonschema: any; @@ -40,23 +42,42 @@ export const createReactQueryHooks = ({ }: ReactQueryHooks) => { const options = context.options.reactQuery; - const genericQueryInterfaceName = `${pascal(contractName)}ReactQuery`; + const genericQueryInterfaceName = `${pascal(contractName)}ReactQuery`; + const underscoreNames: string[] = getMessageProperties(queryMsg).map((schema) => (Object.keys(schema.properties)[0])) - const body = [ - createReactQueryHookGenericInterface({ - context, - QueryClient, - genericQueryInterfaceName, - }) - ] + const body = [] + + const queryKeysName = `${camel(contractName)}QueryKeys` + if (options.queryKeys) { + body.push( + createReactQueryKeys({ + context, + queryKeysName, + camelContractName: camel(contractName), + underscoreNames, + })) + } + + body.push( + createReactQueryHookGenericInterface({ + context, + QueryClient, + genericQueryInterfaceName, + })) body.push(...getMessageProperties(queryMsg) .reduce((m, schema) => { + // list_voters const underscoreName = Object.keys(schema.properties)[0]; + // listVoters const methodName = camel(underscoreName); + // Cw3FlexMultisigListVotersQuery const hookParamsTypeName = `${pascal(contractName)}${pascal(methodName)}Query`; + // useCw3FlexMultisigListVotersQuery const hookName = `use${hookParamsTypeName}`; + // listVotersResponse const responseType = pascal(`${methodName}Response`); + // cw3FlexMultisigListVoters const getterKey = camel(`${contractName}${pascal(methodName)}`); const jsonschema = schema.properties[underscoreName]; return [ @@ -73,6 +94,7 @@ export const createReactQueryHooks = ({ methodName, hookName, hookParamsTypeName, + queryKeysName, responseType, hookKeyName: getterKey, jsonschema @@ -92,6 +114,7 @@ export const createReactQueryHook = ({ hookParamsTypeName, responseType, hookKeyName, + queryKeysName, methodName, jsonschema }: ReactQueryHookQuery) => { @@ -150,9 +173,7 @@ export const createReactQueryHook = ({ callExpression( t.identifier('useQuery'), [ - t.arrayExpression( - generateUseQueryQueryKey(hookKeyName, props, options.optionalClient) - ), + generateUseQueryQueryKey({hookKeyName, queryKeysName, methodName, props, options }), t.arrowFunctionExpression( [], optionalConditionalExpression( @@ -226,16 +247,6 @@ export const createReactQueryHook = ({ ), t.tsTypeReference( t.identifier(responseType) - ), - t.tsArrayType( - t.tsParenthesizedType( - t.tsUnionType( - [ - t.tsStringKeyword(), - t.tsUndefinedKeyword() - ] - ) - ) ) ] ) @@ -521,6 +532,145 @@ export const createReactQueryMutationHook = ({ }; +function createReactQueryKeys({ + context, + queryKeysName, + camelContractName, + underscoreNames +}: { + context: RenderContext; + queryKeysName: string, + camelContractName: string; + underscoreNames: string[]; +}) { + const options = context.options.reactQuery + + const contractAddressTypeAnnotation = t.tsTypeAnnotation( + options.optionalClient + ? t.tsUnionType([ + t.tsStringKeyword(), + t.tsUndefinedKeyword() + ]) + : t.tSStringKeyword() + ) + + return t.exportNamedDeclaration( + t.variableDeclaration('const', [ + t.variableDeclarator( + t.identifier(queryKeysName), + t.objectExpression([ + // 1: contract + t.objectProperty( + t.identifier('contract'), + t.tSAsExpression( + t.arrayExpression([ + t.objectExpression([ + t.objectProperty( + t.identifier('contract'), + t.stringLiteral(camelContractName) + ) + ]) + ]), + t.tSTypeReference(t.identifier('const')) + ) + ), + // 2: address + t.objectProperty( + t.identifier('address'), + t.arrowFunctionExpression( + [ + identifier( + 'contractAddress', + contractAddressTypeAnnotation + ) + ], + t.tSAsExpression( + t.arrayExpression([ + t.objectExpression([ + // 1 + t.spreadElement( + t.memberExpression( + t.memberExpression( + t.identifier(queryKeysName), + t.identifier('contract') + ), + t.numericLiteral(0), + true // computed + ) + ), + t.objectProperty( + t.identifier('address'), + t.identifier('contractAddress') + ) + ]) + ]), + t.tSTypeReference(t.identifier('const')) + ) + ) + ), + // 3: methods + ...underscoreNames.map((underscoreMethodName) => + t.objectProperty( + // key id is the camel method name + t.identifier(camel(underscoreMethodName)), + t.arrowFunctionExpression( + [ + identifier( + 'contractAddress', + contractAddressTypeAnnotation + ), + identifier( + 'args', + // Record + t.tSTypeAnnotation( + t.tsTypeReference( + t.identifier('Record'), + t.tsTypeParameterInstantiation([ + t.tsStringKeyword(), + t.tsUnknownKeyword() + ]) + ) + ), + true // optional + ) + ], + t.tSAsExpression( + t.arrayExpression([ + t.objectExpression([ + //...cw3FlexMultisigQueryKeys.address(contractAddress)[0] + t.spreadElement( + t.memberExpression( + t.callExpression( + t.memberExpression( + t.identifier(queryKeysName), + t.identifier('address') + ), + [t.identifier('contractAddress')] + ), + t.numericLiteral(0), + true // computed + ) + ), + // method: list_voters + t.objectProperty( + t.identifier('method'), + t.stringLiteral(underscoreMethodName) + ), + // args + shorthandProperty('args') + ]) + ]), + t.tSTypeReference(t.identifier('const')) + ) + ) + ) + ) + ]) + ) + ]) + ) +} + interface ReactQueryHookGenericInterface { context: RenderContext, QueryClient: string, @@ -548,15 +698,7 @@ function createReactQueryHookGenericInterface({ t.tsTypeReference(t.identifier('Error')), t.tsTypeReference( t.identifier(genericTypeName) - ), - t.tsArrayType( - t.tsParenthesizedType( - t.tsUnionType([ - t.tsStringKeyword(), - t.tsUndefinedKeyword() - ]) - ) - ), + ) ]) ) @@ -682,22 +824,54 @@ const getProps = ( }); } -const generateUseQueryQueryKey = ( - hookKeyName: string, - props: string[], - optionalClient: boolean -): Array => { +interface GenerateUseQueryQueryKeyParams { + hookKeyName: string; + queryKeysName: string; + methodName: string; + props: string[]; + options: ReactQueryOptions; +} + +const generateUseQueryQueryKey = ({ + hookKeyName, + queryKeysName, + methodName, + props, + options, + }: GenerateUseQueryQueryKeyParams): t.ArrayExpression | t.CallExpression => { + const { optionalClient, queryKeys } = options + + const hasArgs = props.includes('args') + + const contractAddressExpression = + t.optionalMemberExpression( + t.identifier('client'), + t.identifier('contractAddress'), + false, + optionalClient + ) + + if (queryKeys) { + + const callArgs: Array = [contractAddressExpression] + + if (hasArgs) callArgs.push(t.identifier('args')) + + return t.callExpression( + t.memberExpression( + t.identifier(queryKeysName), + t.identifier(camel(methodName)) + ), + callArgs + ) + } + const queryKey: Array = [ - t.stringLiteral(hookKeyName), - t.optionalMemberExpression( - t.identifier('client'), - t.identifier('contractAddress'), - false, - optionalClient - ) + t.stringLiteral(hookKeyName), + contractAddressExpression ]; - if (props.includes('args')) { + if (hasArgs) { queryKey.push(t.callExpression( t.memberExpression( t.identifier('JSON'), @@ -708,5 +882,5 @@ const generateUseQueryQueryKey = ( ] )) } - return queryKey + return t.arrayExpression(queryKey) } diff --git a/packages/wasm-ast-types/types/context/context.d.ts b/packages/wasm-ast-types/types/context/context.d.ts index a0103512..8dd73001 100644 --- a/packages/wasm-ast-types/types/context/context.d.ts +++ b/packages/wasm-ast-types/types/context/context.d.ts @@ -5,6 +5,7 @@ export interface ReactQueryOptions { version?: 'v3' | 'v4'; mutations?: boolean; camelize?: boolean; + queryKeys?: boolean; } export interface TSClientOptions { enabled?: boolean; From 7b9d75882865c64947f7efb668cbff936126912c Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Mon, 22 Aug 2022 12:19:28 +0200 Subject: [PATCH 002/287] Update readme --- README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c2397866..412d556a 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,8 @@ codegen({ enabled: true, optionalClient: true, version: 'v4', - mutations: true + mutations: true, + queryKeys: true, }, recoil: { enabled: false @@ -161,13 +162,14 @@ Generate [react-query v3](https://react-query-v3.tanstack.com/) or [react-query #### React Query Options - | option | description | - | ------------------------------ | ------------------------------------------------------------------- | - | `reactQuery.enabled` | enable the react-query plugin | - | `reactQuery.optionalClient` | allows contract client to be undefined as the component renders | - | `reactQuery.version` | `v4` uses `@tanstack/react-query` and `v3` uses `react-query` | - | `reactQuery.mutations` | also generate mutations | - | `reactQuery.camelize` | use camelCase style for property names | + | option | description | +-----------------------------| ------------------------------ | ------------------------------------------------------------------- | + | `reactQuery.enabled` | enable the react-query plugin | + | `reactQuery.optionalClient` | allows contract client to be undefined as the component renders | + | `reactQuery.queryKeys` | generates a const queryKeys object for use with invalidations and set values | + | `reactQuery.version` | `v4` uses `@tanstack/react-query` and `v3` uses `react-query` | + | `reactQuery.mutations` | also generate mutations | + | `reactQuery.camelize` | use camelCase style for property names | #### React Query via CLI From 50dd957f8e9053ba1093bef0d9db586de9621e02 Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Mon, 22 Aug 2022 12:36:59 +0200 Subject: [PATCH 003/287] Update snapshot tests --- .../__snapshots__/react-query.spec.ts.snap | 104 +++++++++--------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap b/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap index 83513e76..e8beaab1 100644 --- a/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap +++ b/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap @@ -3,21 +3,21 @@ exports[`createReactQueryHooks 1`] = ` "export interface Sg721ReactQuery { client: Sg721QueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } export interface Sg721CollectionInfoQuery extends Sg721ReactQuery {} export function useSg721CollectionInfoQuery({ client, options }: Sg721CollectionInfoQuery) { - return useQuery([\\"sg721CollectionInfo\\", client.contractAddress], () => client.collectionInfo(), options); + return useQuery([\\"sg721CollectionInfo\\", client.contractAddress], () => client.collectionInfo(), options); } export interface Sg721MinterQuery extends Sg721ReactQuery {} export function useSg721MinterQuery({ client, options }: Sg721MinterQuery) { - return useQuery([\\"sg721Minter\\", client.contractAddress], () => client.minter(), options); + return useQuery([\\"sg721Minter\\", client.contractAddress], () => client.minter(), options); } export interface Sg721AllTokensQuery extends Sg721ReactQuery { args: { @@ -30,7 +30,7 @@ export function useSg721AllTokensQuery({ args, options }: Sg721AllTokensQuery) { - return useQuery([\\"sg721AllTokens\\", client.contractAddress, JSON.stringify(args)], () => client.allTokens({ + return useQuery([\\"sg721AllTokens\\", client.contractAddress, JSON.stringify(args)], () => client.allTokens({ limit: args.limit, startAfter: args.startAfter }), options); @@ -47,7 +47,7 @@ export function useSg721TokensQuery({ args, options }: Sg721TokensQuery) { - return useQuery([\\"sg721Tokens\\", client.contractAddress, JSON.stringify(args)], () => client.tokens({ + return useQuery([\\"sg721Tokens\\", client.contractAddress, JSON.stringify(args)], () => client.tokens({ limit: args.limit, owner: args.owner, startAfter: args.startAfter @@ -64,7 +64,7 @@ export function useSg721AllNftInfoQuery({ args, options }: Sg721AllNftInfoQuery) { - return useQuery([\\"sg721AllNftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.allNftInfo({ + return useQuery([\\"sg721AllNftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.allNftInfo({ includeExpired: args.includeExpired, tokenId: args.tokenId }), options); @@ -79,7 +79,7 @@ export function useSg721NftInfoQuery({ args, options }: Sg721NftInfoQuery) { - return useQuery([\\"sg721NftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.nftInfo({ + return useQuery([\\"sg721NftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.nftInfo({ tokenId: args.tokenId }), options); } @@ -88,14 +88,14 @@ export function useSg721ContractInfoQuery({ client, options }: Sg721ContractInfoQuery) { - return useQuery([\\"sg721ContractInfo\\", client.contractAddress], () => client.contractInfo(), options); + return useQuery([\\"sg721ContractInfo\\", client.contractAddress], () => client.contractInfo(), options); } export interface Sg721NumTokensQuery extends Sg721ReactQuery {} export function useSg721NumTokensQuery({ client, options }: Sg721NumTokensQuery) { - return useQuery([\\"sg721NumTokens\\", client.contractAddress], () => client.numTokens(), options); + return useQuery([\\"sg721NumTokens\\", client.contractAddress], () => client.numTokens(), options); } export interface Sg721AllOperatorsQuery extends Sg721ReactQuery { args: { @@ -110,7 +110,7 @@ export function useSg721AllOperatorsQuery({ args, options }: Sg721AllOperatorsQuery) { - return useQuery([\\"sg721AllOperators\\", client.contractAddress, JSON.stringify(args)], () => client.allOperators({ + return useQuery([\\"sg721AllOperators\\", client.contractAddress, JSON.stringify(args)], () => client.allOperators({ includeExpired: args.includeExpired, limit: args.limit, owner: args.owner, @@ -128,7 +128,7 @@ export function useSg721ApprovalsQuery({ args, options }: Sg721ApprovalsQuery) { - return useQuery([\\"sg721Approvals\\", client.contractAddress, JSON.stringify(args)], () => client.approvals({ + return useQuery([\\"sg721Approvals\\", client.contractAddress, JSON.stringify(args)], () => client.approvals({ includeExpired: args.includeExpired, tokenId: args.tokenId }), options); @@ -145,7 +145,7 @@ export function useSg721ApprovalQuery({ args, options }: Sg721ApprovalQuery) { - return useQuery([\\"sg721Approval\\", client.contractAddress, JSON.stringify(args)], () => client.approval({ + return useQuery([\\"sg721Approval\\", client.contractAddress, JSON.stringify(args)], () => client.approval({ includeExpired: args.includeExpired, spender: args.spender, tokenId: args.tokenId @@ -162,7 +162,7 @@ export function useSg721OwnerOfQuery({ args, options }: Sg721OwnerOfQuery) { - return useQuery([\\"sg721OwnerOf\\", client.contractAddress, JSON.stringify(args)], () => client.ownerOf({ + return useQuery([\\"sg721OwnerOf\\", client.contractAddress, JSON.stringify(args)], () => client.ownerOf({ includeExpired: args.includeExpired, tokenId: args.tokenId }), options); @@ -172,14 +172,14 @@ export function useSg721OwnerOfQuery({ exports[`createReactQueryHooks 2`] = ` "export interface Sg721ReactQuery { client: Sg721QueryClient | undefined; - options?: UseQueryOptions; + options?: UseQueryOptions; } export interface Sg721CollectionInfoQuery extends Sg721ReactQuery {} export function useSg721CollectionInfoQuery({ client, options }: Sg721CollectionInfoQuery) { - return useQuery([\\"sg721CollectionInfo\\", client?.contractAddress], () => client ? client.collectionInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, + return useQuery([\\"sg721CollectionInfo\\", client?.contractAddress], () => client ? client.collectionInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } @@ -188,7 +188,7 @@ export function useSg721MinterQuery({ client, options }: Sg721MinterQuery) { - return useQuery([\\"sg721Minter\\", client?.contractAddress], () => client ? client.minter() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, + return useQuery([\\"sg721Minter\\", client?.contractAddress], () => client ? client.minter() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } @@ -203,7 +203,7 @@ export function useSg721AllTokensQuery({ args, options }: Sg721AllTokensQuery) { - return useQuery([\\"sg721AllTokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allTokens({ + return useQuery([\\"sg721AllTokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allTokens({ limit: args.limit, startAfter: args.startAfter }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, @@ -222,7 +222,7 @@ export function useSg721TokensQuery({ args, options }: Sg721TokensQuery) { - return useQuery([\\"sg721Tokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.tokens({ + return useQuery([\\"sg721Tokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.tokens({ limit: args.limit, owner: args.owner, startAfter: args.startAfter @@ -241,7 +241,7 @@ export function useSg721AllNftInfoQuery({ args, options }: Sg721AllNftInfoQuery) { - return useQuery([\\"sg721AllNftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allNftInfo({ + return useQuery([\\"sg721AllNftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allNftInfo({ includeExpired: args.includeExpired, tokenId: args.tokenId }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, @@ -258,7 +258,7 @@ export function useSg721NftInfoQuery({ args, options }: Sg721NftInfoQuery) { - return useQuery([\\"sg721NftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.nftInfo({ + return useQuery([\\"sg721NftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.nftInfo({ tokenId: args.tokenId }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) @@ -269,7 +269,7 @@ export function useSg721ContractInfoQuery({ client, options }: Sg721ContractInfoQuery) { - return useQuery([\\"sg721ContractInfo\\", client?.contractAddress], () => client ? client.contractInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, + return useQuery([\\"sg721ContractInfo\\", client?.contractAddress], () => client ? client.contractInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } @@ -278,7 +278,7 @@ export function useSg721NumTokensQuery({ client, options }: Sg721NumTokensQuery) { - return useQuery([\\"sg721NumTokens\\", client?.contractAddress], () => client ? client.numTokens() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, + return useQuery([\\"sg721NumTokens\\", client?.contractAddress], () => client ? client.numTokens() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } @@ -295,7 +295,7 @@ export function useSg721AllOperatorsQuery({ args, options }: Sg721AllOperatorsQuery) { - return useQuery([\\"sg721AllOperators\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allOperators({ + return useQuery([\\"sg721AllOperators\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allOperators({ includeExpired: args.includeExpired, limit: args.limit, owner: args.owner, @@ -315,7 +315,7 @@ export function useSg721ApprovalsQuery({ args, options }: Sg721ApprovalsQuery) { - return useQuery([\\"sg721Approvals\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approvals({ + return useQuery([\\"sg721Approvals\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approvals({ includeExpired: args.includeExpired, tokenId: args.tokenId }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, @@ -334,7 +334,7 @@ export function useSg721ApprovalQuery({ args, options }: Sg721ApprovalQuery) { - return useQuery([\\"sg721Approval\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approval({ + return useQuery([\\"sg721Approval\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approval({ includeExpired: args.includeExpired, spender: args.spender, tokenId: args.tokenId @@ -353,7 +353,7 @@ export function useSg721OwnerOfQuery({ args, options }: Sg721OwnerOfQuery) { - return useQuery([\\"sg721OwnerOf\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.ownerOf({ + return useQuery([\\"sg721OwnerOf\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.ownerOf({ includeExpired: args.includeExpired, tokenId: args.tokenId }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, @@ -365,7 +365,7 @@ export function useSg721OwnerOfQuery({ exports[`createReactQueryHooks 3`] = ` "export interface Sg721ReactQuery { client: Sg721QueryClient; - options?: Omit, \\"'queryKey' | 'queryFn' | 'initialData'\\"> & { + options?: Omit, \\"'queryKey' | 'queryFn' | 'initialData'\\"> & { initialData?: undefined; }; } @@ -374,14 +374,14 @@ export function useSg721CollectionInfoQuery({ client, options }: Sg721CollectionInfoQuery) { - return useQuery([\\"sg721CollectionInfo\\", client.contractAddress], () => client.collectionInfo(), options); + return useQuery([\\"sg721CollectionInfo\\", client.contractAddress], () => client.collectionInfo(), options); } export interface Sg721MinterQuery extends Sg721ReactQuery {} export function useSg721MinterQuery({ client, options }: Sg721MinterQuery) { - return useQuery([\\"sg721Minter\\", client.contractAddress], () => client.minter(), options); + return useQuery([\\"sg721Minter\\", client.contractAddress], () => client.minter(), options); } export interface Sg721AllTokensQuery extends Sg721ReactQuery { args: { @@ -394,7 +394,7 @@ export function useSg721AllTokensQuery({ args, options }: Sg721AllTokensQuery) { - return useQuery([\\"sg721AllTokens\\", client.contractAddress, JSON.stringify(args)], () => client.allTokens({ + return useQuery([\\"sg721AllTokens\\", client.contractAddress, JSON.stringify(args)], () => client.allTokens({ limit: args.limit, startAfter: args.startAfter }), options); @@ -411,7 +411,7 @@ export function useSg721TokensQuery({ args, options }: Sg721TokensQuery) { - return useQuery([\\"sg721Tokens\\", client.contractAddress, JSON.stringify(args)], () => client.tokens({ + return useQuery([\\"sg721Tokens\\", client.contractAddress, JSON.stringify(args)], () => client.tokens({ limit: args.limit, owner: args.owner, startAfter: args.startAfter @@ -428,7 +428,7 @@ export function useSg721AllNftInfoQuery({ args, options }: Sg721AllNftInfoQuery) { - return useQuery([\\"sg721AllNftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.allNftInfo({ + return useQuery([\\"sg721AllNftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.allNftInfo({ includeExpired: args.includeExpired, tokenId: args.tokenId }), options); @@ -443,7 +443,7 @@ export function useSg721NftInfoQuery({ args, options }: Sg721NftInfoQuery) { - return useQuery([\\"sg721NftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.nftInfo({ + return useQuery([\\"sg721NftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.nftInfo({ tokenId: args.tokenId }), options); } @@ -452,14 +452,14 @@ export function useSg721ContractInfoQuery({ client, options }: Sg721ContractInfoQuery) { - return useQuery([\\"sg721ContractInfo\\", client.contractAddress], () => client.contractInfo(), options); + return useQuery([\\"sg721ContractInfo\\", client.contractAddress], () => client.contractInfo(), options); } export interface Sg721NumTokensQuery extends Sg721ReactQuery {} export function useSg721NumTokensQuery({ client, options }: Sg721NumTokensQuery) { - return useQuery([\\"sg721NumTokens\\", client.contractAddress], () => client.numTokens(), options); + return useQuery([\\"sg721NumTokens\\", client.contractAddress], () => client.numTokens(), options); } export interface Sg721AllOperatorsQuery extends Sg721ReactQuery { args: { @@ -474,7 +474,7 @@ export function useSg721AllOperatorsQuery({ args, options }: Sg721AllOperatorsQuery) { - return useQuery([\\"sg721AllOperators\\", client.contractAddress, JSON.stringify(args)], () => client.allOperators({ + return useQuery([\\"sg721AllOperators\\", client.contractAddress, JSON.stringify(args)], () => client.allOperators({ includeExpired: args.includeExpired, limit: args.limit, owner: args.owner, @@ -492,7 +492,7 @@ export function useSg721ApprovalsQuery({ args, options }: Sg721ApprovalsQuery) { - return useQuery([\\"sg721Approvals\\", client.contractAddress, JSON.stringify(args)], () => client.approvals({ + return useQuery([\\"sg721Approvals\\", client.contractAddress, JSON.stringify(args)], () => client.approvals({ includeExpired: args.includeExpired, tokenId: args.tokenId }), options); @@ -509,7 +509,7 @@ export function useSg721ApprovalQuery({ args, options }: Sg721ApprovalQuery) { - return useQuery([\\"sg721Approval\\", client.contractAddress, JSON.stringify(args)], () => client.approval({ + return useQuery([\\"sg721Approval\\", client.contractAddress, JSON.stringify(args)], () => client.approval({ includeExpired: args.includeExpired, spender: args.spender, tokenId: args.tokenId @@ -526,7 +526,7 @@ export function useSg721OwnerOfQuery({ args, options }: Sg721OwnerOfQuery) { - return useQuery([\\"sg721OwnerOf\\", client.contractAddress, JSON.stringify(args)], () => client.ownerOf({ + return useQuery([\\"sg721OwnerOf\\", client.contractAddress, JSON.stringify(args)], () => client.ownerOf({ includeExpired: args.includeExpired, tokenId: args.tokenId }), options); @@ -536,7 +536,7 @@ export function useSg721OwnerOfQuery({ exports[`createReactQueryHooks 4`] = ` "export interface Sg721ReactQuery { client: Sg721QueryClient | undefined; - options?: Omit, \\"'queryKey' | 'queryFn' | 'initialData'\\"> & { + options?: Omit, \\"'queryKey' | 'queryFn' | 'initialData'\\"> & { initialData?: undefined; }; } @@ -545,7 +545,7 @@ export function useSg721CollectionInfoQuery({ client, options }: Sg721CollectionInfoQuery) { - return useQuery([\\"sg721CollectionInfo\\", client?.contractAddress], () => client ? client.collectionInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, + return useQuery([\\"sg721CollectionInfo\\", client?.contractAddress], () => client ? client.collectionInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } @@ -554,7 +554,7 @@ export function useSg721MinterQuery({ client, options }: Sg721MinterQuery) { - return useQuery([\\"sg721Minter\\", client?.contractAddress], () => client ? client.minter() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, + return useQuery([\\"sg721Minter\\", client?.contractAddress], () => client ? client.minter() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } @@ -569,7 +569,7 @@ export function useSg721AllTokensQuery({ args, options }: Sg721AllTokensQuery) { - return useQuery([\\"sg721AllTokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allTokens({ + return useQuery([\\"sg721AllTokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allTokens({ limit: args.limit, startAfter: args.startAfter }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, @@ -588,7 +588,7 @@ export function useSg721TokensQuery({ args, options }: Sg721TokensQuery) { - return useQuery([\\"sg721Tokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.tokens({ + return useQuery([\\"sg721Tokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.tokens({ limit: args.limit, owner: args.owner, startAfter: args.startAfter @@ -607,7 +607,7 @@ export function useSg721AllNftInfoQuery({ args, options }: Sg721AllNftInfoQuery) { - return useQuery([\\"sg721AllNftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allNftInfo({ + return useQuery([\\"sg721AllNftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allNftInfo({ includeExpired: args.includeExpired, tokenId: args.tokenId }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, @@ -624,7 +624,7 @@ export function useSg721NftInfoQuery({ args, options }: Sg721NftInfoQuery) { - return useQuery([\\"sg721NftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.nftInfo({ + return useQuery([\\"sg721NftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.nftInfo({ tokenId: args.tokenId }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) @@ -635,7 +635,7 @@ export function useSg721ContractInfoQuery({ client, options }: Sg721ContractInfoQuery) { - return useQuery([\\"sg721ContractInfo\\", client?.contractAddress], () => client ? client.contractInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, + return useQuery([\\"sg721ContractInfo\\", client?.contractAddress], () => client ? client.contractInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } @@ -644,7 +644,7 @@ export function useSg721NumTokensQuery({ client, options }: Sg721NumTokensQuery) { - return useQuery([\\"sg721NumTokens\\", client?.contractAddress], () => client ? client.numTokens() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, + return useQuery([\\"sg721NumTokens\\", client?.contractAddress], () => client ? client.numTokens() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } @@ -661,7 +661,7 @@ export function useSg721AllOperatorsQuery({ args, options }: Sg721AllOperatorsQuery) { - return useQuery([\\"sg721AllOperators\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allOperators({ + return useQuery([\\"sg721AllOperators\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allOperators({ includeExpired: args.includeExpired, limit: args.limit, owner: args.owner, @@ -681,7 +681,7 @@ export function useSg721ApprovalsQuery({ args, options }: Sg721ApprovalsQuery) { - return useQuery([\\"sg721Approvals\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approvals({ + return useQuery([\\"sg721Approvals\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approvals({ includeExpired: args.includeExpired, tokenId: args.tokenId }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, @@ -700,7 +700,7 @@ export function useSg721ApprovalQuery({ args, options }: Sg721ApprovalQuery) { - return useQuery([\\"sg721Approval\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approval({ + return useQuery([\\"sg721Approval\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approval({ includeExpired: args.includeExpired, spender: args.spender, tokenId: args.tokenId @@ -719,7 +719,7 @@ export function useSg721OwnerOfQuery({ args, options }: Sg721OwnerOfQuery) { - return useQuery([\\"sg721OwnerOf\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.ownerOf({ + return useQuery([\\"sg721OwnerOf\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.ownerOf({ includeExpired: args.includeExpired, tokenId: args.tokenId }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, From 9004a00ac4375e615fe2cd4a6863b3dc462e76ea Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Mon, 22 Aug 2022 12:44:46 +0200 Subject: [PATCH 004/287] Allow use of select in reactquery by introducing generic param --- .../default/CwAdminFactory.react-query.ts | 4 +- .../default/CwCodeIdRegistry.react-query.ts | 36 +- .../builder/default/CwSingle.react-query.ts | 84 ++-- .../builder/default/Factory.react-query.ts | 52 +-- .../builder/default/Minter.react-query.ts | 44 +- .../invoke/CwAdminFactory.react-query.ts | 4 +- .../invoke/CwCodeIdRegistry.react-query.ts | 36 +- .../builder/invoke/CwSingle.react-query.ts | 84 ++-- .../builder/invoke/Factory.react-query.ts | 52 +-- .../builder/invoke/Minter.react-query.ts | 44 +- __output__/cosmwasm/CW4Group.react-query.ts | 44 +- .../CwAdminFactory.react-query.ts | 4 +- .../CwCodeIdRegistry.react-query.ts | 36 +- .../CwNamedGroups.react-query.ts | 36 +- .../CwProposalSingle.react-query.ts | 84 ++-- __output__/minter/Minter.react-query.ts | 44 +- __output__/sg721/Sg721.react-query.ts | 100 ++--- .../Factory.react-query.ts | 52 +-- .../factory-v4-query/Factory.react-query.ts | 52 +-- .../Factory.react-query.ts | 52 +-- .../vectis/factory/Factory.react-query.ts | 52 +-- __output__/vectis/govec/Govec.react-query.ts | 20 +- __output__/vectis/proxy/Proxy.react-query.ts | 20 +- .../__snapshots__/react-query.spec.ts.snap | 400 +++++++++--------- .../src/react-query/react-query.ts | 53 ++- 25 files changed, 759 insertions(+), 730 deletions(-) diff --git a/__output__/builder/default/CwAdminFactory.react-query.ts b/__output__/builder/default/CwAdminFactory.react-query.ts index 731fdfc3..be2aa1b7 100644 --- a/__output__/builder/default/CwAdminFactory.react-query.ts +++ b/__output__/builder/default/CwAdminFactory.react-query.ts @@ -7,7 +7,7 @@ import { UseQueryOptions } from "react-query"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; -export interface CwAdminFactoryReactQuery { +export interface CwAdminFactoryReactQuery { client: CwAdminFactoryQueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } \ No newline at end of file diff --git a/__output__/builder/default/CwCodeIdRegistry.react-query.ts b/__output__/builder/default/CwCodeIdRegistry.react-query.ts index d30fda59..f219bfd3 100644 --- a/__output__/builder/default/CwCodeIdRegistry.react-query.ts +++ b/__output__/builder/default/CwCodeIdRegistry.react-query.ts @@ -7,64 +7,64 @@ import { UseQueryOptions, useQuery } from "react-query"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; -export interface CwCodeIdRegistryReactQuery { +export interface CwCodeIdRegistryReactQuery { client: CwCodeIdRegistryQueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface CwCodeIdRegistryListRegistrationsQuery extends CwCodeIdRegistryReactQuery { +export interface CwCodeIdRegistryListRegistrationsQuery extends CwCodeIdRegistryReactQuery { args: { chainId: string; name: string; }; } -export function useCwCodeIdRegistryListRegistrationsQuery({ +export function useCwCodeIdRegistryListRegistrationsQuery({ client, args, options -}: CwCodeIdRegistryListRegistrationsQuery) { - return useQuery(["cwCodeIdRegistryListRegistrations", client.contractAddress, JSON.stringify(args)], () => client.listRegistrations({ +}: CwCodeIdRegistryListRegistrationsQuery) { + return useQuery(["cwCodeIdRegistryListRegistrations", client.contractAddress, JSON.stringify(args)], () => client.listRegistrations({ chainId: args.chainId, name: args.name }), options); } -export interface CwCodeIdRegistryInfoForCodeIdQuery extends CwCodeIdRegistryReactQuery { +export interface CwCodeIdRegistryInfoForCodeIdQuery extends CwCodeIdRegistryReactQuery { args: { chainId: string; codeId: number; }; } -export function useCwCodeIdRegistryInfoForCodeIdQuery({ +export function useCwCodeIdRegistryInfoForCodeIdQuery({ client, args, options -}: CwCodeIdRegistryInfoForCodeIdQuery) { - return useQuery(["cwCodeIdRegistryInfoForCodeId", client.contractAddress, JSON.stringify(args)], () => client.infoForCodeId({ +}: CwCodeIdRegistryInfoForCodeIdQuery) { + return useQuery(["cwCodeIdRegistryInfoForCodeId", client.contractAddress, JSON.stringify(args)], () => client.infoForCodeId({ chainId: args.chainId, codeId: args.codeId }), options); } -export interface CwCodeIdRegistryGetRegistrationQuery extends CwCodeIdRegistryReactQuery { +export interface CwCodeIdRegistryGetRegistrationQuery extends CwCodeIdRegistryReactQuery { args: { chainId: string; name: string; version?: string; }; } -export function useCwCodeIdRegistryGetRegistrationQuery({ +export function useCwCodeIdRegistryGetRegistrationQuery({ client, args, options -}: CwCodeIdRegistryGetRegistrationQuery) { - return useQuery(["cwCodeIdRegistryGetRegistration", client.contractAddress, JSON.stringify(args)], () => client.getRegistration({ +}: CwCodeIdRegistryGetRegistrationQuery) { + return useQuery(["cwCodeIdRegistryGetRegistration", client.contractAddress, JSON.stringify(args)], () => client.getRegistration({ chainId: args.chainId, name: args.name, version: args.version }), options); } -export interface CwCodeIdRegistryConfigQuery extends CwCodeIdRegistryReactQuery {} -export function useCwCodeIdRegistryConfigQuery({ +export interface CwCodeIdRegistryConfigQuery extends CwCodeIdRegistryReactQuery {} +export function useCwCodeIdRegistryConfigQuery({ client, options -}: CwCodeIdRegistryConfigQuery) { - return useQuery(["cwCodeIdRegistryConfig", client.contractAddress], () => client.config(), options); +}: CwCodeIdRegistryConfigQuery) { + return useQuery(["cwCodeIdRegistryConfig", client.contractAddress], () => client.config(), options); } \ No newline at end of file diff --git a/__output__/builder/default/CwSingle.react-query.ts b/__output__/builder/default/CwSingle.react-query.ts index bdf7f3ee..c3f26272 100644 --- a/__output__/builder/default/CwSingle.react-query.ts +++ b/__output__/builder/default/CwSingle.react-query.ts @@ -7,122 +7,122 @@ import { UseQueryOptions, useQuery } from "react-query"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; import { CwSingleQueryClient } from "./CwSingle.client"; -export interface CwSingleReactQuery { +export interface CwSingleReactQuery { client: CwSingleQueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface CwSingleInfoQuery extends CwSingleReactQuery {} -export function useCwSingleInfoQuery({ +export interface CwSingleInfoQuery extends CwSingleReactQuery {} +export function useCwSingleInfoQuery({ client, options -}: CwSingleInfoQuery) { - return useQuery(["cwSingleInfo", client.contractAddress], () => client.info(), options); +}: CwSingleInfoQuery) { + return useQuery(["cwSingleInfo", client.contractAddress], () => client.info(), options); } -export interface CwSingleVoteHooksQuery extends CwSingleReactQuery {} -export function useCwSingleVoteHooksQuery({ +export interface CwSingleVoteHooksQuery extends CwSingleReactQuery {} +export function useCwSingleVoteHooksQuery({ client, options -}: CwSingleVoteHooksQuery) { - return useQuery(["cwSingleVoteHooks", client.contractAddress], () => client.voteHooks(), options); +}: CwSingleVoteHooksQuery) { + return useQuery(["cwSingleVoteHooks", client.contractAddress], () => client.voteHooks(), options); } -export interface CwSingleProposalHooksQuery extends CwSingleReactQuery {} -export function useCwSingleProposalHooksQuery({ +export interface CwSingleProposalHooksQuery extends CwSingleReactQuery {} +export function useCwSingleProposalHooksQuery({ client, options -}: CwSingleProposalHooksQuery) { - return useQuery(["cwSingleProposalHooks", client.contractAddress], () => client.proposalHooks(), options); +}: CwSingleProposalHooksQuery) { + return useQuery(["cwSingleProposalHooks", client.contractAddress], () => client.proposalHooks(), options); } -export interface CwSingleListVotesQuery extends CwSingleReactQuery { +export interface CwSingleListVotesQuery extends CwSingleReactQuery { args: { limit?: number; proposalId: number; startAfter?: string; }; } -export function useCwSingleListVotesQuery({ +export function useCwSingleListVotesQuery({ client, args, options -}: CwSingleListVotesQuery) { - return useQuery(["cwSingleListVotes", client.contractAddress, JSON.stringify(args)], () => client.listVotes({ +}: CwSingleListVotesQuery) { + return useQuery(["cwSingleListVotes", client.contractAddress, JSON.stringify(args)], () => client.listVotes({ limit: args.limit, proposalId: args.proposalId, startAfter: args.startAfter }), options); } -export interface CwSingleVoteQuery extends CwSingleReactQuery { +export interface CwSingleVoteQuery extends CwSingleReactQuery { args: { proposalId: number; voter: string; }; } -export function useCwSingleVoteQuery({ +export function useCwSingleVoteQuery({ client, args, options -}: CwSingleVoteQuery) { - return useQuery(["cwSingleVote", client.contractAddress, JSON.stringify(args)], () => client.vote({ +}: CwSingleVoteQuery) { + return useQuery(["cwSingleVote", client.contractAddress, JSON.stringify(args)], () => client.vote({ proposalId: args.proposalId, voter: args.voter }), options); } -export interface CwSingleProposalCountQuery extends CwSingleReactQuery {} -export function useCwSingleProposalCountQuery({ +export interface CwSingleProposalCountQuery extends CwSingleReactQuery {} +export function useCwSingleProposalCountQuery({ client, options -}: CwSingleProposalCountQuery) { - return useQuery(["cwSingleProposalCount", client.contractAddress], () => client.proposalCount(), options); +}: CwSingleProposalCountQuery) { + return useQuery(["cwSingleProposalCount", client.contractAddress], () => client.proposalCount(), options); } -export interface CwSingleReverseProposalsQuery extends CwSingleReactQuery { +export interface CwSingleReverseProposalsQuery extends CwSingleReactQuery { args: { limit?: number; startBefore?: number; }; } -export function useCwSingleReverseProposalsQuery({ +export function useCwSingleReverseProposalsQuery({ client, args, options -}: CwSingleReverseProposalsQuery) { - return useQuery(["cwSingleReverseProposals", client.contractAddress, JSON.stringify(args)], () => client.reverseProposals({ +}: CwSingleReverseProposalsQuery) { + return useQuery(["cwSingleReverseProposals", client.contractAddress, JSON.stringify(args)], () => client.reverseProposals({ limit: args.limit, startBefore: args.startBefore }), options); } -export interface CwSingleListProposalsQuery extends CwSingleReactQuery { +export interface CwSingleListProposalsQuery extends CwSingleReactQuery { args: { limit?: number; startAfter?: number; }; } -export function useCwSingleListProposalsQuery({ +export function useCwSingleListProposalsQuery({ client, args, options -}: CwSingleListProposalsQuery) { - return useQuery(["cwSingleListProposals", client.contractAddress, JSON.stringify(args)], () => client.listProposals({ +}: CwSingleListProposalsQuery) { + return useQuery(["cwSingleListProposals", client.contractAddress, JSON.stringify(args)], () => client.listProposals({ limit: args.limit, startAfter: args.startAfter }), options); } -export interface CwSingleProposalQuery extends CwSingleReactQuery { +export interface CwSingleProposalQuery extends CwSingleReactQuery { args: { proposalId: number; }; } -export function useCwSingleProposalQuery({ +export function useCwSingleProposalQuery({ client, args, options -}: CwSingleProposalQuery) { - return useQuery(["cwSingleProposal", client.contractAddress, JSON.stringify(args)], () => client.proposal({ +}: CwSingleProposalQuery) { + return useQuery(["cwSingleProposal", client.contractAddress, JSON.stringify(args)], () => client.proposal({ proposalId: args.proposalId }), options); } -export interface CwSingleConfigQuery extends CwSingleReactQuery {} -export function useCwSingleConfigQuery({ +export interface CwSingleConfigQuery extends CwSingleReactQuery {} +export function useCwSingleConfigQuery({ client, options -}: CwSingleConfigQuery) { - return useQuery(["cwSingleConfig", client.contractAddress], () => client.config(), options); +}: CwSingleConfigQuery) { + return useQuery(["cwSingleConfig", client.contractAddress], () => client.config(), options); } \ No newline at end of file diff --git a/__output__/builder/default/Factory.react-query.ts b/__output__/builder/default/Factory.react-query.ts index 1e9481eb..41b88b79 100644 --- a/__output__/builder/default/Factory.react-query.ts +++ b/__output__/builder/default/Factory.react-query.ts @@ -7,75 +7,75 @@ import { UseQueryOptions, useQuery } from "react-query"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { FactoryQueryClient } from "./Factory.client"; -export interface FactoryReactQuery { +export interface FactoryReactQuery { client: FactoryQueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface FactoryAdminAddrQuery extends FactoryReactQuery {} -export function useFactoryAdminAddrQuery({ +export interface FactoryAdminAddrQuery extends FactoryReactQuery {} +export function useFactoryAdminAddrQuery({ client, options -}: FactoryAdminAddrQuery) { - return useQuery(["factoryAdminAddr", client.contractAddress], () => client.adminAddr(), options); +}: FactoryAdminAddrQuery) { + return useQuery(["factoryAdminAddr", client.contractAddress], () => client.adminAddr(), options); } -export interface FactoryGovecAddrQuery extends FactoryReactQuery {} -export function useFactoryGovecAddrQuery({ +export interface FactoryGovecAddrQuery extends FactoryReactQuery {} +export function useFactoryGovecAddrQuery({ client, options -}: FactoryGovecAddrQuery) { - return useQuery(["factoryGovecAddr", client.contractAddress], () => client.govecAddr(), options); +}: FactoryGovecAddrQuery) { + return useQuery(["factoryGovecAddr", client.contractAddress], () => client.govecAddr(), options); } -export interface FactoryFeeQuery extends FactoryReactQuery {} -export function useFactoryFeeQuery({ +export interface FactoryFeeQuery extends FactoryReactQuery {} +export function useFactoryFeeQuery({ client, options -}: FactoryFeeQuery) { - return useQuery(["factoryFee", client.contractAddress], () => client.fee(), options); +}: FactoryFeeQuery) { + return useQuery(["factoryFee", client.contractAddress], () => client.fee(), options); } -export interface FactoryCodeIdQuery extends FactoryReactQuery { +export interface FactoryCodeIdQuery extends FactoryReactQuery { args: { ty: CodeIdType; }; } -export function useFactoryCodeIdQuery({ +export function useFactoryCodeIdQuery({ client, args, options -}: FactoryCodeIdQuery) { - return useQuery(["factoryCodeId", client.contractAddress, JSON.stringify(args)], () => client.codeId({ +}: FactoryCodeIdQuery) { + return useQuery(["factoryCodeId", client.contractAddress, JSON.stringify(args)], () => client.codeId({ ty: args.ty }), options); } -export interface FactoryWalletsOfQuery extends FactoryReactQuery { +export interface FactoryWalletsOfQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: string; user: string; }; } -export function useFactoryWalletsOfQuery({ +export function useFactoryWalletsOfQuery({ client, args, options -}: FactoryWalletsOfQuery) { - return useQuery(["factoryWalletsOf", client.contractAddress, JSON.stringify(args)], () => client.walletsOf({ +}: FactoryWalletsOfQuery) { + return useQuery(["factoryWalletsOf", client.contractAddress, JSON.stringify(args)], () => client.walletsOf({ limit: args.limit, startAfter: args.startAfter, user: args.user }), options); } -export interface FactoryWalletsQuery extends FactoryReactQuery { +export interface FactoryWalletsQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: WalletQueryPrefix; }; } -export function useFactoryWalletsQuery({ +export function useFactoryWalletsQuery({ client, args, options -}: FactoryWalletsQuery) { - return useQuery(["factoryWallets", client.contractAddress, JSON.stringify(args)], () => client.wallets({ +}: FactoryWalletsQuery) { + return useQuery(["factoryWallets", client.contractAddress, JSON.stringify(args)], () => client.wallets({ limit: args.limit, startAfter: args.startAfter }), options); diff --git a/__output__/builder/default/Minter.react-query.ts b/__output__/builder/default/Minter.react-query.ts index f97b612d..28483c5b 100644 --- a/__output__/builder/default/Minter.react-query.ts +++ b/__output__/builder/default/Minter.react-query.ts @@ -7,49 +7,49 @@ import { UseQueryOptions, useQuery } from "react-query"; import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; import { MinterQueryClient } from "./Minter.client"; -export interface MinterReactQuery { +export interface MinterReactQuery { client: MinterQueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface MinterMintCountQuery extends MinterReactQuery { +export interface MinterMintCountQuery extends MinterReactQuery { args: { address: string; }; } -export function useMinterMintCountQuery({ +export function useMinterMintCountQuery({ client, args, options -}: MinterMintCountQuery) { - return useQuery(["minterMintCount", client.contractAddress, JSON.stringify(args)], () => client.mintCount({ +}: MinterMintCountQuery) { + return useQuery(["minterMintCount", client.contractAddress, JSON.stringify(args)], () => client.mintCount({ address: args.address }), options); } -export interface MinterMintPriceQuery extends MinterReactQuery {} -export function useMinterMintPriceQuery({ +export interface MinterMintPriceQuery extends MinterReactQuery {} +export function useMinterMintPriceQuery({ client, options -}: MinterMintPriceQuery) { - return useQuery(["minterMintPrice", client.contractAddress], () => client.mintPrice(), options); +}: MinterMintPriceQuery) { + return useQuery(["minterMintPrice", client.contractAddress], () => client.mintPrice(), options); } -export interface MinterStartTimeQuery extends MinterReactQuery {} -export function useMinterStartTimeQuery({ +export interface MinterStartTimeQuery extends MinterReactQuery {} +export function useMinterStartTimeQuery({ client, options -}: MinterStartTimeQuery) { - return useQuery(["minterStartTime", client.contractAddress], () => client.startTime(), options); +}: MinterStartTimeQuery) { + return useQuery(["minterStartTime", client.contractAddress], () => client.startTime(), options); } -export interface MinterMintableNumTokensQuery extends MinterReactQuery {} -export function useMinterMintableNumTokensQuery({ +export interface MinterMintableNumTokensQuery extends MinterReactQuery {} +export function useMinterMintableNumTokensQuery({ client, options -}: MinterMintableNumTokensQuery) { - return useQuery(["minterMintableNumTokens", client.contractAddress], () => client.mintableNumTokens(), options); +}: MinterMintableNumTokensQuery) { + return useQuery(["minterMintableNumTokens", client.contractAddress], () => client.mintableNumTokens(), options); } -export interface MinterConfigQuery extends MinterReactQuery {} -export function useMinterConfigQuery({ +export interface MinterConfigQuery extends MinterReactQuery {} +export function useMinterConfigQuery({ client, options -}: MinterConfigQuery) { - return useQuery(["minterConfig", client.contractAddress], () => client.config(), options); +}: MinterConfigQuery) { + return useQuery(["minterConfig", client.contractAddress], () => client.config(), options); } \ No newline at end of file diff --git a/__output__/builder/invoke/CwAdminFactory.react-query.ts b/__output__/builder/invoke/CwAdminFactory.react-query.ts index 731fdfc3..be2aa1b7 100644 --- a/__output__/builder/invoke/CwAdminFactory.react-query.ts +++ b/__output__/builder/invoke/CwAdminFactory.react-query.ts @@ -7,7 +7,7 @@ import { UseQueryOptions } from "react-query"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; -export interface CwAdminFactoryReactQuery { +export interface CwAdminFactoryReactQuery { client: CwAdminFactoryQueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } \ No newline at end of file diff --git a/__output__/builder/invoke/CwCodeIdRegistry.react-query.ts b/__output__/builder/invoke/CwCodeIdRegistry.react-query.ts index d30fda59..f219bfd3 100644 --- a/__output__/builder/invoke/CwCodeIdRegistry.react-query.ts +++ b/__output__/builder/invoke/CwCodeIdRegistry.react-query.ts @@ -7,64 +7,64 @@ import { UseQueryOptions, useQuery } from "react-query"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; -export interface CwCodeIdRegistryReactQuery { +export interface CwCodeIdRegistryReactQuery { client: CwCodeIdRegistryQueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface CwCodeIdRegistryListRegistrationsQuery extends CwCodeIdRegistryReactQuery { +export interface CwCodeIdRegistryListRegistrationsQuery extends CwCodeIdRegistryReactQuery { args: { chainId: string; name: string; }; } -export function useCwCodeIdRegistryListRegistrationsQuery({ +export function useCwCodeIdRegistryListRegistrationsQuery({ client, args, options -}: CwCodeIdRegistryListRegistrationsQuery) { - return useQuery(["cwCodeIdRegistryListRegistrations", client.contractAddress, JSON.stringify(args)], () => client.listRegistrations({ +}: CwCodeIdRegistryListRegistrationsQuery) { + return useQuery(["cwCodeIdRegistryListRegistrations", client.contractAddress, JSON.stringify(args)], () => client.listRegistrations({ chainId: args.chainId, name: args.name }), options); } -export interface CwCodeIdRegistryInfoForCodeIdQuery extends CwCodeIdRegistryReactQuery { +export interface CwCodeIdRegistryInfoForCodeIdQuery extends CwCodeIdRegistryReactQuery { args: { chainId: string; codeId: number; }; } -export function useCwCodeIdRegistryInfoForCodeIdQuery({ +export function useCwCodeIdRegistryInfoForCodeIdQuery({ client, args, options -}: CwCodeIdRegistryInfoForCodeIdQuery) { - return useQuery(["cwCodeIdRegistryInfoForCodeId", client.contractAddress, JSON.stringify(args)], () => client.infoForCodeId({ +}: CwCodeIdRegistryInfoForCodeIdQuery) { + return useQuery(["cwCodeIdRegistryInfoForCodeId", client.contractAddress, JSON.stringify(args)], () => client.infoForCodeId({ chainId: args.chainId, codeId: args.codeId }), options); } -export interface CwCodeIdRegistryGetRegistrationQuery extends CwCodeIdRegistryReactQuery { +export interface CwCodeIdRegistryGetRegistrationQuery extends CwCodeIdRegistryReactQuery { args: { chainId: string; name: string; version?: string; }; } -export function useCwCodeIdRegistryGetRegistrationQuery({ +export function useCwCodeIdRegistryGetRegistrationQuery({ client, args, options -}: CwCodeIdRegistryGetRegistrationQuery) { - return useQuery(["cwCodeIdRegistryGetRegistration", client.contractAddress, JSON.stringify(args)], () => client.getRegistration({ +}: CwCodeIdRegistryGetRegistrationQuery) { + return useQuery(["cwCodeIdRegistryGetRegistration", client.contractAddress, JSON.stringify(args)], () => client.getRegistration({ chainId: args.chainId, name: args.name, version: args.version }), options); } -export interface CwCodeIdRegistryConfigQuery extends CwCodeIdRegistryReactQuery {} -export function useCwCodeIdRegistryConfigQuery({ +export interface CwCodeIdRegistryConfigQuery extends CwCodeIdRegistryReactQuery {} +export function useCwCodeIdRegistryConfigQuery({ client, options -}: CwCodeIdRegistryConfigQuery) { - return useQuery(["cwCodeIdRegistryConfig", client.contractAddress], () => client.config(), options); +}: CwCodeIdRegistryConfigQuery) { + return useQuery(["cwCodeIdRegistryConfig", client.contractAddress], () => client.config(), options); } \ No newline at end of file diff --git a/__output__/builder/invoke/CwSingle.react-query.ts b/__output__/builder/invoke/CwSingle.react-query.ts index bdf7f3ee..c3f26272 100644 --- a/__output__/builder/invoke/CwSingle.react-query.ts +++ b/__output__/builder/invoke/CwSingle.react-query.ts @@ -7,122 +7,122 @@ import { UseQueryOptions, useQuery } from "react-query"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; import { CwSingleQueryClient } from "./CwSingle.client"; -export interface CwSingleReactQuery { +export interface CwSingleReactQuery { client: CwSingleQueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface CwSingleInfoQuery extends CwSingleReactQuery {} -export function useCwSingleInfoQuery({ +export interface CwSingleInfoQuery extends CwSingleReactQuery {} +export function useCwSingleInfoQuery({ client, options -}: CwSingleInfoQuery) { - return useQuery(["cwSingleInfo", client.contractAddress], () => client.info(), options); +}: CwSingleInfoQuery) { + return useQuery(["cwSingleInfo", client.contractAddress], () => client.info(), options); } -export interface CwSingleVoteHooksQuery extends CwSingleReactQuery {} -export function useCwSingleVoteHooksQuery({ +export interface CwSingleVoteHooksQuery extends CwSingleReactQuery {} +export function useCwSingleVoteHooksQuery({ client, options -}: CwSingleVoteHooksQuery) { - return useQuery(["cwSingleVoteHooks", client.contractAddress], () => client.voteHooks(), options); +}: CwSingleVoteHooksQuery) { + return useQuery(["cwSingleVoteHooks", client.contractAddress], () => client.voteHooks(), options); } -export interface CwSingleProposalHooksQuery extends CwSingleReactQuery {} -export function useCwSingleProposalHooksQuery({ +export interface CwSingleProposalHooksQuery extends CwSingleReactQuery {} +export function useCwSingleProposalHooksQuery({ client, options -}: CwSingleProposalHooksQuery) { - return useQuery(["cwSingleProposalHooks", client.contractAddress], () => client.proposalHooks(), options); +}: CwSingleProposalHooksQuery) { + return useQuery(["cwSingleProposalHooks", client.contractAddress], () => client.proposalHooks(), options); } -export interface CwSingleListVotesQuery extends CwSingleReactQuery { +export interface CwSingleListVotesQuery extends CwSingleReactQuery { args: { limit?: number; proposalId: number; startAfter?: string; }; } -export function useCwSingleListVotesQuery({ +export function useCwSingleListVotesQuery({ client, args, options -}: CwSingleListVotesQuery) { - return useQuery(["cwSingleListVotes", client.contractAddress, JSON.stringify(args)], () => client.listVotes({ +}: CwSingleListVotesQuery) { + return useQuery(["cwSingleListVotes", client.contractAddress, JSON.stringify(args)], () => client.listVotes({ limit: args.limit, proposalId: args.proposalId, startAfter: args.startAfter }), options); } -export interface CwSingleVoteQuery extends CwSingleReactQuery { +export interface CwSingleVoteQuery extends CwSingleReactQuery { args: { proposalId: number; voter: string; }; } -export function useCwSingleVoteQuery({ +export function useCwSingleVoteQuery({ client, args, options -}: CwSingleVoteQuery) { - return useQuery(["cwSingleVote", client.contractAddress, JSON.stringify(args)], () => client.vote({ +}: CwSingleVoteQuery) { + return useQuery(["cwSingleVote", client.contractAddress, JSON.stringify(args)], () => client.vote({ proposalId: args.proposalId, voter: args.voter }), options); } -export interface CwSingleProposalCountQuery extends CwSingleReactQuery {} -export function useCwSingleProposalCountQuery({ +export interface CwSingleProposalCountQuery extends CwSingleReactQuery {} +export function useCwSingleProposalCountQuery({ client, options -}: CwSingleProposalCountQuery) { - return useQuery(["cwSingleProposalCount", client.contractAddress], () => client.proposalCount(), options); +}: CwSingleProposalCountQuery) { + return useQuery(["cwSingleProposalCount", client.contractAddress], () => client.proposalCount(), options); } -export interface CwSingleReverseProposalsQuery extends CwSingleReactQuery { +export interface CwSingleReverseProposalsQuery extends CwSingleReactQuery { args: { limit?: number; startBefore?: number; }; } -export function useCwSingleReverseProposalsQuery({ +export function useCwSingleReverseProposalsQuery({ client, args, options -}: CwSingleReverseProposalsQuery) { - return useQuery(["cwSingleReverseProposals", client.contractAddress, JSON.stringify(args)], () => client.reverseProposals({ +}: CwSingleReverseProposalsQuery) { + return useQuery(["cwSingleReverseProposals", client.contractAddress, JSON.stringify(args)], () => client.reverseProposals({ limit: args.limit, startBefore: args.startBefore }), options); } -export interface CwSingleListProposalsQuery extends CwSingleReactQuery { +export interface CwSingleListProposalsQuery extends CwSingleReactQuery { args: { limit?: number; startAfter?: number; }; } -export function useCwSingleListProposalsQuery({ +export function useCwSingleListProposalsQuery({ client, args, options -}: CwSingleListProposalsQuery) { - return useQuery(["cwSingleListProposals", client.contractAddress, JSON.stringify(args)], () => client.listProposals({ +}: CwSingleListProposalsQuery) { + return useQuery(["cwSingleListProposals", client.contractAddress, JSON.stringify(args)], () => client.listProposals({ limit: args.limit, startAfter: args.startAfter }), options); } -export interface CwSingleProposalQuery extends CwSingleReactQuery { +export interface CwSingleProposalQuery extends CwSingleReactQuery { args: { proposalId: number; }; } -export function useCwSingleProposalQuery({ +export function useCwSingleProposalQuery({ client, args, options -}: CwSingleProposalQuery) { - return useQuery(["cwSingleProposal", client.contractAddress, JSON.stringify(args)], () => client.proposal({ +}: CwSingleProposalQuery) { + return useQuery(["cwSingleProposal", client.contractAddress, JSON.stringify(args)], () => client.proposal({ proposalId: args.proposalId }), options); } -export interface CwSingleConfigQuery extends CwSingleReactQuery {} -export function useCwSingleConfigQuery({ +export interface CwSingleConfigQuery extends CwSingleReactQuery {} +export function useCwSingleConfigQuery({ client, options -}: CwSingleConfigQuery) { - return useQuery(["cwSingleConfig", client.contractAddress], () => client.config(), options); +}: CwSingleConfigQuery) { + return useQuery(["cwSingleConfig", client.contractAddress], () => client.config(), options); } \ No newline at end of file diff --git a/__output__/builder/invoke/Factory.react-query.ts b/__output__/builder/invoke/Factory.react-query.ts index 1e9481eb..41b88b79 100644 --- a/__output__/builder/invoke/Factory.react-query.ts +++ b/__output__/builder/invoke/Factory.react-query.ts @@ -7,75 +7,75 @@ import { UseQueryOptions, useQuery } from "react-query"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { FactoryQueryClient } from "./Factory.client"; -export interface FactoryReactQuery { +export interface FactoryReactQuery { client: FactoryQueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface FactoryAdminAddrQuery extends FactoryReactQuery {} -export function useFactoryAdminAddrQuery({ +export interface FactoryAdminAddrQuery extends FactoryReactQuery {} +export function useFactoryAdminAddrQuery({ client, options -}: FactoryAdminAddrQuery) { - return useQuery(["factoryAdminAddr", client.contractAddress], () => client.adminAddr(), options); +}: FactoryAdminAddrQuery) { + return useQuery(["factoryAdminAddr", client.contractAddress], () => client.adminAddr(), options); } -export interface FactoryGovecAddrQuery extends FactoryReactQuery {} -export function useFactoryGovecAddrQuery({ +export interface FactoryGovecAddrQuery extends FactoryReactQuery {} +export function useFactoryGovecAddrQuery({ client, options -}: FactoryGovecAddrQuery) { - return useQuery(["factoryGovecAddr", client.contractAddress], () => client.govecAddr(), options); +}: FactoryGovecAddrQuery) { + return useQuery(["factoryGovecAddr", client.contractAddress], () => client.govecAddr(), options); } -export interface FactoryFeeQuery extends FactoryReactQuery {} -export function useFactoryFeeQuery({ +export interface FactoryFeeQuery extends FactoryReactQuery {} +export function useFactoryFeeQuery({ client, options -}: FactoryFeeQuery) { - return useQuery(["factoryFee", client.contractAddress], () => client.fee(), options); +}: FactoryFeeQuery) { + return useQuery(["factoryFee", client.contractAddress], () => client.fee(), options); } -export interface FactoryCodeIdQuery extends FactoryReactQuery { +export interface FactoryCodeIdQuery extends FactoryReactQuery { args: { ty: CodeIdType; }; } -export function useFactoryCodeIdQuery({ +export function useFactoryCodeIdQuery({ client, args, options -}: FactoryCodeIdQuery) { - return useQuery(["factoryCodeId", client.contractAddress, JSON.stringify(args)], () => client.codeId({ +}: FactoryCodeIdQuery) { + return useQuery(["factoryCodeId", client.contractAddress, JSON.stringify(args)], () => client.codeId({ ty: args.ty }), options); } -export interface FactoryWalletsOfQuery extends FactoryReactQuery { +export interface FactoryWalletsOfQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: string; user: string; }; } -export function useFactoryWalletsOfQuery({ +export function useFactoryWalletsOfQuery({ client, args, options -}: FactoryWalletsOfQuery) { - return useQuery(["factoryWalletsOf", client.contractAddress, JSON.stringify(args)], () => client.walletsOf({ +}: FactoryWalletsOfQuery) { + return useQuery(["factoryWalletsOf", client.contractAddress, JSON.stringify(args)], () => client.walletsOf({ limit: args.limit, startAfter: args.startAfter, user: args.user }), options); } -export interface FactoryWalletsQuery extends FactoryReactQuery { +export interface FactoryWalletsQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: WalletQueryPrefix; }; } -export function useFactoryWalletsQuery({ +export function useFactoryWalletsQuery({ client, args, options -}: FactoryWalletsQuery) { - return useQuery(["factoryWallets", client.contractAddress, JSON.stringify(args)], () => client.wallets({ +}: FactoryWalletsQuery) { + return useQuery(["factoryWallets", client.contractAddress, JSON.stringify(args)], () => client.wallets({ limit: args.limit, startAfter: args.startAfter }), options); diff --git a/__output__/builder/invoke/Minter.react-query.ts b/__output__/builder/invoke/Minter.react-query.ts index f97b612d..28483c5b 100644 --- a/__output__/builder/invoke/Minter.react-query.ts +++ b/__output__/builder/invoke/Minter.react-query.ts @@ -7,49 +7,49 @@ import { UseQueryOptions, useQuery } from "react-query"; import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; import { MinterQueryClient } from "./Minter.client"; -export interface MinterReactQuery { +export interface MinterReactQuery { client: MinterQueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface MinterMintCountQuery extends MinterReactQuery { +export interface MinterMintCountQuery extends MinterReactQuery { args: { address: string; }; } -export function useMinterMintCountQuery({ +export function useMinterMintCountQuery({ client, args, options -}: MinterMintCountQuery) { - return useQuery(["minterMintCount", client.contractAddress, JSON.stringify(args)], () => client.mintCount({ +}: MinterMintCountQuery) { + return useQuery(["minterMintCount", client.contractAddress, JSON.stringify(args)], () => client.mintCount({ address: args.address }), options); } -export interface MinterMintPriceQuery extends MinterReactQuery {} -export function useMinterMintPriceQuery({ +export interface MinterMintPriceQuery extends MinterReactQuery {} +export function useMinterMintPriceQuery({ client, options -}: MinterMintPriceQuery) { - return useQuery(["minterMintPrice", client.contractAddress], () => client.mintPrice(), options); +}: MinterMintPriceQuery) { + return useQuery(["minterMintPrice", client.contractAddress], () => client.mintPrice(), options); } -export interface MinterStartTimeQuery extends MinterReactQuery {} -export function useMinterStartTimeQuery({ +export interface MinterStartTimeQuery extends MinterReactQuery {} +export function useMinterStartTimeQuery({ client, options -}: MinterStartTimeQuery) { - return useQuery(["minterStartTime", client.contractAddress], () => client.startTime(), options); +}: MinterStartTimeQuery) { + return useQuery(["minterStartTime", client.contractAddress], () => client.startTime(), options); } -export interface MinterMintableNumTokensQuery extends MinterReactQuery {} -export function useMinterMintableNumTokensQuery({ +export interface MinterMintableNumTokensQuery extends MinterReactQuery {} +export function useMinterMintableNumTokensQuery({ client, options -}: MinterMintableNumTokensQuery) { - return useQuery(["minterMintableNumTokens", client.contractAddress], () => client.mintableNumTokens(), options); +}: MinterMintableNumTokensQuery) { + return useQuery(["minterMintableNumTokens", client.contractAddress], () => client.mintableNumTokens(), options); } -export interface MinterConfigQuery extends MinterReactQuery {} -export function useMinterConfigQuery({ +export interface MinterConfigQuery extends MinterReactQuery {} +export function useMinterConfigQuery({ client, options -}: MinterConfigQuery) { - return useQuery(["minterConfig", client.contractAddress], () => client.config(), options); +}: MinterConfigQuery) { + return useQuery(["minterConfig", client.contractAddress], () => client.config(), options); } \ No newline at end of file diff --git a/__output__/cosmwasm/CW4Group.react-query.ts b/__output__/cosmwasm/CW4Group.react-query.ts index 044bd4b9..5ee0ff4a 100644 --- a/__output__/cosmwasm/CW4Group.react-query.ts +++ b/__output__/cosmwasm/CW4Group.react-query.ts @@ -7,60 +7,60 @@ import { UseQueryOptions, useQuery } from "react-query"; import { InstantiateMsg, Member, ExecuteMsg, QueryMsg, QueryResponse, AdminResponse, TotalWeightResponse, MemberListResponse, MemberResponse, HooksResponse } from "./CW4Group.types"; import { CW4GroupQueryClient } from "./CW4Group.client"; -export interface CW4GroupReactQuery { +export interface CW4GroupReactQuery { client: CW4GroupQueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface CW4GroupHooksQuery extends CW4GroupReactQuery {} -export function useCW4GroupHooksQuery({ +export interface CW4GroupHooksQuery extends CW4GroupReactQuery {} +export function useCW4GroupHooksQuery({ client, options -}: CW4GroupHooksQuery) { - return useQuery(["cW4GroupHooks", client.contractAddress], () => client.hooks(), options); +}: CW4GroupHooksQuery) { + return useQuery(["cW4GroupHooks", client.contractAddress], () => client.hooks(), options); } -export interface CW4GroupMemberQuery extends CW4GroupReactQuery { +export interface CW4GroupMemberQuery extends CW4GroupReactQuery { args: { addr: string; atHeight?: number; }; } -export function useCW4GroupMemberQuery({ +export function useCW4GroupMemberQuery({ client, args, options -}: CW4GroupMemberQuery) { - return useQuery(["cW4GroupMember", client.contractAddress, JSON.stringify(args)], () => client.member({ +}: CW4GroupMemberQuery) { + return useQuery(["cW4GroupMember", client.contractAddress, JSON.stringify(args)], () => client.member({ addr: args.addr, atHeight: args.atHeight }), options); } -export interface CW4GroupListMembersQuery extends CW4GroupReactQuery { +export interface CW4GroupListMembersQuery extends CW4GroupReactQuery { args: { limit?: number; startAfter?: string; }; } -export function useCW4GroupListMembersQuery({ +export function useCW4GroupListMembersQuery({ client, args, options -}: CW4GroupListMembersQuery) { - return useQuery(["cW4GroupListMembers", client.contractAddress, JSON.stringify(args)], () => client.listMembers({ +}: CW4GroupListMembersQuery) { + return useQuery(["cW4GroupListMembers", client.contractAddress, JSON.stringify(args)], () => client.listMembers({ limit: args.limit, startAfter: args.startAfter }), options); } -export interface CW4GroupTotalWeightQuery extends CW4GroupReactQuery {} -export function useCW4GroupTotalWeightQuery({ +export interface CW4GroupTotalWeightQuery extends CW4GroupReactQuery {} +export function useCW4GroupTotalWeightQuery({ client, options -}: CW4GroupTotalWeightQuery) { - return useQuery(["cW4GroupTotalWeight", client.contractAddress], () => client.totalWeight(), options); +}: CW4GroupTotalWeightQuery) { + return useQuery(["cW4GroupTotalWeight", client.contractAddress], () => client.totalWeight(), options); } -export interface CW4GroupAdminQuery extends CW4GroupReactQuery {} -export function useCW4GroupAdminQuery({ +export interface CW4GroupAdminQuery extends CW4GroupReactQuery {} +export function useCW4GroupAdminQuery({ client, options -}: CW4GroupAdminQuery) { - return useQuery(["cW4GroupAdmin", client.contractAddress], () => client.admin(), options); +}: CW4GroupAdminQuery) { + return useQuery(["cW4GroupAdmin", client.contractAddress], () => client.admin(), options); } \ No newline at end of file diff --git a/__output__/daodao/cw-admin-factory/CwAdminFactory.react-query.ts b/__output__/daodao/cw-admin-factory/CwAdminFactory.react-query.ts index 731fdfc3..be2aa1b7 100644 --- a/__output__/daodao/cw-admin-factory/CwAdminFactory.react-query.ts +++ b/__output__/daodao/cw-admin-factory/CwAdminFactory.react-query.ts @@ -7,7 +7,7 @@ import { UseQueryOptions } from "react-query"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; -export interface CwAdminFactoryReactQuery { +export interface CwAdminFactoryReactQuery { client: CwAdminFactoryQueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } \ No newline at end of file diff --git a/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.react-query.ts b/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.react-query.ts index d30fda59..f219bfd3 100644 --- a/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.react-query.ts +++ b/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.react-query.ts @@ -7,64 +7,64 @@ import { UseQueryOptions, useQuery } from "react-query"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; -export interface CwCodeIdRegistryReactQuery { +export interface CwCodeIdRegistryReactQuery { client: CwCodeIdRegistryQueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface CwCodeIdRegistryListRegistrationsQuery extends CwCodeIdRegistryReactQuery { +export interface CwCodeIdRegistryListRegistrationsQuery extends CwCodeIdRegistryReactQuery { args: { chainId: string; name: string; }; } -export function useCwCodeIdRegistryListRegistrationsQuery({ +export function useCwCodeIdRegistryListRegistrationsQuery({ client, args, options -}: CwCodeIdRegistryListRegistrationsQuery) { - return useQuery(["cwCodeIdRegistryListRegistrations", client.contractAddress, JSON.stringify(args)], () => client.listRegistrations({ +}: CwCodeIdRegistryListRegistrationsQuery) { + return useQuery(["cwCodeIdRegistryListRegistrations", client.contractAddress, JSON.stringify(args)], () => client.listRegistrations({ chainId: args.chainId, name: args.name }), options); } -export interface CwCodeIdRegistryInfoForCodeIdQuery extends CwCodeIdRegistryReactQuery { +export interface CwCodeIdRegistryInfoForCodeIdQuery extends CwCodeIdRegistryReactQuery { args: { chainId: string; codeId: number; }; } -export function useCwCodeIdRegistryInfoForCodeIdQuery({ +export function useCwCodeIdRegistryInfoForCodeIdQuery({ client, args, options -}: CwCodeIdRegistryInfoForCodeIdQuery) { - return useQuery(["cwCodeIdRegistryInfoForCodeId", client.contractAddress, JSON.stringify(args)], () => client.infoForCodeId({ +}: CwCodeIdRegistryInfoForCodeIdQuery) { + return useQuery(["cwCodeIdRegistryInfoForCodeId", client.contractAddress, JSON.stringify(args)], () => client.infoForCodeId({ chainId: args.chainId, codeId: args.codeId }), options); } -export interface CwCodeIdRegistryGetRegistrationQuery extends CwCodeIdRegistryReactQuery { +export interface CwCodeIdRegistryGetRegistrationQuery extends CwCodeIdRegistryReactQuery { args: { chainId: string; name: string; version?: string; }; } -export function useCwCodeIdRegistryGetRegistrationQuery({ +export function useCwCodeIdRegistryGetRegistrationQuery({ client, args, options -}: CwCodeIdRegistryGetRegistrationQuery) { - return useQuery(["cwCodeIdRegistryGetRegistration", client.contractAddress, JSON.stringify(args)], () => client.getRegistration({ +}: CwCodeIdRegistryGetRegistrationQuery) { + return useQuery(["cwCodeIdRegistryGetRegistration", client.contractAddress, JSON.stringify(args)], () => client.getRegistration({ chainId: args.chainId, name: args.name, version: args.version }), options); } -export interface CwCodeIdRegistryConfigQuery extends CwCodeIdRegistryReactQuery {} -export function useCwCodeIdRegistryConfigQuery({ +export interface CwCodeIdRegistryConfigQuery extends CwCodeIdRegistryReactQuery {} +export function useCwCodeIdRegistryConfigQuery({ client, options -}: CwCodeIdRegistryConfigQuery) { - return useQuery(["cwCodeIdRegistryConfig", client.contractAddress], () => client.config(), options); +}: CwCodeIdRegistryConfigQuery) { + return useQuery(["cwCodeIdRegistryConfig", client.contractAddress], () => client.config(), options); } \ No newline at end of file diff --git a/__output__/daodao/cw-named-groups/CwNamedGroups.react-query.ts b/__output__/daodao/cw-named-groups/CwNamedGroups.react-query.ts index d53e040b..5451d8c7 100644 --- a/__output__/daodao/cw-named-groups/CwNamedGroups.react-query.ts +++ b/__output__/daodao/cw-named-groups/CwNamedGroups.react-query.ts @@ -7,66 +7,66 @@ import { UseQueryOptions, useQuery } from "react-query"; import { DumpResponse, Group, ExecuteMsg, InstantiateMsg, Addr, ListAddressesResponse, ListGroupsResponse, QueryMsg } from "./CwNamedGroups.types"; import { CwNamedGroupsQueryClient } from "./CwNamedGroups.client"; -export interface CwNamedGroupsReactQuery { +export interface CwNamedGroupsReactQuery { client: CwNamedGroupsQueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface CwNamedGroupsIsAddressInGroupQuery extends CwNamedGroupsReactQuery { +export interface CwNamedGroupsIsAddressInGroupQuery extends CwNamedGroupsReactQuery { args: { address: string; group: string; }; } -export function useCwNamedGroupsIsAddressInGroupQuery({ +export function useCwNamedGroupsIsAddressInGroupQuery({ client, args, options -}: CwNamedGroupsIsAddressInGroupQuery) { - return useQuery(["cwNamedGroupsIsAddressInGroup", client.contractAddress, JSON.stringify(args)], () => client.isAddressInGroup({ +}: CwNamedGroupsIsAddressInGroupQuery) { + return useQuery(["cwNamedGroupsIsAddressInGroup", client.contractAddress, JSON.stringify(args)], () => client.isAddressInGroup({ address: args.address, group: args.group }), options); } -export interface CwNamedGroupsListAddressesQuery extends CwNamedGroupsReactQuery { +export interface CwNamedGroupsListAddressesQuery extends CwNamedGroupsReactQuery { args: { group: string; limit?: number; offset?: number; }; } -export function useCwNamedGroupsListAddressesQuery({ +export function useCwNamedGroupsListAddressesQuery({ client, args, options -}: CwNamedGroupsListAddressesQuery) { - return useQuery(["cwNamedGroupsListAddresses", client.contractAddress, JSON.stringify(args)], () => client.listAddresses({ +}: CwNamedGroupsListAddressesQuery) { + return useQuery(["cwNamedGroupsListAddresses", client.contractAddress, JSON.stringify(args)], () => client.listAddresses({ group: args.group, limit: args.limit, offset: args.offset }), options); } -export interface CwNamedGroupsListGroupsQuery extends CwNamedGroupsReactQuery { +export interface CwNamedGroupsListGroupsQuery extends CwNamedGroupsReactQuery { args: { address: string; limit?: number; offset?: number; }; } -export function useCwNamedGroupsListGroupsQuery({ +export function useCwNamedGroupsListGroupsQuery({ client, args, options -}: CwNamedGroupsListGroupsQuery) { - return useQuery(["cwNamedGroupsListGroups", client.contractAddress, JSON.stringify(args)], () => client.listGroups({ +}: CwNamedGroupsListGroupsQuery) { + return useQuery(["cwNamedGroupsListGroups", client.contractAddress, JSON.stringify(args)], () => client.listGroups({ address: args.address, limit: args.limit, offset: args.offset }), options); } -export interface CwNamedGroupsDumpQuery extends CwNamedGroupsReactQuery {} -export function useCwNamedGroupsDumpQuery({ +export interface CwNamedGroupsDumpQuery extends CwNamedGroupsReactQuery {} +export function useCwNamedGroupsDumpQuery({ client, options -}: CwNamedGroupsDumpQuery) { - return useQuery(["cwNamedGroupsDump", client.contractAddress], () => client.dump(), options); +}: CwNamedGroupsDumpQuery) { + return useQuery(["cwNamedGroupsDump", client.contractAddress], () => client.dump(), options); } \ No newline at end of file diff --git a/__output__/daodao/cw-proposal-single/CwProposalSingle.react-query.ts b/__output__/daodao/cw-proposal-single/CwProposalSingle.react-query.ts index 03e35352..4ad925ce 100644 --- a/__output__/daodao/cw-proposal-single/CwProposalSingle.react-query.ts +++ b/__output__/daodao/cw-proposal-single/CwProposalSingle.react-query.ts @@ -7,122 +7,122 @@ import { UseQueryOptions, useQuery } from "react-query"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwProposalSingle.types"; import { CwProposalSingleQueryClient } from "./CwProposalSingle.client"; -export interface CwProposalSingleReactQuery { +export interface CwProposalSingleReactQuery { client: CwProposalSingleQueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface CwProposalSingleInfoQuery extends CwProposalSingleReactQuery {} -export function useCwProposalSingleInfoQuery({ +export interface CwProposalSingleInfoQuery extends CwProposalSingleReactQuery {} +export function useCwProposalSingleInfoQuery({ client, options -}: CwProposalSingleInfoQuery) { - return useQuery(["cwProposalSingleInfo", client.contractAddress], () => client.info(), options); +}: CwProposalSingleInfoQuery) { + return useQuery(["cwProposalSingleInfo", client.contractAddress], () => client.info(), options); } -export interface CwProposalSingleVoteHooksQuery extends CwProposalSingleReactQuery {} -export function useCwProposalSingleVoteHooksQuery({ +export interface CwProposalSingleVoteHooksQuery extends CwProposalSingleReactQuery {} +export function useCwProposalSingleVoteHooksQuery({ client, options -}: CwProposalSingleVoteHooksQuery) { - return useQuery(["cwProposalSingleVoteHooks", client.contractAddress], () => client.voteHooks(), options); +}: CwProposalSingleVoteHooksQuery) { + return useQuery(["cwProposalSingleVoteHooks", client.contractAddress], () => client.voteHooks(), options); } -export interface CwProposalSingleProposalHooksQuery extends CwProposalSingleReactQuery {} -export function useCwProposalSingleProposalHooksQuery({ +export interface CwProposalSingleProposalHooksQuery extends CwProposalSingleReactQuery {} +export function useCwProposalSingleProposalHooksQuery({ client, options -}: CwProposalSingleProposalHooksQuery) { - return useQuery(["cwProposalSingleProposalHooks", client.contractAddress], () => client.proposalHooks(), options); +}: CwProposalSingleProposalHooksQuery) { + return useQuery(["cwProposalSingleProposalHooks", client.contractAddress], () => client.proposalHooks(), options); } -export interface CwProposalSingleListVotesQuery extends CwProposalSingleReactQuery { +export interface CwProposalSingleListVotesQuery extends CwProposalSingleReactQuery { args: { limit?: number; proposalId: number; startAfter?: string; }; } -export function useCwProposalSingleListVotesQuery({ +export function useCwProposalSingleListVotesQuery({ client, args, options -}: CwProposalSingleListVotesQuery) { - return useQuery(["cwProposalSingleListVotes", client.contractAddress, JSON.stringify(args)], () => client.listVotes({ +}: CwProposalSingleListVotesQuery) { + return useQuery(["cwProposalSingleListVotes", client.contractAddress, JSON.stringify(args)], () => client.listVotes({ limit: args.limit, proposalId: args.proposalId, startAfter: args.startAfter }), options); } -export interface CwProposalSingleVoteQuery extends CwProposalSingleReactQuery { +export interface CwProposalSingleVoteQuery extends CwProposalSingleReactQuery { args: { proposalId: number; voter: string; }; } -export function useCwProposalSingleVoteQuery({ +export function useCwProposalSingleVoteQuery({ client, args, options -}: CwProposalSingleVoteQuery) { - return useQuery(["cwProposalSingleVote", client.contractAddress, JSON.stringify(args)], () => client.vote({ +}: CwProposalSingleVoteQuery) { + return useQuery(["cwProposalSingleVote", client.contractAddress, JSON.stringify(args)], () => client.vote({ proposalId: args.proposalId, voter: args.voter }), options); } -export interface CwProposalSingleProposalCountQuery extends CwProposalSingleReactQuery {} -export function useCwProposalSingleProposalCountQuery({ +export interface CwProposalSingleProposalCountQuery extends CwProposalSingleReactQuery {} +export function useCwProposalSingleProposalCountQuery({ client, options -}: CwProposalSingleProposalCountQuery) { - return useQuery(["cwProposalSingleProposalCount", client.contractAddress], () => client.proposalCount(), options); +}: CwProposalSingleProposalCountQuery) { + return useQuery(["cwProposalSingleProposalCount", client.contractAddress], () => client.proposalCount(), options); } -export interface CwProposalSingleReverseProposalsQuery extends CwProposalSingleReactQuery { +export interface CwProposalSingleReverseProposalsQuery extends CwProposalSingleReactQuery { args: { limit?: number; startBefore?: number; }; } -export function useCwProposalSingleReverseProposalsQuery({ +export function useCwProposalSingleReverseProposalsQuery({ client, args, options -}: CwProposalSingleReverseProposalsQuery) { - return useQuery(["cwProposalSingleReverseProposals", client.contractAddress, JSON.stringify(args)], () => client.reverseProposals({ +}: CwProposalSingleReverseProposalsQuery) { + return useQuery(["cwProposalSingleReverseProposals", client.contractAddress, JSON.stringify(args)], () => client.reverseProposals({ limit: args.limit, startBefore: args.startBefore }), options); } -export interface CwProposalSingleListProposalsQuery extends CwProposalSingleReactQuery { +export interface CwProposalSingleListProposalsQuery extends CwProposalSingleReactQuery { args: { limit?: number; startAfter?: number; }; } -export function useCwProposalSingleListProposalsQuery({ +export function useCwProposalSingleListProposalsQuery({ client, args, options -}: CwProposalSingleListProposalsQuery) { - return useQuery(["cwProposalSingleListProposals", client.contractAddress, JSON.stringify(args)], () => client.listProposals({ +}: CwProposalSingleListProposalsQuery) { + return useQuery(["cwProposalSingleListProposals", client.contractAddress, JSON.stringify(args)], () => client.listProposals({ limit: args.limit, startAfter: args.startAfter }), options); } -export interface CwProposalSingleProposalQuery extends CwProposalSingleReactQuery { +export interface CwProposalSingleProposalQuery extends CwProposalSingleReactQuery { args: { proposalId: number; }; } -export function useCwProposalSingleProposalQuery({ +export function useCwProposalSingleProposalQuery({ client, args, options -}: CwProposalSingleProposalQuery) { - return useQuery(["cwProposalSingleProposal", client.contractAddress, JSON.stringify(args)], () => client.proposal({ +}: CwProposalSingleProposalQuery) { + return useQuery(["cwProposalSingleProposal", client.contractAddress, JSON.stringify(args)], () => client.proposal({ proposalId: args.proposalId }), options); } -export interface CwProposalSingleConfigQuery extends CwProposalSingleReactQuery {} -export function useCwProposalSingleConfigQuery({ +export interface CwProposalSingleConfigQuery extends CwProposalSingleReactQuery {} +export function useCwProposalSingleConfigQuery({ client, options -}: CwProposalSingleConfigQuery) { - return useQuery(["cwProposalSingleConfig", client.contractAddress], () => client.config(), options); +}: CwProposalSingleConfigQuery) { + return useQuery(["cwProposalSingleConfig", client.contractAddress], () => client.config(), options); } \ No newline at end of file diff --git a/__output__/minter/Minter.react-query.ts b/__output__/minter/Minter.react-query.ts index f97b612d..28483c5b 100644 --- a/__output__/minter/Minter.react-query.ts +++ b/__output__/minter/Minter.react-query.ts @@ -7,49 +7,49 @@ import { UseQueryOptions, useQuery } from "react-query"; import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; import { MinterQueryClient } from "./Minter.client"; -export interface MinterReactQuery { +export interface MinterReactQuery { client: MinterQueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface MinterMintCountQuery extends MinterReactQuery { +export interface MinterMintCountQuery extends MinterReactQuery { args: { address: string; }; } -export function useMinterMintCountQuery({ +export function useMinterMintCountQuery({ client, args, options -}: MinterMintCountQuery) { - return useQuery(["minterMintCount", client.contractAddress, JSON.stringify(args)], () => client.mintCount({ +}: MinterMintCountQuery) { + return useQuery(["minterMintCount", client.contractAddress, JSON.stringify(args)], () => client.mintCount({ address: args.address }), options); } -export interface MinterMintPriceQuery extends MinterReactQuery {} -export function useMinterMintPriceQuery({ +export interface MinterMintPriceQuery extends MinterReactQuery {} +export function useMinterMintPriceQuery({ client, options -}: MinterMintPriceQuery) { - return useQuery(["minterMintPrice", client.contractAddress], () => client.mintPrice(), options); +}: MinterMintPriceQuery) { + return useQuery(["minterMintPrice", client.contractAddress], () => client.mintPrice(), options); } -export interface MinterStartTimeQuery extends MinterReactQuery {} -export function useMinterStartTimeQuery({ +export interface MinterStartTimeQuery extends MinterReactQuery {} +export function useMinterStartTimeQuery({ client, options -}: MinterStartTimeQuery) { - return useQuery(["minterStartTime", client.contractAddress], () => client.startTime(), options); +}: MinterStartTimeQuery) { + return useQuery(["minterStartTime", client.contractAddress], () => client.startTime(), options); } -export interface MinterMintableNumTokensQuery extends MinterReactQuery {} -export function useMinterMintableNumTokensQuery({ +export interface MinterMintableNumTokensQuery extends MinterReactQuery {} +export function useMinterMintableNumTokensQuery({ client, options -}: MinterMintableNumTokensQuery) { - return useQuery(["minterMintableNumTokens", client.contractAddress], () => client.mintableNumTokens(), options); +}: MinterMintableNumTokensQuery) { + return useQuery(["minterMintableNumTokens", client.contractAddress], () => client.mintableNumTokens(), options); } -export interface MinterConfigQuery extends MinterReactQuery {} -export function useMinterConfigQuery({ +export interface MinterConfigQuery extends MinterReactQuery {} +export function useMinterConfigQuery({ client, options -}: MinterConfigQuery) { - return useQuery(["minterConfig", client.contractAddress], () => client.config(), options); +}: MinterConfigQuery) { + return useQuery(["minterConfig", client.contractAddress], () => client.config(), options); } \ No newline at end of file diff --git a/__output__/sg721/Sg721.react-query.ts b/__output__/sg721/Sg721.react-query.ts index dba7c0be..c4ba9cfa 100644 --- a/__output__/sg721/Sg721.react-query.ts +++ b/__output__/sg721/Sg721.react-query.ts @@ -7,103 +7,103 @@ import { UseQueryOptions, useQuery } from "react-query"; import { Expiration, Timestamp, Uint64, AllNftInfoResponse, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, AllOperatorsResponse, AllTokensResponse, ApprovalResponse, ApprovalsResponse, Decimal, CollectionInfoResponse, RoyaltyInfoResponse, ContractInfoResponse, ExecuteMsgForEmpty, Binary, MintMsgForEmpty, InstantiateMsg, CollectionInfoForRoyaltyInfoResponse, MinterResponse, NftInfoResponse, NumTokensResponse, OperatorsResponse, QueryMsg, TokensResponse } from "./Sg721.types"; import { Sg721QueryClient } from "./Sg721.client"; -export interface Sg721ReactQuery { +export interface Sg721ReactQuery { client: Sg721QueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface Sg721CollectionInfoQuery extends Sg721ReactQuery {} -export function useSg721CollectionInfoQuery({ +export interface Sg721CollectionInfoQuery extends Sg721ReactQuery {} +export function useSg721CollectionInfoQuery({ client, options -}: Sg721CollectionInfoQuery) { - return useQuery(["sg721CollectionInfo", client.contractAddress], () => client.collectionInfo(), options); +}: Sg721CollectionInfoQuery) { + return useQuery(["sg721CollectionInfo", client.contractAddress], () => client.collectionInfo(), options); } -export interface Sg721MinterQuery extends Sg721ReactQuery {} -export function useSg721MinterQuery({ +export interface Sg721MinterQuery extends Sg721ReactQuery {} +export function useSg721MinterQuery({ client, options -}: Sg721MinterQuery) { - return useQuery(["sg721Minter", client.contractAddress], () => client.minter(), options); +}: Sg721MinterQuery) { + return useQuery(["sg721Minter", client.contractAddress], () => client.minter(), options); } -export interface Sg721AllTokensQuery extends Sg721ReactQuery { +export interface Sg721AllTokensQuery extends Sg721ReactQuery { args: { limit?: number; startAfter?: string; }; } -export function useSg721AllTokensQuery({ +export function useSg721AllTokensQuery({ client, args, options -}: Sg721AllTokensQuery) { - return useQuery(["sg721AllTokens", client.contractAddress, JSON.stringify(args)], () => client.allTokens({ +}: Sg721AllTokensQuery) { + return useQuery(["sg721AllTokens", client.contractAddress, JSON.stringify(args)], () => client.allTokens({ limit: args.limit, startAfter: args.startAfter }), options); } -export interface Sg721TokensQuery extends Sg721ReactQuery { +export interface Sg721TokensQuery extends Sg721ReactQuery { args: { limit?: number; owner: string; startAfter?: string; }; } -export function useSg721TokensQuery({ +export function useSg721TokensQuery({ client, args, options -}: Sg721TokensQuery) { - return useQuery(["sg721Tokens", client.contractAddress, JSON.stringify(args)], () => client.tokens({ +}: Sg721TokensQuery) { + return useQuery(["sg721Tokens", client.contractAddress, JSON.stringify(args)], () => client.tokens({ limit: args.limit, owner: args.owner, startAfter: args.startAfter }), options); } -export interface Sg721AllNftInfoQuery extends Sg721ReactQuery { +export interface Sg721AllNftInfoQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; tokenId: string; }; } -export function useSg721AllNftInfoQuery({ +export function useSg721AllNftInfoQuery({ client, args, options -}: Sg721AllNftInfoQuery) { - return useQuery(["sg721AllNftInfo", client.contractAddress, JSON.stringify(args)], () => client.allNftInfo({ +}: Sg721AllNftInfoQuery) { + return useQuery(["sg721AllNftInfo", client.contractAddress, JSON.stringify(args)], () => client.allNftInfo({ includeExpired: args.includeExpired, tokenId: args.tokenId }), options); } -export interface Sg721NftInfoQuery extends Sg721ReactQuery { +export interface Sg721NftInfoQuery extends Sg721ReactQuery { args: { tokenId: string; }; } -export function useSg721NftInfoQuery({ +export function useSg721NftInfoQuery({ client, args, options -}: Sg721NftInfoQuery) { - return useQuery(["sg721NftInfo", client.contractAddress, JSON.stringify(args)], () => client.nftInfo({ +}: Sg721NftInfoQuery) { + return useQuery(["sg721NftInfo", client.contractAddress, JSON.stringify(args)], () => client.nftInfo({ tokenId: args.tokenId }), options); } -export interface Sg721ContractInfoQuery extends Sg721ReactQuery {} -export function useSg721ContractInfoQuery({ +export interface Sg721ContractInfoQuery extends Sg721ReactQuery {} +export function useSg721ContractInfoQuery({ client, options -}: Sg721ContractInfoQuery) { - return useQuery(["sg721ContractInfo", client.contractAddress], () => client.contractInfo(), options); +}: Sg721ContractInfoQuery) { + return useQuery(["sg721ContractInfo", client.contractAddress], () => client.contractInfo(), options); } -export interface Sg721NumTokensQuery extends Sg721ReactQuery {} -export function useSg721NumTokensQuery({ +export interface Sg721NumTokensQuery extends Sg721ReactQuery {} +export function useSg721NumTokensQuery({ client, options -}: Sg721NumTokensQuery) { - return useQuery(["sg721NumTokens", client.contractAddress], () => client.numTokens(), options); +}: Sg721NumTokensQuery) { + return useQuery(["sg721NumTokens", client.contractAddress], () => client.numTokens(), options); } -export interface Sg721AllOperatorsQuery extends Sg721ReactQuery { +export interface Sg721AllOperatorsQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; limit?: number; @@ -111,64 +111,64 @@ export interface Sg721AllOperatorsQuery extends Sg721ReactQuery({ client, args, options -}: Sg721AllOperatorsQuery) { - return useQuery(["sg721AllOperators", client.contractAddress, JSON.stringify(args)], () => client.allOperators({ +}: Sg721AllOperatorsQuery) { + return useQuery(["sg721AllOperators", client.contractAddress, JSON.stringify(args)], () => client.allOperators({ includeExpired: args.includeExpired, limit: args.limit, owner: args.owner, startAfter: args.startAfter }), options); } -export interface Sg721ApprovalsQuery extends Sg721ReactQuery { +export interface Sg721ApprovalsQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; tokenId: string; }; } -export function useSg721ApprovalsQuery({ +export function useSg721ApprovalsQuery({ client, args, options -}: Sg721ApprovalsQuery) { - return useQuery(["sg721Approvals", client.contractAddress, JSON.stringify(args)], () => client.approvals({ +}: Sg721ApprovalsQuery) { + return useQuery(["sg721Approvals", client.contractAddress, JSON.stringify(args)], () => client.approvals({ includeExpired: args.includeExpired, tokenId: args.tokenId }), options); } -export interface Sg721ApprovalQuery extends Sg721ReactQuery { +export interface Sg721ApprovalQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; spender: string; tokenId: string; }; } -export function useSg721ApprovalQuery({ +export function useSg721ApprovalQuery({ client, args, options -}: Sg721ApprovalQuery) { - return useQuery(["sg721Approval", client.contractAddress, JSON.stringify(args)], () => client.approval({ +}: Sg721ApprovalQuery) { + return useQuery(["sg721Approval", client.contractAddress, JSON.stringify(args)], () => client.approval({ includeExpired: args.includeExpired, spender: args.spender, tokenId: args.tokenId }), options); } -export interface Sg721OwnerOfQuery extends Sg721ReactQuery { +export interface Sg721OwnerOfQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; tokenId: string; }; } -export function useSg721OwnerOfQuery({ +export function useSg721OwnerOfQuery({ client, args, options -}: Sg721OwnerOfQuery) { - return useQuery(["sg721OwnerOf", client.contractAddress, JSON.stringify(args)], () => client.ownerOf({ +}: Sg721OwnerOfQuery) { + return useQuery(["sg721OwnerOf", client.contractAddress, JSON.stringify(args)], () => client.ownerOf({ includeExpired: args.includeExpired, tokenId: args.tokenId }), options); diff --git a/__output__/vectis/factory-optional-client/Factory.react-query.ts b/__output__/vectis/factory-optional-client/Factory.react-query.ts index 9288c29c..0514312c 100644 --- a/__output__/vectis/factory-optional-client/Factory.react-query.ts +++ b/__output__/vectis/factory-optional-client/Factory.react-query.ts @@ -7,66 +7,66 @@ import { UseQueryOptions, useQuery } from "react-query"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { FactoryQueryClient } from "./Factory.client"; -export interface FactoryReactQuery { +export interface FactoryReactQuery { client: FactoryQueryClient | undefined; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface FactoryAdminAddrQuery extends FactoryReactQuery {} -export function useFactoryAdminAddrQuery({ +export interface FactoryAdminAddrQuery extends FactoryReactQuery {} +export function useFactoryAdminAddrQuery({ client, options -}: FactoryAdminAddrQuery) { - return useQuery(["factoryAdminAddr", client?.contractAddress], () => client ? client.adminAddr() : Promise.reject(new Error("Invalid client")), { ...options, +}: FactoryAdminAddrQuery) { + return useQuery(["factoryAdminAddr", client?.contractAddress], () => client ? client.adminAddr() : Promise.reject(new Error("Invalid client")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface FactoryGovecAddrQuery extends FactoryReactQuery {} -export function useFactoryGovecAddrQuery({ +export interface FactoryGovecAddrQuery extends FactoryReactQuery {} +export function useFactoryGovecAddrQuery({ client, options -}: FactoryGovecAddrQuery) { - return useQuery(["factoryGovecAddr", client?.contractAddress], () => client ? client.govecAddr() : Promise.reject(new Error("Invalid client")), { ...options, +}: FactoryGovecAddrQuery) { + return useQuery(["factoryGovecAddr", client?.contractAddress], () => client ? client.govecAddr() : Promise.reject(new Error("Invalid client")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface FactoryFeeQuery extends FactoryReactQuery {} -export function useFactoryFeeQuery({ +export interface FactoryFeeQuery extends FactoryReactQuery {} +export function useFactoryFeeQuery({ client, options -}: FactoryFeeQuery) { - return useQuery(["factoryFee", client?.contractAddress], () => client ? client.fee() : Promise.reject(new Error("Invalid client")), { ...options, +}: FactoryFeeQuery) { + return useQuery(["factoryFee", client?.contractAddress], () => client ? client.fee() : Promise.reject(new Error("Invalid client")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface FactoryCodeIdQuery extends FactoryReactQuery { +export interface FactoryCodeIdQuery extends FactoryReactQuery { args: { ty: CodeIdType; }; } -export function useFactoryCodeIdQuery({ +export function useFactoryCodeIdQuery({ client, args, options -}: FactoryCodeIdQuery) { - return useQuery(["factoryCodeId", client?.contractAddress, JSON.stringify(args)], () => client ? client.codeId({ +}: FactoryCodeIdQuery) { + return useQuery(["factoryCodeId", client?.contractAddress, JSON.stringify(args)], () => client ? client.codeId({ ty: args.ty }) : Promise.reject(new Error("Invalid client")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface FactoryWalletsOfQuery extends FactoryReactQuery { +export interface FactoryWalletsOfQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: string; user: string; }; } -export function useFactoryWalletsOfQuery({ +export function useFactoryWalletsOfQuery({ client, args, options -}: FactoryWalletsOfQuery) { - return useQuery(["factoryWalletsOf", client?.contractAddress, JSON.stringify(args)], () => client ? client.walletsOf({ +}: FactoryWalletsOfQuery) { + return useQuery(["factoryWalletsOf", client?.contractAddress, JSON.stringify(args)], () => client ? client.walletsOf({ limit: args.limit, startAfter: args.startAfter, user: args.user @@ -74,18 +74,18 @@ export function useFactoryWalletsOfQuery({ enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface FactoryWalletsQuery extends FactoryReactQuery { +export interface FactoryWalletsQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: WalletQueryPrefix; }; } -export function useFactoryWalletsQuery({ +export function useFactoryWalletsQuery({ client, args, options -}: FactoryWalletsQuery) { - return useQuery(["factoryWallets", client?.contractAddress, JSON.stringify(args)], () => client ? client.wallets({ +}: FactoryWalletsQuery) { + return useQuery(["factoryWallets", client?.contractAddress, JSON.stringify(args)], () => client ? client.wallets({ limit: args.limit, startAfter: args.startAfter }) : Promise.reject(new Error("Invalid client")), { ...options, diff --git a/__output__/vectis/factory-v4-query/Factory.react-query.ts b/__output__/vectis/factory-v4-query/Factory.react-query.ts index 74af8235..fc74f99f 100644 --- a/__output__/vectis/factory-v4-query/Factory.react-query.ts +++ b/__output__/vectis/factory-v4-query/Factory.react-query.ts @@ -7,77 +7,77 @@ import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { FactoryQueryClient } from "./Factory.client"; -export interface FactoryReactQuery { +export interface FactoryReactQuery { client: FactoryQueryClient; - options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { initialData?: undefined; }; } -export interface FactoryAdminAddrQuery extends FactoryReactQuery {} -export function useFactoryAdminAddrQuery({ +export interface FactoryAdminAddrQuery extends FactoryReactQuery {} +export function useFactoryAdminAddrQuery({ client, options -}: FactoryAdminAddrQuery) { - return useQuery(["factoryAdminAddr", client.contractAddress], () => client.adminAddr(), options); +}: FactoryAdminAddrQuery) { + return useQuery(["factoryAdminAddr", client.contractAddress], () => client.adminAddr(), options); } -export interface FactoryGovecAddrQuery extends FactoryReactQuery {} -export function useFactoryGovecAddrQuery({ +export interface FactoryGovecAddrQuery extends FactoryReactQuery {} +export function useFactoryGovecAddrQuery({ client, options -}: FactoryGovecAddrQuery) { - return useQuery(["factoryGovecAddr", client.contractAddress], () => client.govecAddr(), options); +}: FactoryGovecAddrQuery) { + return useQuery(["factoryGovecAddr", client.contractAddress], () => client.govecAddr(), options); } -export interface FactoryFeeQuery extends FactoryReactQuery {} -export function useFactoryFeeQuery({ +export interface FactoryFeeQuery extends FactoryReactQuery {} +export function useFactoryFeeQuery({ client, options -}: FactoryFeeQuery) { - return useQuery(["factoryFee", client.contractAddress], () => client.fee(), options); +}: FactoryFeeQuery) { + return useQuery(["factoryFee", client.contractAddress], () => client.fee(), options); } -export interface FactoryCodeIdQuery extends FactoryReactQuery { +export interface FactoryCodeIdQuery extends FactoryReactQuery { args: { ty: CodeIdType; }; } -export function useFactoryCodeIdQuery({ +export function useFactoryCodeIdQuery({ client, args, options -}: FactoryCodeIdQuery) { - return useQuery(["factoryCodeId", client.contractAddress, JSON.stringify(args)], () => client.codeId({ +}: FactoryCodeIdQuery) { + return useQuery(["factoryCodeId", client.contractAddress, JSON.stringify(args)], () => client.codeId({ ty: args.ty }), options); } -export interface FactoryWalletsOfQuery extends FactoryReactQuery { +export interface FactoryWalletsOfQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: string; user: string; }; } -export function useFactoryWalletsOfQuery({ +export function useFactoryWalletsOfQuery({ client, args, options -}: FactoryWalletsOfQuery) { - return useQuery(["factoryWalletsOf", client.contractAddress, JSON.stringify(args)], () => client.walletsOf({ +}: FactoryWalletsOfQuery) { + return useQuery(["factoryWalletsOf", client.contractAddress, JSON.stringify(args)], () => client.walletsOf({ limit: args.limit, startAfter: args.startAfter, user: args.user }), options); } -export interface FactoryWalletsQuery extends FactoryReactQuery { +export interface FactoryWalletsQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: WalletQueryPrefix; }; } -export function useFactoryWalletsQuery({ +export function useFactoryWalletsQuery({ client, args, options -}: FactoryWalletsQuery) { - return useQuery(["factoryWallets", client.contractAddress, JSON.stringify(args)], () => client.wallets({ +}: FactoryWalletsQuery) { + return useQuery(["factoryWallets", client.contractAddress, JSON.stringify(args)], () => client.wallets({ limit: args.limit, startAfter: args.startAfter }), options); diff --git a/__output__/vectis/factory-w-mutations/Factory.react-query.ts b/__output__/vectis/factory-w-mutations/Factory.react-query.ts index b85d1eb4..d1fa2ce2 100644 --- a/__output__/vectis/factory-w-mutations/Factory.react-query.ts +++ b/__output__/vectis/factory-w-mutations/Factory.react-query.ts @@ -9,77 +9,77 @@ import { ExecuteResult } from "@cosmjs/cosmwasm-stargate"; import { StdFee } from "@cosmjs/amino"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { FactoryQueryClient, FactoryClient } from "./Factory.client"; -export interface FactoryReactQuery { +export interface FactoryReactQuery { client: FactoryQueryClient; - options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { initialData?: undefined; }; } -export interface FactoryAdminAddrQuery extends FactoryReactQuery {} -export function useFactoryAdminAddrQuery({ +export interface FactoryAdminAddrQuery extends FactoryReactQuery {} +export function useFactoryAdminAddrQuery({ client, options -}: FactoryAdminAddrQuery) { - return useQuery(["factoryAdminAddr", client.contractAddress], () => client.adminAddr(), options); +}: FactoryAdminAddrQuery) { + return useQuery(["factoryAdminAddr", client.contractAddress], () => client.adminAddr(), options); } -export interface FactoryGovecAddrQuery extends FactoryReactQuery {} -export function useFactoryGovecAddrQuery({ +export interface FactoryGovecAddrQuery extends FactoryReactQuery {} +export function useFactoryGovecAddrQuery({ client, options -}: FactoryGovecAddrQuery) { - return useQuery(["factoryGovecAddr", client.contractAddress], () => client.govecAddr(), options); +}: FactoryGovecAddrQuery) { + return useQuery(["factoryGovecAddr", client.contractAddress], () => client.govecAddr(), options); } -export interface FactoryFeeQuery extends FactoryReactQuery {} -export function useFactoryFeeQuery({ +export interface FactoryFeeQuery extends FactoryReactQuery {} +export function useFactoryFeeQuery({ client, options -}: FactoryFeeQuery) { - return useQuery(["factoryFee", client.contractAddress], () => client.fee(), options); +}: FactoryFeeQuery) { + return useQuery(["factoryFee", client.contractAddress], () => client.fee(), options); } -export interface FactoryCodeIdQuery extends FactoryReactQuery { +export interface FactoryCodeIdQuery extends FactoryReactQuery { args: { ty: CodeIdType; }; } -export function useFactoryCodeIdQuery({ +export function useFactoryCodeIdQuery({ client, args, options -}: FactoryCodeIdQuery) { - return useQuery(["factoryCodeId", client.contractAddress, JSON.stringify(args)], () => client.codeId({ +}: FactoryCodeIdQuery) { + return useQuery(["factoryCodeId", client.contractAddress, JSON.stringify(args)], () => client.codeId({ ty: args.ty }), options); } -export interface FactoryWalletsOfQuery extends FactoryReactQuery { +export interface FactoryWalletsOfQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: string; user: string; }; } -export function useFactoryWalletsOfQuery({ +export function useFactoryWalletsOfQuery({ client, args, options -}: FactoryWalletsOfQuery) { - return useQuery(["factoryWalletsOf", client.contractAddress, JSON.stringify(args)], () => client.walletsOf({ +}: FactoryWalletsOfQuery) { + return useQuery(["factoryWalletsOf", client.contractAddress, JSON.stringify(args)], () => client.walletsOf({ limit: args.limit, startAfter: args.startAfter, user: args.user }), options); } -export interface FactoryWalletsQuery extends FactoryReactQuery { +export interface FactoryWalletsQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: WalletQueryPrefix; }; } -export function useFactoryWalletsQuery({ +export function useFactoryWalletsQuery({ client, args, options -}: FactoryWalletsQuery) { - return useQuery(["factoryWallets", client.contractAddress, JSON.stringify(args)], () => client.wallets({ +}: FactoryWalletsQuery) { + return useQuery(["factoryWallets", client.contractAddress, JSON.stringify(args)], () => client.wallets({ limit: args.limit, startAfter: args.startAfter }), options); diff --git a/__output__/vectis/factory/Factory.react-query.ts b/__output__/vectis/factory/Factory.react-query.ts index 1e9481eb..41b88b79 100644 --- a/__output__/vectis/factory/Factory.react-query.ts +++ b/__output__/vectis/factory/Factory.react-query.ts @@ -7,75 +7,75 @@ import { UseQueryOptions, useQuery } from "react-query"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { FactoryQueryClient } from "./Factory.client"; -export interface FactoryReactQuery { +export interface FactoryReactQuery { client: FactoryQueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface FactoryAdminAddrQuery extends FactoryReactQuery {} -export function useFactoryAdminAddrQuery({ +export interface FactoryAdminAddrQuery extends FactoryReactQuery {} +export function useFactoryAdminAddrQuery({ client, options -}: FactoryAdminAddrQuery) { - return useQuery(["factoryAdminAddr", client.contractAddress], () => client.adminAddr(), options); +}: FactoryAdminAddrQuery) { + return useQuery(["factoryAdminAddr", client.contractAddress], () => client.adminAddr(), options); } -export interface FactoryGovecAddrQuery extends FactoryReactQuery {} -export function useFactoryGovecAddrQuery({ +export interface FactoryGovecAddrQuery extends FactoryReactQuery {} +export function useFactoryGovecAddrQuery({ client, options -}: FactoryGovecAddrQuery) { - return useQuery(["factoryGovecAddr", client.contractAddress], () => client.govecAddr(), options); +}: FactoryGovecAddrQuery) { + return useQuery(["factoryGovecAddr", client.contractAddress], () => client.govecAddr(), options); } -export interface FactoryFeeQuery extends FactoryReactQuery {} -export function useFactoryFeeQuery({ +export interface FactoryFeeQuery extends FactoryReactQuery {} +export function useFactoryFeeQuery({ client, options -}: FactoryFeeQuery) { - return useQuery(["factoryFee", client.contractAddress], () => client.fee(), options); +}: FactoryFeeQuery) { + return useQuery(["factoryFee", client.contractAddress], () => client.fee(), options); } -export interface FactoryCodeIdQuery extends FactoryReactQuery { +export interface FactoryCodeIdQuery extends FactoryReactQuery { args: { ty: CodeIdType; }; } -export function useFactoryCodeIdQuery({ +export function useFactoryCodeIdQuery({ client, args, options -}: FactoryCodeIdQuery) { - return useQuery(["factoryCodeId", client.contractAddress, JSON.stringify(args)], () => client.codeId({ +}: FactoryCodeIdQuery) { + return useQuery(["factoryCodeId", client.contractAddress, JSON.stringify(args)], () => client.codeId({ ty: args.ty }), options); } -export interface FactoryWalletsOfQuery extends FactoryReactQuery { +export interface FactoryWalletsOfQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: string; user: string; }; } -export function useFactoryWalletsOfQuery({ +export function useFactoryWalletsOfQuery({ client, args, options -}: FactoryWalletsOfQuery) { - return useQuery(["factoryWalletsOf", client.contractAddress, JSON.stringify(args)], () => client.walletsOf({ +}: FactoryWalletsOfQuery) { + return useQuery(["factoryWalletsOf", client.contractAddress, JSON.stringify(args)], () => client.walletsOf({ limit: args.limit, startAfter: args.startAfter, user: args.user }), options); } -export interface FactoryWalletsQuery extends FactoryReactQuery { +export interface FactoryWalletsQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: WalletQueryPrefix; }; } -export function useFactoryWalletsQuery({ +export function useFactoryWalletsQuery({ client, args, options -}: FactoryWalletsQuery) { - return useQuery(["factoryWallets", client.contractAddress, JSON.stringify(args)], () => client.wallets({ +}: FactoryWalletsQuery) { + return useQuery(["factoryWallets", client.contractAddress, JSON.stringify(args)], () => client.wallets({ limit: args.limit, startAfter: args.startAfter }), options); diff --git a/__output__/vectis/govec/Govec.react-query.ts b/__output__/vectis/govec/Govec.react-query.ts index b58e53c2..638b2bd1 100644 --- a/__output__/vectis/govec/Govec.react-query.ts +++ b/__output__/vectis/govec/Govec.react-query.ts @@ -7,28 +7,28 @@ import { UseQueryOptions, useQuery } from "react-query"; import { CanExecuteRelayResponse, CosmosMsgForEmpty, BankMsg, Uint128, StakingMsg, DistributionMsg, WasmMsg, Binary, Coin, Empty, ExecuteMsgForEmpty, Addr, RelayTransaction, Guardians, MultiSig, InfoResponse, ContractVersion, InstantiateMsg, CreateWalletMsg, QueryMsg, Uint64 } from "./Govec.types"; import { GovecQueryClient } from "./Govec.client"; -export interface GovecReactQuery { +export interface GovecReactQuery { client: GovecQueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface GovecCanExecuteRelayQuery extends GovecReactQuery { +export interface GovecCanExecuteRelayQuery extends GovecReactQuery { args: { sender: string; }; } -export function useGovecCanExecuteRelayQuery({ +export function useGovecCanExecuteRelayQuery({ client, args, options -}: GovecCanExecuteRelayQuery) { - return useQuery(["govecCanExecuteRelay", client.contractAddress, JSON.stringify(args)], () => client.canExecuteRelay({ +}: GovecCanExecuteRelayQuery) { + return useQuery(["govecCanExecuteRelay", client.contractAddress, JSON.stringify(args)], () => client.canExecuteRelay({ sender: args.sender }), options); } -export interface GovecInfoQuery extends GovecReactQuery {} -export function useGovecInfoQuery({ +export interface GovecInfoQuery extends GovecReactQuery {} +export function useGovecInfoQuery({ client, options -}: GovecInfoQuery) { - return useQuery(["govecInfo", client.contractAddress], () => client.info(), options); +}: GovecInfoQuery) { + return useQuery(["govecInfo", client.contractAddress], () => client.info(), options); } \ No newline at end of file diff --git a/__output__/vectis/proxy/Proxy.react-query.ts b/__output__/vectis/proxy/Proxy.react-query.ts index e69c96e7..1bcb2754 100644 --- a/__output__/vectis/proxy/Proxy.react-query.ts +++ b/__output__/vectis/proxy/Proxy.react-query.ts @@ -7,28 +7,28 @@ import { UseQueryOptions, useQuery } from "react-query"; import { CanExecuteRelayResponse, CosmosMsgForEmpty, BankMsg, Uint128, StakingMsg, DistributionMsg, WasmMsg, Binary, Coin, Empty, ExecuteMsgForEmpty, Addr, RelayTransaction, Guardians, MultiSig, InfoResponse, ContractVersion, InstantiateMsg, CreateWalletMsg, QueryMsg, Uint64 } from "./Proxy.types"; import { ProxyQueryClient } from "./Proxy.client"; -export interface ProxyReactQuery { +export interface ProxyReactQuery { client: ProxyQueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface ProxyCanExecuteRelayQuery extends ProxyReactQuery { +export interface ProxyCanExecuteRelayQuery extends ProxyReactQuery { args: { sender: string; }; } -export function useProxyCanExecuteRelayQuery({ +export function useProxyCanExecuteRelayQuery({ client, args, options -}: ProxyCanExecuteRelayQuery) { - return useQuery(["proxyCanExecuteRelay", client.contractAddress, JSON.stringify(args)], () => client.canExecuteRelay({ +}: ProxyCanExecuteRelayQuery) { + return useQuery(["proxyCanExecuteRelay", client.contractAddress, JSON.stringify(args)], () => client.canExecuteRelay({ sender: args.sender }), options); } -export interface ProxyInfoQuery extends ProxyReactQuery {} -export function useProxyInfoQuery({ +export interface ProxyInfoQuery extends ProxyReactQuery {} +export function useProxyInfoQuery({ client, options -}: ProxyInfoQuery) { - return useQuery(["proxyInfo", client.contractAddress], () => client.info(), options); +}: ProxyInfoQuery) { + return useQuery(["proxyInfo", client.contractAddress], () => client.info(), options); } \ No newline at end of file diff --git a/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap b/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap index e8beaab1..afd93450 100644 --- a/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap +++ b/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap @@ -1,103 +1,103 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`createReactQueryHooks 1`] = ` -"export interface Sg721ReactQuery { +"export interface Sg721ReactQuery { client: Sg721QueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface Sg721CollectionInfoQuery extends Sg721ReactQuery {} -export function useSg721CollectionInfoQuery({ +export interface Sg721CollectionInfoQuery extends Sg721ReactQuery {} +export function useSg721CollectionInfoQuery({ client, options -}: Sg721CollectionInfoQuery) { - return useQuery([\\"sg721CollectionInfo\\", client.contractAddress], () => client.collectionInfo(), options); +}: Sg721CollectionInfoQuery) { + return useQuery([\\"sg721CollectionInfo\\", client.contractAddress], () => client.collectionInfo(), options); } -export interface Sg721MinterQuery extends Sg721ReactQuery {} -export function useSg721MinterQuery({ +export interface Sg721MinterQuery extends Sg721ReactQuery {} +export function useSg721MinterQuery({ client, options -}: Sg721MinterQuery) { - return useQuery([\\"sg721Minter\\", client.contractAddress], () => client.minter(), options); +}: Sg721MinterQuery) { + return useQuery([\\"sg721Minter\\", client.contractAddress], () => client.minter(), options); } -export interface Sg721AllTokensQuery extends Sg721ReactQuery { +export interface Sg721AllTokensQuery extends Sg721ReactQuery { args: { limit?: number; startAfter?: string; }; } -export function useSg721AllTokensQuery({ +export function useSg721AllTokensQuery({ client, args, options -}: Sg721AllTokensQuery) { - return useQuery([\\"sg721AllTokens\\", client.contractAddress, JSON.stringify(args)], () => client.allTokens({ +}: Sg721AllTokensQuery) { + return useQuery([\\"sg721AllTokens\\", client.contractAddress, JSON.stringify(args)], () => client.allTokens({ limit: args.limit, startAfter: args.startAfter }), options); } -export interface Sg721TokensQuery extends Sg721ReactQuery { +export interface Sg721TokensQuery extends Sg721ReactQuery { args: { limit?: number; owner: string; startAfter?: string; }; } -export function useSg721TokensQuery({ +export function useSg721TokensQuery({ client, args, options -}: Sg721TokensQuery) { - return useQuery([\\"sg721Tokens\\", client.contractAddress, JSON.stringify(args)], () => client.tokens({ +}: Sg721TokensQuery) { + return useQuery([\\"sg721Tokens\\", client.contractAddress, JSON.stringify(args)], () => client.tokens({ limit: args.limit, owner: args.owner, startAfter: args.startAfter }), options); } -export interface Sg721AllNftInfoQuery extends Sg721ReactQuery { +export interface Sg721AllNftInfoQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; tokenId: string; }; } -export function useSg721AllNftInfoQuery({ +export function useSg721AllNftInfoQuery({ client, args, options -}: Sg721AllNftInfoQuery) { - return useQuery([\\"sg721AllNftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.allNftInfo({ +}: Sg721AllNftInfoQuery) { + return useQuery([\\"sg721AllNftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.allNftInfo({ includeExpired: args.includeExpired, tokenId: args.tokenId }), options); } -export interface Sg721NftInfoQuery extends Sg721ReactQuery { +export interface Sg721NftInfoQuery extends Sg721ReactQuery { args: { tokenId: string; }; } -export function useSg721NftInfoQuery({ +export function useSg721NftInfoQuery({ client, args, options -}: Sg721NftInfoQuery) { - return useQuery([\\"sg721NftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.nftInfo({ +}: Sg721NftInfoQuery) { + return useQuery([\\"sg721NftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.nftInfo({ tokenId: args.tokenId }), options); } -export interface Sg721ContractInfoQuery extends Sg721ReactQuery {} -export function useSg721ContractInfoQuery({ +export interface Sg721ContractInfoQuery extends Sg721ReactQuery {} +export function useSg721ContractInfoQuery({ client, options -}: Sg721ContractInfoQuery) { - return useQuery([\\"sg721ContractInfo\\", client.contractAddress], () => client.contractInfo(), options); +}: Sg721ContractInfoQuery) { + return useQuery([\\"sg721ContractInfo\\", client.contractAddress], () => client.contractInfo(), options); } -export interface Sg721NumTokensQuery extends Sg721ReactQuery {} -export function useSg721NumTokensQuery({ +export interface Sg721NumTokensQuery extends Sg721ReactQuery {} +export function useSg721NumTokensQuery({ client, options -}: Sg721NumTokensQuery) { - return useQuery([\\"sg721NumTokens\\", client.contractAddress], () => client.numTokens(), options); +}: Sg721NumTokensQuery) { + return useQuery([\\"sg721NumTokens\\", client.contractAddress], () => client.numTokens(), options); } -export interface Sg721AllOperatorsQuery extends Sg721ReactQuery { +export interface Sg721AllOperatorsQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; limit?: number; @@ -105,64 +105,64 @@ export interface Sg721AllOperatorsQuery extends Sg721ReactQuery({ client, args, options -}: Sg721AllOperatorsQuery) { - return useQuery([\\"sg721AllOperators\\", client.contractAddress, JSON.stringify(args)], () => client.allOperators({ +}: Sg721AllOperatorsQuery) { + return useQuery([\\"sg721AllOperators\\", client.contractAddress, JSON.stringify(args)], () => client.allOperators({ includeExpired: args.includeExpired, limit: args.limit, owner: args.owner, startAfter: args.startAfter }), options); } -export interface Sg721ApprovalsQuery extends Sg721ReactQuery { +export interface Sg721ApprovalsQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; tokenId: string; }; } -export function useSg721ApprovalsQuery({ +export function useSg721ApprovalsQuery({ client, args, options -}: Sg721ApprovalsQuery) { - return useQuery([\\"sg721Approvals\\", client.contractAddress, JSON.stringify(args)], () => client.approvals({ +}: Sg721ApprovalsQuery) { + return useQuery([\\"sg721Approvals\\", client.contractAddress, JSON.stringify(args)], () => client.approvals({ includeExpired: args.includeExpired, tokenId: args.tokenId }), options); } -export interface Sg721ApprovalQuery extends Sg721ReactQuery { +export interface Sg721ApprovalQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; spender: string; tokenId: string; }; } -export function useSg721ApprovalQuery({ +export function useSg721ApprovalQuery({ client, args, options -}: Sg721ApprovalQuery) { - return useQuery([\\"sg721Approval\\", client.contractAddress, JSON.stringify(args)], () => client.approval({ +}: Sg721ApprovalQuery) { + return useQuery([\\"sg721Approval\\", client.contractAddress, JSON.stringify(args)], () => client.approval({ includeExpired: args.includeExpired, spender: args.spender, tokenId: args.tokenId }), options); } -export interface Sg721OwnerOfQuery extends Sg721ReactQuery { +export interface Sg721OwnerOfQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; tokenId: string; }; } -export function useSg721OwnerOfQuery({ +export function useSg721OwnerOfQuery({ client, args, options -}: Sg721OwnerOfQuery) { - return useQuery([\\"sg721OwnerOf\\", client.contractAddress, JSON.stringify(args)], () => client.ownerOf({ +}: Sg721OwnerOfQuery) { + return useQuery([\\"sg721OwnerOf\\", client.contractAddress, JSON.stringify(args)], () => client.ownerOf({ includeExpired: args.includeExpired, tokenId: args.tokenId }), options); @@ -170,59 +170,59 @@ export function useSg721OwnerOfQuery({ `; exports[`createReactQueryHooks 2`] = ` -"export interface Sg721ReactQuery { +"export interface Sg721ReactQuery { client: Sg721QueryClient | undefined; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface Sg721CollectionInfoQuery extends Sg721ReactQuery {} -export function useSg721CollectionInfoQuery({ +export interface Sg721CollectionInfoQuery extends Sg721ReactQuery {} +export function useSg721CollectionInfoQuery({ client, options -}: Sg721CollectionInfoQuery) { - return useQuery([\\"sg721CollectionInfo\\", client?.contractAddress], () => client ? client.collectionInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, +}: Sg721CollectionInfoQuery) { + return useQuery([\\"sg721CollectionInfo\\", client?.contractAddress], () => client ? client.collectionInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721MinterQuery extends Sg721ReactQuery {} -export function useSg721MinterQuery({ +export interface Sg721MinterQuery extends Sg721ReactQuery {} +export function useSg721MinterQuery({ client, options -}: Sg721MinterQuery) { - return useQuery([\\"sg721Minter\\", client?.contractAddress], () => client ? client.minter() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, +}: Sg721MinterQuery) { + return useQuery([\\"sg721Minter\\", client?.contractAddress], () => client ? client.minter() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721AllTokensQuery extends Sg721ReactQuery { +export interface Sg721AllTokensQuery extends Sg721ReactQuery { args: { limit?: number; startAfter?: string; }; } -export function useSg721AllTokensQuery({ +export function useSg721AllTokensQuery({ client, args, options -}: Sg721AllTokensQuery) { - return useQuery([\\"sg721AllTokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allTokens({ +}: Sg721AllTokensQuery) { + return useQuery([\\"sg721AllTokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allTokens({ limit: args.limit, startAfter: args.startAfter }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721TokensQuery extends Sg721ReactQuery { +export interface Sg721TokensQuery extends Sg721ReactQuery { args: { limit?: number; owner: string; startAfter?: string; }; } -export function useSg721TokensQuery({ +export function useSg721TokensQuery({ client, args, options -}: Sg721TokensQuery) { - return useQuery([\\"sg721Tokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.tokens({ +}: Sg721TokensQuery) { + return useQuery([\\"sg721Tokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.tokens({ limit: args.limit, owner: args.owner, startAfter: args.startAfter @@ -230,59 +230,59 @@ export function useSg721TokensQuery({ enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721AllNftInfoQuery extends Sg721ReactQuery { +export interface Sg721AllNftInfoQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; tokenId: string; }; } -export function useSg721AllNftInfoQuery({ +export function useSg721AllNftInfoQuery({ client, args, options -}: Sg721AllNftInfoQuery) { - return useQuery([\\"sg721AllNftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allNftInfo({ +}: Sg721AllNftInfoQuery) { + return useQuery([\\"sg721AllNftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allNftInfo({ includeExpired: args.includeExpired, tokenId: args.tokenId }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721NftInfoQuery extends Sg721ReactQuery { +export interface Sg721NftInfoQuery extends Sg721ReactQuery { args: { tokenId: string; }; } -export function useSg721NftInfoQuery({ +export function useSg721NftInfoQuery({ client, args, options -}: Sg721NftInfoQuery) { - return useQuery([\\"sg721NftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.nftInfo({ +}: Sg721NftInfoQuery) { + return useQuery([\\"sg721NftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.nftInfo({ tokenId: args.tokenId }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721ContractInfoQuery extends Sg721ReactQuery {} -export function useSg721ContractInfoQuery({ +export interface Sg721ContractInfoQuery extends Sg721ReactQuery {} +export function useSg721ContractInfoQuery({ client, options -}: Sg721ContractInfoQuery) { - return useQuery([\\"sg721ContractInfo\\", client?.contractAddress], () => client ? client.contractInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, +}: Sg721ContractInfoQuery) { + return useQuery([\\"sg721ContractInfo\\", client?.contractAddress], () => client ? client.contractInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721NumTokensQuery extends Sg721ReactQuery {} -export function useSg721NumTokensQuery({ +export interface Sg721NumTokensQuery extends Sg721ReactQuery {} +export function useSg721NumTokensQuery({ client, options -}: Sg721NumTokensQuery) { - return useQuery([\\"sg721NumTokens\\", client?.contractAddress], () => client ? client.numTokens() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, +}: Sg721NumTokensQuery) { + return useQuery([\\"sg721NumTokens\\", client?.contractAddress], () => client ? client.numTokens() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721AllOperatorsQuery extends Sg721ReactQuery { +export interface Sg721AllOperatorsQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; limit?: number; @@ -290,12 +290,12 @@ export interface Sg721AllOperatorsQuery extends Sg721ReactQuery({ client, args, options -}: Sg721AllOperatorsQuery) { - return useQuery([\\"sg721AllOperators\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allOperators({ +}: Sg721AllOperatorsQuery) { + return useQuery([\\"sg721AllOperators\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allOperators({ includeExpired: args.includeExpired, limit: args.limit, owner: args.owner, @@ -304,37 +304,37 @@ export function useSg721AllOperatorsQuery({ enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721ApprovalsQuery extends Sg721ReactQuery { +export interface Sg721ApprovalsQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; tokenId: string; }; } -export function useSg721ApprovalsQuery({ +export function useSg721ApprovalsQuery({ client, args, options -}: Sg721ApprovalsQuery) { - return useQuery([\\"sg721Approvals\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approvals({ +}: Sg721ApprovalsQuery) { + return useQuery([\\"sg721Approvals\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approvals({ includeExpired: args.includeExpired, tokenId: args.tokenId }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721ApprovalQuery extends Sg721ReactQuery { +export interface Sg721ApprovalQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; spender: string; tokenId: string; }; } -export function useSg721ApprovalQuery({ +export function useSg721ApprovalQuery({ client, args, options -}: Sg721ApprovalQuery) { - return useQuery([\\"sg721Approval\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approval({ +}: Sg721ApprovalQuery) { + return useQuery([\\"sg721Approval\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approval({ includeExpired: args.includeExpired, spender: args.spender, tokenId: args.tokenId @@ -342,18 +342,18 @@ export function useSg721ApprovalQuery({ enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721OwnerOfQuery extends Sg721ReactQuery { +export interface Sg721OwnerOfQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; tokenId: string; }; } -export function useSg721OwnerOfQuery({ +export function useSg721OwnerOfQuery({ client, args, options -}: Sg721OwnerOfQuery) { - return useQuery([\\"sg721OwnerOf\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.ownerOf({ +}: Sg721OwnerOfQuery) { + return useQuery([\\"sg721OwnerOf\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.ownerOf({ includeExpired: args.includeExpired, tokenId: args.tokenId }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, @@ -363,105 +363,105 @@ export function useSg721OwnerOfQuery({ `; exports[`createReactQueryHooks 3`] = ` -"export interface Sg721ReactQuery { +"export interface Sg721ReactQuery { client: Sg721QueryClient; - options?: Omit, \\"'queryKey' | 'queryFn' | 'initialData'\\"> & { + options?: Omit, \\"'queryKey' | 'queryFn' | 'initialData'\\"> & { initialData?: undefined; }; } -export interface Sg721CollectionInfoQuery extends Sg721ReactQuery {} -export function useSg721CollectionInfoQuery({ +export interface Sg721CollectionInfoQuery extends Sg721ReactQuery {} +export function useSg721CollectionInfoQuery({ client, options -}: Sg721CollectionInfoQuery) { - return useQuery([\\"sg721CollectionInfo\\", client.contractAddress], () => client.collectionInfo(), options); +}: Sg721CollectionInfoQuery) { + return useQuery([\\"sg721CollectionInfo\\", client.contractAddress], () => client.collectionInfo(), options); } -export interface Sg721MinterQuery extends Sg721ReactQuery {} -export function useSg721MinterQuery({ +export interface Sg721MinterQuery extends Sg721ReactQuery {} +export function useSg721MinterQuery({ client, options -}: Sg721MinterQuery) { - return useQuery([\\"sg721Minter\\", client.contractAddress], () => client.minter(), options); +}: Sg721MinterQuery) { + return useQuery([\\"sg721Minter\\", client.contractAddress], () => client.minter(), options); } -export interface Sg721AllTokensQuery extends Sg721ReactQuery { +export interface Sg721AllTokensQuery extends Sg721ReactQuery { args: { limit?: number; startAfter?: string; }; } -export function useSg721AllTokensQuery({ +export function useSg721AllTokensQuery({ client, args, options -}: Sg721AllTokensQuery) { - return useQuery([\\"sg721AllTokens\\", client.contractAddress, JSON.stringify(args)], () => client.allTokens({ +}: Sg721AllTokensQuery) { + return useQuery([\\"sg721AllTokens\\", client.contractAddress, JSON.stringify(args)], () => client.allTokens({ limit: args.limit, startAfter: args.startAfter }), options); } -export interface Sg721TokensQuery extends Sg721ReactQuery { +export interface Sg721TokensQuery extends Sg721ReactQuery { args: { limit?: number; owner: string; startAfter?: string; }; } -export function useSg721TokensQuery({ +export function useSg721TokensQuery({ client, args, options -}: Sg721TokensQuery) { - return useQuery([\\"sg721Tokens\\", client.contractAddress, JSON.stringify(args)], () => client.tokens({ +}: Sg721TokensQuery) { + return useQuery([\\"sg721Tokens\\", client.contractAddress, JSON.stringify(args)], () => client.tokens({ limit: args.limit, owner: args.owner, startAfter: args.startAfter }), options); } -export interface Sg721AllNftInfoQuery extends Sg721ReactQuery { +export interface Sg721AllNftInfoQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; tokenId: string; }; } -export function useSg721AllNftInfoQuery({ +export function useSg721AllNftInfoQuery({ client, args, options -}: Sg721AllNftInfoQuery) { - return useQuery([\\"sg721AllNftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.allNftInfo({ +}: Sg721AllNftInfoQuery) { + return useQuery([\\"sg721AllNftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.allNftInfo({ includeExpired: args.includeExpired, tokenId: args.tokenId }), options); } -export interface Sg721NftInfoQuery extends Sg721ReactQuery { +export interface Sg721NftInfoQuery extends Sg721ReactQuery { args: { tokenId: string; }; } -export function useSg721NftInfoQuery({ +export function useSg721NftInfoQuery({ client, args, options -}: Sg721NftInfoQuery) { - return useQuery([\\"sg721NftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.nftInfo({ +}: Sg721NftInfoQuery) { + return useQuery([\\"sg721NftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.nftInfo({ tokenId: args.tokenId }), options); } -export interface Sg721ContractInfoQuery extends Sg721ReactQuery {} -export function useSg721ContractInfoQuery({ +export interface Sg721ContractInfoQuery extends Sg721ReactQuery {} +export function useSg721ContractInfoQuery({ client, options -}: Sg721ContractInfoQuery) { - return useQuery([\\"sg721ContractInfo\\", client.contractAddress], () => client.contractInfo(), options); +}: Sg721ContractInfoQuery) { + return useQuery([\\"sg721ContractInfo\\", client.contractAddress], () => client.contractInfo(), options); } -export interface Sg721NumTokensQuery extends Sg721ReactQuery {} -export function useSg721NumTokensQuery({ +export interface Sg721NumTokensQuery extends Sg721ReactQuery {} +export function useSg721NumTokensQuery({ client, options -}: Sg721NumTokensQuery) { - return useQuery([\\"sg721NumTokens\\", client.contractAddress], () => client.numTokens(), options); +}: Sg721NumTokensQuery) { + return useQuery([\\"sg721NumTokens\\", client.contractAddress], () => client.numTokens(), options); } -export interface Sg721AllOperatorsQuery extends Sg721ReactQuery { +export interface Sg721AllOperatorsQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; limit?: number; @@ -469,64 +469,64 @@ export interface Sg721AllOperatorsQuery extends Sg721ReactQuery({ client, args, options -}: Sg721AllOperatorsQuery) { - return useQuery([\\"sg721AllOperators\\", client.contractAddress, JSON.stringify(args)], () => client.allOperators({ +}: Sg721AllOperatorsQuery) { + return useQuery([\\"sg721AllOperators\\", client.contractAddress, JSON.stringify(args)], () => client.allOperators({ includeExpired: args.includeExpired, limit: args.limit, owner: args.owner, startAfter: args.startAfter }), options); } -export interface Sg721ApprovalsQuery extends Sg721ReactQuery { +export interface Sg721ApprovalsQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; tokenId: string; }; } -export function useSg721ApprovalsQuery({ +export function useSg721ApprovalsQuery({ client, args, options -}: Sg721ApprovalsQuery) { - return useQuery([\\"sg721Approvals\\", client.contractAddress, JSON.stringify(args)], () => client.approvals({ +}: Sg721ApprovalsQuery) { + return useQuery([\\"sg721Approvals\\", client.contractAddress, JSON.stringify(args)], () => client.approvals({ includeExpired: args.includeExpired, tokenId: args.tokenId }), options); } -export interface Sg721ApprovalQuery extends Sg721ReactQuery { +export interface Sg721ApprovalQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; spender: string; tokenId: string; }; } -export function useSg721ApprovalQuery({ +export function useSg721ApprovalQuery({ client, args, options -}: Sg721ApprovalQuery) { - return useQuery([\\"sg721Approval\\", client.contractAddress, JSON.stringify(args)], () => client.approval({ +}: Sg721ApprovalQuery) { + return useQuery([\\"sg721Approval\\", client.contractAddress, JSON.stringify(args)], () => client.approval({ includeExpired: args.includeExpired, spender: args.spender, tokenId: args.tokenId }), options); } -export interface Sg721OwnerOfQuery extends Sg721ReactQuery { +export interface Sg721OwnerOfQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; tokenId: string; }; } -export function useSg721OwnerOfQuery({ +export function useSg721OwnerOfQuery({ client, args, options -}: Sg721OwnerOfQuery) { - return useQuery([\\"sg721OwnerOf\\", client.contractAddress, JSON.stringify(args)], () => client.ownerOf({ +}: Sg721OwnerOfQuery) { + return useQuery([\\"sg721OwnerOf\\", client.contractAddress, JSON.stringify(args)], () => client.ownerOf({ includeExpired: args.includeExpired, tokenId: args.tokenId }), options); @@ -534,61 +534,61 @@ export function useSg721OwnerOfQuery({ `; exports[`createReactQueryHooks 4`] = ` -"export interface Sg721ReactQuery { +"export interface Sg721ReactQuery { client: Sg721QueryClient | undefined; - options?: Omit, \\"'queryKey' | 'queryFn' | 'initialData'\\"> & { + options?: Omit, \\"'queryKey' | 'queryFn' | 'initialData'\\"> & { initialData?: undefined; }; } -export interface Sg721CollectionInfoQuery extends Sg721ReactQuery {} -export function useSg721CollectionInfoQuery({ +export interface Sg721CollectionInfoQuery extends Sg721ReactQuery {} +export function useSg721CollectionInfoQuery({ client, options -}: Sg721CollectionInfoQuery) { - return useQuery([\\"sg721CollectionInfo\\", client?.contractAddress], () => client ? client.collectionInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, +}: Sg721CollectionInfoQuery) { + return useQuery([\\"sg721CollectionInfo\\", client?.contractAddress], () => client ? client.collectionInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721MinterQuery extends Sg721ReactQuery {} -export function useSg721MinterQuery({ +export interface Sg721MinterQuery extends Sg721ReactQuery {} +export function useSg721MinterQuery({ client, options -}: Sg721MinterQuery) { - return useQuery([\\"sg721Minter\\", client?.contractAddress], () => client ? client.minter() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, +}: Sg721MinterQuery) { + return useQuery([\\"sg721Minter\\", client?.contractAddress], () => client ? client.minter() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721AllTokensQuery extends Sg721ReactQuery { +export interface Sg721AllTokensQuery extends Sg721ReactQuery { args: { limit?: number; startAfter?: string; }; } -export function useSg721AllTokensQuery({ +export function useSg721AllTokensQuery({ client, args, options -}: Sg721AllTokensQuery) { - return useQuery([\\"sg721AllTokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allTokens({ +}: Sg721AllTokensQuery) { + return useQuery([\\"sg721AllTokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allTokens({ limit: args.limit, startAfter: args.startAfter }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721TokensQuery extends Sg721ReactQuery { +export interface Sg721TokensQuery extends Sg721ReactQuery { args: { limit?: number; owner: string; startAfter?: string; }; } -export function useSg721TokensQuery({ +export function useSg721TokensQuery({ client, args, options -}: Sg721TokensQuery) { - return useQuery([\\"sg721Tokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.tokens({ +}: Sg721TokensQuery) { + return useQuery([\\"sg721Tokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.tokens({ limit: args.limit, owner: args.owner, startAfter: args.startAfter @@ -596,59 +596,59 @@ export function useSg721TokensQuery({ enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721AllNftInfoQuery extends Sg721ReactQuery { +export interface Sg721AllNftInfoQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; tokenId: string; }; } -export function useSg721AllNftInfoQuery({ +export function useSg721AllNftInfoQuery({ client, args, options -}: Sg721AllNftInfoQuery) { - return useQuery([\\"sg721AllNftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allNftInfo({ +}: Sg721AllNftInfoQuery) { + return useQuery([\\"sg721AllNftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allNftInfo({ includeExpired: args.includeExpired, tokenId: args.tokenId }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721NftInfoQuery extends Sg721ReactQuery { +export interface Sg721NftInfoQuery extends Sg721ReactQuery { args: { tokenId: string; }; } -export function useSg721NftInfoQuery({ +export function useSg721NftInfoQuery({ client, args, options -}: Sg721NftInfoQuery) { - return useQuery([\\"sg721NftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.nftInfo({ +}: Sg721NftInfoQuery) { + return useQuery([\\"sg721NftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.nftInfo({ tokenId: args.tokenId }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721ContractInfoQuery extends Sg721ReactQuery {} -export function useSg721ContractInfoQuery({ +export interface Sg721ContractInfoQuery extends Sg721ReactQuery {} +export function useSg721ContractInfoQuery({ client, options -}: Sg721ContractInfoQuery) { - return useQuery([\\"sg721ContractInfo\\", client?.contractAddress], () => client ? client.contractInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, +}: Sg721ContractInfoQuery) { + return useQuery([\\"sg721ContractInfo\\", client?.contractAddress], () => client ? client.contractInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721NumTokensQuery extends Sg721ReactQuery {} -export function useSg721NumTokensQuery({ +export interface Sg721NumTokensQuery extends Sg721ReactQuery {} +export function useSg721NumTokensQuery({ client, options -}: Sg721NumTokensQuery) { - return useQuery([\\"sg721NumTokens\\", client?.contractAddress], () => client ? client.numTokens() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, +}: Sg721NumTokensQuery) { + return useQuery([\\"sg721NumTokens\\", client?.contractAddress], () => client ? client.numTokens() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721AllOperatorsQuery extends Sg721ReactQuery { +export interface Sg721AllOperatorsQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; limit?: number; @@ -656,12 +656,12 @@ export interface Sg721AllOperatorsQuery extends Sg721ReactQuery({ client, args, options -}: Sg721AllOperatorsQuery) { - return useQuery([\\"sg721AllOperators\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allOperators({ +}: Sg721AllOperatorsQuery) { + return useQuery([\\"sg721AllOperators\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allOperators({ includeExpired: args.includeExpired, limit: args.limit, owner: args.owner, @@ -670,37 +670,37 @@ export function useSg721AllOperatorsQuery({ enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721ApprovalsQuery extends Sg721ReactQuery { +export interface Sg721ApprovalsQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; tokenId: string; }; } -export function useSg721ApprovalsQuery({ +export function useSg721ApprovalsQuery({ client, args, options -}: Sg721ApprovalsQuery) { - return useQuery([\\"sg721Approvals\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approvals({ +}: Sg721ApprovalsQuery) { + return useQuery([\\"sg721Approvals\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approvals({ includeExpired: args.includeExpired, tokenId: args.tokenId }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721ApprovalQuery extends Sg721ReactQuery { +export interface Sg721ApprovalQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; spender: string; tokenId: string; }; } -export function useSg721ApprovalQuery({ +export function useSg721ApprovalQuery({ client, args, options -}: Sg721ApprovalQuery) { - return useQuery([\\"sg721Approval\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approval({ +}: Sg721ApprovalQuery) { + return useQuery([\\"sg721Approval\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approval({ includeExpired: args.includeExpired, spender: args.spender, tokenId: args.tokenId @@ -708,18 +708,18 @@ export function useSg721ApprovalQuery({ enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface Sg721OwnerOfQuery extends Sg721ReactQuery { +export interface Sg721OwnerOfQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; tokenId: string; }; } -export function useSg721OwnerOfQuery({ +export function useSg721OwnerOfQuery({ client, args, options -}: Sg721OwnerOfQuery) { - return useQuery([\\"sg721OwnerOf\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.ownerOf({ +}: Sg721OwnerOfQuery) { + return useQuery([\\"sg721OwnerOf\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.ownerOf({ includeExpired: args.includeExpired, tokenId: args.tokenId }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, diff --git a/packages/wasm-ast-types/src/react-query/react-query.ts b/packages/wasm-ast-types/src/react-query/react-query.ts index 548b8fea..b482934f 100644 --- a/packages/wasm-ast-types/src/react-query/react-query.ts +++ b/packages/wasm-ast-types/src/react-query/react-query.ts @@ -146,7 +146,9 @@ export const createReactQueryHook = ({ props = ['client', 'args', 'options']; } - return t.exportNamedDeclaration( + const selectResponseGenericTypeName = 'TData'; + + const queryFunctionDeclaration = t.functionDeclaration( t.identifier(hookName), [ @@ -162,7 +164,10 @@ export const createReactQueryHook = ({ }) ], t.tsTypeAnnotation(t.tsTypeReference( - t.identifier(hookParamsTypeName) + t.identifier(hookParamsTypeName), + t.tsTypeParameterInstantiation([ + t.tsTypeReference(t.identifier(selectResponseGenericTypeName)) + ]) )) ) ], @@ -246,7 +251,7 @@ export const createReactQueryHook = ({ t.identifier('Error') ), t.tsTypeReference( - t.identifier(responseType) + t.identifier(selectResponseGenericTypeName) ) ] ) @@ -255,9 +260,18 @@ export const createReactQueryHook = ({ ] ), + ) - ) - ) + // Add the TData type parameters + queryFunctionDeclaration.typeParameters = t.tsTypeParameterDeclaration([ + t.tsTypeParameter( + undefined, + t.tSTypeReference(t.identifier(responseType)), + selectResponseGenericTypeName + ) + ]) + + return t.exportNamedDeclaration(queryFunctionDeclaration) }; @@ -685,19 +699,22 @@ function createReactQueryHookGenericInterface({ const options = context.options.reactQuery; - const genericTypeName = 'TResponse' + const genericResponseTypeName = 'TResponse' + const genericSelectResponseTypeName = 'TData' context.addUtil('UseQueryOptions'); + // UseQueryOptions, const typedUseQueryOptions = t.tsTypeReference( t.identifier('UseQueryOptions'), - t.tsTypeParameterInstantiation([ + t.tsTypeParameterInstantiation( + [ t.tsTypeReference( - t.identifier(genericTypeName) + t.identifier(genericResponseTypeName) ), t.tsTypeReference(t.identifier('Error')), t.tsTypeReference( - t.identifier(genericTypeName) + t.identifier(genericSelectResponseTypeName) ) ]) ) @@ -744,7 +761,14 @@ function createReactQueryHookGenericInterface({ t.tsInterfaceDeclaration( t.identifier(genericQueryInterfaceName), t.tsTypeParameterDeclaration([ - t.tsTypeParameter(undefined, undefined, genericTypeName) + // 1: TResponse + t.tsTypeParameter(undefined, undefined, genericResponseTypeName), + // 2: TData + t.tsTypeParameter( + undefined, + t.tSTypeReference(t.identifier(genericResponseTypeName)), + genericSelectResponseTypeName + ) ]), [], t.tSInterfaceBody(body) @@ -789,12 +813,17 @@ export const createReactQueryHookInterface = ({ return t.exportNamedDeclaration( t.tsInterfaceDeclaration( t.identifier(hookParamsTypeName), - null, + t.tsTypeParameterDeclaration([ + t.tSTypeParameter(undefined, undefined, 'TData') + ]), [ t.tSExpressionWithTypeArguments( t.identifier(queryInterfaceName), t.tsTypeParameterInstantiation([ - t.tsTypeReference(t.identifier(responseType)) + // 1: response + t.tsTypeReference(t.identifier(responseType)), + // 2: select generic + t.tSTypeReference(t.identifier('TData')) ]) ) ], From d61fc1e1e347ca93c1f4fcb7a861a0690a3eb58c Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Mon, 22 Aug 2022 12:55:09 +0200 Subject: [PATCH 005/287] Update the tests for select in queries --- .../default/CwCodeIdRegistry.react-query.ts | 8 +-- .../builder/default/CwSingle.react-query.ts | 20 +++--- .../builder/default/Factory.react-query.ts | 12 ++-- .../builder/default/Minter.react-query.ts | 10 +-- .../invoke/CwCodeIdRegistry.react-query.ts | 8 +-- .../builder/invoke/CwSingle.react-query.ts | 20 +++--- .../builder/invoke/Factory.react-query.ts | 12 ++-- .../builder/invoke/Minter.react-query.ts | 10 +-- __output__/cosmwasm/CW4Group.react-query.ts | 10 +-- .../CwCodeIdRegistry.react-query.ts | 8 +-- .../CwNamedGroups.react-query.ts | 8 +-- .../CwProposalSingle.react-query.ts | 20 +++--- __output__/minter/Minter.react-query.ts | 10 +-- __output__/sg721/Sg721.react-query.ts | 24 +++---- .../Factory.react-query.ts | 12 ++-- .../Factory.react-query.ts | 64 +++++++++---------- .../factory-query-keys/Factory.react-query.ts | 64 +++++++++---------- .../factory-v4-query/Factory.react-query.ts | 12 ++-- .../Factory.react-query.ts | 12 ++-- .../vectis/factory/Factory.react-query.ts | 12 ++-- __output__/vectis/govec/Govec.react-query.ts | 4 +- __output__/vectis/proxy/Proxy.react-query.ts | 4 +- .../__snapshots__/builder.test.ts.snap | 2 + 23 files changed, 184 insertions(+), 182 deletions(-) diff --git a/__output__/builder/default/CwCodeIdRegistry.react-query.ts b/__output__/builder/default/CwCodeIdRegistry.react-query.ts index f219bfd3..d2bcdc8f 100644 --- a/__output__/builder/default/CwCodeIdRegistry.react-query.ts +++ b/__output__/builder/default/CwCodeIdRegistry.react-query.ts @@ -11,7 +11,7 @@ export interface CwCodeIdRegistryReactQuery { client: CwCodeIdRegistryQueryClient; options?: UseQueryOptions; } -export interface CwCodeIdRegistryListRegistrationsQuery extends CwCodeIdRegistryReactQuery { +export interface CwCodeIdRegistryListRegistrationsQuery extends CwCodeIdRegistryReactQuery { args: { chainId: string; name: string; @@ -27,7 +27,7 @@ export function useCwCodeIdRegistryListRegistrationsQuery { +export interface CwCodeIdRegistryInfoForCodeIdQuery extends CwCodeIdRegistryReactQuery { args: { chainId: string; codeId: number; @@ -43,7 +43,7 @@ export function useCwCodeIdRegistryInfoForCodeIdQuery { +export interface CwCodeIdRegistryGetRegistrationQuery extends CwCodeIdRegistryReactQuery { args: { chainId: string; name: string; @@ -61,7 +61,7 @@ export function useCwCodeIdRegistryGetRegistrationQuery {} +export interface CwCodeIdRegistryConfigQuery extends CwCodeIdRegistryReactQuery {} export function useCwCodeIdRegistryConfigQuery({ client, options diff --git a/__output__/builder/default/CwSingle.react-query.ts b/__output__/builder/default/CwSingle.react-query.ts index c3f26272..874561b4 100644 --- a/__output__/builder/default/CwSingle.react-query.ts +++ b/__output__/builder/default/CwSingle.react-query.ts @@ -11,28 +11,28 @@ export interface CwSingleReactQuery { client: CwSingleQueryClient; options?: UseQueryOptions; } -export interface CwSingleInfoQuery extends CwSingleReactQuery {} +export interface CwSingleInfoQuery extends CwSingleReactQuery {} export function useCwSingleInfoQuery({ client, options }: CwSingleInfoQuery) { return useQuery(["cwSingleInfo", client.contractAddress], () => client.info(), options); } -export interface CwSingleVoteHooksQuery extends CwSingleReactQuery {} +export interface CwSingleVoteHooksQuery extends CwSingleReactQuery {} export function useCwSingleVoteHooksQuery({ client, options }: CwSingleVoteHooksQuery) { return useQuery(["cwSingleVoteHooks", client.contractAddress], () => client.voteHooks(), options); } -export interface CwSingleProposalHooksQuery extends CwSingleReactQuery {} +export interface CwSingleProposalHooksQuery extends CwSingleReactQuery {} export function useCwSingleProposalHooksQuery({ client, options }: CwSingleProposalHooksQuery) { return useQuery(["cwSingleProposalHooks", client.contractAddress], () => client.proposalHooks(), options); } -export interface CwSingleListVotesQuery extends CwSingleReactQuery { +export interface CwSingleListVotesQuery extends CwSingleReactQuery { args: { limit?: number; proposalId: number; @@ -50,7 +50,7 @@ export function useCwSingleListVotesQuery({ startAfter: args.startAfter }), options); } -export interface CwSingleVoteQuery extends CwSingleReactQuery { +export interface CwSingleVoteQuery extends CwSingleReactQuery { args: { proposalId: number; voter: string; @@ -66,14 +66,14 @@ export function useCwSingleVoteQuery({ voter: args.voter }), options); } -export interface CwSingleProposalCountQuery extends CwSingleReactQuery {} +export interface CwSingleProposalCountQuery extends CwSingleReactQuery {} export function useCwSingleProposalCountQuery({ client, options }: CwSingleProposalCountQuery) { return useQuery(["cwSingleProposalCount", client.contractAddress], () => client.proposalCount(), options); } -export interface CwSingleReverseProposalsQuery extends CwSingleReactQuery { +export interface CwSingleReverseProposalsQuery extends CwSingleReactQuery { args: { limit?: number; startBefore?: number; @@ -89,7 +89,7 @@ export function useCwSingleReverseProposalsQuery { +export interface CwSingleListProposalsQuery extends CwSingleReactQuery { args: { limit?: number; startAfter?: number; @@ -105,7 +105,7 @@ export function useCwSingleListProposalsQuery({ startAfter: args.startAfter }), options); } -export interface CwSingleProposalQuery extends CwSingleReactQuery { +export interface CwSingleProposalQuery extends CwSingleReactQuery { args: { proposalId: number; }; @@ -119,7 +119,7 @@ export function useCwSingleProposalQuery({ proposalId: args.proposalId }), options); } -export interface CwSingleConfigQuery extends CwSingleReactQuery {} +export interface CwSingleConfigQuery extends CwSingleReactQuery {} export function useCwSingleConfigQuery({ client, options diff --git a/__output__/builder/default/Factory.react-query.ts b/__output__/builder/default/Factory.react-query.ts index 41b88b79..2d40ad5e 100644 --- a/__output__/builder/default/Factory.react-query.ts +++ b/__output__/builder/default/Factory.react-query.ts @@ -11,28 +11,28 @@ export interface FactoryReactQuery { client: FactoryQueryClient; options?: UseQueryOptions; } -export interface FactoryAdminAddrQuery extends FactoryReactQuery {} +export interface FactoryAdminAddrQuery extends FactoryReactQuery {} export function useFactoryAdminAddrQuery({ client, options }: FactoryAdminAddrQuery) { return useQuery(["factoryAdminAddr", client.contractAddress], () => client.adminAddr(), options); } -export interface FactoryGovecAddrQuery extends FactoryReactQuery {} +export interface FactoryGovecAddrQuery extends FactoryReactQuery {} export function useFactoryGovecAddrQuery({ client, options }: FactoryGovecAddrQuery) { return useQuery(["factoryGovecAddr", client.contractAddress], () => client.govecAddr(), options); } -export interface FactoryFeeQuery extends FactoryReactQuery {} +export interface FactoryFeeQuery extends FactoryReactQuery {} export function useFactoryFeeQuery({ client, options }: FactoryFeeQuery) { return useQuery(["factoryFee", client.contractAddress], () => client.fee(), options); } -export interface FactoryCodeIdQuery extends FactoryReactQuery { +export interface FactoryCodeIdQuery extends FactoryReactQuery { args: { ty: CodeIdType; }; @@ -46,7 +46,7 @@ export function useFactoryCodeIdQuery({ ty: args.ty }), options); } -export interface FactoryWalletsOfQuery extends FactoryReactQuery { +export interface FactoryWalletsOfQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: string; @@ -64,7 +64,7 @@ export function useFactoryWalletsOfQuery({ user: args.user }), options); } -export interface FactoryWalletsQuery extends FactoryReactQuery { +export interface FactoryWalletsQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: WalletQueryPrefix; diff --git a/__output__/builder/default/Minter.react-query.ts b/__output__/builder/default/Minter.react-query.ts index 28483c5b..007bcfd9 100644 --- a/__output__/builder/default/Minter.react-query.ts +++ b/__output__/builder/default/Minter.react-query.ts @@ -11,7 +11,7 @@ export interface MinterReactQuery { client: MinterQueryClient; options?: UseQueryOptions; } -export interface MinterMintCountQuery extends MinterReactQuery { +export interface MinterMintCountQuery extends MinterReactQuery { args: { address: string; }; @@ -25,28 +25,28 @@ export function useMinterMintCountQuery({ address: args.address }), options); } -export interface MinterMintPriceQuery extends MinterReactQuery {} +export interface MinterMintPriceQuery extends MinterReactQuery {} export function useMinterMintPriceQuery({ client, options }: MinterMintPriceQuery) { return useQuery(["minterMintPrice", client.contractAddress], () => client.mintPrice(), options); } -export interface MinterStartTimeQuery extends MinterReactQuery {} +export interface MinterStartTimeQuery extends MinterReactQuery {} export function useMinterStartTimeQuery({ client, options }: MinterStartTimeQuery) { return useQuery(["minterStartTime", client.contractAddress], () => client.startTime(), options); } -export interface MinterMintableNumTokensQuery extends MinterReactQuery {} +export interface MinterMintableNumTokensQuery extends MinterReactQuery {} export function useMinterMintableNumTokensQuery({ client, options }: MinterMintableNumTokensQuery) { return useQuery(["minterMintableNumTokens", client.contractAddress], () => client.mintableNumTokens(), options); } -export interface MinterConfigQuery extends MinterReactQuery {} +export interface MinterConfigQuery extends MinterReactQuery {} export function useMinterConfigQuery({ client, options diff --git a/__output__/builder/invoke/CwCodeIdRegistry.react-query.ts b/__output__/builder/invoke/CwCodeIdRegistry.react-query.ts index f219bfd3..d2bcdc8f 100644 --- a/__output__/builder/invoke/CwCodeIdRegistry.react-query.ts +++ b/__output__/builder/invoke/CwCodeIdRegistry.react-query.ts @@ -11,7 +11,7 @@ export interface CwCodeIdRegistryReactQuery { client: CwCodeIdRegistryQueryClient; options?: UseQueryOptions; } -export interface CwCodeIdRegistryListRegistrationsQuery extends CwCodeIdRegistryReactQuery { +export interface CwCodeIdRegistryListRegistrationsQuery extends CwCodeIdRegistryReactQuery { args: { chainId: string; name: string; @@ -27,7 +27,7 @@ export function useCwCodeIdRegistryListRegistrationsQuery { +export interface CwCodeIdRegistryInfoForCodeIdQuery extends CwCodeIdRegistryReactQuery { args: { chainId: string; codeId: number; @@ -43,7 +43,7 @@ export function useCwCodeIdRegistryInfoForCodeIdQuery { +export interface CwCodeIdRegistryGetRegistrationQuery extends CwCodeIdRegistryReactQuery { args: { chainId: string; name: string; @@ -61,7 +61,7 @@ export function useCwCodeIdRegistryGetRegistrationQuery {} +export interface CwCodeIdRegistryConfigQuery extends CwCodeIdRegistryReactQuery {} export function useCwCodeIdRegistryConfigQuery({ client, options diff --git a/__output__/builder/invoke/CwSingle.react-query.ts b/__output__/builder/invoke/CwSingle.react-query.ts index c3f26272..874561b4 100644 --- a/__output__/builder/invoke/CwSingle.react-query.ts +++ b/__output__/builder/invoke/CwSingle.react-query.ts @@ -11,28 +11,28 @@ export interface CwSingleReactQuery { client: CwSingleQueryClient; options?: UseQueryOptions; } -export interface CwSingleInfoQuery extends CwSingleReactQuery {} +export interface CwSingleInfoQuery extends CwSingleReactQuery {} export function useCwSingleInfoQuery({ client, options }: CwSingleInfoQuery) { return useQuery(["cwSingleInfo", client.contractAddress], () => client.info(), options); } -export interface CwSingleVoteHooksQuery extends CwSingleReactQuery {} +export interface CwSingleVoteHooksQuery extends CwSingleReactQuery {} export function useCwSingleVoteHooksQuery({ client, options }: CwSingleVoteHooksQuery) { return useQuery(["cwSingleVoteHooks", client.contractAddress], () => client.voteHooks(), options); } -export interface CwSingleProposalHooksQuery extends CwSingleReactQuery {} +export interface CwSingleProposalHooksQuery extends CwSingleReactQuery {} export function useCwSingleProposalHooksQuery({ client, options }: CwSingleProposalHooksQuery) { return useQuery(["cwSingleProposalHooks", client.contractAddress], () => client.proposalHooks(), options); } -export interface CwSingleListVotesQuery extends CwSingleReactQuery { +export interface CwSingleListVotesQuery extends CwSingleReactQuery { args: { limit?: number; proposalId: number; @@ -50,7 +50,7 @@ export function useCwSingleListVotesQuery({ startAfter: args.startAfter }), options); } -export interface CwSingleVoteQuery extends CwSingleReactQuery { +export interface CwSingleVoteQuery extends CwSingleReactQuery { args: { proposalId: number; voter: string; @@ -66,14 +66,14 @@ export function useCwSingleVoteQuery({ voter: args.voter }), options); } -export interface CwSingleProposalCountQuery extends CwSingleReactQuery {} +export interface CwSingleProposalCountQuery extends CwSingleReactQuery {} export function useCwSingleProposalCountQuery({ client, options }: CwSingleProposalCountQuery) { return useQuery(["cwSingleProposalCount", client.contractAddress], () => client.proposalCount(), options); } -export interface CwSingleReverseProposalsQuery extends CwSingleReactQuery { +export interface CwSingleReverseProposalsQuery extends CwSingleReactQuery { args: { limit?: number; startBefore?: number; @@ -89,7 +89,7 @@ export function useCwSingleReverseProposalsQuery { +export interface CwSingleListProposalsQuery extends CwSingleReactQuery { args: { limit?: number; startAfter?: number; @@ -105,7 +105,7 @@ export function useCwSingleListProposalsQuery({ startAfter: args.startAfter }), options); } -export interface CwSingleProposalQuery extends CwSingleReactQuery { +export interface CwSingleProposalQuery extends CwSingleReactQuery { args: { proposalId: number; }; @@ -119,7 +119,7 @@ export function useCwSingleProposalQuery({ proposalId: args.proposalId }), options); } -export interface CwSingleConfigQuery extends CwSingleReactQuery {} +export interface CwSingleConfigQuery extends CwSingleReactQuery {} export function useCwSingleConfigQuery({ client, options diff --git a/__output__/builder/invoke/Factory.react-query.ts b/__output__/builder/invoke/Factory.react-query.ts index 41b88b79..2d40ad5e 100644 --- a/__output__/builder/invoke/Factory.react-query.ts +++ b/__output__/builder/invoke/Factory.react-query.ts @@ -11,28 +11,28 @@ export interface FactoryReactQuery { client: FactoryQueryClient; options?: UseQueryOptions; } -export interface FactoryAdminAddrQuery extends FactoryReactQuery {} +export interface FactoryAdminAddrQuery extends FactoryReactQuery {} export function useFactoryAdminAddrQuery({ client, options }: FactoryAdminAddrQuery) { return useQuery(["factoryAdminAddr", client.contractAddress], () => client.adminAddr(), options); } -export interface FactoryGovecAddrQuery extends FactoryReactQuery {} +export interface FactoryGovecAddrQuery extends FactoryReactQuery {} export function useFactoryGovecAddrQuery({ client, options }: FactoryGovecAddrQuery) { return useQuery(["factoryGovecAddr", client.contractAddress], () => client.govecAddr(), options); } -export interface FactoryFeeQuery extends FactoryReactQuery {} +export interface FactoryFeeQuery extends FactoryReactQuery {} export function useFactoryFeeQuery({ client, options }: FactoryFeeQuery) { return useQuery(["factoryFee", client.contractAddress], () => client.fee(), options); } -export interface FactoryCodeIdQuery extends FactoryReactQuery { +export interface FactoryCodeIdQuery extends FactoryReactQuery { args: { ty: CodeIdType; }; @@ -46,7 +46,7 @@ export function useFactoryCodeIdQuery({ ty: args.ty }), options); } -export interface FactoryWalletsOfQuery extends FactoryReactQuery { +export interface FactoryWalletsOfQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: string; @@ -64,7 +64,7 @@ export function useFactoryWalletsOfQuery({ user: args.user }), options); } -export interface FactoryWalletsQuery extends FactoryReactQuery { +export interface FactoryWalletsQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: WalletQueryPrefix; diff --git a/__output__/builder/invoke/Minter.react-query.ts b/__output__/builder/invoke/Minter.react-query.ts index 28483c5b..007bcfd9 100644 --- a/__output__/builder/invoke/Minter.react-query.ts +++ b/__output__/builder/invoke/Minter.react-query.ts @@ -11,7 +11,7 @@ export interface MinterReactQuery { client: MinterQueryClient; options?: UseQueryOptions; } -export interface MinterMintCountQuery extends MinterReactQuery { +export interface MinterMintCountQuery extends MinterReactQuery { args: { address: string; }; @@ -25,28 +25,28 @@ export function useMinterMintCountQuery({ address: args.address }), options); } -export interface MinterMintPriceQuery extends MinterReactQuery {} +export interface MinterMintPriceQuery extends MinterReactQuery {} export function useMinterMintPriceQuery({ client, options }: MinterMintPriceQuery) { return useQuery(["minterMintPrice", client.contractAddress], () => client.mintPrice(), options); } -export interface MinterStartTimeQuery extends MinterReactQuery {} +export interface MinterStartTimeQuery extends MinterReactQuery {} export function useMinterStartTimeQuery({ client, options }: MinterStartTimeQuery) { return useQuery(["minterStartTime", client.contractAddress], () => client.startTime(), options); } -export interface MinterMintableNumTokensQuery extends MinterReactQuery {} +export interface MinterMintableNumTokensQuery extends MinterReactQuery {} export function useMinterMintableNumTokensQuery({ client, options }: MinterMintableNumTokensQuery) { return useQuery(["minterMintableNumTokens", client.contractAddress], () => client.mintableNumTokens(), options); } -export interface MinterConfigQuery extends MinterReactQuery {} +export interface MinterConfigQuery extends MinterReactQuery {} export function useMinterConfigQuery({ client, options diff --git a/__output__/cosmwasm/CW4Group.react-query.ts b/__output__/cosmwasm/CW4Group.react-query.ts index 5ee0ff4a..420c1a09 100644 --- a/__output__/cosmwasm/CW4Group.react-query.ts +++ b/__output__/cosmwasm/CW4Group.react-query.ts @@ -11,14 +11,14 @@ export interface CW4GroupReactQuery { client: CW4GroupQueryClient; options?: UseQueryOptions; } -export interface CW4GroupHooksQuery extends CW4GroupReactQuery {} +export interface CW4GroupHooksQuery extends CW4GroupReactQuery {} export function useCW4GroupHooksQuery({ client, options }: CW4GroupHooksQuery) { return useQuery(["cW4GroupHooks", client.contractAddress], () => client.hooks(), options); } -export interface CW4GroupMemberQuery extends CW4GroupReactQuery { +export interface CW4GroupMemberQuery extends CW4GroupReactQuery { args: { addr: string; atHeight?: number; @@ -34,7 +34,7 @@ export function useCW4GroupMemberQuery({ atHeight: args.atHeight }), options); } -export interface CW4GroupListMembersQuery extends CW4GroupReactQuery { +export interface CW4GroupListMembersQuery extends CW4GroupReactQuery { args: { limit?: number; startAfter?: string; @@ -50,14 +50,14 @@ export function useCW4GroupListMembersQuery({ startAfter: args.startAfter }), options); } -export interface CW4GroupTotalWeightQuery extends CW4GroupReactQuery {} +export interface CW4GroupTotalWeightQuery extends CW4GroupReactQuery {} export function useCW4GroupTotalWeightQuery({ client, options }: CW4GroupTotalWeightQuery) { return useQuery(["cW4GroupTotalWeight", client.contractAddress], () => client.totalWeight(), options); } -export interface CW4GroupAdminQuery extends CW4GroupReactQuery {} +export interface CW4GroupAdminQuery extends CW4GroupReactQuery {} export function useCW4GroupAdminQuery({ client, options diff --git a/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.react-query.ts b/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.react-query.ts index f219bfd3..d2bcdc8f 100644 --- a/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.react-query.ts +++ b/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.react-query.ts @@ -11,7 +11,7 @@ export interface CwCodeIdRegistryReactQuery { client: CwCodeIdRegistryQueryClient; options?: UseQueryOptions; } -export interface CwCodeIdRegistryListRegistrationsQuery extends CwCodeIdRegistryReactQuery { +export interface CwCodeIdRegistryListRegistrationsQuery extends CwCodeIdRegistryReactQuery { args: { chainId: string; name: string; @@ -27,7 +27,7 @@ export function useCwCodeIdRegistryListRegistrationsQuery { +export interface CwCodeIdRegistryInfoForCodeIdQuery extends CwCodeIdRegistryReactQuery { args: { chainId: string; codeId: number; @@ -43,7 +43,7 @@ export function useCwCodeIdRegistryInfoForCodeIdQuery { +export interface CwCodeIdRegistryGetRegistrationQuery extends CwCodeIdRegistryReactQuery { args: { chainId: string; name: string; @@ -61,7 +61,7 @@ export function useCwCodeIdRegistryGetRegistrationQuery {} +export interface CwCodeIdRegistryConfigQuery extends CwCodeIdRegistryReactQuery {} export function useCwCodeIdRegistryConfigQuery({ client, options diff --git a/__output__/daodao/cw-named-groups/CwNamedGroups.react-query.ts b/__output__/daodao/cw-named-groups/CwNamedGroups.react-query.ts index 5451d8c7..f50712b2 100644 --- a/__output__/daodao/cw-named-groups/CwNamedGroups.react-query.ts +++ b/__output__/daodao/cw-named-groups/CwNamedGroups.react-query.ts @@ -11,7 +11,7 @@ export interface CwNamedGroupsReactQuery { client: CwNamedGroupsQueryClient; options?: UseQueryOptions; } -export interface CwNamedGroupsIsAddressInGroupQuery extends CwNamedGroupsReactQuery { +export interface CwNamedGroupsIsAddressInGroupQuery extends CwNamedGroupsReactQuery { args: { address: string; group: string; @@ -27,7 +27,7 @@ export function useCwNamedGroupsIsAddressInGroupQuery { +export interface CwNamedGroupsListAddressesQuery extends CwNamedGroupsReactQuery { args: { group: string; limit?: number; @@ -45,7 +45,7 @@ export function useCwNamedGroupsListAddressesQuery { +export interface CwNamedGroupsListGroupsQuery extends CwNamedGroupsReactQuery { args: { address: string; limit?: number; @@ -63,7 +63,7 @@ export function useCwNamedGroupsListGroupsQuery({ offset: args.offset }), options); } -export interface CwNamedGroupsDumpQuery extends CwNamedGroupsReactQuery {} +export interface CwNamedGroupsDumpQuery extends CwNamedGroupsReactQuery {} export function useCwNamedGroupsDumpQuery({ client, options diff --git a/__output__/daodao/cw-proposal-single/CwProposalSingle.react-query.ts b/__output__/daodao/cw-proposal-single/CwProposalSingle.react-query.ts index 4ad925ce..d9c0a85e 100644 --- a/__output__/daodao/cw-proposal-single/CwProposalSingle.react-query.ts +++ b/__output__/daodao/cw-proposal-single/CwProposalSingle.react-query.ts @@ -11,28 +11,28 @@ export interface CwProposalSingleReactQuery { client: CwProposalSingleQueryClient; options?: UseQueryOptions; } -export interface CwProposalSingleInfoQuery extends CwProposalSingleReactQuery {} +export interface CwProposalSingleInfoQuery extends CwProposalSingleReactQuery {} export function useCwProposalSingleInfoQuery({ client, options }: CwProposalSingleInfoQuery) { return useQuery(["cwProposalSingleInfo", client.contractAddress], () => client.info(), options); } -export interface CwProposalSingleVoteHooksQuery extends CwProposalSingleReactQuery {} +export interface CwProposalSingleVoteHooksQuery extends CwProposalSingleReactQuery {} export function useCwProposalSingleVoteHooksQuery({ client, options }: CwProposalSingleVoteHooksQuery) { return useQuery(["cwProposalSingleVoteHooks", client.contractAddress], () => client.voteHooks(), options); } -export interface CwProposalSingleProposalHooksQuery extends CwProposalSingleReactQuery {} +export interface CwProposalSingleProposalHooksQuery extends CwProposalSingleReactQuery {} export function useCwProposalSingleProposalHooksQuery({ client, options }: CwProposalSingleProposalHooksQuery) { return useQuery(["cwProposalSingleProposalHooks", client.contractAddress], () => client.proposalHooks(), options); } -export interface CwProposalSingleListVotesQuery extends CwProposalSingleReactQuery { +export interface CwProposalSingleListVotesQuery extends CwProposalSingleReactQuery { args: { limit?: number; proposalId: number; @@ -50,7 +50,7 @@ export function useCwProposalSingleListVotesQuery({ startAfter: args.startAfter }), options); } -export interface CwProposalSingleVoteQuery extends CwProposalSingleReactQuery { +export interface CwProposalSingleVoteQuery extends CwProposalSingleReactQuery { args: { proposalId: number; voter: string; @@ -66,14 +66,14 @@ export function useCwProposalSingleVoteQuery({ voter: args.voter }), options); } -export interface CwProposalSingleProposalCountQuery extends CwProposalSingleReactQuery {} +export interface CwProposalSingleProposalCountQuery extends CwProposalSingleReactQuery {} export function useCwProposalSingleProposalCountQuery({ client, options }: CwProposalSingleProposalCountQuery) { return useQuery(["cwProposalSingleProposalCount", client.contractAddress], () => client.proposalCount(), options); } -export interface CwProposalSingleReverseProposalsQuery extends CwProposalSingleReactQuery { +export interface CwProposalSingleReverseProposalsQuery extends CwProposalSingleReactQuery { args: { limit?: number; startBefore?: number; @@ -89,7 +89,7 @@ export function useCwProposalSingleReverseProposalsQuery { +export interface CwProposalSingleListProposalsQuery extends CwProposalSingleReactQuery { args: { limit?: number; startAfter?: number; @@ -105,7 +105,7 @@ export function useCwProposalSingleListProposalsQuery { +export interface CwProposalSingleProposalQuery extends CwProposalSingleReactQuery { args: { proposalId: number; }; @@ -119,7 +119,7 @@ export function useCwProposalSingleProposalQuery({ proposalId: args.proposalId }), options); } -export interface CwProposalSingleConfigQuery extends CwProposalSingleReactQuery {} +export interface CwProposalSingleConfigQuery extends CwProposalSingleReactQuery {} export function useCwProposalSingleConfigQuery({ client, options diff --git a/__output__/minter/Minter.react-query.ts b/__output__/minter/Minter.react-query.ts index 28483c5b..007bcfd9 100644 --- a/__output__/minter/Minter.react-query.ts +++ b/__output__/minter/Minter.react-query.ts @@ -11,7 +11,7 @@ export interface MinterReactQuery { client: MinterQueryClient; options?: UseQueryOptions; } -export interface MinterMintCountQuery extends MinterReactQuery { +export interface MinterMintCountQuery extends MinterReactQuery { args: { address: string; }; @@ -25,28 +25,28 @@ export function useMinterMintCountQuery({ address: args.address }), options); } -export interface MinterMintPriceQuery extends MinterReactQuery {} +export interface MinterMintPriceQuery extends MinterReactQuery {} export function useMinterMintPriceQuery({ client, options }: MinterMintPriceQuery) { return useQuery(["minterMintPrice", client.contractAddress], () => client.mintPrice(), options); } -export interface MinterStartTimeQuery extends MinterReactQuery {} +export interface MinterStartTimeQuery extends MinterReactQuery {} export function useMinterStartTimeQuery({ client, options }: MinterStartTimeQuery) { return useQuery(["minterStartTime", client.contractAddress], () => client.startTime(), options); } -export interface MinterMintableNumTokensQuery extends MinterReactQuery {} +export interface MinterMintableNumTokensQuery extends MinterReactQuery {} export function useMinterMintableNumTokensQuery({ client, options }: MinterMintableNumTokensQuery) { return useQuery(["minterMintableNumTokens", client.contractAddress], () => client.mintableNumTokens(), options); } -export interface MinterConfigQuery extends MinterReactQuery {} +export interface MinterConfigQuery extends MinterReactQuery {} export function useMinterConfigQuery({ client, options diff --git a/__output__/sg721/Sg721.react-query.ts b/__output__/sg721/Sg721.react-query.ts index c4ba9cfa..3a62ccbf 100644 --- a/__output__/sg721/Sg721.react-query.ts +++ b/__output__/sg721/Sg721.react-query.ts @@ -11,21 +11,21 @@ export interface Sg721ReactQuery { client: Sg721QueryClient; options?: UseQueryOptions; } -export interface Sg721CollectionInfoQuery extends Sg721ReactQuery {} +export interface Sg721CollectionInfoQuery extends Sg721ReactQuery {} export function useSg721CollectionInfoQuery({ client, options }: Sg721CollectionInfoQuery) { return useQuery(["sg721CollectionInfo", client.contractAddress], () => client.collectionInfo(), options); } -export interface Sg721MinterQuery extends Sg721ReactQuery {} +export interface Sg721MinterQuery extends Sg721ReactQuery {} export function useSg721MinterQuery({ client, options }: Sg721MinterQuery) { return useQuery(["sg721Minter", client.contractAddress], () => client.minter(), options); } -export interface Sg721AllTokensQuery extends Sg721ReactQuery { +export interface Sg721AllTokensQuery extends Sg721ReactQuery { args: { limit?: number; startAfter?: string; @@ -41,7 +41,7 @@ export function useSg721AllTokensQuery({ startAfter: args.startAfter }), options); } -export interface Sg721TokensQuery extends Sg721ReactQuery { +export interface Sg721TokensQuery extends Sg721ReactQuery { args: { limit?: number; owner: string; @@ -59,7 +59,7 @@ export function useSg721TokensQuery({ startAfter: args.startAfter }), options); } -export interface Sg721AllNftInfoQuery extends Sg721ReactQuery { +export interface Sg721AllNftInfoQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; tokenId: string; @@ -75,7 +75,7 @@ export function useSg721AllNftInfoQuery({ tokenId: args.tokenId }), options); } -export interface Sg721NftInfoQuery extends Sg721ReactQuery { +export interface Sg721NftInfoQuery extends Sg721ReactQuery { args: { tokenId: string; }; @@ -89,21 +89,21 @@ export function useSg721NftInfoQuery({ tokenId: args.tokenId }), options); } -export interface Sg721ContractInfoQuery extends Sg721ReactQuery {} +export interface Sg721ContractInfoQuery extends Sg721ReactQuery {} export function useSg721ContractInfoQuery({ client, options }: Sg721ContractInfoQuery) { return useQuery(["sg721ContractInfo", client.contractAddress], () => client.contractInfo(), options); } -export interface Sg721NumTokensQuery extends Sg721ReactQuery {} +export interface Sg721NumTokensQuery extends Sg721ReactQuery {} export function useSg721NumTokensQuery({ client, options }: Sg721NumTokensQuery) { return useQuery(["sg721NumTokens", client.contractAddress], () => client.numTokens(), options); } -export interface Sg721AllOperatorsQuery extends Sg721ReactQuery { +export interface Sg721AllOperatorsQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; limit?: number; @@ -123,7 +123,7 @@ export function useSg721AllOperatorsQuery({ startAfter: args.startAfter }), options); } -export interface Sg721ApprovalsQuery extends Sg721ReactQuery { +export interface Sg721ApprovalsQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; tokenId: string; @@ -139,7 +139,7 @@ export function useSg721ApprovalsQuery({ tokenId: args.tokenId }), options); } -export interface Sg721ApprovalQuery extends Sg721ReactQuery { +export interface Sg721ApprovalQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; spender: string; @@ -157,7 +157,7 @@ export function useSg721ApprovalQuery({ tokenId: args.tokenId }), options); } -export interface Sg721OwnerOfQuery extends Sg721ReactQuery { +export interface Sg721OwnerOfQuery extends Sg721ReactQuery { args: { includeExpired?: boolean; tokenId: string; diff --git a/__output__/vectis/factory-optional-client/Factory.react-query.ts b/__output__/vectis/factory-optional-client/Factory.react-query.ts index 0514312c..d4ae40f0 100644 --- a/__output__/vectis/factory-optional-client/Factory.react-query.ts +++ b/__output__/vectis/factory-optional-client/Factory.react-query.ts @@ -11,7 +11,7 @@ export interface FactoryReactQuery { client: FactoryQueryClient | undefined; options?: UseQueryOptions; } -export interface FactoryAdminAddrQuery extends FactoryReactQuery {} +export interface FactoryAdminAddrQuery extends FactoryReactQuery {} export function useFactoryAdminAddrQuery({ client, options @@ -20,7 +20,7 @@ export function useFactoryAdminAddrQuery({ enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface FactoryGovecAddrQuery extends FactoryReactQuery {} +export interface FactoryGovecAddrQuery extends FactoryReactQuery {} export function useFactoryGovecAddrQuery({ client, options @@ -29,7 +29,7 @@ export function useFactoryGovecAddrQuery({ enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface FactoryFeeQuery extends FactoryReactQuery {} +export interface FactoryFeeQuery extends FactoryReactQuery {} export function useFactoryFeeQuery({ client, options @@ -38,7 +38,7 @@ export function useFactoryFeeQuery({ enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface FactoryCodeIdQuery extends FactoryReactQuery { +export interface FactoryCodeIdQuery extends FactoryReactQuery { args: { ty: CodeIdType; }; @@ -54,7 +54,7 @@ export function useFactoryCodeIdQuery({ enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface FactoryWalletsOfQuery extends FactoryReactQuery { +export interface FactoryWalletsOfQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: string; @@ -74,7 +74,7 @@ export function useFactoryWalletsOfQuery({ enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface FactoryWalletsQuery extends FactoryReactQuery { +export interface FactoryWalletsQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: WalletQueryPrefix; diff --git a/__output__/vectis/factory-query-keys-optional-client/Factory.react-query.ts b/__output__/vectis/factory-query-keys-optional-client/Factory.react-query.ts index 4b292ea0..1e598df4 100644 --- a/__output__/vectis/factory-query-keys-optional-client/Factory.react-query.ts +++ b/__output__/vectis/factory-query-keys-optional-client/Factory.react-query.ts @@ -14,91 +14,91 @@ export const factoryQueryKeys = { address: (contractAddress: string | undefined) => ([{ ...factoryQueryKeys.contract[0], address: contractAddress }] as const), - wallets: (contractAddress: string | undefined, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + wallets: (contractAddress: string | undefined, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], method: "wallets", args }] as const), - walletsOf: (contractAddress: string | undefined, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + walletsOf: (contractAddress: string | undefined, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], method: "wallets_of", args }] as const), - codeId: (contractAddress: string | undefined, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + codeId: (contractAddress: string | undefined, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], method: "code_id", args }] as const), - fee: (contractAddress: string | undefined, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + fee: (contractAddress: string | undefined, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], method: "fee", args }] as const), - govecAddr: (contractAddress: string | undefined, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + govecAddr: (contractAddress: string | undefined, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], method: "govec_addr", args }] as const), - adminAddr: (contractAddress: string | undefined, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + adminAddr: (contractAddress: string | undefined, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], method: "admin_addr", args }] as const) }; -export interface FactoryReactQuery { +export interface FactoryReactQuery { client: FactoryQueryClient | undefined; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface FactoryAdminAddrQuery extends FactoryReactQuery {} -export function useFactoryAdminAddrQuery({ +export interface FactoryAdminAddrQuery extends FactoryReactQuery {} +export function useFactoryAdminAddrQuery({ client, options -}: FactoryAdminAddrQuery) { - return useQuery(["factoryAdminAddr", client?.contractAddress], () => client ? client.adminAddr() : Promise.reject(new Error("Invalid client")), { ...options, +}: FactoryAdminAddrQuery) { + return useQuery(factoryQueryKeys.adminAddr(client?.contractAddress), () => client ? client.adminAddr() : Promise.reject(new Error("Invalid client")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface FactoryGovecAddrQuery extends FactoryReactQuery {} -export function useFactoryGovecAddrQuery({ +export interface FactoryGovecAddrQuery extends FactoryReactQuery {} +export function useFactoryGovecAddrQuery({ client, options -}: FactoryGovecAddrQuery) { - return useQuery(["factoryGovecAddr", client?.contractAddress], () => client ? client.govecAddr() : Promise.reject(new Error("Invalid client")), { ...options, +}: FactoryGovecAddrQuery) { + return useQuery(factoryQueryKeys.govecAddr(client?.contractAddress), () => client ? client.govecAddr() : Promise.reject(new Error("Invalid client")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface FactoryFeeQuery extends FactoryReactQuery {} -export function useFactoryFeeQuery({ +export interface FactoryFeeQuery extends FactoryReactQuery {} +export function useFactoryFeeQuery({ client, options -}: FactoryFeeQuery) { - return useQuery(["factoryFee", client?.contractAddress], () => client ? client.fee() : Promise.reject(new Error("Invalid client")), { ...options, +}: FactoryFeeQuery) { + return useQuery(factoryQueryKeys.fee(client?.contractAddress), () => client ? client.fee() : Promise.reject(new Error("Invalid client")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface FactoryCodeIdQuery extends FactoryReactQuery { +export interface FactoryCodeIdQuery extends FactoryReactQuery { args: { ty: CodeIdType; }; } -export function useFactoryCodeIdQuery({ +export function useFactoryCodeIdQuery({ client, args, options -}: FactoryCodeIdQuery) { - return useQuery(["factoryCodeId", client?.contractAddress, JSON.stringify(args)], () => client ? client.codeId({ +}: FactoryCodeIdQuery) { + return useQuery(factoryQueryKeys.codeId(client?.contractAddress, args), () => client ? client.codeId({ ty: args.ty }) : Promise.reject(new Error("Invalid client")), { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface FactoryWalletsOfQuery extends FactoryReactQuery { +export interface FactoryWalletsOfQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: string; user: string; }; } -export function useFactoryWalletsOfQuery({ +export function useFactoryWalletsOfQuery({ client, args, options -}: FactoryWalletsOfQuery) { - return useQuery(["factoryWalletsOf", client?.contractAddress, JSON.stringify(args)], () => client ? client.walletsOf({ +}: FactoryWalletsOfQuery) { + return useQuery(factoryQueryKeys.walletsOf(client?.contractAddress, args), () => client ? client.walletsOf({ limit: args.limit, startAfter: args.startAfter, user: args.user @@ -106,18 +106,18 @@ export function useFactoryWalletsOfQuery({ enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }); } -export interface FactoryWalletsQuery extends FactoryReactQuery { +export interface FactoryWalletsQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: WalletQueryPrefix; }; } -export function useFactoryWalletsQuery({ +export function useFactoryWalletsQuery({ client, args, options -}: FactoryWalletsQuery) { - return useQuery(["factoryWallets", client?.contractAddress, JSON.stringify(args)], () => client ? client.wallets({ +}: FactoryWalletsQuery) { + return useQuery(factoryQueryKeys.wallets(client?.contractAddress, args), () => client ? client.wallets({ limit: args.limit, startAfter: args.startAfter }) : Promise.reject(new Error("Invalid client")), { ...options, diff --git a/__output__/vectis/factory-query-keys/Factory.react-query.ts b/__output__/vectis/factory-query-keys/Factory.react-query.ts index 41c30fb5..e233c2bb 100644 --- a/__output__/vectis/factory-query-keys/Factory.react-query.ts +++ b/__output__/vectis/factory-query-keys/Factory.react-query.ts @@ -14,100 +14,100 @@ export const factoryQueryKeys = { address: (contractAddress: string) => ([{ ...factoryQueryKeys.contract[0], address: contractAddress }] as const), - wallets: (contractAddress: string, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + wallets: (contractAddress: string, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], method: "wallets", args }] as const), - walletsOf: (contractAddress: string, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + walletsOf: (contractAddress: string, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], method: "wallets_of", args }] as const), - codeId: (contractAddress: string, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + codeId: (contractAddress: string, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], method: "code_id", args }] as const), - fee: (contractAddress: string, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + fee: (contractAddress: string, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], method: "fee", args }] as const), - govecAddr: (contractAddress: string, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + govecAddr: (contractAddress: string, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], method: "govec_addr", args }] as const), - adminAddr: (contractAddress: string, args: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + adminAddr: (contractAddress: string, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], method: "admin_addr", args }] as const) }; -export interface FactoryReactQuery { +export interface FactoryReactQuery { client: FactoryQueryClient; - options?: UseQueryOptions; + options?: UseQueryOptions; } -export interface FactoryAdminAddrQuery extends FactoryReactQuery {} -export function useFactoryAdminAddrQuery({ +export interface FactoryAdminAddrQuery extends FactoryReactQuery {} +export function useFactoryAdminAddrQuery({ client, options -}: FactoryAdminAddrQuery) { - return useQuery(["factoryAdminAddr", client.contractAddress], () => client.adminAddr(), options); +}: FactoryAdminAddrQuery) { + return useQuery(factoryQueryKeys.adminAddr(client.contractAddress), () => client.adminAddr(), options); } -export interface FactoryGovecAddrQuery extends FactoryReactQuery {} -export function useFactoryGovecAddrQuery({ +export interface FactoryGovecAddrQuery extends FactoryReactQuery {} +export function useFactoryGovecAddrQuery({ client, options -}: FactoryGovecAddrQuery) { - return useQuery(["factoryGovecAddr", client.contractAddress], () => client.govecAddr(), options); +}: FactoryGovecAddrQuery) { + return useQuery(factoryQueryKeys.govecAddr(client.contractAddress), () => client.govecAddr(), options); } -export interface FactoryFeeQuery extends FactoryReactQuery {} -export function useFactoryFeeQuery({ +export interface FactoryFeeQuery extends FactoryReactQuery {} +export function useFactoryFeeQuery({ client, options -}: FactoryFeeQuery) { - return useQuery(["factoryFee", client.contractAddress], () => client.fee(), options); +}: FactoryFeeQuery) { + return useQuery(factoryQueryKeys.fee(client.contractAddress), () => client.fee(), options); } -export interface FactoryCodeIdQuery extends FactoryReactQuery { +export interface FactoryCodeIdQuery extends FactoryReactQuery { args: { ty: CodeIdType; }; } -export function useFactoryCodeIdQuery({ +export function useFactoryCodeIdQuery({ client, args, options -}: FactoryCodeIdQuery) { - return useQuery(["factoryCodeId", client.contractAddress, JSON.stringify(args)], () => client.codeId({ +}: FactoryCodeIdQuery) { + return useQuery(factoryQueryKeys.codeId(client.contractAddress, args), () => client.codeId({ ty: args.ty }), options); } -export interface FactoryWalletsOfQuery extends FactoryReactQuery { +export interface FactoryWalletsOfQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: string; user: string; }; } -export function useFactoryWalletsOfQuery({ +export function useFactoryWalletsOfQuery({ client, args, options -}: FactoryWalletsOfQuery) { - return useQuery(["factoryWalletsOf", client.contractAddress, JSON.stringify(args)], () => client.walletsOf({ +}: FactoryWalletsOfQuery) { + return useQuery(factoryQueryKeys.walletsOf(client.contractAddress, args), () => client.walletsOf({ limit: args.limit, startAfter: args.startAfter, user: args.user }), options); } -export interface FactoryWalletsQuery extends FactoryReactQuery { +export interface FactoryWalletsQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: WalletQueryPrefix; }; } -export function useFactoryWalletsQuery({ +export function useFactoryWalletsQuery({ client, args, options -}: FactoryWalletsQuery) { - return useQuery(["factoryWallets", client.contractAddress, JSON.stringify(args)], () => client.wallets({ +}: FactoryWalletsQuery) { + return useQuery(factoryQueryKeys.wallets(client.contractAddress, args), () => client.wallets({ limit: args.limit, startAfter: args.startAfter }), options); diff --git a/__output__/vectis/factory-v4-query/Factory.react-query.ts b/__output__/vectis/factory-v4-query/Factory.react-query.ts index fc74f99f..0bbeba10 100644 --- a/__output__/vectis/factory-v4-query/Factory.react-query.ts +++ b/__output__/vectis/factory-v4-query/Factory.react-query.ts @@ -13,28 +13,28 @@ export interface FactoryReactQuery { initialData?: undefined; }; } -export interface FactoryAdminAddrQuery extends FactoryReactQuery {} +export interface FactoryAdminAddrQuery extends FactoryReactQuery {} export function useFactoryAdminAddrQuery({ client, options }: FactoryAdminAddrQuery) { return useQuery(["factoryAdminAddr", client.contractAddress], () => client.adminAddr(), options); } -export interface FactoryGovecAddrQuery extends FactoryReactQuery {} +export interface FactoryGovecAddrQuery extends FactoryReactQuery {} export function useFactoryGovecAddrQuery({ client, options }: FactoryGovecAddrQuery) { return useQuery(["factoryGovecAddr", client.contractAddress], () => client.govecAddr(), options); } -export interface FactoryFeeQuery extends FactoryReactQuery {} +export interface FactoryFeeQuery extends FactoryReactQuery {} export function useFactoryFeeQuery({ client, options }: FactoryFeeQuery) { return useQuery(["factoryFee", client.contractAddress], () => client.fee(), options); } -export interface FactoryCodeIdQuery extends FactoryReactQuery { +export interface FactoryCodeIdQuery extends FactoryReactQuery { args: { ty: CodeIdType; }; @@ -48,7 +48,7 @@ export function useFactoryCodeIdQuery({ ty: args.ty }), options); } -export interface FactoryWalletsOfQuery extends FactoryReactQuery { +export interface FactoryWalletsOfQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: string; @@ -66,7 +66,7 @@ export function useFactoryWalletsOfQuery({ user: args.user }), options); } -export interface FactoryWalletsQuery extends FactoryReactQuery { +export interface FactoryWalletsQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: WalletQueryPrefix; diff --git a/__output__/vectis/factory-w-mutations/Factory.react-query.ts b/__output__/vectis/factory-w-mutations/Factory.react-query.ts index d1fa2ce2..93a6f935 100644 --- a/__output__/vectis/factory-w-mutations/Factory.react-query.ts +++ b/__output__/vectis/factory-w-mutations/Factory.react-query.ts @@ -15,28 +15,28 @@ export interface FactoryReactQuery { initialData?: undefined; }; } -export interface FactoryAdminAddrQuery extends FactoryReactQuery {} +export interface FactoryAdminAddrQuery extends FactoryReactQuery {} export function useFactoryAdminAddrQuery({ client, options }: FactoryAdminAddrQuery) { return useQuery(["factoryAdminAddr", client.contractAddress], () => client.adminAddr(), options); } -export interface FactoryGovecAddrQuery extends FactoryReactQuery {} +export interface FactoryGovecAddrQuery extends FactoryReactQuery {} export function useFactoryGovecAddrQuery({ client, options }: FactoryGovecAddrQuery) { return useQuery(["factoryGovecAddr", client.contractAddress], () => client.govecAddr(), options); } -export interface FactoryFeeQuery extends FactoryReactQuery {} +export interface FactoryFeeQuery extends FactoryReactQuery {} export function useFactoryFeeQuery({ client, options }: FactoryFeeQuery) { return useQuery(["factoryFee", client.contractAddress], () => client.fee(), options); } -export interface FactoryCodeIdQuery extends FactoryReactQuery { +export interface FactoryCodeIdQuery extends FactoryReactQuery { args: { ty: CodeIdType; }; @@ -50,7 +50,7 @@ export function useFactoryCodeIdQuery({ ty: args.ty }), options); } -export interface FactoryWalletsOfQuery extends FactoryReactQuery { +export interface FactoryWalletsOfQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: string; @@ -68,7 +68,7 @@ export function useFactoryWalletsOfQuery({ user: args.user }), options); } -export interface FactoryWalletsQuery extends FactoryReactQuery { +export interface FactoryWalletsQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: WalletQueryPrefix; diff --git a/__output__/vectis/factory/Factory.react-query.ts b/__output__/vectis/factory/Factory.react-query.ts index 41b88b79..2d40ad5e 100644 --- a/__output__/vectis/factory/Factory.react-query.ts +++ b/__output__/vectis/factory/Factory.react-query.ts @@ -11,28 +11,28 @@ export interface FactoryReactQuery { client: FactoryQueryClient; options?: UseQueryOptions; } -export interface FactoryAdminAddrQuery extends FactoryReactQuery {} +export interface FactoryAdminAddrQuery extends FactoryReactQuery {} export function useFactoryAdminAddrQuery({ client, options }: FactoryAdminAddrQuery) { return useQuery(["factoryAdminAddr", client.contractAddress], () => client.adminAddr(), options); } -export interface FactoryGovecAddrQuery extends FactoryReactQuery {} +export interface FactoryGovecAddrQuery extends FactoryReactQuery {} export function useFactoryGovecAddrQuery({ client, options }: FactoryGovecAddrQuery) { return useQuery(["factoryGovecAddr", client.contractAddress], () => client.govecAddr(), options); } -export interface FactoryFeeQuery extends FactoryReactQuery {} +export interface FactoryFeeQuery extends FactoryReactQuery {} export function useFactoryFeeQuery({ client, options }: FactoryFeeQuery) { return useQuery(["factoryFee", client.contractAddress], () => client.fee(), options); } -export interface FactoryCodeIdQuery extends FactoryReactQuery { +export interface FactoryCodeIdQuery extends FactoryReactQuery { args: { ty: CodeIdType; }; @@ -46,7 +46,7 @@ export function useFactoryCodeIdQuery({ ty: args.ty }), options); } -export interface FactoryWalletsOfQuery extends FactoryReactQuery { +export interface FactoryWalletsOfQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: string; @@ -64,7 +64,7 @@ export function useFactoryWalletsOfQuery({ user: args.user }), options); } -export interface FactoryWalletsQuery extends FactoryReactQuery { +export interface FactoryWalletsQuery extends FactoryReactQuery { args: { limit?: number; startAfter?: WalletQueryPrefix; diff --git a/__output__/vectis/govec/Govec.react-query.ts b/__output__/vectis/govec/Govec.react-query.ts index 638b2bd1..88d2ed1f 100644 --- a/__output__/vectis/govec/Govec.react-query.ts +++ b/__output__/vectis/govec/Govec.react-query.ts @@ -11,7 +11,7 @@ export interface GovecReactQuery { client: GovecQueryClient; options?: UseQueryOptions; } -export interface GovecCanExecuteRelayQuery extends GovecReactQuery { +export interface GovecCanExecuteRelayQuery extends GovecReactQuery { args: { sender: string; }; @@ -25,7 +25,7 @@ export function useGovecCanExecuteRelayQuery({ sender: args.sender }), options); } -export interface GovecInfoQuery extends GovecReactQuery {} +export interface GovecInfoQuery extends GovecReactQuery {} export function useGovecInfoQuery({ client, options diff --git a/__output__/vectis/proxy/Proxy.react-query.ts b/__output__/vectis/proxy/Proxy.react-query.ts index 1bcb2754..a6fc6d41 100644 --- a/__output__/vectis/proxy/Proxy.react-query.ts +++ b/__output__/vectis/proxy/Proxy.react-query.ts @@ -11,7 +11,7 @@ export interface ProxyReactQuery { client: ProxyQueryClient; options?: UseQueryOptions; } -export interface ProxyCanExecuteRelayQuery extends ProxyReactQuery { +export interface ProxyCanExecuteRelayQuery extends ProxyReactQuery { args: { sender: string; }; @@ -25,7 +25,7 @@ export function useProxyCanExecuteRelayQuery({ sender: args.sender }), options); } -export interface ProxyInfoQuery extends ProxyReactQuery {} +export interface ProxyInfoQuery extends ProxyReactQuery {} export function useProxyInfoQuery({ client, options diff --git a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap index df47231c..463da362 100644 --- a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap +++ b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap @@ -20,6 +20,7 @@ TSBuilder { "enabled": true, "mutations": false, "optionalClient": false, + "queryKeys": false, "version": "v3", }, "recoil": Object { @@ -53,6 +54,7 @@ TSBuilder { "enabled": false, "mutations": false, "optionalClient": false, + "queryKeys": false, "version": "v3", }, "recoil": Object { From d63f1f6594db19cf692da4dd062a16b277ddf057 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 22 Aug 2022 10:01:49 -0700 Subject: [PATCH 006/287] dep --- packages/ts-codegen/package.json | 3 +- .../ts-client.issues.55.test.ts.snap | 1967 ----------------- 2 files changed, 2 insertions(+), 1968 deletions(-) delete mode 100644 packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issues.55.test.ts.snap diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index c889104e..0a7e92d7 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -82,6 +82,7 @@ "@babel/types": "7.18.10", "case": "1.6.3", "dargs": "7.0.0", + "deepmerge": "4.2.2", "dotty": "0.1.2", "fuzzy": "0.1.3", "glob": "8.0.3", @@ -95,4 +96,4 @@ "shelljs": "0.8.5", "wasm-ast-types": "^0.8.1" } -} +} \ No newline at end of file diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issues.55.test.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issues.55.test.ts.snap deleted file mode 100644 index 6649bbf6..00000000 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issues.55.test.ts.snap +++ /dev/null @@ -1,1967 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`execute class /issues/0001/batch.json 1`] = ` -"export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; - sender: string; - contractAddress: string; - - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { - this.client = client; - this.sender = sender; - this.contractAddress = contractAddress; - } - -}" -`; - -exports[`execute class /issues/0001/denom_response.json 1`] = ` -"export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; - sender: string; - contractAddress: string; - - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { - this.client = client; - this.sender = sender; - this.contractAddress = contractAddress; - } - -}" -`; - -exports[`execute class /issues/0001/edge.json 1`] = ` -"export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; - sender: string; - contractAddress: string; - - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { - this.client = client; - this.sender = sender; - this.contractAddress = contractAddress; - } - -}" -`; - -exports[`execute class /issues/0001/execute_msg.json 1`] = ` -"export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; - sender: string; - contractAddress: string; - - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { - this.client = client; - this.sender = sender; - this.contractAddress = contractAddress; - this.createEdge = this.createEdge.bind(this); - this.editEdge = this.editEdge.bind(this); - this.removeEdge = this.removeEdge.bind(this); - this.createGraph = this.createGraph.bind(this); - this.createGraphSimplified = this.createGraphSimplified.bind(this); - this.editGraphSimplified = this.editGraphSimplified.bind(this); - this.removeGraph = this.removeGraph.bind(this); - this.updateEdges = this.updateEdges.bind(this); - this.findSavings = this.findSavings.bind(this); - this.findSavingsInAGraph = this.findSavingsInAGraph.bind(this); - this.reset = this.reset.bind(this); - this.saveNetworkToFile = this.saveNetworkToFile.bind(this); - this.createGraphFromFile = this.createGraphFromFile.bind(this); - this.applySetOffFromFile = this.applySetOffFromFile.bind(this); - } - - createEdge = async ({ - amount, - creditor - }: { - amount: number; - creditor: Addr; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - create_edge: { - amount, - creditor - } - }, fee, memo, funds); - }; - editEdge = async ({ - amount, - creditor, - edgeId - }: { - amount: number; - creditor: Addr; - edgeId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - edit_edge: { - amount, - creditor, - edge_id: edgeId - } - }, fee, memo, funds); - }; - removeEdge = async ({ - edgeId - }: { - edgeId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - remove_edge: { - edge_id: edgeId - } - }, fee, memo, funds); - }; - createGraph = async ({ - graph - }: { - graph: Edge[]; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - create_graph: { - graph - } - }, fee, memo, funds); - }; - createGraphSimplified = async ({ - graph, - graphId - }: { - graph: Addr[][]; - graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - create_graph_simplified: { - graph, - graph_id: graphId - } - }, fee, memo, funds); - }; - editGraphSimplified = async ({ - graph, - graphId - }: { - graph: Addr[][]; - graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - edit_graph_simplified: { - graph, - graph_id: graphId - } - }, fee, memo, funds); - }; - removeGraph = async ({ - graphId - }: { - graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - remove_graph: { - graph_id: graphId - } - }, fee, memo, funds); - }; - updateEdges = async ({ - edges - }: { - edges: number[][]; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - update_edges: { - edges - } - }, fee, memo, funds); - }; - findSavings = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - find_savings: {} - }, fee, memo, funds); - }; - findSavingsInAGraph = async ({ - graphId - }: { - graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - find_savings_in_a_graph: { - graph_id: graphId - } - }, fee, memo, funds); - }; - reset = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - reset: {} - }, fee, memo, funds); - }; - saveNetworkToFile = async ({ - filepath - }: { - filepath: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - save_network_to_file: { - filepath - } - }, fee, memo, funds); - }; - createGraphFromFile = async ({ - filepath - }: { - filepath: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - create_graph_from_file: { - filepath - } - }, fee, memo, funds); - }; - applySetOffFromFile = async ({ - filepath - }: { - filepath: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - apply_set_off_from_file: { - filepath - } - }, fee, memo, funds); - }; -}" -`; - -exports[`execute class /issues/0001/instantiate_msg.json 1`] = ` -"export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; - sender: string; - contractAddress: string; - - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { - this.client = client; - this.sender = sender; - this.contractAddress = contractAddress; - } - -}" -`; - -exports[`execute class /issues/0001/network.json 1`] = ` -"export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; - sender: string; - contractAddress: string; - - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { - this.client = client; - this.sender = sender; - this.contractAddress = contractAddress; - } - -}" -`; - -exports[`execute class /issues/0001/query_msg.json 1`] = ` -"export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; - sender: string; - contractAddress: string; - - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { - this.client = client; - this.sender = sender; - this.contractAddress = contractAddress; - this.getDenom = this.getDenom.bind(this); - this.getOwner = this.getOwner.bind(this); - this.allEdges = this.allEdges.bind(this); - this.oneEdge = this.oneEdge.bind(this); - this.oneBatch = this.oneBatch.bind(this); - this.oneGraph = this.oneGraph.bind(this); - this.getEdgesByAddress = this.getEdgesByAddress.bind(this); - this.getEdgesAsCounterparty = this.getEdgesAsCounterparty.bind(this); - this.getTotalDebtPerAddress = this.getTotalDebtPerAddress.bind(this); - this.getTotalCreditPerAddress = this.getTotalCreditPerAddress.bind(this); - this.getTotalDebtByGraph = this.getTotalDebtByGraph.bind(this); - this.getTotalDebt = this.getTotalDebt.bind(this); - } - - getDenom = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - get_denom: {} - }, fee, memo, funds); - }; - getOwner = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - get_owner: {} - }, fee, memo, funds); - }; - allEdges = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - all_edges: {} - }, fee, memo, funds); - }; - oneEdge = async ({ - edgeId - }: { - edgeId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - one_edge: { - edge_id: edgeId - } - }, fee, memo, funds); - }; - oneBatch = async ({ - batchId - }: { - batchId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - one_batch: { - batch_id: batchId - } - }, fee, memo, funds); - }; - oneGraph = async ({ - graphId - }: { - graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - one_graph: { - graph_id: graphId - } - }, fee, memo, funds); - }; - getEdgesByAddress = async ({ - address - }: { - address: Addr; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - get_edges_by_address: { - address - } - }, fee, memo, funds); - }; - getEdgesAsCounterparty = async ({ - address - }: { - address: Addr; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - get_edges_as_counterparty: { - address - } - }, fee, memo, funds); - }; - getTotalDebtPerAddress = async ({ - address - }: { - address: Addr; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - get_total_debt_per_address: { - address - } - }, fee, memo, funds); - }; - getTotalCreditPerAddress = async ({ - address - }: { - address: Addr; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - get_total_credit_per_address: { - address - } - }, fee, memo, funds); - }; - getTotalDebtByGraph = async ({ - graphId - }: { - graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - get_total_debt_by_graph: { - graph_id: graphId - } - }, fee, memo, funds); - }; - getTotalDebt = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - get_total_debt: {} - }, fee, memo, funds); - }; -}" -`; - -exports[`execute class /issues/55/batch.json 1`] = ` -"export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; - sender: string; - contractAddress: string; - - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { - this.client = client; - this.sender = sender; - this.contractAddress = contractAddress; - } - -}" -`; - -exports[`execute class /issues/55/denom_response.json 1`] = ` -"export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; - sender: string; - contractAddress: string; - - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { - this.client = client; - this.sender = sender; - this.contractAddress = contractAddress; - } - -}" -`; - -exports[`execute class /issues/55/edge.json 1`] = ` -"export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; - sender: string; - contractAddress: string; - - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { - this.client = client; - this.sender = sender; - this.contractAddress = contractAddress; - } - -}" -`; - -exports[`execute class /issues/55/execute_msg.json 1`] = ` -"export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; - sender: string; - contractAddress: string; - - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { - this.client = client; - this.sender = sender; - this.contractAddress = contractAddress; - this.createEdge = this.createEdge.bind(this); - this.editEdge = this.editEdge.bind(this); - this.removeEdge = this.removeEdge.bind(this); - this.createGraph = this.createGraph.bind(this); - this.createGraphSimplified = this.createGraphSimplified.bind(this); - this.editGraphSimplified = this.editGraphSimplified.bind(this); - this.removeGraph = this.removeGraph.bind(this); - this.updateEdges = this.updateEdges.bind(this); - this.findSavings = this.findSavings.bind(this); - this.findSavingsInAGraph = this.findSavingsInAGraph.bind(this); - this.reset = this.reset.bind(this); - this.saveNetworkToFile = this.saveNetworkToFile.bind(this); - this.createGraphFromFile = this.createGraphFromFile.bind(this); - this.applySetOffFromFile = this.applySetOffFromFile.bind(this); - } - - createEdge = async ({ - amount, - creditor - }: { - amount: number; - creditor: Addr; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - create_edge: { - amount, - creditor - } - }, fee, memo, funds); - }; - editEdge = async ({ - amount, - creditor, - edgeId - }: { - amount: number; - creditor: Addr; - edgeId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - edit_edge: { - amount, - creditor, - edge_id: edgeId - } - }, fee, memo, funds); - }; - removeEdge = async ({ - edgeId - }: { - edgeId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - remove_edge: { - edge_id: edgeId - } - }, fee, memo, funds); - }; - createGraph = async ({ - graph - }: { - graph: Edge[]; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - create_graph: { - graph - } - }, fee, memo, funds); - }; - createGraphSimplified = async ({ - graph, - graphId - }: { - graph: Addr[][]; - graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - create_graph_simplified: { - graph, - graph_id: graphId - } - }, fee, memo, funds); - }; - editGraphSimplified = async ({ - graph, - graphId - }: { - graph: Addr[][]; - graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - edit_graph_simplified: { - graph, - graph_id: graphId - } - }, fee, memo, funds); - }; - removeGraph = async ({ - graphId - }: { - graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - remove_graph: { - graph_id: graphId - } - }, fee, memo, funds); - }; - updateEdges = async ({ - edges - }: { - edges: number[][]; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - update_edges: { - edges - } - }, fee, memo, funds); - }; - findSavings = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - find_savings: {} - }, fee, memo, funds); - }; - findSavingsInAGraph = async ({ - graphId - }: { - graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - find_savings_in_a_graph: { - graph_id: graphId - } - }, fee, memo, funds); - }; - reset = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - reset: {} - }, fee, memo, funds); - }; - saveNetworkToFile = async ({ - filepath - }: { - filepath: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - save_network_to_file: { - filepath - } - }, fee, memo, funds); - }; - createGraphFromFile = async ({ - filepath - }: { - filepath: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - create_graph_from_file: { - filepath - } - }, fee, memo, funds); - }; - applySetOffFromFile = async ({ - filepath - }: { - filepath: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - apply_set_off_from_file: { - filepath - } - }, fee, memo, funds); - }; -}" -`; - -exports[`execute class /issues/55/instantiate_msg.json 1`] = ` -"export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; - sender: string; - contractAddress: string; - - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { - this.client = client; - this.sender = sender; - this.contractAddress = contractAddress; - } - -}" -`; - -exports[`execute class /issues/55/network.json 1`] = ` -"export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; - sender: string; - contractAddress: string; - - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { - this.client = client; - this.sender = sender; - this.contractAddress = contractAddress; - } - -}" -`; - -exports[`execute class /issues/55/query_msg.json 1`] = ` -"export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; - sender: string; - contractAddress: string; - - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { - this.client = client; - this.sender = sender; - this.contractAddress = contractAddress; - this.getDenom = this.getDenom.bind(this); - this.getOwner = this.getOwner.bind(this); - this.allEdges = this.allEdges.bind(this); - this.oneEdge = this.oneEdge.bind(this); - this.oneBatch = this.oneBatch.bind(this); - this.oneGraph = this.oneGraph.bind(this); - this.getEdgesByAddress = this.getEdgesByAddress.bind(this); - this.getEdgesAsCounterparty = this.getEdgesAsCounterparty.bind(this); - this.getTotalDebtPerAddress = this.getTotalDebtPerAddress.bind(this); - this.getTotalCreditPerAddress = this.getTotalCreditPerAddress.bind(this); - this.getTotalDebtByGraph = this.getTotalDebtByGraph.bind(this); - this.getTotalDebt = this.getTotalDebt.bind(this); - } - - getDenom = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - get_denom: {} - }, fee, memo, funds); - }; - getOwner = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - get_owner: {} - }, fee, memo, funds); - }; - allEdges = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - all_edges: {} - }, fee, memo, funds); - }; - oneEdge = async ({ - edgeId - }: { - edgeId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - one_edge: { - edge_id: edgeId - } - }, fee, memo, funds); - }; - oneBatch = async ({ - batchId - }: { - batchId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - one_batch: { - batch_id: batchId - } - }, fee, memo, funds); - }; - oneGraph = async ({ - graphId - }: { - graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - one_graph: { - graph_id: graphId - } - }, fee, memo, funds); - }; - getEdgesByAddress = async ({ - address - }: { - address: Addr; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - get_edges_by_address: { - address - } - }, fee, memo, funds); - }; - getEdgesAsCounterparty = async ({ - address - }: { - address: Addr; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - get_edges_as_counterparty: { - address - } - }, fee, memo, funds); - }; - getTotalDebtPerAddress = async ({ - address - }: { - address: Addr; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - get_total_debt_per_address: { - address - } - }, fee, memo, funds); - }; - getTotalCreditPerAddress = async ({ - address - }: { - address: Addr; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - get_total_credit_per_address: { - address - } - }, fee, memo, funds); - }; - getTotalDebtByGraph = async ({ - graphId - }: { - graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - get_total_debt_by_graph: { - graph_id: graphId - } - }, fee, memo, funds); - }; - getTotalDebt = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - get_total_debt: {} - }, fee, memo, funds); - }; -}" -`; - -exports[`execute interface /issues/0001/batch.json 1`] = ` -"export interface SG721Instance { - contractAddress: string; - sender: string; -}" -`; - -exports[`execute interface /issues/0001/denom_response.json 1`] = ` -"export interface SG721Instance { - contractAddress: string; - sender: string; -}" -`; - -exports[`execute interface /issues/0001/edge.json 1`] = ` -"export interface SG721Instance { - contractAddress: string; - sender: string; -}" -`; - -exports[`execute interface /issues/0001/execute_msg.json 1`] = ` -"export interface SG721Instance { - contractAddress: string; - sender: string; - createEdge: ({ - amount, - creditor - }: { - amount: number; - creditor: Addr; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - editEdge: ({ - amount, - creditor, - edgeId - }: { - amount: number; - creditor: Addr; - edgeId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - removeEdge: ({ - edgeId - }: { - edgeId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - createGraph: ({ - graph - }: { - graph: Edge[]; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - createGraphSimplified: ({ - graph, - graphId - }: { - graph: Addr[][]; - graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - editGraphSimplified: ({ - graph, - graphId - }: { - graph: Addr[][]; - graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - removeGraph: ({ - graphId - }: { - graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - updateEdges: ({ - edges - }: { - edges: number[][]; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - findSavings: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - findSavingsInAGraph: ({ - graphId - }: { - graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - reset: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - saveNetworkToFile: ({ - filepath - }: { - filepath: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - createGraphFromFile: ({ - filepath - }: { - filepath: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - applySetOffFromFile: ({ - filepath - }: { - filepath: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; -}" -`; - -exports[`execute interface /issues/0001/instantiate_msg.json 1`] = ` -"export interface SG721Instance { - contractAddress: string; - sender: string; -}" -`; - -exports[`execute interface /issues/0001/network.json 1`] = ` -"export interface SG721Instance { - contractAddress: string; - sender: string; -}" -`; - -exports[`execute interface /issues/0001/query_msg.json 1`] = ` -"export interface SG721Instance { - contractAddress: string; - sender: string; - getDenom: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - getOwner: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - allEdges: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - oneEdge: ({ - edgeId - }: { - edgeId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - oneBatch: ({ - batchId - }: { - batchId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - oneGraph: ({ - graphId - }: { - graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - getEdgesByAddress: ({ - address - }: { - address: Addr; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - getEdgesAsCounterparty: ({ - address - }: { - address: Addr; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - getTotalDebtPerAddress: ({ - address - }: { - address: Addr; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - getTotalCreditPerAddress: ({ - address - }: { - address: Addr; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - getTotalDebtByGraph: ({ - graphId - }: { - graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - getTotalDebt: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; -}" -`; - -exports[`execute interface /issues/55/batch.json 1`] = ` -"export interface SG721Instance { - contractAddress: string; - sender: string; -}" -`; - -exports[`execute interface /issues/55/denom_response.json 1`] = ` -"export interface SG721Instance { - contractAddress: string; - sender: string; -}" -`; - -exports[`execute interface /issues/55/edge.json 1`] = ` -"export interface SG721Instance { - contractAddress: string; - sender: string; -}" -`; - -exports[`execute interface /issues/55/execute_msg.json 1`] = ` -"export interface SG721Instance { - contractAddress: string; - sender: string; - createEdge: ({ - amount, - creditor - }: { - amount: number; - creditor: Addr; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - editEdge: ({ - amount, - creditor, - edgeId - }: { - amount: number; - creditor: Addr; - edgeId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - removeEdge: ({ - edgeId - }: { - edgeId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - createGraph: ({ - graph - }: { - graph: Edge[]; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - createGraphSimplified: ({ - graph, - graphId - }: { - graph: Addr[][]; - graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - editGraphSimplified: ({ - graph, - graphId - }: { - graph: Addr[][]; - graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - removeGraph: ({ - graphId - }: { - graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - updateEdges: ({ - edges - }: { - edges: number[][]; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - findSavings: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - findSavingsInAGraph: ({ - graphId - }: { - graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - reset: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - saveNetworkToFile: ({ - filepath - }: { - filepath: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - createGraphFromFile: ({ - filepath - }: { - filepath: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - applySetOffFromFile: ({ - filepath - }: { - filepath: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; -}" -`; - -exports[`execute interface /issues/55/instantiate_msg.json 1`] = ` -"export interface SG721Instance { - contractAddress: string; - sender: string; -}" -`; - -exports[`execute interface /issues/55/network.json 1`] = ` -"export interface SG721Instance { - contractAddress: string; - sender: string; -}" -`; - -exports[`execute interface /issues/55/query_msg.json 1`] = ` -"export interface SG721Instance { - contractAddress: string; - sender: string; - getDenom: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - getOwner: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - allEdges: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - oneEdge: ({ - edgeId - }: { - edgeId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - oneBatch: ({ - batchId - }: { - batchId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - oneGraph: ({ - graphId - }: { - graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - getEdgesByAddress: ({ - address - }: { - address: Addr; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - getEdgesAsCounterparty: ({ - address - }: { - address: Addr; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - getTotalDebtPerAddress: ({ - address - }: { - address: Addr; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - getTotalCreditPerAddress: ({ - address - }: { - address: Addr; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - getTotalDebtByGraph: ({ - graphId - }: { - graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - getTotalDebt: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; -}" -`; - -exports[`execute_msg_for__empty /issues/0001/batch.json 1`] = ` -"export interface Batch { - batchId: number; - setoffs: number[][]; -}" -`; - -exports[`execute_msg_for__empty /issues/0001/denom_response.json 1`] = ` -"export interface DenomResponse { - denom: string; -}" -`; - -exports[`execute_msg_for__empty /issues/0001/edge.json 1`] = ` -"export interface Edge { - amount: number; - creditor: Addr; - debtor: Addr; - edgeId: number; - graphId?: number; -}" -`; - -exports[`execute_msg_for__empty /issues/0001/execute_msg.json 1`] = `"export type ExecuteMsg = ExecuteMsg;"`; - -exports[`execute_msg_for__empty /issues/0001/instantiate_msg.json 1`] = ` -"export interface InstantiateMsg { - denom: string; -}" -`; - -exports[`execute_msg_for__empty /issues/0001/network.json 1`] = ` -"export interface Network { - denom: string; - owner: Addr; -}" -`; - -exports[`execute_msg_for__empty /issues/0001/query_msg.json 1`] = `"export type QueryMsg = QueryMsg;"`; - -exports[`execute_msg_for__empty /issues/55/batch.json 1`] = ` -"export interface Batch { - batchId: number; - setoffs: number[][]; -}" -`; - -exports[`execute_msg_for__empty /issues/55/denom_response.json 1`] = ` -"export interface DenomResponse { - denom: string; -}" -`; - -exports[`execute_msg_for__empty /issues/55/edge.json 1`] = ` -"export interface Edge { - amount: number; - creditor: Addr; - debtor: Addr; - edgeId: number; - graphId?: number; -}" -`; - -exports[`execute_msg_for__empty /issues/55/execute_msg.json 1`] = `"export type ExecuteMsg = ExecuteMsg;"`; - -exports[`execute_msg_for__empty /issues/55/instantiate_msg.json 1`] = ` -"export interface InstantiateMsg { - denom: string; -}" -`; - -exports[`execute_msg_for__empty /issues/55/network.json 1`] = ` -"export interface Network { - denom: string; - owner: Addr; -}" -`; - -exports[`execute_msg_for__empty /issues/55/query_msg.json 1`] = `"export type QueryMsg = QueryMsg;"`; - -exports[`query classes /issues/0001/batch.json 1`] = ` -"export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; - contractAddress: string; - - constructor(client: CosmWasmClient, contractAddress: string) { - this.client = client; - this.contractAddress = contractAddress; - } - -}" -`; - -exports[`query classes /issues/0001/denom_response.json 1`] = ` -"export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; - contractAddress: string; - - constructor(client: CosmWasmClient, contractAddress: string) { - this.client = client; - this.contractAddress = contractAddress; - } - -}" -`; - -exports[`query classes /issues/0001/edge.json 1`] = ` -"export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; - contractAddress: string; - - constructor(client: CosmWasmClient, contractAddress: string) { - this.client = client; - this.contractAddress = contractAddress; - } - -}" -`; - -exports[`query classes /issues/0001/execute_msg.json 1`] = ` -"export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; - contractAddress: string; - - constructor(client: CosmWasmClient, contractAddress: string) { - this.client = client; - this.contractAddress = contractAddress; - this.createEdge = this.createEdge.bind(this); - this.editEdge = this.editEdge.bind(this); - this.removeEdge = this.removeEdge.bind(this); - this.createGraph = this.createGraph.bind(this); - this.createGraphSimplified = this.createGraphSimplified.bind(this); - this.editGraphSimplified = this.editGraphSimplified.bind(this); - this.removeGraph = this.removeGraph.bind(this); - this.updateEdges = this.updateEdges.bind(this); - this.findSavings = this.findSavings.bind(this); - this.findSavingsInAGraph = this.findSavingsInAGraph.bind(this); - this.reset = this.reset.bind(this); - this.saveNetworkToFile = this.saveNetworkToFile.bind(this); - this.createGraphFromFile = this.createGraphFromFile.bind(this); - this.applySetOffFromFile = this.applySetOffFromFile.bind(this); - } - - createEdge = async ({ - amount, - creditor - }: { - amount: number; - creditor: Addr; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - create_edge: { - amount, - creditor - } - }); - }; - editEdge = async ({ - amount, - creditor, - edgeId - }: { - amount: number; - creditor: Addr; - edgeId: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - edit_edge: { - amount, - creditor, - edge_id: edgeId - } - }); - }; - removeEdge = async ({ - edgeId - }: { - edgeId: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - remove_edge: { - edge_id: edgeId - } - }); - }; - createGraph = async ({ - graph - }: { - graph: Edge[]; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - create_graph: { - graph - } - }); - }; - createGraphSimplified = async ({ - graph, - graphId - }: { - graph: Addr[][]; - graphId: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - create_graph_simplified: { - graph, - graph_id: graphId - } - }); - }; - editGraphSimplified = async ({ - graph, - graphId - }: { - graph: Addr[][]; - graphId: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - edit_graph_simplified: { - graph, - graph_id: graphId - } - }); - }; - removeGraph = async ({ - graphId - }: { - graphId: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - remove_graph: { - graph_id: graphId - } - }); - }; - updateEdges = async ({ - edges - }: { - edges: number[][]; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - update_edges: { - edges - } - }); - }; - findSavings = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - find_savings: {} - }); - }; - findSavingsInAGraph = async ({ - graphId - }: { - graphId: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - find_savings_in_a_graph: { - graph_id: graphId - } - }); - }; - reset = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - reset: {} - }); - }; - saveNetworkToFile = async ({ - filepath - }: { - filepath: string; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - save_network_to_file: { - filepath - } - }); - }; - createGraphFromFile = async ({ - filepath - }: { - filepath: string; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - create_graph_from_file: { - filepath - } - }); - }; - applySetOffFromFile = async ({ - filepath - }: { - filepath: string; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - apply_set_off_from_file: { - filepath - } - }); - }; -}" -`; - -exports[`query classes /issues/0001/instantiate_msg.json 1`] = ` -"export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; - contractAddress: string; - - constructor(client: CosmWasmClient, contractAddress: string) { - this.client = client; - this.contractAddress = contractAddress; - } - -}" -`; - -exports[`query classes /issues/0001/network.json 1`] = ` -"export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; - contractAddress: string; - - constructor(client: CosmWasmClient, contractAddress: string) { - this.client = client; - this.contractAddress = contractAddress; - } - -}" -`; - -exports[`query classes /issues/0001/query_msg.json 1`] = ` -"export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; - contractAddress: string; - - constructor(client: CosmWasmClient, contractAddress: string) { - this.client = client; - this.contractAddress = contractAddress; - this.getDenom = this.getDenom.bind(this); - this.getOwner = this.getOwner.bind(this); - this.allEdges = this.allEdges.bind(this); - this.oneEdge = this.oneEdge.bind(this); - this.oneBatch = this.oneBatch.bind(this); - this.oneGraph = this.oneGraph.bind(this); - this.getEdgesByAddress = this.getEdgesByAddress.bind(this); - this.getEdgesAsCounterparty = this.getEdgesAsCounterparty.bind(this); - this.getTotalDebtPerAddress = this.getTotalDebtPerAddress.bind(this); - this.getTotalCreditPerAddress = this.getTotalCreditPerAddress.bind(this); - this.getTotalDebtByGraph = this.getTotalDebtByGraph.bind(this); - this.getTotalDebt = this.getTotalDebt.bind(this); - } - - getDenom = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - get_denom: {} - }); - }; - getOwner = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - get_owner: {} - }); - }; - allEdges = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - all_edges: {} - }); - }; - oneEdge = async ({ - edgeId - }: { - edgeId: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - one_edge: { - edge_id: edgeId - } - }); - }; - oneBatch = async ({ - batchId - }: { - batchId: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - one_batch: { - batch_id: batchId - } - }); - }; - oneGraph = async ({ - graphId - }: { - graphId: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - one_graph: { - graph_id: graphId - } - }); - }; - getEdgesByAddress = async ({ - address - }: { - address: Addr; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - get_edges_by_address: { - address - } - }); - }; - getEdgesAsCounterparty = async ({ - address - }: { - address: Addr; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - get_edges_as_counterparty: { - address - } - }); - }; - getTotalDebtPerAddress = async ({ - address - }: { - address: Addr; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - get_total_debt_per_address: { - address - } - }); - }; - getTotalCreditPerAddress = async ({ - address - }: { - address: Addr; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - get_total_credit_per_address: { - address - } - }); - }; - getTotalDebtByGraph = async ({ - graphId - }: { - graphId: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - get_total_debt_by_graph: { - graph_id: graphId - } - }); - }; - getTotalDebt = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - get_total_debt: {} - }); - }; -}" -`; - -exports[`query classes /issues/55/batch.json 1`] = ` -"export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; - contractAddress: string; - - constructor(client: CosmWasmClient, contractAddress: string) { - this.client = client; - this.contractAddress = contractAddress; - } - -}" -`; - -exports[`query classes /issues/55/denom_response.json 1`] = ` -"export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; - contractAddress: string; - - constructor(client: CosmWasmClient, contractAddress: string) { - this.client = client; - this.contractAddress = contractAddress; - } - -}" -`; - -exports[`query classes /issues/55/edge.json 1`] = ` -"export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; - contractAddress: string; - - constructor(client: CosmWasmClient, contractAddress: string) { - this.client = client; - this.contractAddress = contractAddress; - } - -}" -`; - -exports[`query classes /issues/55/execute_msg.json 1`] = ` -"export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; - contractAddress: string; - - constructor(client: CosmWasmClient, contractAddress: string) { - this.client = client; - this.contractAddress = contractAddress; - this.createEdge = this.createEdge.bind(this); - this.editEdge = this.editEdge.bind(this); - this.removeEdge = this.removeEdge.bind(this); - this.createGraph = this.createGraph.bind(this); - this.createGraphSimplified = this.createGraphSimplified.bind(this); - this.editGraphSimplified = this.editGraphSimplified.bind(this); - this.removeGraph = this.removeGraph.bind(this); - this.updateEdges = this.updateEdges.bind(this); - this.findSavings = this.findSavings.bind(this); - this.findSavingsInAGraph = this.findSavingsInAGraph.bind(this); - this.reset = this.reset.bind(this); - this.saveNetworkToFile = this.saveNetworkToFile.bind(this); - this.createGraphFromFile = this.createGraphFromFile.bind(this); - this.applySetOffFromFile = this.applySetOffFromFile.bind(this); - } - - createEdge = async ({ - amount, - creditor - }: { - amount: number; - creditor: Addr; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - create_edge: { - amount, - creditor - } - }); - }; - editEdge = async ({ - amount, - creditor, - edgeId - }: { - amount: number; - creditor: Addr; - edgeId: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - edit_edge: { - amount, - creditor, - edge_id: edgeId - } - }); - }; - removeEdge = async ({ - edgeId - }: { - edgeId: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - remove_edge: { - edge_id: edgeId - } - }); - }; - createGraph = async ({ - graph - }: { - graph: Edge[]; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - create_graph: { - graph - } - }); - }; - createGraphSimplified = async ({ - graph, - graphId - }: { - graph: Addr[][]; - graphId: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - create_graph_simplified: { - graph, - graph_id: graphId - } - }); - }; - editGraphSimplified = async ({ - graph, - graphId - }: { - graph: Addr[][]; - graphId: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - edit_graph_simplified: { - graph, - graph_id: graphId - } - }); - }; - removeGraph = async ({ - graphId - }: { - graphId: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - remove_graph: { - graph_id: graphId - } - }); - }; - updateEdges = async ({ - edges - }: { - edges: number[][]; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - update_edges: { - edges - } - }); - }; - findSavings = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - find_savings: {} - }); - }; - findSavingsInAGraph = async ({ - graphId - }: { - graphId: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - find_savings_in_a_graph: { - graph_id: graphId - } - }); - }; - reset = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - reset: {} - }); - }; - saveNetworkToFile = async ({ - filepath - }: { - filepath: string; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - save_network_to_file: { - filepath - } - }); - }; - createGraphFromFile = async ({ - filepath - }: { - filepath: string; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - create_graph_from_file: { - filepath - } - }); - }; - applySetOffFromFile = async ({ - filepath - }: { - filepath: string; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - apply_set_off_from_file: { - filepath - } - }); - }; -}" -`; - -exports[`query classes /issues/55/instantiate_msg.json 1`] = ` -"export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; - contractAddress: string; - - constructor(client: CosmWasmClient, contractAddress: string) { - this.client = client; - this.contractAddress = contractAddress; - } - -}" -`; - -exports[`query classes /issues/55/network.json 1`] = ` -"export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; - contractAddress: string; - - constructor(client: CosmWasmClient, contractAddress: string) { - this.client = client; - this.contractAddress = contractAddress; - } - -}" -`; - -exports[`query classes /issues/55/query_msg.json 1`] = ` -"export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; - contractAddress: string; - - constructor(client: CosmWasmClient, contractAddress: string) { - this.client = client; - this.contractAddress = contractAddress; - this.getDenom = this.getDenom.bind(this); - this.getOwner = this.getOwner.bind(this); - this.allEdges = this.allEdges.bind(this); - this.oneEdge = this.oneEdge.bind(this); - this.oneBatch = this.oneBatch.bind(this); - this.oneGraph = this.oneGraph.bind(this); - this.getEdgesByAddress = this.getEdgesByAddress.bind(this); - this.getEdgesAsCounterparty = this.getEdgesAsCounterparty.bind(this); - this.getTotalDebtPerAddress = this.getTotalDebtPerAddress.bind(this); - this.getTotalCreditPerAddress = this.getTotalCreditPerAddress.bind(this); - this.getTotalDebtByGraph = this.getTotalDebtByGraph.bind(this); - this.getTotalDebt = this.getTotalDebt.bind(this); - } - - getDenom = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - get_denom: {} - }); - }; - getOwner = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - get_owner: {} - }); - }; - allEdges = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - all_edges: {} - }); - }; - oneEdge = async ({ - edgeId - }: { - edgeId: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - one_edge: { - edge_id: edgeId - } - }); - }; - oneBatch = async ({ - batchId - }: { - batchId: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - one_batch: { - batch_id: batchId - } - }); - }; - oneGraph = async ({ - graphId - }: { - graphId: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - one_graph: { - graph_id: graphId - } - }); - }; - getEdgesByAddress = async ({ - address - }: { - address: Addr; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - get_edges_by_address: { - address - } - }); - }; - getEdgesAsCounterparty = async ({ - address - }: { - address: Addr; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - get_edges_as_counterparty: { - address - } - }); - }; - getTotalDebtPerAddress = async ({ - address - }: { - address: Addr; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - get_total_debt_per_address: { - address - } - }); - }; - getTotalCreditPerAddress = async ({ - address - }: { - address: Addr; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - get_total_credit_per_address: { - address - } - }); - }; - getTotalDebtByGraph = async ({ - graphId - }: { - graphId: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - get_total_debt_by_graph: { - graph_id: graphId - } - }); - }; - getTotalDebt = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - get_total_debt: {} - }); - }; -}" -`; From d36b8c2de0e9f6eb14c9056705d460600a2b15d5 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 22 Aug 2022 10:01:55 -0700 Subject: [PATCH 007/287] chore(release): publish - @cosmwasm/ts-codegen@0.11.2 - wasm-ast-types@0.8.2 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 6 +++--- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 32e9a2d5..aa5d846a 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.11.2](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.11.1...@cosmwasm/ts-codegen@0.11.2) (2022-08-22) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.11.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.11.0...@cosmwasm/ts-codegen@0.11.1) (2022-08-14) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 0a7e92d7..8b542f77 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.11.1", + "version": "0.11.2", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -94,6 +94,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.8.1" + "wasm-ast-types": "^0.8.2" } -} \ No newline at end of file +} diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 4931f908..a199a421 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.8.2](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.8.1...wasm-ast-types@0.8.2) (2022-08-22) + +**Note:** Version bump only for package wasm-ast-types + + + + + ## [0.8.1](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.8.0...wasm-ast-types@0.8.1) (2022-08-13) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index 37c5499d..f831e202 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.8.1", + "version": "0.8.2", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From 42bd456c43144180f024ecf37b4b979620531524 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 22 Aug 2022 11:45:44 -0700 Subject: [PATCH 008/287] update package --- packages/ts-codegen/package.json | 4 +- packages/ts-codegen/src/utils/schemas.ts | 2 +- yarn.lock | 60 ++++++++++++------------ 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 8b542f77..fe8ad58c 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -87,7 +87,7 @@ "fuzzy": "0.1.3", "glob": "8.0.3", "inquirerer": "0.1.3", - "json-schema-to-typescript": "11.0.1", + "@pyramation/json-schema-to-typescript": " 11.0.4", "long": "^5.2.0", "minimist": "1.2.6", "mkdirp": "1.0.4", @@ -96,4 +96,4 @@ "shelljs": "0.8.5", "wasm-ast-types": "^0.8.2" } -} +} \ No newline at end of file diff --git a/packages/ts-codegen/src/utils/schemas.ts b/packages/ts-codegen/src/utils/schemas.ts index fa4ae08e..e98f40b0 100644 --- a/packages/ts-codegen/src/utils/schemas.ts +++ b/packages/ts-codegen/src/utils/schemas.ts @@ -1,7 +1,7 @@ import { sync as glob } from 'glob'; import { readFileSync } from 'fs'; import { cleanse } from './cleanse'; -import { compile } from 'json-schema-to-typescript'; +import { compile } from '@pyramation/json-schema-to-typescript'; import { parser } from './parse'; import { JSONSchema } from 'wasm-ast-types'; diff --git a/yarn.lock b/yarn.lock index 1acb83c4..220b3fe5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10,15 +10,6 @@ "@jridgewell/gen-mapping" "^0.1.0" "@jridgewell/trace-mapping" "^0.3.9" -"@apidevtools/json-schema-ref-parser@https://github.com/bcherny/json-schema-ref-parser.git#984282d34a2993e5243aa35100fe32a63699164d": - version "0.0.0-dev" - resolved "https://github.com/bcherny/json-schema-ref-parser.git#984282d34a2993e5243aa35100fe32a63699164d" - dependencies: - "@jsdevtools/ono" "^7.1.3" - "@types/json-schema" "^7.0.6" - call-me-maybe "^1.0.1" - js-yaml "^4.1.0" - "@babel/cli@7.18.10": version "7.18.10" resolved "https://registry.npmjs.org/@babel/cli/-/cli-7.18.10.tgz#4211adfc45ffa7d4f3cee6b60bb92e9fe68fe56a" @@ -3232,6 +3223,35 @@ "@babel/preset-react" "7.9.4" babel-plugin-macros "2.8.0" +"@pyramation/json-schema-ref-parser@9.0.6": + version "9.0.6" + resolved "https://registry.npmjs.org/@pyramation/json-schema-ref-parser/-/json-schema-ref-parser-9.0.6.tgz#556e416ce7dcc15a3c1afd04d6a059e03ed09aeb" + integrity sha512-L5kToHAEc1Q87R8ZwWFaNa4tPHr8Hnm+U+DRdUVq3tUtk+EX4pCqSd34Z6EMxNi/bjTzt1syAG9J2Oo1YFlqSg== + dependencies: + "@jsdevtools/ono" "^7.1.3" + call-me-maybe "^1.0.1" + js-yaml "^3.13.1" + +"@pyramation/json-schema-to-typescript@ 11.0.4": + version "11.0.4" + resolved "https://registry.npmjs.org/@pyramation/json-schema-to-typescript/-/json-schema-to-typescript-11.0.4.tgz#959bdb631dad336e1fdbf608a9b5908ab0da1d6b" + integrity sha512-+aSzXDLhMHOEdV2cJ7Tjg/9YenjHU5BCmClVygzwxJZ1R16NOfEn7lTAwVzb/2jivOSnhjHzMJbnSf8b6rd1zg== + dependencies: + "@pyramation/json-schema-ref-parser" "9.0.6" + "@types/json-schema" "^7.0.11" + "@types/lodash" "^4.14.182" + "@types/prettier" "^2.6.1" + cli-color "^2.0.2" + get-stdin "^8.0.0" + glob "^7.1.6" + glob-promise "^4.2.2" + is-glob "^4.0.3" + lodash "^4.17.21" + minimist "^1.2.6" + mkdirp "^1.0.4" + mz "^2.7.0" + prettier "^2.6.2" + "@sinclair/typebox@^0.23.3": version "0.23.5" resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.23.5.tgz" @@ -3336,7 +3356,7 @@ jest-matcher-utils "^28.0.0" pretty-format "^28.0.0" -"@types/json-schema@^7.0.11", "@types/json-schema@^7.0.6": +"@types/json-schema@^7.0.11": version "7.0.11" resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== @@ -6536,26 +6556,6 @@ json-parse-even-better-errors@^2.3.0: resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== -json-schema-to-typescript@11.0.1: - version "11.0.1" - resolved "https://registry.npmjs.org/json-schema-to-typescript/-/json-schema-to-typescript-11.0.1.tgz#9203036817ca797f1116cbfe9163e8a4ec948bc3" - integrity sha512-iQFEErdr9PWQUN3kLvaFFdgWAfwBeqH3PMzxza4NpSU/8uadwHKKi66Hgu5Rb3NeVSk85xkwTYIeuah+R0ASeA== - dependencies: - "@apidevtools/json-schema-ref-parser" "https://github.com/bcherny/json-schema-ref-parser.git#984282d34a2993e5243aa35100fe32a63699164d" - "@types/json-schema" "^7.0.11" - "@types/lodash" "^4.14.182" - "@types/prettier" "^2.6.1" - cli-color "^2.0.2" - get-stdin "^8.0.0" - glob "^7.1.6" - glob-promise "^4.2.2" - is-glob "^4.0.3" - lodash "^4.17.21" - minimist "^1.2.6" - mkdirp "^1.0.4" - mz "^2.7.0" - prettier "^2.6.2" - json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" From a6ba17d4ba6e02e5c34614e425720d5353f7cc6e Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 22 Aug 2022 11:45:59 -0700 Subject: [PATCH 009/287] chore(release): publish - @cosmwasm/ts-codegen@0.12.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index aa5d846a..81860e2d 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.12.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.11.2...@cosmwasm/ts-codegen@0.12.0) (2022-08-22) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.11.2](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.11.1...@cosmwasm/ts-codegen@0.11.2) (2022-08-22) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index fe8ad58c..54d0eb1d 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.11.2", + "version": "0.12.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -80,6 +80,7 @@ "@babel/runtime": "^7.18.9", "@babel/traverse": "7.18.11", "@babel/types": "7.18.10", + "@pyramation/json-schema-to-typescript": " 11.0.4", "case": "1.6.3", "dargs": "7.0.0", "deepmerge": "4.2.2", @@ -87,7 +88,6 @@ "fuzzy": "0.1.3", "glob": "8.0.3", "inquirerer": "0.1.3", - "@pyramation/json-schema-to-typescript": " 11.0.4", "long": "^5.2.0", "minimist": "1.2.6", "mkdirp": "1.0.4", @@ -96,4 +96,4 @@ "shelljs": "0.8.5", "wasm-ast-types": "^0.8.2" } -} \ No newline at end of file +} From 3b7ca02c9283c346a365d8426d3034af355afcac Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 22 Aug 2022 23:13:26 -0700 Subject: [PATCH 010/287] chore(release): publish - @cosmwasm/ts-codegen@0.13.0 - wasm-ast-types@0.9.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 81860e2d..54e5d986 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.13.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.12.0...@cosmwasm/ts-codegen@0.13.0) (2022-08-23) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.12.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.11.2...@cosmwasm/ts-codegen@0.12.0) (2022-08-22) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 54d0eb1d..8f8f38ec 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.12.0", + "version": "0.13.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -94,6 +94,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.8.2" + "wasm-ast-types": "^0.9.0" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index a199a421..4212d463 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.9.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.8.2...wasm-ast-types@0.9.0) (2022-08-23) + +**Note:** Version bump only for package wasm-ast-types + + + + + ## [0.8.2](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.8.1...wasm-ast-types@0.8.2) (2022-08-22) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index f831e202..e19ff7dd 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.8.2", + "version": "0.9.0", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From 1d22dd4e5372a7ff99e5738b01c8d75994ca8042 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 24 Aug 2022 18:12:30 -0700 Subject: [PATCH 011/287] empty bundles --- packages/ts-codegen/src/builder/builder.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/ts-codegen/src/builder/builder.ts b/packages/ts-codegen/src/builder/builder.ts index 79ab26f6..ec7ff609 100644 --- a/packages/ts-codegen/src/builder/builder.ts +++ b/packages/ts-codegen/src/builder/builder.ts @@ -167,8 +167,7 @@ export class TSBuilder { }); const ast = recursiveModuleBundle(bundleVariables); - - const code = generate(t.program( + let code = generate(t.program( [ ...importPaths, ...ast @@ -176,6 +175,9 @@ export class TSBuilder { )).code; mkdirp(this.outPath); + + if (code.trim() === '') code = 'export {};' + writeFileSync(join(this.outPath, bundleFile), header + code); } From 37ca0c4ace985d47d31fcbcf24b585e185b65432 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 24 Aug 2022 18:12:37 -0700 Subject: [PATCH 012/287] chore(release): publish - @cosmwasm/ts-codegen@0.13.1 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 54e5d986..f801dcd7 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.13.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.13.0...@cosmwasm/ts-codegen@0.13.1) (2022-08-25) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.13.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.12.0...@cosmwasm/ts-codegen@0.13.0) (2022-08-23) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 8f8f38ec..ab424ba2 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.13.0", + "version": "0.13.1", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From 8d3634e501642a228d128e9f83384b889f47c54c Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 26 Aug 2022 15:03:02 -0700 Subject: [PATCH 013/287] install --- packages/ts-codegen/src/commands/install.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/ts-codegen/src/commands/install.ts b/packages/ts-codegen/src/commands/install.ts index 267c799d..3cedf009 100644 --- a/packages/ts-codegen/src/commands/install.ts +++ b/packages/ts-codegen/src/commands/install.ts @@ -50,6 +50,7 @@ export default async (argv) => { 'stargaze-royalty-group', 'stargaze-sg721', 'stargaze-whitelist', + 'wasmswap' ].map(name => { return { name, From 8aa97ed3052ef00ea377f6fe5530d4ea7ed76ad4 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 26 Aug 2022 15:03:08 -0700 Subject: [PATCH 014/287] chore(release): publish - @cosmwasm/ts-codegen@0.13.2 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index f801dcd7..4857cb1e 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.13.2](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.13.1...@cosmwasm/ts-codegen@0.13.2) (2022-08-26) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.13.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.13.0...@cosmwasm/ts-codegen@0.13.1) (2022-08-25) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index ab424ba2..5f0b07a7 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.13.1", + "version": "0.13.2", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From 52679636294ceb7e6caf6632d00ad2f378d40090 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 26 Aug 2022 15:19:55 -0700 Subject: [PATCH 015/287] bundle --- packages/ts-codegen/src/commands/generate.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/ts-codegen/src/commands/generate.ts b/packages/ts-codegen/src/commands/generate.ts index c7343bc7..4d0c47d3 100644 --- a/packages/ts-codegen/src/commands/generate.ts +++ b/packages/ts-codegen/src/commands/generate.ts @@ -67,10 +67,10 @@ export default async (argv) => { choices: ['v3', 'v4'] }, { - type: 'confirm', - name: 'queryKeys', - message: 'queryKeys?', - default: false + type: 'confirm', + name: 'queryKeys', + message: 'queryKeys?', + default: false }, ]) }; @@ -99,7 +99,7 @@ export default async (argv) => { type: 'string', name: 'bundleFile', message: 'bundleFile?', - default: 'bundle.ts' + default: 'index.ts' }, { type: 'string', From 50046a43a3c9464fb8f8f84522d6433f25b1dc50 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 26 Aug 2022 15:20:02 -0700 Subject: [PATCH 016/287] chore(release): publish - @cosmwasm/ts-codegen@0.13.3 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 4857cb1e..3db6fe0a 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.13.3](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.13.2...@cosmwasm/ts-codegen@0.13.3) (2022-08-26) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.13.2](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.13.1...@cosmwasm/ts-codegen@0.13.2) (2022-08-26) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 5f0b07a7..e0cc265b 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.13.2", + "version": "0.13.3", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From 49f5708243b36243ff365903d7fa58565b022e02 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 26 Aug 2022 17:26:59 -0700 Subject: [PATCH 017/287] readme --- README.md | 16 ++++++++-------- packages/ts-codegen/README.md | 18 ++++++++++-------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 412d556a..db0df7a0 100644 --- a/README.md +++ b/README.md @@ -162,14 +162,14 @@ Generate [react-query v3](https://react-query-v3.tanstack.com/) or [react-query #### React Query Options - | option | description | ------------------------------| ------------------------------ | ------------------------------------------------------------------- | - | `reactQuery.enabled` | enable the react-query plugin | - | `reactQuery.optionalClient` | allows contract client to be undefined as the component renders | - | `reactQuery.queryKeys` | generates a const queryKeys object for use with invalidations and set values | - | `reactQuery.version` | `v4` uses `@tanstack/react-query` and `v3` uses `react-query` | - | `reactQuery.mutations` | also generate mutations | - | `reactQuery.camelize` | use camelCase style for property names | + | option | description | + | ----------------------------| ---------------------------------------------------------------------------- | + | `reactQuery.enabled` | enable the react-query plugin | + | `reactQuery.optionalClient` | allows contract client to be undefined as the component renders | + | `reactQuery.queryKeys` | generates a const queryKeys object for use with invalidations and set values | + | `reactQuery.version` | `v4` uses `@tanstack/react-query` and `v3` uses `react-query` | + | `reactQuery.mutations` | also generate mutations | + | `reactQuery.camelize` | use camelCase style for property names | #### React Query via CLI diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index c2397866..db0df7a0 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -106,7 +106,8 @@ codegen({ enabled: true, optionalClient: true, version: 'v4', - mutations: true + mutations: true, + queryKeys: true, }, recoil: { enabled: false @@ -161,13 +162,14 @@ Generate [react-query v3](https://react-query-v3.tanstack.com/) or [react-query #### React Query Options - | option | description | - | ------------------------------ | ------------------------------------------------------------------- | - | `reactQuery.enabled` | enable the react-query plugin | - | `reactQuery.optionalClient` | allows contract client to be undefined as the component renders | - | `reactQuery.version` | `v4` uses `@tanstack/react-query` and `v3` uses `react-query` | - | `reactQuery.mutations` | also generate mutations | - | `reactQuery.camelize` | use camelCase style for property names | + | option | description | + | ----------------------------| ---------------------------------------------------------------------------- | + | `reactQuery.enabled` | enable the react-query plugin | + | `reactQuery.optionalClient` | allows contract client to be undefined as the component renders | + | `reactQuery.queryKeys` | generates a const queryKeys object for use with invalidations and set values | + | `reactQuery.version` | `v4` uses `@tanstack/react-query` and `v3` uses `react-query` | + | `reactQuery.mutations` | also generate mutations | + | `reactQuery.camelize` | use camelCase style for property names | #### React Query via CLI From cce2e2903084d313d7a3a148a41c3f6b6c6c60e1 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 26 Aug 2022 17:27:04 -0700 Subject: [PATCH 018/287] chore(release): publish - @cosmwasm/ts-codegen@0.13.4 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 3db6fe0a..2c5b1a1d 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.13.4](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.13.3...@cosmwasm/ts-codegen@0.13.4) (2022-08-27) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.13.3](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.13.2...@cosmwasm/ts-codegen@0.13.3) (2022-08-26) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index e0cc265b..34a93fd9 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.13.3", + "version": "0.13.4", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From eab9036191e0619eca08b876756358a63c1e8c8f Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 5 Sep 2022 17:55:08 -0700 Subject: [PATCH 019/287] new IDL objects --- .../ts-codegen/__tests__/ts-codegen.test.ts | 108 +++++++++++++----- packages/ts-codegen/src/builder/builder.ts | 20 +++- packages/ts-codegen/src/commands/generate.ts | 2 +- packages/ts-codegen/src/types.ts | 16 ++- packages/ts-codegen/src/utils/schemas.ts | 64 +++++++++-- 5 files changed, 161 insertions(+), 49 deletions(-) diff --git a/packages/ts-codegen/__tests__/ts-codegen.test.ts b/packages/ts-codegen/__tests__/ts-codegen.test.ts index 6977bd3d..75863f5c 100644 --- a/packages/ts-codegen/__tests__/ts-codegen.test.ts +++ b/packages/ts-codegen/__tests__/ts-codegen.test.ts @@ -11,36 +11,46 @@ const OUTPUT_DIR = __dirname + '/../../../__output__'; it('optionalClient', async () => { const outopt = OUTPUT_DIR + '/vectis/factory-optional-client'; const schemaDir = FIXTURE_DIR + '/vectis/factory/'; - const schemas = await readSchemas({ schemaDir, schemaOptions: {} }); + const { schemas } = await readSchemas({ + schemaDir + }); await generateReactQuery('Factory', schemas, outopt, { optionalClient: true }); }) it('v4Query', async () => { const outopt = OUTPUT_DIR + '/vectis/factory-v4-query'; const schemaDir = FIXTURE_DIR + '/vectis/factory/'; - const schemas = await readSchemas({ schemaDir, schemaOptions: {} }); + const { schemas } = await readSchemas({ + schemaDir + }); await generateReactQuery('Factory', schemas, outopt, { version: 'v4' }); }) it('queryKeys', async () => { - const outopt = OUTPUT_DIR + '/vectis/factory-query-keys'; - const schemaDir = FIXTURE_DIR + '/vectis/factory/'; - const schemas = await readSchemas({ schemaDir, schemaOptions: {} }); - await generateReactQuery('Factory', schemas, outopt, { queryKeys: true }); + const outopt = OUTPUT_DIR + '/vectis/factory-query-keys'; + const schemaDir = FIXTURE_DIR + '/vectis/factory/'; + const { schemas } = await readSchemas({ + schemaDir + }); + await generateReactQuery('Factory', schemas, outopt, { queryKeys: true }); }) it('queryKeysOptionalClient', async () => { - const outopt = OUTPUT_DIR + '/vectis/factory-query-keys-optional-client'; - const schemaDir = FIXTURE_DIR + '/vectis/factory/'; - const schemas = await readSchemas({ schemaDir, schemaOptions: {} }); - await generateReactQuery('Factory', schemas, outopt, { queryKeys: true, optionalClient: true }); + const outopt = OUTPUT_DIR + '/vectis/factory-query-keys-optional-client'; + const schemaDir = FIXTURE_DIR + '/vectis/factory/'; + const { schemas } = await readSchemas({ + schemaDir + }); + await generateReactQuery('Factory', schemas, outopt, { queryKeys: true, optionalClient: true }); }) it('useMutations', async () => { const outopt = OUTPUT_DIR + '/vectis/factory-w-mutations'; const schemaDir = FIXTURE_DIR + '/vectis/factory/'; - const schemas = await readSchemas({ schemaDir, schemaOptions: {} }); + const { schemas } = await readSchemas({ + schemaDir + }); await generateReactQuery('Factory', schemas, outopt, { version: 'v4', mutations: true }); }) @@ -48,7 +58,9 @@ it('vectis/factory', async () => { const out = OUTPUT_DIR + '/vectis/factory'; const schemaDir = FIXTURE_DIR + '/vectis/factory/'; - const schemas = await readSchemas({ schemaDir, schemaOptions: {} }); + const { schemas } = await readSchemas({ + schemaDir + }); await generateTypes('Factory', schemas, out); await generateClient('Factory', schemas, out); await generateMessageComposer('Factory', schemas, out); @@ -60,7 +72,9 @@ it('vectis/govec', async () => { const out = OUTPUT_DIR + '/vectis/govec'; const schemaDir = FIXTURE_DIR + '/vectis/govec/'; - const schemas = await readSchemas({ schemaDir, schemaOptions: {} }); + const { schemas } = await readSchemas({ + schemaDir + }); await generateTypes('Govec', schemas, out); await generateClient('Govec', schemas, out); await generateMessageComposer('Govec', schemas, out); @@ -72,7 +86,9 @@ it('vectis/proxy', async () => { const out = OUTPUT_DIR + '/vectis/proxy'; const schemaDir = FIXTURE_DIR + '/vectis/proxy/'; - const schemas = await readSchemas({ schemaDir, schemaOptions: {} }); + const { schemas } = await readSchemas({ + schemaDir + }); await generateTypes('Proxy', schemas, out); await generateClient('Proxy', schemas, out); await generateMessageComposer('Proxy', schemas, out); @@ -80,21 +96,12 @@ it('vectis/proxy', async () => { await generateReactQuery('Proxy', schemas, out); }) -it('cosmwasm', async () => { - const out = OUTPUT_DIR + '/cosmwasm'; - const schemaDir = FIXTURE_DIR + '/cosmwasm/'; - const schemas = await readSchemas({ schemaDir, schemaOptions: { packed: true } }); - await generateTypes('CW4Group', schemas, out); - await generateClient('CW4Group', schemas, out); - await generateMessageComposer('CW4Group', schemas, out); - await generateRecoil('CW4Group', schemas, out); - await generateReactQuery('CW4Group', schemas, out); -}) - it('minter', async () => { const out = OUTPUT_DIR + '/minter'; const schemaDir = FIXTURE_DIR + '/minter/'; - const schemas = await readSchemas({ schemaDir, schemaOptions: {} }); + const { schemas } = await readSchemas({ + schemaDir + }); await generateTypes('Minter', schemas, out); await generateClient('Minter', schemas, out); await generateMessageComposer('Minter', schemas, out); @@ -106,7 +113,9 @@ it('sg721', async () => { const out = OUTPUT_DIR + '/sg721'; const schemaDir = FIXTURE_DIR + '/sg721/'; - const schemas = await readSchemas({ schemaDir, schemaOptions: {} }); + const { schemas } = await readSchemas({ + schemaDir + }); await generateTypes('Sg721', schemas, out); await generateClient('Sg721', schemas, out); await generateMessageComposer('Sg721', schemas, out); @@ -118,7 +127,9 @@ it('cw-named-groups', async () => { const out = OUTPUT_DIR + '/daodao/cw-named-groups'; const schemaDir = FIXTURE_DIR + '/daodao/cw-named-groups/'; - const schemas = await readSchemas({ schemaDir, schemaOptions: {} }); + const { schemas } = await readSchemas({ + schemaDir + }); await generateTypes('CwNamedGroups', schemas, out); await generateClient('CwNamedGroups', schemas, out); await generateMessageComposer('CwNamedGroups', schemas, out); @@ -130,7 +141,9 @@ it('cw-proposal-single', async () => { const out = OUTPUT_DIR + '/daodao/cw-proposal-single'; const schemaDir = FIXTURE_DIR + '/daodao/cw-proposal-single/'; - const schemas = await readSchemas({ schemaDir, schemaOptions: {} }); + const { schemas } = await readSchemas({ + schemaDir + }); await generateTypes('CwProposalSingle', schemas, out); await generateClient('CwProposalSingle', schemas, out); await generateMessageComposer('CwProposalSingle', schemas, out); @@ -142,7 +155,9 @@ it('cw-admin-factory', async () => { const out = OUTPUT_DIR + '/daodao/cw-admin-factory'; const schemaDir = FIXTURE_DIR + '/daodao/cw-admin-factory/'; - const schemas = await readSchemas({ schemaDir, schemaOptions: {} }); + const { schemas } = await readSchemas({ + schemaDir + }); await generateTypes('CwAdminFactory', schemas, out); await generateClient('CwAdminFactory', schemas, out); await generateMessageComposer('CwAdminFactory', schemas, out); @@ -154,10 +169,41 @@ it('cw-code-id-registry', async () => { const out = OUTPUT_DIR + '/daodao/cw-code-id-registry'; const schemaDir = FIXTURE_DIR + '/daodao/cw-code-id-registry/'; - const schemas = await readSchemas({ schemaDir, schemaOptions: {} }); + const { schemas } = await readSchemas({ + schemaDir + }); await generateTypes('CwCodeIdRegistry', schemas, out); await generateClient('CwCodeIdRegistry', schemas, out); await generateMessageComposer('CwCodeIdRegistry', schemas, out); await generateRecoil('CwCodeIdRegistry', schemas, out); await generateReactQuery('CwCodeIdRegistry', schemas, out); }) + +it('idl-version/hackatom', async () => { + const out = OUTPUT_DIR + '/idl-version/hackatom'; + const schemaDir = FIXTURE_DIR + '/idl-version/hackatom/'; + + const { schemas } = await readSchemas({ + schemaDir + }); + await generateTypes('HackAtom', schemas, out); + await generateClient('HackAtom', schemas, out); + await generateMessageComposer('HackAtom', schemas, out); + await generateRecoil('HackAtom', schemas, out); + await generateReactQuery('HackAtom', schemas, out); +}) + +it('idl-version/cyberpunk', async () => { + const out = OUTPUT_DIR + '/idl-version/cyberpunk'; + const schemaDir = FIXTURE_DIR + '/idl-version/cyberpunk/'; + + const { schemas } = await readSchemas({ + schemaDir + }); + + await generateTypes('CyberPunk', schemas, out); + await generateClient('CyberPunk', schemas, out); + await generateMessageComposer('CyberPunk', schemas, out); + await generateRecoil('CyberPunk', schemas, out); + await generateReactQuery('CyberPunk', schemas, out); +}) diff --git a/packages/ts-codegen/src/builder/builder.ts b/packages/ts-codegen/src/builder/builder.ts index ec7ff609..9f15817c 100644 --- a/packages/ts-codegen/src/builder/builder.ts +++ b/packages/ts-codegen/src/builder/builder.ts @@ -95,7 +95,9 @@ export class TSBuilder { async renderTypes(contract: ContractFile) { const { enabled, ...options } = this.options.types; if (!enabled) return; - const schemas = await readSchemas({ schemaDir: contract.dir }); + const { schemas } = await readSchemas({ + schemaDir: contract.dir + }); const files = await generateTypes(contract.name, schemas, this.outPath, options); [].push.apply(this.files, files); } @@ -103,7 +105,9 @@ export class TSBuilder { async renderClient(contract: ContractFile) { const { enabled, ...options } = this.options.client; if (!enabled) return; - const schemas = await readSchemas({ schemaDir: contract.dir }); + const { schemas } = await readSchemas({ + schemaDir: contract.dir + }); const files = await generateClient(contract.name, schemas, this.outPath, options); [].push.apply(this.files, files); } @@ -111,7 +115,9 @@ export class TSBuilder { async renderRecoil(contract: ContractFile) { const { enabled, ...options } = this.options.recoil; if (!enabled) return; - const schemas = await readSchemas({ schemaDir: contract.dir }); + const { schemas } = await readSchemas({ + schemaDir: contract.dir + }); const files = await generateRecoil(contract.name, schemas, this.outPath, options); [].push.apply(this.files, files); } @@ -119,7 +125,9 @@ export class TSBuilder { async renderReactQuery(contract: ContractFile) { const { enabled, ...options } = this.options.reactQuery; if (!enabled) return; - const schemas = await readSchemas({ schemaDir: contract.dir }); + const { schemas } = await readSchemas({ + schemaDir: contract.dir + }); const files = await generateReactQuery(contract.name, schemas, this.outPath, options); [].push.apply(this.files, files); } @@ -127,7 +135,9 @@ export class TSBuilder { async renderMessageComposer(contract: ContractFile) { const { enabled, ...options } = this.options.messageComposer; if (!enabled) return; - const schemas = await readSchemas({ schemaDir: contract.dir }); + const { schemas } = await readSchemas({ + schemaDir: contract.dir + }); const files = await generateMessageComposer(contract.name, schemas, this.outPath, options); [].push.apply(this.files, files); } diff --git a/packages/ts-codegen/src/commands/generate.ts b/packages/ts-codegen/src/commands/generate.ts index 4d0c47d3..182313d7 100644 --- a/packages/ts-codegen/src/commands/generate.ts +++ b/packages/ts-codegen/src/commands/generate.ts @@ -46,6 +46,7 @@ export default async (argv) => { if (argv.typesOnly) { argv.plugin = 'types'; } + let { schema, out, name, plugin, bundle } = await prompt(questions, argv); if (!Array.isArray(plugin)) plugin = [plugin]; @@ -112,7 +113,6 @@ export default async (argv) => { const { bundleFile, bundleScope } = await prompt(questions4, argv); ///////// END BUNDLE - const options: TSBuilderOptions = { types: { enabled: true diff --git a/packages/ts-codegen/src/types.ts b/packages/ts-codegen/src/types.ts index fd550b46..cefe1c96 100644 --- a/packages/ts-codegen/src/types.ts +++ b/packages/ts-codegen/src/types.ts @@ -1,2 +1,16 @@ -import { TSClientOptions, ReactQueryOptions } from "wasm-ast-types"; +import { JSONSchema } from "wasm-ast-types"; +interface KeyedSchema { + [key: string]: JSONSchema; +} +export interface IDLObject { + contract_name: string; + contract_version: string; + idl_version: string; + instantiate: JSONSchema; + execute: JSONSchema; + query: JSONSchema; + migrate: JSONSchema; + sudo: JSONSchema; + responses: KeyedSchema; +} \ No newline at end of file diff --git a/packages/ts-codegen/src/utils/schemas.ts b/packages/ts-codegen/src/utils/schemas.ts index e98f40b0..fe6c1144 100644 --- a/packages/ts-codegen/src/utils/schemas.ts +++ b/packages/ts-codegen/src/utils/schemas.ts @@ -4,30 +4,72 @@ import { cleanse } from './cleanse'; import { compile } from '@pyramation/json-schema-to-typescript'; import { parser } from './parse'; import { JSONSchema } from 'wasm-ast-types'; +import { IDLObject } from '../types'; interface ReadSchemaOpts { schemaDir: string; - schemaOptions?: { - packed?: boolean - }; clean?: boolean; }; +interface ReadSchemasValue { + schemas: JSONSchema[]; + idlObject?: IDLObject +}; export const readSchemas = async ({ - schemaDir, schemaOptions, clean = true -}: ReadSchemaOpts) => { + schemaDir, clean = true +}: ReadSchemaOpts): Promise => { const fn = clean ? cleanse : (str) => str; const files = glob(schemaDir + '/**/*.json'); const schemas = files .map(file => JSON.parse(readFileSync(file, 'utf-8'))); - if (schemaOptions?.packed) { - if (schemas.length !== 1) { - throw new Error('packed option only supports one file'); - } - return Object.values(fn(schemas[0])); + if (schemas.length > 1) { + // legacy + // TODO add console.warn here + return { + schemas: fn(schemas) + }; + } + + if (schemas.length === 0) { + throw new Error('Error [too few files]: requires one schema file per contract'); + } + + if (schemas.length !== 1) { + throw new Error('Error [too many files]: CosmWasm v1.1 schemas supports one file'); } - return fn(schemas); + + const idlObject = schemas[0]; + const { + contract_name, + contract_version, + idl_version, + responses, + instantiate, + execute, + query, + migrate, + sudo + } = idlObject; + + if (typeof idl_version !== 'string') { + // legacy + return { + schemas: fn(schemas) + }; + } + + // TODO use contract_name, etc. + return { + schemas: Object.values(fn({ + instantiate, + execute, + query, + migrate, + sudo + })).filter(Boolean), + idlObject + }; }; export const findQueryMsg = (schemas) => { From 7a1517afa627f0b32bb296a9e9c25f23b4a9e5a4 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 5 Sep 2022 17:55:14 -0700 Subject: [PATCH 020/287] fixtures --- .../idl-version/cyberpunk/cyberpunk.json | 185 ++++++++ .../idl-version/hackatom/hackatom.json | 403 ++++++++++++++++++ 2 files changed, 588 insertions(+) create mode 100644 __fixtures__/idl-version/cyberpunk/cyberpunk.json create mode 100644 __fixtures__/idl-version/hackatom/hackatom.json diff --git a/__fixtures__/idl-version/cyberpunk/cyberpunk.json b/__fixtures__/idl-version/cyberpunk/cyberpunk.json new file mode 100644 index 00000000..9439d305 --- /dev/null +++ b/__fixtures__/idl-version/cyberpunk/cyberpunk.json @@ -0,0 +1,185 @@ +{ + "contract_name": "cyberpunk", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "description": "Hashes some data. Uses CPU and memory, but no external calls.", + "type": "object", + "required": [ + "argon2" + ], + "properties": { + "argon2": { + "type": "object", + "required": [ + "mem_cost", + "time_cost" + ], + "properties": { + "mem_cost": { + "description": "The amount of memory requested (KB).", + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "time_cost": { + "description": "The number of passes.", + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Returns the env for testing", + "type": "object", + "required": [ + "mirror_env" + ], + "properties": { + "mirror_env": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "query": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "description": "Returns the env for testing", + "type": "object", + "required": [ + "mirror_env" + ], + "properties": { + "mirror_env": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "migrate": null, + "sudo": null, + "responses": { + "mirror_env": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Env", + "type": "object", + "required": [ + "block", + "contract" + ], + "properties": { + "block": { + "$ref": "#/definitions/BlockInfo" + }, + "contract": { + "$ref": "#/definitions/ContractInfo" + }, + "transaction": { + "description": "Information on the transaction this message was executed in. The field is unset when the `MsgExecuteContract`/`MsgInstantiateContract`/`MsgMigrateContract` is not executed as part of a transaction.", + "anyOf": [ + { + "$ref": "#/definitions/TransactionInfo" + }, + { + "type": "null" + } + ] + } + }, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "BlockInfo": { + "type": "object", + "required": [ + "chain_id", + "height", + "time" + ], + "properties": { + "chain_id": { + "type": "string" + }, + "height": { + "description": "The height of a block is the number of blocks preceding it in the blockchain.", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "time": { + "description": "Absolute time of the block creation in seconds since the UNIX epoch (00:00:00 on 1970-01-01 UTC).\n\nThe source of this is the [BFT Time in Tendermint](https://github.com/tendermint/tendermint/blob/58dc1726/spec/consensus/bft-time.md), which has the same nanosecond precision as the `Timestamp` type.\n\n# Examples\n\nUsing chrono:\n\n``` # use cosmwasm_std::{Addr, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo}; # let env = Env { # block: BlockInfo { # height: 12_345, # time: Timestamp::from_nanos(1_571_797_419_879_305_533), # chain_id: \"cosmos-testnet-14002\".to_string(), # }, # transaction: Some(TransactionInfo { index: 3 }), # contract: ContractInfo { # address: Addr::unchecked(\"contract\"), # }, # }; # extern crate chrono; use chrono::NaiveDateTime; let seconds = env.block.time.seconds(); let nsecs = env.block.time.subsec_nanos(); let dt = NaiveDateTime::from_timestamp(seconds as i64, nsecs as u32); ```\n\nCreating a simple millisecond-precision timestamp (as used in JavaScript):\n\n``` # use cosmwasm_std::{Addr, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo}; # let env = Env { # block: BlockInfo { # height: 12_345, # time: Timestamp::from_nanos(1_571_797_419_879_305_533), # chain_id: \"cosmos-testnet-14002\".to_string(), # }, # transaction: Some(TransactionInfo { index: 3 }), # contract: ContractInfo { # address: Addr::unchecked(\"contract\"), # }, # }; let millis = env.block.time.nanos() / 1_000_000; ```", + "allOf": [ + { + "$ref": "#/definitions/Timestamp" + } + ] + } + } + }, + "ContractInfo": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "$ref": "#/definitions/Addr" + } + } + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "TransactionInfo": { + "type": "object", + "required": [ + "index" + ], + "properties": { + "index": { + "description": "The position of this transaction in the block. The first transaction has index 0.\n\nThis allows you to get a unique transaction indentifier in this chain using the pair (`env.block.height`, `env.transaction.index`).", + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } + } + } +} diff --git a/__fixtures__/idl-version/hackatom/hackatom.json b/__fixtures__/idl-version/hackatom/hackatom.json new file mode 100644 index 00000000..3bdc458a --- /dev/null +++ b/__fixtures__/idl-version/hackatom/hackatom.json @@ -0,0 +1,403 @@ +{ + "contract_name": "hackatom", + "contract_version": "0.0.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "beneficiary", + "verifier" + ], + "properties": { + "beneficiary": { + "type": "string" + }, + "verifier": { + "type": "string" + } + }, + "additionalProperties": false + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "description": "Releasing all funds in the contract to the beneficiary. This is the only \"proper\" action of this demo contract.", + "type": "object", + "required": [ + "release" + ], + "properties": { + "release": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Infinite loop to burn cpu cycles (only run when metering is enabled)", + "type": "object", + "required": [ + "cpu_loop" + ], + "properties": { + "cpu_loop": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Infinite loop making storage calls (to test when their limit hits)", + "type": "object", + "required": [ + "storage_loop" + ], + "properties": { + "storage_loop": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Infinite loop reading and writing memory", + "type": "object", + "required": [ + "memory_loop" + ], + "properties": { + "memory_loop": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Infinite loop sending message to itself", + "type": "object", + "required": [ + "message_loop" + ], + "properties": { + "message_loop": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Allocate large amounts of memory without consuming much gas", + "type": "object", + "required": [ + "allocate_large_memory" + ], + "properties": { + "allocate_large_memory": { + "type": "object", + "required": [ + "pages" + ], + "properties": { + "pages": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Trigger a panic to ensure framework handles gracefully", + "type": "object", + "required": [ + "panic" + ], + "properties": { + "panic": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Starting with CosmWasm 0.10, some API calls return user errors back to the contract. This triggers such user errors, ensuring the transaction does not fail in the backend.", + "type": "object", + "required": [ + "user_errors_in_api_calls" + ], + "properties": { + "user_errors_in_api_calls": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "query": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "description": "returns a human-readable representation of the verifier use to ensure query path works in integration tests", + "type": "object", + "required": [ + "verifier" + ], + "properties": { + "verifier": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "This returns cosmwasm_std::AllBalanceResponse to demo use of the querier", + "type": "object", + "required": [ + "other_balance" + ], + "properties": { + "other_balance": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Recurse will execute a query into itself up to depth-times and return Each step of the recursion may perform some extra work to test gas metering (`work` rounds of sha256 on contract). Now that we have Env, we can auto-calculate the address to recurse into", + "type": "object", + "required": [ + "recurse" + ], + "properties": { + "recurse": { + "type": "object", + "required": [ + "depth", + "work" + ], + "properties": { + "depth": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "work": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "GetInt returns a hardcoded u32 value", + "type": "object", + "required": [ + "get_int" + ], + "properties": { + "get_int": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "migrate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MigrateMsg", + "description": "MigrateMsg allows a privileged contract administrator to run a migration on the contract. In this (demo) case it is just migrating from one hackatom code to the same code, but taking advantage of the migration step to set a new validator.\n\nNote that the contract doesn't enforce permissions here, this is done by blockchain logic (in the future by blockchain governance)", + "type": "object", + "required": [ + "verifier" + ], + "properties": { + "verifier": { + "type": "string" + } + }, + "additionalProperties": false + }, + "sudo": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SudoMsg", + "description": "SudoMsg is only exposed for internal Cosmos SDK modules to call. This is showing how we can expose \"admin\" functionality than can not be called by external users or contracts, but only trusted (native/Go) code in the blockchain", + "oneOf": [ + { + "type": "object", + "required": [ + "steal_funds" + ], + "properties": { + "steal_funds": { + "type": "object", + "required": [ + "amount", + "recipient" + ], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "recipient": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + "responses": { + "get_int": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "IntResponse", + "type": "object", + "required": [ + "int" + ], + "properties": { + "int": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + "other_balance": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AllBalanceResponse", + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "description": "Returns all non-zero coins held by this account.", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + }, + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + "recurse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RecurseResponse", + "type": "object", + "required": [ + "hashed" + ], + "properties": { + "hashed": { + "description": "hashed is the result of running sha256 \"work+1\" times on the contract's human address", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec", + "type": "string" + } + } + }, + "verifier": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VerifierResponse", + "type": "object", + "required": [ + "verifier" + ], + "properties": { + "verifier": { + "type": "string" + } + }, + "additionalProperties": false + } + } +} From b6ada53ded213a7ebbf7bf5d72bf9b034b17ae77 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 5 Sep 2022 17:55:22 -0700 Subject: [PATCH 021/287] snaps --- .../daodao/cw-code-id-registry/clean.json | 1534 +++++----- .../daodao/cw-code-id-registry/orig.json | 1534 +++++----- .../idl-version/cyberpunk/CyberPunk.client.ts | 75 + .../cyberpunk/CyberPunk.message-composer.ts | 70 + .../cyberpunk/CyberPunk.react-query.ts | 20 + .../idl-version/cyberpunk/CyberPunk.recoil.ts | 38 + .../idl-version/cyberpunk/CyberPunk.types.ts | 20 + .../idl-version/hackatom/HackAtom.client.ts | 158 + .../hackatom/HackAtom.message-composer.ts | 154 + .../hackatom/HackAtom.react-query.ts | 57 + .../idl-version/hackatom/HackAtom.recoil.ts | 80 + .../idl-version/hackatom/HackAtom.types.ts | 58 + __output__/sg721/clean.json | 2708 +++++++++-------- __output__/sg721/orig.json | 2708 +++++++++-------- 14 files changed, 4976 insertions(+), 4238 deletions(-) create mode 100644 __output__/idl-version/cyberpunk/CyberPunk.client.ts create mode 100644 __output__/idl-version/cyberpunk/CyberPunk.message-composer.ts create mode 100644 __output__/idl-version/cyberpunk/CyberPunk.react-query.ts create mode 100644 __output__/idl-version/cyberpunk/CyberPunk.recoil.ts create mode 100644 __output__/idl-version/cyberpunk/CyberPunk.types.ts create mode 100644 __output__/idl-version/hackatom/HackAtom.client.ts create mode 100644 __output__/idl-version/hackatom/HackAtom.message-composer.ts create mode 100644 __output__/idl-version/hackatom/HackAtom.react-query.ts create mode 100644 __output__/idl-version/hackatom/HackAtom.recoil.ts create mode 100644 __output__/idl-version/hackatom/HackAtom.types.ts diff --git a/__output__/daodao/cw-code-id-registry/clean.json b/__output__/daodao/cw-code-id-registry/clean.json index 867179dc..1a92d761 100644 --- a/__output__/daodao/cw-code-id-registry/clean.json +++ b/__output__/daodao/cw-code-id-registry/clean.json @@ -1,825 +1,827 @@ -[ - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ConfigResponse", - "type": "object", - "required": [ - "admin", - "payment_info" - ], - "properties": { - "admin": { - "description": "Admin receives fees, can register anything, and set owners to allow future registration.", - "allOf": [ - { - "$ref": "#/definitions/Addr" - } - ] - }, - "payment_info": { - "$ref": "#/definitions/PaymentInfo" - } - }, - "additionalProperties": false, - "definitions": { - "Addr": { - "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", - "type": "string" +{ + "schemas": [ + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigResponse", + "type": "object", + "required": [ + "admin", + "payment_info" + ], + "properties": { + "admin": { + "description": "Admin receives fees, can register anything, and set owners to allow future registration.", + "allOf": [ + { + "$ref": "#/definitions/Addr" + } + ] + }, + "payment_info": { + "$ref": "#/definitions/PaymentInfo" + } }, - "PaymentInfo": { - "oneOf": [ - { - "type": "object", - "required": [ - "none" - ], - "properties": { - "none": { - "type": "object", - "additionalProperties": false - } + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "PaymentInfo": { + "oneOf": [ + { + "type": "object", + "required": [ + "none" + ], + "properties": { + "none": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "native_payment" - ], - "properties": { - "native_payment": { - "type": "object", - "required": [ - "payment_amount", - "token_denom" - ], - "properties": { - "payment_amount": { - "$ref": "#/definitions/Uint128" + { + "type": "object", + "required": [ + "native_payment" + ], + "properties": { + "native_payment": { + "type": "object", + "required": [ + "payment_amount", + "token_denom" + ], + "properties": { + "payment_amount": { + "$ref": "#/definitions/Uint128" + }, + "token_denom": { + "type": "string" + } }, - "token_denom": { - "type": "string" - } - }, - "additionalProperties": false - } + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "cw20_payment" - ], - "properties": { - "cw20_payment": { - "type": "object", - "required": [ - "payment_amount", - "token_address" - ], - "properties": { - "payment_amount": { - "$ref": "#/definitions/Uint128" + { + "type": "object", + "required": [ + "cw20_payment" + ], + "properties": { + "cw20_payment": { + "type": "object", + "required": [ + "payment_amount", + "token_address" + ], + "properties": { + "payment_amount": { + "$ref": "#/definitions/Uint128" + }, + "token_address": { + "type": "string" + } }, - "token_address": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ExecuteMsg", - "oneOf": [ - { - "description": "Receive payment to register when payment info is a CW20.", - "type": "object", - "required": [ - "receive" - ], - "properties": { - "receive": { - "$ref": "#/definitions/Cw20ReceiveMsg" - } + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "description": "Receive payment to register when payment info is a CW20.", + "type": "object", + "required": [ + "receive" + ], + "properties": { + "receive": { + "$ref": "#/definitions/Cw20ReceiveMsg" + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Receive payment to register when payment info is native.", - "type": "object", - "required": [ - "register" - ], - "properties": { - "register": { - "type": "object", - "required": [ - "chain_id", - "checksum", - "code_id", - "name", - "version" - ], - "properties": { - "chain_id": { - "type": "string" - }, - "checksum": { - "type": "string" - }, - "code_id": { - "type": "integer", - "format": "uint64", - "minimum": 0 - }, - "name": { - "type": "string" + { + "description": "Receive payment to register when payment info is native.", + "type": "object", + "required": [ + "register" + ], + "properties": { + "register": { + "type": "object", + "required": [ + "chain_id", + "checksum", + "code_id", + "name", + "version" + ], + "properties": { + "chain_id": { + "type": "string" + }, + "checksum": { + "type": "string" + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "name": { + "type": "string" + }, + "version": { + "type": "string" + } }, - "version": { - "type": "string" - } - }, - "additionalProperties": false - } + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Set owner for registration.", - "type": "object", - "required": [ - "set_owner" - ], - "properties": { - "set_owner": { - "type": "object", - "required": [ - "chain_id", - "name" - ], - "properties": { - "chain_id": { - "type": "string" + { + "description": "Set owner for registration.", + "type": "object", + "required": [ + "set_owner" + ], + "properties": { + "set_owner": { + "type": "object", + "required": [ + "chain_id", + "name" + ], + "properties": { + "chain_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "owner": { + "type": [ + "string", + "null" + ] + } }, - "name": { - "type": "string" + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Allow admin to unregister code IDs.", + "type": "object", + "required": [ + "unregister" + ], + "properties": { + "unregister": { + "type": "object", + "required": [ + "chain_id", + "code_id" + ], + "properties": { + "chain_id": { + "type": "string" + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } }, - "owner": { - "type": [ - "string", - "null" - ] - } - }, - "additionalProperties": false - } + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Allow admin to unregister code IDs.", - "type": "object", - "required": [ - "unregister" - ], - "properties": { - "unregister": { - "type": "object", - "required": [ - "chain_id", - "code_id" - ], - "properties": { - "chain_id": { - "type": "string" + { + "description": "Update config.", + "type": "object", + "required": [ + "update_config" + ], + "properties": { + "update_config": { + "type": "object", + "properties": { + "admin": { + "type": [ + "string", + "null" + ] + }, + "payment_info": { + "anyOf": [ + { + "$ref": "#/definitions/PaymentInfo" + }, + { + "type": "null" + } + ] + } }, - "code_id": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec", + "type": "string" + }, + "Cw20ReceiveMsg": { + "description": "Cw20ReceiveMsg should be de/serialized under `Receive()` variant in a ExecuteMsg", + "type": "object", + "required": [ + "amount", + "msg", + "sender" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "msg": { + "$ref": "#/definitions/Binary" }, - "additionalProperties": false + "sender": { + "type": "string" + } } }, - "additionalProperties": false - }, - { - "description": "Update config.", - "type": "object", - "required": [ - "update_config" - ], - "properties": { - "update_config": { - "type": "object", - "properties": { - "admin": { - "type": [ - "string", - "null" - ] + "PaymentInfo": { + "oneOf": [ + { + "type": "object", + "required": [ + "none" + ], + "properties": { + "none": { + "type": "object", + "additionalProperties": false + } }, - "payment_info": { - "anyOf": [ - { - "$ref": "#/definitions/PaymentInfo" + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "native_payment" + ], + "properties": { + "native_payment": { + "type": "object", + "required": [ + "payment_amount", + "token_denom" + ], + "properties": { + "payment_amount": { + "$ref": "#/definitions/Uint128" + }, + "token_denom": { + "type": "string" + } }, - { - "type": "null" - } - ] - } + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - } + { + "type": "object", + "required": [ + "cw20_payment" + ], + "properties": { + "cw20_payment": { + "type": "object", + "required": [ + "payment_amount", + "token_address" + ], + "properties": { + "payment_amount": { + "$ref": "#/definitions/Uint128" + }, + "token_address": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] }, - "additionalProperties": false + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } } - ], - "definitions": { - "Binary": { - "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec", - "type": "string" - }, - "Cw20ReceiveMsg": { - "description": "Cw20ReceiveMsg should be de/serialized under `Receive()` variant in a ExecuteMsg", - "type": "object", - "required": [ - "amount", - "msg", - "sender" - ], - "properties": { - "amount": { - "$ref": "#/definitions/Uint128" - }, - "msg": { - "$ref": "#/definitions/Binary" - }, - "sender": { - "type": "string" - } + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "GetRegistrationResponse", + "type": "object", + "required": [ + "registration" + ], + "properties": { + "registration": { + "$ref": "#/definitions/Registration" } }, - "PaymentInfo": { - "oneOf": [ - { - "type": "object", - "required": [ - "none" - ], - "properties": { - "none": { - "type": "object", - "additionalProperties": false - } + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "Registration": { + "type": "object", + "required": [ + "checksum", + "code_id", + "registered_by", + "version" + ], + "properties": { + "checksum": { + "type": "string" }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "native_payment" - ], - "properties": { - "native_payment": { - "type": "object", - "required": [ - "payment_amount", - "token_denom" - ], - "properties": { - "payment_amount": { - "$ref": "#/definitions/Uint128" - }, - "token_denom": { - "type": "string" - } - }, - "additionalProperties": false - } + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0 }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "cw20_payment" - ], - "properties": { - "cw20_payment": { - "type": "object", - "required": [ - "payment_amount", - "token_address" - ], - "properties": { - "payment_amount": { - "$ref": "#/definitions/Uint128" - }, - "token_address": { - "type": "string" - } - }, - "additionalProperties": false - } + "registered_by": { + "$ref": "#/definitions/Addr" }, - "additionalProperties": false - } - ] - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "GetRegistrationResponse", - "type": "object", - "required": [ - "registration" - ], - "properties": { - "registration": { - "$ref": "#/definitions/Registration" + "version": { + "type": "string" + } + }, + "additionalProperties": false + } } }, - "additionalProperties": false, - "definitions": { - "Addr": { - "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", - "type": "string" - }, - "Registration": { - "type": "object", - "required": [ - "checksum", - "code_id", - "registered_by", - "version" - ], - "properties": { - "checksum": { - "type": "string" - }, - "code_id": { - "type": "integer", - "format": "uint64", - "minimum": 0 - }, - "registered_by": { - "$ref": "#/definitions/Addr" - }, - "version": { - "type": "string" - } + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InfoForCodeIdResponse", + "type": "object", + "required": [ + "checksum", + "name", + "registered_by", + "version" + ], + "properties": { + "checksum": { + "type": "string" }, - "additionalProperties": false - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "InfoForCodeIdResponse", - "type": "object", - "required": [ - "checksum", - "name", - "registered_by", - "version" - ], - "properties": { - "checksum": { - "type": "string" - }, - "name": { - "type": "string" - }, - "registered_by": { - "$ref": "#/definitions/Addr" + "name": { + "type": "string" + }, + "registered_by": { + "$ref": "#/definitions/Addr" + }, + "version": { + "type": "string" + } }, - "version": { - "type": "string" + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + } } }, - "additionalProperties": false, - "definitions": { - "Addr": { - "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", - "type": "string" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "InstantiateMsg", - "type": "object", - "required": [ - "admin", - "payment_info" - ], - "properties": { - "admin": { - "type": "string" + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "admin", + "payment_info" + ], + "properties": { + "admin": { + "type": "string" + }, + "payment_info": { + "$ref": "#/definitions/PaymentInfo" + } }, - "payment_info": { - "$ref": "#/definitions/PaymentInfo" - } - }, - "additionalProperties": false, - "definitions": { - "PaymentInfo": { - "oneOf": [ - { - "type": "object", - "required": [ - "none" - ], - "properties": { - "none": { - "type": "object", - "additionalProperties": false - } + "additionalProperties": false, + "definitions": { + "PaymentInfo": { + "oneOf": [ + { + "type": "object", + "required": [ + "none" + ], + "properties": { + "none": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "native_payment" - ], - "properties": { - "native_payment": { - "type": "object", - "required": [ - "payment_amount", - "token_denom" - ], - "properties": { - "payment_amount": { - "$ref": "#/definitions/Uint128" + { + "type": "object", + "required": [ + "native_payment" + ], + "properties": { + "native_payment": { + "type": "object", + "required": [ + "payment_amount", + "token_denom" + ], + "properties": { + "payment_amount": { + "$ref": "#/definitions/Uint128" + }, + "token_denom": { + "type": "string" + } }, - "token_denom": { - "type": "string" - } - }, - "additionalProperties": false - } + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "cw20_payment" - ], - "properties": { - "cw20_payment": { - "type": "object", - "required": [ - "payment_amount", - "token_address" - ], - "properties": { - "payment_amount": { - "$ref": "#/definitions/Uint128" + { + "type": "object", + "required": [ + "cw20_payment" + ], + "properties": { + "cw20_payment": { + "type": "object", + "required": [ + "payment_amount", + "token_address" + ], + "properties": { + "payment_amount": { + "$ref": "#/definitions/Uint128" + }, + "token_address": { + "type": "string" + } }, - "token_address": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ListRegistrationsResponse", - "type": "object", - "required": [ - "registrations" - ], - "properties": { - "registrations": { - "type": "array", - "items": { - "$ref": "#/definitions/Registration" + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" } } }, - "additionalProperties": false, - "definitions": { - "Addr": { - "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", - "type": "string" - }, - "Registration": { - "type": "object", - "required": [ - "checksum", - "code_id", - "registered_by", - "version" - ], - "properties": { - "checksum": { - "type": "string" - }, - "code_id": { - "type": "integer", - "format": "uint64", - "minimum": 0 - }, - "registered_by": { - "$ref": "#/definitions/Addr" - }, - "version": { - "type": "string" - } - }, - "additionalProperties": false - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "PaymentInfo", - "oneOf": [ - { - "type": "object", - "required": [ - "none" - ], - "properties": { - "none": { - "type": "object", - "additionalProperties": false + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ListRegistrationsResponse", + "type": "object", + "required": [ + "registrations" + ], + "properties": { + "registrations": { + "type": "array", + "items": { + "$ref": "#/definitions/Registration" } - }, - "additionalProperties": false + } }, - { - "type": "object", - "required": [ - "native_payment" - ], - "properties": { - "native_payment": { - "type": "object", - "required": [ - "payment_amount", - "token_denom" - ], - "properties": { - "payment_amount": { - "$ref": "#/definitions/Uint128" - }, - "token_denom": { - "type": "string" - } - }, - "additionalProperties": false - } + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "cw20_payment" - ], - "properties": { - "cw20_payment": { - "type": "object", - "required": [ - "payment_amount", - "token_address" - ], - "properties": { - "payment_amount": { - "$ref": "#/definitions/Uint128" - }, - "token_address": { - "type": "string" - } + "Registration": { + "type": "object", + "required": [ + "checksum", + "code_id", + "registered_by", + "version" + ], + "properties": { + "checksum": { + "type": "string" }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ], - "definitions": { - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "registered_by": { + "$ref": "#/definitions/Addr" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false + } } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "QueryMsg", - "oneOf": [ - { - "type": "object", - "required": [ - "config" - ], - "properties": { - "config": { - "type": "object", - "additionalProperties": false - } + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PaymentInfo", + "oneOf": [ + { + "type": "object", + "required": [ + "none" + ], + "properties": { + "none": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "If version provided, tries to find given version. Otherwise returns the latest version registered.", - "type": "object", - "required": [ - "get_registration" - ], - "properties": { - "get_registration": { - "type": "object", - "required": [ - "chain_id", - "name" - ], - "properties": { - "chain_id": { - "type": "string" - }, - "name": { - "type": "string" + { + "type": "object", + "required": [ + "native_payment" + ], + "properties": { + "native_payment": { + "type": "object", + "required": [ + "payment_amount", + "token_denom" + ], + "properties": { + "payment_amount": { + "$ref": "#/definitions/Uint128" + }, + "token_denom": { + "type": "string" + } }, - "version": { - "type": [ - "string", - "null" - ] - } - }, - "additionalProperties": false - } + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "info_for_code_id" - ], - "properties": { - "info_for_code_id": { - "type": "object", - "required": [ - "chain_id", - "code_id" - ], - "properties": { - "chain_id": { - "type": "string" + { + "type": "object", + "required": [ + "cw20_payment" + ], + "properties": { + "cw20_payment": { + "type": "object", + "required": [ + "payment_amount", + "token_address" + ], + "properties": { + "payment_amount": { + "$ref": "#/definitions/Uint128" + }, + "token_address": { + "type": "string" + } }, - "code_id": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } - }, - "additionalProperties": false - } + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "config" + ], + "properties": { + "config": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "list_registrations" - ], - "properties": { - "list_registrations": { - "type": "object", - "required": [ - "chain_id", - "name" - ], - "properties": { - "chain_id": { - "type": "string" + { + "description": "If version provided, tries to find given version. Otherwise returns the latest version registered.", + "type": "object", + "required": [ + "get_registration" + ], + "properties": { + "get_registration": { + "type": "object", + "required": [ + "chain_id", + "name" + ], + "properties": { + "chain_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "version": { + "type": [ + "string", + "null" + ] + } }, - "name": { - "type": "string" - } - }, - "additionalProperties": false - } + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - } - ] - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ReceiveMsg", - "oneOf": [ - { - "type": "object", - "required": [ - "register" - ], - "properties": { - "register": { - "type": "object", - "required": [ - "chain_id", - "checksum", - "code_id", - "name", - "version" - ], - "properties": { - "chain_id": { - "type": "string" - }, - "checksum": { - "type": "string" + { + "type": "object", + "required": [ + "info_for_code_id" + ], + "properties": { + "info_for_code_id": { + "type": "object", + "required": [ + "chain_id", + "code_id" + ], + "properties": { + "chain_id": { + "type": "string" + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } }, - "code_id": { - "type": "integer", - "format": "uint64", - "minimum": 0 + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "list_registrations" + ], + "properties": { + "list_registrations": { + "type": "object", + "required": [ + "chain_id", + "name" + ], + "properties": { + "chain_id": { + "type": "string" + }, + "name": { + "type": "string" + } }, - "name": { - "type": "string" + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ReceiveMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "register" + ], + "properties": { + "register": { + "type": "object", + "required": [ + "chain_id", + "checksum", + "code_id", + "name", + "version" + ], + "properties": { + "chain_id": { + "type": "string" + }, + "checksum": { + "type": "string" + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "name": { + "type": "string" + }, + "version": { + "type": "string" + } }, - "version": { - "type": "string" - } - }, - "additionalProperties": false - } + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Registration", + "type": "object", + "required": [ + "checksum", + "code_id", + "registered_by", + "version" + ], + "properties": { + "checksum": { + "type": "string" }, - "additionalProperties": false - } - ] - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Registration", - "type": "object", - "required": [ - "checksum", - "code_id", - "registered_by", - "version" - ], - "properties": { - "checksum": { - "type": "string" - }, - "code_id": { - "type": "integer", - "format": "uint64", - "minimum": 0 - }, - "registered_by": { - "$ref": "#/definitions/Addr" + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "registered_by": { + "$ref": "#/definitions/Addr" + }, + "version": { + "type": "string" + } }, - "version": { - "type": "string" - } - }, - "additionalProperties": false, - "definitions": { - "Addr": { - "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", - "type": "string" + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + } } } - } -] \ No newline at end of file + ] +} \ No newline at end of file diff --git a/__output__/daodao/cw-code-id-registry/orig.json b/__output__/daodao/cw-code-id-registry/orig.json index 867179dc..1a92d761 100644 --- a/__output__/daodao/cw-code-id-registry/orig.json +++ b/__output__/daodao/cw-code-id-registry/orig.json @@ -1,825 +1,827 @@ -[ - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ConfigResponse", - "type": "object", - "required": [ - "admin", - "payment_info" - ], - "properties": { - "admin": { - "description": "Admin receives fees, can register anything, and set owners to allow future registration.", - "allOf": [ - { - "$ref": "#/definitions/Addr" - } - ] - }, - "payment_info": { - "$ref": "#/definitions/PaymentInfo" - } - }, - "additionalProperties": false, - "definitions": { - "Addr": { - "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", - "type": "string" +{ + "schemas": [ + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigResponse", + "type": "object", + "required": [ + "admin", + "payment_info" + ], + "properties": { + "admin": { + "description": "Admin receives fees, can register anything, and set owners to allow future registration.", + "allOf": [ + { + "$ref": "#/definitions/Addr" + } + ] + }, + "payment_info": { + "$ref": "#/definitions/PaymentInfo" + } }, - "PaymentInfo": { - "oneOf": [ - { - "type": "object", - "required": [ - "none" - ], - "properties": { - "none": { - "type": "object", - "additionalProperties": false - } + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "PaymentInfo": { + "oneOf": [ + { + "type": "object", + "required": [ + "none" + ], + "properties": { + "none": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "native_payment" - ], - "properties": { - "native_payment": { - "type": "object", - "required": [ - "payment_amount", - "token_denom" - ], - "properties": { - "payment_amount": { - "$ref": "#/definitions/Uint128" + { + "type": "object", + "required": [ + "native_payment" + ], + "properties": { + "native_payment": { + "type": "object", + "required": [ + "payment_amount", + "token_denom" + ], + "properties": { + "payment_amount": { + "$ref": "#/definitions/Uint128" + }, + "token_denom": { + "type": "string" + } }, - "token_denom": { - "type": "string" - } - }, - "additionalProperties": false - } + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "cw20_payment" - ], - "properties": { - "cw20_payment": { - "type": "object", - "required": [ - "payment_amount", - "token_address" - ], - "properties": { - "payment_amount": { - "$ref": "#/definitions/Uint128" + { + "type": "object", + "required": [ + "cw20_payment" + ], + "properties": { + "cw20_payment": { + "type": "object", + "required": [ + "payment_amount", + "token_address" + ], + "properties": { + "payment_amount": { + "$ref": "#/definitions/Uint128" + }, + "token_address": { + "type": "string" + } }, - "token_address": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ExecuteMsg", - "oneOf": [ - { - "description": "Receive payment to register when payment info is a CW20.", - "type": "object", - "required": [ - "receive" - ], - "properties": { - "receive": { - "$ref": "#/definitions/Cw20ReceiveMsg" - } + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "description": "Receive payment to register when payment info is a CW20.", + "type": "object", + "required": [ + "receive" + ], + "properties": { + "receive": { + "$ref": "#/definitions/Cw20ReceiveMsg" + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Receive payment to register when payment info is native.", - "type": "object", - "required": [ - "register" - ], - "properties": { - "register": { - "type": "object", - "required": [ - "chain_id", - "checksum", - "code_id", - "name", - "version" - ], - "properties": { - "chain_id": { - "type": "string" - }, - "checksum": { - "type": "string" - }, - "code_id": { - "type": "integer", - "format": "uint64", - "minimum": 0 - }, - "name": { - "type": "string" + { + "description": "Receive payment to register when payment info is native.", + "type": "object", + "required": [ + "register" + ], + "properties": { + "register": { + "type": "object", + "required": [ + "chain_id", + "checksum", + "code_id", + "name", + "version" + ], + "properties": { + "chain_id": { + "type": "string" + }, + "checksum": { + "type": "string" + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "name": { + "type": "string" + }, + "version": { + "type": "string" + } }, - "version": { - "type": "string" - } - }, - "additionalProperties": false - } + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Set owner for registration.", - "type": "object", - "required": [ - "set_owner" - ], - "properties": { - "set_owner": { - "type": "object", - "required": [ - "chain_id", - "name" - ], - "properties": { - "chain_id": { - "type": "string" + { + "description": "Set owner for registration.", + "type": "object", + "required": [ + "set_owner" + ], + "properties": { + "set_owner": { + "type": "object", + "required": [ + "chain_id", + "name" + ], + "properties": { + "chain_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "owner": { + "type": [ + "string", + "null" + ] + } }, - "name": { - "type": "string" + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Allow admin to unregister code IDs.", + "type": "object", + "required": [ + "unregister" + ], + "properties": { + "unregister": { + "type": "object", + "required": [ + "chain_id", + "code_id" + ], + "properties": { + "chain_id": { + "type": "string" + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } }, - "owner": { - "type": [ - "string", - "null" - ] - } - }, - "additionalProperties": false - } + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Allow admin to unregister code IDs.", - "type": "object", - "required": [ - "unregister" - ], - "properties": { - "unregister": { - "type": "object", - "required": [ - "chain_id", - "code_id" - ], - "properties": { - "chain_id": { - "type": "string" + { + "description": "Update config.", + "type": "object", + "required": [ + "update_config" + ], + "properties": { + "update_config": { + "type": "object", + "properties": { + "admin": { + "type": [ + "string", + "null" + ] + }, + "payment_info": { + "anyOf": [ + { + "$ref": "#/definitions/PaymentInfo" + }, + { + "type": "null" + } + ] + } }, - "code_id": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec", + "type": "string" + }, + "Cw20ReceiveMsg": { + "description": "Cw20ReceiveMsg should be de/serialized under `Receive()` variant in a ExecuteMsg", + "type": "object", + "required": [ + "amount", + "msg", + "sender" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "msg": { + "$ref": "#/definitions/Binary" }, - "additionalProperties": false + "sender": { + "type": "string" + } } }, - "additionalProperties": false - }, - { - "description": "Update config.", - "type": "object", - "required": [ - "update_config" - ], - "properties": { - "update_config": { - "type": "object", - "properties": { - "admin": { - "type": [ - "string", - "null" - ] + "PaymentInfo": { + "oneOf": [ + { + "type": "object", + "required": [ + "none" + ], + "properties": { + "none": { + "type": "object", + "additionalProperties": false + } }, - "payment_info": { - "anyOf": [ - { - "$ref": "#/definitions/PaymentInfo" + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "native_payment" + ], + "properties": { + "native_payment": { + "type": "object", + "required": [ + "payment_amount", + "token_denom" + ], + "properties": { + "payment_amount": { + "$ref": "#/definitions/Uint128" + }, + "token_denom": { + "type": "string" + } }, - { - "type": "null" - } - ] - } + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - } + { + "type": "object", + "required": [ + "cw20_payment" + ], + "properties": { + "cw20_payment": { + "type": "object", + "required": [ + "payment_amount", + "token_address" + ], + "properties": { + "payment_amount": { + "$ref": "#/definitions/Uint128" + }, + "token_address": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] }, - "additionalProperties": false + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } } - ], - "definitions": { - "Binary": { - "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec", - "type": "string" - }, - "Cw20ReceiveMsg": { - "description": "Cw20ReceiveMsg should be de/serialized under `Receive()` variant in a ExecuteMsg", - "type": "object", - "required": [ - "amount", - "msg", - "sender" - ], - "properties": { - "amount": { - "$ref": "#/definitions/Uint128" - }, - "msg": { - "$ref": "#/definitions/Binary" - }, - "sender": { - "type": "string" - } + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "GetRegistrationResponse", + "type": "object", + "required": [ + "registration" + ], + "properties": { + "registration": { + "$ref": "#/definitions/Registration" } }, - "PaymentInfo": { - "oneOf": [ - { - "type": "object", - "required": [ - "none" - ], - "properties": { - "none": { - "type": "object", - "additionalProperties": false - } + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "Registration": { + "type": "object", + "required": [ + "checksum", + "code_id", + "registered_by", + "version" + ], + "properties": { + "checksum": { + "type": "string" }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "native_payment" - ], - "properties": { - "native_payment": { - "type": "object", - "required": [ - "payment_amount", - "token_denom" - ], - "properties": { - "payment_amount": { - "$ref": "#/definitions/Uint128" - }, - "token_denom": { - "type": "string" - } - }, - "additionalProperties": false - } + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0 }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "cw20_payment" - ], - "properties": { - "cw20_payment": { - "type": "object", - "required": [ - "payment_amount", - "token_address" - ], - "properties": { - "payment_amount": { - "$ref": "#/definitions/Uint128" - }, - "token_address": { - "type": "string" - } - }, - "additionalProperties": false - } + "registered_by": { + "$ref": "#/definitions/Addr" }, - "additionalProperties": false - } - ] - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "GetRegistrationResponse", - "type": "object", - "required": [ - "registration" - ], - "properties": { - "registration": { - "$ref": "#/definitions/Registration" + "version": { + "type": "string" + } + }, + "additionalProperties": false + } } }, - "additionalProperties": false, - "definitions": { - "Addr": { - "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", - "type": "string" - }, - "Registration": { - "type": "object", - "required": [ - "checksum", - "code_id", - "registered_by", - "version" - ], - "properties": { - "checksum": { - "type": "string" - }, - "code_id": { - "type": "integer", - "format": "uint64", - "minimum": 0 - }, - "registered_by": { - "$ref": "#/definitions/Addr" - }, - "version": { - "type": "string" - } + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InfoForCodeIdResponse", + "type": "object", + "required": [ + "checksum", + "name", + "registered_by", + "version" + ], + "properties": { + "checksum": { + "type": "string" }, - "additionalProperties": false - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "InfoForCodeIdResponse", - "type": "object", - "required": [ - "checksum", - "name", - "registered_by", - "version" - ], - "properties": { - "checksum": { - "type": "string" - }, - "name": { - "type": "string" - }, - "registered_by": { - "$ref": "#/definitions/Addr" + "name": { + "type": "string" + }, + "registered_by": { + "$ref": "#/definitions/Addr" + }, + "version": { + "type": "string" + } }, - "version": { - "type": "string" + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + } } }, - "additionalProperties": false, - "definitions": { - "Addr": { - "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", - "type": "string" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "InstantiateMsg", - "type": "object", - "required": [ - "admin", - "payment_info" - ], - "properties": { - "admin": { - "type": "string" + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "admin", + "payment_info" + ], + "properties": { + "admin": { + "type": "string" + }, + "payment_info": { + "$ref": "#/definitions/PaymentInfo" + } }, - "payment_info": { - "$ref": "#/definitions/PaymentInfo" - } - }, - "additionalProperties": false, - "definitions": { - "PaymentInfo": { - "oneOf": [ - { - "type": "object", - "required": [ - "none" - ], - "properties": { - "none": { - "type": "object", - "additionalProperties": false - } + "additionalProperties": false, + "definitions": { + "PaymentInfo": { + "oneOf": [ + { + "type": "object", + "required": [ + "none" + ], + "properties": { + "none": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "native_payment" - ], - "properties": { - "native_payment": { - "type": "object", - "required": [ - "payment_amount", - "token_denom" - ], - "properties": { - "payment_amount": { - "$ref": "#/definitions/Uint128" + { + "type": "object", + "required": [ + "native_payment" + ], + "properties": { + "native_payment": { + "type": "object", + "required": [ + "payment_amount", + "token_denom" + ], + "properties": { + "payment_amount": { + "$ref": "#/definitions/Uint128" + }, + "token_denom": { + "type": "string" + } }, - "token_denom": { - "type": "string" - } - }, - "additionalProperties": false - } + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "cw20_payment" - ], - "properties": { - "cw20_payment": { - "type": "object", - "required": [ - "payment_amount", - "token_address" - ], - "properties": { - "payment_amount": { - "$ref": "#/definitions/Uint128" + { + "type": "object", + "required": [ + "cw20_payment" + ], + "properties": { + "cw20_payment": { + "type": "object", + "required": [ + "payment_amount", + "token_address" + ], + "properties": { + "payment_amount": { + "$ref": "#/definitions/Uint128" + }, + "token_address": { + "type": "string" + } }, - "token_address": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ListRegistrationsResponse", - "type": "object", - "required": [ - "registrations" - ], - "properties": { - "registrations": { - "type": "array", - "items": { - "$ref": "#/definitions/Registration" + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" } } }, - "additionalProperties": false, - "definitions": { - "Addr": { - "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", - "type": "string" - }, - "Registration": { - "type": "object", - "required": [ - "checksum", - "code_id", - "registered_by", - "version" - ], - "properties": { - "checksum": { - "type": "string" - }, - "code_id": { - "type": "integer", - "format": "uint64", - "minimum": 0 - }, - "registered_by": { - "$ref": "#/definitions/Addr" - }, - "version": { - "type": "string" - } - }, - "additionalProperties": false - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "PaymentInfo", - "oneOf": [ - { - "type": "object", - "required": [ - "none" - ], - "properties": { - "none": { - "type": "object", - "additionalProperties": false + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ListRegistrationsResponse", + "type": "object", + "required": [ + "registrations" + ], + "properties": { + "registrations": { + "type": "array", + "items": { + "$ref": "#/definitions/Registration" } - }, - "additionalProperties": false + } }, - { - "type": "object", - "required": [ - "native_payment" - ], - "properties": { - "native_payment": { - "type": "object", - "required": [ - "payment_amount", - "token_denom" - ], - "properties": { - "payment_amount": { - "$ref": "#/definitions/Uint128" - }, - "token_denom": { - "type": "string" - } - }, - "additionalProperties": false - } + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "cw20_payment" - ], - "properties": { - "cw20_payment": { - "type": "object", - "required": [ - "payment_amount", - "token_address" - ], - "properties": { - "payment_amount": { - "$ref": "#/definitions/Uint128" - }, - "token_address": { - "type": "string" - } + "Registration": { + "type": "object", + "required": [ + "checksum", + "code_id", + "registered_by", + "version" + ], + "properties": { + "checksum": { + "type": "string" }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ], - "definitions": { - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "registered_by": { + "$ref": "#/definitions/Addr" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false + } } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "QueryMsg", - "oneOf": [ - { - "type": "object", - "required": [ - "config" - ], - "properties": { - "config": { - "type": "object", - "additionalProperties": false - } + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PaymentInfo", + "oneOf": [ + { + "type": "object", + "required": [ + "none" + ], + "properties": { + "none": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "If version provided, tries to find given version. Otherwise returns the latest version registered.", - "type": "object", - "required": [ - "get_registration" - ], - "properties": { - "get_registration": { - "type": "object", - "required": [ - "chain_id", - "name" - ], - "properties": { - "chain_id": { - "type": "string" - }, - "name": { - "type": "string" + { + "type": "object", + "required": [ + "native_payment" + ], + "properties": { + "native_payment": { + "type": "object", + "required": [ + "payment_amount", + "token_denom" + ], + "properties": { + "payment_amount": { + "$ref": "#/definitions/Uint128" + }, + "token_denom": { + "type": "string" + } }, - "version": { - "type": [ - "string", - "null" - ] - } - }, - "additionalProperties": false - } + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "info_for_code_id" - ], - "properties": { - "info_for_code_id": { - "type": "object", - "required": [ - "chain_id", - "code_id" - ], - "properties": { - "chain_id": { - "type": "string" + { + "type": "object", + "required": [ + "cw20_payment" + ], + "properties": { + "cw20_payment": { + "type": "object", + "required": [ + "payment_amount", + "token_address" + ], + "properties": { + "payment_amount": { + "$ref": "#/definitions/Uint128" + }, + "token_address": { + "type": "string" + } }, - "code_id": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } - }, - "additionalProperties": false - } + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "config" + ], + "properties": { + "config": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "list_registrations" - ], - "properties": { - "list_registrations": { - "type": "object", - "required": [ - "chain_id", - "name" - ], - "properties": { - "chain_id": { - "type": "string" + { + "description": "If version provided, tries to find given version. Otherwise returns the latest version registered.", + "type": "object", + "required": [ + "get_registration" + ], + "properties": { + "get_registration": { + "type": "object", + "required": [ + "chain_id", + "name" + ], + "properties": { + "chain_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "version": { + "type": [ + "string", + "null" + ] + } }, - "name": { - "type": "string" - } - }, - "additionalProperties": false - } + "additionalProperties": false + } + }, + "additionalProperties": false }, - "additionalProperties": false - } - ] - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ReceiveMsg", - "oneOf": [ - { - "type": "object", - "required": [ - "register" - ], - "properties": { - "register": { - "type": "object", - "required": [ - "chain_id", - "checksum", - "code_id", - "name", - "version" - ], - "properties": { - "chain_id": { - "type": "string" - }, - "checksum": { - "type": "string" + { + "type": "object", + "required": [ + "info_for_code_id" + ], + "properties": { + "info_for_code_id": { + "type": "object", + "required": [ + "chain_id", + "code_id" + ], + "properties": { + "chain_id": { + "type": "string" + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } }, - "code_id": { - "type": "integer", - "format": "uint64", - "minimum": 0 + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "list_registrations" + ], + "properties": { + "list_registrations": { + "type": "object", + "required": [ + "chain_id", + "name" + ], + "properties": { + "chain_id": { + "type": "string" + }, + "name": { + "type": "string" + } }, - "name": { - "type": "string" + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ReceiveMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "register" + ], + "properties": { + "register": { + "type": "object", + "required": [ + "chain_id", + "checksum", + "code_id", + "name", + "version" + ], + "properties": { + "chain_id": { + "type": "string" + }, + "checksum": { + "type": "string" + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "name": { + "type": "string" + }, + "version": { + "type": "string" + } }, - "version": { - "type": "string" - } - }, - "additionalProperties": false - } + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Registration", + "type": "object", + "required": [ + "checksum", + "code_id", + "registered_by", + "version" + ], + "properties": { + "checksum": { + "type": "string" }, - "additionalProperties": false - } - ] - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Registration", - "type": "object", - "required": [ - "checksum", - "code_id", - "registered_by", - "version" - ], - "properties": { - "checksum": { - "type": "string" - }, - "code_id": { - "type": "integer", - "format": "uint64", - "minimum": 0 - }, - "registered_by": { - "$ref": "#/definitions/Addr" + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "registered_by": { + "$ref": "#/definitions/Addr" + }, + "version": { + "type": "string" + } }, - "version": { - "type": "string" - } - }, - "additionalProperties": false, - "definitions": { - "Addr": { - "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", - "type": "string" + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + } } } - } -] \ No newline at end of file + ] +} \ No newline at end of file diff --git a/__output__/idl-version/cyberpunk/CyberPunk.client.ts b/__output__/idl-version/cyberpunk/CyberPunk.client.ts new file mode 100644 index 00000000..5dbf4ca0 --- /dev/null +++ b/__output__/idl-version/cyberpunk/CyberPunk.client.ts @@ -0,0 +1,75 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { Coin, StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, QueryMsg } from "./CyberPunk.types"; +export interface CyberPunkReadOnlyInterface { + contractAddress: string; + mirrorEnv: () => Promise; +} +export class CyberPunkQueryClient implements CyberPunkReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.mirrorEnv = this.mirrorEnv.bind(this); + } + + mirrorEnv = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + mirror_env: {} + }); + }; +} +export interface CyberPunkInterface extends CyberPunkReadOnlyInterface { + contractAddress: string; + sender: string; + argon2: ({ + memCost, + timeCost + }: { + memCost: number; + timeCost: number; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + mirrorEnv: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; +} +export class CyberPunkClient extends CyberPunkQueryClient implements CyberPunkInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + super(client, contractAddress); + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.argon2 = this.argon2.bind(this); + this.mirrorEnv = this.mirrorEnv.bind(this); + } + + argon2 = async ({ + memCost, + timeCost + }: { + memCost: number; + timeCost: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + argon2: { + mem_cost: memCost, + time_cost: timeCost + } + }, fee, memo, funds); + }; + mirrorEnv = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mirror_env: {} + }, fee, memo, funds); + }; +} \ No newline at end of file diff --git a/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts b/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts new file mode 100644 index 00000000..fef92e22 --- /dev/null +++ b/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts @@ -0,0 +1,70 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Coin } from "@cosmjs/amino"; +import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@cosmjs/encoding"; +import { InstantiateMsg, ExecuteMsg, QueryMsg } from "./CyberPunk.types"; +export interface CyberPunkMessage { + contractAddress: string; + sender: string; + argon2: ({ + memCost, + timeCost + }: { + memCost: number; + timeCost: number; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + mirrorEnv: (funds?: Coin[]) => MsgExecuteContractEncodeObject; +} +export class CyberPunkMessageComposer implements CyberPunkMessage { + sender: string; + contractAddress: string; + + constructor(sender: string, contractAddress: string) { + this.sender = sender; + this.contractAddress = contractAddress; + this.argon2 = this.argon2.bind(this); + this.mirrorEnv = this.mirrorEnv.bind(this); + } + + argon2 = ({ + memCost, + timeCost + }: { + memCost: number; + timeCost: number; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + argon2: { + mem_cost: memCost, + time_cost: timeCost + } + })), + funds + }) + }; + }; + mirrorEnv = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + mirror_env: {} + })), + funds + }) + }; + }; +} \ No newline at end of file diff --git a/__output__/idl-version/cyberpunk/CyberPunk.react-query.ts b/__output__/idl-version/cyberpunk/CyberPunk.react-query.ts new file mode 100644 index 00000000..d6c80f03 --- /dev/null +++ b/__output__/idl-version/cyberpunk/CyberPunk.react-query.ts @@ -0,0 +1,20 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions, useQuery } from "react-query"; +import { InstantiateMsg, ExecuteMsg, QueryMsg } from "./CyberPunk.types"; +import { CyberPunkQueryClient } from "./CyberPunk.client"; +export interface CyberPunkReactQuery { + client: CyberPunkQueryClient; + options?: UseQueryOptions; +} +export interface CyberPunkMirrorEnvQuery extends CyberPunkReactQuery {} +export function useCyberPunkMirrorEnvQuery({ + client, + options +}: CyberPunkMirrorEnvQuery) { + return useQuery(["cyberPunkMirrorEnv", client.contractAddress], () => client.mirrorEnv(), options); +} \ No newline at end of file diff --git a/__output__/idl-version/cyberpunk/CyberPunk.recoil.ts b/__output__/idl-version/cyberpunk/CyberPunk.recoil.ts new file mode 100644 index 00000000..55e8eb18 --- /dev/null +++ b/__output__/idl-version/cyberpunk/CyberPunk.recoil.ts @@ -0,0 +1,38 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { selectorFamily } from "recoil"; +import { cosmWasmClient } from "./chain"; +import { InstantiateMsg, ExecuteMsg, QueryMsg } from "./CyberPunk.types"; +import { CyberPunkQueryClient } from "./CyberPunk.client"; +type QueryClientParams = { + contractAddress: string; +}; +export const queryClient = selectorFamily({ + key: "cyberPunkQueryClient", + get: ({ + contractAddress + }) => ({ + get + }) => { + const client = get(cosmWasmClient); + return new CyberPunkQueryClient(client, contractAddress); + } +}); +export const mirrorEnvSelector = selectorFamily; +}>({ + key: "cyberPunkMirrorEnv", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.mirrorEnv(...params); + } +}); \ No newline at end of file diff --git a/__output__/idl-version/cyberpunk/CyberPunk.types.ts b/__output__/idl-version/cyberpunk/CyberPunk.types.ts new file mode 100644 index 00000000..81228471 --- /dev/null +++ b/__output__/idl-version/cyberpunk/CyberPunk.types.ts @@ -0,0 +1,20 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + [k: string]: unknown; +} +export type ExecuteMsg = { + argon2: { + mem_cost: number; + time_cost: number; + }; +} | { + mirror_env: {}; +}; +export type QueryMsg = { + mirror_env: {}; +}; \ No newline at end of file diff --git a/__output__/idl-version/hackatom/HackAtom.client.ts b/__output__/idl-version/hackatom/HackAtom.client.ts new file mode 100644 index 00000000..297ee46f --- /dev/null +++ b/__output__/idl-version/hackatom/HackAtom.client.ts @@ -0,0 +1,158 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, SudoMsg, Uint128, Coin } from "./HackAtom.types"; +export interface HackAtomReadOnlyInterface { + contractAddress: string; + verifier: () => Promise; + otherBalance: ({ + address + }: { + address: string; + }) => Promise; + recurse: ({ + depth, + work + }: { + depth: number; + work: number; + }) => Promise; + getInt: () => Promise; +} +export class HackAtomQueryClient implements HackAtomReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.verifier = this.verifier.bind(this); + this.otherBalance = this.otherBalance.bind(this); + this.recurse = this.recurse.bind(this); + this.getInt = this.getInt.bind(this); + } + + verifier = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + verifier: {} + }); + }; + otherBalance = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + other_balance: { + address + } + }); + }; + recurse = async ({ + depth, + work + }: { + depth: number; + work: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + recurse: { + depth, + work + } + }); + }; + getInt = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_int: {} + }); + }; +} +export interface HackAtomInterface extends HackAtomReadOnlyInterface { + contractAddress: string; + sender: string; + release: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + cpuLoop: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + storageLoop: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + memoryLoop: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + messageLoop: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + allocateLargeMemory: ({ + pages + }: { + pages: number; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + panic: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + userErrorsInApiCalls: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; +} +export class HackAtomClient extends HackAtomQueryClient implements HackAtomInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + super(client, contractAddress); + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.release = this.release.bind(this); + this.cpuLoop = this.cpuLoop.bind(this); + this.storageLoop = this.storageLoop.bind(this); + this.memoryLoop = this.memoryLoop.bind(this); + this.messageLoop = this.messageLoop.bind(this); + this.allocateLargeMemory = this.allocateLargeMemory.bind(this); + this.panic = this.panic.bind(this); + this.userErrorsInApiCalls = this.userErrorsInApiCalls.bind(this); + } + + release = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + release: {} + }, fee, memo, funds); + }; + cpuLoop = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + cpu_loop: {} + }, fee, memo, funds); + }; + storageLoop = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + storage_loop: {} + }, fee, memo, funds); + }; + memoryLoop = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + memory_loop: {} + }, fee, memo, funds); + }; + messageLoop = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + message_loop: {} + }, fee, memo, funds); + }; + allocateLargeMemory = async ({ + pages + }: { + pages: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + allocate_large_memory: { + pages + } + }, fee, memo, funds); + }; + panic = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + panic: {} + }, fee, memo, funds); + }; + userErrorsInApiCalls = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + user_errors_in_api_calls: {} + }, fee, memo, funds); + }; +} \ No newline at end of file diff --git a/__output__/idl-version/hackatom/HackAtom.message-composer.ts b/__output__/idl-version/hackatom/HackAtom.message-composer.ts new file mode 100644 index 00000000..399f497d --- /dev/null +++ b/__output__/idl-version/hackatom/HackAtom.message-composer.ts @@ -0,0 +1,154 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@cosmjs/encoding"; +import { InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, SudoMsg, Uint128, Coin } from "./HackAtom.types"; +export interface HackAtomMessage { + contractAddress: string; + sender: string; + release: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + cpuLoop: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + storageLoop: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + memoryLoop: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + messageLoop: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + allocateLargeMemory: ({ + pages + }: { + pages: number; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + panic: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + userErrorsInApiCalls: (funds?: Coin[]) => MsgExecuteContractEncodeObject; +} +export class HackAtomMessageComposer implements HackAtomMessage { + sender: string; + contractAddress: string; + + constructor(sender: string, contractAddress: string) { + this.sender = sender; + this.contractAddress = contractAddress; + this.release = this.release.bind(this); + this.cpuLoop = this.cpuLoop.bind(this); + this.storageLoop = this.storageLoop.bind(this); + this.memoryLoop = this.memoryLoop.bind(this); + this.messageLoop = this.messageLoop.bind(this); + this.allocateLargeMemory = this.allocateLargeMemory.bind(this); + this.panic = this.panic.bind(this); + this.userErrorsInApiCalls = this.userErrorsInApiCalls.bind(this); + } + + release = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + release: {} + })), + funds + }) + }; + }; + cpuLoop = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + cpu_loop: {} + })), + funds + }) + }; + }; + storageLoop = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + storage_loop: {} + })), + funds + }) + }; + }; + memoryLoop = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + memory_loop: {} + })), + funds + }) + }; + }; + messageLoop = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + message_loop: {} + })), + funds + }) + }; + }; + allocateLargeMemory = ({ + pages + }: { + pages: number; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + allocate_large_memory: { + pages + } + })), + funds + }) + }; + }; + panic = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + panic: {} + })), + funds + }) + }; + }; + userErrorsInApiCalls = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + user_errors_in_api_calls: {} + })), + funds + }) + }; + }; +} \ No newline at end of file diff --git a/__output__/idl-version/hackatom/HackAtom.react-query.ts b/__output__/idl-version/hackatom/HackAtom.react-query.ts new file mode 100644 index 00000000..4503f9d5 --- /dev/null +++ b/__output__/idl-version/hackatom/HackAtom.react-query.ts @@ -0,0 +1,57 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions, useQuery } from "react-query"; +import { InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, SudoMsg, Uint128, Coin } from "./HackAtom.types"; +import { HackAtomQueryClient } from "./HackAtom.client"; +export interface HackAtomReactQuery { + client: HackAtomQueryClient; + options?: UseQueryOptions; +} +export interface HackAtomGetIntQuery extends HackAtomReactQuery {} +export function useHackAtomGetIntQuery({ + client, + options +}: HackAtomGetIntQuery) { + return useQuery(["hackAtomGetInt", client.contractAddress], () => client.getInt(), options); +} +export interface HackAtomRecurseQuery extends HackAtomReactQuery { + args: { + depth: number; + work: number; + }; +} +export function useHackAtomRecurseQuery({ + client, + args, + options +}: HackAtomRecurseQuery) { + return useQuery(["hackAtomRecurse", client.contractAddress, JSON.stringify(args)], () => client.recurse({ + depth: args.depth, + work: args.work + }), options); +} +export interface HackAtomOtherBalanceQuery extends HackAtomReactQuery { + args: { + address: string; + }; +} +export function useHackAtomOtherBalanceQuery({ + client, + args, + options +}: HackAtomOtherBalanceQuery) { + return useQuery(["hackAtomOtherBalance", client.contractAddress, JSON.stringify(args)], () => client.otherBalance({ + address: args.address + }), options); +} +export interface HackAtomVerifierQuery extends HackAtomReactQuery {} +export function useHackAtomVerifierQuery({ + client, + options +}: HackAtomVerifierQuery) { + return useQuery(["hackAtomVerifier", client.contractAddress], () => client.verifier(), options); +} \ No newline at end of file diff --git a/__output__/idl-version/hackatom/HackAtom.recoil.ts b/__output__/idl-version/hackatom/HackAtom.recoil.ts new file mode 100644 index 00000000..6fe2294e --- /dev/null +++ b/__output__/idl-version/hackatom/HackAtom.recoil.ts @@ -0,0 +1,80 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { selectorFamily } from "recoil"; +import { cosmWasmClient } from "./chain"; +import { InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, SudoMsg, Uint128, Coin } from "./HackAtom.types"; +import { HackAtomQueryClient } from "./HackAtom.client"; +type QueryClientParams = { + contractAddress: string; +}; +export const queryClient = selectorFamily({ + key: "hackAtomQueryClient", + get: ({ + contractAddress + }) => ({ + get + }) => { + const client = get(cosmWasmClient); + return new HackAtomQueryClient(client, contractAddress); + } +}); +export const verifierSelector = selectorFamily; +}>({ + key: "hackAtomVerifier", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.verifier(...params); + } +}); +export const otherBalanceSelector = selectorFamily; +}>({ + key: "hackAtomOtherBalance", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.otherBalance(...params); + } +}); +export const recurseSelector = selectorFamily; +}>({ + key: "hackAtomRecurse", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.recurse(...params); + } +}); +export const getIntSelector = selectorFamily; +}>({ + key: "hackAtomGetInt", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.getInt(...params); + } +}); \ No newline at end of file diff --git a/__output__/idl-version/hackatom/HackAtom.types.ts b/__output__/idl-version/hackatom/HackAtom.types.ts new file mode 100644 index 00000000..8a564933 --- /dev/null +++ b/__output__/idl-version/hackatom/HackAtom.types.ts @@ -0,0 +1,58 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + beneficiary: string; + verifier: string; +} +export type ExecuteMsg = { + release: {}; +} | { + cpu_loop: {}; +} | { + storage_loop: {}; +} | { + memory_loop: {}; +} | { + message_loop: {}; +} | { + allocate_large_memory: { + pages: number; + }; +} | { + panic: {}; +} | { + user_errors_in_api_calls: {}; +}; +export type QueryMsg = { + verifier: {}; +} | { + other_balance: { + address: string; + }; +} | { + recurse: { + depth: number; + work: number; + }; +} | { + get_int: {}; +}; +export interface MigrateMsg { + verifier: string; +} +export type SudoMsg = { + steal_funds: { + amount: Coin[]; + recipient: string; + }; +}; +export type Uint128 = string; +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} \ No newline at end of file diff --git a/__output__/sg721/clean.json b/__output__/sg721/clean.json index 7026c82b..8bd3787d 100644 --- a/__output__/sg721/clean.json +++ b/__output__/sg721/clean.json @@ -1,1487 +1,1489 @@ -[ - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "AllNftInfoResponse", - "type": "object", - "required": [ - "access", - "info" - ], - "properties": { - "access": { - "description": "Who can transfer the token", - "allOf": [ - { - "$ref": "#/definitions/OwnerOfResponse" - } - ] - }, - "info": { - "description": "Data on the token itself,", - "allOf": [ - { - "$ref": "#/definitions/NftInfoResponseForEmpty" - } - ] - } - }, - "definitions": { - "Approval": { - "type": "object", - "required": [ - "expires", - "spender" - ], - "properties": { - "expires": { - "description": "When the Approval expires (maybe Expiration::never)", - "allOf": [ - { - "$ref": "#/definitions/Expiration" - } - ] - }, - "spender": { - "description": "Account that can transfer/send the token", - "type": "string" - } +{ + "schemas": [ + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AllNftInfoResponse", + "type": "object", + "required": [ + "access", + "info" + ], + "properties": { + "access": { + "description": "Who can transfer the token", + "allOf": [ + { + "$ref": "#/definitions/OwnerOfResponse" + } + ] + }, + "info": { + "description": "Data on the token itself,", + "allOf": [ + { + "$ref": "#/definitions/NftInfoResponseForEmpty" + } + ] } }, - "Empty": { - "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", - "type": "object" - }, - "Expiration": { - "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", - "oneOf": [ - { - "description": "AtHeight will expire when `env.block.height` >= height", - "type": "object", - "required": [ - "at_height" - ], - "properties": { - "at_height": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] }, - "additionalProperties": false - }, - { - "description": "AtTime will expire when `env.block.time` >= time", - "type": "object", - "required": [ - "at_time" - ], - "properties": { - "at_time": { - "$ref": "#/definitions/Timestamp" - } + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + } + }, + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Never will never expire. Used to express the empty variant", - "type": "object", - "required": [ - "never" - ], - "properties": { - "never": { - "type": "object" - } + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false }, - "additionalProperties": false + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + "NftInfoResponseForEmpty": { + "type": "object", + "required": [ + "extension" + ], + "properties": { + "extension": { + "description": "You can add any custom metadata here when you extend cw721-base", + "allOf": [ + { + "$ref": "#/definitions/Empty" + } + ] + }, + "token_uri": { + "description": "Universal resource identifier for this NFT Should point to a JSON file that conforms to the ERC721 Metadata JSON Schema", + "type": [ + "string", + "null" + ] + } } - ] - }, - "NftInfoResponseForEmpty": { - "type": "object", - "required": [ - "extension" - ], - "properties": { - "extension": { - "description": "You can add any custom metadata here when you extend cw721-base", - "allOf": [ - { - "$ref": "#/definitions/Empty" + }, + "OwnerOfResponse": { + "type": "object", + "required": [ + "approvals", + "owner" + ], + "properties": { + "approvals": { + "description": "If set this address is approved to transfer/send the token as well", + "type": "array", + "items": { + "$ref": "#/definitions/Approval" } - ] - }, - "token_uri": { - "description": "Universal resource identifier for this NFT Should point to a JSON file that conforms to the ERC721 Metadata JSON Schema", - "type": [ - "string", - "null" - ] - } - } - }, - "OwnerOfResponse": { - "type": "object", - "required": [ - "approvals", - "owner" - ], - "properties": { - "approvals": { - "description": "If set this address is approved to transfer/send the token as well", - "type": "array", - "items": { - "$ref": "#/definitions/Approval" + }, + "owner": { + "description": "Owner of the token", + "type": "string" } - }, - "owner": { - "description": "Owner of the token", - "type": "string" - } - } - }, - "Timestamp": { - "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", - "allOf": [ - { - "$ref": "#/definitions/Uint64" } - ] - }, - "Uint64": { - "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", - "type": "string" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "AllOperatorsResponse", - "type": "object", - "required": [ - "operators" - ], - "properties": { - "operators": { - "type": "array", - "items": { - "$ref": "#/definitions/Approval" + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" } } }, - "definitions": { - "Approval": { - "type": "object", - "required": [ - "expires", - "spender" - ], - "properties": { - "expires": { - "description": "When the Approval expires (maybe Expiration::never)", - "allOf": [ - { - "$ref": "#/definitions/Expiration" - } - ] - }, - "spender": { - "description": "Account that can transfer/send the token", - "type": "string" + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AllOperatorsResponse", + "type": "object", + "required": [ + "operators" + ], + "properties": { + "operators": { + "type": "array", + "items": { + "$ref": "#/definitions/Approval" } } }, - "Expiration": { - "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", - "oneOf": [ - { - "description": "AtHeight will expire when `env.block.height` >= height", - "type": "object", - "required": [ - "at_height" - ], - "properties": { - "at_height": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] }, - "additionalProperties": false - }, - { - "description": "AtTime will expire when `env.block.time` >= time", - "type": "object", - "required": [ - "at_time" - ], - "properties": { - "at_time": { - "$ref": "#/definitions/Timestamp" - } + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + } + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Never will never expire. Used to express the empty variant", - "type": "object", - "required": [ - "never" - ], - "properties": { - "never": { - "type": "object" - } + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false }, - "additionalProperties": false - } - ] - }, - "Timestamp": { - "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", - "allOf": [ - { - "$ref": "#/definitions/Uint64" - } - ] - }, - "Uint64": { - "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", - "type": "string" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "AllTokensResponse", - "type": "object", - "required": [ - "tokens" - ], - "properties": { - "tokens": { - "description": "Contains all token_ids in lexicographical ordering If there are more than `limit`, use `start_from` in future queries to achieve pagination.", - "type": "array", - "items": { + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", "type": "string" } } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ApprovalResponse", - "type": "object", - "required": [ - "approval" - ], - "properties": { - "approval": { - "$ref": "#/definitions/Approval" - } }, - "definitions": { - "Approval": { - "type": "object", - "required": [ - "expires", - "spender" - ], - "properties": { - "expires": { - "description": "When the Approval expires (maybe Expiration::never)", - "allOf": [ - { - "$ref": "#/definitions/Expiration" - } - ] - }, - "spender": { - "description": "Account that can transfer/send the token", + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AllTokensResponse", + "type": "object", + "required": [ + "tokens" + ], + "properties": { + "tokens": { + "description": "Contains all token_ids in lexicographical ordering If there are more than `limit`, use `start_from` in future queries to achieve pagination.", + "type": "array", + "items": { "type": "string" } } + } + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ApprovalResponse", + "type": "object", + "required": [ + "approval" + ], + "properties": { + "approval": { + "$ref": "#/definitions/Approval" + } }, - "Expiration": { - "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", - "oneOf": [ - { - "description": "AtHeight will expire when `env.block.height` >= height", - "type": "object", - "required": [ - "at_height" - ], - "properties": { - "at_height": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] }, - "additionalProperties": false - }, - { - "description": "AtTime will expire when `env.block.time` >= time", - "type": "object", - "required": [ - "at_time" - ], - "properties": { - "at_time": { - "$ref": "#/definitions/Timestamp" - } + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + } + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Never will never expire. Used to express the empty variant", - "type": "object", - "required": [ - "never" - ], - "properties": { - "never": { - "type": "object" - } + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false }, - "additionalProperties": false - } - ] - }, - "Timestamp": { - "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", - "allOf": [ - { - "$ref": "#/definitions/Uint64" - } - ] - }, - "Uint64": { - "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", - "type": "string" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ApprovalsResponse", - "type": "object", - "required": [ - "approvals" - ], - "properties": { - "approvals": { - "type": "array", - "items": { - "$ref": "#/definitions/Approval" + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" } } }, - "definitions": { - "Approval": { - "type": "object", - "required": [ - "expires", - "spender" - ], - "properties": { - "expires": { - "description": "When the Approval expires (maybe Expiration::never)", - "allOf": [ - { - "$ref": "#/definitions/Expiration" - } - ] - }, - "spender": { - "description": "Account that can transfer/send the token", - "type": "string" + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ApprovalsResponse", + "type": "object", + "required": [ + "approvals" + ], + "properties": { + "approvals": { + "type": "array", + "items": { + "$ref": "#/definitions/Approval" } } }, - "Expiration": { - "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", - "oneOf": [ - { - "description": "AtHeight will expire when `env.block.height` >= height", - "type": "object", - "required": [ - "at_height" - ], - "properties": { - "at_height": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] }, - "additionalProperties": false - }, - { - "description": "AtTime will expire when `env.block.time` >= time", - "type": "object", - "required": [ - "at_time" - ], - "properties": { - "at_time": { - "$ref": "#/definitions/Timestamp" - } + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + } + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Never will never expire. Used to express the empty variant", - "type": "object", - "required": [ - "never" - ], - "properties": { - "never": { - "type": "object" - } + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false }, - "additionalProperties": false - } - ] - }, - "Timestamp": { - "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", - "allOf": [ - { - "$ref": "#/definitions/Uint64" - } - ] - }, - "Uint64": { - "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", - "type": "string" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "CollectionInfoResponse", - "type": "object", - "required": [ - "creator", - "description", - "image" - ], - "properties": { - "creator": { - "type": "string" - }, - "description": { - "type": "string" - }, - "external_link": { - "type": [ - "string", - "null" - ] - }, - "image": { - "type": "string" - }, - "royalty_info": { - "anyOf": [ - { - "$ref": "#/definitions/RoyaltyInfoResponse" - }, - { - "type": "null" - } - ] + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } } }, - "definitions": { - "Decimal": { - "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", - "type": "string" + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CollectionInfoResponse", + "type": "object", + "required": [ + "creator", + "description", + "image" + ], + "properties": { + "creator": { + "type": "string" + }, + "description": { + "type": "string" + }, + "external_link": { + "type": [ + "string", + "null" + ] + }, + "image": { + "type": "string" + }, + "royalty_info": { + "anyOf": [ + { + "$ref": "#/definitions/RoyaltyInfoResponse" + }, + { + "type": "null" + } + ] + } }, - "RoyaltyInfoResponse": { - "type": "object", - "required": [ - "payment_address", - "share" - ], - "properties": { - "payment_address": { - "type": "string" - }, - "share": { - "$ref": "#/definitions/Decimal" + "definitions": { + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "RoyaltyInfoResponse": { + "type": "object", + "required": [ + "payment_address", + "share" + ], + "properties": { + "payment_address": { + "type": "string" + }, + "share": { + "$ref": "#/definitions/Decimal" + } } } } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ContractInfoResponse", - "type": "object", - "required": [ - "name", - "symbol" - ], - "properties": { - "name": { - "type": "string" - }, - "symbol": { - "type": "string" + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ContractInfoResponse", + "type": "object", + "required": [ + "name", + "symbol" + ], + "properties": { + "name": { + "type": "string" + }, + "symbol": { + "type": "string" + } } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ExecuteMsgForEmpty", - "description": "This is like Cw721ExecuteMsg but we add a Mint command for an owner to make this stand-alone. You will likely want to remove mint and use other control logic in any contract that inherits this.", - "oneOf": [ - { - "description": "Transfer is a base message to move a token to another account without triggering actions", - "type": "object", - "required": [ - "transfer_nft" - ], - "properties": { - "transfer_nft": { - "type": "object", - "required": [ - "recipient", - "token_id" - ], - "properties": { - "recipient": { - "type": "string" - }, - "token_id": { - "type": "string" + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsgForEmpty", + "description": "This is like Cw721ExecuteMsg but we add a Mint command for an owner to make this stand-alone. You will likely want to remove mint and use other control logic in any contract that inherits this.", + "oneOf": [ + { + "description": "Transfer is a base message to move a token to another account without triggering actions", + "type": "object", + "required": [ + "transfer_nft" + ], + "properties": { + "transfer_nft": { + "type": "object", + "required": [ + "recipient", + "token_id" + ], + "properties": { + "recipient": { + "type": "string" + }, + "token_id": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Send is a base message to transfer a token to a contract and trigger an action on the receiving contract.", - "type": "object", - "required": [ - "send_nft" - ], - "properties": { - "send_nft": { - "type": "object", - "required": [ - "contract", - "msg", - "token_id" - ], - "properties": { - "contract": { - "type": "string" - }, - "msg": { - "$ref": "#/definitions/Binary" - }, - "token_id": { - "type": "string" + { + "description": "Send is a base message to transfer a token to a contract and trigger an action on the receiving contract.", + "type": "object", + "required": [ + "send_nft" + ], + "properties": { + "send_nft": { + "type": "object", + "required": [ + "contract", + "msg", + "token_id" + ], + "properties": { + "contract": { + "type": "string" + }, + "msg": { + "$ref": "#/definitions/Binary" + }, + "token_id": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Allows operator to transfer / send the token from the owner's account. If expiration is set, then this allowance has a time/height limit", - "type": "object", - "required": [ - "approve" - ], - "properties": { - "approve": { - "type": "object", - "required": [ - "spender", - "token_id" - ], - "properties": { - "expires": { - "anyOf": [ - { - "$ref": "#/definitions/Expiration" - }, - { - "type": "null" - } - ] - }, - "spender": { - "type": "string" - }, - "token_id": { - "type": "string" + { + "description": "Allows operator to transfer / send the token from the owner's account. If expiration is set, then this allowance has a time/height limit", + "type": "object", + "required": [ + "approve" + ], + "properties": { + "approve": { + "type": "object", + "required": [ + "spender", + "token_id" + ], + "properties": { + "expires": { + "anyOf": [ + { + "$ref": "#/definitions/Expiration" + }, + { + "type": "null" + } + ] + }, + "spender": { + "type": "string" + }, + "token_id": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Remove previously granted Approval", - "type": "object", - "required": [ - "revoke" - ], - "properties": { - "revoke": { - "type": "object", - "required": [ - "spender", - "token_id" - ], - "properties": { - "spender": { - "type": "string" - }, - "token_id": { - "type": "string" + { + "description": "Remove previously granted Approval", + "type": "object", + "required": [ + "revoke" + ], + "properties": { + "revoke": { + "type": "object", + "required": [ + "spender", + "token_id" + ], + "properties": { + "spender": { + "type": "string" + }, + "token_id": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Allows operator to transfer / send any token from the owner's account. If expiration is set, then this allowance has a time/height limit", - "type": "object", - "required": [ - "approve_all" - ], - "properties": { - "approve_all": { - "type": "object", - "required": [ - "operator" - ], - "properties": { - "expires": { - "anyOf": [ - { - "$ref": "#/definitions/Expiration" - }, - { - "type": "null" - } - ] - }, - "operator": { - "type": "string" + { + "description": "Allows operator to transfer / send any token from the owner's account. If expiration is set, then this allowance has a time/height limit", + "type": "object", + "required": [ + "approve_all" + ], + "properties": { + "approve_all": { + "type": "object", + "required": [ + "operator" + ], + "properties": { + "expires": { + "anyOf": [ + { + "$ref": "#/definitions/Expiration" + }, + { + "type": "null" + } + ] + }, + "operator": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Remove previously granted ApproveAll permission", - "type": "object", - "required": [ - "revoke_all" - ], - "properties": { - "revoke_all": { - "type": "object", - "required": [ - "operator" - ], - "properties": { - "operator": { - "type": "string" + { + "description": "Remove previously granted ApproveAll permission", + "type": "object", + "required": [ + "revoke_all" + ], + "properties": { + "revoke_all": { + "type": "object", + "required": [ + "operator" + ], + "properties": { + "operator": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Mint a new NFT, can only be called by the contract minter", - "type": "object", - "required": [ - "mint" - ], - "properties": { - "mint": { - "$ref": "#/definitions/MintMsgForEmpty" - } + { + "description": "Mint a new NFT, can only be called by the contract minter", + "type": "object", + "required": [ + "mint" + ], + "properties": { + "mint": { + "$ref": "#/definitions/MintMsgForEmpty" + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Burn an NFT the sender has access to", - "type": "object", - "required": [ - "burn" - ], - "properties": { - "burn": { - "type": "object", - "required": [ - "token_id" - ], - "properties": { - "token_id": { - "type": "string" + { + "description": "Burn an NFT the sender has access to", + "type": "object", + "required": [ + "burn" + ], + "properties": { + "burn": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "token_id": { + "type": "string" + } } } + }, + "additionalProperties": false + } + ], + "definitions": { + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec", + "type": "string" + }, + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } + }, + "additionalProperties": false + }, + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false + }, + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + "MintMsgForEmpty": { + "type": "object", + "required": [ + "extension", + "owner", + "token_id" + ], + "properties": { + "extension": { + "description": "Any custom extension used by this contract", + "allOf": [ + { + "$ref": "#/definitions/Empty" + } + ] + }, + "owner": { + "description": "The owner of the newly minter NFT", + "type": "string" + }, + "token_id": { + "description": "Unique ID of the NFT", + "type": "string" + }, + "token_uri": { + "description": "Universal resource identifier for this NFT Should point to a JSON file that conforms to the ERC721 Metadata JSON Schema", + "type": [ + "string", + "null" + ] + } } }, - "additionalProperties": false + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } } - ], - "definitions": { - "Binary": { - "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec", - "type": "string" - }, - "Empty": { - "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", - "type": "object" + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "collection_info", + "minter", + "name", + "symbol" + ], + "properties": { + "collection_info": { + "$ref": "#/definitions/CollectionInfoForRoyaltyInfoResponse" + }, + "minter": { + "type": "string" + }, + "name": { + "type": "string" + }, + "symbol": { + "type": "string" + } }, - "Expiration": { - "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", - "oneOf": [ - { - "description": "AtHeight will expire when `env.block.height` >= height", - "type": "object", - "required": [ - "at_height" - ], - "properties": { - "at_height": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } + "definitions": { + "CollectionInfoForRoyaltyInfoResponse": { + "type": "object", + "required": [ + "creator", + "description", + "image" + ], + "properties": { + "creator": { + "type": "string" }, - "additionalProperties": false - }, - { - "description": "AtTime will expire when `env.block.time` >= time", - "type": "object", - "required": [ - "at_time" - ], - "properties": { - "at_time": { - "$ref": "#/definitions/Timestamp" - } + "description": { + "type": "string" }, - "additionalProperties": false - }, - { - "description": "Never will never expire. Used to express the empty variant", - "type": "object", - "required": [ - "never" - ], - "properties": { - "never": { - "type": "object" - } + "external_link": { + "type": [ + "string", + "null" + ] + }, + "image": { + "type": "string" }, - "additionalProperties": false + "royalty_info": { + "anyOf": [ + { + "$ref": "#/definitions/RoyaltyInfoResponse" + }, + { + "type": "null" + } + ] + } } - ] - }, - "MintMsgForEmpty": { - "type": "object", - "required": [ - "extension", - "owner", - "token_id" - ], - "properties": { - "extension": { - "description": "Any custom extension used by this contract", - "allOf": [ - { - "$ref": "#/definitions/Empty" - } - ] - }, - "owner": { - "description": "The owner of the newly minter NFT", - "type": "string" - }, - "token_id": { - "description": "Unique ID of the NFT", - "type": "string" - }, - "token_uri": { - "description": "Universal resource identifier for this NFT Should point to a JSON file that conforms to the ERC721 Metadata JSON Schema", - "type": [ - "string", - "null" - ] + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "RoyaltyInfoResponse": { + "type": "object", + "required": [ + "payment_address", + "share" + ], + "properties": { + "payment_address": { + "type": "string" + }, + "share": { + "$ref": "#/definitions/Decimal" + } } } - }, - "Timestamp": { - "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", - "allOf": [ - { - "$ref": "#/definitions/Uint64" - } - ] - }, - "Uint64": { - "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", - "type": "string" } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "InstantiateMsg", - "type": "object", - "required": [ - "collection_info", - "minter", - "name", - "symbol" - ], - "properties": { - "collection_info": { - "$ref": "#/definitions/CollectionInfoForRoyaltyInfoResponse" - }, - "minter": { - "type": "string" - }, - "name": { - "type": "string" - }, - "symbol": { - "type": "string" + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MinterResponse", + "description": "Shows who can mint these tokens", + "type": "object", + "required": [ + "minter" + ], + "properties": { + "minter": { + "type": "string" + } } }, - "definitions": { - "CollectionInfoForRoyaltyInfoResponse": { - "type": "object", - "required": [ - "creator", - "description", - "image" - ], - "properties": { - "creator": { - "type": "string" - }, - "description": { - "type": "string" - }, - "external_link": { - "type": [ - "string", - "null" - ] - }, - "image": { - "type": "string" - }, - "royalty_info": { - "anyOf": [ - { - "$ref": "#/definitions/RoyaltyInfoResponse" - }, - { - "type": "null" - } - ] - } + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "NftInfoResponse", + "type": "object", + "required": [ + "extension" + ], + "properties": { + "extension": { + "description": "You can add any custom metadata here when you extend cw721-base", + "allOf": [ + { + "$ref": "#/definitions/Empty" + } + ] + }, + "token_uri": { + "description": "Universal resource identifier for this NFT Should point to a JSON file that conforms to the ERC721 Metadata JSON Schema", + "type": [ + "string", + "null" + ] } }, - "Decimal": { - "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", - "type": "string" - }, - "RoyaltyInfoResponse": { - "type": "object", - "required": [ - "payment_address", - "share" - ], - "properties": { - "payment_address": { - "type": "string" - }, - "share": { - "$ref": "#/definitions/Decimal" - } + "definitions": { + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" } } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "MinterResponse", - "description": "Shows who can mint these tokens", - "type": "object", - "required": [ - "minter" - ], - "properties": { - "minter": { - "type": "string" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "NftInfoResponse", - "type": "object", - "required": [ - "extension" - ], - "properties": { - "extension": { - "description": "You can add any custom metadata here when you extend cw721-base", - "allOf": [ - { - "$ref": "#/definitions/Empty" - } - ] - }, - "token_uri": { - "description": "Universal resource identifier for this NFT Should point to a JSON file that conforms to the ERC721 Metadata JSON Schema", - "type": [ - "string", - "null" - ] - } }, - "definitions": { - "Empty": { - "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", - "type": "object" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "NumTokensResponse", - "type": "object", - "required": [ - "count" - ], - "properties": { - "count": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OperatorsResponse", - "type": "object", - "required": [ - "operators" - ], - "properties": { - "operators": { - "type": "array", - "items": { - "$ref": "#/definitions/Approval" + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "NumTokensResponse", + "type": "object", + "required": [ + "count" + ], + "properties": { + "count": { + "type": "integer", + "format": "uint64", + "minimum": 0 } } }, - "definitions": { - "Approval": { - "type": "object", - "required": [ - "expires", - "spender" - ], - "properties": { - "expires": { - "description": "When the Approval expires (maybe Expiration::never)", - "allOf": [ - { - "$ref": "#/definitions/Expiration" - } - ] - }, - "spender": { - "description": "Account that can transfer/send the token", - "type": "string" + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OperatorsResponse", + "type": "object", + "required": [ + "operators" + ], + "properties": { + "operators": { + "type": "array", + "items": { + "$ref": "#/definitions/Approval" } } }, - "Expiration": { - "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", - "oneOf": [ - { - "description": "AtHeight will expire when `env.block.height` >= height", - "type": "object", - "required": [ - "at_height" - ], - "properties": { - "at_height": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] }, - "additionalProperties": false - }, - { - "description": "AtTime will expire when `env.block.time` >= time", - "type": "object", - "required": [ - "at_time" - ], - "properties": { - "at_time": { - "$ref": "#/definitions/Timestamp" - } + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + } + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Never will never expire. Used to express the empty variant", - "type": "object", - "required": [ - "never" - ], - "properties": { - "never": { - "type": "object" - } + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false }, - "additionalProperties": false - } - ] - }, - "Timestamp": { - "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", - "allOf": [ - { - "$ref": "#/definitions/Uint64" - } - ] - }, - "Uint64": { - "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", - "type": "string" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OwnerOfResponse", - "type": "object", - "required": [ - "approvals", - "owner" - ], - "properties": { - "approvals": { - "description": "If set this address is approved to transfer/send the token as well", - "type": "array", - "items": { - "$ref": "#/definitions/Approval" + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" } - }, - "owner": { - "description": "Owner of the token", - "type": "string" } }, - "definitions": { - "Approval": { - "type": "object", - "required": [ - "expires", - "spender" - ], - "properties": { - "expires": { - "description": "When the Approval expires (maybe Expiration::never)", - "allOf": [ - { - "$ref": "#/definitions/Expiration" - } - ] - }, - "spender": { - "description": "Account that can transfer/send the token", - "type": "string" + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OwnerOfResponse", + "type": "object", + "required": [ + "approvals", + "owner" + ], + "properties": { + "approvals": { + "description": "If set this address is approved to transfer/send the token as well", + "type": "array", + "items": { + "$ref": "#/definitions/Approval" } + }, + "owner": { + "description": "Owner of the token", + "type": "string" } }, - "Expiration": { - "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", - "oneOf": [ - { - "description": "AtHeight will expire when `env.block.height` >= height", - "type": "object", - "required": [ - "at_height" - ], - "properties": { - "at_height": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] }, - "additionalProperties": false - }, - { - "description": "AtTime will expire when `env.block.time` >= time", - "type": "object", - "required": [ - "at_time" - ], - "properties": { - "at_time": { - "$ref": "#/definitions/Timestamp" - } + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + } + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Never will never expire. Used to express the empty variant", - "type": "object", - "required": [ - "never" - ], - "properties": { - "never": { - "type": "object" - } + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false }, - "additionalProperties": false - } - ] - }, - "Timestamp": { - "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", - "allOf": [ - { - "$ref": "#/definitions/Uint64" - } - ] - }, - "Uint64": { - "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", - "type": "string" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "QueryMsg", - "oneOf": [ - { - "type": "object", - "required": [ - "owner_of" - ], - "properties": { - "owner_of": { - "type": "object", - "required": [ - "token_id" - ], - "properties": { - "include_expired": { - "type": [ - "boolean", - "null" - ] + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } }, - "token_id": { - "type": "string" + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "owner_of" + ], + "properties": { + "owner_of": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "include_expired": { + "type": [ + "boolean", + "null" + ] + }, + "token_id": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "approval" - ], - "properties": { - "approval": { - "type": "object", - "required": [ - "spender", - "token_id" - ], - "properties": { - "include_expired": { - "type": [ - "boolean", - "null" - ] - }, - "spender": { - "type": "string" - }, - "token_id": { - "type": "string" + { + "type": "object", + "required": [ + "approval" + ], + "properties": { + "approval": { + "type": "object", + "required": [ + "spender", + "token_id" + ], + "properties": { + "include_expired": { + "type": [ + "boolean", + "null" + ] + }, + "spender": { + "type": "string" + }, + "token_id": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "approvals" - ], - "properties": { - "approvals": { - "type": "object", - "required": [ - "token_id" - ], - "properties": { - "include_expired": { - "type": [ - "boolean", - "null" - ] - }, - "token_id": { - "type": "string" + { + "type": "object", + "required": [ + "approvals" + ], + "properties": { + "approvals": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "include_expired": { + "type": [ + "boolean", + "null" + ] + }, + "token_id": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "all_operators" - ], - "properties": { - "all_operators": { - "type": "object", - "required": [ - "owner" - ], - "properties": { - "include_expired": { - "type": [ - "boolean", - "null" - ] - }, - "limit": { - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0 - }, - "owner": { - "type": "string" - }, - "start_after": { - "type": [ - "string", - "null" - ] + { + "type": "object", + "required": [ + "all_operators" + ], + "properties": { + "all_operators": { + "type": "object", + "required": [ + "owner" + ], + "properties": { + "include_expired": { + "type": [ + "boolean", + "null" + ] + }, + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0 + }, + "owner": { + "type": "string" + }, + "start_after": { + "type": [ + "string", + "null" + ] + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "num_tokens" - ], - "properties": { - "num_tokens": { - "type": "object" - } + { + "type": "object", + "required": [ + "num_tokens" + ], + "properties": { + "num_tokens": { + "type": "object" + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "contract_info" - ], - "properties": { - "contract_info": { - "type": "object" - } + { + "type": "object", + "required": [ + "contract_info" + ], + "properties": { + "contract_info": { + "type": "object" + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "nft_info" - ], - "properties": { - "nft_info": { - "type": "object", - "required": [ - "token_id" - ], - "properties": { - "token_id": { - "type": "string" + { + "type": "object", + "required": [ + "nft_info" + ], + "properties": { + "nft_info": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "token_id": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "all_nft_info" - ], - "properties": { - "all_nft_info": { - "type": "object", - "required": [ - "token_id" - ], - "properties": { - "include_expired": { - "type": [ - "boolean", - "null" - ] - }, - "token_id": { - "type": "string" + { + "type": "object", + "required": [ + "all_nft_info" + ], + "properties": { + "all_nft_info": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "include_expired": { + "type": [ + "boolean", + "null" + ] + }, + "token_id": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "tokens" - ], - "properties": { - "tokens": { - "type": "object", - "required": [ - "owner" - ], - "properties": { - "limit": { - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0 - }, - "owner": { - "type": "string" - }, - "start_after": { - "type": [ - "string", - "null" - ] + { + "type": "object", + "required": [ + "tokens" + ], + "properties": { + "tokens": { + "type": "object", + "required": [ + "owner" + ], + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0 + }, + "owner": { + "type": "string" + }, + "start_after": { + "type": [ + "string", + "null" + ] + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "all_tokens" - ], - "properties": { - "all_tokens": { - "type": "object", - "properties": { - "limit": { - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0 - }, - "start_after": { - "type": [ - "string", - "null" - ] + { + "type": "object", + "required": [ + "all_tokens" + ], + "properties": { + "all_tokens": { + "type": "object", + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0 + }, + "start_after": { + "type": [ + "string", + "null" + ] + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "minter" - ], - "properties": { - "minter": { - "type": "object" - } + { + "type": "object", + "required": [ + "minter" + ], + "properties": { + "minter": { + "type": "object" + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "collection_info" - ], - "properties": { - "collection_info": { - "type": "object" + { + "type": "object", + "required": [ + "collection_info" + ], + "properties": { + "collection_info": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TokensResponse", + "type": "object", + "required": [ + "tokens" + ], + "properties": { + "tokens": { + "description": "Contains all token_ids in lexicographical ordering If there are more than `limit`, use `start_from` in future queries to achieve pagination.", + "type": "array", + "items": { + "type": "string" } - }, - "additionalProperties": false - } - ] - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "TokensResponse", - "type": "object", - "required": [ - "tokens" - ], - "properties": { - "tokens": { - "description": "Contains all token_ids in lexicographical ordering If there are more than `limit`, use `start_from` in future queries to achieve pagination.", - "type": "array", - "items": { - "type": "string" } } } - } -] \ No newline at end of file + ] +} \ No newline at end of file diff --git a/__output__/sg721/orig.json b/__output__/sg721/orig.json index 7e7e6f72..177acf3b 100644 --- a/__output__/sg721/orig.json +++ b/__output__/sg721/orig.json @@ -1,1487 +1,1489 @@ -[ - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "AllNftInfoResponse", - "type": "object", - "required": [ - "access", - "info" - ], - "properties": { - "access": { - "description": "Who can transfer the token", - "allOf": [ - { - "$ref": "#/definitions/OwnerOfResponse" - } - ] - }, - "info": { - "description": "Data on the token itself,", - "allOf": [ - { - "$ref": "#/definitions/NftInfoResponse_for_Empty" - } - ] - } - }, - "definitions": { - "Approval": { - "type": "object", - "required": [ - "expires", - "spender" - ], - "properties": { - "expires": { - "description": "When the Approval expires (maybe Expiration::never)", - "allOf": [ - { - "$ref": "#/definitions/Expiration" - } - ] - }, - "spender": { - "description": "Account that can transfer/send the token", - "type": "string" - } +{ + "schemas": [ + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AllNftInfoResponse", + "type": "object", + "required": [ + "access", + "info" + ], + "properties": { + "access": { + "description": "Who can transfer the token", + "allOf": [ + { + "$ref": "#/definitions/OwnerOfResponse" + } + ] + }, + "info": { + "description": "Data on the token itself,", + "allOf": [ + { + "$ref": "#/definitions/NftInfoResponse_for_Empty" + } + ] } }, - "Empty": { - "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", - "type": "object" - }, - "Expiration": { - "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", - "oneOf": [ - { - "description": "AtHeight will expire when `env.block.height` >= height", - "type": "object", - "required": [ - "at_height" - ], - "properties": { - "at_height": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] }, - "additionalProperties": false - }, - { - "description": "AtTime will expire when `env.block.time` >= time", - "type": "object", - "required": [ - "at_time" - ], - "properties": { - "at_time": { - "$ref": "#/definitions/Timestamp" - } + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + } + }, + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Never will never expire. Used to express the empty variant", - "type": "object", - "required": [ - "never" - ], - "properties": { - "never": { - "type": "object" - } + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false }, - "additionalProperties": false + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + "NftInfoResponse_for_Empty": { + "type": "object", + "required": [ + "extension" + ], + "properties": { + "extension": { + "description": "You can add any custom metadata here when you extend cw721-base", + "allOf": [ + { + "$ref": "#/definitions/Empty" + } + ] + }, + "token_uri": { + "description": "Universal resource identifier for this NFT Should point to a JSON file that conforms to the ERC721 Metadata JSON Schema", + "type": [ + "string", + "null" + ] + } } - ] - }, - "NftInfoResponse_for_Empty": { - "type": "object", - "required": [ - "extension" - ], - "properties": { - "extension": { - "description": "You can add any custom metadata here when you extend cw721-base", - "allOf": [ - { - "$ref": "#/definitions/Empty" + }, + "OwnerOfResponse": { + "type": "object", + "required": [ + "approvals", + "owner" + ], + "properties": { + "approvals": { + "description": "If set this address is approved to transfer/send the token as well", + "type": "array", + "items": { + "$ref": "#/definitions/Approval" } - ] - }, - "token_uri": { - "description": "Universal resource identifier for this NFT Should point to a JSON file that conforms to the ERC721 Metadata JSON Schema", - "type": [ - "string", - "null" - ] - } - } - }, - "OwnerOfResponse": { - "type": "object", - "required": [ - "approvals", - "owner" - ], - "properties": { - "approvals": { - "description": "If set this address is approved to transfer/send the token as well", - "type": "array", - "items": { - "$ref": "#/definitions/Approval" + }, + "owner": { + "description": "Owner of the token", + "type": "string" } - }, - "owner": { - "description": "Owner of the token", - "type": "string" - } - } - }, - "Timestamp": { - "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", - "allOf": [ - { - "$ref": "#/definitions/Uint64" } - ] - }, - "Uint64": { - "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", - "type": "string" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "AllOperatorsResponse", - "type": "object", - "required": [ - "operators" - ], - "properties": { - "operators": { - "type": "array", - "items": { - "$ref": "#/definitions/Approval" + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" } } }, - "definitions": { - "Approval": { - "type": "object", - "required": [ - "expires", - "spender" - ], - "properties": { - "expires": { - "description": "When the Approval expires (maybe Expiration::never)", - "allOf": [ - { - "$ref": "#/definitions/Expiration" - } - ] - }, - "spender": { - "description": "Account that can transfer/send the token", - "type": "string" + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AllOperatorsResponse", + "type": "object", + "required": [ + "operators" + ], + "properties": { + "operators": { + "type": "array", + "items": { + "$ref": "#/definitions/Approval" } } }, - "Expiration": { - "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", - "oneOf": [ - { - "description": "AtHeight will expire when `env.block.height` >= height", - "type": "object", - "required": [ - "at_height" - ], - "properties": { - "at_height": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] }, - "additionalProperties": false - }, - { - "description": "AtTime will expire when `env.block.time` >= time", - "type": "object", - "required": [ - "at_time" - ], - "properties": { - "at_time": { - "$ref": "#/definitions/Timestamp" - } + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + } + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Never will never expire. Used to express the empty variant", - "type": "object", - "required": [ - "never" - ], - "properties": { - "never": { - "type": "object" - } + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false }, - "additionalProperties": false - } - ] - }, - "Timestamp": { - "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", - "allOf": [ - { - "$ref": "#/definitions/Uint64" - } - ] - }, - "Uint64": { - "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", - "type": "string" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "AllTokensResponse", - "type": "object", - "required": [ - "tokens" - ], - "properties": { - "tokens": { - "description": "Contains all token_ids in lexicographical ordering If there are more than `limit`, use `start_from` in future queries to achieve pagination.", - "type": "array", - "items": { + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", "type": "string" } } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ApprovalResponse", - "type": "object", - "required": [ - "approval" - ], - "properties": { - "approval": { - "$ref": "#/definitions/Approval" - } }, - "definitions": { - "Approval": { - "type": "object", - "required": [ - "expires", - "spender" - ], - "properties": { - "expires": { - "description": "When the Approval expires (maybe Expiration::never)", - "allOf": [ - { - "$ref": "#/definitions/Expiration" - } - ] - }, - "spender": { - "description": "Account that can transfer/send the token", + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AllTokensResponse", + "type": "object", + "required": [ + "tokens" + ], + "properties": { + "tokens": { + "description": "Contains all token_ids in lexicographical ordering If there are more than `limit`, use `start_from` in future queries to achieve pagination.", + "type": "array", + "items": { "type": "string" } } + } + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ApprovalResponse", + "type": "object", + "required": [ + "approval" + ], + "properties": { + "approval": { + "$ref": "#/definitions/Approval" + } }, - "Expiration": { - "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", - "oneOf": [ - { - "description": "AtHeight will expire when `env.block.height` >= height", - "type": "object", - "required": [ - "at_height" - ], - "properties": { - "at_height": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] }, - "additionalProperties": false - }, - { - "description": "AtTime will expire when `env.block.time` >= time", - "type": "object", - "required": [ - "at_time" - ], - "properties": { - "at_time": { - "$ref": "#/definitions/Timestamp" - } + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + } + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Never will never expire. Used to express the empty variant", - "type": "object", - "required": [ - "never" - ], - "properties": { - "never": { - "type": "object" - } + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false }, - "additionalProperties": false - } - ] - }, - "Timestamp": { - "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", - "allOf": [ - { - "$ref": "#/definitions/Uint64" - } - ] - }, - "Uint64": { - "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", - "type": "string" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ApprovalsResponse", - "type": "object", - "required": [ - "approvals" - ], - "properties": { - "approvals": { - "type": "array", - "items": { - "$ref": "#/definitions/Approval" + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" } } }, - "definitions": { - "Approval": { - "type": "object", - "required": [ - "expires", - "spender" - ], - "properties": { - "expires": { - "description": "When the Approval expires (maybe Expiration::never)", - "allOf": [ - { - "$ref": "#/definitions/Expiration" - } - ] - }, - "spender": { - "description": "Account that can transfer/send the token", - "type": "string" + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ApprovalsResponse", + "type": "object", + "required": [ + "approvals" + ], + "properties": { + "approvals": { + "type": "array", + "items": { + "$ref": "#/definitions/Approval" } } }, - "Expiration": { - "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", - "oneOf": [ - { - "description": "AtHeight will expire when `env.block.height` >= height", - "type": "object", - "required": [ - "at_height" - ], - "properties": { - "at_height": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] }, - "additionalProperties": false - }, - { - "description": "AtTime will expire when `env.block.time` >= time", - "type": "object", - "required": [ - "at_time" - ], - "properties": { - "at_time": { - "$ref": "#/definitions/Timestamp" - } + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + } + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Never will never expire. Used to express the empty variant", - "type": "object", - "required": [ - "never" - ], - "properties": { - "never": { - "type": "object" - } + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false }, - "additionalProperties": false - } - ] - }, - "Timestamp": { - "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", - "allOf": [ - { - "$ref": "#/definitions/Uint64" - } - ] - }, - "Uint64": { - "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", - "type": "string" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "CollectionInfoResponse", - "type": "object", - "required": [ - "creator", - "description", - "image" - ], - "properties": { - "creator": { - "type": "string" - }, - "description": { - "type": "string" - }, - "external_link": { - "type": [ - "string", - "null" - ] - }, - "image": { - "type": "string" - }, - "royalty_info": { - "anyOf": [ - { - "$ref": "#/definitions/RoyaltyInfoResponse" - }, - { - "type": "null" - } - ] + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } } }, - "definitions": { - "Decimal": { - "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", - "type": "string" + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CollectionInfoResponse", + "type": "object", + "required": [ + "creator", + "description", + "image" + ], + "properties": { + "creator": { + "type": "string" + }, + "description": { + "type": "string" + }, + "external_link": { + "type": [ + "string", + "null" + ] + }, + "image": { + "type": "string" + }, + "royalty_info": { + "anyOf": [ + { + "$ref": "#/definitions/RoyaltyInfoResponse" + }, + { + "type": "null" + } + ] + } }, - "RoyaltyInfoResponse": { - "type": "object", - "required": [ - "payment_address", - "share" - ], - "properties": { - "payment_address": { - "type": "string" - }, - "share": { - "$ref": "#/definitions/Decimal" + "definitions": { + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "RoyaltyInfoResponse": { + "type": "object", + "required": [ + "payment_address", + "share" + ], + "properties": { + "payment_address": { + "type": "string" + }, + "share": { + "$ref": "#/definitions/Decimal" + } } } } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ContractInfoResponse", - "type": "object", - "required": [ - "name", - "symbol" - ], - "properties": { - "name": { - "type": "string" - }, - "symbol": { - "type": "string" + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ContractInfoResponse", + "type": "object", + "required": [ + "name", + "symbol" + ], + "properties": { + "name": { + "type": "string" + }, + "symbol": { + "type": "string" + } } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ExecuteMsg_for_Empty", - "description": "This is like Cw721ExecuteMsg but we add a Mint command for an owner to make this stand-alone. You will likely want to remove mint and use other control logic in any contract that inherits this.", - "oneOf": [ - { - "description": "Transfer is a base message to move a token to another account without triggering actions", - "type": "object", - "required": [ - "transfer_nft" - ], - "properties": { - "transfer_nft": { - "type": "object", - "required": [ - "recipient", - "token_id" - ], - "properties": { - "recipient": { - "type": "string" - }, - "token_id": { - "type": "string" + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg_for_Empty", + "description": "This is like Cw721ExecuteMsg but we add a Mint command for an owner to make this stand-alone. You will likely want to remove mint and use other control logic in any contract that inherits this.", + "oneOf": [ + { + "description": "Transfer is a base message to move a token to another account without triggering actions", + "type": "object", + "required": [ + "transfer_nft" + ], + "properties": { + "transfer_nft": { + "type": "object", + "required": [ + "recipient", + "token_id" + ], + "properties": { + "recipient": { + "type": "string" + }, + "token_id": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Send is a base message to transfer a token to a contract and trigger an action on the receiving contract.", - "type": "object", - "required": [ - "send_nft" - ], - "properties": { - "send_nft": { - "type": "object", - "required": [ - "contract", - "msg", - "token_id" - ], - "properties": { - "contract": { - "type": "string" - }, - "msg": { - "$ref": "#/definitions/Binary" - }, - "token_id": { - "type": "string" + { + "description": "Send is a base message to transfer a token to a contract and trigger an action on the receiving contract.", + "type": "object", + "required": [ + "send_nft" + ], + "properties": { + "send_nft": { + "type": "object", + "required": [ + "contract", + "msg", + "token_id" + ], + "properties": { + "contract": { + "type": "string" + }, + "msg": { + "$ref": "#/definitions/Binary" + }, + "token_id": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Allows operator to transfer / send the token from the owner's account. If expiration is set, then this allowance has a time/height limit", - "type": "object", - "required": [ - "approve" - ], - "properties": { - "approve": { - "type": "object", - "required": [ - "spender", - "token_id" - ], - "properties": { - "expires": { - "anyOf": [ - { - "$ref": "#/definitions/Expiration" - }, - { - "type": "null" - } - ] - }, - "spender": { - "type": "string" - }, - "token_id": { - "type": "string" + { + "description": "Allows operator to transfer / send the token from the owner's account. If expiration is set, then this allowance has a time/height limit", + "type": "object", + "required": [ + "approve" + ], + "properties": { + "approve": { + "type": "object", + "required": [ + "spender", + "token_id" + ], + "properties": { + "expires": { + "anyOf": [ + { + "$ref": "#/definitions/Expiration" + }, + { + "type": "null" + } + ] + }, + "spender": { + "type": "string" + }, + "token_id": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Remove previously granted Approval", - "type": "object", - "required": [ - "revoke" - ], - "properties": { - "revoke": { - "type": "object", - "required": [ - "spender", - "token_id" - ], - "properties": { - "spender": { - "type": "string" - }, - "token_id": { - "type": "string" + { + "description": "Remove previously granted Approval", + "type": "object", + "required": [ + "revoke" + ], + "properties": { + "revoke": { + "type": "object", + "required": [ + "spender", + "token_id" + ], + "properties": { + "spender": { + "type": "string" + }, + "token_id": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Allows operator to transfer / send any token from the owner's account. If expiration is set, then this allowance has a time/height limit", - "type": "object", - "required": [ - "approve_all" - ], - "properties": { - "approve_all": { - "type": "object", - "required": [ - "operator" - ], - "properties": { - "expires": { - "anyOf": [ - { - "$ref": "#/definitions/Expiration" - }, - { - "type": "null" - } - ] - }, - "operator": { - "type": "string" + { + "description": "Allows operator to transfer / send any token from the owner's account. If expiration is set, then this allowance has a time/height limit", + "type": "object", + "required": [ + "approve_all" + ], + "properties": { + "approve_all": { + "type": "object", + "required": [ + "operator" + ], + "properties": { + "expires": { + "anyOf": [ + { + "$ref": "#/definitions/Expiration" + }, + { + "type": "null" + } + ] + }, + "operator": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Remove previously granted ApproveAll permission", - "type": "object", - "required": [ - "revoke_all" - ], - "properties": { - "revoke_all": { - "type": "object", - "required": [ - "operator" - ], - "properties": { - "operator": { - "type": "string" + { + "description": "Remove previously granted ApproveAll permission", + "type": "object", + "required": [ + "revoke_all" + ], + "properties": { + "revoke_all": { + "type": "object", + "required": [ + "operator" + ], + "properties": { + "operator": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Mint a new NFT, can only be called by the contract minter", - "type": "object", - "required": [ - "mint" - ], - "properties": { - "mint": { - "$ref": "#/definitions/MintMsg_for_Empty" - } + { + "description": "Mint a new NFT, can only be called by the contract minter", + "type": "object", + "required": [ + "mint" + ], + "properties": { + "mint": { + "$ref": "#/definitions/MintMsg_for_Empty" + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Burn an NFT the sender has access to", - "type": "object", - "required": [ - "burn" - ], - "properties": { - "burn": { - "type": "object", - "required": [ - "token_id" - ], - "properties": { - "token_id": { - "type": "string" + { + "description": "Burn an NFT the sender has access to", + "type": "object", + "required": [ + "burn" + ], + "properties": { + "burn": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "token_id": { + "type": "string" + } } } + }, + "additionalProperties": false + } + ], + "definitions": { + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec", + "type": "string" + }, + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } + }, + "additionalProperties": false + }, + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false + }, + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + "MintMsg_for_Empty": { + "type": "object", + "required": [ + "extension", + "owner", + "token_id" + ], + "properties": { + "extension": { + "description": "Any custom extension used by this contract", + "allOf": [ + { + "$ref": "#/definitions/Empty" + } + ] + }, + "owner": { + "description": "The owner of the newly minter NFT", + "type": "string" + }, + "token_id": { + "description": "Unique ID of the NFT", + "type": "string" + }, + "token_uri": { + "description": "Universal resource identifier for this NFT Should point to a JSON file that conforms to the ERC721 Metadata JSON Schema", + "type": [ + "string", + "null" + ] + } } }, - "additionalProperties": false + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } } - ], - "definitions": { - "Binary": { - "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec", - "type": "string" - }, - "Empty": { - "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", - "type": "object" + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "collection_info", + "minter", + "name", + "symbol" + ], + "properties": { + "collection_info": { + "$ref": "#/definitions/CollectionInfo_for_RoyaltyInfoResponse" + }, + "minter": { + "type": "string" + }, + "name": { + "type": "string" + }, + "symbol": { + "type": "string" + } }, - "Expiration": { - "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", - "oneOf": [ - { - "description": "AtHeight will expire when `env.block.height` >= height", - "type": "object", - "required": [ - "at_height" - ], - "properties": { - "at_height": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } + "definitions": { + "CollectionInfo_for_RoyaltyInfoResponse": { + "type": "object", + "required": [ + "creator", + "description", + "image" + ], + "properties": { + "creator": { + "type": "string" }, - "additionalProperties": false - }, - { - "description": "AtTime will expire when `env.block.time` >= time", - "type": "object", - "required": [ - "at_time" - ], - "properties": { - "at_time": { - "$ref": "#/definitions/Timestamp" - } + "description": { + "type": "string" }, - "additionalProperties": false - }, - { - "description": "Never will never expire. Used to express the empty variant", - "type": "object", - "required": [ - "never" - ], - "properties": { - "never": { - "type": "object" - } + "external_link": { + "type": [ + "string", + "null" + ] + }, + "image": { + "type": "string" }, - "additionalProperties": false + "royalty_info": { + "anyOf": [ + { + "$ref": "#/definitions/RoyaltyInfoResponse" + }, + { + "type": "null" + } + ] + } } - ] - }, - "MintMsg_for_Empty": { - "type": "object", - "required": [ - "extension", - "owner", - "token_id" - ], - "properties": { - "extension": { - "description": "Any custom extension used by this contract", - "allOf": [ - { - "$ref": "#/definitions/Empty" - } - ] - }, - "owner": { - "description": "The owner of the newly minter NFT", - "type": "string" - }, - "token_id": { - "description": "Unique ID of the NFT", - "type": "string" - }, - "token_uri": { - "description": "Universal resource identifier for this NFT Should point to a JSON file that conforms to the ERC721 Metadata JSON Schema", - "type": [ - "string", - "null" - ] + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "RoyaltyInfoResponse": { + "type": "object", + "required": [ + "payment_address", + "share" + ], + "properties": { + "payment_address": { + "type": "string" + }, + "share": { + "$ref": "#/definitions/Decimal" + } } } - }, - "Timestamp": { - "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", - "allOf": [ - { - "$ref": "#/definitions/Uint64" - } - ] - }, - "Uint64": { - "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", - "type": "string" } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "InstantiateMsg", - "type": "object", - "required": [ - "collection_info", - "minter", - "name", - "symbol" - ], - "properties": { - "collection_info": { - "$ref": "#/definitions/CollectionInfo_for_RoyaltyInfoResponse" - }, - "minter": { - "type": "string" - }, - "name": { - "type": "string" - }, - "symbol": { - "type": "string" + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MinterResponse", + "description": "Shows who can mint these tokens", + "type": "object", + "required": [ + "minter" + ], + "properties": { + "minter": { + "type": "string" + } } }, - "definitions": { - "CollectionInfo_for_RoyaltyInfoResponse": { - "type": "object", - "required": [ - "creator", - "description", - "image" - ], - "properties": { - "creator": { - "type": "string" - }, - "description": { - "type": "string" - }, - "external_link": { - "type": [ - "string", - "null" - ] - }, - "image": { - "type": "string" - }, - "royalty_info": { - "anyOf": [ - { - "$ref": "#/definitions/RoyaltyInfoResponse" - }, - { - "type": "null" - } - ] - } + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "NftInfoResponse", + "type": "object", + "required": [ + "extension" + ], + "properties": { + "extension": { + "description": "You can add any custom metadata here when you extend cw721-base", + "allOf": [ + { + "$ref": "#/definitions/Empty" + } + ] + }, + "token_uri": { + "description": "Universal resource identifier for this NFT Should point to a JSON file that conforms to the ERC721 Metadata JSON Schema", + "type": [ + "string", + "null" + ] } }, - "Decimal": { - "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", - "type": "string" - }, - "RoyaltyInfoResponse": { - "type": "object", - "required": [ - "payment_address", - "share" - ], - "properties": { - "payment_address": { - "type": "string" - }, - "share": { - "$ref": "#/definitions/Decimal" - } + "definitions": { + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" } } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "MinterResponse", - "description": "Shows who can mint these tokens", - "type": "object", - "required": [ - "minter" - ], - "properties": { - "minter": { - "type": "string" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "NftInfoResponse", - "type": "object", - "required": [ - "extension" - ], - "properties": { - "extension": { - "description": "You can add any custom metadata here when you extend cw721-base", - "allOf": [ - { - "$ref": "#/definitions/Empty" - } - ] - }, - "token_uri": { - "description": "Universal resource identifier for this NFT Should point to a JSON file that conforms to the ERC721 Metadata JSON Schema", - "type": [ - "string", - "null" - ] - } }, - "definitions": { - "Empty": { - "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", - "type": "object" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "NumTokensResponse", - "type": "object", - "required": [ - "count" - ], - "properties": { - "count": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OperatorsResponse", - "type": "object", - "required": [ - "operators" - ], - "properties": { - "operators": { - "type": "array", - "items": { - "$ref": "#/definitions/Approval" + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "NumTokensResponse", + "type": "object", + "required": [ + "count" + ], + "properties": { + "count": { + "type": "integer", + "format": "uint64", + "minimum": 0 } } }, - "definitions": { - "Approval": { - "type": "object", - "required": [ - "expires", - "spender" - ], - "properties": { - "expires": { - "description": "When the Approval expires (maybe Expiration::never)", - "allOf": [ - { - "$ref": "#/definitions/Expiration" - } - ] - }, - "spender": { - "description": "Account that can transfer/send the token", - "type": "string" + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OperatorsResponse", + "type": "object", + "required": [ + "operators" + ], + "properties": { + "operators": { + "type": "array", + "items": { + "$ref": "#/definitions/Approval" } } }, - "Expiration": { - "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", - "oneOf": [ - { - "description": "AtHeight will expire when `env.block.height` >= height", - "type": "object", - "required": [ - "at_height" - ], - "properties": { - "at_height": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] }, - "additionalProperties": false - }, - { - "description": "AtTime will expire when `env.block.time` >= time", - "type": "object", - "required": [ - "at_time" - ], - "properties": { - "at_time": { - "$ref": "#/definitions/Timestamp" - } + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + } + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Never will never expire. Used to express the empty variant", - "type": "object", - "required": [ - "never" - ], - "properties": { - "never": { - "type": "object" - } + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false }, - "additionalProperties": false - } - ] - }, - "Timestamp": { - "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", - "allOf": [ - { - "$ref": "#/definitions/Uint64" - } - ] - }, - "Uint64": { - "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", - "type": "string" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OwnerOfResponse", - "type": "object", - "required": [ - "approvals", - "owner" - ], - "properties": { - "approvals": { - "description": "If set this address is approved to transfer/send the token as well", - "type": "array", - "items": { - "$ref": "#/definitions/Approval" + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" } - }, - "owner": { - "description": "Owner of the token", - "type": "string" } }, - "definitions": { - "Approval": { - "type": "object", - "required": [ - "expires", - "spender" - ], - "properties": { - "expires": { - "description": "When the Approval expires (maybe Expiration::never)", - "allOf": [ - { - "$ref": "#/definitions/Expiration" - } - ] - }, - "spender": { - "description": "Account that can transfer/send the token", - "type": "string" + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OwnerOfResponse", + "type": "object", + "required": [ + "approvals", + "owner" + ], + "properties": { + "approvals": { + "description": "If set this address is approved to transfer/send the token as well", + "type": "array", + "items": { + "$ref": "#/definitions/Approval" } + }, + "owner": { + "description": "Owner of the token", + "type": "string" } }, - "Expiration": { - "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", - "oneOf": [ - { - "description": "AtHeight will expire when `env.block.height` >= height", - "type": "object", - "required": [ - "at_height" - ], - "properties": { - "at_height": { - "type": "integer", - "format": "uint64", - "minimum": 0 - } + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] }, - "additionalProperties": false - }, - { - "description": "AtTime will expire when `env.block.time` >= time", - "type": "object", - "required": [ - "at_time" - ], - "properties": { - "at_time": { - "$ref": "#/definitions/Timestamp" - } + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + } + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "description": "Never will never expire. Used to express the empty variant", - "type": "object", - "required": [ - "never" - ], - "properties": { - "never": { - "type": "object" - } + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false }, - "additionalProperties": false - } - ] - }, - "Timestamp": { - "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", - "allOf": [ - { - "$ref": "#/definitions/Uint64" - } - ] - }, - "Uint64": { - "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", - "type": "string" - } - } - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "QueryMsg", - "oneOf": [ - { - "type": "object", - "required": [ - "owner_of" - ], - "properties": { - "owner_of": { - "type": "object", - "required": [ - "token_id" - ], - "properties": { - "include_expired": { - "type": [ - "boolean", - "null" - ] + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } }, - "token_id": { - "type": "string" + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "owner_of" + ], + "properties": { + "owner_of": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "include_expired": { + "type": [ + "boolean", + "null" + ] + }, + "token_id": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "approval" - ], - "properties": { - "approval": { - "type": "object", - "required": [ - "spender", - "token_id" - ], - "properties": { - "include_expired": { - "type": [ - "boolean", - "null" - ] - }, - "spender": { - "type": "string" - }, - "token_id": { - "type": "string" + { + "type": "object", + "required": [ + "approval" + ], + "properties": { + "approval": { + "type": "object", + "required": [ + "spender", + "token_id" + ], + "properties": { + "include_expired": { + "type": [ + "boolean", + "null" + ] + }, + "spender": { + "type": "string" + }, + "token_id": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "approvals" - ], - "properties": { - "approvals": { - "type": "object", - "required": [ - "token_id" - ], - "properties": { - "include_expired": { - "type": [ - "boolean", - "null" - ] - }, - "token_id": { - "type": "string" + { + "type": "object", + "required": [ + "approvals" + ], + "properties": { + "approvals": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "include_expired": { + "type": [ + "boolean", + "null" + ] + }, + "token_id": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "all_operators" - ], - "properties": { - "all_operators": { - "type": "object", - "required": [ - "owner" - ], - "properties": { - "include_expired": { - "type": [ - "boolean", - "null" - ] - }, - "limit": { - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0 - }, - "owner": { - "type": "string" - }, - "start_after": { - "type": [ - "string", - "null" - ] + { + "type": "object", + "required": [ + "all_operators" + ], + "properties": { + "all_operators": { + "type": "object", + "required": [ + "owner" + ], + "properties": { + "include_expired": { + "type": [ + "boolean", + "null" + ] + }, + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0 + }, + "owner": { + "type": "string" + }, + "start_after": { + "type": [ + "string", + "null" + ] + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "num_tokens" - ], - "properties": { - "num_tokens": { - "type": "object" - } + { + "type": "object", + "required": [ + "num_tokens" + ], + "properties": { + "num_tokens": { + "type": "object" + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "contract_info" - ], - "properties": { - "contract_info": { - "type": "object" - } + { + "type": "object", + "required": [ + "contract_info" + ], + "properties": { + "contract_info": { + "type": "object" + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "nft_info" - ], - "properties": { - "nft_info": { - "type": "object", - "required": [ - "token_id" - ], - "properties": { - "token_id": { - "type": "string" + { + "type": "object", + "required": [ + "nft_info" + ], + "properties": { + "nft_info": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "token_id": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "all_nft_info" - ], - "properties": { - "all_nft_info": { - "type": "object", - "required": [ - "token_id" - ], - "properties": { - "include_expired": { - "type": [ - "boolean", - "null" - ] - }, - "token_id": { - "type": "string" + { + "type": "object", + "required": [ + "all_nft_info" + ], + "properties": { + "all_nft_info": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "include_expired": { + "type": [ + "boolean", + "null" + ] + }, + "token_id": { + "type": "string" + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "tokens" - ], - "properties": { - "tokens": { - "type": "object", - "required": [ - "owner" - ], - "properties": { - "limit": { - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0 - }, - "owner": { - "type": "string" - }, - "start_after": { - "type": [ - "string", - "null" - ] + { + "type": "object", + "required": [ + "tokens" + ], + "properties": { + "tokens": { + "type": "object", + "required": [ + "owner" + ], + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0 + }, + "owner": { + "type": "string" + }, + "start_after": { + "type": [ + "string", + "null" + ] + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "all_tokens" - ], - "properties": { - "all_tokens": { - "type": "object", - "properties": { - "limit": { - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0 - }, - "start_after": { - "type": [ - "string", - "null" - ] + { + "type": "object", + "required": [ + "all_tokens" + ], + "properties": { + "all_tokens": { + "type": "object", + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0 + }, + "start_after": { + "type": [ + "string", + "null" + ] + } } } - } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "minter" - ], - "properties": { - "minter": { - "type": "object" - } + { + "type": "object", + "required": [ + "minter" + ], + "properties": { + "minter": { + "type": "object" + } + }, + "additionalProperties": false }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "collection_info" - ], - "properties": { - "collection_info": { - "type": "object" + { + "type": "object", + "required": [ + "collection_info" + ], + "properties": { + "collection_info": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TokensResponse", + "type": "object", + "required": [ + "tokens" + ], + "properties": { + "tokens": { + "description": "Contains all token_ids in lexicographical ordering If there are more than `limit`, use `start_from` in future queries to achieve pagination.", + "type": "array", + "items": { + "type": "string" } - }, - "additionalProperties": false - } - ] - }, - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "TokensResponse", - "type": "object", - "required": [ - "tokens" - ], - "properties": { - "tokens": { - "description": "Contains all token_ids in lexicographical ordering If there are more than `limit`, use `start_from` in future queries to achieve pagination.", - "type": "array", - "items": { - "type": "string" } } } - } -] \ No newline at end of file + ] +} \ No newline at end of file From 28e393701bdf630ff99ba395fbd25643679665ba Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 5 Sep 2022 21:54:37 -0700 Subject: [PATCH 022/287] types --- packages/ts-codegen/types/src/types.d.ts | 15 +++++++++++++++ packages/ts-codegen/types/src/utils/schemas.d.ts | 10 ++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/packages/ts-codegen/types/src/types.d.ts b/packages/ts-codegen/types/src/types.d.ts index cb0ff5c3..e390180c 100644 --- a/packages/ts-codegen/types/src/types.d.ts +++ b/packages/ts-codegen/types/src/types.d.ts @@ -1 +1,16 @@ +import { JSONSchema } from "wasm-ast-types"; +interface KeyedSchema { + [key: string]: JSONSchema; +} +export interface IDLObject { + contract_name: string; + contract_version: string; + idl_version: string; + instantiate: JSONSchema; + execute: JSONSchema; + query: JSONSchema; + migrate: JSONSchema; + sudo: JSONSchema; + responses: KeyedSchema; +} export {}; diff --git a/packages/ts-codegen/types/src/utils/schemas.d.ts b/packages/ts-codegen/types/src/utils/schemas.d.ts index f50f1b1d..ba6ec91e 100644 --- a/packages/ts-codegen/types/src/utils/schemas.d.ts +++ b/packages/ts-codegen/types/src/utils/schemas.d.ts @@ -1,12 +1,14 @@ import { JSONSchema } from 'wasm-ast-types'; +import { IDLObject } from '../types'; interface ReadSchemaOpts { schemaDir: string; - schemaOptions?: { - packed?: boolean; - }; clean?: boolean; } -export declare const readSchemas: ({ schemaDir, schemaOptions, clean }: ReadSchemaOpts) => Promise; +interface ReadSchemasValue { + schemas: JSONSchema[]; + idlObject?: IDLObject; +} +export declare const readSchemas: ({ schemaDir, clean }: ReadSchemaOpts) => Promise; export declare const findQueryMsg: (schemas: any) => any; export declare const findExecuteMsg: (schemas: any) => any; export declare const findAndParseTypes: (schemas: any) => Promise<{}>; From bd618c3cbad6241017f09c79afd2b306a9ca8ee2 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Tue, 6 Sep 2022 20:59:16 -0700 Subject: [PATCH 023/287] chore(release): publish - @cosmwasm/ts-codegen@0.14.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 2c5b1a1d..c9500ce9 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.14.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.13.4...@cosmwasm/ts-codegen@0.14.0) (2022-09-07) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.13.4](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.13.3...@cosmwasm/ts-codegen@0.13.4) (2022-08-27) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 34a93fd9..4ccdeb76 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.13.4", + "version": "0.14.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From 949261d0702aba23ec8ef0755217cf3f4dc2dc34 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 9 Sep 2022 11:27:09 -0400 Subject: [PATCH 024/287] typings --- packages/ts-codegen/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 4ccdeb76..c03aaef5 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -7,7 +7,7 @@ "license": "SEE LICENSE IN LICENSE", "main": "main/index.js", "module": "module/index.js", - "typings": "types/index.d.ts", + "typings": "types/src/index.d.ts", "bin": { "cosmwasm-ts-codegen": "main/ts-codegen.js" }, @@ -96,4 +96,4 @@ "shelljs": "0.8.5", "wasm-ast-types": "^0.9.0" } -} +} \ No newline at end of file From 4aad0373cb937e7dce0798f7cda0c935ecde9cd8 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 9 Sep 2022 11:27:32 -0400 Subject: [PATCH 025/287] chore(release): publish - @cosmwasm/ts-codegen@0.14.1 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index c9500ce9..4ee19db1 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.14.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.14.0...@cosmwasm/ts-codegen@0.14.1) (2022-09-09) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.14.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.13.4...@cosmwasm/ts-codegen@0.14.0) (2022-09-07) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index c03aaef5..bfe76e8c 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.14.0", + "version": "0.14.1", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,4 +96,4 @@ "shelljs": "0.8.5", "wasm-ast-types": "^0.9.0" } -} \ No newline at end of file +} From 7016ebbab29a2662a3043ec9ab8701436da965b1 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Sun, 11 Sep 2022 13:22:36 -0400 Subject: [PATCH 026/287] switch to https --- README.md | 7 ++++--- packages/ts-codegen/src/commands/create-boilerplate.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index db0df7a0..6da8093d 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,8 @@ The quickest and easiest way to interact with CosmWasm Contracts. `@cosmwasm/ts- Clone your project and `cd` into your contracts folder ```sh -git clone git@github.com:public-awesome/stargaze-contracts.git -cd stargaze-contracts/contracts/sg721/ +git clone https://github.com/public-awesome/launchpad.git +cd launchpad/contracts/sg721-base/ ``` Run `cosmwasm-ts-codegen` to generate your code. @@ -58,7 +58,8 @@ cosmwasm-ts-codegen generate \ --plugin client \ --schema ./schema \ --out ./ts \ - --name SG721 + --name SG721 \ + --no-bundle ``` The output will be in the folder specified by `--out`, enjoy! diff --git a/packages/ts-codegen/src/commands/create-boilerplate.ts b/packages/ts-codegen/src/commands/create-boilerplate.ts index fb867eec..db36a30d 100644 --- a/packages/ts-codegen/src/commands/create-boilerplate.ts +++ b/packages/ts-codegen/src/commands/create-boilerplate.ts @@ -5,7 +5,7 @@ const glob = require('glob').sync; const fs = require('fs'); const path = require('path'); -const repo = 'git@github.com:pyramation/tmpl-cosmwasm-module.git'; +const repo = 'https://github.com/pyramation/tmpl-cosmwasm-module.git'; export default async argv => { if (!shell.which('git')) { shell.echo('Sorry, this script requires git'); From f1b4bb730177be7342b0867c162cc7edf5ce3a29 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Sun, 11 Sep 2022 13:22:45 -0400 Subject: [PATCH 027/287] chore(release): publish - @cosmwasm/ts-codegen@0.14.2 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 4ee19db1..85071cc8 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.14.2](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.14.1...@cosmwasm/ts-codegen@0.14.2) (2022-09-11) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.14.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.14.0...@cosmwasm/ts-codegen@0.14.1) (2022-09-09) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index bfe76e8c..3b4f6b83 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.14.1", + "version": "0.14.2", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From 883407abdee3389fdf794434fd6ec6b3319892a1 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 12 Sep 2022 22:13:37 -0400 Subject: [PATCH 028/287] readme --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6da8093d..00aba9a9 100644 --- a/README.md +++ b/README.md @@ -405,7 +405,28 @@ cd contracts/sg721/ cargo schema ``` ### Exporting Schemas -#### `cosmwasm_std` Examples +#### `cosmwasm v1.1` Example + +Using the new `write_api` method, you can export schemas: + +```rs +use cosmwasm_schema::write_api; + +pub use cw4::{AdminResponse, MemberListResponse, MemberResponse, TotalWeightResponse}; +pub use cw4_group::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; + +fn main() { + write_api! { + instantiate: InstantiateMsg, + execute: ExecuteMsg, + query: QueryMsg, + } +} +``` + +#### `cosmwasm_std` Example + +Here is a legacy example: ```rs use cosmwasm_std::{Addr, CosmosMsg, Empty}; From 9f6c2041a6533a0e1ffc637a34fb1165ad6a5062 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 12 Sep 2022 22:13:47 -0400 Subject: [PATCH 029/287] readme --- packages/ts-codegen/README.md | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index db0df7a0..00aba9a9 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -47,8 +47,8 @@ The quickest and easiest way to interact with CosmWasm Contracts. `@cosmwasm/ts- Clone your project and `cd` into your contracts folder ```sh -git clone git@github.com:public-awesome/stargaze-contracts.git -cd stargaze-contracts/contracts/sg721/ +git clone https://github.com/public-awesome/launchpad.git +cd launchpad/contracts/sg721-base/ ``` Run `cosmwasm-ts-codegen` to generate your code. @@ -58,7 +58,8 @@ cosmwasm-ts-codegen generate \ --plugin client \ --schema ./schema \ --out ./ts \ - --name SG721 + --name SG721 \ + --no-bundle ``` The output will be in the folder specified by `--out`, enjoy! @@ -404,7 +405,28 @@ cd contracts/sg721/ cargo schema ``` ### Exporting Schemas -#### `cosmwasm_std` Examples +#### `cosmwasm v1.1` Example + +Using the new `write_api` method, you can export schemas: + +```rs +use cosmwasm_schema::write_api; + +pub use cw4::{AdminResponse, MemberListResponse, MemberResponse, TotalWeightResponse}; +pub use cw4_group::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; + +fn main() { + write_api! { + instantiate: InstantiateMsg, + execute: ExecuteMsg, + query: QueryMsg, + } +} +``` + +#### `cosmwasm_std` Example + +Here is a legacy example: ```rs use cosmwasm_std::{Addr, CosmosMsg, Empty}; From 10c8be3191cc16e89df92030662227e267c2df34 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 12 Sep 2022 22:14:33 -0400 Subject: [PATCH 030/287] ts-codegen --- packages/ts-codegen/__tests__/cleanse.test.ts | 8 +- .../ts-codegen/__tests__/ts-codegen.test.ts | 182 ++++++++++-------- packages/ts-codegen/src/builder/builder.ts | 20 +- packages/ts-codegen/src/generators/client.ts | 11 +- .../src/generators/message-composer.ts | 11 +- .../ts-codegen/src/generators/react-query.ts | 9 +- packages/ts-codegen/src/generators/recoil.ts | 9 +- packages/ts-codegen/src/generators/types.ts | 9 +- packages/ts-codegen/src/types.ts | 16 -- packages/ts-codegen/src/utils/schemas.ts | 46 ++--- 10 files changed, 160 insertions(+), 161 deletions(-) delete mode 100644 packages/ts-codegen/src/types.ts diff --git a/packages/ts-codegen/__tests__/cleanse.test.ts b/packages/ts-codegen/__tests__/cleanse.test.ts index f360e747..c60a838d 100644 --- a/packages/ts-codegen/__tests__/cleanse.test.ts +++ b/packages/ts-codegen/__tests__/cleanse.test.ts @@ -10,8 +10,8 @@ it('sg721', async () => { const out = OUTPUT_DIR + '/sg721'; const schemaDir = FIXTURE_DIR + '/sg721/'; - const clean = await readSchemas({ schemaDir, argv: {}, clean: true }); - const orig = await readSchemas({ schemaDir, argv: {}, clean: false }); + const clean = await readSchemas({ schemaDir, clean: true }); + const orig = await readSchemas({ schemaDir, clean: false }); mkdirp(out); writeFileSync(out + '/orig.json', JSON.stringify(orig, null, 2)); @@ -23,8 +23,8 @@ it('daodao/cw-code-id-registry', async () => { const out = OUTPUT_DIR + '/daodao/cw-code-id-registry'; const schemaDir = FIXTURE_DIR + '/daodao/cw-code-id-registry/'; - const clean = await readSchemas({ schemaDir, argv: {}, clean: true }); - const orig = await readSchemas({ schemaDir, argv: {}, clean: false }); + const clean = await readSchemas({ schemaDir, clean: true }); + const orig = await readSchemas({ schemaDir, clean: false }); mkdirp(out); writeFileSync(out + '/orig.json', JSON.stringify(orig, null, 2)); diff --git a/packages/ts-codegen/__tests__/ts-codegen.test.ts b/packages/ts-codegen/__tests__/ts-codegen.test.ts index 75863f5c..cfdf2896 100644 --- a/packages/ts-codegen/__tests__/ts-codegen.test.ts +++ b/packages/ts-codegen/__tests__/ts-codegen.test.ts @@ -11,199 +11,229 @@ const OUTPUT_DIR = __dirname + '/../../../__output__'; it('optionalClient', async () => { const outopt = OUTPUT_DIR + '/vectis/factory-optional-client'; const schemaDir = FIXTURE_DIR + '/vectis/factory/'; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir }); - await generateReactQuery('Factory', schemas, outopt, { optionalClient: true }); + await generateReactQuery('Factory', contractInfo, outopt, { optionalClient: true }); }) it('v4Query', async () => { const outopt = OUTPUT_DIR + '/vectis/factory-v4-query'; const schemaDir = FIXTURE_DIR + '/vectis/factory/'; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir }); - await generateReactQuery('Factory', schemas, outopt, { version: 'v4' }); + await generateReactQuery('Factory', contractInfo, outopt, { version: 'v4' }); }) it('queryKeys', async () => { const outopt = OUTPUT_DIR + '/vectis/factory-query-keys'; const schemaDir = FIXTURE_DIR + '/vectis/factory/'; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir }); - await generateReactQuery('Factory', schemas, outopt, { queryKeys: true }); + await generateReactQuery('Factory', contractInfo, outopt, { queryKeys: true }); }) it('queryKeysOptionalClient', async () => { const outopt = OUTPUT_DIR + '/vectis/factory-query-keys-optional-client'; const schemaDir = FIXTURE_DIR + '/vectis/factory/'; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir }); - await generateReactQuery('Factory', schemas, outopt, { queryKeys: true, optionalClient: true }); + await generateReactQuery('Factory', contractInfo, outopt, { queryKeys: true, optionalClient: true }); }) it('useMutations', async () => { const outopt = OUTPUT_DIR + '/vectis/factory-w-mutations'; const schemaDir = FIXTURE_DIR + '/vectis/factory/'; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir }); - await generateReactQuery('Factory', schemas, outopt, { version: 'v4', mutations: true }); + await generateReactQuery('Factory', contractInfo, outopt, { version: 'v4', mutations: true }); }) it('vectis/factory', async () => { const out = OUTPUT_DIR + '/vectis/factory'; const schemaDir = FIXTURE_DIR + '/vectis/factory/'; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir }); - await generateTypes('Factory', schemas, out); - await generateClient('Factory', schemas, out); - await generateMessageComposer('Factory', schemas, out); - await generateRecoil('Factory', schemas, out); - await generateReactQuery('Factory', schemas, out); + await generateTypes('Factory', contractInfo, out); + await generateClient('Factory', contractInfo, out); + await generateMessageComposer('Factory', contractInfo, out); + await generateRecoil('Factory', contractInfo, out); + await generateReactQuery('Factory', contractInfo, out); }) it('vectis/govec', async () => { const out = OUTPUT_DIR + '/vectis/govec'; const schemaDir = FIXTURE_DIR + '/vectis/govec/'; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir }); - await generateTypes('Govec', schemas, out); - await generateClient('Govec', schemas, out); - await generateMessageComposer('Govec', schemas, out); - await generateRecoil('Govec', schemas, out); - await generateReactQuery('Govec', schemas, out); + await generateTypes('Govec', contractInfo, out); + await generateClient('Govec', contractInfo, out); + await generateMessageComposer('Govec', contractInfo, out); + await generateRecoil('Govec', contractInfo, out); + await generateReactQuery('Govec', contractInfo, out); }) it('vectis/proxy', async () => { const out = OUTPUT_DIR + '/vectis/proxy'; const schemaDir = FIXTURE_DIR + '/vectis/proxy/'; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir }); - await generateTypes('Proxy', schemas, out); - await generateClient('Proxy', schemas, out); - await generateMessageComposer('Proxy', schemas, out); - await generateRecoil('Proxy', schemas, out); - await generateReactQuery('Proxy', schemas, out); + await generateTypes('Proxy', contractInfo, out); + await generateClient('Proxy', contractInfo, out); + await generateMessageComposer('Proxy', contractInfo, out); + await generateRecoil('Proxy', contractInfo, out); + await generateReactQuery('Proxy', contractInfo, out); }) it('minter', async () => { const out = OUTPUT_DIR + '/minter'; const schemaDir = FIXTURE_DIR + '/minter/'; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir }); - await generateTypes('Minter', schemas, out); - await generateClient('Minter', schemas, out); - await generateMessageComposer('Minter', schemas, out); - await generateRecoil('Minter', schemas, out); - await generateReactQuery('Minter', schemas, out); + await generateTypes('Minter', contractInfo, out); + await generateClient('Minter', contractInfo, out); + await generateMessageComposer('Minter', contractInfo, out); + await generateRecoil('Minter', contractInfo, out); + await generateReactQuery('Minter', contractInfo, out); }) it('sg721', async () => { const out = OUTPUT_DIR + '/sg721'; const schemaDir = FIXTURE_DIR + '/sg721/'; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir }); - await generateTypes('Sg721', schemas, out); - await generateClient('Sg721', schemas, out); - await generateMessageComposer('Sg721', schemas, out); - await generateRecoil('Sg721', schemas, out); - await generateReactQuery('Sg721', schemas, out); + await generateTypes('Sg721', contractInfo, out); + await generateClient('Sg721', contractInfo, out); + await generateMessageComposer('Sg721', contractInfo, out); + await generateRecoil('Sg721', contractInfo, out); + await generateReactQuery('Sg721', contractInfo, out); }) it('cw-named-groups', async () => { const out = OUTPUT_DIR + '/daodao/cw-named-groups'; const schemaDir = FIXTURE_DIR + '/daodao/cw-named-groups/'; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir }); - await generateTypes('CwNamedGroups', schemas, out); - await generateClient('CwNamedGroups', schemas, out); - await generateMessageComposer('CwNamedGroups', schemas, out); - await generateRecoil('CwNamedGroups', schemas, out); - await generateReactQuery('CwNamedGroups', schemas, out); + await generateTypes('CwNamedGroups', contractInfo, out); + await generateClient('CwNamedGroups', contractInfo, out); + await generateMessageComposer('CwNamedGroups', contractInfo, out); + await generateRecoil('CwNamedGroups', contractInfo, out); + await generateReactQuery('CwNamedGroups', contractInfo, out); }) it('cw-proposal-single', async () => { const out = OUTPUT_DIR + '/daodao/cw-proposal-single'; const schemaDir = FIXTURE_DIR + '/daodao/cw-proposal-single/'; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir }); - await generateTypes('CwProposalSingle', schemas, out); - await generateClient('CwProposalSingle', schemas, out); - await generateMessageComposer('CwProposalSingle', schemas, out); - await generateRecoil('CwProposalSingle', schemas, out); - await generateReactQuery('CwProposalSingle', schemas, out); + await generateTypes('CwProposalSingle', contractInfo, out); + await generateClient('CwProposalSingle', contractInfo, out); + await generateMessageComposer('CwProposalSingle', contractInfo, out); + await generateRecoil('CwProposalSingle', contractInfo, out); + await generateReactQuery('CwProposalSingle', contractInfo, out); }) it('cw-admin-factory', async () => { const out = OUTPUT_DIR + '/daodao/cw-admin-factory'; const schemaDir = FIXTURE_DIR + '/daodao/cw-admin-factory/'; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir }); - await generateTypes('CwAdminFactory', schemas, out); - await generateClient('CwAdminFactory', schemas, out); - await generateMessageComposer('CwAdminFactory', schemas, out); - await generateRecoil('CwAdminFactory', schemas, out); - await generateReactQuery('CwAdminFactory', schemas, out); + await generateTypes('CwAdminFactory', contractInfo, out); + await generateClient('CwAdminFactory', contractInfo, out); + await generateMessageComposer('CwAdminFactory', contractInfo, out); + await generateRecoil('CwAdminFactory', contractInfo, out); + await generateReactQuery('CwAdminFactory', contractInfo, out); }) it('cw-code-id-registry', async () => { const out = OUTPUT_DIR + '/daodao/cw-code-id-registry'; const schemaDir = FIXTURE_DIR + '/daodao/cw-code-id-registry/'; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir }); - await generateTypes('CwCodeIdRegistry', schemas, out); - await generateClient('CwCodeIdRegistry', schemas, out); - await generateMessageComposer('CwCodeIdRegistry', schemas, out); - await generateRecoil('CwCodeIdRegistry', schemas, out); - await generateReactQuery('CwCodeIdRegistry', schemas, out); + await generateTypes('CwCodeIdRegistry', contractInfo, out); + await generateClient('CwCodeIdRegistry', contractInfo, out); + await generateMessageComposer('CwCodeIdRegistry', contractInfo, out); + await generateRecoil('CwCodeIdRegistry', contractInfo, out); + await generateReactQuery('CwCodeIdRegistry', contractInfo, out); }) it('idl-version/hackatom', async () => { const out = OUTPUT_DIR + '/idl-version/hackatom'; const schemaDir = FIXTURE_DIR + '/idl-version/hackatom/'; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir }); - await generateTypes('HackAtom', schemas, out); - await generateClient('HackAtom', schemas, out); - await generateMessageComposer('HackAtom', schemas, out); - await generateRecoil('HackAtom', schemas, out); - await generateReactQuery('HackAtom', schemas, out); + await generateTypes('HackAtom', contractInfo, out); + await generateClient('HackAtom', contractInfo, out); + await generateMessageComposer('HackAtom', contractInfo, out); + await generateRecoil('HackAtom', contractInfo, out); + await generateReactQuery('HackAtom', contractInfo, out); }) it('idl-version/cyberpunk', async () => { const out = OUTPUT_DIR + '/idl-version/cyberpunk'; const schemaDir = FIXTURE_DIR + '/idl-version/cyberpunk/'; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir }); - await generateTypes('CyberPunk', schemas, out); - await generateClient('CyberPunk', schemas, out); - await generateMessageComposer('CyberPunk', schemas, out); - await generateRecoil('CyberPunk', schemas, out); - await generateReactQuery('CyberPunk', schemas, out); + await generateTypes('CyberPunk', contractInfo, out); + await generateClient('CyberPunk', contractInfo, out); + await generateMessageComposer('CyberPunk', contractInfo, out); + await generateRecoil('CyberPunk', contractInfo, out); + await generateReactQuery('CyberPunk', contractInfo, out); +}) + +it('idl-version/cw4-group', async () => { + const out = OUTPUT_DIR + '/idl-version/cw4-group'; + const schemaDir = FIXTURE_DIR + '/idl-version/cw4-group/'; + + const contractInfo = await readSchemas({ + schemaDir + }); + + await generateTypes('Cw4Group', contractInfo, out); + await generateClient('Cw4Group', contractInfo, out); + await generateMessageComposer('Cw4Group', contractInfo, out); + await generateRecoil('Cw4Group', contractInfo, out); + await generateReactQuery('Cw4Group', contractInfo, out); +}) + +it('idl-version/cw3-fixed-multisig', async () => { + const out = OUTPUT_DIR + '/idl-version/cw3-fixed-multisig'; + const schemaDir = FIXTURE_DIR + '/idl-version/cw3-fixed-multisig/'; + + const contractInfo = await readSchemas({ + schemaDir + }); + + await generateTypes('Cw3FixedMultiSig', contractInfo, out); + await generateClient('Cw3FixedMultiSig', contractInfo, out); + await generateMessageComposer('Cw3FixedMultiSig', contractInfo, out); + await generateRecoil('Cw3FixedMultiSig', contractInfo, out); + await generateReactQuery('Cw3FixedMultiSig', contractInfo, out); }) diff --git a/packages/ts-codegen/src/builder/builder.ts b/packages/ts-codegen/src/builder/builder.ts index 9f15817c..c4ae7739 100644 --- a/packages/ts-codegen/src/builder/builder.ts +++ b/packages/ts-codegen/src/builder/builder.ts @@ -95,50 +95,50 @@ export class TSBuilder { async renderTypes(contract: ContractFile) { const { enabled, ...options } = this.options.types; if (!enabled) return; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir: contract.dir }); - const files = await generateTypes(contract.name, schemas, this.outPath, options); + const files = await generateTypes(contract.name, contractInfo, this.outPath, options); [].push.apply(this.files, files); } async renderClient(contract: ContractFile) { const { enabled, ...options } = this.options.client; if (!enabled) return; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir: contract.dir }); - const files = await generateClient(contract.name, schemas, this.outPath, options); + const files = await generateClient(contract.name, contractInfo, this.outPath, options); [].push.apply(this.files, files); } async renderRecoil(contract: ContractFile) { const { enabled, ...options } = this.options.recoil; if (!enabled) return; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir: contract.dir }); - const files = await generateRecoil(contract.name, schemas, this.outPath, options); + const files = await generateRecoil(contract.name, contractInfo, this.outPath, options); [].push.apply(this.files, files); } async renderReactQuery(contract: ContractFile) { const { enabled, ...options } = this.options.reactQuery; if (!enabled) return; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir: contract.dir }); - const files = await generateReactQuery(contract.name, schemas, this.outPath, options); + const files = await generateReactQuery(contract.name, contractInfo, this.outPath, options); [].push.apply(this.files, files); } async renderMessageComposer(contract: ContractFile) { const { enabled, ...options } = this.options.messageComposer; if (!enabled) return; - const { schemas } = await readSchemas({ + const contractInfo = await readSchemas({ schemaDir: contract.dir }); - const files = await generateMessageComposer(contract.name, schemas, this.outPath, options); + const files = await generateMessageComposer(contract.name, contractInfo, this.outPath, options); [].push.apply(this.files, files); } diff --git a/packages/ts-codegen/src/generators/client.ts b/packages/ts-codegen/src/generators/client.ts index 4b7354c7..b43bbdfe 100644 --- a/packages/ts-codegen/src/generators/client.ts +++ b/packages/ts-codegen/src/generators/client.ts @@ -6,22 +6,23 @@ import * as w from 'wasm-ast-types'; import * as t from '@babel/types'; import { writeFileSync } from 'fs'; import generate from "@babel/generator"; -import { getMessageProperties } from "wasm-ast-types"; -import { findAndParseTypes, findExecuteMsg, findQueryMsg, getDefinitionSchema } from '../utils'; +import { ContractInfo, getMessageProperties } from "wasm-ast-types"; +import { findAndParseTypes, findExecuteMsg, findQueryMsg } from '../utils'; import { RenderContext, TSClientOptions } from "wasm-ast-types"; import { BuilderFile } from "../builder"; export default async ( name: string, - schemas: any[], + contractInfo: ContractInfo, outPath: string, tsClientOptions?: TSClientOptions ): Promise => { - const context = new RenderContext(getDefinitionSchema(schemas), { + const { schemas } = contractInfo; + const context = new RenderContext(contractInfo, { client: tsClientOptions ?? {} }); - const options = context.options.client; + // const options = context.options.client; const localname = pascal(name) + '.client.ts'; const TypesFile = pascal(name) + '.types' diff --git a/packages/ts-codegen/src/generators/message-composer.ts b/packages/ts-codegen/src/generators/message-composer.ts index c068eadc..3c808675 100644 --- a/packages/ts-codegen/src/generators/message-composer.ts +++ b/packages/ts-codegen/src/generators/message-composer.ts @@ -6,22 +6,23 @@ import * as w from 'wasm-ast-types'; import * as t from '@babel/types'; import { writeFileSync } from 'fs'; import generate from "@babel/generator"; -import { getMessageProperties } from "wasm-ast-types"; -import { findAndParseTypes, findExecuteMsg, getDefinitionSchema } from "../utils"; +import { ContractInfo, getMessageProperties } from "wasm-ast-types"; +import { findAndParseTypes, findExecuteMsg } from "../utils"; import { RenderContext, MessageComposerOptions } from "wasm-ast-types"; import { BuilderFile } from "../builder"; export default async ( name: string, - schemas: any[], + contractInfo: ContractInfo, outPath: string, messageComposerOptions?: MessageComposerOptions ): Promise => { - const context = new RenderContext(getDefinitionSchema(schemas), { + const { schemas } = contractInfo; + const context = new RenderContext(contractInfo, { messageComposer: messageComposerOptions ?? {} }); - const options = context.options.messageComposer; + // const options = context.options.messageComposer; const localname = pascal(name) + '.message-composer.ts'; const TypesFile = pascal(name) + '.types'; diff --git a/packages/ts-codegen/src/generators/react-query.ts b/packages/ts-codegen/src/generators/react-query.ts index c2c83257..5ade22fa 100644 --- a/packages/ts-codegen/src/generators/react-query.ts +++ b/packages/ts-codegen/src/generators/react-query.ts @@ -7,17 +7,18 @@ import { RenderContext } from 'wasm-ast-types'; import * as t from '@babel/types'; import { writeFileSync } from 'fs'; import generate from "@babel/generator"; -import { findAndParseTypes, findExecuteMsg, findQueryMsg, getDefinitionSchema } from '../utils'; -import { getMessageProperties, ReactQueryOptions } from "wasm-ast-types"; +import { findAndParseTypes, findExecuteMsg, findQueryMsg } from '../utils'; +import { getMessageProperties, ReactQueryOptions, ContractInfo } from "wasm-ast-types"; import { BuilderFile } from "../builder"; export default async ( contractName: string, - schemas: any[], + contractInfo: ContractInfo, outPath: string, reactQueryOptions?: ReactQueryOptions ): Promise => { - const context = new RenderContext(getDefinitionSchema(schemas), { + const { schemas } = contractInfo; + const context = new RenderContext(contractInfo, { reactQuery: reactQueryOptions ?? {} }); const options = context.options.reactQuery; diff --git a/packages/ts-codegen/src/generators/recoil.ts b/packages/ts-codegen/src/generators/recoil.ts index 601b1891..7bd46303 100644 --- a/packages/ts-codegen/src/generators/recoil.ts +++ b/packages/ts-codegen/src/generators/recoil.ts @@ -6,18 +6,19 @@ import * as w from 'wasm-ast-types'; import * as t from '@babel/types'; import { writeFileSync } from 'fs'; import generate from "@babel/generator"; -import { findAndParseTypes, findQueryMsg, getDefinitionSchema } from "../utils"; -import { RenderContext, RecoilOptions } from "wasm-ast-types"; +import { findAndParseTypes, findQueryMsg } from "../utils"; +import { ContractInfo, RenderContext, RecoilOptions } from "wasm-ast-types"; import { BuilderFile } from "../builder"; export default async ( name: string, - schemas: any[], + contractInfo: ContractInfo, outPath: string, recoilOptions?: RecoilOptions ): Promise => { - const context = new RenderContext(getDefinitionSchema(schemas), { + const { schemas } = contractInfo; + const context = new RenderContext(contractInfo, { recoil: recoilOptions ?? {} }); const options = context.options.recoil; diff --git a/packages/ts-codegen/src/generators/types.ts b/packages/ts-codegen/src/generators/types.ts index d839c05d..972c9fe8 100644 --- a/packages/ts-codegen/src/generators/types.ts +++ b/packages/ts-codegen/src/generators/types.ts @@ -6,18 +6,19 @@ import * as t from '@babel/types'; import { writeFileSync } from 'fs'; import generate from "@babel/generator"; import { clean } from "../utils/clean"; -import { findAndParseTypes, findExecuteMsg, getDefinitionSchema } from '../utils'; -import { RenderContext, TSTypesOptions } from "wasm-ast-types"; +import { findAndParseTypes, findExecuteMsg } from '../utils'; +import { ContractInfo, RenderContext, TSTypesOptions } from "wasm-ast-types"; import { BuilderFile } from "../builder"; export default async ( name: string, - schemas: any[], + contractInfo: ContractInfo, outPath: string, tsTypesOptions?: TSTypesOptions ): Promise => { - const context = new RenderContext(getDefinitionSchema(schemas), { + const { schemas } = contractInfo; + const context = new RenderContext(contractInfo, { types: tsTypesOptions ?? {} }); const options = context.options.types; diff --git a/packages/ts-codegen/src/types.ts b/packages/ts-codegen/src/types.ts deleted file mode 100644 index cefe1c96..00000000 --- a/packages/ts-codegen/src/types.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { JSONSchema } from "wasm-ast-types"; - -interface KeyedSchema { - [key: string]: JSONSchema; -} -export interface IDLObject { - contract_name: string; - contract_version: string; - idl_version: string; - instantiate: JSONSchema; - execute: JSONSchema; - query: JSONSchema; - migrate: JSONSchema; - sudo: JSONSchema; - responses: KeyedSchema; -} \ No newline at end of file diff --git a/packages/ts-codegen/src/utils/schemas.ts b/packages/ts-codegen/src/utils/schemas.ts index fe6c1144..8d4ffcaa 100644 --- a/packages/ts-codegen/src/utils/schemas.ts +++ b/packages/ts-codegen/src/utils/schemas.ts @@ -3,21 +3,15 @@ import { readFileSync } from 'fs'; import { cleanse } from './cleanse'; import { compile } from '@pyramation/json-schema-to-typescript'; import { parser } from './parse'; -import { JSONSchema } from 'wasm-ast-types'; -import { IDLObject } from '../types'; - +import { ContractInfo, JSONSchema } from 'wasm-ast-types'; interface ReadSchemaOpts { schemaDir: string; clean?: boolean; }; -interface ReadSchemasValue { - schemas: JSONSchema[]; - idlObject?: IDLObject -}; export const readSchemas = async ({ schemaDir, clean = true -}: ReadSchemaOpts): Promise => { +}: ReadSchemaOpts): Promise => { const fn = clean ? cleanse : (str) => str; const files = glob(schemaDir + '/**/*.json'); const schemas = files @@ -61,13 +55,17 @@ export const readSchemas = async ({ // TODO use contract_name, etc. return { - schemas: Object.values(fn({ - instantiate, - execute, - query, - migrate, - sudo - })).filter(Boolean), + schemas: [ + ...Object.values(fn({ + instantiate, + execute, + query, + migrate, + sudo + })).filter(Boolean), + ...Object.values(fn({ ...responses })).filter(Boolean) + ], + responses, idlObject }; }; @@ -102,21 +100,3 @@ export const findAndParseTypes = async (schemas) => { const typeHash = parser(allTypes); return typeHash; }; - -export const getDefinitionSchema = (schemas: JSONSchema[]): JSONSchema => { - const aggregateSchema = { - definitions: { - // - } - }; - - schemas.forEach(schema => { - schema.definitions = schema.definitions || {}; - aggregateSchema.definitions = { - ...aggregateSchema.definitions, - ...schema.definitions - }; - }); - - return aggregateSchema; -}; \ No newline at end of file From b371dd9d74919eb53c3dff9c018928b2bbac5c3f Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 12 Sep 2022 22:14:44 -0400 Subject: [PATCH 031/287] ast types --- packages/wasm-ast-types/src/client/client.ts | 6 +- .../client/test/ts-client.arrays-ref.spec.ts | 4 +- .../src/client/test/ts-client.arrays.spec.ts | 4 +- .../test/ts-client.cw-named-groups.test.ts | 4 +- .../test/ts-client.cw-proposal-single.test.ts | 11 +- .../client/test/ts-client.empty-enums.spec.ts | 5 +- .../src/client/test/ts-client.issues.test.ts | 11 +- .../src/client/test/ts-client.sg721.spec.ts | 5 +- .../src/client/test/ts-client.spec.ts | 37 +- .../src/client/test/ts-client.vectis.spec.ts | 20 +- .../wasm-ast-types/src/context/context.ts | 48 +- .../message-composer/message-composer.spec.ts | 7 +- .../src/react-query/react-query.spec.ts | 12 +- .../src/react-query/react-query.ts | 418 +++++++++--------- .../wasm-ast-types/src/recoil/recoil.spec.ts | 7 +- packages/wasm-ast-types/src/recoil/recoil.ts | 11 +- packages/wasm-ast-types/src/utils/types.ts | 16 +- packages/wasm-ast-types/test-utils/index.ts | 12 + .../wasm-ast-types/types/context/context.d.ts | 28 +- .../types/react-query/react-query.d.ts | 5 +- .../wasm-ast-types/types/recoil/recoil.d.ts | 2 +- .../wasm-ast-types/types/utils/types.d.ts | 1 + 22 files changed, 380 insertions(+), 294 deletions(-) diff --git a/packages/wasm-ast-types/src/client/client.ts b/packages/wasm-ast-types/src/client/client.ts index 5e0d2685..ca01115c 100644 --- a/packages/wasm-ast-types/src/client/client.ts +++ b/packages/wasm-ast-types/src/client/client.ts @@ -15,7 +15,7 @@ import { ExecuteMsg } from '../types'; -import { getPropertyType, getType, createTypedObjectParams } from '../utils/types'; +import { getPropertyType, getType, createTypedObjectParams, getResponseType } from '../utils/types'; import { RenderContext } from '../context'; import { JSONSchema } from '../types'; import { identifier, propertySignature } from '../utils/babel'; @@ -87,7 +87,7 @@ export const createWasmQueryMethod = ( const underscoreName = Object.keys(jsonschema.properties)[0]; const methodName = camel(underscoreName); - const responseType = pascal(`${methodName}Response`); + const responseType = getResponseType(context, underscoreName); const obj = createTypedObjectParams( context, @@ -573,7 +573,7 @@ export const createQueryInterface = ( .map(jsonschema => { const underscoreName = Object.keys(jsonschema.properties)[0]; const methodName = camel(underscoreName); - const responseType = pascal(`${methodName}Response`); + const responseType = getResponseType(context, underscoreName); return createPropertyFunctionWithObjectParams( context, methodName, diff --git a/packages/wasm-ast-types/src/client/test/ts-client.arrays-ref.spec.ts b/packages/wasm-ast-types/src/client/test/ts-client.arrays-ref.spec.ts index 4ad17cc4..bd31bf19 100644 --- a/packages/wasm-ast-types/src/client/test/ts-client.arrays-ref.spec.ts +++ b/packages/wasm-ast-types/src/client/test/ts-client.arrays-ref.spec.ts @@ -7,9 +7,9 @@ import { createTypeInterface } from '../client' import { RenderContext } from '../../context'; -import { expectCode } from '../../../test-utils'; +import { expectCode, makeContext } from '../../../test-utils'; -const ctx = new RenderContext(message); +const ctx = makeContext(message); it('execute_msg_for__empty', () => { expectCode(createTypeInterface( diff --git a/packages/wasm-ast-types/src/client/test/ts-client.arrays.spec.ts b/packages/wasm-ast-types/src/client/test/ts-client.arrays.spec.ts index 79855d37..a991464b 100644 --- a/packages/wasm-ast-types/src/client/test/ts-client.arrays.spec.ts +++ b/packages/wasm-ast-types/src/client/test/ts-client.arrays.spec.ts @@ -7,9 +7,9 @@ import { createTypeInterface } from '../client' import { RenderContext } from '../../context'; -import { expectCode } from '../../../test-utils'; +import { expectCode, makeContext } from '../../../test-utils'; -const ctx = new RenderContext(message); +const ctx = makeContext(message); it('execute_msg_for__empty', () => { expectCode(createTypeInterface( diff --git a/packages/wasm-ast-types/src/client/test/ts-client.cw-named-groups.test.ts b/packages/wasm-ast-types/src/client/test/ts-client.cw-named-groups.test.ts index 0774b2bf..e88f1f52 100644 --- a/packages/wasm-ast-types/src/client/test/ts-client.cw-named-groups.test.ts +++ b/packages/wasm-ast-types/src/client/test/ts-client.cw-named-groups.test.ts @@ -7,9 +7,9 @@ import { createTypeInterface } from '../client' import { RenderContext } from '../../context'; -import { expectCode } from '../../../test-utils'; +import { expectCode, makeContext } from '../../../test-utils'; -const ctx = new RenderContext(execute_msg); +const ctx = makeContext(execute_msg); it('execute_msg', () => { expectCode(createTypeInterface( diff --git a/packages/wasm-ast-types/src/client/test/ts-client.cw-proposal-single.test.ts b/packages/wasm-ast-types/src/client/test/ts-client.cw-proposal-single.test.ts index d592ac8b..77ed57fa 100644 --- a/packages/wasm-ast-types/src/client/test/ts-client.cw-proposal-single.test.ts +++ b/packages/wasm-ast-types/src/client/test/ts-client.cw-proposal-single.test.ts @@ -7,11 +7,10 @@ import { createExecuteInterface, createTypeInterface } from '../client' -import { RenderContext } from '../../context'; -import { expectCode } from '../../../test-utils'; +import { expectCode, makeContext } from '../../../test-utils'; it('execute_msg_for', () => { - const ctx = new RenderContext(execute_msg); + const ctx = makeContext(execute_msg); expectCode(createTypeInterface( ctx, execute_msg @@ -20,7 +19,7 @@ it('execute_msg_for', () => { it('query classes', () => { - const ctx = new RenderContext(query_msg); + const ctx = makeContext(query_msg); expectCode(createQueryClass( ctx, 'SG721QueryClient', @@ -30,7 +29,7 @@ it('query classes', () => { }); it('execute classes array types', () => { - const ctx = new RenderContext(execute_msg); + const ctx = makeContext(execute_msg); expectCode(createExecuteClass( ctx, 'SG721Client', @@ -41,7 +40,7 @@ it('execute classes array types', () => { }); it('execute interfaces no extends', () => { - const ctx = new RenderContext(execute_msg); + const ctx = makeContext(execute_msg); expectCode(createExecuteInterface( ctx, 'SG721Instance', diff --git a/packages/wasm-ast-types/src/client/test/ts-client.empty-enums.spec.ts b/packages/wasm-ast-types/src/client/test/ts-client.empty-enums.spec.ts index 44e8a506..f6d5daa3 100644 --- a/packages/wasm-ast-types/src/client/test/ts-client.empty-enums.spec.ts +++ b/packages/wasm-ast-types/src/client/test/ts-client.empty-enums.spec.ts @@ -4,10 +4,9 @@ import { createQueryClass, createQueryInterface } from '../client' -import { RenderContext } from '../../context'; -import { expectCode } from '../../../test-utils'; +import { expectCode, makeContext } from '../../../test-utils'; -const ctx = new RenderContext(query_msg); +const ctx = makeContext(query_msg); it('query classes', () => { expectCode(createQueryClass( diff --git a/packages/wasm-ast-types/src/client/test/ts-client.issues.test.ts b/packages/wasm-ast-types/src/client/test/ts-client.issues.test.ts index 6aed0369..d1b70188 100644 --- a/packages/wasm-ast-types/src/client/test/ts-client.issues.test.ts +++ b/packages/wasm-ast-types/src/client/test/ts-client.issues.test.ts @@ -1,11 +1,10 @@ -import { globContracts } from '../../../test-utils' +import { globContracts, makeContext } from '../../../test-utils' import { createQueryClass, createExecuteClass, createExecuteInterface, createTypeInterface } from '../client' -import { RenderContext } from '../../context'; import { expectCode } from '../../../test-utils'; import cases from 'jest-in-case'; @@ -13,7 +12,7 @@ const contracts = globContracts('issues/55'); cases('execute_msg_for__empty', async opts => { - const ctx = new RenderContext(opts.content); + const ctx = makeContext(opts.content); expectCode(createTypeInterface( ctx, opts.content @@ -21,7 +20,7 @@ cases('execute_msg_for__empty', async opts => { }, contracts); cases('query classes', async opts => { - const ctx = new RenderContext(opts.content); + const ctx = makeContext(opts.content); expectCode(createQueryClass( ctx, 'SG721QueryClient', @@ -31,7 +30,7 @@ cases('query classes', async opts => { }, contracts); cases('execute class', async opts => { - const ctx = new RenderContext(opts.content); + const ctx = makeContext(opts.content); expectCode(createExecuteClass( ctx, 'SG721Client', @@ -42,7 +41,7 @@ cases('execute class', async opts => { }, contracts); cases('execute interface', async opts => { - const ctx = new RenderContext(opts.content); + const ctx = makeContext(opts.content); expectCode(createExecuteInterface( ctx, 'SG721Instance', diff --git a/packages/wasm-ast-types/src/client/test/ts-client.sg721.spec.ts b/packages/wasm-ast-types/src/client/test/ts-client.sg721.spec.ts index 489e96cb..69f2f971 100644 --- a/packages/wasm-ast-types/src/client/test/ts-client.sg721.spec.ts +++ b/packages/wasm-ast-types/src/client/test/ts-client.sg721.spec.ts @@ -5,10 +5,9 @@ import { createExecuteInterface, createTypeInterface } from '../client' -import { RenderContext } from '../../context'; -import { expectCode } from '../../../test-utils'; +import { expectCode, makeContext } from '../../../test-utils'; -const ctx = new RenderContext(execute_msg_for__empty); +const ctx = makeContext(execute_msg_for__empty); it('execute_msg_for__empty', () => { expectCode(createTypeInterface( diff --git a/packages/wasm-ast-types/src/client/test/ts-client.spec.ts b/packages/wasm-ast-types/src/client/test/ts-client.spec.ts index 4db182a9..e8decbb5 100644 --- a/packages/wasm-ast-types/src/client/test/ts-client.spec.ts +++ b/packages/wasm-ast-types/src/client/test/ts-client.spec.ts @@ -22,11 +22,10 @@ import { createTypeInterface } from '../client'; -import { RenderContext } from '../../context'; -import { expectCode } from '../../../test-utils'; +import { expectCode, makeContext } from '../../../test-utils'; it('approval_response', () => { - const ctx = new RenderContext(approval_response); + const ctx = makeContext(approval_response); expectCode(createTypeInterface( ctx, approval_response @@ -34,70 +33,70 @@ it('approval_response', () => { }); it('all_nft_info_response', () => { - const ctx = new RenderContext(all_nft_info_response); + const ctx = makeContext(all_nft_info_response); expectCode(createTypeInterface( ctx, all_nft_info_response )) }) it('approvals_response', () => { - const ctx = new RenderContext(approvals_response); + const ctx = makeContext(approvals_response); expectCode(createTypeInterface( ctx, approvals_response )) }) it('collection_info_response', () => { - const ctx = new RenderContext(collection_info_response); + const ctx = makeContext(collection_info_response); expectCode(createTypeInterface( ctx, collection_info_response )) }) it('contract_info_response', () => { - const ctx = new RenderContext(contract_info_response); + const ctx = makeContext(contract_info_response); expectCode(createTypeInterface( ctx, contract_info_response )) }) it('instantiate_msg', () => { - const ctx = new RenderContext(instantiate_msg); + const ctx = makeContext(instantiate_msg); expectCode(createTypeInterface( ctx, instantiate_msg )) }) it('nft_info_response', () => { - const ctx = new RenderContext(nft_info_response); + const ctx = makeContext(nft_info_response); expectCode(createTypeInterface( ctx, nft_info_response )) }) it('num_tokens_response', () => { - const ctx = new RenderContext(num_tokens_response); + const ctx = makeContext(num_tokens_response); expectCode(createTypeInterface( ctx, num_tokens_response )) }) it('operators_response', () => { - const ctx = new RenderContext(operators_response); + const ctx = makeContext(operators_response); expectCode(createTypeInterface( ctx, operators_response )) }) it('owner_of_response', () => { - const ctx = new RenderContext(owner_of_response); + const ctx = makeContext(owner_of_response); expectCode(createTypeInterface( ctx, owner_of_response )) }) it('tokens_response', () => { - const ctx = new RenderContext(tokens_response); + const ctx = makeContext(tokens_response); expectCode(createTypeInterface( ctx, tokens_response @@ -105,7 +104,7 @@ it('tokens_response', () => { }) it('query classes', () => { - const ctx = new RenderContext(query_msg); + const ctx = makeContext(query_msg); expectCode(createQueryClass( ctx, 'SG721QueryClient', @@ -115,7 +114,7 @@ it('query classes', () => { }); it('execute classes', () => { - const ctx = new RenderContext(execute_msg); + const ctx = makeContext(execute_msg); expectCode(createExecuteClass( ctx, 'SG721Client', @@ -126,7 +125,7 @@ it('execute classes', () => { }); it('execute classes no extends', () => { - const ctx = new RenderContext(execute_msg); + const ctx = makeContext(execute_msg); expectCode(createExecuteClass( ctx, 'SG721Client', @@ -137,7 +136,7 @@ it('execute classes no extends', () => { }); it('execute classes array types', () => { - const ctx = new RenderContext(execute_msg_named_groups); + const ctx = makeContext(execute_msg_named_groups); expectCode(createExecuteClass( ctx, 'SG721Client', @@ -148,7 +147,7 @@ it('execute classes array types', () => { }); it('execute interfaces no extends', () => { - const ctx = new RenderContext(execute_msg); + const ctx = makeContext(execute_msg); expectCode(createExecuteInterface( ctx, 'SG721Instance', @@ -158,7 +157,7 @@ it('execute interfaces no extends', () => { }); it('query interfaces', () => { - const ctx = new RenderContext(query_msg); + const ctx = makeContext(query_msg); expectCode(createQueryInterface( ctx, 'SG721ReadOnlyInstance', diff --git a/packages/wasm-ast-types/src/client/test/ts-client.vectis.spec.ts b/packages/wasm-ast-types/src/client/test/ts-client.vectis.spec.ts index cdfdc8c2..dde93637 100644 --- a/packages/wasm-ast-types/src/client/test/ts-client.vectis.spec.ts +++ b/packages/wasm-ast-types/src/client/test/ts-client.vectis.spec.ts @@ -12,10 +12,10 @@ import { } from '../client'; import { RenderContext } from '../../context'; -import { expectCode } from '../../../test-utils'; +import { expectCode, makeContext } from '../../../test-utils'; it('cosmos_msg_for__empty', () => { - const ctx = new RenderContext(cosmos_msg_for__empty); + const ctx = makeContext(cosmos_msg_for__empty); expectCode(createTypeInterface( ctx, cosmos_msg_for__empty @@ -23,7 +23,7 @@ it('cosmos_msg_for__empty', () => { }); it('execute_msg_for__empty', () => { - const ctx = new RenderContext(execute_msg_for__empty); + const ctx = makeContext(execute_msg_for__empty); expectCode(createTypeInterface( ctx, execute_msg_for__empty @@ -31,7 +31,7 @@ it('execute_msg_for__empty', () => { }) it('can_execute_relay_response', () => { - const ctx = new RenderContext(can_execute_relay_response); + const ctx = makeContext(can_execute_relay_response); expectCode(createTypeInterface( ctx, can_execute_relay_response @@ -39,7 +39,7 @@ it('can_execute_relay_response', () => { }) it('info_response', () => { - const ctx = new RenderContext(info_response); + const ctx = makeContext(info_response); expectCode(createTypeInterface( ctx, info_response @@ -47,7 +47,7 @@ it('info_response', () => { }) it('relay_transaction', () => { - const ctx = new RenderContext(relay_transaction); + const ctx = makeContext(relay_transaction); expectCode(createTypeInterface( ctx, relay_transaction @@ -56,7 +56,7 @@ it('relay_transaction', () => { it('query classes', () => { - const ctx = new RenderContext(cosmos_msg_for__empty); + const ctx = makeContext(cosmos_msg_for__empty); expectCode(createQueryClass( ctx, 'SG721QueryClient', @@ -66,7 +66,7 @@ it('query classes', () => { }); it('query classes', () => { - const ctx = new RenderContext(execute_msg_for__empty); + const ctx = makeContext(execute_msg_for__empty); expectCode(createQueryClass( ctx, 'SG721QueryClient', @@ -76,7 +76,7 @@ it('query classes', () => { }); it('execute classes array types', () => { - const ctx = new RenderContext(execute_msg_for__empty); + const ctx = makeContext(execute_msg_for__empty); expectCode(createExecuteClass( ctx, 'SG721Client', @@ -87,7 +87,7 @@ it('execute classes array types', () => { }); it('execute interfaces no extends', () => { - const ctx = new RenderContext(execute_msg_for__empty); + const ctx = makeContext(execute_msg_for__empty); expectCode(createExecuteInterface( ctx, 'SG721Instance', diff --git a/packages/wasm-ast-types/src/context/context.ts b/packages/wasm-ast-types/src/context/context.ts index 6d81dd74..23ec6b25 100644 --- a/packages/wasm-ast-types/src/context/context.ts +++ b/packages/wasm-ast-types/src/context/context.ts @@ -27,6 +27,27 @@ export interface TSTypesOptions { } /// END Plugin Types + +interface KeyedSchema { + [key: string]: JSONSchema; +} +export interface IDLObject { + contract_name: string; + contract_version: string; + idl_version: string; + instantiate: JSONSchema; + execute: JSONSchema; + query: JSONSchema; + migrate: JSONSchema; + sudo: JSONSchema; + responses: KeyedSchema; +} + +export interface ContractInfo { + schemas: JSONSchema[]; + responses?: Record; + idlObject?: IDLObject; +}; export interface RenderOptions { types?: TSTypesOptions; recoil?: RecoilOptions; @@ -36,7 +57,7 @@ export interface RenderOptions { } export interface RenderContext { - schema: JSONSchema; + contract: ContractInfo; options: RenderOptions; } @@ -64,14 +85,33 @@ export const defaultOptions: RenderOptions = { } }; +export const getDefinitionSchema = (schemas: JSONSchema[]): JSONSchema => { + const aggregateSchema = { + definitions: { + // + } + }; + + schemas.forEach(schema => { + schema.definitions = schema.definitions || {}; + aggregateSchema.definitions = { + ...aggregateSchema.definitions, + ...schema.definitions + }; + }); + + return aggregateSchema; +}; export class RenderContext implements RenderContext { - schema: JSONSchema; + contract: ContractInfo; utils: string[] = []; + schema: JSONSchema; constructor( - schema: JSONSchema, + contract: ContractInfo, options?: RenderOptions ) { - this.schema = schema; + this.contract = contract; + this.schema = getDefinitionSchema(contract.schemas); this.options = deepmerge(defaultOptions, options ?? {}); } refLookup($ref: string) { diff --git a/packages/wasm-ast-types/src/message-composer/message-composer.spec.ts b/packages/wasm-ast-types/src/message-composer/message-composer.spec.ts index 83c89714..5b840aaf 100644 --- a/packages/wasm-ast-types/src/message-composer/message-composer.spec.ts +++ b/packages/wasm-ast-types/src/message-composer/message-composer.spec.ts @@ -3,11 +3,10 @@ import { createMessageComposerClass, createMessageComposerInterface } from './message-composer' -import { RenderContext } from '../context'; -import { expectCode } from '../../test-utils'; +import { expectCode, makeContext } from '../../test-utils'; it('execute classes', () => { - const ctx = new RenderContext(execute_msg); + const ctx = makeContext(execute_msg); expectCode(createMessageComposerClass( ctx, 'SG721MessageComposer', @@ -17,7 +16,7 @@ it('execute classes', () => { }); it('createMessageComposerInterface', () => { - const ctx = new RenderContext(execute_msg); + const ctx = makeContext(execute_msg); expectCode(createMessageComposerInterface( ctx, 'SG721Message', diff --git a/packages/wasm-ast-types/src/react-query/react-query.spec.ts b/packages/wasm-ast-types/src/react-query/react-query.spec.ts index 6d5c2fca..1a2dcdfb 100644 --- a/packages/wasm-ast-types/src/react-query/react-query.spec.ts +++ b/packages/wasm-ast-types/src/react-query/react-query.spec.ts @@ -7,10 +7,10 @@ import { createReactQueryHooks, createReactQueryMutationHooks, } from './react-query' -import { expectCode } from '../../test-utils'; +import { expectCode, makeContext } from '../../test-utils'; -const execCtx = new RenderContext(execute_msg); -const queryCtx = new RenderContext(query_msg); +const execCtx = makeContext(execute_msg); +const queryCtx = makeContext(query_msg); it('createReactQueryHooks', () => { expectCode(t.program( @@ -25,7 +25,7 @@ it('createReactQueryHooks', () => { expectCode(t.program( createReactQueryHooks( { - context: new RenderContext(query_msg, { + context: makeContext(query_msg, { reactQuery: { optionalClient: true } @@ -38,7 +38,7 @@ it('createReactQueryHooks', () => { expectCode(t.program( createReactQueryHooks( { - context: new RenderContext(query_msg, { + context: makeContext(query_msg, { reactQuery: { version: 'v4' } @@ -51,7 +51,7 @@ it('createReactQueryHooks', () => { expectCode(t.program( createReactQueryHooks( { - context: new RenderContext(query_msg, { + context: makeContext(query_msg, { reactQuery: { optionalClient: true, version: 'v4' diff --git a/packages/wasm-ast-types/src/react-query/react-query.ts b/packages/wasm-ast-types/src/react-query/react-query.ts index b482934f..91935510 100644 --- a/packages/wasm-ast-types/src/react-query/react-query.ts +++ b/packages/wasm-ast-types/src/react-query/react-query.ts @@ -7,14 +7,12 @@ import { omitTypeReference, optionalConditionalExpression, propertySignature, - shorthandProperty, - typeRefOrUnionWithUndefined + shorthandProperty } from '../utils/babel'; -import { getParamsTypeAnnotation, getPropertyType } from '../utils/types'; +import { getParamsTypeAnnotation, getPropertyType, getResponseType } from '../utils/types'; import { ReactQueryOptions, RenderContext } from '../context'; import { JSONSchema } from '../types'; import { FIXED_EXECUTE_PARAMS } from '../client'; -import { ArgumentPlaceholder, JSXNamespacedName, SpreadElement } from '@babel/types'; interface ReactQueryHookQuery { context: RenderContext, @@ -42,28 +40,28 @@ export const createReactQueryHooks = ({ }: ReactQueryHooks) => { const options = context.options.reactQuery; - const genericQueryInterfaceName = `${pascal(contractName)}ReactQuery`; - const underscoreNames: string[] = getMessageProperties(queryMsg).map((schema) => (Object.keys(schema.properties)[0])) + const genericQueryInterfaceName = `${pascal(contractName)}ReactQuery`; + const underscoreNames: string[] = getMessageProperties(queryMsg).map((schema) => (Object.keys(schema.properties)[0])) - const body = [] + const body = [] - const queryKeysName = `${camel(contractName)}QueryKeys` - if (options.queryKeys) { - body.push( - createReactQueryKeys({ - context, - queryKeysName, - camelContractName: camel(contractName), - underscoreNames, - })) - } + const queryKeysName = `${camel(contractName)}QueryKeys` + if (options.queryKeys) { + body.push( + createReactQueryKeys({ + context, + queryKeysName, + camelContractName: camel(contractName), + underscoreNames, + })) + } - body.push( - createReactQueryHookGenericInterface({ - context, - QueryClient, - genericQueryInterfaceName, - })) + body.push( + createReactQueryHookGenericInterface({ + context, + QueryClient, + genericQueryInterfaceName, + })) body.push(...getMessageProperties(queryMsg) .reduce((m, schema) => { @@ -76,7 +74,7 @@ export const createReactQueryHooks = ({ // useCw3FlexMultisigListVotersQuery const hookName = `use${hookParamsTypeName}`; // listVotersResponse - const responseType = pascal(`${methodName}Response`); + const responseType = getResponseType(context, underscoreName); // cw3FlexMultisigListVoters const getterKey = camel(`${contractName}${pascal(methodName)}`); const jsonschema = schema.properties[underscoreName]; @@ -146,9 +144,9 @@ export const createReactQueryHook = ({ props = ['client', 'args', 'options']; } - const selectResponseGenericTypeName = 'TData'; + const selectResponseGenericTypeName = 'TData'; - const queryFunctionDeclaration = + const queryFunctionDeclaration = t.functionDeclaration( t.identifier(hookName), [ @@ -166,7 +164,7 @@ export const createReactQueryHook = ({ t.tsTypeAnnotation(t.tsTypeReference( t.identifier(hookParamsTypeName), t.tsTypeParameterInstantiation([ - t.tsTypeReference(t.identifier(selectResponseGenericTypeName)) + t.tsTypeReference(t.identifier(selectResponseGenericTypeName)) ]) )) ) @@ -178,7 +176,7 @@ export const createReactQueryHook = ({ callExpression( t.identifier('useQuery'), [ - generateUseQueryQueryKey({hookKeyName, queryKeysName, methodName, props, options }), + generateUseQueryQueryKey({ hookKeyName, queryKeysName, methodName, props, options }), t.arrowFunctionExpression( [], optionalConditionalExpression( @@ -260,18 +258,18 @@ export const createReactQueryHook = ({ ] ), - ) - - // Add the TData type parameters - queryFunctionDeclaration.typeParameters = t.tsTypeParameterDeclaration([ - t.tsTypeParameter( - undefined, - t.tSTypeReference(t.identifier(responseType)), - selectResponseGenericTypeName - ) + ) + + // Add the TData type parameters + queryFunctionDeclaration.typeParameters = t.tsTypeParameterDeclaration([ + t.tsTypeParameter( + undefined, + t.tSTypeReference(t.identifier(responseType)), + selectResponseGenericTypeName + ) ]) - return t.exportNamedDeclaration(queryFunctionDeclaration) + return t.exportNamedDeclaration(queryFunctionDeclaration) }; @@ -547,142 +545,142 @@ export const createReactQueryMutationHook = ({ }; function createReactQueryKeys({ - context, - queryKeysName, - camelContractName, - underscoreNames + context, + queryKeysName, + camelContractName, + underscoreNames }: { - context: RenderContext; - queryKeysName: string, - camelContractName: string; - underscoreNames: string[]; + context: RenderContext; + queryKeysName: string, + camelContractName: string; + underscoreNames: string[]; }) { - const options = context.options.reactQuery - - const contractAddressTypeAnnotation = t.tsTypeAnnotation( - options.optionalClient - ? t.tsUnionType([ - t.tsStringKeyword(), - t.tsUndefinedKeyword() - ]) - : t.tSStringKeyword() - ) + const options = context.options.reactQuery + + const contractAddressTypeAnnotation = t.tsTypeAnnotation( + options.optionalClient + ? t.tsUnionType([ + t.tsStringKeyword(), + t.tsUndefinedKeyword() + ]) + : t.tSStringKeyword() + ) - return t.exportNamedDeclaration( - t.variableDeclaration('const', [ - t.variableDeclarator( - t.identifier(queryKeysName), - t.objectExpression([ - // 1: contract - t.objectProperty( - t.identifier('contract'), - t.tSAsExpression( - t.arrayExpression([ + return t.exportNamedDeclaration( + t.variableDeclaration('const', [ + t.variableDeclarator( + t.identifier(queryKeysName), t.objectExpression([ - t.objectProperty( - t.identifier('contract'), - t.stringLiteral(camelContractName) - ) - ]) - ]), - t.tSTypeReference(t.identifier('const')) - ) - ), - // 2: address - t.objectProperty( - t.identifier('address'), - t.arrowFunctionExpression( - [ - identifier( - 'contractAddress', - contractAddressTypeAnnotation - ) - ], - t.tSAsExpression( - t.arrayExpression([ - t.objectExpression([ - // 1 - t.spreadElement( - t.memberExpression( - t.memberExpression( - t.identifier(queryKeysName), - t.identifier('contract') - ), - t.numericLiteral(0), - true // computed - ) + // 1: contract + t.objectProperty( + t.identifier('contract'), + t.tSAsExpression( + t.arrayExpression([ + t.objectExpression([ + t.objectProperty( + t.identifier('contract'), + t.stringLiteral(camelContractName) + ) + ]) + ]), + t.tSTypeReference(t.identifier('const')) + ) ), + // 2: address t.objectProperty( - t.identifier('address'), - t.identifier('contractAddress') - ) - ]) - ]), - t.tSTypeReference(t.identifier('const')) - ) - ) - ), - // 3: methods - ...underscoreNames.map((underscoreMethodName) => - t.objectProperty( - // key id is the camel method name - t.identifier(camel(underscoreMethodName)), - t.arrowFunctionExpression( - [ - identifier( - 'contractAddress', - contractAddressTypeAnnotation - ), - identifier( - 'args', - // Record - t.tSTypeAnnotation( - t.tsTypeReference( - t.identifier('Record'), - t.tsTypeParameterInstantiation([ - t.tsStringKeyword(), - t.tsUnknownKeyword() - ]) - ) + t.identifier('address'), + t.arrowFunctionExpression( + [ + identifier( + 'contractAddress', + contractAddressTypeAnnotation + ) + ], + t.tSAsExpression( + t.arrayExpression([ + t.objectExpression([ + // 1 + t.spreadElement( + t.memberExpression( + t.memberExpression( + t.identifier(queryKeysName), + t.identifier('contract') + ), + t.numericLiteral(0), + true // computed + ) + ), + t.objectProperty( + t.identifier('address'), + t.identifier('contractAddress') + ) + ]) + ]), + t.tSTypeReference(t.identifier('const')) + ) + ) ), - true // optional - ) - ], - t.tSAsExpression( - t.arrayExpression([ - t.objectExpression([ - //...cw3FlexMultisigQueryKeys.address(contractAddress)[0] - t.spreadElement( - t.memberExpression( - t.callExpression( - t.memberExpression( - t.identifier(queryKeysName), - t.identifier('address') - ), - [t.identifier('contractAddress')] - ), - t.numericLiteral(0), - true // computed + // 3: methods + ...underscoreNames.map((underscoreMethodName) => + t.objectProperty( + // key id is the camel method name + t.identifier(camel(underscoreMethodName)), + t.arrowFunctionExpression( + [ + identifier( + 'contractAddress', + contractAddressTypeAnnotation + ), + identifier( + 'args', + // Record + t.tSTypeAnnotation( + t.tsTypeReference( + t.identifier('Record'), + t.tsTypeParameterInstantiation([ + t.tsStringKeyword(), + t.tsUnknownKeyword() + ]) + ) + ), + true // optional + ) + ], + t.tSAsExpression( + t.arrayExpression([ + t.objectExpression([ + //...cw3FlexMultisigQueryKeys.address(contractAddress)[0] + t.spreadElement( + t.memberExpression( + t.callExpression( + t.memberExpression( + t.identifier(queryKeysName), + t.identifier('address') + ), + [t.identifier('contractAddress')] + ), + t.numericLiteral(0), + true // computed + ) + ), + // method: list_voters + t.objectProperty( + t.identifier('method'), + t.stringLiteral(underscoreMethodName) + ), + // args + shorthandProperty('args') + ]) + ]), + t.tSTypeReference(t.identifier('const')) + ) + ) ) - ), - // method: list_voters - t.objectProperty( - t.identifier('method'), - t.stringLiteral(underscoreMethodName) - ), - // args - shorthandProperty('args') - ]) - ]), - t.tSTypeReference(t.identifier('const')) - ) - ) + ) + ]) ) - ) ]) - ) - ]) - ) + ) } interface ReactQueryHookGenericInterface { @@ -708,15 +706,15 @@ function createReactQueryHookGenericInterface({ const typedUseQueryOptions = t.tsTypeReference( t.identifier('UseQueryOptions'), t.tsTypeParameterInstantiation( - [ - t.tsTypeReference( - t.identifier(genericResponseTypeName) - ), - t.tsTypeReference(t.identifier('Error')), - t.tsTypeReference( - t.identifier(genericSelectResponseTypeName) - ) - ]) + [ + t.tsTypeReference( + t.identifier(genericResponseTypeName) + ), + t.tsTypeReference(t.identifier('Error')), + t.tsTypeReference( + t.identifier(genericSelectResponseTypeName) + ) + ]) ) const body = [ @@ -761,14 +759,14 @@ function createReactQueryHookGenericInterface({ t.tsInterfaceDeclaration( t.identifier(genericQueryInterfaceName), t.tsTypeParameterDeclaration([ - // 1: TResponse - t.tsTypeParameter(undefined, undefined, genericResponseTypeName), - // 2: TData - t.tsTypeParameter( - undefined, - t.tSTypeReference(t.identifier(genericResponseTypeName)), - genericSelectResponseTypeName - ) + // 1: TResponse + t.tsTypeParameter(undefined, undefined, genericResponseTypeName), + // 2: TData + t.tsTypeParameter( + undefined, + t.tSTypeReference(t.identifier(genericResponseTypeName)), + genericSelectResponseTypeName + ) ]), [], t.tSInterfaceBody(body) @@ -814,7 +812,7 @@ export const createReactQueryHookInterface = ({ t.tsInterfaceDeclaration( t.identifier(hookParamsTypeName), t.tsTypeParameterDeclaration([ - t.tSTypeParameter(undefined, undefined, 'TData') + t.tSTypeParameter(undefined, undefined, 'TData') ]), [ t.tSExpressionWithTypeArguments( @@ -854,11 +852,11 @@ const getProps = ( } interface GenerateUseQueryQueryKeyParams { - hookKeyName: string; - queryKeysName: string; - methodName: string; - props: string[]; - options: ReactQueryOptions; + hookKeyName: string; + queryKeysName: string; + methodName: string; + props: string[]; + options: ReactQueryOptions; } const generateUseQueryQueryKey = ({ @@ -867,37 +865,37 @@ const generateUseQueryQueryKey = ({ methodName, props, options, - }: GenerateUseQueryQueryKeyParams): t.ArrayExpression | t.CallExpression => { - const { optionalClient, queryKeys } = options +}: GenerateUseQueryQueryKeyParams): t.ArrayExpression | t.CallExpression => { + const { optionalClient, queryKeys } = options - const hasArgs = props.includes('args') + const hasArgs = props.includes('args') - const contractAddressExpression = - t.optionalMemberExpression( - t.identifier('client'), - t.identifier('contractAddress'), - false, - optionalClient - ) + const contractAddressExpression = + t.optionalMemberExpression( + t.identifier('client'), + t.identifier('contractAddress'), + false, + optionalClient + ) - if (queryKeys) { + if (queryKeys) { - const callArgs: Array = [contractAddressExpression] + const callArgs: Array = [contractAddressExpression] - if (hasArgs) callArgs.push(t.identifier('args')) + if (hasArgs) callArgs.push(t.identifier('args')) - return t.callExpression( - t.memberExpression( - t.identifier(queryKeysName), - t.identifier(camel(methodName)) - ), - callArgs - ) - } + return t.callExpression( + t.memberExpression( + t.identifier(queryKeysName), + t.identifier(camel(methodName)) + ), + callArgs + ) + } const queryKey: Array = [ - t.stringLiteral(hookKeyName), - contractAddressExpression + t.stringLiteral(hookKeyName), + contractAddressExpression ]; if (hasArgs) { diff --git a/packages/wasm-ast-types/src/recoil/recoil.spec.ts b/packages/wasm-ast-types/src/recoil/recoil.spec.ts index 418d8b47..0719711d 100644 --- a/packages/wasm-ast-types/src/recoil/recoil.spec.ts +++ b/packages/wasm-ast-types/src/recoil/recoil.spec.ts @@ -6,16 +6,17 @@ import { createRecoilQueryClient, } from './recoil'; import { RenderContext } from '../context'; -import { expectCode } from '../../test-utils'; +import { expectCode, makeContext } from '../../test-utils'; -const ctx = new RenderContext(query_msg); +const ctx = makeContext(query_msg); it('selector', () => { expectCode(createRecoilSelector( ctx, 'SG721', 'SG721QueryClient', - 'governanceModules' + 'governanceModules', + 'GovernanceModulesResponse' )) }); diff --git a/packages/wasm-ast-types/src/recoil/recoil.ts b/packages/wasm-ast-types/src/recoil/recoil.ts index c669b5fc..fb4e02f8 100644 --- a/packages/wasm-ast-types/src/recoil/recoil.ts +++ b/packages/wasm-ast-types/src/recoil/recoil.ts @@ -2,7 +2,8 @@ import * as t from '@babel/types'; import { camel, pascal } from 'case'; import { callExpression, - getMessageProperties + getMessageProperties, + getResponseType } from '../utils'; import { QueryMsg } from '../types'; import { RenderContext } from '../context'; @@ -11,13 +12,13 @@ export const createRecoilSelector = ( context: RenderContext, keyPrefix: string, QueryClient: string, - methodName: string + methodName: string, + responseType: string ) => { context.addUtil('selectorFamily'); const selectorName = camel(`${methodName}Selector`); - const responseType = pascal(`${methodName}Response`); const getterKey = camel(`${keyPrefix}${pascal(methodName)}`); return t.exportNamedDeclaration( @@ -164,12 +165,14 @@ export const createRecoilSelectors = ( const underscoreName = Object.keys(schema.properties)[0]; const methodName = camel(underscoreName); + const responseType = getResponseType(context, underscoreName); return createRecoilSelector( context, keyPrefix, QueryClient, - methodName + methodName, + responseType ); }); diff --git a/packages/wasm-ast-types/src/utils/types.ts b/packages/wasm-ast-types/src/utils/types.ts index f7f31444..aa08f114 100644 --- a/packages/wasm-ast-types/src/utils/types.ts +++ b/packages/wasm-ast-types/src/utils/types.ts @@ -1,10 +1,23 @@ import * as t from '@babel/types'; -import { camel } from 'case'; +import { camel, pascal } from 'case'; import { propertySignature } from './babel'; import { TSTypeAnnotation } from '@babel/types'; import { RenderContext } from '../context'; import { JSONSchema } from '../types'; +export function getResponseType( + context: RenderContext, + underscoreName: string +) { + const methodName = camel(underscoreName); + return pascal( + context.contract?.responses?.[underscoreName]?.title + ?? + // after v1.1 is adopted, we can deprecate this and require the above response + `${methodName}Response` + ); +}; + const getTypeStrFromRef = ($ref) => { if ($ref?.startsWith('#/definitions/')) { return $ref.replace('#/definitions/', ''); @@ -162,6 +175,7 @@ export const getPropertyType = ( return { type, optional }; }; + export function getPropertySignatureFromProp( context: RenderContext, jsonschema: JSONSchema, diff --git a/packages/wasm-ast-types/test-utils/index.ts b/packages/wasm-ast-types/test-utils/index.ts index de0df777..1d489368 100644 --- a/packages/wasm-ast-types/test-utils/index.ts +++ b/packages/wasm-ast-types/test-utils/index.ts @@ -3,6 +3,7 @@ import { sync as glob } from 'glob'; import { readFileSync } from 'fs'; import { join } from 'path'; import { JSONSchema } from '../src/types'; +import { RenderContext, RenderOptions } from '../src/context'; export const expectCode = (ast) => { expect( @@ -16,6 +17,17 @@ export const printCode = (ast) => { ); } +export const makeContext = ( + schema: JSONSchema, + options?: RenderOptions, + responses?: Record +) => { + return new RenderContext({ + schemas: [schema], + responses + }, options) +}; + interface GlobContract { name: `/${string}.json`; content: JSONSchema; diff --git a/packages/wasm-ast-types/types/context/context.d.ts b/packages/wasm-ast-types/types/context/context.d.ts index 8dd73001..7464030c 100644 --- a/packages/wasm-ast-types/types/context/context.d.ts +++ b/packages/wasm-ast-types/types/context/context.d.ts @@ -20,6 +20,25 @@ export interface TSTypesOptions { enabled?: boolean; aliasExecuteMsg?: boolean; } +interface KeyedSchema { + [key: string]: JSONSchema; +} +export interface IDLObject { + contract_name: string; + contract_version: string; + idl_version: string; + instantiate: JSONSchema; + execute: JSONSchema; + query: JSONSchema; + migrate: JSONSchema; + sudo: JSONSchema; + responses: KeyedSchema; +} +export interface ContractInfo { + schemas: JSONSchema[]; + responses?: Record; + idlObject?: IDLObject; +} export interface RenderOptions { types?: TSTypesOptions; recoil?: RecoilOptions; @@ -28,15 +47,18 @@ export interface RenderOptions { reactQuery?: ReactQueryOptions; } export interface RenderContext { - schema: JSONSchema; + contract: ContractInfo; options: RenderOptions; } export declare const defaultOptions: RenderOptions; +export declare const getDefinitionSchema: (schemas: JSONSchema[]) => JSONSchema; export declare class RenderContext implements RenderContext { - schema: JSONSchema; + contract: ContractInfo; utils: string[]; - constructor(schema: JSONSchema, options?: RenderOptions); + schema: JSONSchema; + constructor(contract: ContractInfo, options?: RenderOptions); refLookup($ref: string): JSONSchema; addUtil(util: string): void; getImports(): any[]; } +export {}; diff --git a/packages/wasm-ast-types/types/react-query/react-query.d.ts b/packages/wasm-ast-types/types/react-query/react-query.d.ts index 47fcdb78..b4ecf402 100644 --- a/packages/wasm-ast-types/types/react-query/react-query.d.ts +++ b/packages/wasm-ast-types/types/react-query/react-query.d.ts @@ -7,6 +7,7 @@ interface ReactQueryHookQuery { hookName: string; hookParamsTypeName: string; hookKeyName: string; + queryKeysName: string; responseType: string; methodName: string; jsonschema: any; @@ -17,8 +18,8 @@ interface ReactQueryHooks { contractName: string; QueryClient: string; } -export declare const createReactQueryHooks: ({ context, queryMsg, contractName, QueryClient }: ReactQueryHooks) => t.ExportNamedDeclaration[]; -export declare const createReactQueryHook: ({ context, hookName, hookParamsTypeName, responseType, hookKeyName, methodName, jsonschema }: ReactQueryHookQuery) => t.ExportNamedDeclaration; +export declare const createReactQueryHooks: ({ context, queryMsg, contractName, QueryClient }: ReactQueryHooks) => any[]; +export declare const createReactQueryHook: ({ context, hookName, hookParamsTypeName, responseType, hookKeyName, queryKeysName, methodName, jsonschema }: ReactQueryHookQuery) => t.ExportNamedDeclaration; interface ReactQueryMutationHookInterface { context: RenderContext; ExecuteClient: string; diff --git a/packages/wasm-ast-types/types/recoil/recoil.d.ts b/packages/wasm-ast-types/types/recoil/recoil.d.ts index 9b035042..03ee4b37 100644 --- a/packages/wasm-ast-types/types/recoil/recoil.d.ts +++ b/packages/wasm-ast-types/types/recoil/recoil.d.ts @@ -1,7 +1,7 @@ import * as t from '@babel/types'; import { QueryMsg } from '../types'; import { RenderContext } from '../context'; -export declare const createRecoilSelector: (context: RenderContext, keyPrefix: string, QueryClient: string, methodName: string) => t.ExportNamedDeclaration; +export declare const createRecoilSelector: (context: RenderContext, keyPrefix: string, QueryClient: string, methodName: string, responseType: string) => t.ExportNamedDeclaration; export declare const createRecoilSelectors: (context: RenderContext, keyPrefix: string, QueryClient: string, queryMsg: QueryMsg) => any; export declare const createRecoilQueryClientType: () => { type: string; diff --git a/packages/wasm-ast-types/types/utils/types.d.ts b/packages/wasm-ast-types/types/utils/types.d.ts index f4e52129..bbde18ac 100644 --- a/packages/wasm-ast-types/types/utils/types.d.ts +++ b/packages/wasm-ast-types/types/utils/types.d.ts @@ -2,6 +2,7 @@ import * as t from '@babel/types'; import { TSTypeAnnotation } from '@babel/types'; import { RenderContext } from '../context'; import { JSONSchema } from '../types'; +export declare function getResponseType(context: RenderContext, underscoreName: string): string; export declare const getTypeFromRef: ($ref: any) => t.TSTypeReference; export declare const getType: (type: any) => t.TSBooleanKeyword | t.TSNumberKeyword | t.TSStringKeyword; export declare const getPropertyType: (context: RenderContext, schema: JSONSchema, prop: string) => { From a80e254e692ba6bfeb62aaacf008925eb7d76eee Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 12 Sep 2022 22:14:53 -0400 Subject: [PATCH 032/287] fixtures --- .../cw3-fixed-multisig.json | 3360 +++++++++++++++++ .../idl-version/cw4-group/cw4-group.json | 385 ++ .../Cw3FixedMultiSig.client.ts | 283 ++ .../Cw3FixedMultiSig.message-composer.ts | 144 + .../Cw3FixedMultiSig.react-query.ts | 130 + .../Cw3FixedMultiSig.recoil.ts | 136 + .../Cw3FixedMultiSig.types.ts | 254 ++ .../idl-version/cw4-group/Cw4Group.client.ts | 177 + .../cw4-group/Cw4Group.message-composer.ts | 130 + .../cw4-group/Cw4Group.react-query.ts | 66 + .../idl-version/cw4-group/Cw4Group.recoil.ts | 94 + .../idl-version/cw4-group/Cw4Group.types.ts | 64 + .../idl-version/cyberpunk/CyberPunk.client.ts | 6 +- .../cyberpunk/CyberPunk.message-composer.ts | 2 +- .../cyberpunk/CyberPunk.react-query.ts | 8 +- .../idl-version/cyberpunk/CyberPunk.recoil.ts | 4 +- .../idl-version/cyberpunk/CyberPunk.types.ts | 25 +- .../idl-version/hackatom/HackAtom.client.ts | 10 +- .../hackatom/HackAtom.message-composer.ts | 2 +- .../hackatom/HackAtom.react-query.ts | 14 +- .../idl-version/hackatom/HackAtom.recoil.ts | 6 +- .../idl-version/hackatom/HackAtom.types.ts | 14 + 22 files changed, 5287 insertions(+), 27 deletions(-) create mode 100644 __fixtures__/idl-version/cw3-fixed-multisig/cw3-fixed-multisig.json create mode 100644 __fixtures__/idl-version/cw4-group/cw4-group.json create mode 100644 __output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.client.ts create mode 100644 __output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.message-composer.ts create mode 100644 __output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.react-query.ts create mode 100644 __output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.recoil.ts create mode 100644 __output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.types.ts create mode 100644 __output__/idl-version/cw4-group/Cw4Group.client.ts create mode 100644 __output__/idl-version/cw4-group/Cw4Group.message-composer.ts create mode 100644 __output__/idl-version/cw4-group/Cw4Group.react-query.ts create mode 100644 __output__/idl-version/cw4-group/Cw4Group.recoil.ts create mode 100644 __output__/idl-version/cw4-group/Cw4Group.types.ts diff --git a/__fixtures__/idl-version/cw3-fixed-multisig/cw3-fixed-multisig.json b/__fixtures__/idl-version/cw3-fixed-multisig/cw3-fixed-multisig.json new file mode 100644 index 00000000..4cfc615d --- /dev/null +++ b/__fixtures__/idl-version/cw3-fixed-multisig/cw3-fixed-multisig.json @@ -0,0 +1,3360 @@ +{ + "contract_name": "cw3-fixed-multisig", + "contract_version": "0.14.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "max_voting_period", + "threshold", + "voters" + ], + "properties": { + "max_voting_period": { + "$ref": "#/definitions/Duration" + }, + "threshold": { + "$ref": "#/definitions/Threshold" + }, + "voters": { + "type": "array", + "items": { + "$ref": "#/definitions/Voter" + } + } + }, + "additionalProperties": false, + "definitions": { + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "Duration": { + "description": "Duration is a delta of time. You can add it to a BlockInfo or Expiration to move that further in the future. Note that an height-based Duration and a time-based Expiration cannot be combined", + "oneOf": [ + { + "type": "object", + "required": [ + "height" + ], + "properties": { + "height": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "description": "Time in seconds", + "type": "object", + "required": [ + "time" + ], + "properties": { + "time": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + ] + }, + "Threshold": { + "description": "This defines the different ways tallies can happen.\n\nThe total_weight used for calculating success as well as the weights of each individual voter used in tallying should be snapshotted at the beginning of the block at which the proposal starts (this is likely the responsibility of a correct cw4 implementation). See also `ThresholdResponse` in the cw3 spec.", + "oneOf": [ + { + "description": "Declares that a fixed weight of Yes votes is needed to pass. See `ThresholdResponse.AbsoluteCount` in the cw3 spec for details.", + "type": "object", + "required": [ + "absolute_count" + ], + "properties": { + "absolute_count": { + "type": "object", + "required": [ + "weight" + ], + "properties": { + "weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Declares a percentage of the total weight that must cast Yes votes in order for a proposal to pass. See `ThresholdResponse.AbsolutePercentage` in the cw3 spec for details.", + "type": "object", + "required": [ + "absolute_percentage" + ], + "properties": { + "absolute_percentage": { + "type": "object", + "required": [ + "percentage" + ], + "properties": { + "percentage": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Declares a `quorum` of the total votes that must participate in the election in order for the vote to be considered at all. See `ThresholdResponse.ThresholdQuorum` in the cw3 spec for details.", + "type": "object", + "required": [ + "threshold_quorum" + ], + "properties": { + "threshold_quorum": { + "type": "object", + "required": [ + "quorum", + "threshold" + ], + "properties": { + "quorum": { + "$ref": "#/definitions/Decimal" + }, + "threshold": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "Voter": { + "type": "object", + "required": [ + "addr", + "weight" + ], + "properties": { + "addr": { + "type": "string" + }, + "weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + } + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "propose" + ], + "properties": { + "propose": { + "type": "object", + "required": [ + "description", + "msgs", + "title" + ], + "properties": { + "description": { + "type": "string" + }, + "latest": { + "anyOf": [ + { + "$ref": "#/definitions/Expiration" + }, + { + "type": "null" + } + ] + }, + "msgs": { + "type": "array", + "items": { + "$ref": "#/definitions/CosmosMsg_for_Empty" + } + }, + "title": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "vote" + ], + "properties": { + "vote": { + "type": "object", + "required": [ + "proposal_id", + "vote" + ], + "properties": { + "proposal_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "vote": { + "$ref": "#/definitions/Vote" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "execute" + ], + "properties": { + "execute": { + "type": "object", + "required": [ + "proposal_id" + ], + "properties": { + "proposal_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "close" + ], + "properties": { + "close": { + "type": "object", + "required": [ + "proposal_id" + ], + "properties": { + "proposal_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "BankMsg": { + "description": "The message types of the bank module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto", + "oneOf": [ + { + "description": "Sends native tokens from the contract to the given address.\n\nThis is translated to a [MsgSend](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto#L19-L28). `from_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "send" + ], + "properties": { + "send": { + "type": "object", + "required": [ + "amount", + "to_address" + ], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "to_address": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This will burn the given coins from the contract's account. There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. Important if a contract controls significant token supply that must be retired.", + "type": "object", + "required": [ + "burn" + ], + "properties": { + "burn": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false + } + ] + }, + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec", + "type": "string" + }, + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "CosmosMsg_for_Empty": { + "oneOf": [ + { + "type": "object", + "required": [ + "bank" + ], + "properties": { + "bank": { + "$ref": "#/definitions/BankMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "$ref": "#/definitions/Empty" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "staking" + ], + "properties": { + "staking": { + "$ref": "#/definitions/StakingMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "distribution" + ], + "properties": { + "distribution": { + "$ref": "#/definitions/DistributionMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "wasm" + ], + "properties": { + "wasm": { + "$ref": "#/definitions/WasmMsg" + } + }, + "additionalProperties": false + } + ] + }, + "DistributionMsg": { + "description": "The message types of the distribution module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto", + "oneOf": [ + { + "description": "This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "set_withdraw_address" + ], + "properties": { + "set_withdraw_address": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "description": "The `withdraw_address`", + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "withdraw_delegator_reward" + ], + "properties": { + "withdraw_delegator_reward": { + "type": "object", + "required": [ + "validator" + ], + "properties": { + "validator": { + "description": "The `validator_address`", + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ] + }, + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false + }, + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "StakingMsg": { + "description": "The message types of the staking module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto", + "oneOf": [ + { + "description": "This is translated to a [MsgDelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "delegate" + ], + "properties": { + "delegate": { + "type": "object", + "required": [ + "amount", + "validator" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "validator": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [MsgUndelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "undelegate" + ], + "properties": { + "undelegate": { + "type": "object", + "required": [ + "amount", + "validator" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "validator": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [MsgBeginRedelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "redelegate" + ], + "properties": { + "redelegate": { + "type": "object", + "required": [ + "amount", + "dst_validator", + "src_validator" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "dst_validator": { + "type": "string" + }, + "src_validator": { + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + }, + "Vote": { + "type": "string", + "enum": [ + "yes", + "no", + "abstain", + "veto" + ] + }, + "WasmMsg": { + "description": "The message types of the wasm module.\n\nSee https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto", + "oneOf": [ + { + "description": "Dispatches a call to another contract at a known address (with known ABI).\n\nThis is translated to a [MsgExecuteContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L68-L78). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "execute" + ], + "properties": { + "execute": { + "type": "object", + "required": [ + "contract_addr", + "funds", + "msg" + ], + "properties": { + "contract_addr": { + "type": "string" + }, + "funds": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "msg": { + "description": "msg is the json-encoded ExecuteMsg struct (as raw Binary)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L47-L61). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "instantiate" + ], + "properties": { + "instantiate": { + "type": "object", + "required": [ + "code_id", + "funds", + "label", + "msg" + ], + "properties": { + "admin": { + "type": [ + "string", + "null" + ] + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "funds": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "label": { + "description": "A human-readbale label for the contract", + "type": "string" + }, + "msg": { + "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to customize behavior.\n\nOnly the contract admin (as defined in wasmd), if any, is able to make this call.\n\nThis is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "migrate" + ], + "properties": { + "migrate": { + "type": "object", + "required": [ + "contract_addr", + "msg", + "new_code_id" + ], + "properties": { + "contract_addr": { + "type": "string" + }, + "msg": { + "description": "msg is the json-encoded MigrateMsg struct that will be passed to the new code", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "new_code_id": { + "description": "the code_id of the new logic to place in the given contract", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Sets a new admin (for migrate) on the given contract. Fails if this contract is not currently admin of the target contract.", + "type": "object", + "required": [ + "update_admin" + ], + "properties": { + "update_admin": { + "type": "object", + "required": [ + "admin", + "contract_addr" + ], + "properties": { + "admin": { + "type": "string" + }, + "contract_addr": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Clears the admin on the given contract, so no more migration possible. Fails if this contract is not currently admin of the target contract.", + "type": "object", + "required": [ + "clear_admin" + ], + "properties": { + "clear_admin": { + "type": "object", + "required": [ + "contract_addr" + ], + "properties": { + "contract_addr": { + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ] + } + } + }, + "query": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "threshold" + ], + "properties": { + "threshold": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "proposal" + ], + "properties": { + "proposal": { + "type": "object", + "required": [ + "proposal_id" + ], + "properties": { + "proposal_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "list_proposals" + ], + "properties": { + "list_proposals": { + "type": "object", + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "start_after": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "reverse_proposals" + ], + "properties": { + "reverse_proposals": { + "type": "object", + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "start_before": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "vote" + ], + "properties": { + "vote": { + "type": "object", + "required": [ + "proposal_id", + "voter" + ], + "properties": { + "proposal_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "voter": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "list_votes" + ], + "properties": { + "list_votes": { + "type": "object", + "required": [ + "proposal_id" + ], + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "proposal_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "start_after": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "voter" + ], + "properties": { + "voter": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "list_voters" + ], + "properties": { + "list_voters": { + "type": "object", + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "start_after": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "migrate": null, + "sudo": null, + "responses": { + "list_proposals": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ProposalListResponse", + "type": "object", + "required": [ + "proposals" + ], + "properties": { + "proposals": { + "type": "array", + "items": { + "$ref": "#/definitions/ProposalResponse_for_Empty" + } + } + }, + "additionalProperties": false, + "definitions": { + "BankMsg": { + "description": "The message types of the bank module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto", + "oneOf": [ + { + "description": "Sends native tokens from the contract to the given address.\n\nThis is translated to a [MsgSend](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto#L19-L28). `from_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "send" + ], + "properties": { + "send": { + "type": "object", + "required": [ + "amount", + "to_address" + ], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "to_address": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This will burn the given coins from the contract's account. There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. Important if a contract controls significant token supply that must be retired.", + "type": "object", + "required": [ + "burn" + ], + "properties": { + "burn": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false + } + ] + }, + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec", + "type": "string" + }, + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "CosmosMsg_for_Empty": { + "oneOf": [ + { + "type": "object", + "required": [ + "bank" + ], + "properties": { + "bank": { + "$ref": "#/definitions/BankMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "$ref": "#/definitions/Empty" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "staking" + ], + "properties": { + "staking": { + "$ref": "#/definitions/StakingMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "distribution" + ], + "properties": { + "distribution": { + "$ref": "#/definitions/DistributionMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "wasm" + ], + "properties": { + "wasm": { + "$ref": "#/definitions/WasmMsg" + } + }, + "additionalProperties": false + } + ] + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "DistributionMsg": { + "description": "The message types of the distribution module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto", + "oneOf": [ + { + "description": "This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "set_withdraw_address" + ], + "properties": { + "set_withdraw_address": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "description": "The `withdraw_address`", + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "withdraw_delegator_reward" + ], + "properties": { + "withdraw_delegator_reward": { + "type": "object", + "required": [ + "validator" + ], + "properties": { + "validator": { + "description": "The `validator_address`", + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ] + }, + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false + }, + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "ProposalResponse_for_Empty": { + "description": "Note, if you are storing custom messages in the proposal, the querier needs to know what possible custom message types those are in order to parse the response", + "type": "object", + "required": [ + "description", + "expires", + "id", + "msgs", + "status", + "threshold", + "title" + ], + "properties": { + "description": { + "type": "string" + }, + "expires": { + "$ref": "#/definitions/Expiration" + }, + "id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "msgs": { + "type": "array", + "items": { + "$ref": "#/definitions/CosmosMsg_for_Empty" + } + }, + "status": { + "$ref": "#/definitions/Status" + }, + "threshold": { + "description": "This is the threshold that is applied to this proposal. Both the rules of the voting contract, as well as the total_weight of the voting group may have changed since this time. That means that the generic `Threshold{}` query does not provide valid information for existing proposals.", + "allOf": [ + { + "$ref": "#/definitions/ThresholdResponse" + } + ] + }, + "title": { + "type": "string" + } + }, + "additionalProperties": false + }, + "StakingMsg": { + "description": "The message types of the staking module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto", + "oneOf": [ + { + "description": "This is translated to a [MsgDelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "delegate" + ], + "properties": { + "delegate": { + "type": "object", + "required": [ + "amount", + "validator" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "validator": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [MsgUndelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "undelegate" + ], + "properties": { + "undelegate": { + "type": "object", + "required": [ + "amount", + "validator" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "validator": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [MsgBeginRedelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "redelegate" + ], + "properties": { + "redelegate": { + "type": "object", + "required": [ + "amount", + "dst_validator", + "src_validator" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "dst_validator": { + "type": "string" + }, + "src_validator": { + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ] + }, + "Status": { + "type": "string", + "enum": [ + "pending", + "open", + "rejected", + "passed", + "executed" + ] + }, + "ThresholdResponse": { + "description": "This defines the different ways tallies can happen. Every contract should support a subset of these, ideally all.\n\nThe total_weight used for calculating success as well as the weights of each individual voter used in tallying should be snapshotted at the beginning of the block at which the proposal starts (this is likely the responsibility of a correct cw4 implementation).", + "oneOf": [ + { + "description": "Declares that a fixed weight of yes votes is needed to pass. It does not matter how many no votes are cast, or how many do not vote, as long as `weight` yes votes are cast.\n\nThis is the simplest format and usually suitable for small multisigs of trusted parties, like 3 of 5. (weight: 3, total_weight: 5)\n\nA proposal of this type can pass early as soon as the needed weight of yes votes has been cast.", + "type": "object", + "required": [ + "absolute_count" + ], + "properties": { + "absolute_count": { + "type": "object", + "required": [ + "total_weight", + "weight" + ], + "properties": { + "total_weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Declares a percentage of the total weight that must cast Yes votes, in order for a proposal to pass. The passing weight is computed over the total weight minus the weight of the abstained votes.\n\nThis is useful for similar circumstances as `AbsoluteCount`, where we have a relatively small set of voters, and participation is required. It is understood that if the voting set (group) changes between different proposals that refer to the same group, each proposal will work with a different set of voter weights (the ones snapshotted at proposal creation), and the passing weight for each proposal will be computed based on the absolute percentage, times the total weights of the members at the time of each proposal creation.\n\nExample: we set `percentage` to 51%. Proposal 1 starts when there is a `total_weight` of 5. This will require 3 weight of Yes votes in order to pass. Later, the Proposal 2 starts but the `total_weight` of the group has increased to 9. That proposal will then automatically require 5 Yes of 9 to pass, rather than 3 yes of 9 as would be the case with `AbsoluteCount`.", + "type": "object", + "required": [ + "absolute_percentage" + ], + "properties": { + "absolute_percentage": { + "type": "object", + "required": [ + "percentage", + "total_weight" + ], + "properties": { + "percentage": { + "$ref": "#/definitions/Decimal" + }, + "total_weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "In addition to a `threshold`, declares a `quorum` of the total votes that must participate in the election in order for the vote to be considered at all. Within the votes that were cast, it requires `threshold` votes in favor. That is calculated by ignoring the Abstain votes (they count towards `quorum`, but do not influence `threshold`). That is, we calculate `Yes / (Yes + No + Veto)` and compare it with `threshold` to consider if the proposal was passed.\n\nIt is rather difficult for a proposal of this type to pass early. That can only happen if the required quorum has been already met, and there are already enough Yes votes for the proposal to pass.\n\n30% Yes votes, 10% No votes, and 20% Abstain would pass early if quorum <= 60% (who has cast votes) and if the threshold is <= 37.5% (the remaining 40% voting no => 30% yes + 50% no). Once the voting period has passed with no additional votes, that same proposal would be considered successful if quorum <= 60% and threshold <= 75% (percent in favor if we ignore abstain votes).\n\nThis type is more common in general elections, where participation is often expected to be low, and `AbsolutePercentage` would either be too high to pass anything, or allow low percentages to pass, independently of if there was high participation in the election or not.", + "type": "object", + "required": [ + "threshold_quorum" + ], + "properties": { + "threshold_quorum": { + "type": "object", + "required": [ + "quorum", + "threshold", + "total_weight" + ], + "properties": { + "quorum": { + "$ref": "#/definitions/Decimal" + }, + "threshold": { + "$ref": "#/definitions/Decimal" + }, + "total_weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + }, + "WasmMsg": { + "description": "The message types of the wasm module.\n\nSee https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto", + "oneOf": [ + { + "description": "Dispatches a call to another contract at a known address (with known ABI).\n\nThis is translated to a [MsgExecuteContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L68-L78). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "execute" + ], + "properties": { + "execute": { + "type": "object", + "required": [ + "contract_addr", + "funds", + "msg" + ], + "properties": { + "contract_addr": { + "type": "string" + }, + "funds": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "msg": { + "description": "msg is the json-encoded ExecuteMsg struct (as raw Binary)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L47-L61). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "instantiate" + ], + "properties": { + "instantiate": { + "type": "object", + "required": [ + "code_id", + "funds", + "label", + "msg" + ], + "properties": { + "admin": { + "type": [ + "string", + "null" + ] + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "funds": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "label": { + "description": "A human-readbale label for the contract", + "type": "string" + }, + "msg": { + "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to customize behavior.\n\nOnly the contract admin (as defined in wasmd), if any, is able to make this call.\n\nThis is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "migrate" + ], + "properties": { + "migrate": { + "type": "object", + "required": [ + "contract_addr", + "msg", + "new_code_id" + ], + "properties": { + "contract_addr": { + "type": "string" + }, + "msg": { + "description": "msg is the json-encoded MigrateMsg struct that will be passed to the new code", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "new_code_id": { + "description": "the code_id of the new logic to place in the given contract", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Sets a new admin (for migrate) on the given contract. Fails if this contract is not currently admin of the target contract.", + "type": "object", + "required": [ + "update_admin" + ], + "properties": { + "update_admin": { + "type": "object", + "required": [ + "admin", + "contract_addr" + ], + "properties": { + "admin": { + "type": "string" + }, + "contract_addr": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Clears the admin on the given contract, so no more migration possible. Fails if this contract is not currently admin of the target contract.", + "type": "object", + "required": [ + "clear_admin" + ], + "properties": { + "clear_admin": { + "type": "object", + "required": [ + "contract_addr" + ], + "properties": { + "contract_addr": { + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ] + } + } + }, + "list_voters": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VoterListResponse", + "type": "object", + "required": [ + "voters" + ], + "properties": { + "voters": { + "type": "array", + "items": { + "$ref": "#/definitions/VoterDetail" + } + } + }, + "additionalProperties": false, + "definitions": { + "VoterDetail": { + "type": "object", + "required": [ + "addr", + "weight" + ], + "properties": { + "addr": { + "type": "string" + }, + "weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + } + }, + "list_votes": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VoteListResponse", + "type": "object", + "required": [ + "votes" + ], + "properties": { + "votes": { + "type": "array", + "items": { + "$ref": "#/definitions/VoteInfo" + } + } + }, + "additionalProperties": false, + "definitions": { + "Vote": { + "type": "string", + "enum": [ + "yes", + "no", + "abstain", + "veto" + ] + }, + "VoteInfo": { + "description": "Returns the vote (opinion as well as weight counted) as well as the address of the voter who submitted it", + "type": "object", + "required": [ + "proposal_id", + "vote", + "voter", + "weight" + ], + "properties": { + "proposal_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "vote": { + "$ref": "#/definitions/Vote" + }, + "voter": { + "type": "string" + }, + "weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + } + }, + "proposal": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ProposalResponse_for_Empty", + "description": "Note, if you are storing custom messages in the proposal, the querier needs to know what possible custom message types those are in order to parse the response", + "type": "object", + "required": [ + "description", + "expires", + "id", + "msgs", + "status", + "threshold", + "title" + ], + "properties": { + "description": { + "type": "string" + }, + "expires": { + "$ref": "#/definitions/Expiration" + }, + "id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "msgs": { + "type": "array", + "items": { + "$ref": "#/definitions/CosmosMsg_for_Empty" + } + }, + "status": { + "$ref": "#/definitions/Status" + }, + "threshold": { + "description": "This is the threshold that is applied to this proposal. Both the rules of the voting contract, as well as the total_weight of the voting group may have changed since this time. That means that the generic `Threshold{}` query does not provide valid information for existing proposals.", + "allOf": [ + { + "$ref": "#/definitions/ThresholdResponse" + } + ] + }, + "title": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "BankMsg": { + "description": "The message types of the bank module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto", + "oneOf": [ + { + "description": "Sends native tokens from the contract to the given address.\n\nThis is translated to a [MsgSend](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto#L19-L28). `from_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "send" + ], + "properties": { + "send": { + "type": "object", + "required": [ + "amount", + "to_address" + ], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "to_address": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This will burn the given coins from the contract's account. There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. Important if a contract controls significant token supply that must be retired.", + "type": "object", + "required": [ + "burn" + ], + "properties": { + "burn": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false + } + ] + }, + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec", + "type": "string" + }, + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "CosmosMsg_for_Empty": { + "oneOf": [ + { + "type": "object", + "required": [ + "bank" + ], + "properties": { + "bank": { + "$ref": "#/definitions/BankMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "$ref": "#/definitions/Empty" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "staking" + ], + "properties": { + "staking": { + "$ref": "#/definitions/StakingMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "distribution" + ], + "properties": { + "distribution": { + "$ref": "#/definitions/DistributionMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "wasm" + ], + "properties": { + "wasm": { + "$ref": "#/definitions/WasmMsg" + } + }, + "additionalProperties": false + } + ] + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "DistributionMsg": { + "description": "The message types of the distribution module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto", + "oneOf": [ + { + "description": "This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "set_withdraw_address" + ], + "properties": { + "set_withdraw_address": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "description": "The `withdraw_address`", + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "withdraw_delegator_reward" + ], + "properties": { + "withdraw_delegator_reward": { + "type": "object", + "required": [ + "validator" + ], + "properties": { + "validator": { + "description": "The `validator_address`", + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ] + }, + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false + }, + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "StakingMsg": { + "description": "The message types of the staking module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto", + "oneOf": [ + { + "description": "This is translated to a [MsgDelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "delegate" + ], + "properties": { + "delegate": { + "type": "object", + "required": [ + "amount", + "validator" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "validator": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [MsgUndelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "undelegate" + ], + "properties": { + "undelegate": { + "type": "object", + "required": [ + "amount", + "validator" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "validator": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [MsgBeginRedelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "redelegate" + ], + "properties": { + "redelegate": { + "type": "object", + "required": [ + "amount", + "dst_validator", + "src_validator" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "dst_validator": { + "type": "string" + }, + "src_validator": { + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ] + }, + "Status": { + "type": "string", + "enum": [ + "pending", + "open", + "rejected", + "passed", + "executed" + ] + }, + "ThresholdResponse": { + "description": "This defines the different ways tallies can happen. Every contract should support a subset of these, ideally all.\n\nThe total_weight used for calculating success as well as the weights of each individual voter used in tallying should be snapshotted at the beginning of the block at which the proposal starts (this is likely the responsibility of a correct cw4 implementation).", + "oneOf": [ + { + "description": "Declares that a fixed weight of yes votes is needed to pass. It does not matter how many no votes are cast, or how many do not vote, as long as `weight` yes votes are cast.\n\nThis is the simplest format and usually suitable for small multisigs of trusted parties, like 3 of 5. (weight: 3, total_weight: 5)\n\nA proposal of this type can pass early as soon as the needed weight of yes votes has been cast.", + "type": "object", + "required": [ + "absolute_count" + ], + "properties": { + "absolute_count": { + "type": "object", + "required": [ + "total_weight", + "weight" + ], + "properties": { + "total_weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Declares a percentage of the total weight that must cast Yes votes, in order for a proposal to pass. The passing weight is computed over the total weight minus the weight of the abstained votes.\n\nThis is useful for similar circumstances as `AbsoluteCount`, where we have a relatively small set of voters, and participation is required. It is understood that if the voting set (group) changes between different proposals that refer to the same group, each proposal will work with a different set of voter weights (the ones snapshotted at proposal creation), and the passing weight for each proposal will be computed based on the absolute percentage, times the total weights of the members at the time of each proposal creation.\n\nExample: we set `percentage` to 51%. Proposal 1 starts when there is a `total_weight` of 5. This will require 3 weight of Yes votes in order to pass. Later, the Proposal 2 starts but the `total_weight` of the group has increased to 9. That proposal will then automatically require 5 Yes of 9 to pass, rather than 3 yes of 9 as would be the case with `AbsoluteCount`.", + "type": "object", + "required": [ + "absolute_percentage" + ], + "properties": { + "absolute_percentage": { + "type": "object", + "required": [ + "percentage", + "total_weight" + ], + "properties": { + "percentage": { + "$ref": "#/definitions/Decimal" + }, + "total_weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "In addition to a `threshold`, declares a `quorum` of the total votes that must participate in the election in order for the vote to be considered at all. Within the votes that were cast, it requires `threshold` votes in favor. That is calculated by ignoring the Abstain votes (they count towards `quorum`, but do not influence `threshold`). That is, we calculate `Yes / (Yes + No + Veto)` and compare it with `threshold` to consider if the proposal was passed.\n\nIt is rather difficult for a proposal of this type to pass early. That can only happen if the required quorum has been already met, and there are already enough Yes votes for the proposal to pass.\n\n30% Yes votes, 10% No votes, and 20% Abstain would pass early if quorum <= 60% (who has cast votes) and if the threshold is <= 37.5% (the remaining 40% voting no => 30% yes + 50% no). Once the voting period has passed with no additional votes, that same proposal would be considered successful if quorum <= 60% and threshold <= 75% (percent in favor if we ignore abstain votes).\n\nThis type is more common in general elections, where participation is often expected to be low, and `AbsolutePercentage` would either be too high to pass anything, or allow low percentages to pass, independently of if there was high participation in the election or not.", + "type": "object", + "required": [ + "threshold_quorum" + ], + "properties": { + "threshold_quorum": { + "type": "object", + "required": [ + "quorum", + "threshold", + "total_weight" + ], + "properties": { + "quorum": { + "$ref": "#/definitions/Decimal" + }, + "threshold": { + "$ref": "#/definitions/Decimal" + }, + "total_weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + }, + "WasmMsg": { + "description": "The message types of the wasm module.\n\nSee https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto", + "oneOf": [ + { + "description": "Dispatches a call to another contract at a known address (with known ABI).\n\nThis is translated to a [MsgExecuteContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L68-L78). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "execute" + ], + "properties": { + "execute": { + "type": "object", + "required": [ + "contract_addr", + "funds", + "msg" + ], + "properties": { + "contract_addr": { + "type": "string" + }, + "funds": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "msg": { + "description": "msg is the json-encoded ExecuteMsg struct (as raw Binary)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L47-L61). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "instantiate" + ], + "properties": { + "instantiate": { + "type": "object", + "required": [ + "code_id", + "funds", + "label", + "msg" + ], + "properties": { + "admin": { + "type": [ + "string", + "null" + ] + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "funds": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "label": { + "description": "A human-readbale label for the contract", + "type": "string" + }, + "msg": { + "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to customize behavior.\n\nOnly the contract admin (as defined in wasmd), if any, is able to make this call.\n\nThis is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "migrate" + ], + "properties": { + "migrate": { + "type": "object", + "required": [ + "contract_addr", + "msg", + "new_code_id" + ], + "properties": { + "contract_addr": { + "type": "string" + }, + "msg": { + "description": "msg is the json-encoded MigrateMsg struct that will be passed to the new code", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "new_code_id": { + "description": "the code_id of the new logic to place in the given contract", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Sets a new admin (for migrate) on the given contract. Fails if this contract is not currently admin of the target contract.", + "type": "object", + "required": [ + "update_admin" + ], + "properties": { + "update_admin": { + "type": "object", + "required": [ + "admin", + "contract_addr" + ], + "properties": { + "admin": { + "type": "string" + }, + "contract_addr": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Clears the admin on the given contract, so no more migration possible. Fails if this contract is not currently admin of the target contract.", + "type": "object", + "required": [ + "clear_admin" + ], + "properties": { + "clear_admin": { + "type": "object", + "required": [ + "contract_addr" + ], + "properties": { + "contract_addr": { + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ] + } + } + }, + "reverse_proposals": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ProposalListResponse", + "type": "object", + "required": [ + "proposals" + ], + "properties": { + "proposals": { + "type": "array", + "items": { + "$ref": "#/definitions/ProposalResponse_for_Empty" + } + } + }, + "additionalProperties": false, + "definitions": { + "BankMsg": { + "description": "The message types of the bank module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto", + "oneOf": [ + { + "description": "Sends native tokens from the contract to the given address.\n\nThis is translated to a [MsgSend](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto#L19-L28). `from_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "send" + ], + "properties": { + "send": { + "type": "object", + "required": [ + "amount", + "to_address" + ], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "to_address": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This will burn the given coins from the contract's account. There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. Important if a contract controls significant token supply that must be retired.", + "type": "object", + "required": [ + "burn" + ], + "properties": { + "burn": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false + } + ] + }, + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec", + "type": "string" + }, + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "CosmosMsg_for_Empty": { + "oneOf": [ + { + "type": "object", + "required": [ + "bank" + ], + "properties": { + "bank": { + "$ref": "#/definitions/BankMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "$ref": "#/definitions/Empty" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "staking" + ], + "properties": { + "staking": { + "$ref": "#/definitions/StakingMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "distribution" + ], + "properties": { + "distribution": { + "$ref": "#/definitions/DistributionMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "wasm" + ], + "properties": { + "wasm": { + "$ref": "#/definitions/WasmMsg" + } + }, + "additionalProperties": false + } + ] + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "DistributionMsg": { + "description": "The message types of the distribution module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto", + "oneOf": [ + { + "description": "This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "set_withdraw_address" + ], + "properties": { + "set_withdraw_address": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "description": "The `withdraw_address`", + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "withdraw_delegator_reward" + ], + "properties": { + "withdraw_delegator_reward": { + "type": "object", + "required": [ + "validator" + ], + "properties": { + "validator": { + "description": "The `validator_address`", + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ] + }, + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false + }, + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "ProposalResponse_for_Empty": { + "description": "Note, if you are storing custom messages in the proposal, the querier needs to know what possible custom message types those are in order to parse the response", + "type": "object", + "required": [ + "description", + "expires", + "id", + "msgs", + "status", + "threshold", + "title" + ], + "properties": { + "description": { + "type": "string" + }, + "expires": { + "$ref": "#/definitions/Expiration" + }, + "id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "msgs": { + "type": "array", + "items": { + "$ref": "#/definitions/CosmosMsg_for_Empty" + } + }, + "status": { + "$ref": "#/definitions/Status" + }, + "threshold": { + "description": "This is the threshold that is applied to this proposal. Both the rules of the voting contract, as well as the total_weight of the voting group may have changed since this time. That means that the generic `Threshold{}` query does not provide valid information for existing proposals.", + "allOf": [ + { + "$ref": "#/definitions/ThresholdResponse" + } + ] + }, + "title": { + "type": "string" + } + }, + "additionalProperties": false + }, + "StakingMsg": { + "description": "The message types of the staking module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto", + "oneOf": [ + { + "description": "This is translated to a [MsgDelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "delegate" + ], + "properties": { + "delegate": { + "type": "object", + "required": [ + "amount", + "validator" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "validator": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [MsgUndelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "undelegate" + ], + "properties": { + "undelegate": { + "type": "object", + "required": [ + "amount", + "validator" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "validator": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [MsgBeginRedelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "redelegate" + ], + "properties": { + "redelegate": { + "type": "object", + "required": [ + "amount", + "dst_validator", + "src_validator" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "dst_validator": { + "type": "string" + }, + "src_validator": { + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ] + }, + "Status": { + "type": "string", + "enum": [ + "pending", + "open", + "rejected", + "passed", + "executed" + ] + }, + "ThresholdResponse": { + "description": "This defines the different ways tallies can happen. Every contract should support a subset of these, ideally all.\n\nThe total_weight used for calculating success as well as the weights of each individual voter used in tallying should be snapshotted at the beginning of the block at which the proposal starts (this is likely the responsibility of a correct cw4 implementation).", + "oneOf": [ + { + "description": "Declares that a fixed weight of yes votes is needed to pass. It does not matter how many no votes are cast, or how many do not vote, as long as `weight` yes votes are cast.\n\nThis is the simplest format and usually suitable for small multisigs of trusted parties, like 3 of 5. (weight: 3, total_weight: 5)\n\nA proposal of this type can pass early as soon as the needed weight of yes votes has been cast.", + "type": "object", + "required": [ + "absolute_count" + ], + "properties": { + "absolute_count": { + "type": "object", + "required": [ + "total_weight", + "weight" + ], + "properties": { + "total_weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Declares a percentage of the total weight that must cast Yes votes, in order for a proposal to pass. The passing weight is computed over the total weight minus the weight of the abstained votes.\n\nThis is useful for similar circumstances as `AbsoluteCount`, where we have a relatively small set of voters, and participation is required. It is understood that if the voting set (group) changes between different proposals that refer to the same group, each proposal will work with a different set of voter weights (the ones snapshotted at proposal creation), and the passing weight for each proposal will be computed based on the absolute percentage, times the total weights of the members at the time of each proposal creation.\n\nExample: we set `percentage` to 51%. Proposal 1 starts when there is a `total_weight` of 5. This will require 3 weight of Yes votes in order to pass. Later, the Proposal 2 starts but the `total_weight` of the group has increased to 9. That proposal will then automatically require 5 Yes of 9 to pass, rather than 3 yes of 9 as would be the case with `AbsoluteCount`.", + "type": "object", + "required": [ + "absolute_percentage" + ], + "properties": { + "absolute_percentage": { + "type": "object", + "required": [ + "percentage", + "total_weight" + ], + "properties": { + "percentage": { + "$ref": "#/definitions/Decimal" + }, + "total_weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "In addition to a `threshold`, declares a `quorum` of the total votes that must participate in the election in order for the vote to be considered at all. Within the votes that were cast, it requires `threshold` votes in favor. That is calculated by ignoring the Abstain votes (they count towards `quorum`, but do not influence `threshold`). That is, we calculate `Yes / (Yes + No + Veto)` and compare it with `threshold` to consider if the proposal was passed.\n\nIt is rather difficult for a proposal of this type to pass early. That can only happen if the required quorum has been already met, and there are already enough Yes votes for the proposal to pass.\n\n30% Yes votes, 10% No votes, and 20% Abstain would pass early if quorum <= 60% (who has cast votes) and if the threshold is <= 37.5% (the remaining 40% voting no => 30% yes + 50% no). Once the voting period has passed with no additional votes, that same proposal would be considered successful if quorum <= 60% and threshold <= 75% (percent in favor if we ignore abstain votes).\n\nThis type is more common in general elections, where participation is often expected to be low, and `AbsolutePercentage` would either be too high to pass anything, or allow low percentages to pass, independently of if there was high participation in the election or not.", + "type": "object", + "required": [ + "threshold_quorum" + ], + "properties": { + "threshold_quorum": { + "type": "object", + "required": [ + "quorum", + "threshold", + "total_weight" + ], + "properties": { + "quorum": { + "$ref": "#/definitions/Decimal" + }, + "threshold": { + "$ref": "#/definitions/Decimal" + }, + "total_weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + }, + "WasmMsg": { + "description": "The message types of the wasm module.\n\nSee https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto", + "oneOf": [ + { + "description": "Dispatches a call to another contract at a known address (with known ABI).\n\nThis is translated to a [MsgExecuteContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L68-L78). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "execute" + ], + "properties": { + "execute": { + "type": "object", + "required": [ + "contract_addr", + "funds", + "msg" + ], + "properties": { + "contract_addr": { + "type": "string" + }, + "funds": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "msg": { + "description": "msg is the json-encoded ExecuteMsg struct (as raw Binary)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L47-L61). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "instantiate" + ], + "properties": { + "instantiate": { + "type": "object", + "required": [ + "code_id", + "funds", + "label", + "msg" + ], + "properties": { + "admin": { + "type": [ + "string", + "null" + ] + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "funds": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "label": { + "description": "A human-readbale label for the contract", + "type": "string" + }, + "msg": { + "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to customize behavior.\n\nOnly the contract admin (as defined in wasmd), if any, is able to make this call.\n\nThis is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "migrate" + ], + "properties": { + "migrate": { + "type": "object", + "required": [ + "contract_addr", + "msg", + "new_code_id" + ], + "properties": { + "contract_addr": { + "type": "string" + }, + "msg": { + "description": "msg is the json-encoded MigrateMsg struct that will be passed to the new code", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "new_code_id": { + "description": "the code_id of the new logic to place in the given contract", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Sets a new admin (for migrate) on the given contract. Fails if this contract is not currently admin of the target contract.", + "type": "object", + "required": [ + "update_admin" + ], + "properties": { + "update_admin": { + "type": "object", + "required": [ + "admin", + "contract_addr" + ], + "properties": { + "admin": { + "type": "string" + }, + "contract_addr": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Clears the admin on the given contract, so no more migration possible. Fails if this contract is not currently admin of the target contract.", + "type": "object", + "required": [ + "clear_admin" + ], + "properties": { + "clear_admin": { + "type": "object", + "required": [ + "contract_addr" + ], + "properties": { + "contract_addr": { + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ] + } + } + }, + "threshold": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThresholdResponse", + "description": "This defines the different ways tallies can happen. Every contract should support a subset of these, ideally all.\n\nThe total_weight used for calculating success as well as the weights of each individual voter used in tallying should be snapshotted at the beginning of the block at which the proposal starts (this is likely the responsibility of a correct cw4 implementation).", + "oneOf": [ + { + "description": "Declares that a fixed weight of yes votes is needed to pass. It does not matter how many no votes are cast, or how many do not vote, as long as `weight` yes votes are cast.\n\nThis is the simplest format and usually suitable for small multisigs of trusted parties, like 3 of 5. (weight: 3, total_weight: 5)\n\nA proposal of this type can pass early as soon as the needed weight of yes votes has been cast.", + "type": "object", + "required": [ + "absolute_count" + ], + "properties": { + "absolute_count": { + "type": "object", + "required": [ + "total_weight", + "weight" + ], + "properties": { + "total_weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Declares a percentage of the total weight that must cast Yes votes, in order for a proposal to pass. The passing weight is computed over the total weight minus the weight of the abstained votes.\n\nThis is useful for similar circumstances as `AbsoluteCount`, where we have a relatively small set of voters, and participation is required. It is understood that if the voting set (group) changes between different proposals that refer to the same group, each proposal will work with a different set of voter weights (the ones snapshotted at proposal creation), and the passing weight for each proposal will be computed based on the absolute percentage, times the total weights of the members at the time of each proposal creation.\n\nExample: we set `percentage` to 51%. Proposal 1 starts when there is a `total_weight` of 5. This will require 3 weight of Yes votes in order to pass. Later, the Proposal 2 starts but the `total_weight` of the group has increased to 9. That proposal will then automatically require 5 Yes of 9 to pass, rather than 3 yes of 9 as would be the case with `AbsoluteCount`.", + "type": "object", + "required": [ + "absolute_percentage" + ], + "properties": { + "absolute_percentage": { + "type": "object", + "required": [ + "percentage", + "total_weight" + ], + "properties": { + "percentage": { + "$ref": "#/definitions/Decimal" + }, + "total_weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "In addition to a `threshold`, declares a `quorum` of the total votes that must participate in the election in order for the vote to be considered at all. Within the votes that were cast, it requires `threshold` votes in favor. That is calculated by ignoring the Abstain votes (they count towards `quorum`, but do not influence `threshold`). That is, we calculate `Yes / (Yes + No + Veto)` and compare it with `threshold` to consider if the proposal was passed.\n\nIt is rather difficult for a proposal of this type to pass early. That can only happen if the required quorum has been already met, and there are already enough Yes votes for the proposal to pass.\n\n30% Yes votes, 10% No votes, and 20% Abstain would pass early if quorum <= 60% (who has cast votes) and if the threshold is <= 37.5% (the remaining 40% voting no => 30% yes + 50% no). Once the voting period has passed with no additional votes, that same proposal would be considered successful if quorum <= 60% and threshold <= 75% (percent in favor if we ignore abstain votes).\n\nThis type is more common in general elections, where participation is often expected to be low, and `AbsolutePercentage` would either be too high to pass anything, or allow low percentages to pass, independently of if there was high participation in the election or not.", + "type": "object", + "required": [ + "threshold_quorum" + ], + "properties": { + "threshold_quorum": { + "type": "object", + "required": [ + "quorum", + "threshold", + "total_weight" + ], + "properties": { + "quorum": { + "$ref": "#/definitions/Decimal" + }, + "threshold": { + "$ref": "#/definitions/Decimal" + }, + "total_weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + } + } + }, + "vote": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VoteResponse", + "type": "object", + "properties": { + "vote": { + "anyOf": [ + { + "$ref": "#/definitions/VoteInfo" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "Vote": { + "type": "string", + "enum": [ + "yes", + "no", + "abstain", + "veto" + ] + }, + "VoteInfo": { + "description": "Returns the vote (opinion as well as weight counted) as well as the address of the voter who submitted it", + "type": "object", + "required": [ + "proposal_id", + "vote", + "voter", + "weight" + ], + "properties": { + "proposal_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "vote": { + "$ref": "#/definitions/Vote" + }, + "voter": { + "type": "string" + }, + "weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + } + }, + "voter": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VoterResponse", + "type": "object", + "properties": { + "weight": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + } +} diff --git a/__fixtures__/idl-version/cw4-group/cw4-group.json b/__fixtures__/idl-version/cw4-group/cw4-group.json new file mode 100644 index 00000000..589e2fef --- /dev/null +++ b/__fixtures__/idl-version/cw4-group/cw4-group.json @@ -0,0 +1,385 @@ +{ + "contract_name": "cw4-group", + "contract_version": "0.14.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "members" + ], + "properties": { + "admin": { + "description": "The admin is the only account that can update the group state. Omit it to make the group immutable.", + "type": [ + "string", + "null" + ] + }, + "members": { + "type": "array", + "items": { + "$ref": "#/definitions/Member" + } + } + }, + "additionalProperties": false, + "definitions": { + "Member": { + "description": "A group member has a weight associated with them. This may all be equal, or may have meaning in the app that makes use of the group (eg. voting power)", + "type": "object", + "required": [ + "addr", + "weight" + ], + "properties": { + "addr": { + "type": "string" + }, + "weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + } + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "description": "Change the admin", + "type": "object", + "required": [ + "update_admin" + ], + "properties": { + "update_admin": { + "type": "object", + "properties": { + "admin": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "apply a diff to the existing members. remove is applied after add, so if an address is in both, it is removed", + "type": "object", + "required": [ + "update_members" + ], + "properties": { + "update_members": { + "type": "object", + "required": [ + "add", + "remove" + ], + "properties": { + "add": { + "type": "array", + "items": { + "$ref": "#/definitions/Member" + } + }, + "remove": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Add a new hook to be informed of all membership changes. Must be called by Admin", + "type": "object", + "required": [ + "add_hook" + ], + "properties": { + "add_hook": { + "type": "object", + "required": [ + "addr" + ], + "properties": { + "addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Remove a hook. Must be called by Admin", + "type": "object", + "required": [ + "remove_hook" + ], + "properties": { + "remove_hook": { + "type": "object", + "required": [ + "addr" + ], + "properties": { + "addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Member": { + "description": "A group member has a weight associated with them. This may all be equal, or may have meaning in the app that makes use of the group (eg. voting power)", + "type": "object", + "required": [ + "addr", + "weight" + ], + "properties": { + "addr": { + "type": "string" + }, + "weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + } + }, + "query": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "admin" + ], + "properties": { + "admin": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "total_weight" + ], + "properties": { + "total_weight": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "list_members" + ], + "properties": { + "list_members": { + "type": "object", + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "start_after": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "member" + ], + "properties": { + "member": { + "type": "object", + "required": [ + "addr" + ], + "properties": { + "addr": { + "type": "string" + }, + "at_height": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Shows all registered hooks.", + "type": "object", + "required": [ + "hooks" + ], + "properties": { + "hooks": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "migrate": null, + "sudo": null, + "responses": { + "admin": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AdminResponse", + "description": "Returned from Admin.query_admin()", + "type": "object", + "properties": { + "admin": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + "hooks": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "HooksResponse", + "type": "object", + "required": [ + "hooks" + ], + "properties": { + "hooks": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "list_members": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MemberListResponse", + "type": "object", + "required": [ + "members" + ], + "properties": { + "members": { + "type": "array", + "items": { + "$ref": "#/definitions/Member" + } + } + }, + "additionalProperties": false, + "definitions": { + "Member": { + "description": "A group member has a weight associated with them. This may all be equal, or may have meaning in the app that makes use of the group (eg. voting power)", + "type": "object", + "required": [ + "addr", + "weight" + ], + "properties": { + "addr": { + "type": "string" + }, + "weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + } + }, + "member": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MemberResponse", + "type": "object", + "properties": { + "weight": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + "total_weight": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TotalWeightResponse", + "type": "object", + "required": [ + "weight" + ], + "properties": { + "weight": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + } +} diff --git a/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.client.ts b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.client.ts new file mode 100644 index 00000000..6f780f31 --- /dev/null +++ b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.client.ts @@ -0,0 +1,283 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Duration, Threshold, Decimal, InstantiateMsg, Voter, ExecuteMsg, Expiration, Timestamp, Uint64, CosmosMsgForEmpty, BankMsg, Uint128, StakingMsg, DistributionMsg, WasmMsg, Binary, Vote, Coin, Empty, QueryMsg, Status, ThresholdResponse, ProposalListResponse, ProposalResponseForEmpty, VoterListResponse, VoterDetail, VoteListResponse, VoteInfo, VoteResponse, VoterResponse } from "./Cw3FixedMultiSig.types"; +export interface Cw3FixedMultiSigReadOnlyInterface { + contractAddress: string; + threshold: () => Promise; + proposal: ({ + proposalId + }: { + proposalId: number; + }) => Promise; + listProposals: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }) => Promise; + reverseProposals: ({ + limit, + startBefore + }: { + limit?: number; + startBefore?: number; + }) => Promise; + vote: ({ + proposalId, + voter + }: { + proposalId: number; + voter: string; + }) => Promise; + listVotes: ({ + limit, + proposalId, + startAfter + }: { + limit?: number; + proposalId: number; + startAfter?: string; + }) => Promise; + voter: ({ + address + }: { + address: string; + }) => Promise; + listVoters: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; +} +export class Cw3FixedMultiSigQueryClient implements Cw3FixedMultiSigReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.threshold = this.threshold.bind(this); + this.proposal = this.proposal.bind(this); + this.listProposals = this.listProposals.bind(this); + this.reverseProposals = this.reverseProposals.bind(this); + this.vote = this.vote.bind(this); + this.listVotes = this.listVotes.bind(this); + this.voter = this.voter.bind(this); + this.listVoters = this.listVoters.bind(this); + } + + threshold = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + threshold: {} + }); + }; + proposal = async ({ + proposalId + }: { + proposalId: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + proposal: { + proposal_id: proposalId + } + }); + }; + listProposals = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + list_proposals: { + limit, + start_after: startAfter + } + }); + }; + reverseProposals = async ({ + limit, + startBefore + }: { + limit?: number; + startBefore?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + reverse_proposals: { + limit, + start_before: startBefore + } + }); + }; + vote = async ({ + proposalId, + voter + }: { + proposalId: number; + voter: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + vote: { + proposal_id: proposalId, + voter + } + }); + }; + listVotes = async ({ + limit, + proposalId, + startAfter + }: { + limit?: number; + proposalId: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + list_votes: { + limit, + proposal_id: proposalId, + start_after: startAfter + } + }); + }; + voter = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + voter: { + address + } + }); + }; + listVoters = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + list_voters: { + limit, + start_after: startAfter + } + }); + }; +} +export interface Cw3FixedMultiSigInterface extends Cw3FixedMultiSigReadOnlyInterface { + contractAddress: string; + sender: string; + propose: ({ + description, + latest, + msgs, + title + }: { + description: string; + latest?: Expiration; + msgs: CosmosMsgForEmpty[]; + title: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + vote: ({ + proposalId, + vote + }: { + proposalId: number; + vote: Vote; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + execute: ({ + proposalId + }: { + proposalId: number; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + close: ({ + proposalId + }: { + proposalId: number; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; +} +export class Cw3FixedMultiSigClient extends Cw3FixedMultiSigQueryClient implements Cw3FixedMultiSigInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + super(client, contractAddress); + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.propose = this.propose.bind(this); + this.vote = this.vote.bind(this); + this.execute = this.execute.bind(this); + this.close = this.close.bind(this); + } + + propose = async ({ + description, + latest, + msgs, + title + }: { + description: string; + latest?: Expiration; + msgs: CosmosMsgForEmpty[]; + title: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + propose: { + description, + latest, + msgs, + title + } + }, fee, memo, funds); + }; + vote = async ({ + proposalId, + vote + }: { + proposalId: number; + vote: Vote; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + vote: { + proposal_id: proposalId, + vote + } + }, fee, memo, funds); + }; + execute = async ({ + proposalId + }: { + proposalId: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + execute: { + proposal_id: proposalId + } + }, fee, memo, funds); + }; + close = async ({ + proposalId + }: { + proposalId: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + close: { + proposal_id: proposalId + } + }, fee, memo, funds); + }; +} \ No newline at end of file diff --git a/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.message-composer.ts b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.message-composer.ts new file mode 100644 index 00000000..a191ec12 --- /dev/null +++ b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.message-composer.ts @@ -0,0 +1,144 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@cosmjs/encoding"; +import { Duration, Threshold, Decimal, InstantiateMsg, Voter, ExecuteMsg, Expiration, Timestamp, Uint64, CosmosMsgForEmpty, BankMsg, Uint128, StakingMsg, DistributionMsg, WasmMsg, Binary, Vote, Coin, Empty, QueryMsg, Status, ThresholdResponse, ProposalListResponse, ProposalResponseForEmpty, VoterListResponse, VoterDetail, VoteListResponse, VoteInfo, VoteResponse, VoterResponse } from "./Cw3FixedMultiSig.types"; +export interface Cw3FixedMultiSigMessage { + contractAddress: string; + sender: string; + propose: ({ + description, + latest, + msgs, + title + }: { + description: string; + latest?: Expiration; + msgs: CosmosMsgForEmpty[]; + title: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + vote: ({ + proposalId, + vote + }: { + proposalId: number; + vote: Vote; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + execute: ({ + proposalId + }: { + proposalId: number; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + close: ({ + proposalId + }: { + proposalId: number; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; +} +export class Cw3FixedMultiSigMessageComposer implements Cw3FixedMultiSigMessage { + sender: string; + contractAddress: string; + + constructor(sender: string, contractAddress: string) { + this.sender = sender; + this.contractAddress = contractAddress; + this.propose = this.propose.bind(this); + this.vote = this.vote.bind(this); + this.execute = this.execute.bind(this); + this.close = this.close.bind(this); + } + + propose = ({ + description, + latest, + msgs, + title + }: { + description: string; + latest?: Expiration; + msgs: CosmosMsgForEmpty[]; + title: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + propose: { + description, + latest, + msgs, + title + } + })), + funds + }) + }; + }; + vote = ({ + proposalId, + vote + }: { + proposalId: number; + vote: Vote; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + vote: { + proposal_id: proposalId, + vote + } + })), + funds + }) + }; + }; + execute = ({ + proposalId + }: { + proposalId: number; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + execute: { + proposal_id: proposalId + } + })), + funds + }) + }; + }; + close = ({ + proposalId + }: { + proposalId: number; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + close: { + proposal_id: proposalId + } + })), + funds + }) + }; + }; +} \ No newline at end of file diff --git a/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.react-query.ts b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.react-query.ts new file mode 100644 index 00000000..dd485541 --- /dev/null +++ b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.react-query.ts @@ -0,0 +1,130 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions, useQuery } from "react-query"; +import { Duration, Threshold, Decimal, InstantiateMsg, Voter, ExecuteMsg, Expiration, Timestamp, Uint64, CosmosMsgForEmpty, BankMsg, Uint128, StakingMsg, DistributionMsg, WasmMsg, Binary, Vote, Coin, Empty, QueryMsg, Status, ThresholdResponse, ProposalListResponse, ProposalResponseForEmpty, VoterListResponse, VoterDetail, VoteListResponse, VoteInfo, VoteResponse, VoterResponse } from "./Cw3FixedMultiSig.types"; +import { Cw3FixedMultiSigQueryClient } from "./Cw3FixedMultiSig.client"; +export interface Cw3FixedMultiSigReactQuery { + client: Cw3FixedMultiSigQueryClient; + options?: UseQueryOptions; +} +export interface Cw3FixedMultiSigListVotersQuery extends Cw3FixedMultiSigReactQuery { + args: { + limit?: number; + startAfter?: string; + }; +} +export function useCw3FixedMultiSigListVotersQuery({ + client, + args, + options +}: Cw3FixedMultiSigListVotersQuery) { + return useQuery(["cw3FixedMultiSigListVoters", client.contractAddress, JSON.stringify(args)], () => client.listVoters({ + limit: args.limit, + startAfter: args.startAfter + }), options); +} +export interface Cw3FixedMultiSigVoterQuery extends Cw3FixedMultiSigReactQuery { + args: { + address: string; + }; +} +export function useCw3FixedMultiSigVoterQuery({ + client, + args, + options +}: Cw3FixedMultiSigVoterQuery) { + return useQuery(["cw3FixedMultiSigVoter", client.contractAddress, JSON.stringify(args)], () => client.voter({ + address: args.address + }), options); +} +export interface Cw3FixedMultiSigListVotesQuery extends Cw3FixedMultiSigReactQuery { + args: { + limit?: number; + proposalId: number; + startAfter?: string; + }; +} +export function useCw3FixedMultiSigListVotesQuery({ + client, + args, + options +}: Cw3FixedMultiSigListVotesQuery) { + return useQuery(["cw3FixedMultiSigListVotes", client.contractAddress, JSON.stringify(args)], () => client.listVotes({ + limit: args.limit, + proposalId: args.proposalId, + startAfter: args.startAfter + }), options); +} +export interface Cw3FixedMultiSigVoteQuery extends Cw3FixedMultiSigReactQuery { + args: { + proposalId: number; + voter: string; + }; +} +export function useCw3FixedMultiSigVoteQuery({ + client, + args, + options +}: Cw3FixedMultiSigVoteQuery) { + return useQuery(["cw3FixedMultiSigVote", client.contractAddress, JSON.stringify(args)], () => client.vote({ + proposalId: args.proposalId, + voter: args.voter + }), options); +} +export interface Cw3FixedMultiSigReverseProposalsQuery extends Cw3FixedMultiSigReactQuery { + args: { + limit?: number; + startBefore?: number; + }; +} +export function useCw3FixedMultiSigReverseProposalsQuery({ + client, + args, + options +}: Cw3FixedMultiSigReverseProposalsQuery) { + return useQuery(["cw3FixedMultiSigReverseProposals", client.contractAddress, JSON.stringify(args)], () => client.reverseProposals({ + limit: args.limit, + startBefore: args.startBefore + }), options); +} +export interface Cw3FixedMultiSigListProposalsQuery extends Cw3FixedMultiSigReactQuery { + args: { + limit?: number; + startAfter?: number; + }; +} +export function useCw3FixedMultiSigListProposalsQuery({ + client, + args, + options +}: Cw3FixedMultiSigListProposalsQuery) { + return useQuery(["cw3FixedMultiSigListProposals", client.contractAddress, JSON.stringify(args)], () => client.listProposals({ + limit: args.limit, + startAfter: args.startAfter + }), options); +} +export interface Cw3FixedMultiSigProposalQuery extends Cw3FixedMultiSigReactQuery { + args: { + proposalId: number; + }; +} +export function useCw3FixedMultiSigProposalQuery({ + client, + args, + options +}: Cw3FixedMultiSigProposalQuery) { + return useQuery(["cw3FixedMultiSigProposal", client.contractAddress, JSON.stringify(args)], () => client.proposal({ + proposalId: args.proposalId + }), options); +} +export interface Cw3FixedMultiSigThresholdQuery extends Cw3FixedMultiSigReactQuery {} +export function useCw3FixedMultiSigThresholdQuery({ + client, + options +}: Cw3FixedMultiSigThresholdQuery) { + return useQuery(["cw3FixedMultiSigThreshold", client.contractAddress], () => client.threshold(), options); +} \ No newline at end of file diff --git a/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.recoil.ts b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.recoil.ts new file mode 100644 index 00000000..150517c8 --- /dev/null +++ b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.recoil.ts @@ -0,0 +1,136 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { selectorFamily } from "recoil"; +import { cosmWasmClient } from "./chain"; +import { Duration, Threshold, Decimal, InstantiateMsg, Voter, ExecuteMsg, Expiration, Timestamp, Uint64, CosmosMsgForEmpty, BankMsg, Uint128, StakingMsg, DistributionMsg, WasmMsg, Binary, Vote, Coin, Empty, QueryMsg, Status, ThresholdResponse, ProposalListResponse, ProposalResponseForEmpty, VoterListResponse, VoterDetail, VoteListResponse, VoteInfo, VoteResponse, VoterResponse } from "./Cw3FixedMultiSig.types"; +import { Cw3FixedMultiSigQueryClient } from "./Cw3FixedMultiSig.client"; +type QueryClientParams = { + contractAddress: string; +}; +export const queryClient = selectorFamily({ + key: "cw3FixedMultiSigQueryClient", + get: ({ + contractAddress + }) => ({ + get + }) => { + const client = get(cosmWasmClient); + return new Cw3FixedMultiSigQueryClient(client, contractAddress); + } +}); +export const thresholdSelector = selectorFamily; +}>({ + key: "cw3FixedMultiSigThreshold", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.threshold(...params); + } +}); +export const proposalSelector = selectorFamily; +}>({ + key: "cw3FixedMultiSigProposal", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.proposal(...params); + } +}); +export const listProposalsSelector = selectorFamily; +}>({ + key: "cw3FixedMultiSigListProposals", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.listProposals(...params); + } +}); +export const reverseProposalsSelector = selectorFamily; +}>({ + key: "cw3FixedMultiSigReverseProposals", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.reverseProposals(...params); + } +}); +export const voteSelector = selectorFamily; +}>({ + key: "cw3FixedMultiSigVote", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.vote(...params); + } +}); +export const listVotesSelector = selectorFamily; +}>({ + key: "cw3FixedMultiSigListVotes", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.listVotes(...params); + } +}); +export const voterSelector = selectorFamily; +}>({ + key: "cw3FixedMultiSigVoter", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.voter(...params); + } +}); +export const listVotersSelector = selectorFamily; +}>({ + key: "cw3FixedMultiSigListVoters", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.listVoters(...params); + } +}); \ No newline at end of file diff --git a/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.types.ts b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.types.ts new file mode 100644 index 00000000..8f40d647 --- /dev/null +++ b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.types.ts @@ -0,0 +1,254 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Duration = { + height: number; +} | { + time: number; +}; +export type Threshold = { + absolute_count: { + weight: number; + }; +} | { + absolute_percentage: { + percentage: Decimal; + }; +} | { + threshold_quorum: { + quorum: Decimal; + threshold: Decimal; + }; +}; +export type Decimal = string; +export interface InstantiateMsg { + max_voting_period: Duration; + threshold: Threshold; + voters: Voter[]; +} +export interface Voter { + addr: string; + weight: number; +} +export type ExecuteMsg = { + propose: { + description: string; + latest?: Expiration | null; + msgs: CosmosMsgForEmpty[]; + title: string; + }; +} | { + vote: { + proposal_id: number; + vote: Vote; + }; +} | { + execute: { + proposal_id: number; + }; +} | { + close: { + proposal_id: number; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type CosmosMsgForEmpty = { + bank: BankMsg; +} | { + custom: Empty; +} | { + staking: StakingMsg; +} | { + distribution: DistributionMsg; +} | { + wasm: WasmMsg; +}; +export type BankMsg = { + send: { + amount: Coin[]; + to_address: string; + [k: string]: unknown; + }; +} | { + burn: { + amount: Coin[]; + [k: string]: unknown; + }; +}; +export type Uint128 = string; +export type StakingMsg = { + delegate: { + amount: Coin; + validator: string; + [k: string]: unknown; + }; +} | { + undelegate: { + amount: Coin; + validator: string; + [k: string]: unknown; + }; +} | { + redelegate: { + amount: Coin; + dst_validator: string; + src_validator: string; + [k: string]: unknown; + }; +}; +export type DistributionMsg = { + set_withdraw_address: { + address: string; + [k: string]: unknown; + }; +} | { + withdraw_delegator_reward: { + validator: string; + [k: string]: unknown; + }; +}; +export type WasmMsg = { + execute: { + contract_addr: string; + funds: Coin[]; + msg: Binary; + [k: string]: unknown; + }; +} | { + instantiate: { + admin?: string | null; + code_id: number; + funds: Coin[]; + label: string; + msg: Binary; + [k: string]: unknown; + }; +} | { + migrate: { + contract_addr: string; + msg: Binary; + new_code_id: number; + [k: string]: unknown; + }; +} | { + update_admin: { + admin: string; + contract_addr: string; + [k: string]: unknown; + }; +} | { + clear_admin: { + contract_addr: string; + [k: string]: unknown; + }; +}; +export type Binary = string; +export type Vote = "yes" | "no" | "abstain" | "veto"; +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface Empty { + [k: string]: unknown; +} +export type QueryMsg = { + threshold: {}; +} | { + proposal: { + proposal_id: number; + }; +} | { + list_proposals: { + limit?: number | null; + start_after?: number | null; + }; +} | { + reverse_proposals: { + limit?: number | null; + start_before?: number | null; + }; +} | { + vote: { + proposal_id: number; + voter: string; + }; +} | { + list_votes: { + limit?: number | null; + proposal_id: number; + start_after?: string | null; + }; +} | { + voter: { + address: string; + }; +} | { + list_voters: { + limit?: number | null; + start_after?: string | null; + }; +}; +export type Status = "pending" | "open" | "rejected" | "passed" | "executed"; +export type ThresholdResponse = { + absolute_count: { + total_weight: number; + weight: number; + }; +} | { + absolute_percentage: { + percentage: Decimal; + total_weight: number; + }; +} | { + threshold_quorum: { + quorum: Decimal; + threshold: Decimal; + total_weight: number; + }; +}; +export interface ProposalListResponse { + proposals: ProposalResponseForEmpty[]; +} +export interface ProposalResponseForEmpty { + description: string; + expires: Expiration; + id: number; + msgs: CosmosMsgForEmpty[]; + status: Status; + threshold: ThresholdResponse; + title: string; +} +export interface VoterListResponse { + voters: VoterDetail[]; +} +export interface VoterDetail { + addr: string; + weight: number; +} +export interface VoteListResponse { + votes: VoteInfo[]; +} +export interface VoteInfo { + proposal_id: number; + vote: Vote; + voter: string; + weight: number; +} +export interface VoteResponse { + vote?: VoteInfo | null; +} +export interface VoterResponse { + weight?: number | null; +} \ No newline at end of file diff --git a/__output__/idl-version/cw4-group/Cw4Group.client.ts b/__output__/idl-version/cw4-group/Cw4Group.client.ts new file mode 100644 index 00000000..c438469b --- /dev/null +++ b/__output__/idl-version/cw4-group/Cw4Group.client.ts @@ -0,0 +1,177 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { Coin, StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, Member, ExecuteMsg, QueryMsg, AdminResponse, HooksResponse, MemberListResponse, MemberResponse, TotalWeightResponse } from "./Cw4Group.types"; +export interface Cw4GroupReadOnlyInterface { + contractAddress: string; + admin: () => Promise; + totalWeight: () => Promise; + listMembers: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + member: ({ + addr, + atHeight + }: { + addr: string; + atHeight?: number; + }) => Promise; + hooks: () => Promise; +} +export class Cw4GroupQueryClient implements Cw4GroupReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.admin = this.admin.bind(this); + this.totalWeight = this.totalWeight.bind(this); + this.listMembers = this.listMembers.bind(this); + this.member = this.member.bind(this); + this.hooks = this.hooks.bind(this); + } + + admin = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + admin: {} + }); + }; + totalWeight = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + total_weight: {} + }); + }; + listMembers = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + list_members: { + limit, + start_after: startAfter + } + }); + }; + member = async ({ + addr, + atHeight + }: { + addr: string; + atHeight?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + member: { + addr, + at_height: atHeight + } + }); + }; + hooks = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + hooks: {} + }); + }; +} +export interface Cw4GroupInterface extends Cw4GroupReadOnlyInterface { + contractAddress: string; + sender: string; + updateAdmin: ({ + admin + }: { + admin?: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateMembers: ({ + add, + remove + }: { + add: Member[]; + remove: string[]; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + addHook: ({ + addr + }: { + addr: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + removeHook: ({ + addr + }: { + addr: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; +} +export class Cw4GroupClient extends Cw4GroupQueryClient implements Cw4GroupInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + super(client, contractAddress); + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateAdmin = this.updateAdmin.bind(this); + this.updateMembers = this.updateMembers.bind(this); + this.addHook = this.addHook.bind(this); + this.removeHook = this.removeHook.bind(this); + } + + updateAdmin = async ({ + admin + }: { + admin?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_admin: { + admin + } + }, fee, memo, funds); + }; + updateMembers = async ({ + add, + remove + }: { + add: Member[]; + remove: string[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_members: { + add, + remove + } + }, fee, memo, funds); + }; + addHook = async ({ + addr + }: { + addr: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_hook: { + addr + } + }, fee, memo, funds); + }; + removeHook = async ({ + addr + }: { + addr: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_hook: { + addr + } + }, fee, memo, funds); + }; +} \ No newline at end of file diff --git a/__output__/idl-version/cw4-group/Cw4Group.message-composer.ts b/__output__/idl-version/cw4-group/Cw4Group.message-composer.ts new file mode 100644 index 00000000..e516b7ca --- /dev/null +++ b/__output__/idl-version/cw4-group/Cw4Group.message-composer.ts @@ -0,0 +1,130 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Coin } from "@cosmjs/amino"; +import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@cosmjs/encoding"; +import { InstantiateMsg, Member, ExecuteMsg, QueryMsg, AdminResponse, HooksResponse, MemberListResponse, MemberResponse, TotalWeightResponse } from "./Cw4Group.types"; +export interface Cw4GroupMessage { + contractAddress: string; + sender: string; + updateAdmin: ({ + admin + }: { + admin?: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateMembers: ({ + add, + remove + }: { + add: Member[]; + remove: string[]; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + addHook: ({ + addr + }: { + addr: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + removeHook: ({ + addr + }: { + addr: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; +} +export class Cw4GroupMessageComposer implements Cw4GroupMessage { + sender: string; + contractAddress: string; + + constructor(sender: string, contractAddress: string) { + this.sender = sender; + this.contractAddress = contractAddress; + this.updateAdmin = this.updateAdmin.bind(this); + this.updateMembers = this.updateMembers.bind(this); + this.addHook = this.addHook.bind(this); + this.removeHook = this.removeHook.bind(this); + } + + updateAdmin = ({ + admin + }: { + admin?: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_admin: { + admin + } + })), + funds + }) + }; + }; + updateMembers = ({ + add, + remove + }: { + add: Member[]; + remove: string[]; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_members: { + add, + remove + } + })), + funds + }) + }; + }; + addHook = ({ + addr + }: { + addr: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + add_hook: { + addr + } + })), + funds + }) + }; + }; + removeHook = ({ + addr + }: { + addr: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + remove_hook: { + addr + } + })), + funds + }) + }; + }; +} \ No newline at end of file diff --git a/__output__/idl-version/cw4-group/Cw4Group.react-query.ts b/__output__/idl-version/cw4-group/Cw4Group.react-query.ts new file mode 100644 index 00000000..c6773c81 --- /dev/null +++ b/__output__/idl-version/cw4-group/Cw4Group.react-query.ts @@ -0,0 +1,66 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions, useQuery } from "react-query"; +import { InstantiateMsg, Member, ExecuteMsg, QueryMsg, AdminResponse, HooksResponse, MemberListResponse, MemberResponse, TotalWeightResponse } from "./Cw4Group.types"; +import { Cw4GroupQueryClient } from "./Cw4Group.client"; +export interface Cw4GroupReactQuery { + client: Cw4GroupQueryClient; + options?: UseQueryOptions; +} +export interface Cw4GroupHooksQuery extends Cw4GroupReactQuery {} +export function useCw4GroupHooksQuery({ + client, + options +}: Cw4GroupHooksQuery) { + return useQuery(["cw4GroupHooks", client.contractAddress], () => client.hooks(), options); +} +export interface Cw4GroupMemberQuery extends Cw4GroupReactQuery { + args: { + addr: string; + atHeight?: number; + }; +} +export function useCw4GroupMemberQuery({ + client, + args, + options +}: Cw4GroupMemberQuery) { + return useQuery(["cw4GroupMember", client.contractAddress, JSON.stringify(args)], () => client.member({ + addr: args.addr, + atHeight: args.atHeight + }), options); +} +export interface Cw4GroupListMembersQuery extends Cw4GroupReactQuery { + args: { + limit?: number; + startAfter?: string; + }; +} +export function useCw4GroupListMembersQuery({ + client, + args, + options +}: Cw4GroupListMembersQuery) { + return useQuery(["cw4GroupListMembers", client.contractAddress, JSON.stringify(args)], () => client.listMembers({ + limit: args.limit, + startAfter: args.startAfter + }), options); +} +export interface Cw4GroupTotalWeightQuery extends Cw4GroupReactQuery {} +export function useCw4GroupTotalWeightQuery({ + client, + options +}: Cw4GroupTotalWeightQuery) { + return useQuery(["cw4GroupTotalWeight", client.contractAddress], () => client.totalWeight(), options); +} +export interface Cw4GroupAdminQuery extends Cw4GroupReactQuery {} +export function useCw4GroupAdminQuery({ + client, + options +}: Cw4GroupAdminQuery) { + return useQuery(["cw4GroupAdmin", client.contractAddress], () => client.admin(), options); +} \ No newline at end of file diff --git a/__output__/idl-version/cw4-group/Cw4Group.recoil.ts b/__output__/idl-version/cw4-group/Cw4Group.recoil.ts new file mode 100644 index 00000000..e07778ac --- /dev/null +++ b/__output__/idl-version/cw4-group/Cw4Group.recoil.ts @@ -0,0 +1,94 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { selectorFamily } from "recoil"; +import { cosmWasmClient } from "./chain"; +import { InstantiateMsg, Member, ExecuteMsg, QueryMsg, AdminResponse, HooksResponse, MemberListResponse, MemberResponse, TotalWeightResponse } from "./Cw4Group.types"; +import { Cw4GroupQueryClient } from "./Cw4Group.client"; +type QueryClientParams = { + contractAddress: string; +}; +export const queryClient = selectorFamily({ + key: "cw4GroupQueryClient", + get: ({ + contractAddress + }) => ({ + get + }) => { + const client = get(cosmWasmClient); + return new Cw4GroupQueryClient(client, contractAddress); + } +}); +export const adminSelector = selectorFamily; +}>({ + key: "cw4GroupAdmin", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.admin(...params); + } +}); +export const totalWeightSelector = selectorFamily; +}>({ + key: "cw4GroupTotalWeight", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.totalWeight(...params); + } +}); +export const listMembersSelector = selectorFamily; +}>({ + key: "cw4GroupListMembers", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.listMembers(...params); + } +}); +export const memberSelector = selectorFamily; +}>({ + key: "cw4GroupMember", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.member(...params); + } +}); +export const hooksSelector = selectorFamily; +}>({ + key: "cw4GroupHooks", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.hooks(...params); + } +}); \ No newline at end of file diff --git a/__output__/idl-version/cw4-group/Cw4Group.types.ts b/__output__/idl-version/cw4-group/Cw4Group.types.ts new file mode 100644 index 00000000..461389d2 --- /dev/null +++ b/__output__/idl-version/cw4-group/Cw4Group.types.ts @@ -0,0 +1,64 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + admin?: string | null; + members: Member[]; +} +export interface Member { + addr: string; + weight: number; +} +export type ExecuteMsg = { + update_admin: { + admin?: string | null; + }; +} | { + update_members: { + add: Member[]; + remove: string[]; + }; +} | { + add_hook: { + addr: string; + }; +} | { + remove_hook: { + addr: string; + }; +}; +export type QueryMsg = { + admin: {}; +} | { + total_weight: {}; +} | { + list_members: { + limit?: number | null; + start_after?: string | null; + }; +} | { + member: { + addr: string; + at_height?: number | null; + }; +} | { + hooks: {}; +}; +export interface AdminResponse { + admin?: string | null; +} +export interface HooksResponse { + hooks: string[]; +} +export interface MemberListResponse { + members: Member[]; +} +export interface MemberResponse { + weight?: number | null; +} +export interface TotalWeightResponse { + weight: number; +} \ No newline at end of file diff --git a/__output__/idl-version/cyberpunk/CyberPunk.client.ts b/__output__/idl-version/cyberpunk/CyberPunk.client.ts index 5dbf4ca0..70e3100c 100644 --- a/__output__/idl-version/cyberpunk/CyberPunk.client.ts +++ b/__output__/idl-version/cyberpunk/CyberPunk.client.ts @@ -6,10 +6,10 @@ import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; import { Coin, StdFee } from "@cosmjs/amino"; -import { InstantiateMsg, ExecuteMsg, QueryMsg } from "./CyberPunk.types"; +import { InstantiateMsg, ExecuteMsg, QueryMsg, Timestamp, Uint64, Addr, Env, BlockInfo, ContractInfo, TransactionInfo } from "./CyberPunk.types"; export interface CyberPunkReadOnlyInterface { contractAddress: string; - mirrorEnv: () => Promise; + mirrorEnv: () => Promise; } export class CyberPunkQueryClient implements CyberPunkReadOnlyInterface { client: CosmWasmClient; @@ -21,7 +21,7 @@ export class CyberPunkQueryClient implements CyberPunkReadOnlyInterface { this.mirrorEnv = this.mirrorEnv.bind(this); } - mirrorEnv = async (): Promise => { + mirrorEnv = async (): Promise => { return this.client.queryContractSmart(this.contractAddress, { mirror_env: {} }); diff --git a/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts b/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts index fef92e22..22f9edde 100644 --- a/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts +++ b/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts @@ -8,7 +8,7 @@ import { Coin } from "@cosmjs/amino"; import { MsgExecuteContractEncodeObject } from "cosmwasm"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; -import { InstantiateMsg, ExecuteMsg, QueryMsg } from "./CyberPunk.types"; +import { InstantiateMsg, ExecuteMsg, QueryMsg, Timestamp, Uint64, Addr, Env, BlockInfo, ContractInfo, TransactionInfo } from "./CyberPunk.types"; export interface CyberPunkMessage { contractAddress: string; sender: string; diff --git a/__output__/idl-version/cyberpunk/CyberPunk.react-query.ts b/__output__/idl-version/cyberpunk/CyberPunk.react-query.ts index d6c80f03..37307588 100644 --- a/__output__/idl-version/cyberpunk/CyberPunk.react-query.ts +++ b/__output__/idl-version/cyberpunk/CyberPunk.react-query.ts @@ -5,16 +5,16 @@ */ import { UseQueryOptions, useQuery } from "react-query"; -import { InstantiateMsg, ExecuteMsg, QueryMsg } from "./CyberPunk.types"; +import { InstantiateMsg, ExecuteMsg, QueryMsg, Timestamp, Uint64, Addr, Env, BlockInfo, ContractInfo, TransactionInfo } from "./CyberPunk.types"; import { CyberPunkQueryClient } from "./CyberPunk.client"; export interface CyberPunkReactQuery { client: CyberPunkQueryClient; options?: UseQueryOptions; } -export interface CyberPunkMirrorEnvQuery extends CyberPunkReactQuery {} -export function useCyberPunkMirrorEnvQuery({ +export interface CyberPunkMirrorEnvQuery extends CyberPunkReactQuery {} +export function useCyberPunkMirrorEnvQuery({ client, options }: CyberPunkMirrorEnvQuery) { - return useQuery(["cyberPunkMirrorEnv", client.contractAddress], () => client.mirrorEnv(), options); + return useQuery(["cyberPunkMirrorEnv", client.contractAddress], () => client.mirrorEnv(), options); } \ No newline at end of file diff --git a/__output__/idl-version/cyberpunk/CyberPunk.recoil.ts b/__output__/idl-version/cyberpunk/CyberPunk.recoil.ts index 55e8eb18..02290cbb 100644 --- a/__output__/idl-version/cyberpunk/CyberPunk.recoil.ts +++ b/__output__/idl-version/cyberpunk/CyberPunk.recoil.ts @@ -6,7 +6,7 @@ import { selectorFamily } from "recoil"; import { cosmWasmClient } from "./chain"; -import { InstantiateMsg, ExecuteMsg, QueryMsg } from "./CyberPunk.types"; +import { InstantiateMsg, ExecuteMsg, QueryMsg, Timestamp, Uint64, Addr, Env, BlockInfo, ContractInfo, TransactionInfo } from "./CyberPunk.types"; import { CyberPunkQueryClient } from "./CyberPunk.client"; type QueryClientParams = { contractAddress: string; @@ -22,7 +22,7 @@ export const queryClient = selectorFamily; }>({ key: "cyberPunkMirrorEnv", diff --git a/__output__/idl-version/cyberpunk/CyberPunk.types.ts b/__output__/idl-version/cyberpunk/CyberPunk.types.ts index 81228471..91b6a9bb 100644 --- a/__output__/idl-version/cyberpunk/CyberPunk.types.ts +++ b/__output__/idl-version/cyberpunk/CyberPunk.types.ts @@ -17,4 +17,27 @@ export type ExecuteMsg = { }; export type QueryMsg = { mirror_env: {}; -}; \ No newline at end of file +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Addr = string; +export interface Env { + block: BlockInfo; + contract: ContractInfo; + transaction?: TransactionInfo | null; + [k: string]: unknown; +} +export interface BlockInfo { + chain_id: string; + height: number; + time: Timestamp; + [k: string]: unknown; +} +export interface ContractInfo { + address: Addr; + [k: string]: unknown; +} +export interface TransactionInfo { + index: number; + [k: string]: unknown; +} \ No newline at end of file diff --git a/__output__/idl-version/hackatom/HackAtom.client.ts b/__output__/idl-version/hackatom/HackAtom.client.ts index 297ee46f..bce1ebde 100644 --- a/__output__/idl-version/hackatom/HackAtom.client.ts +++ b/__output__/idl-version/hackatom/HackAtom.client.ts @@ -6,7 +6,7 @@ import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; import { StdFee } from "@cosmjs/amino"; -import { InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, SudoMsg, Uint128, Coin } from "./HackAtom.types"; +import { InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, SudoMsg, Uint128, Coin, IntResponse, AllBalanceResponse, Binary, RecurseResponse, VerifierResponse } from "./HackAtom.types"; export interface HackAtomReadOnlyInterface { contractAddress: string; verifier: () => Promise; @@ -14,7 +14,7 @@ export interface HackAtomReadOnlyInterface { address }: { address: string; - }) => Promise; + }) => Promise; recurse: ({ depth, work @@ -22,7 +22,7 @@ export interface HackAtomReadOnlyInterface { depth: number; work: number; }) => Promise; - getInt: () => Promise; + getInt: () => Promise; } export class HackAtomQueryClient implements HackAtomReadOnlyInterface { client: CosmWasmClient; @@ -46,7 +46,7 @@ export class HackAtomQueryClient implements HackAtomReadOnlyInterface { address }: { address: string; - }): Promise => { + }): Promise => { return this.client.queryContractSmart(this.contractAddress, { other_balance: { address @@ -67,7 +67,7 @@ export class HackAtomQueryClient implements HackAtomReadOnlyInterface { } }); }; - getInt = async (): Promise => { + getInt = async (): Promise => { return this.client.queryContractSmart(this.contractAddress, { get_int: {} }); diff --git a/__output__/idl-version/hackatom/HackAtom.message-composer.ts b/__output__/idl-version/hackatom/HackAtom.message-composer.ts index 399f497d..6fade775 100644 --- a/__output__/idl-version/hackatom/HackAtom.message-composer.ts +++ b/__output__/idl-version/hackatom/HackAtom.message-composer.ts @@ -7,7 +7,7 @@ import { MsgExecuteContractEncodeObject } from "cosmwasm"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; -import { InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, SudoMsg, Uint128, Coin } from "./HackAtom.types"; +import { InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, SudoMsg, Uint128, Coin, IntResponse, AllBalanceResponse, Binary, RecurseResponse, VerifierResponse } from "./HackAtom.types"; export interface HackAtomMessage { contractAddress: string; sender: string; diff --git a/__output__/idl-version/hackatom/HackAtom.react-query.ts b/__output__/idl-version/hackatom/HackAtom.react-query.ts index 4503f9d5..549016db 100644 --- a/__output__/idl-version/hackatom/HackAtom.react-query.ts +++ b/__output__/idl-version/hackatom/HackAtom.react-query.ts @@ -5,18 +5,18 @@ */ import { UseQueryOptions, useQuery } from "react-query"; -import { InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, SudoMsg, Uint128, Coin } from "./HackAtom.types"; +import { InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, SudoMsg, Uint128, Coin, IntResponse, AllBalanceResponse, Binary, RecurseResponse, VerifierResponse } from "./HackAtom.types"; import { HackAtomQueryClient } from "./HackAtom.client"; export interface HackAtomReactQuery { client: HackAtomQueryClient; options?: UseQueryOptions; } -export interface HackAtomGetIntQuery extends HackAtomReactQuery {} -export function useHackAtomGetIntQuery({ +export interface HackAtomGetIntQuery extends HackAtomReactQuery {} +export function useHackAtomGetIntQuery({ client, options }: HackAtomGetIntQuery) { - return useQuery(["hackAtomGetInt", client.contractAddress], () => client.getInt(), options); + return useQuery(["hackAtomGetInt", client.contractAddress], () => client.getInt(), options); } export interface HackAtomRecurseQuery extends HackAtomReactQuery { args: { @@ -34,17 +34,17 @@ export function useHackAtomRecurseQuery({ work: args.work }), options); } -export interface HackAtomOtherBalanceQuery extends HackAtomReactQuery { +export interface HackAtomOtherBalanceQuery extends HackAtomReactQuery { args: { address: string; }; } -export function useHackAtomOtherBalanceQuery({ +export function useHackAtomOtherBalanceQuery({ client, args, options }: HackAtomOtherBalanceQuery) { - return useQuery(["hackAtomOtherBalance", client.contractAddress, JSON.stringify(args)], () => client.otherBalance({ + return useQuery(["hackAtomOtherBalance", client.contractAddress, JSON.stringify(args)], () => client.otherBalance({ address: args.address }), options); } diff --git a/__output__/idl-version/hackatom/HackAtom.recoil.ts b/__output__/idl-version/hackatom/HackAtom.recoil.ts index 6fe2294e..04e915e8 100644 --- a/__output__/idl-version/hackatom/HackAtom.recoil.ts +++ b/__output__/idl-version/hackatom/HackAtom.recoil.ts @@ -6,7 +6,7 @@ import { selectorFamily } from "recoil"; import { cosmWasmClient } from "./chain"; -import { InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, SudoMsg, Uint128, Coin } from "./HackAtom.types"; +import { InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, SudoMsg, Uint128, Coin, IntResponse, AllBalanceResponse, Binary, RecurseResponse, VerifierResponse } from "./HackAtom.types"; import { HackAtomQueryClient } from "./HackAtom.client"; type QueryClientParams = { contractAddress: string; @@ -36,7 +36,7 @@ export const verifierSelector = selectorFamily; }>({ key: "hackAtomOtherBalance", @@ -64,7 +64,7 @@ export const recurseSelector = selectorFamily; }>({ key: "hackAtomGetInt", diff --git a/__output__/idl-version/hackatom/HackAtom.types.ts b/__output__/idl-version/hackatom/HackAtom.types.ts index 8a564933..fd21f5e3 100644 --- a/__output__/idl-version/hackatom/HackAtom.types.ts +++ b/__output__/idl-version/hackatom/HackAtom.types.ts @@ -55,4 +55,18 @@ export interface Coin { amount: Uint128; denom: string; [k: string]: unknown; +} +export interface IntResponse { + int: number; +} +export interface AllBalanceResponse { + amount: Coin[]; + [k: string]: unknown; +} +export type Binary = string; +export interface RecurseResponse { + hashed: Binary; +} +export interface VerifierResponse { + verifier: string; } \ No newline at end of file From 94c5785d947e329df1cc9108cc33bb7a0c21af60 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 12 Sep 2022 22:20:31 -0400 Subject: [PATCH 033/287] chore(release): publish - @cosmwasm/ts-codegen@0.15.0 - wasm-ast-types@0.10.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 85071cc8..a6f550d3 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.15.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.14.2...@cosmwasm/ts-codegen@0.15.0) (2022-09-13) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.14.2](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.14.1...@cosmwasm/ts-codegen@0.14.2) (2022-09-11) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 3b4f6b83..4074f787 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.14.2", + "version": "0.15.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -94,6 +94,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.9.0" + "wasm-ast-types": "^0.10.0" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 4212d463..5ccd9601 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.10.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.9.0...wasm-ast-types@0.10.0) (2022-09-13) + +**Note:** Version bump only for package wasm-ast-types + + + + + # [0.9.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.8.2...wasm-ast-types@0.9.0) (2022-08-23) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index e19ff7dd..70e4f673 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.9.0", + "version": "0.10.0", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From af68247176aaf1499dd8893478f54d1363720330 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Tue, 13 Sep 2022 10:28:52 -0400 Subject: [PATCH 034/287] readme --- README.md | 5 ++--- packages/ts-codegen/README.md | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 00aba9a9..88248d59 100644 --- a/README.md +++ b/README.md @@ -412,8 +412,7 @@ Using the new `write_api` method, you can export schemas: ```rs use cosmwasm_schema::write_api; -pub use cw4::{AdminResponse, MemberListResponse, MemberResponse, TotalWeightResponse}; -pub use cw4_group::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use cw4_group::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; fn main() { write_api! { @@ -477,5 +476,5 @@ Checkout these related projects: ## Credits -Built by Cosmology — if you like our tools, please consider delegating to [our validator](https://www.mintscan.io/juno/validators/junovaloper1pr5qgj4jg47lvsnejtfvk78090shvuctgdwdm5) +🛠 Built by Cosmology — if you like our tools, please consider delegating to [our validator ⚛️](https://cosmology.tech/validator) diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index 00aba9a9..17d5dd4d 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -412,8 +412,7 @@ Using the new `write_api` method, you can export schemas: ```rs use cosmwasm_schema::write_api; -pub use cw4::{AdminResponse, MemberListResponse, MemberResponse, TotalWeightResponse}; -pub use cw4_group::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use cw4_group::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; fn main() { write_api! { @@ -477,5 +476,4 @@ Checkout these related projects: ## Credits -Built by Cosmology — if you like our tools, please consider delegating to [our validator](https://www.mintscan.io/juno/validators/junovaloper1pr5qgj4jg47lvsnejtfvk78090shvuctgdwdm5) - +🛠 Built by Cosmology — if you like our tools, please consider delegating to [our validator ⚛️](https://cosmology.tech/validator) From 1de67fe821e940e8f29927115b670f6b38c1c359 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Tue, 13 Sep 2022 10:28:56 -0400 Subject: [PATCH 035/287] chore(release): publish - @cosmwasm/ts-codegen@0.15.1 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index a6f550d3..8f6cdf81 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.15.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.15.0...@cosmwasm/ts-codegen@0.15.1) (2022-09-13) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.15.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.14.2...@cosmwasm/ts-codegen@0.15.0) (2022-09-13) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 4074f787..6defa96c 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.15.0", + "version": "0.15.1", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From feec2f4b8dac4df2e01520452034739358a415c3 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Tue, 13 Sep 2022 14:06:15 -0400 Subject: [PATCH 036/287] ts lint --- packages/ts-codegen/src/generators/client.ts | 1 + packages/ts-codegen/src/generators/message-composer.ts | 1 + packages/ts-codegen/src/generators/react-query.ts | 1 + packages/ts-codegen/src/generators/recoil.ts | 1 + 4 files changed, 4 insertions(+) diff --git a/packages/ts-codegen/src/generators/client.ts b/packages/ts-codegen/src/generators/client.ts index b43bbdfe..2ee571dd 100644 --- a/packages/ts-codegen/src/generators/client.ts +++ b/packages/ts-codegen/src/generators/client.ts @@ -83,6 +83,7 @@ export default async ( } if (typeHash.hasOwnProperty('Coin')) { + // @ts-ignore delete context.utils.Coin; } const imports = context.getImports(); diff --git a/packages/ts-codegen/src/generators/message-composer.ts b/packages/ts-codegen/src/generators/message-composer.ts index 3c808675..f60645a4 100644 --- a/packages/ts-codegen/src/generators/message-composer.ts +++ b/packages/ts-codegen/src/generators/message-composer.ts @@ -61,6 +61,7 @@ export default async ( } if (typeHash.hasOwnProperty('Coin')) { + // @ts-ignore delete context.utils.Coin; } const imports = context.getImports(); diff --git a/packages/ts-codegen/src/generators/react-query.ts b/packages/ts-codegen/src/generators/react-query.ts index 5ade22fa..cdeed267 100644 --- a/packages/ts-codegen/src/generators/react-query.ts +++ b/packages/ts-codegen/src/generators/react-query.ts @@ -77,6 +77,7 @@ export default async ( } if (typeHash.hasOwnProperty('Coin')) { + // @ts-ignore delete context.utils.Coin; } const imports = context.getImports(); diff --git a/packages/ts-codegen/src/generators/recoil.ts b/packages/ts-codegen/src/generators/recoil.ts index 7bd46303..aac4e3cc 100644 --- a/packages/ts-codegen/src/generators/recoil.ts +++ b/packages/ts-codegen/src/generators/recoil.ts @@ -67,6 +67,7 @@ export default async ( } if (typeHash.hasOwnProperty('Coin')) { + // @ts-ignore delete context.utils.Coin; } const imports = context.getImports(); From 15ecaad3377f10524b85332e9af5a63f75933610 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Tue, 13 Sep 2022 14:06:50 -0400 Subject: [PATCH 037/287] fixture --- __fixtures__/misc/schema/arrays.json | 46 ++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/__fixtures__/misc/schema/arrays.json b/__fixtures__/misc/schema/arrays.json index 276c6aa2..04e67a96 100644 --- a/__fixtures__/misc/schema/arrays.json +++ b/__fixtures__/misc/schema/arrays.json @@ -13,10 +13,56 @@ "type": "object", "required": [ "edges", + "edges2", "nested", "supernested" ], "properties": { + "edges3": { + "type": [ + "array", + "null" + ], + "items": { + "type": [ + "array", + "null" + ], + "items": [ + { + "type": "integer", + "format": "int32" + }, + { + "type": "integer", + "format": "int32" + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "edges2": { + "type": [ + "array", + "null" + ], + "items": { + "type": "array", + "items": [ + { + "type": "integer", + "format": "int32" + }, + { + "type": "integer", + "format": "int32" + } + ], + "maxItems": 2, + "minItems": 2 + } + }, "edges": { "type": "array", "items": { From a676c3a13e7b68529d423ecb2b7dae27ba834423 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Tue, 13 Sep 2022 14:07:29 -0400 Subject: [PATCH 038/287] functionality --- .../ts-client.arrays.spec.ts.snap | 18 +++ .../src/client/test/ts-client.arrays.spec.ts | 14 +- packages/wasm-ast-types/src/utils/types.ts | 129 +++++++++++++----- 3 files changed, 125 insertions(+), 36 deletions(-) diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.arrays.spec.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.arrays.spec.ts.snap index d455b3ec..911ff10a 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.arrays.spec.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.arrays.spec.ts.snap @@ -14,16 +14,22 @@ exports[`execute classes array types 1`] = ` } updateEdges = async ({ + edges3, + edges2, edges, nested, supernested }: { + edges3?: number[][][]; + edges2: number[][][]; edges: number[][]; nested: number[][][]; supernested: string[][][][][][]; }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_edges: { + edges3, + edges2, edges, nested, supernested @@ -38,10 +44,14 @@ exports[`execute interfaces no extends 1`] = ` contractAddress: string; sender: string; updateEdges: ({ + edges3, + edges2, edges, nested, supernested }: { + edges3?: number[][][]; + edges2: number[][][]; edges: number[][]; nested: number[][][]; supernested: string[][][][][][]; @@ -51,6 +61,8 @@ exports[`execute interfaces no extends 1`] = ` exports[`execute_msg_for__empty 1`] = `"export type ExecuteMsg = ExecuteMsg;"`; +exports[`getPropertyType 1`] = `"number[][][]"`; + exports[`query classes 1`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { client: CosmWasmClient; @@ -63,16 +75,22 @@ exports[`query classes 1`] = ` } updateEdges = async ({ + edges3, + edges2, edges, nested, supernested }: { + edges3?: number[][][]; + edges2: number[][][]; edges: number[][]; nested: number[][][]; supernested: string[][][][][][]; }): Promise => { return this.client.queryContractSmart(this.contractAddress, { update_edges: { + edges3, + edges2, edges, nested, supernested diff --git a/packages/wasm-ast-types/src/client/test/ts-client.arrays.spec.ts b/packages/wasm-ast-types/src/client/test/ts-client.arrays.spec.ts index a991464b..1945ada0 100644 --- a/packages/wasm-ast-types/src/client/test/ts-client.arrays.spec.ts +++ b/packages/wasm-ast-types/src/client/test/ts-client.arrays.spec.ts @@ -6,11 +6,21 @@ import { createExecuteInterface, createTypeInterface } from '../client' -import { RenderContext } from '../../context'; -import { expectCode, makeContext } from '../../../test-utils'; +import { expectCode, printCode, makeContext } from '../../../test-utils'; +import { getPropertyType } from '../../utils'; const ctx = makeContext(message); +it('getPropertyType', () => { + const ast = getPropertyType( + ctx, + message.oneOf[0].properties.update_edges, + 'edges3' + ); + expectCode(ast.type) + // printCode(ast.type) +}) + it('execute_msg_for__empty', () => { expectCode(createTypeInterface( ctx, diff --git a/packages/wasm-ast-types/src/utils/types.ts b/packages/wasm-ast-types/src/utils/types.ts index aa08f114..26c6abc9 100644 --- a/packages/wasm-ast-types/src/utils/types.ts +++ b/packages/wasm-ast-types/src/utils/types.ts @@ -46,7 +46,9 @@ const getTypeOrRef = (obj) => { } const getArrayTypeFromItems = (items) => { - if (items.type === 'array') { + const detect = detectType(items.type); + + if (detect.type === 'array') { if (Array.isArray(items.items)) { return t.tsArrayType( t.tsArrayType( @@ -61,43 +63,40 @@ const getArrayTypeFromItems = (items) => { ); } } + + return t.tsArrayType( - getType(items.type) + getType(detect.type) ); } -export const getType = (type) => { - switch (type) { - case 'string': - return t.tsStringKeyword(); - case 'boolean': - return t.tSBooleanKeyword(); - case 'integer': - return t.tsNumberKeyword(); - default: - throw new Error('contact maintainers [unknown type]: ' + type); +export const detectType = (type: string | string[]) => { + let optional = false; + let theType = ''; + if (Array.isArray(type)) { + if (type.length !== 2) { + throw new Error('[getType(array length)] case not handled by transpiler. contact maintainers.') + } + const [nullableType, nullType] = type; + if (nullType !== 'null') { + throw new Error('[getType(null)] case not handled by transpiler. contact maintainers.') + } + theType = nullableType; + optional = true; + } else { + theType = type; } -} - -export const getPropertyType = ( - context: RenderContext, - schema: JSONSchema, - prop: string -) => { - const props = schema.properties ?? {}; - let info = props[prop]; - let type = null; - let optional = !schema.required?.includes(prop); - - if (info.allOf && info.allOf.length === 1) { - info = info.allOf[0]; - } + return { + type: theType, + optional + }; +} - if (typeof info.$ref === 'string') { - type = getTypeFromRef(info.$ref) - } +export const getTypeInfo = (info: JSONSchema) => { + let type = undefined; + let optional = undefined; if (Array.isArray(info.anyOf)) { // assuming 2nd is null, but let's check to ensure @@ -120,6 +119,7 @@ export const getPropertyType = ( optional = true; } + if (typeof info.type === 'string') { if (info.type === 'array') { if (typeof info.items === 'object' && !Array.isArray(info.items)) { @@ -140,7 +140,9 @@ export const getPropertyType = ( throw new Error('[info.items] case not handled by transpiler. contact maintainers.') } } else { - type = getType(info.type); + const detect = detectType(info.type); + type = getType(detect.type); + optional = detect.optional; } } @@ -155,15 +157,74 @@ export const getPropertyType = ( } if (nullableType === 'array' && typeof info.items === 'object' && !Array.isArray(info.items)) { - type = t.tsArrayType( - getType(info.items.type) - ); + const detect = detectType(info.items.type); + if (detect.type === 'array') { + // wen recursion? + type = t.tsArrayType( + getArrayTypeFromItems(info.items) + ); + } else { + type = t.tsArrayType( + getType(detect.type) + ); + } + optional = detect.optional; + } else { type = getType(nullableType); } optional = true; } + + return { + type, + optional + }; + +} + + +export const getType = (type: string) => { + switch (type) { + case 'string': + return t.tsStringKeyword(); + case 'boolean': + return t.tSBooleanKeyword(); + case 'integer': + return t.tsNumberKeyword(); + default: + throw new Error('contact maintainers [unknown type]: ' + type); + } +} + +export const getPropertyType = ( + context: RenderContext, + schema: JSONSchema, + prop: string +) => { + const props = schema.properties ?? {}; + let info = props[prop]; + + let type = null; + let optional = !schema.required?.includes(prop); + + if (info.allOf && info.allOf.length === 1) { + info = info.allOf[0]; + } + + if (typeof info.$ref === 'string') { + type = getTypeFromRef(info.$ref) + } + + const typeInfo = getTypeInfo(info); + if (typeof typeInfo.optional !== 'undefined') { + optional = typeInfo.optional; + } + if (typeof typeInfo.type !== 'undefined') { + type = typeInfo.type; + } + if (!type) { throw new Error('cannot find type for ' + JSON.stringify(info)) } From 6b42c191d7cb2fbf3c374cd307040118a24658f4 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Tue, 13 Sep 2022 14:07:36 -0400 Subject: [PATCH 039/287] types --- packages/ts-codegen/types/src/generators/client.d.ts | 3 ++- .../types/src/generators/message-composer.d.ts | 3 ++- .../ts-codegen/types/src/generators/react-query.d.ts | 4 ++-- packages/ts-codegen/types/src/generators/recoil.d.ts | 4 ++-- packages/ts-codegen/types/src/generators/types.d.ts | 4 ++-- packages/ts-codegen/types/src/utils/schemas.d.ts | 10 ++-------- packages/wasm-ast-types/types/utils/types.d.ts | 10 +++++++++- 7 files changed, 21 insertions(+), 17 deletions(-) diff --git a/packages/ts-codegen/types/src/generators/client.d.ts b/packages/ts-codegen/types/src/generators/client.d.ts index 5c9a5a91..b6aed11a 100644 --- a/packages/ts-codegen/types/src/generators/client.d.ts +++ b/packages/ts-codegen/types/src/generators/client.d.ts @@ -1,4 +1,5 @@ +import { ContractInfo } from "wasm-ast-types"; import { TSClientOptions } from "wasm-ast-types"; import { BuilderFile } from "../builder"; -declare const _default: (name: string, schemas: any[], outPath: string, tsClientOptions?: TSClientOptions) => Promise; +declare const _default: (name: string, contractInfo: ContractInfo, outPath: string, tsClientOptions?: TSClientOptions) => Promise; export default _default; diff --git a/packages/ts-codegen/types/src/generators/message-composer.d.ts b/packages/ts-codegen/types/src/generators/message-composer.d.ts index 7162e360..e2f4a834 100644 --- a/packages/ts-codegen/types/src/generators/message-composer.d.ts +++ b/packages/ts-codegen/types/src/generators/message-composer.d.ts @@ -1,4 +1,5 @@ +import { ContractInfo } from "wasm-ast-types"; import { MessageComposerOptions } from "wasm-ast-types"; import { BuilderFile } from "../builder"; -declare const _default: (name: string, schemas: any[], outPath: string, messageComposerOptions?: MessageComposerOptions) => Promise; +declare const _default: (name: string, contractInfo: ContractInfo, outPath: string, messageComposerOptions?: MessageComposerOptions) => Promise; export default _default; diff --git a/packages/ts-codegen/types/src/generators/react-query.d.ts b/packages/ts-codegen/types/src/generators/react-query.d.ts index 238d41f0..0e7d1cd1 100644 --- a/packages/ts-codegen/types/src/generators/react-query.d.ts +++ b/packages/ts-codegen/types/src/generators/react-query.d.ts @@ -1,4 +1,4 @@ -import { ReactQueryOptions } from "wasm-ast-types"; +import { ReactQueryOptions, ContractInfo } from "wasm-ast-types"; import { BuilderFile } from "../builder"; -declare const _default: (contractName: string, schemas: any[], outPath: string, reactQueryOptions?: ReactQueryOptions) => Promise; +declare const _default: (contractName: string, contractInfo: ContractInfo, outPath: string, reactQueryOptions?: ReactQueryOptions) => Promise; export default _default; diff --git a/packages/ts-codegen/types/src/generators/recoil.d.ts b/packages/ts-codegen/types/src/generators/recoil.d.ts index e46702d7..cb352533 100644 --- a/packages/ts-codegen/types/src/generators/recoil.d.ts +++ b/packages/ts-codegen/types/src/generators/recoil.d.ts @@ -1,4 +1,4 @@ -import { RecoilOptions } from "wasm-ast-types"; +import { ContractInfo, RecoilOptions } from "wasm-ast-types"; import { BuilderFile } from "../builder"; -declare const _default: (name: string, schemas: any[], outPath: string, recoilOptions?: RecoilOptions) => Promise; +declare const _default: (name: string, contractInfo: ContractInfo, outPath: string, recoilOptions?: RecoilOptions) => Promise; export default _default; diff --git a/packages/ts-codegen/types/src/generators/types.d.ts b/packages/ts-codegen/types/src/generators/types.d.ts index 29e985ed..d49e838d 100644 --- a/packages/ts-codegen/types/src/generators/types.d.ts +++ b/packages/ts-codegen/types/src/generators/types.d.ts @@ -1,4 +1,4 @@ -import { TSTypesOptions } from "wasm-ast-types"; +import { ContractInfo, TSTypesOptions } from "wasm-ast-types"; import { BuilderFile } from "../builder"; -declare const _default: (name: string, schemas: any[], outPath: string, tsTypesOptions?: TSTypesOptions) => Promise; +declare const _default: (name: string, contractInfo: ContractInfo, outPath: string, tsTypesOptions?: TSTypesOptions) => Promise; export default _default; diff --git a/packages/ts-codegen/types/src/utils/schemas.d.ts b/packages/ts-codegen/types/src/utils/schemas.d.ts index ba6ec91e..8e19d7a1 100644 --- a/packages/ts-codegen/types/src/utils/schemas.d.ts +++ b/packages/ts-codegen/types/src/utils/schemas.d.ts @@ -1,16 +1,10 @@ -import { JSONSchema } from 'wasm-ast-types'; -import { IDLObject } from '../types'; +import { ContractInfo } from 'wasm-ast-types'; interface ReadSchemaOpts { schemaDir: string; clean?: boolean; } -interface ReadSchemasValue { - schemas: JSONSchema[]; - idlObject?: IDLObject; -} -export declare const readSchemas: ({ schemaDir, clean }: ReadSchemaOpts) => Promise; +export declare const readSchemas: ({ schemaDir, clean }: ReadSchemaOpts) => Promise; export declare const findQueryMsg: (schemas: any) => any; export declare const findExecuteMsg: (schemas: any) => any; export declare const findAndParseTypes: (schemas: any) => Promise<{}>; -export declare const getDefinitionSchema: (schemas: JSONSchema[]) => JSONSchema; export {}; diff --git a/packages/wasm-ast-types/types/utils/types.d.ts b/packages/wasm-ast-types/types/utils/types.d.ts index bbde18ac..bcaeb367 100644 --- a/packages/wasm-ast-types/types/utils/types.d.ts +++ b/packages/wasm-ast-types/types/utils/types.d.ts @@ -4,7 +4,15 @@ import { RenderContext } from '../context'; import { JSONSchema } from '../types'; export declare function getResponseType(context: RenderContext, underscoreName: string): string; export declare const getTypeFromRef: ($ref: any) => t.TSTypeReference; -export declare const getType: (type: any) => t.TSBooleanKeyword | t.TSNumberKeyword | t.TSStringKeyword; +export declare const detectType: (type: string | string[]) => { + type: string; + optional: boolean; +}; +export declare const getTypeInfo: (info: JSONSchema) => { + type: any; + optional: any; +}; +export declare const getType: (type: string) => t.TSBooleanKeyword | t.TSNumberKeyword | t.TSStringKeyword; export declare const getPropertyType: (context: RenderContext, schema: JSONSchema, prop: string) => { type: any; optional: boolean; From d7f8c715f76edac8c5c2762e58fe8c73351d2af5 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Tue, 13 Sep 2022 14:15:58 -0400 Subject: [PATCH 040/287] chore(release): publish - @cosmwasm/ts-codegen@0.16.0 - wasm-ast-types@0.11.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 8f6cdf81..a309a240 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.16.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.15.1...@cosmwasm/ts-codegen@0.16.0) (2022-09-13) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.15.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.15.0...@cosmwasm/ts-codegen@0.15.1) (2022-09-13) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 6defa96c..46f3754e 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.15.1", + "version": "0.16.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -94,6 +94,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.10.0" + "wasm-ast-types": "^0.11.0" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 5ccd9601..ae2e903e 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.11.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.10.0...wasm-ast-types@0.11.0) (2022-09-13) + +**Note:** Version bump only for package wasm-ast-types + + + + + # [0.10.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.9.0...wasm-ast-types@0.10.0) (2022-09-13) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index 70e4f673..78056392 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.10.0", + "version": "0.11.0", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From deddde0b602859421fe28a2c2b547cc3b65029ac Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Tue, 13 Sep 2022 14:34:59 -0400 Subject: [PATCH 041/287] array case --- .../idl-version/accounts-nft/account-nft.json | 1390 +++++++++++++++++ .../ts-client.account-nfts.spec.ts.snap | 447 ++++++ .../test/ts-client.account-nfts.spec.ts | 48 + packages/wasm-ast-types/src/utils/types.ts | 23 +- 4 files changed, 1906 insertions(+), 2 deletions(-) create mode 100644 __fixtures__/idl-version/accounts-nft/account-nft.json create mode 100644 packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap create mode 100644 packages/wasm-ast-types/src/client/test/ts-client.account-nfts.spec.ts diff --git a/__fixtures__/idl-version/accounts-nft/account-nft.json b/__fixtures__/idl-version/accounts-nft/account-nft.json new file mode 100644 index 00000000..0303666a --- /dev/null +++ b/__fixtures__/idl-version/accounts-nft/account-nft.json @@ -0,0 +1,1390 @@ +{ + "contract_name": "account-nft", + "contract_version": "0.1.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "minter", + "name", + "symbol" + ], + "properties": { + "minter": { + "description": "The minter is the only one who can create new NFTs. This is designed for a base NFT that is controlled by an external program or contract. You will likely replace this with custom logic in custom NFTs", + "type": "string" + }, + "name": { + "description": "Name of the NFT contract", + "type": "string" + }, + "symbol": { + "description": "Symbol of the NFT contract", + "type": "string" + } + } + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "description": "Due to some chains being permissioned via governance, we must instantiate this contract first and give ownership access to Rover contract with this action after both are independently deployed.", + "type": "object", + "required": [ + "propose_new_owner" + ], + "properties": { + "propose_new_owner": { + "type": "object", + "required": [ + "new_owner" + ], + "properties": { + "new_owner": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Accept the proposed ownership transfer", + "type": "object", + "required": [ + "accept_ownership" + ], + "properties": { + "accept_ownership": { + "type": "object" + } + }, + "additionalProperties": false + }, + { + "description": "Mint a new NFT to the specified user; can only be called by the contract minter", + "type": "object", + "required": [ + "mint" + ], + "properties": { + "mint": { + "type": "object", + "required": [ + "user" + ], + "properties": { + "user": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Transfer is a base message to move a token to another account without triggering actions", + "type": "object", + "required": [ + "transfer_nft" + ], + "properties": { + "transfer_nft": { + "type": "object", + "required": [ + "recipient", + "token_id" + ], + "properties": { + "recipient": { + "type": "string" + }, + "token_id": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Send is a base message to transfer a token to a contract and trigger an action on the receiving contract.", + "type": "object", + "required": [ + "send_nft" + ], + "properties": { + "send_nft": { + "type": "object", + "required": [ + "contract", + "msg", + "token_id" + ], + "properties": { + "contract": { + "type": "string" + }, + "msg": { + "$ref": "#/definitions/Binary" + }, + "token_id": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Allows operator to transfer / send the token from the owner's account. If expiration is set, then this allowance has a time/height limit", + "type": "object", + "required": [ + "approve" + ], + "properties": { + "approve": { + "type": "object", + "required": [ + "spender", + "token_id" + ], + "properties": { + "expires": { + "anyOf": [ + { + "$ref": "#/definitions/Expiration" + }, + { + "type": "null" + } + ] + }, + "spender": { + "type": "string" + }, + "token_id": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Remove previously granted Approval", + "type": "object", + "required": [ + "revoke" + ], + "properties": { + "revoke": { + "type": "object", + "required": [ + "spender", + "token_id" + ], + "properties": { + "spender": { + "type": "string" + }, + "token_id": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Allows operator to transfer / send any token from the owner's account. If expiration is set, then this allowance has a time/height limit", + "type": "object", + "required": [ + "approve_all" + ], + "properties": { + "approve_all": { + "type": "object", + "required": [ + "operator" + ], + "properties": { + "expires": { + "anyOf": [ + { + "$ref": "#/definitions/Expiration" + }, + { + "type": "null" + } + ] + }, + "operator": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Remove previously granted ApproveAll permission", + "type": "object", + "required": [ + "revoke_all" + ], + "properties": { + "revoke_all": { + "type": "object", + "required": [ + "operator" + ], + "properties": { + "operator": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Burn an NFT the sender has access to", + "type": "object", + "required": [ + "burn" + ], + "properties": { + "burn": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "token_id": { + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec", + "type": "string" + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false + }, + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } + }, + "query": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "proposed_new_owner" + ], + "properties": { + "proposed_new_owner": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Enumerate debt shares for all token positions; start_after accepts (token_id, denom)", + "type": "object", + "required": [ + "all_debt_shares" + ], + "properties": { + "all_debt_shares": { + "type": "object", + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "start_after": { + "type": [ + "array", + "null" + ], + "items": [ + { + "type": "string" + }, + { + "type": "string" + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Return the owner of the given token, error if token does not exist", + "type": "object", + "required": [ + "owner_of" + ], + "properties": { + "owner_of": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "include_expired": { + "description": "unset or false will filter out expired approvals, you must set to true to see them", + "type": [ + "boolean", + "null" + ] + }, + "token_id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Return operator that can access all of the owner's tokens.", + "type": "object", + "required": [ + "approval" + ], + "properties": { + "approval": { + "type": "object", + "required": [ + "spender", + "token_id" + ], + "properties": { + "include_expired": { + "type": [ + "boolean", + "null" + ] + }, + "spender": { + "type": "string" + }, + "token_id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Return approvals that a token has", + "type": "object", + "required": [ + "approvals" + ], + "properties": { + "approvals": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "include_expired": { + "type": [ + "boolean", + "null" + ] + }, + "token_id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "List all operators that can access all of the owner's tokens", + "type": "object", + "required": [ + "all_operators" + ], + "properties": { + "all_operators": { + "type": "object", + "required": [ + "owner" + ], + "properties": { + "include_expired": { + "description": "unset or false will filter out expired items, you must set to true to see them", + "type": [ + "boolean", + "null" + ] + }, + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "owner": { + "type": "string" + }, + "start_after": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Total number of tokens issued", + "type": "object", + "required": [ + "num_tokens" + ], + "properties": { + "num_tokens": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "With MetaData Extension. Returns top-level metadata about the contract", + "type": "object", + "required": [ + "contract_info" + ], + "properties": { + "contract_info": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "With MetaData Extension. Returns metadata about one particular token, based on *ERC721 Metadata JSON Schema* but directly from the contract", + "type": "object", + "required": [ + "nft_info" + ], + "properties": { + "nft_info": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "token_id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "With MetaData Extension. Returns the result of both `NftInfo` and `OwnerOf` as one query as an optimization for clients", + "type": "object", + "required": [ + "all_nft_info" + ], + "properties": { + "all_nft_info": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "include_expired": { + "description": "unset or false will filter out expired approvals, you must set to true to see them", + "type": [ + "boolean", + "null" + ] + }, + "token_id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "With Enumerable extension. Returns all tokens owned by the given address, [] if unset.", + "type": "object", + "required": [ + "tokens" + ], + "properties": { + "tokens": { + "type": "object", + "required": [ + "owner" + ], + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "owner": { + "type": "string" + }, + "start_after": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "With Enumerable extension. Requires pagination. Lists all token_ids controlled by the contract. Return type: TokensResponse.", + "type": "object", + "required": [ + "all_tokens" + ], + "properties": { + "all_tokens": { + "type": "object", + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "start_after": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Return the minter", + "type": "object", + "required": [ + "minter" + ], + "properties": { + "minter": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "migrate": null, + "sudo": null, + "responses": { + "all_debt_shares": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Array_of_SharesResponseItem", + "type": "array", + "items": { + "$ref": "#/definitions/SharesResponseItem" + }, + "definitions": { + "SharesResponseItem": { + "type": "object", + "required": [ + "denom", + "shares", + "token_id" + ], + "properties": { + "denom": { + "type": "string" + }, + "shares": { + "$ref": "#/definitions/Uint128" + }, + "token_id": { + "type": "string" + } + } + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + "all_nft_info": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AllNftInfoResponse_for_Empty", + "type": "object", + "required": [ + "access", + "info" + ], + "properties": { + "access": { + "description": "Who can transfer the token", + "allOf": [ + { + "$ref": "#/definitions/OwnerOfResponse" + } + ] + }, + "info": { + "description": "Data on the token itself,", + "allOf": [ + { + "$ref": "#/definitions/NftInfoResponse_for_Empty" + } + ] + } + }, + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] + }, + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + } + }, + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false + }, + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + "NftInfoResponse_for_Empty": { + "type": "object", + "required": [ + "extension" + ], + "properties": { + "extension": { + "description": "You can add any custom metadata here when you extend cw721-base", + "allOf": [ + { + "$ref": "#/definitions/Empty" + } + ] + }, + "token_uri": { + "description": "Universal resource identifier for this NFT Should point to a JSON file that conforms to the ERC721 Metadata JSON Schema", + "type": [ + "string", + "null" + ] + } + } + }, + "OwnerOfResponse": { + "type": "object", + "required": [ + "approvals", + "owner" + ], + "properties": { + "approvals": { + "description": "If set this address is approved to transfer/send the token as well", + "type": "array", + "items": { + "$ref": "#/definitions/Approval" + } + }, + "owner": { + "description": "Owner of the token", + "type": "string" + } + } + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } + }, + "all_operators": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OperatorsResponse", + "type": "object", + "required": [ + "operators" + ], + "properties": { + "operators": { + "type": "array", + "items": { + "$ref": "#/definitions/Approval" + } + } + }, + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] + }, + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + } + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false + }, + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } + }, + "all_tokens": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TokensResponse", + "type": "object", + "required": [ + "tokens" + ], + "properties": { + "tokens": { + "description": "Contains all token_ids in lexicographical ordering If there are more than `limit`, use `start_from` in future queries to achieve pagination.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "approval": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ApprovalResponse", + "type": "object", + "required": [ + "approval" + ], + "properties": { + "approval": { + "$ref": "#/definitions/Approval" + } + }, + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] + }, + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + } + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false + }, + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } + }, + "approvals": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ApprovalsResponse", + "type": "object", + "required": [ + "approvals" + ], + "properties": { + "approvals": { + "type": "array", + "items": { + "$ref": "#/definitions/Approval" + } + } + }, + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] + }, + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + } + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false + }, + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } + }, + "contract_info": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ContractInfoResponse", + "type": "object", + "required": [ + "name", + "symbol" + ], + "properties": { + "name": { + "type": "string" + }, + "symbol": { + "type": "string" + } + } + }, + "minter": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MinterResponse", + "description": "Shows who can mint these tokens", + "type": "object", + "required": [ + "minter" + ], + "properties": { + "minter": { + "type": "string" + } + } + }, + "nft_info": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "NftInfoResponse_for_Empty", + "type": "object", + "required": [ + "extension" + ], + "properties": { + "extension": { + "description": "You can add any custom metadata here when you extend cw721-base", + "allOf": [ + { + "$ref": "#/definitions/Empty" + } + ] + }, + "token_uri": { + "description": "Universal resource identifier for this NFT Should point to a JSON file that conforms to the ERC721 Metadata JSON Schema", + "type": [ + "string", + "null" + ] + } + }, + "definitions": { + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" + } + } + }, + "num_tokens": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "NumTokensResponse", + "type": "object", + "required": [ + "count" + ], + "properties": { + "count": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + }, + "owner_of": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OwnerOfResponse", + "type": "object", + "required": [ + "approvals", + "owner" + ], + "properties": { + "approvals": { + "description": "If set this address is approved to transfer/send the token as well", + "type": "array", + "items": { + "$ref": "#/definitions/Approval" + } + }, + "owner": { + "description": "Owner of the token", + "type": "string" + } + }, + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] + }, + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + } + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false + }, + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object" + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } + }, + "proposed_new_owner": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "String", + "type": "string" + }, + "tokens": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TokensResponse", + "type": "object", + "required": [ + "tokens" + ], + "properties": { + "tokens": { + "description": "Contains all token_ids in lexicographical ordering If there are more than `limit`, use `start_from` in future queries to achieve pagination.", + "type": "array", + "items": { + "type": "string" + } + } + } + } + } +} diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap new file mode 100644 index 00000000..e3d3eec7 --- /dev/null +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap @@ -0,0 +1,447 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`execute classes array types 1`] = ` +"export class SG721Client implements SG721Instance { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.proposedNewOwner = this.proposedNewOwner.bind(this); + this.allDebtShares = this.allDebtShares.bind(this); + this.ownerOf = this.ownerOf.bind(this); + this.approval = this.approval.bind(this); + this.approvals = this.approvals.bind(this); + this.allOperators = this.allOperators.bind(this); + this.numTokens = this.numTokens.bind(this); + this.contractInfo = this.contractInfo.bind(this); + this.nftInfo = this.nftInfo.bind(this); + this.allNftInfo = this.allNftInfo.bind(this); + this.tokens = this.tokens.bind(this); + this.allTokens = this.allTokens.bind(this); + this.minter = this.minter.bind(this); + } + + proposedNewOwner = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + proposed_new_owner: {} + }, fee, memo, funds); + }; + allDebtShares = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string[][]; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + all_debt_shares: { + limit, + start_after: startAfter + } + }, fee, memo, funds); + }; + ownerOf = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + owner_of: { + include_expired: includeExpired, + token_id: tokenId + } + }, fee, memo, funds); + }; + approval = async ({ + includeExpired, + spender, + tokenId + }: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approval: { + include_expired: includeExpired, + spender, + token_id: tokenId + } + }, fee, memo, funds); + }; + approvals = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approvals: { + include_expired: includeExpired, + token_id: tokenId + } + }, fee, memo, funds); + }; + allOperators = async ({ + includeExpired, + limit, + owner, + startAfter + }: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + all_operators: { + include_expired: includeExpired, + limit, + owner, + start_after: startAfter + } + }, fee, memo, funds); + }; + numTokens = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + num_tokens: {} + }, fee, memo, funds); + }; + contractInfo = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + contract_info: {} + }, fee, memo, funds); + }; + nftInfo = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + nft_info: { + token_id: tokenId + } + }, fee, memo, funds); + }; + allNftInfo = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + all_nft_info: { + include_expired: includeExpired, + token_id: tokenId + } + }, fee, memo, funds); + }; + tokens = async ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + tokens: { + limit, + owner, + start_after: startAfter + } + }, fee, memo, funds); + }; + allTokens = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + all_tokens: { + limit, + start_after: startAfter + } + }, fee, memo, funds); + }; + minter = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + minter: {} + }, fee, memo, funds); + }; +}" +`; + +exports[`execute interfaces no extends 1`] = ` +"export interface SG721Instance { + contractAddress: string; + sender: string; + proposedNewOwner: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + allDebtShares: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string[][]; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + ownerOf: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + approval: ({ + includeExpired, + spender, + tokenId + }: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + approvals: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + allOperators: ({ + includeExpired, + limit, + owner, + startAfter + }: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + numTokens: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + contractInfo: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + nftInfo: ({ + tokenId + }: { + tokenId: string; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + allNftInfo: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + tokens: ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + allTokens: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + minter: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; +}" +`; + +exports[`execute_msg_for__empty 1`] = `"export type QueryMsg = QueryMsg;"`; + +exports[`query classes 1`] = ` +"export class SG721QueryClient implements SG721ReadOnlyInstance { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.proposedNewOwner = this.proposedNewOwner.bind(this); + this.allDebtShares = this.allDebtShares.bind(this); + this.ownerOf = this.ownerOf.bind(this); + this.approval = this.approval.bind(this); + this.approvals = this.approvals.bind(this); + this.allOperators = this.allOperators.bind(this); + this.numTokens = this.numTokens.bind(this); + this.contractInfo = this.contractInfo.bind(this); + this.nftInfo = this.nftInfo.bind(this); + this.allNftInfo = this.allNftInfo.bind(this); + this.tokens = this.tokens.bind(this); + this.allTokens = this.allTokens.bind(this); + this.minter = this.minter.bind(this); + } + + proposedNewOwner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + proposed_new_owner: {} + }); + }; + allDebtShares = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string[][]; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_debt_shares: { + limit, + start_after: startAfter + } + }); + }; + ownerOf = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner_of: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + approval = async ({ + includeExpired, + spender, + tokenId + }: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + approval: { + include_expired: includeExpired, + spender, + token_id: tokenId + } + }); + }; + approvals = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + approvals: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + allOperators = async ({ + includeExpired, + limit, + owner, + startAfter + }: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_operators: { + include_expired: includeExpired, + limit, + owner, + start_after: startAfter + } + }); + }; + numTokens = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + num_tokens: {} + }); + }; + contractInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + contract_info: {} + }); + }; + nftInfo = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + nft_info: { + token_id: tokenId + } + }); + }; + allNftInfo = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_nft_info: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + tokens = async ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + tokens: { + limit, + owner, + start_after: startAfter + } + }); + }; + allTokens = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_tokens: { + limit, + start_after: startAfter + } + }); + }; + minter = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + minter: {} + }); + }; +}" +`; diff --git a/packages/wasm-ast-types/src/client/test/ts-client.account-nfts.spec.ts b/packages/wasm-ast-types/src/client/test/ts-client.account-nfts.spec.ts new file mode 100644 index 00000000..a0ee8254 --- /dev/null +++ b/packages/wasm-ast-types/src/client/test/ts-client.account-nfts.spec.ts @@ -0,0 +1,48 @@ +import contract from '../../../../../__fixtures__/idl-version/accounts-nft/account-nft.json'; + +import { + createQueryClass, + createExecuteClass, + createExecuteInterface, + createTypeInterface +} from '../client' +import { expectCode, printCode, makeContext } from '../../../test-utils'; + +const message = contract.query +const ctx = makeContext(message); + +it('execute_msg_for__empty', () => { + expectCode(createTypeInterface( + ctx, + message + )) +}) + + +it('query classes', () => { + expectCode(createQueryClass( + ctx, + 'SG721QueryClient', + 'SG721ReadOnlyInstance', + message + )) +}); + +it('execute classes array types', () => { + expectCode(createExecuteClass( + ctx, + 'SG721Client', + 'SG721Instance', + null, + message + )) +}); + +it('execute interfaces no extends', () => { + expectCode(createExecuteInterface( + ctx, + 'SG721Instance', + null, + message + )) +}); diff --git a/packages/wasm-ast-types/src/utils/types.ts b/packages/wasm-ast-types/src/utils/types.ts index 26c6abc9..fe5360f1 100644 --- a/packages/wasm-ast-types/src/utils/types.ts +++ b/packages/wasm-ast-types/src/utils/types.ts @@ -46,6 +46,16 @@ const getTypeOrRef = (obj) => { } const getArrayTypeFromItems = (items) => { + // passing in [{"type":"string"}] + if (Array.isArray(items)) { + return t.tsArrayType( + t.tsArrayType( + getTypeOrRef(items[0]) + ) + ); + } + + // passing in {"items": [{"type":"string"}]} const detect = detectType(items.type); if (detect.type === 'array') { @@ -171,7 +181,16 @@ export const getTypeInfo = (info: JSONSchema) => { optional = detect.optional; } else { - type = getType(nullableType); + const detect = detectType(nullableType); + optional = detect.optional; + if (detect.type === 'array') { + type = getArrayTypeFromItems( + info.items + ); + } else { + type = getType(detect.type); + } + } optional = true; @@ -332,7 +351,7 @@ export function getPropertySignatureFromProp( getPropertyType(context, jsonschema, prop); } catch (e) { console.log(e); - console.log(jsonschema, prop); + console.log(JSON.stringify(jsonschema, null, 2), prop); } const { type, optional } = getPropertyType(context, jsonschema, prop); From 4d6287ab9d17ea8cef91b183c00e9bae6e8529e1 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Tue, 13 Sep 2022 14:35:23 -0400 Subject: [PATCH 042/287] chore(release): publish - @cosmwasm/ts-codegen@0.16.1 - wasm-ast-types@0.11.1 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index a309a240..8d7dc0f0 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.16.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.16.0...@cosmwasm/ts-codegen@0.16.1) (2022-09-13) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.16.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.15.1...@cosmwasm/ts-codegen@0.16.0) (2022-09-13) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 46f3754e..20c69941 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.16.0", + "version": "0.16.1", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -94,6 +94,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.11.0" + "wasm-ast-types": "^0.11.1" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index ae2e903e..c8d00b6b 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.11.1](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.11.0...wasm-ast-types@0.11.1) (2022-09-13) + +**Note:** Version bump only for package wasm-ast-types + + + + + # [0.11.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.10.0...wasm-ast-types@0.11.0) (2022-09-13) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index 78056392..b0db3c75 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.11.0", + "version": "0.11.1", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From df88c817ee53b3691315d76ff5823e298c1287f1 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 14 Sep 2022 11:34:01 -0400 Subject: [PATCH 043/287] case fix --- .../accounts-nft/AccountsNft.client.ts | 475 ++++++++++++++++++ .../AccountsNft.message-composer.ts | 300 +++++++++++ .../accounts-nft/AccountsNft.react-query.ts | 191 +++++++ .../accounts-nft/AccountsNft.recoil.ts | 206 ++++++++ .../accounts-nft/AccountsNft.types.ts | 199 ++++++++ .../ts-codegen/__tests__/ts-codegen.test.ts | 15 + packages/ts-codegen/src/utils/cleanse.ts | 3 + .../test/ts-client.account-nfts.spec.ts | 7 + 8 files changed, 1396 insertions(+) create mode 100644 __output__/idl-version/accounts-nft/AccountsNft.client.ts create mode 100644 __output__/idl-version/accounts-nft/AccountsNft.message-composer.ts create mode 100644 __output__/idl-version/accounts-nft/AccountsNft.react-query.ts create mode 100644 __output__/idl-version/accounts-nft/AccountsNft.recoil.ts create mode 100644 __output__/idl-version/accounts-nft/AccountsNft.types.ts diff --git a/__output__/idl-version/accounts-nft/AccountsNft.client.ts b/__output__/idl-version/accounts-nft/AccountsNft.client.ts new file mode 100644 index 00000000..48fab63a --- /dev/null +++ b/__output__/idl-version/accounts-nft/AccountsNft.client.ts @@ -0,0 +1,475 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { Coin, StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, TokensResponse, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse, String } from "./AccountsNft.types"; +export interface AccountsNftReadOnlyInterface { + contractAddress: string; + proposedNewOwner: () => Promise; + allDebtShares: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string[][]; + }) => Promise; + ownerOf: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + approval: ({ + includeExpired, + spender, + tokenId + }: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }) => Promise; + approvals: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + allOperators: ({ + includeExpired, + limit, + owner, + startAfter + }: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + numTokens: () => Promise; + contractInfo: () => Promise; + nftInfo: ({ + tokenId + }: { + tokenId: string; + }) => Promise; + allNftInfo: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + tokens: ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + allTokens: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + minter: () => Promise; +} +export class AccountsNftQueryClient implements AccountsNftReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.proposedNewOwner = this.proposedNewOwner.bind(this); + this.allDebtShares = this.allDebtShares.bind(this); + this.ownerOf = this.ownerOf.bind(this); + this.approval = this.approval.bind(this); + this.approvals = this.approvals.bind(this); + this.allOperators = this.allOperators.bind(this); + this.numTokens = this.numTokens.bind(this); + this.contractInfo = this.contractInfo.bind(this); + this.nftInfo = this.nftInfo.bind(this); + this.allNftInfo = this.allNftInfo.bind(this); + this.tokens = this.tokens.bind(this); + this.allTokens = this.allTokens.bind(this); + this.minter = this.minter.bind(this); + } + + proposedNewOwner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + proposed_new_owner: {} + }); + }; + allDebtShares = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string[][]; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_debt_shares: { + limit, + start_after: startAfter + } + }); + }; + ownerOf = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner_of: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + approval = async ({ + includeExpired, + spender, + tokenId + }: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + approval: { + include_expired: includeExpired, + spender, + token_id: tokenId + } + }); + }; + approvals = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + approvals: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + allOperators = async ({ + includeExpired, + limit, + owner, + startAfter + }: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_operators: { + include_expired: includeExpired, + limit, + owner, + start_after: startAfter + } + }); + }; + numTokens = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + num_tokens: {} + }); + }; + contractInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + contract_info: {} + }); + }; + nftInfo = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + nft_info: { + token_id: tokenId + } + }); + }; + allNftInfo = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_nft_info: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + tokens = async ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + tokens: { + limit, + owner, + start_after: startAfter + } + }); + }; + allTokens = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_tokens: { + limit, + start_after: startAfter + } + }); + }; + minter = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + minter: {} + }); + }; +} +export interface AccountsNftInterface extends AccountsNftReadOnlyInterface { + contractAddress: string; + sender: string; + proposeNewOwner: ({ + newOwner + }: { + newOwner: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + acceptOwnership: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + mint: ({ + user + }: { + user: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + transferNft: ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + sendNft: ({ + contract, + msg, + tokenId + }: { + contract: string; + msg: Binary; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + approve: ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + revoke: ({ + spender, + tokenId + }: { + spender: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + approveAll: ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + revokeAll: ({ + operator + }: { + operator: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + burn: ({ + tokenId + }: { + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; +} +export class AccountsNftClient extends AccountsNftQueryClient implements AccountsNftInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + super(client, contractAddress); + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.proposeNewOwner = this.proposeNewOwner.bind(this); + this.acceptOwnership = this.acceptOwnership.bind(this); + this.mint = this.mint.bind(this); + this.transferNft = this.transferNft.bind(this); + this.sendNft = this.sendNft.bind(this); + this.approve = this.approve.bind(this); + this.revoke = this.revoke.bind(this); + this.approveAll = this.approveAll.bind(this); + this.revokeAll = this.revokeAll.bind(this); + this.burn = this.burn.bind(this); + } + + proposeNewOwner = async ({ + newOwner + }: { + newOwner: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + propose_new_owner: { + new_owner: newOwner + } + }, fee, memo, funds); + }; + acceptOwnership = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + accept_ownership: {} + }, fee, memo, funds); + }; + mint = async ({ + user + }: { + user: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: { + user + } + }, fee, memo, funds); + }; + transferNft = async ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_nft: { + recipient, + token_id: tokenId + } + }, fee, memo, funds); + }; + sendNft = async ({ + contract, + msg, + tokenId + }: { + contract: string; + msg: Binary; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send_nft: { + contract, + msg, + token_id: tokenId + } + }, fee, memo, funds); + }; + approve = async ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve: { + expires, + spender, + token_id: tokenId + } + }, fee, memo, funds); + }; + revoke = async ({ + spender, + tokenId + }: { + spender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke: { + spender, + token_id: tokenId + } + }, fee, memo, funds); + }; + approveAll = async ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve_all: { + expires, + operator + } + }, fee, memo, funds); + }; + revokeAll = async ({ + operator + }: { + operator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke_all: { + operator + } + }, fee, memo, funds); + }; + burn = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + token_id: tokenId + } + }, fee, memo, funds); + }; +} \ No newline at end of file diff --git a/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts b/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts new file mode 100644 index 00000000..d09bda4a --- /dev/null +++ b/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts @@ -0,0 +1,300 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Coin } from "@cosmjs/amino"; +import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@cosmjs/encoding"; +import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, TokensResponse, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse, String } from "./AccountsNft.types"; +export interface AccountsNftMessage { + contractAddress: string; + sender: string; + proposeNewOwner: ({ + newOwner + }: { + newOwner: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + acceptOwnership: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + mint: ({ + user + }: { + user: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + transferNft: ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + sendNft: ({ + contract, + msg, + tokenId + }: { + contract: string; + msg: Binary; + tokenId: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + approve: ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + revoke: ({ + spender, + tokenId + }: { + spender: string; + tokenId: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + approveAll: ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + revokeAll: ({ + operator + }: { + operator: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + burn: ({ + tokenId + }: { + tokenId: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; +} +export class AccountsNftMessageComposer implements AccountsNftMessage { + sender: string; + contractAddress: string; + + constructor(sender: string, contractAddress: string) { + this.sender = sender; + this.contractAddress = contractAddress; + this.proposeNewOwner = this.proposeNewOwner.bind(this); + this.acceptOwnership = this.acceptOwnership.bind(this); + this.mint = this.mint.bind(this); + this.transferNft = this.transferNft.bind(this); + this.sendNft = this.sendNft.bind(this); + this.approve = this.approve.bind(this); + this.revoke = this.revoke.bind(this); + this.approveAll = this.approveAll.bind(this); + this.revokeAll = this.revokeAll.bind(this); + this.burn = this.burn.bind(this); + } + + proposeNewOwner = ({ + newOwner + }: { + newOwner: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + propose_new_owner: { + new_owner: newOwner + } + })), + funds + }) + }; + }; + acceptOwnership = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + accept_ownership: {} + })), + funds + }) + }; + }; + mint = ({ + user + }: { + user: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + mint: { + user + } + })), + funds + }) + }; + }; + transferNft = ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + transfer_nft: { + recipient, + token_id: tokenId + } + })), + funds + }) + }; + }; + sendNft = ({ + contract, + msg, + tokenId + }: { + contract: string; + msg: Binary; + tokenId: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + send_nft: { + contract, + msg, + token_id: tokenId + } + })), + funds + }) + }; + }; + approve = ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + approve: { + expires, + spender, + token_id: tokenId + } + })), + funds + }) + }; + }; + revoke = ({ + spender, + tokenId + }: { + spender: string; + tokenId: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + revoke: { + spender, + token_id: tokenId + } + })), + funds + }) + }; + }; + approveAll = ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + approve_all: { + expires, + operator + } + })), + funds + }) + }; + }; + revokeAll = ({ + operator + }: { + operator: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + revoke_all: { + operator + } + })), + funds + }) + }; + }; + burn = ({ + tokenId + }: { + tokenId: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + burn: { + token_id: tokenId + } + })), + funds + }) + }; + }; +} \ No newline at end of file diff --git a/__output__/idl-version/accounts-nft/AccountsNft.react-query.ts b/__output__/idl-version/accounts-nft/AccountsNft.react-query.ts new file mode 100644 index 00000000..5ce72700 --- /dev/null +++ b/__output__/idl-version/accounts-nft/AccountsNft.react-query.ts @@ -0,0 +1,191 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions, useQuery } from "react-query"; +import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, TokensResponse, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse, String } from "./AccountsNft.types"; +import { AccountsNftQueryClient } from "./AccountsNft.client"; +export interface AccountsNftReactQuery { + client: AccountsNftQueryClient; + options?: UseQueryOptions; +} +export interface AccountsNftMinterQuery extends AccountsNftReactQuery {} +export function useAccountsNftMinterQuery({ + client, + options +}: AccountsNftMinterQuery) { + return useQuery(["accountsNftMinter", client.contractAddress], () => client.minter(), options); +} +export interface AccountsNftAllTokensQuery extends AccountsNftReactQuery { + args: { + limit?: number; + startAfter?: string; + }; +} +export function useAccountsNftAllTokensQuery({ + client, + args, + options +}: AccountsNftAllTokensQuery) { + return useQuery(["accountsNftAllTokens", client.contractAddress, JSON.stringify(args)], () => client.allTokens({ + limit: args.limit, + startAfter: args.startAfter + }), options); +} +export interface AccountsNftTokensQuery extends AccountsNftReactQuery { + args: { + limit?: number; + owner: string; + startAfter?: string; + }; +} +export function useAccountsNftTokensQuery({ + client, + args, + options +}: AccountsNftTokensQuery) { + return useQuery(["accountsNftTokens", client.contractAddress, JSON.stringify(args)], () => client.tokens({ + limit: args.limit, + owner: args.owner, + startAfter: args.startAfter + }), options); +} +export interface AccountsNftAllNftInfoQuery extends AccountsNftReactQuery { + args: { + includeExpired?: boolean; + tokenId: string; + }; +} +export function useAccountsNftAllNftInfoQuery({ + client, + args, + options +}: AccountsNftAllNftInfoQuery) { + return useQuery(["accountsNftAllNftInfo", client.contractAddress, JSON.stringify(args)], () => client.allNftInfo({ + includeExpired: args.includeExpired, + tokenId: args.tokenId + }), options); +} +export interface AccountsNftNftInfoQuery extends AccountsNftReactQuery { + args: { + tokenId: string; + }; +} +export function useAccountsNftNftInfoQuery({ + client, + args, + options +}: AccountsNftNftInfoQuery) { + return useQuery(["accountsNftNftInfo", client.contractAddress, JSON.stringify(args)], () => client.nftInfo({ + tokenId: args.tokenId + }), options); +} +export interface AccountsNftContractInfoQuery extends AccountsNftReactQuery {} +export function useAccountsNftContractInfoQuery({ + client, + options +}: AccountsNftContractInfoQuery) { + return useQuery(["accountsNftContractInfo", client.contractAddress], () => client.contractInfo(), options); +} +export interface AccountsNftNumTokensQuery extends AccountsNftReactQuery {} +export function useAccountsNftNumTokensQuery({ + client, + options +}: AccountsNftNumTokensQuery) { + return useQuery(["accountsNftNumTokens", client.contractAddress], () => client.numTokens(), options); +} +export interface AccountsNftAllOperatorsQuery extends AccountsNftReactQuery { + args: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }; +} +export function useAccountsNftAllOperatorsQuery({ + client, + args, + options +}: AccountsNftAllOperatorsQuery) { + return useQuery(["accountsNftAllOperators", client.contractAddress, JSON.stringify(args)], () => client.allOperators({ + includeExpired: args.includeExpired, + limit: args.limit, + owner: args.owner, + startAfter: args.startAfter + }), options); +} +export interface AccountsNftApprovalsQuery extends AccountsNftReactQuery { + args: { + includeExpired?: boolean; + tokenId: string; + }; +} +export function useAccountsNftApprovalsQuery({ + client, + args, + options +}: AccountsNftApprovalsQuery) { + return useQuery(["accountsNftApprovals", client.contractAddress, JSON.stringify(args)], () => client.approvals({ + includeExpired: args.includeExpired, + tokenId: args.tokenId + }), options); +} +export interface AccountsNftApprovalQuery extends AccountsNftReactQuery { + args: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }; +} +export function useAccountsNftApprovalQuery({ + client, + args, + options +}: AccountsNftApprovalQuery) { + return useQuery(["accountsNftApproval", client.contractAddress, JSON.stringify(args)], () => client.approval({ + includeExpired: args.includeExpired, + spender: args.spender, + tokenId: args.tokenId + }), options); +} +export interface AccountsNftOwnerOfQuery extends AccountsNftReactQuery { + args: { + includeExpired?: boolean; + tokenId: string; + }; +} +export function useAccountsNftOwnerOfQuery({ + client, + args, + options +}: AccountsNftOwnerOfQuery) { + return useQuery(["accountsNftOwnerOf", client.contractAddress, JSON.stringify(args)], () => client.ownerOf({ + includeExpired: args.includeExpired, + tokenId: args.tokenId + }), options); +} +export interface AccountsNftAllDebtSharesQuery extends AccountsNftReactQuery { + args: { + limit?: number; + startAfter?: string[][]; + }; +} +export function useAccountsNftAllDebtSharesQuery({ + client, + args, + options +}: AccountsNftAllDebtSharesQuery) { + return useQuery(["accountsNftAllDebtShares", client.contractAddress, JSON.stringify(args)], () => client.allDebtShares({ + limit: args.limit, + startAfter: args.startAfter + }), options); +} +export interface AccountsNftProposedNewOwnerQuery extends AccountsNftReactQuery {} +export function useAccountsNftProposedNewOwnerQuery({ + client, + options +}: AccountsNftProposedNewOwnerQuery) { + return useQuery(["accountsNftProposedNewOwner", client.contractAddress], () => client.proposedNewOwner(), options); +} \ No newline at end of file diff --git a/__output__/idl-version/accounts-nft/AccountsNft.recoil.ts b/__output__/idl-version/accounts-nft/AccountsNft.recoil.ts new file mode 100644 index 00000000..04e6665b --- /dev/null +++ b/__output__/idl-version/accounts-nft/AccountsNft.recoil.ts @@ -0,0 +1,206 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { selectorFamily } from "recoil"; +import { cosmWasmClient } from "./chain"; +import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, TokensResponse, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse, String } from "./AccountsNft.types"; +import { AccountsNftQueryClient } from "./AccountsNft.client"; +type QueryClientParams = { + contractAddress: string; +}; +export const queryClient = selectorFamily({ + key: "accountsNftQueryClient", + get: ({ + contractAddress + }) => ({ + get + }) => { + const client = get(cosmWasmClient); + return new AccountsNftQueryClient(client, contractAddress); + } +}); +export const proposedNewOwnerSelector = selectorFamily; +}>({ + key: "accountsNftProposedNewOwner", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.proposedNewOwner(...params); + } +}); +export const allDebtSharesSelector = selectorFamily; +}>({ + key: "accountsNftAllDebtShares", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.allDebtShares(...params); + } +}); +export const ownerOfSelector = selectorFamily; +}>({ + key: "accountsNftOwnerOf", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.ownerOf(...params); + } +}); +export const approvalSelector = selectorFamily; +}>({ + key: "accountsNftApproval", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.approval(...params); + } +}); +export const approvalsSelector = selectorFamily; +}>({ + key: "accountsNftApprovals", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.approvals(...params); + } +}); +export const allOperatorsSelector = selectorFamily; +}>({ + key: "accountsNftAllOperators", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.allOperators(...params); + } +}); +export const numTokensSelector = selectorFamily; +}>({ + key: "accountsNftNumTokens", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.numTokens(...params); + } +}); +export const contractInfoSelector = selectorFamily; +}>({ + key: "accountsNftContractInfo", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.contractInfo(...params); + } +}); +export const nftInfoSelector = selectorFamily; +}>({ + key: "accountsNftNftInfo", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.nftInfo(...params); + } +}); +export const allNftInfoSelector = selectorFamily; +}>({ + key: "accountsNftAllNftInfo", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.allNftInfo(...params); + } +}); +export const tokensSelector = selectorFamily; +}>({ + key: "accountsNftTokens", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.tokens(...params); + } +}); +export const allTokensSelector = selectorFamily; +}>({ + key: "accountsNftAllTokens", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.allTokens(...params); + } +}); +export const minterSelector = selectorFamily; +}>({ + key: "accountsNftMinter", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.minter(...params); + } +}); \ No newline at end of file diff --git a/__output__/idl-version/accounts-nft/AccountsNft.types.ts b/__output__/idl-version/accounts-nft/AccountsNft.types.ts new file mode 100644 index 00000000..364d67d7 --- /dev/null +++ b/__output__/idl-version/accounts-nft/AccountsNft.types.ts @@ -0,0 +1,199 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + minter: string; + name: string; + symbol: string; + [k: string]: unknown; +} +export type ExecuteMsg = { + propose_new_owner: { + new_owner: string; + [k: string]: unknown; + }; +} | { + accept_ownership: { + [k: string]: unknown; + }; +} | { + mint: { + user: string; + [k: string]: unknown; + }; +} | { + transfer_nft: { + recipient: string; + token_id: string; + [k: string]: unknown; + }; +} | { + send_nft: { + contract: string; + msg: Binary; + token_id: string; + [k: string]: unknown; + }; +} | { + approve: { + expires?: Expiration | null; + spender: string; + token_id: string; + [k: string]: unknown; + }; +} | { + revoke: { + spender: string; + token_id: string; + [k: string]: unknown; + }; +} | { + approve_all: { + expires?: Expiration | null; + operator: string; + [k: string]: unknown; + }; +} | { + revoke_all: { + operator: string; + [k: string]: unknown; + }; +} | { + burn: { + token_id: string; + [k: string]: unknown; + }; +}; +export type Binary = string; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: { + [k: string]: unknown; + }; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type QueryMsg = { + proposed_new_owner: {}; +} | { + all_debt_shares: { + limit?: number | null; + start_after?: [string, string] | null; + }; +} | { + owner_of: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + approval: { + include_expired?: boolean | null; + spender: string; + token_id: string; + }; +} | { + approvals: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + all_operators: { + include_expired?: boolean | null; + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + num_tokens: {}; +} | { + contract_info: {}; +} | { + nft_info: { + token_id: string; + }; +} | { + all_nft_info: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + tokens: { + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + all_tokens: { + limit?: number | null; + start_after?: string | null; + }; +} | { + minter: {}; +}; +export type Uint128 = string; +export type ArrayOfSharesResponseItem = SharesResponseItem[]; +export interface SharesResponseItem { + denom: string; + shares: Uint128; + token_id: string; + [k: string]: unknown; +} +export interface AllNftInfoResponseForEmpty { + access: OwnerOfResponse; + info: NftInfoResponseForEmpty; + [k: string]: unknown; +} +export interface OwnerOfResponse { + approvals: Approval[]; + owner: string; + [k: string]: unknown; +} +export interface Approval { + expires: Expiration; + spender: string; + [k: string]: unknown; +} +export interface NftInfoResponseForEmpty { + extension: Empty; + token_uri?: string | null; + [k: string]: unknown; +} +export interface Empty { + [k: string]: unknown; +} +export interface OperatorsResponse { + operators: Approval[]; + [k: string]: unknown; +} +export interface TokensResponse { + tokens: string[]; + [k: string]: unknown; +} +export interface ApprovalResponse { + approval: Approval; + [k: string]: unknown; +} +export interface ApprovalsResponse { + approvals: Approval[]; + [k: string]: unknown; +} +export interface ContractInfoResponse { + name: string; + symbol: string; + [k: string]: unknown; +} +export interface MinterResponse { + minter: string; + [k: string]: unknown; +} +export interface NumTokensResponse { + count: number; + [k: string]: unknown; +} +export type String = string; \ No newline at end of file diff --git a/packages/ts-codegen/__tests__/ts-codegen.test.ts b/packages/ts-codegen/__tests__/ts-codegen.test.ts index cfdf2896..74fa6618 100644 --- a/packages/ts-codegen/__tests__/ts-codegen.test.ts +++ b/packages/ts-codegen/__tests__/ts-codegen.test.ts @@ -237,3 +237,18 @@ it('idl-version/cw3-fixed-multisig', async () => { await generateRecoil('Cw3FixedMultiSig', contractInfo, out); await generateReactQuery('Cw3FixedMultiSig', contractInfo, out); }) + +it('idl-version/accounts-nft', async () => { + const out = OUTPUT_DIR + '/idl-version/accounts-nft'; + const schemaDir = FIXTURE_DIR + '/idl-version/accounts-nft/'; + + const contractInfo = await readSchemas({ + schemaDir + }); + + await generateTypes('AccountsNft', contractInfo, out); + await generateClient('AccountsNft', contractInfo, out); + await generateMessageComposer('AccountsNft', contractInfo, out); + await generateRecoil('AccountsNft', contractInfo, out); + await generateReactQuery('AccountsNft', contractInfo, out); +}) diff --git a/packages/ts-codegen/src/utils/cleanse.ts b/packages/ts-codegen/src/utils/cleanse.ts index 406029cf..be543e22 100644 --- a/packages/ts-codegen/src/utils/cleanse.ts +++ b/packages/ts-codegen/src/utils/cleanse.ts @@ -6,6 +6,9 @@ const cleanFor = (str) => { if (/_for_[A-Z]/.test(str)) { return str.replace(/_for_/, 'For'); } + if (/_of_[A-Z]/.test(str)) { + return str.replace(/_of_/, 'Of'); + } return str; }; diff --git a/packages/wasm-ast-types/src/client/test/ts-client.account-nfts.spec.ts b/packages/wasm-ast-types/src/client/test/ts-client.account-nfts.spec.ts index a0ee8254..0f07a397 100644 --- a/packages/wasm-ast-types/src/client/test/ts-client.account-nfts.spec.ts +++ b/packages/wasm-ast-types/src/client/test/ts-client.account-nfts.spec.ts @@ -28,6 +28,13 @@ it('query classes', () => { )) }); +// it('query classes response', () => { +// expectCode(createTypeInterface( +// ctx, +// contract.responses.all_debt_shares +// )) +// }); + it('execute classes array types', () => { expectCode(createExecuteClass( ctx, From 800c1113e152c70ff5f2e48628c5d98a9b28b51b Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 14 Sep 2022 11:34:11 -0400 Subject: [PATCH 044/287] chore(release): publish - @cosmwasm/ts-codegen@0.16.2 - wasm-ast-types@0.11.2 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 8d7dc0f0..b2acddaa 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.16.2](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.16.1...@cosmwasm/ts-codegen@0.16.2) (2022-09-14) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.16.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.16.0...@cosmwasm/ts-codegen@0.16.1) (2022-09-13) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 20c69941..5095570e 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.16.1", + "version": "0.16.2", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -94,6 +94,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.11.1" + "wasm-ast-types": "^0.11.2" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index c8d00b6b..3a21d83e 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.11.2](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.11.1...wasm-ast-types@0.11.2) (2022-09-14) + +**Note:** Version bump only for package wasm-ast-types + + + + + ## [0.11.1](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.11.0...wasm-ast-types@0.11.1) (2022-09-13) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index b0db3c75..2f0df48c 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.11.1", + "version": "0.11.2", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From acbb8339cd8c8a9cb7311548832e08239516cfa8 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 14 Sep 2022 11:41:07 -0400 Subject: [PATCH 045/287] scalar schema example --- .../idl-version/accounts-nft/account-nft.json | 19 ++++++++++++++++++- .../accounts-nft/AccountsNft.client.ts | 9 ++++++++- .../AccountsNft.message-composer.ts | 2 +- .../accounts-nft/AccountsNft.react-query.ts | 9 ++++++++- .../accounts-nft/AccountsNft.recoil.ts | 16 +++++++++++++++- .../accounts-nft/AccountsNft.types.ts | 6 ++++-- .../ts-client.account-nfts.spec.ts.snap | 13 +++++++++++++ 7 files changed, 67 insertions(+), 7 deletions(-) diff --git a/__fixtures__/idl-version/accounts-nft/account-nft.json b/__fixtures__/idl-version/accounts-nft/account-nft.json index 0303666a..efc7f4ce 100644 --- a/__fixtures__/idl-version/accounts-nft/account-nft.json +++ b/__fixtures__/idl-version/accounts-nft/account-nft.json @@ -395,6 +395,18 @@ }, "additionalProperties": false }, + { + "type": "object", + "required": [ + "all_previous_owners" + ], + "properties": { + "all_previous_owners": { + "type": "string" + } + }, + "additionalProperties": false + }, { "description": "Return the owner of the given token, error if token does not exist", "type": "object", @@ -976,6 +988,11 @@ } } }, + "all_previous_owners": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "String", + "type": "string" + }, "all_tokens": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "TokensResponse", @@ -1387,4 +1404,4 @@ } } } -} +} \ No newline at end of file diff --git a/__output__/idl-version/accounts-nft/AccountsNft.client.ts b/__output__/idl-version/accounts-nft/AccountsNft.client.ts index 48fab63a..3acb582e 100644 --- a/__output__/idl-version/accounts-nft/AccountsNft.client.ts +++ b/__output__/idl-version/accounts-nft/AccountsNft.client.ts @@ -6,7 +6,7 @@ import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; import { Coin, StdFee } from "@cosmjs/amino"; -import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, TokensResponse, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse, String } from "./AccountsNft.types"; +import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, String, TokensResponse, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse } from "./AccountsNft.types"; export interface AccountsNftReadOnlyInterface { contractAddress: string; proposedNewOwner: () => Promise; @@ -17,6 +17,7 @@ export interface AccountsNftReadOnlyInterface { limit?: number; startAfter?: string[][]; }) => Promise; + allPreviousOwners: () => Promise; ownerOf: ({ includeExpired, tokenId @@ -92,6 +93,7 @@ export class AccountsNftQueryClient implements AccountsNftReadOnlyInterface { this.contractAddress = contractAddress; this.proposedNewOwner = this.proposedNewOwner.bind(this); this.allDebtShares = this.allDebtShares.bind(this); + this.allPreviousOwners = this.allPreviousOwners.bind(this); this.ownerOf = this.ownerOf.bind(this); this.approval = this.approval.bind(this); this.approvals = this.approvals.bind(this); @@ -124,6 +126,11 @@ export class AccountsNftQueryClient implements AccountsNftReadOnlyInterface { } }); }; + allPreviousOwners = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_previous_owners: {} + }); + }; ownerOf = async ({ includeExpired, tokenId diff --git a/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts b/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts index d09bda4a..21196923 100644 --- a/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts +++ b/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts @@ -8,7 +8,7 @@ import { Coin } from "@cosmjs/amino"; import { MsgExecuteContractEncodeObject } from "cosmwasm"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; -import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, TokensResponse, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse, String } from "./AccountsNft.types"; +import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, String, TokensResponse, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse } from "./AccountsNft.types"; export interface AccountsNftMessage { contractAddress: string; sender: string; diff --git a/__output__/idl-version/accounts-nft/AccountsNft.react-query.ts b/__output__/idl-version/accounts-nft/AccountsNft.react-query.ts index 5ce72700..522d621a 100644 --- a/__output__/idl-version/accounts-nft/AccountsNft.react-query.ts +++ b/__output__/idl-version/accounts-nft/AccountsNft.react-query.ts @@ -5,7 +5,7 @@ */ import { UseQueryOptions, useQuery } from "react-query"; -import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, TokensResponse, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse, String } from "./AccountsNft.types"; +import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, String, TokensResponse, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse } from "./AccountsNft.types"; import { AccountsNftQueryClient } from "./AccountsNft.client"; export interface AccountsNftReactQuery { client: AccountsNftQueryClient; @@ -166,6 +166,13 @@ export function useAccountsNftOwnerOfQuery({ tokenId: args.tokenId }), options); } +export interface AccountsNftAllPreviousOwnersQuery extends AccountsNftReactQuery {} +export function useAccountsNftAllPreviousOwnersQuery({ + client, + options +}: AccountsNftAllPreviousOwnersQuery) { + return useQuery(["accountsNftAllPreviousOwners", client.contractAddress], () => client.allPreviousOwners(), options); +} export interface AccountsNftAllDebtSharesQuery extends AccountsNftReactQuery { args: { limit?: number; diff --git a/__output__/idl-version/accounts-nft/AccountsNft.recoil.ts b/__output__/idl-version/accounts-nft/AccountsNft.recoil.ts index 04e6665b..6a149297 100644 --- a/__output__/idl-version/accounts-nft/AccountsNft.recoil.ts +++ b/__output__/idl-version/accounts-nft/AccountsNft.recoil.ts @@ -6,7 +6,7 @@ import { selectorFamily } from "recoil"; import { cosmWasmClient } from "./chain"; -import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, TokensResponse, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse, String } from "./AccountsNft.types"; +import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, String, TokensResponse, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse } from "./AccountsNft.types"; import { AccountsNftQueryClient } from "./AccountsNft.client"; type QueryClientParams = { contractAddress: string; @@ -50,6 +50,20 @@ export const allDebtSharesSelector = selectorFamily; +}>({ + key: "accountsNftAllPreviousOwners", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.allPreviousOwners(...params); + } +}); export const ownerOfSelector = selectorFamily; }>({ diff --git a/__output__/idl-version/accounts-nft/AccountsNft.types.ts b/__output__/idl-version/accounts-nft/AccountsNft.types.ts index 364d67d7..50f93d61 100644 --- a/__output__/idl-version/accounts-nft/AccountsNft.types.ts +++ b/__output__/idl-version/accounts-nft/AccountsNft.types.ts @@ -86,6 +86,8 @@ export type QueryMsg = { limit?: number | null; start_after?: [string, string] | null; }; +} | { + all_previous_owners: string; } | { owner_of: { include_expired?: boolean | null; @@ -171,6 +173,7 @@ export interface OperatorsResponse { operators: Approval[]; [k: string]: unknown; } +export type String = string; export interface TokensResponse { tokens: string[]; [k: string]: unknown; @@ -195,5 +198,4 @@ export interface MinterResponse { export interface NumTokensResponse { count: number; [k: string]: unknown; -} -export type String = string; \ No newline at end of file +} \ No newline at end of file diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap index e3d3eec7..eb3400fa 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap @@ -12,6 +12,7 @@ exports[`execute classes array types 1`] = ` this.contractAddress = contractAddress; this.proposedNewOwner = this.proposedNewOwner.bind(this); this.allDebtShares = this.allDebtShares.bind(this); + this.allPreviousOwners = this.allPreviousOwners.bind(this); this.ownerOf = this.ownerOf.bind(this); this.approval = this.approval.bind(this); this.approvals = this.approvals.bind(this); @@ -44,6 +45,11 @@ exports[`execute classes array types 1`] = ` } }, fee, memo, funds); }; + allPreviousOwners = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + all_previous_owners: {} + }, fee, memo, funds); + }; ownerOf = async ({ includeExpired, tokenId @@ -195,6 +201,7 @@ exports[`execute interfaces no extends 1`] = ` limit?: number; startAfter?: string[][]; }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + allPreviousOwners: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; ownerOf: ({ includeExpired, tokenId @@ -275,6 +282,7 @@ exports[`query classes 1`] = ` this.contractAddress = contractAddress; this.proposedNewOwner = this.proposedNewOwner.bind(this); this.allDebtShares = this.allDebtShares.bind(this); + this.allPreviousOwners = this.allPreviousOwners.bind(this); this.ownerOf = this.ownerOf.bind(this); this.approval = this.approval.bind(this); this.approvals = this.approvals.bind(this); @@ -307,6 +315,11 @@ exports[`query classes 1`] = ` } }); }; + allPreviousOwners = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_previous_owners: {} + }); + }; ownerOf = async ({ includeExpired, tokenId From f849d4199977b2319e8ebbfd58bc89e3f9b58181 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 14 Sep 2022 12:00:58 -0400 Subject: [PATCH 046/287] update cleanse --- .../idl-version/accounts-nft/account-nft.json | 53 ++++++++++++++++++- .../accounts-nft/AccountsNft.client.ts | 24 ++++++++- .../AccountsNft.message-composer.ts | 2 +- .../accounts-nft/AccountsNft.react-query.ts | 18 ++++++- .../accounts-nft/AccountsNft.recoil.ts | 16 +++++- .../accounts-nft/AccountsNft.types.ts | 7 +++ packages/ts-codegen/src/utils/cleanse.ts | 11 ++-- .../ts-client.account-nfts.spec.ts.snap | 37 +++++++++++++ 8 files changed, 158 insertions(+), 10 deletions(-) diff --git a/__fixtures__/idl-version/accounts-nft/account-nft.json b/__fixtures__/idl-version/accounts-nft/account-nft.json index efc7f4ce..d2fa6f30 100644 --- a/__fixtures__/idl-version/accounts-nft/account-nft.json +++ b/__fixtures__/idl-version/accounts-nft/account-nft.json @@ -355,6 +355,39 @@ }, "additionalProperties": false }, + { + "type": "object", + "required": [ + "allowed_vaults" + ], + "properties": { + "allowed_vaults": { + "type": "object", + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "start_after": { + "anyOf": [ + { + "$ref": "#/definitions/VaultBase_for_String" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "description": "Enumerate debt shares for all token positions; start_after accepts (token_id, denom)", "type": "object", @@ -698,7 +731,12 @@ }, "additionalProperties": false } - ] + ], + "definitions": { + "VaultBase_for_String": { + "type": "string" + } + } }, "migrate": null, "sudo": null, @@ -1010,6 +1048,19 @@ } } }, + "allowed_vaults": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Array_of_VaultBase_for_String", + "type": "array", + "items": { + "$ref": "#/definitions/VaultBase_for_String" + }, + "definitions": { + "VaultBase_for_String": { + "type": "string" + } + } + }, "approval": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "ApprovalResponse", diff --git a/__output__/idl-version/accounts-nft/AccountsNft.client.ts b/__output__/idl-version/accounts-nft/AccountsNft.client.ts index 3acb582e..02276b5d 100644 --- a/__output__/idl-version/accounts-nft/AccountsNft.client.ts +++ b/__output__/idl-version/accounts-nft/AccountsNft.client.ts @@ -6,10 +6,17 @@ import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; import { Coin, StdFee } from "@cosmjs/amino"; -import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, String, TokensResponse, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse } from "./AccountsNft.types"; +import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, VaultBaseForString, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, String, TokensResponse, ArrayOfVaultBaseForString, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse } from "./AccountsNft.types"; export interface AccountsNftReadOnlyInterface { contractAddress: string; proposedNewOwner: () => Promise; + allowedVaults: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: VaultBaseForString; + }) => Promise; allDebtShares: ({ limit, startAfter @@ -92,6 +99,7 @@ export class AccountsNftQueryClient implements AccountsNftReadOnlyInterface { this.client = client; this.contractAddress = contractAddress; this.proposedNewOwner = this.proposedNewOwner.bind(this); + this.allowedVaults = this.allowedVaults.bind(this); this.allDebtShares = this.allDebtShares.bind(this); this.allPreviousOwners = this.allPreviousOwners.bind(this); this.ownerOf = this.ownerOf.bind(this); @@ -112,6 +120,20 @@ export class AccountsNftQueryClient implements AccountsNftReadOnlyInterface { proposed_new_owner: {} }); }; + allowedVaults = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: VaultBaseForString; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + allowed_vaults: { + limit, + start_after: startAfter + } + }); + }; allDebtShares = async ({ limit, startAfter diff --git a/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts b/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts index 21196923..f0397c4a 100644 --- a/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts +++ b/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts @@ -8,7 +8,7 @@ import { Coin } from "@cosmjs/amino"; import { MsgExecuteContractEncodeObject } from "cosmwasm"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; -import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, String, TokensResponse, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse } from "./AccountsNft.types"; +import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, VaultBaseForString, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, String, TokensResponse, ArrayOfVaultBaseForString, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse } from "./AccountsNft.types"; export interface AccountsNftMessage { contractAddress: string; sender: string; diff --git a/__output__/idl-version/accounts-nft/AccountsNft.react-query.ts b/__output__/idl-version/accounts-nft/AccountsNft.react-query.ts index 522d621a..641b624b 100644 --- a/__output__/idl-version/accounts-nft/AccountsNft.react-query.ts +++ b/__output__/idl-version/accounts-nft/AccountsNft.react-query.ts @@ -5,7 +5,7 @@ */ import { UseQueryOptions, useQuery } from "react-query"; -import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, String, TokensResponse, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse } from "./AccountsNft.types"; +import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, VaultBaseForString, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, String, TokensResponse, ArrayOfVaultBaseForString, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse } from "./AccountsNft.types"; import { AccountsNftQueryClient } from "./AccountsNft.client"; export interface AccountsNftReactQuery { client: AccountsNftQueryClient; @@ -189,6 +189,22 @@ export function useAccountsNftAllDebtSharesQuery extends AccountsNftReactQuery { + args: { + limit?: number; + startAfter?: VaultBaseForString; + }; +} +export function useAccountsNftAllowedVaultsQuery({ + client, + args, + options +}: AccountsNftAllowedVaultsQuery) { + return useQuery(["accountsNftAllowedVaults", client.contractAddress, JSON.stringify(args)], () => client.allowedVaults({ + limit: args.limit, + startAfter: args.startAfter + }), options); +} export interface AccountsNftProposedNewOwnerQuery extends AccountsNftReactQuery {} export function useAccountsNftProposedNewOwnerQuery({ client, diff --git a/__output__/idl-version/accounts-nft/AccountsNft.recoil.ts b/__output__/idl-version/accounts-nft/AccountsNft.recoil.ts index 6a149297..d8d0274b 100644 --- a/__output__/idl-version/accounts-nft/AccountsNft.recoil.ts +++ b/__output__/idl-version/accounts-nft/AccountsNft.recoil.ts @@ -6,7 +6,7 @@ import { selectorFamily } from "recoil"; import { cosmWasmClient } from "./chain"; -import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, String, TokensResponse, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse } from "./AccountsNft.types"; +import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, VaultBaseForString, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, String, TokensResponse, ArrayOfVaultBaseForString, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse } from "./AccountsNft.types"; import { AccountsNftQueryClient } from "./AccountsNft.client"; type QueryClientParams = { contractAddress: string; @@ -36,6 +36,20 @@ export const proposedNewOwnerSelector = selectorFamily; +}>({ + key: "accountsNftAllowedVaults", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.allowedVaults(...params); + } +}); export const allDebtSharesSelector = selectorFamily; }>({ diff --git a/__output__/idl-version/accounts-nft/AccountsNft.types.ts b/__output__/idl-version/accounts-nft/AccountsNft.types.ts index 50f93d61..975a314a 100644 --- a/__output__/idl-version/accounts-nft/AccountsNft.types.ts +++ b/__output__/idl-version/accounts-nft/AccountsNft.types.ts @@ -81,6 +81,11 @@ export type Timestamp = Uint64; export type Uint64 = string; export type QueryMsg = { proposed_new_owner: {}; +} | { + allowed_vaults: { + limit?: number | null; + start_after?: VaultBaseForString | null; + }; } | { all_debt_shares: { limit?: number | null; @@ -138,6 +143,7 @@ export type QueryMsg = { } | { minter: {}; }; +export type VaultBaseForString = string; export type Uint128 = string; export type ArrayOfSharesResponseItem = SharesResponseItem[]; export interface SharesResponseItem { @@ -178,6 +184,7 @@ export interface TokensResponse { tokens: string[]; [k: string]: unknown; } +export type ArrayOfVaultBaseForString = VaultBaseForString[]; export interface ApprovalResponse { approval: Approval; [k: string]: unknown; diff --git a/packages/ts-codegen/src/utils/cleanse.ts b/packages/ts-codegen/src/utils/cleanse.ts index be543e22..2e32b7c6 100644 --- a/packages/ts-codegen/src/utils/cleanse.ts +++ b/packages/ts-codegen/src/utils/cleanse.ts @@ -1,14 +1,15 @@ +import { pascal } from "case"; + const cleanFor = (str) => { /* 1. look at first char after _for_ 2. ONLY if you find capitals after, modify it */ - if (/_for_[A-Z]/.test(str)) { - return str.replace(/_for_/, 'For'); - } - if (/_of_[A-Z]/.test(str)) { - return str.replace(/_of_/, 'Of'); + while (/_[a-z]+_[A-Z]/.test(str)) { + const m = str.match(/(_[a-z]+_)[A-Z]/); + str = str.replace(m[1], pascal(m[1])); } + return str; }; diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap index eb3400fa..254ba6b0 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap @@ -11,6 +11,7 @@ exports[`execute classes array types 1`] = ` this.sender = sender; this.contractAddress = contractAddress; this.proposedNewOwner = this.proposedNewOwner.bind(this); + this.allowedVaults = this.allowedVaults.bind(this); this.allDebtShares = this.allDebtShares.bind(this); this.allPreviousOwners = this.allPreviousOwners.bind(this); this.ownerOf = this.ownerOf.bind(this); @@ -31,6 +32,20 @@ exports[`execute classes array types 1`] = ` proposed_new_owner: {} }, fee, memo, funds); }; + allowedVaults = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: VaultBase_for_String; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + allowed_vaults: { + limit, + start_after: startAfter + } + }, fee, memo, funds); + }; allDebtShares = async ({ limit, startAfter @@ -194,6 +209,13 @@ exports[`execute interfaces no extends 1`] = ` contractAddress: string; sender: string; proposedNewOwner: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + allowedVaults: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: VaultBase_for_String; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; allDebtShares: ({ limit, startAfter @@ -281,6 +303,7 @@ exports[`query classes 1`] = ` this.client = client; this.contractAddress = contractAddress; this.proposedNewOwner = this.proposedNewOwner.bind(this); + this.allowedVaults = this.allowedVaults.bind(this); this.allDebtShares = this.allDebtShares.bind(this); this.allPreviousOwners = this.allPreviousOwners.bind(this); this.ownerOf = this.ownerOf.bind(this); @@ -301,6 +324,20 @@ exports[`query classes 1`] = ` proposed_new_owner: {} }); }; + allowedVaults = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: VaultBase_for_String; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + allowed_vaults: { + limit, + start_after: startAfter + } + }); + }; allDebtShares = async ({ limit, startAfter From b7fc988703af9305db47b3259f7e2a95db4665ba Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 14 Sep 2022 12:01:06 -0400 Subject: [PATCH 047/287] chore(release): publish - @cosmwasm/ts-codegen@0.16.3 - wasm-ast-types@0.11.3 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index b2acddaa..740050a7 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.16.3](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.16.2...@cosmwasm/ts-codegen@0.16.3) (2022-09-14) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.16.2](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.16.1...@cosmwasm/ts-codegen@0.16.2) (2022-09-14) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 5095570e..682e5885 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.16.2", + "version": "0.16.3", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -94,6 +94,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.11.2" + "wasm-ast-types": "^0.11.3" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 3a21d83e..65c53686 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.11.3](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.11.2...wasm-ast-types@0.11.3) (2022-09-14) + +**Note:** Version bump only for package wasm-ast-types + + + + + ## [0.11.2](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.11.1...wasm-ast-types@0.11.2) (2022-09-14) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index 2f0df48c..128129cf 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.11.2", + "version": "0.11.3", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From b20316d63b85ac8ce2d75ed90124087b7c50c5b4 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Thu, 15 Sep 2022 15:28:41 -0400 Subject: [PATCH 048/287] readme --- README.md | 1 + packages/ts-codegen/README.md | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 88248d59..562ad087 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ npm install -g @cosmwasm/ts-codegen The quickest and easiest way to interact with CosmWasm Contracts. `@cosmwasm/ts-codegen` converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code. +🎥 [Checkout our video playlist](https://www.youtube.com/watch?v=D_A5V2PfNLA&list=PL-lMkVv7GZwz1KO3jANwr5W4MoziruXwK) to learn how to use `ts-codegen`! ## Table of contents - [@cosmwasm/ts-codegen](#cosmwasmts-codegen) diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index 17d5dd4d..562ad087 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -21,6 +21,7 @@ npm install -g @cosmwasm/ts-codegen The quickest and easiest way to interact with CosmWasm Contracts. `@cosmwasm/ts-codegen` converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code. +🎥 [Checkout our video playlist](https://www.youtube.com/watch?v=D_A5V2PfNLA&list=PL-lMkVv7GZwz1KO3jANwr5W4MoziruXwK) to learn how to use `ts-codegen`! ## Table of contents - [@cosmwasm/ts-codegen](#cosmwasmts-codegen) @@ -477,3 +478,4 @@ Checkout these related projects: ## Credits 🛠 Built by Cosmology — if you like our tools, please consider delegating to [our validator ⚛️](https://cosmology.tech/validator) + From 15ad71ea06140dc79f594b946c52f3efbcf3a295 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Thu, 15 Sep 2022 15:28:44 -0400 Subject: [PATCH 049/287] chore(release): publish - @cosmwasm/ts-codegen@0.16.4 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 740050a7..f0820eea 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.16.4](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.16.3...@cosmwasm/ts-codegen@0.16.4) (2022-09-15) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.16.3](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.16.2...@cosmwasm/ts-codegen@0.16.3) (2022-09-14) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 682e5885..32114419 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.16.3", + "version": "0.16.4", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From 4aef1195851b0cd43556d53cd3b9880034a3fa5b Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 21 Sep 2022 17:29:55 -0500 Subject: [PATCH 050/287] readme --- README.md | 2 +- packages/ts-codegen/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 562ad087..b5f4dbea 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Generate TypeScript SDKs for your CosmWasm smart contracts

- +

diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index 562ad087..b5f4dbea 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -3,7 +3,7 @@ Generate TypeScript SDKs for your CosmWasm smart contracts

- +

From d5c403bd9db776c23428a53db346accb111b3098 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 21 Sep 2022 17:30:00 -0500 Subject: [PATCH 051/287] chore(release): publish - @cosmwasm/ts-codegen@0.16.5 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index f0820eea..db299bb2 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.16.5](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.16.4...@cosmwasm/ts-codegen@0.16.5) (2022-09-21) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.16.4](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.16.3...@cosmwasm/ts-codegen@0.16.4) (2022-09-15) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 32114419..5c2943a0 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.16.4", + "version": "0.16.5", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From 737d1f2e6cb03f6e814e985831d1845373205ea8 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Sun, 2 Oct 2022 01:54:06 -0500 Subject: [PATCH 052/287] contracts --- packages/ts-codegen/src/commands/install.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/ts-codegen/src/commands/install.ts b/packages/ts-codegen/src/commands/install.ts index 3cedf009..2005cf3f 100644 --- a/packages/ts-codegen/src/commands/install.ts +++ b/packages/ts-codegen/src/commands/install.ts @@ -44,11 +44,14 @@ export default async (argv) => { message: 'which chain contracts do you want to support?', choices: [ - 'stargaze-claim', - 'stargaze-ics721', - 'stargaze-minter', - 'stargaze-royalty-group', - 'stargaze-sg721', + 'stargaze-base-factory', + 'stargaze-base-minter', + 'stargaze-sg721-base', + 'stargaze-sg721-metdata-onchain', + 'stargaze-sg721-nt', + 'stargaze-splits', + 'stargaze-vending-factory', + 'stargaze-vending-minter', 'stargaze-whitelist', 'wasmswap' ].map(name => { From 98faaab5547b61074b697d7e5728a1788ef52826 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Sun, 2 Oct 2022 01:54:15 -0500 Subject: [PATCH 053/287] chore(release): publish - @cosmwasm/ts-codegen@0.17.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index db299bb2..f413848c 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.17.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.16.5...@cosmwasm/ts-codegen@0.17.0) (2022-10-02) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.16.5](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.16.4...@cosmwasm/ts-codegen@0.16.5) (2022-09-21) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 5c2943a0..f5f55148 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.16.5", + "version": "0.17.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From 653f6cda264e5e79237336885fc24fd361d8131f Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 10 Oct 2022 14:33:53 -0700 Subject: [PATCH 054/287] fixture for #71 --- __fixtures__/issues/71/execute_msg.json | 645 ++++++++++++++++++ .../client/test/ts-client.issue-71.test.ts | 51 ++ 2 files changed, 696 insertions(+) create mode 100644 __fixtures__/issues/71/execute_msg.json create mode 100644 packages/wasm-ast-types/src/client/test/ts-client.issue-71.test.ts diff --git a/__fixtures__/issues/71/execute_msg.json b/__fixtures__/issues/71/execute_msg.json new file mode 100644 index 00000000..af6f24cd --- /dev/null +++ b/__fixtures__/issues/71/execute_msg.json @@ -0,0 +1,645 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "receive" + ], + "properties": { + "receive": { + "$ref": "#/definitions/Cw20ReceiveMsg" + } + }, + "additionalProperties": false + }, + { + "description": "Executable only by `config.owner`. Facilitates updating `config.fee_collector`, `config.generator_address`, `config.lp_token_code_id` parameters.", + "type": "object", + "required": [ + "update_config" + ], + "properties": { + "update_config": { + "type": "object", + "properties": { + "fee_collector": { + "type": [ + "string", + "null" + ] + }, + "generator_address": { + "type": [ + "string", + "null" + ] + }, + "lp_token_code_id": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Executable only by `pool_config.fee_info.developer_addr` or `config.owner` if its not set. Facilitates enabling / disabling new pool instances creation (`pool_config.is_disabled`) , and updating Fee (` pool_config.fee_info`) for new pool instances", + "type": "object", + "required": [ + "update_pool_config" + ], + "properties": { + "update_pool_config": { + "type": "object", + "required": [ + "pool_type" + ], + "properties": { + "is_disabled": { + "type": [ + "boolean", + "null" + ] + }, + "new_fee_info": { + "anyOf": [ + { + "$ref": "#/definitions/FeeInfo" + }, + { + "type": "null" + } + ] + }, + "pool_type": { + "$ref": "#/definitions/PoolType" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Adds a new pool with a new [`PoolType`] Key.", + "type": "object", + "required": [ + "add_to_registery" + ], + "properties": { + "add_to_registery": { + "type": "object", + "required": [ + "new_pool_config" + ], + "properties": { + "new_pool_config": { + "$ref": "#/definitions/PoolConfig" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Creates a new pool with the specified parameters in the `asset_infos` variable.", + "type": "object", + "required": [ + "create_pool_instance" + ], + "properties": { + "create_pool_instance": { + "type": "object", + "required": [ + "asset_infos", + "pool_type" + ], + "properties": { + "asset_infos": { + "type": "array", + "items": { + "$ref": "#/definitions/AssetInfo" + } + }, + "init_params": { + "anyOf": [ + { + "$ref": "#/definitions/Binary" + }, + { + "type": "null" + } + ] + }, + "lp_token_name": { + "type": [ + "string", + "null" + ] + }, + "lp_token_symbol": { + "type": [ + "string", + "null" + ] + }, + "pool_type": { + "$ref": "#/definitions/PoolType" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "join_pool" + ], + "properties": { + "join_pool": { + "type": "object", + "required": [ + "pool_id" + ], + "properties": { + "assets": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Asset" + } + }, + "auto_stake": { + "type": [ + "boolean", + "null" + ] + }, + "lp_to_mint": { + "anyOf": [ + { + "$ref": "#/definitions/Uint128" + }, + { + "type": "null" + } + ] + }, + "pool_id": { + "$ref": "#/definitions/Uint128" + }, + "recipient": { + "type": [ + "string", + "null" + ] + }, + "slippage_tolerance": { + "anyOf": [ + { + "$ref": "#/definitions/Decimal" + }, + { + "type": "null" + } + ] + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "swap" + ], + "properties": { + "swap": { + "type": "object", + "required": [ + "swap_request" + ], + "properties": { + "recipient": { + "type": [ + "string", + "null" + ] + }, + "swap_request": { + "$ref": "#/definitions/SingleSwapRequest" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "ProposeNewOwner creates an offer for a new owner. The validity period of the offer is set in the `expires_in` variable.", + "type": "object", + "required": [ + "propose_new_owner" + ], + "properties": { + "propose_new_owner": { + "type": "object", + "required": [ + "expires_in", + "owner" + ], + "properties": { + "expires_in": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "owner": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "DropOwnershipProposal removes the existing offer for the new owner.", + "type": "object", + "required": [ + "drop_ownership_proposal" + ], + "properties": { + "drop_ownership_proposal": { + "type": "object" + } + }, + "additionalProperties": false + }, + { + "description": "Used to claim(approve) new owner proposal, thus changing contract's owner", + "type": "object", + "required": [ + "claim_ownership" + ], + "properties": { + "claim_ownership": { + "type": "object" + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "Asset": { + "title": "Description - This enum describes a asset (native or CW20).", + "type": "object", + "required": [ + "amount", + "info" + ], + "properties": { + "amount": { + "description": "A token amount", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] + }, + "info": { + "description": "Information about an asset stored in a [`AssetInfo`] struct", + "allOf": [ + { + "$ref": "#/definitions/AssetInfo" + } + ] + } + } + }, + "AssetInfo": { + "description": "This enum describes available Token types.", + "oneOf": [ + { + "description": "Non-native Token", + "type": "object", + "required": [ + "token" + ], + "properties": { + "token": { + "type": "object", + "required": [ + "contract_addr" + ], + "properties": { + "contract_addr": { + "$ref": "#/definitions/Addr" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Native token", + "type": "object", + "required": [ + "native_token" + ], + "properties": { + "native_token": { + "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ] + }, + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec", + "type": "string" + }, + "Cw20ReceiveMsg": { + "description": "Cw20ReceiveMsg should be de/serialized under `Receive()` variant in a ExecuteMsg", + "type": "object", + "required": [ + "amount", + "msg", + "sender" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "msg": { + "$ref": "#/definitions/Binary" + }, + "sender": { + "type": "string" + } + } + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "FeeInfo": { + "title": "Description - This struct describes the Fee configuration supported by a particular pool type.", + "type": "object", + "required": [ + "dev_fee_percent", + "protocol_fee_percent", + "total_fee_bps" + ], + "properties": { + "dev_fee_percent": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "developer_addr": { + "anyOf": [ + { + "$ref": "#/definitions/Addr" + }, + { + "type": "null" + } + ] + }, + "protocol_fee_percent": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "total_fee_bps": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + } + } + }, + "PoolConfig": { + "description": "This struct stores a pool type's configuration.", + "type": "object", + "required": [ + "code_id", + "fee_info", + "is_disabled", + "is_generator_disabled", + "pool_type" + ], + "properties": { + "code_id": { + "description": "ID of contract which is used to create pools of this type", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "fee_info": { + "$ref": "#/definitions/FeeInfo" + }, + "is_disabled": { + "description": "Whether a pool type is disabled or not. If it is disabled, new pools cannot be created, but existing ones can still read the pool configuration", + "type": "boolean" + }, + "is_generator_disabled": { + "description": "Setting this to true means that pools of this type will not be able to get added to generator", + "type": "boolean" + }, + "pool_type": { + "description": "The pools type (provided in a [`PoolType`])", + "allOf": [ + { + "$ref": "#/definitions/PoolType" + } + ] + } + } + }, + "PoolType": { + "description": "This enum describes the key for the different Pool types supported by Dexter ## Available pool types ``` Xyk Stable2Pool Weighted Stable3Pool Custom(String::from(\"Custom\")); ```", + "oneOf": [ + { + "description": "XYK pool type", + "type": "object", + "required": [ + "xyk" + ], + "properties": { + "xyk": { + "type": "object" + } + }, + "additionalProperties": false + }, + { + "description": "Stable pool type", + "type": "object", + "required": [ + "stable2_pool" + ], + "properties": { + "stable2_pool": { + "type": "object" + } + }, + "additionalProperties": false + }, + { + "description": "Stable pool type", + "type": "object", + "required": [ + "stable3_pool" + ], + "properties": { + "stable3_pool": { + "type": "object" + } + }, + "additionalProperties": false + }, + { + "description": "Weighted pool type", + "type": "object", + "required": [ + "weighted" + ], + "properties": { + "weighted": { + "type": "object" + } + }, + "additionalProperties": false + }, + { + "description": "Custom pool type", + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "SingleSwapRequest": { + "type": "object", + "required": [ + "amount", + "asset_in", + "asset_out", + "pool_id", + "swap_type" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "asset_in": { + "$ref": "#/definitions/AssetInfo" + }, + "asset_out": { + "$ref": "#/definitions/AssetInfo" + }, + "belief_price": { + "anyOf": [ + { + "$ref": "#/definitions/Decimal" + }, + { + "type": "null" + } + ] + }, + "max_spread": { + "anyOf": [ + { + "$ref": "#/definitions/Decimal" + }, + { + "type": "null" + } + ] + }, + "pool_id": { + "$ref": "#/definitions/Uint128" + }, + "swap_type": { + "$ref": "#/definitions/SwapType" + } + } + }, + "SwapType": { + "description": "This enum describes available Swap types. ## Available swap types ``` GiveIn :: When we have the number of tokens being provided by the user to the pool in the swap request GiveOut :: When we have the number of tokens to be sent to the user from the pool in the swap request ```", + "oneOf": [ + { + "type": "object", + "required": [ + "give_in" + ], + "properties": { + "give_in": { + "type": "object" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "give_out" + ], + "properties": { + "give_out": { + "type": "object" + } + }, + "additionalProperties": false + }, + { + "description": "Custom swap type", + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/wasm-ast-types/src/client/test/ts-client.issue-71.test.ts b/packages/wasm-ast-types/src/client/test/ts-client.issue-71.test.ts new file mode 100644 index 00000000..18f48125 --- /dev/null +++ b/packages/wasm-ast-types/src/client/test/ts-client.issue-71.test.ts @@ -0,0 +1,51 @@ +import { globContracts, makeContext } from '../../../test-utils' +import { + createQueryClass, + createExecuteClass, + createExecuteInterface, + createTypeInterface +} from '../client' +import { expectCode } from '../../../test-utils'; +import cases from 'jest-in-case'; + +const contracts = globContracts('issues/71'); + +cases('execute_msg_for__empty', async opts => { + const ctx = makeContext(opts.content); + expectCode(createTypeInterface( + ctx, + opts.content + )); +}, contracts); + +cases('query classes', async opts => { + const ctx = makeContext(opts.content); + expectCode(createQueryClass( + ctx, + 'SG721QueryClient', + 'SG721ReadOnlyInstance', + opts.content + )) +}, contracts); + +cases('execute class', async opts => { + const ctx = makeContext(opts.content); + expectCode(createExecuteClass( + ctx, + 'SG721Client', + 'SG721Instance', + null, + opts.content + )) +}, contracts); + +cases('execute interface', async opts => { + const ctx = makeContext(opts.content); + expectCode(createExecuteInterface( + ctx, + 'SG721Instance', + null, + opts.content + )) +}, contracts); + From ac7f8acee2f843cba77fa71427bd8e9344c4c70d Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 10 Oct 2022 18:11:55 -0700 Subject: [PATCH 055/287] fix #71 --- .../ts-client.issue-71.test.ts.snap | 432 ++++++++++++++++++ packages/wasm-ast-types/src/utils/types.ts | 35 +- 2 files changed, 457 insertions(+), 10 deletions(-) create mode 100644 packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-71.test.ts.snap diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-71.test.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-71.test.ts.snap new file mode 100644 index 00000000..29fbf717 --- /dev/null +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-71.test.ts.snap @@ -0,0 +1,432 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`execute class /issues/71/execute_msg.json 1`] = ` +"export class SG721Client implements SG721Instance { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receive = this.receive.bind(this); + this.updateConfig = this.updateConfig.bind(this); + this.updatePoolConfig = this.updatePoolConfig.bind(this); + this.addToRegistery = this.addToRegistery.bind(this); + this.createPoolInstance = this.createPoolInstance.bind(this); + this.joinPool = this.joinPool.bind(this); + this.swap = this.swap.bind(this); + this.proposeNewOwner = this.proposeNewOwner.bind(this); + this.dropOwnershipProposal = this.dropOwnershipProposal.bind(this); + this.claimOwnership = this.claimOwnership.bind(this); + } + + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, funds); + }; + updateConfig = async ({ + feeCollector, + generatorAddress, + lpTokenCodeId + }: { + feeCollector?: string; + generatorAddress?: string; + lpTokenCodeId?: number; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_config: { + fee_collector: feeCollector, + generator_address: generatorAddress, + lp_token_code_id: lpTokenCodeId + } + }, fee, memo, funds); + }; + updatePoolConfig = async ({ + isDisabled, + newFeeInfo, + poolType + }: { + isDisabled?: boolean; + newFeeInfo?: FeeInfo; + poolType: PoolType; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_pool_config: { + is_disabled: isDisabled, + new_fee_info: newFeeInfo, + pool_type: poolType + } + }, fee, memo, funds); + }; + addToRegistery = async ({ + newPoolConfig + }: { + newPoolConfig: PoolConfig; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_to_registery: { + new_pool_config: newPoolConfig + } + }, fee, memo, funds); + }; + createPoolInstance = async ({ + assetInfos, + initParams, + lpTokenName, + lpTokenSymbol, + poolType + }: { + assetInfos: AssetInfo[]; + initParams?: Binary; + lpTokenName?: string; + lpTokenSymbol?: string; + poolType: PoolType; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + create_pool_instance: { + asset_infos: assetInfos, + init_params: initParams, + lp_token_name: lpTokenName, + lp_token_symbol: lpTokenSymbol, + pool_type: poolType + } + }, fee, memo, funds); + }; + joinPool = async ({ + assets, + autoStake, + lpToMint, + poolId, + recipient, + slippageTolerance + }: { + assets?: Asset[]; + autoStake?: boolean; + lpToMint?: Uint128; + poolId: Uint128; + recipient?: string; + slippageTolerance?: Decimal; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + join_pool: { + assets, + auto_stake: autoStake, + lp_to_mint: lpToMint, + pool_id: poolId, + recipient, + slippage_tolerance: slippageTolerance + } + }, fee, memo, funds); + }; + swap = async ({ + recipient, + swapRequest + }: { + recipient?: string; + swapRequest: SingleSwapRequest; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + swap: { + recipient, + swap_request: swapRequest + } + }, fee, memo, funds); + }; + proposeNewOwner = async ({ + expiresIn, + owner + }: { + expiresIn: number; + owner: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + propose_new_owner: { + expires_in: expiresIn, + owner + } + }, fee, memo, funds); + }; + dropOwnershipProposal = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + drop_ownership_proposal: {} + }, fee, memo, funds); + }; + claimOwnership = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_ownership: {} + }, fee, memo, funds); + }; +}" +`; + +exports[`execute interface /issues/71/execute_msg.json 1`] = ` +"export interface SG721Instance { + contractAddress: string; + sender: string; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + updateConfig: ({ + feeCollector, + generatorAddress, + lpTokenCodeId + }: { + feeCollector?: string; + generatorAddress?: string; + lpTokenCodeId?: number; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + updatePoolConfig: ({ + isDisabled, + newFeeInfo, + poolType + }: { + isDisabled?: boolean; + newFeeInfo?: FeeInfo; + poolType: PoolType; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + addToRegistery: ({ + newPoolConfig + }: { + newPoolConfig: PoolConfig; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + createPoolInstance: ({ + assetInfos, + initParams, + lpTokenName, + lpTokenSymbol, + poolType + }: { + assetInfos: AssetInfo[]; + initParams?: Binary; + lpTokenName?: string; + lpTokenSymbol?: string; + poolType: PoolType; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + joinPool: ({ + assets, + autoStake, + lpToMint, + poolId, + recipient, + slippageTolerance + }: { + assets?: Asset[]; + autoStake?: boolean; + lpToMint?: Uint128; + poolId: Uint128; + recipient?: string; + slippageTolerance?: Decimal; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + swap: ({ + recipient, + swapRequest + }: { + recipient?: string; + swapRequest: SingleSwapRequest; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + proposeNewOwner: ({ + expiresIn, + owner + }: { + expiresIn: number; + owner: string; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + dropOwnershipProposal: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + claimOwnership: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; +}" +`; + +exports[`execute_msg_for__empty /issues/71/execute_msg.json 1`] = `"export type ExecuteMsg = ExecuteMsg;"`; + +exports[`query classes /issues/71/execute_msg.json 1`] = ` +"export class SG721QueryClient implements SG721ReadOnlyInstance { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.receive = this.receive.bind(this); + this.updateConfig = this.updateConfig.bind(this); + this.updatePoolConfig = this.updatePoolConfig.bind(this); + this.addToRegistery = this.addToRegistery.bind(this); + this.createPoolInstance = this.createPoolInstance.bind(this); + this.joinPool = this.joinPool.bind(this); + this.swap = this.swap.bind(this); + this.proposeNewOwner = this.proposeNewOwner.bind(this); + this.dropOwnershipProposal = this.dropOwnershipProposal.bind(this); + this.claimOwnership = this.claimOwnership.bind(this); + } + + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + receive: { + amount, + msg, + sender + } + }); + }; + updateConfig = async ({ + feeCollector, + generatorAddress, + lpTokenCodeId + }: { + feeCollector?: string; + generatorAddress?: string; + lpTokenCodeId?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + update_config: { + fee_collector: feeCollector, + generator_address: generatorAddress, + lp_token_code_id: lpTokenCodeId + } + }); + }; + updatePoolConfig = async ({ + isDisabled, + newFeeInfo, + poolType + }: { + isDisabled?: boolean; + newFeeInfo?: FeeInfo; + poolType: PoolType; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + update_pool_config: { + is_disabled: isDisabled, + new_fee_info: newFeeInfo, + pool_type: poolType + } + }); + }; + addToRegistery = async ({ + newPoolConfig + }: { + newPoolConfig: PoolConfig; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + add_to_registery: { + new_pool_config: newPoolConfig + } + }); + }; + createPoolInstance = async ({ + assetInfos, + initParams, + lpTokenName, + lpTokenSymbol, + poolType + }: { + assetInfos: AssetInfo[]; + initParams?: Binary; + lpTokenName?: string; + lpTokenSymbol?: string; + poolType: PoolType; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + create_pool_instance: { + asset_infos: assetInfos, + init_params: initParams, + lp_token_name: lpTokenName, + lp_token_symbol: lpTokenSymbol, + pool_type: poolType + } + }); + }; + joinPool = async ({ + assets, + autoStake, + lpToMint, + poolId, + recipient, + slippageTolerance + }: { + assets?: Asset[]; + autoStake?: boolean; + lpToMint?: Uint128; + poolId: Uint128; + recipient?: string; + slippageTolerance?: Decimal; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + join_pool: { + assets, + auto_stake: autoStake, + lp_to_mint: lpToMint, + pool_id: poolId, + recipient, + slippage_tolerance: slippageTolerance + } + }); + }; + swap = async ({ + recipient, + swapRequest + }: { + recipient?: string; + swapRequest: SingleSwapRequest; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + swap: { + recipient, + swap_request: swapRequest + } + }); + }; + proposeNewOwner = async ({ + expiresIn, + owner + }: { + expiresIn: number; + owner: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + propose_new_owner: { + expires_in: expiresIn, + owner + } + }); + }; + dropOwnershipProposal = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + drop_ownership_proposal: {} + }); + }; + claimOwnership = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + claim_ownership: {} + }); + }; +}" +`; diff --git a/packages/wasm-ast-types/src/utils/types.ts b/packages/wasm-ast-types/src/utils/types.ts index fe5360f1..01de42c3 100644 --- a/packages/wasm-ast-types/src/utils/types.ts +++ b/packages/wasm-ast-types/src/utils/types.ts @@ -167,18 +167,33 @@ export const getTypeInfo = (info: JSONSchema) => { } if (nullableType === 'array' && typeof info.items === 'object' && !Array.isArray(info.items)) { - const detect = detectType(info.items.type); - if (detect.type === 'array') { - // wen recursion? - type = t.tsArrayType( - getArrayTypeFromItems(info.items) - ); + + if (info.items.type) { + const detect = detectType(info.items.type); + if (detect.type === 'array') { + // wen recursion? + type = t.tsArrayType( + getArrayTypeFromItems(info.items) + ); + } else { + type = t.tsArrayType( + getType(detect.type) + ); + } + optional = detect.optional; + } else if (info.items.$ref) { + type = getArrayTypeFromRef(info.items.$ref); + // } else if (info.items.title) { + // type = t.tsArrayType( + // t.tsTypeReference( + // t.identifier(info.items.title) + // ) + // ); + } else if (info.items.type) { + type = getArrayTypeFromItems(info.items); } else { - type = t.tsArrayType( - getType(detect.type) - ); + throw new Error('[info.items] case not handled by transpiler. contact maintainers.') } - optional = detect.optional; } else { const detect = detectType(nullableType); From 573e12a87370fc2f6b005e928f1291931a9cf2e7 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 10 Oct 2022 18:15:48 -0700 Subject: [PATCH 056/287] pkg --- packages/ts-codegen/package.json | 6 ++++-- packages/wasm-ast-types/package.json | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index f5f55148..5ea4660d 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -18,13 +18,15 @@ "files": [ "types", "main", + "src", "module" ], "scripts": { "build:main": "cross-env BABEL_ENV=production babel src --out-dir main --delete-dir-on-start --extensions \".tsx,.ts,.js\"", "build:module": "cross-env MODULE=true babel src --out-dir module --delete-dir-on-start --extensions \".tsx,.ts,.js\"", - "build": "npm run build:module && npm run build:main", "build:ts": "tsc --project ./tsconfig.json", + "build": "npm run build:module && npm run build:main", + "buidl": "npm run build && npm run build:ts", "prepare": "npm run build", "dev": "cross-env NODE_ENV=development babel-node src/ts-codegen --extensions \".tsx,.ts,.js\"", "watch": "cross-env NODE_ENV=development babel-watch src/ts-codegen --extensions \".tsx,.ts,.js\"", @@ -96,4 +98,4 @@ "shelljs": "0.8.5", "wasm-ast-types": "^0.11.3" } -} +} \ No newline at end of file diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index 128129cf..06007674 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -15,13 +15,15 @@ "files": [ "types", "main", + "src", "module" ], "scripts": { "build:main": "cross-env BABEL_ENV=production babel src --out-dir main --delete-dir-on-start --extensions \".tsx,.ts,.js\"", "build:module": "cross-env MODULE=true babel src --out-dir module --delete-dir-on-start --extensions \".tsx,.ts,.js\"", - "build": "npm run build:module && npm run build:main", "build:ts": "tsc --project ./tsconfig.json", + "build": "npm run build:module && npm run build:main", + "buidl": "npm run build && npm run build:ts", "prepare": "npm run build", "lint": "eslint .", "format": "eslint . --fix", @@ -86,4 +88,4 @@ "case": "1.6.3", "deepmerge": "4.2.2" } -} +} \ No newline at end of file From 59dcc054d241c6bf43d5a617b31c3cd5c4ecff6e Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 10 Oct 2022 18:15:56 -0700 Subject: [PATCH 057/287] chore(release): publish - @cosmwasm/ts-codegen@0.18.0 - wasm-ast-types@0.12.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 6 +++--- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 4 ++-- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index f413848c..81c3c15d 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.18.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.17.0...@cosmwasm/ts-codegen@0.18.0) (2022-10-11) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.17.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.16.5...@cosmwasm/ts-codegen@0.17.0) (2022-10-02) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 5ea4660d..81b5145f 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.17.0", + "version": "0.18.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.11.3" + "wasm-ast-types": "^0.12.0" } -} \ No newline at end of file +} diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 65c53686..27fd5784 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.12.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.11.3...wasm-ast-types@0.12.0) (2022-10-11) + +**Note:** Version bump only for package wasm-ast-types + + + + + ## [0.11.3](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.11.2...wasm-ast-types@0.11.3) (2022-09-14) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index 06007674..f4a16143 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.11.3", + "version": "0.12.0", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", @@ -88,4 +88,4 @@ "case": "1.6.3", "deepmerge": "4.2.2" } -} \ No newline at end of file +} From 930b1f1b29c2cd7c3b4655e8bb85f96decb74a2a Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 10 Oct 2022 18:49:17 -0700 Subject: [PATCH 058/287] execExtendsQuery option --- .../no-extends/CwAdminFactory.client.ts | 65 +++ .../CwAdminFactory.message-composer.ts | 60 +++ .../no-extends/CwAdminFactory.react-query.ts | 13 + .../no-extends/CwAdminFactory.recoil.ts | 24 + .../no-extends/CwAdminFactory.types.ts | 19 + .../no-extends/CwCodeIdRegistry.client.ts | 251 +++++++++++ .../CwCodeIdRegistry.message-composer.ts | 200 +++++++++ .../CwCodeIdRegistry.react-query.ts | 70 +++ .../no-extends/CwCodeIdRegistry.recoil.ts | 80 ++++ .../no-extends/CwCodeIdRegistry.types.ts | 109 +++++ .../builder/no-extends/CwSingle.client.ts | 381 ++++++++++++++++ .../no-extends/CwSingle.message-composer.ts | 294 +++++++++++++ .../no-extends/CwSingle.react-query.ts | 128 ++++++ .../builder/no-extends/CwSingle.recoil.ts | 164 +++++++ .../builder/no-extends/CwSingle.types.ts | 416 ++++++++++++++++++ .../builder/no-extends/Factory.client.ts | 259 +++++++++++ .../no-extends/Factory.message-composer.ts | 214 +++++++++ .../builder/no-extends/Factory.react-query.ts | 82 ++++ .../builder/no-extends/Factory.recoil.ts | 108 +++++ .../builder/no-extends/Factory.types.ts | 183 ++++++++ .../builder/no-extends/Minter.client.ts | 177 ++++++++ .../no-extends/Minter.message-composer.ts | 174 ++++++++ .../builder/no-extends/Minter.react-query.ts | 55 +++ .../builder/no-extends/Minter.recoil.ts | 94 ++++ __output__/builder/no-extends/Minter.types.ts | 124 ++++++ __output__/builder/no-extends/index.ts | 65 +++ package.json | 1 + .../__snapshots__/builder.test.ts.snap | 2 + packages/ts-codegen/__tests__/builder.test.ts | 41 ++ packages/ts-codegen/src/generators/client.ts | 5 +- packages/wasm-ast-types/src/client/client.ts | 2 +- .../wasm-ast-types/src/context/context.ts | 4 +- .../wasm-ast-types/types/client/client.d.ts | 2 +- .../wasm-ast-types/types/context/context.d.ts | 1 + 34 files changed, 3862 insertions(+), 5 deletions(-) create mode 100644 __output__/builder/no-extends/CwAdminFactory.client.ts create mode 100644 __output__/builder/no-extends/CwAdminFactory.message-composer.ts create mode 100644 __output__/builder/no-extends/CwAdminFactory.react-query.ts create mode 100644 __output__/builder/no-extends/CwAdminFactory.recoil.ts create mode 100644 __output__/builder/no-extends/CwAdminFactory.types.ts create mode 100644 __output__/builder/no-extends/CwCodeIdRegistry.client.ts create mode 100644 __output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts create mode 100644 __output__/builder/no-extends/CwCodeIdRegistry.react-query.ts create mode 100644 __output__/builder/no-extends/CwCodeIdRegistry.recoil.ts create mode 100644 __output__/builder/no-extends/CwCodeIdRegistry.types.ts create mode 100644 __output__/builder/no-extends/CwSingle.client.ts create mode 100644 __output__/builder/no-extends/CwSingle.message-composer.ts create mode 100644 __output__/builder/no-extends/CwSingle.react-query.ts create mode 100644 __output__/builder/no-extends/CwSingle.recoil.ts create mode 100644 __output__/builder/no-extends/CwSingle.types.ts create mode 100644 __output__/builder/no-extends/Factory.client.ts create mode 100644 __output__/builder/no-extends/Factory.message-composer.ts create mode 100644 __output__/builder/no-extends/Factory.react-query.ts create mode 100644 __output__/builder/no-extends/Factory.recoil.ts create mode 100644 __output__/builder/no-extends/Factory.types.ts create mode 100644 __output__/builder/no-extends/Minter.client.ts create mode 100644 __output__/builder/no-extends/Minter.message-composer.ts create mode 100644 __output__/builder/no-extends/Minter.react-query.ts create mode 100644 __output__/builder/no-extends/Minter.recoil.ts create mode 100644 __output__/builder/no-extends/Minter.types.ts create mode 100644 __output__/builder/no-extends/index.ts diff --git a/__output__/builder/no-extends/CwAdminFactory.client.ts b/__output__/builder/no-extends/CwAdminFactory.client.ts new file mode 100644 index 00000000..3194c8c0 --- /dev/null +++ b/__output__/builder/no-extends/CwAdminFactory.client.ts @@ -0,0 +1,65 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { Coin, StdFee } from "@cosmjs/amino"; +import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; +export interface CwAdminFactoryReadOnlyInterface { + contractAddress: string; +} +export class CwAdminFactoryQueryClient implements CwAdminFactoryReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + } + +} +export interface CwAdminFactoryInterface { + contractAddress: string; + sender: string; + instantiateContractWithSelfAdmin: ({ + codeId, + instantiateMsg, + label + }: { + codeId: number; + instantiateMsg: Binary; + label: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; +} +export class CwAdminFactoryClient implements CwAdminFactoryInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.instantiateContractWithSelfAdmin = this.instantiateContractWithSelfAdmin.bind(this); + } + + instantiateContractWithSelfAdmin = async ({ + codeId, + instantiateMsg, + label + }: { + codeId: number; + instantiateMsg: Binary; + label: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + instantiate_contract_with_self_admin: { + code_id: codeId, + instantiate_msg: instantiateMsg, + label + } + }, fee, memo, funds); + }; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/CwAdminFactory.message-composer.ts b/__output__/builder/no-extends/CwAdminFactory.message-composer.ts new file mode 100644 index 00000000..6ff9c5fb --- /dev/null +++ b/__output__/builder/no-extends/CwAdminFactory.message-composer.ts @@ -0,0 +1,60 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Coin } from "@cosmjs/amino"; +import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@cosmjs/encoding"; +import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; +export interface CwAdminFactoryMessage { + contractAddress: string; + sender: string; + instantiateContractWithSelfAdmin: ({ + codeId, + instantiateMsg, + label + }: { + codeId: number; + instantiateMsg: Binary; + label: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; +} +export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { + sender: string; + contractAddress: string; + + constructor(sender: string, contractAddress: string) { + this.sender = sender; + this.contractAddress = contractAddress; + this.instantiateContractWithSelfAdmin = this.instantiateContractWithSelfAdmin.bind(this); + } + + instantiateContractWithSelfAdmin = ({ + codeId, + instantiateMsg, + label + }: { + codeId: number; + instantiateMsg: Binary; + label: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + instantiate_contract_with_self_admin: { + code_id: codeId, + instantiate_msg: instantiateMsg, + label + } + })), + funds + }) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/CwAdminFactory.react-query.ts b/__output__/builder/no-extends/CwAdminFactory.react-query.ts new file mode 100644 index 00000000..be2aa1b7 --- /dev/null +++ b/__output__/builder/no-extends/CwAdminFactory.react-query.ts @@ -0,0 +1,13 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions } from "react-query"; +import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; +import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; +export interface CwAdminFactoryReactQuery { + client: CwAdminFactoryQueryClient; + options?: UseQueryOptions; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/CwAdminFactory.recoil.ts b/__output__/builder/no-extends/CwAdminFactory.recoil.ts new file mode 100644 index 00000000..eddb158c --- /dev/null +++ b/__output__/builder/no-extends/CwAdminFactory.recoil.ts @@ -0,0 +1,24 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { selectorFamily } from "recoil"; +import { cosmWasmClient } from "./chain"; +import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; +import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; +type QueryClientParams = { + contractAddress: string; +}; +export const queryClient = selectorFamily({ + key: "cwAdminFactoryQueryClient", + get: ({ + contractAddress + }) => ({ + get + }) => { + const client = get(cosmWasmClient); + return new CwAdminFactoryQueryClient(client, contractAddress); + } +}); \ No newline at end of file diff --git a/__output__/builder/no-extends/CwAdminFactory.types.ts b/__output__/builder/no-extends/CwAdminFactory.types.ts new file mode 100644 index 00000000..11b47d44 --- /dev/null +++ b/__output__/builder/no-extends/CwAdminFactory.types.ts @@ -0,0 +1,19 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type ExecuteMsg = { + instantiate_contract_with_self_admin: { + code_id: number; + instantiate_msg: Binary; + label: string; + [k: string]: unknown; + }; +}; +export type Binary = string; +export interface InstantiateMsg { + [k: string]: unknown; +} +export type QueryMsg = string; \ No newline at end of file diff --git a/__output__/builder/no-extends/CwCodeIdRegistry.client.ts b/__output__/builder/no-extends/CwCodeIdRegistry.client.ts new file mode 100644 index 00000000..59e6506b --- /dev/null +++ b/__output__/builder/no-extends/CwCodeIdRegistry.client.ts @@ -0,0 +1,251 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { Coin, StdFee } from "@cosmjs/amino"; +import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; +export interface CwCodeIdRegistryReadOnlyInterface { + contractAddress: string; + config: () => Promise; + getRegistration: ({ + chainId, + name, + version + }: { + chainId: string; + name: string; + version?: string; + }) => Promise; + infoForCodeId: ({ + chainId, + codeId + }: { + chainId: string; + codeId: number; + }) => Promise; + listRegistrations: ({ + chainId, + name + }: { + chainId: string; + name: string; + }) => Promise; +} +export class CwCodeIdRegistryQueryClient implements CwCodeIdRegistryReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.getRegistration = this.getRegistration.bind(this); + this.infoForCodeId = this.infoForCodeId.bind(this); + this.listRegistrations = this.listRegistrations.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + getRegistration = async ({ + chainId, + name, + version + }: { + chainId: string; + name: string; + version?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_registration: { + chain_id: chainId, + name, + version + } + }); + }; + infoForCodeId = async ({ + chainId, + codeId + }: { + chainId: string; + codeId: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + info_for_code_id: { + chain_id: chainId, + code_id: codeId + } + }); + }; + listRegistrations = async ({ + chainId, + name + }: { + chainId: string; + name: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + list_registrations: { + chain_id: chainId, + name + } + }); + }; +} +export interface CwCodeIdRegistryInterface { + contractAddress: string; + sender: string; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + register: ({ + chainId, + checksum, + codeId, + name, + version + }: { + chainId: string; + checksum: string; + codeId: number; + name: string; + version: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + setOwner: ({ + chainId, + name, + owner + }: { + chainId: string; + name: string; + owner?: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + unregister: ({ + chainId, + codeId + }: { + chainId: string; + codeId: number; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateConfig: ({ + admin, + paymentInfo + }: { + admin?: string; + paymentInfo?: PaymentInfo; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; +} +export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receive = this.receive.bind(this); + this.register = this.register.bind(this); + this.setOwner = this.setOwner.bind(this); + this.unregister = this.unregister.bind(this); + this.updateConfig = this.updateConfig.bind(this); + } + + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, funds); + }; + register = async ({ + chainId, + checksum, + codeId, + name, + version + }: { + chainId: string; + checksum: string; + codeId: number; + name: string; + version: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register: { + chain_id: chainId, + checksum, + code_id: codeId, + name, + version + } + }, fee, memo, funds); + }; + setOwner = async ({ + chainId, + name, + owner + }: { + chainId: string; + name: string; + owner?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_owner: { + chain_id: chainId, + name, + owner + } + }, fee, memo, funds); + }; + unregister = async ({ + chainId, + codeId + }: { + chainId: string; + codeId: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + unregister: { + chain_id: chainId, + code_id: codeId + } + }, fee, memo, funds); + }; + updateConfig = async ({ + admin, + paymentInfo + }: { + admin?: string; + paymentInfo?: PaymentInfo; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_config: { + admin, + payment_info: paymentInfo + } + }, fee, memo, funds); + }; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts b/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts new file mode 100644 index 00000000..2590da00 --- /dev/null +++ b/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts @@ -0,0 +1,200 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Coin } from "@cosmjs/amino"; +import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@cosmjs/encoding"; +import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; +export interface CwCodeIdRegistryMessage { + contractAddress: string; + sender: string; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + register: ({ + chainId, + checksum, + codeId, + name, + version + }: { + chainId: string; + checksum: string; + codeId: number; + name: string; + version: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + setOwner: ({ + chainId, + name, + owner + }: { + chainId: string; + name: string; + owner?: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + unregister: ({ + chainId, + codeId + }: { + chainId: string; + codeId: number; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateConfig: ({ + admin, + paymentInfo + }: { + admin?: string; + paymentInfo?: PaymentInfo; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; +} +export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage { + sender: string; + contractAddress: string; + + constructor(sender: string, contractAddress: string) { + this.sender = sender; + this.contractAddress = contractAddress; + this.receive = this.receive.bind(this); + this.register = this.register.bind(this); + this.setOwner = this.setOwner.bind(this); + this.unregister = this.unregister.bind(this); + this.updateConfig = this.updateConfig.bind(this); + } + + receive = ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + receive: { + amount, + msg, + sender + } + })), + funds + }) + }; + }; + register = ({ + chainId, + checksum, + codeId, + name, + version + }: { + chainId: string; + checksum: string; + codeId: number; + name: string; + version: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + register: { + chain_id: chainId, + checksum, + code_id: codeId, + name, + version + } + })), + funds + }) + }; + }; + setOwner = ({ + chainId, + name, + owner + }: { + chainId: string; + name: string; + owner?: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + set_owner: { + chain_id: chainId, + name, + owner + } + })), + funds + }) + }; + }; + unregister = ({ + chainId, + codeId + }: { + chainId: string; + codeId: number; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + unregister: { + chain_id: chainId, + code_id: codeId + } + })), + funds + }) + }; + }; + updateConfig = ({ + admin, + paymentInfo + }: { + admin?: string; + paymentInfo?: PaymentInfo; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_config: { + admin, + payment_info: paymentInfo + } + })), + funds + }) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/CwCodeIdRegistry.react-query.ts b/__output__/builder/no-extends/CwCodeIdRegistry.react-query.ts new file mode 100644 index 00000000..d2bcdc8f --- /dev/null +++ b/__output__/builder/no-extends/CwCodeIdRegistry.react-query.ts @@ -0,0 +1,70 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions, useQuery } from "react-query"; +import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; +import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; +export interface CwCodeIdRegistryReactQuery { + client: CwCodeIdRegistryQueryClient; + options?: UseQueryOptions; +} +export interface CwCodeIdRegistryListRegistrationsQuery extends CwCodeIdRegistryReactQuery { + args: { + chainId: string; + name: string; + }; +} +export function useCwCodeIdRegistryListRegistrationsQuery({ + client, + args, + options +}: CwCodeIdRegistryListRegistrationsQuery) { + return useQuery(["cwCodeIdRegistryListRegistrations", client.contractAddress, JSON.stringify(args)], () => client.listRegistrations({ + chainId: args.chainId, + name: args.name + }), options); +} +export interface CwCodeIdRegistryInfoForCodeIdQuery extends CwCodeIdRegistryReactQuery { + args: { + chainId: string; + codeId: number; + }; +} +export function useCwCodeIdRegistryInfoForCodeIdQuery({ + client, + args, + options +}: CwCodeIdRegistryInfoForCodeIdQuery) { + return useQuery(["cwCodeIdRegistryInfoForCodeId", client.contractAddress, JSON.stringify(args)], () => client.infoForCodeId({ + chainId: args.chainId, + codeId: args.codeId + }), options); +} +export interface CwCodeIdRegistryGetRegistrationQuery extends CwCodeIdRegistryReactQuery { + args: { + chainId: string; + name: string; + version?: string; + }; +} +export function useCwCodeIdRegistryGetRegistrationQuery({ + client, + args, + options +}: CwCodeIdRegistryGetRegistrationQuery) { + return useQuery(["cwCodeIdRegistryGetRegistration", client.contractAddress, JSON.stringify(args)], () => client.getRegistration({ + chainId: args.chainId, + name: args.name, + version: args.version + }), options); +} +export interface CwCodeIdRegistryConfigQuery extends CwCodeIdRegistryReactQuery {} +export function useCwCodeIdRegistryConfigQuery({ + client, + options +}: CwCodeIdRegistryConfigQuery) { + return useQuery(["cwCodeIdRegistryConfig", client.contractAddress], () => client.config(), options); +} \ No newline at end of file diff --git a/__output__/builder/no-extends/CwCodeIdRegistry.recoil.ts b/__output__/builder/no-extends/CwCodeIdRegistry.recoil.ts new file mode 100644 index 00000000..c76fd755 --- /dev/null +++ b/__output__/builder/no-extends/CwCodeIdRegistry.recoil.ts @@ -0,0 +1,80 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { selectorFamily } from "recoil"; +import { cosmWasmClient } from "./chain"; +import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; +import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; +type QueryClientParams = { + contractAddress: string; +}; +export const queryClient = selectorFamily({ + key: "cwCodeIdRegistryQueryClient", + get: ({ + contractAddress + }) => ({ + get + }) => { + const client = get(cosmWasmClient); + return new CwCodeIdRegistryQueryClient(client, contractAddress); + } +}); +export const configSelector = selectorFamily; +}>({ + key: "cwCodeIdRegistryConfig", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.config(...params); + } +}); +export const getRegistrationSelector = selectorFamily; +}>({ + key: "cwCodeIdRegistryGetRegistration", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.getRegistration(...params); + } +}); +export const infoForCodeIdSelector = selectorFamily; +}>({ + key: "cwCodeIdRegistryInfoForCodeId", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.infoForCodeId(...params); + } +}); +export const listRegistrationsSelector = selectorFamily; +}>({ + key: "cwCodeIdRegistryListRegistrations", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.listRegistrations(...params); + } +}); \ No newline at end of file diff --git a/__output__/builder/no-extends/CwCodeIdRegistry.types.ts b/__output__/builder/no-extends/CwCodeIdRegistry.types.ts new file mode 100644 index 00000000..46a8c284 --- /dev/null +++ b/__output__/builder/no-extends/CwCodeIdRegistry.types.ts @@ -0,0 +1,109 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Addr = string; +export type PaymentInfo = { + none: {}; +} | { + native_payment: { + payment_amount: Uint128; + token_denom: string; + }; +} | { + cw20_payment: { + payment_amount: Uint128; + token_address: string; + }; +}; +export type Uint128 = string; +export interface ConfigResponse { + admin: Addr; + payment_info: PaymentInfo; +} +export type ExecuteMsg = { + receive: Cw20ReceiveMsg; +} | { + register: { + chain_id: string; + checksum: string; + code_id: number; + name: string; + version: string; + }; +} | { + set_owner: { + chain_id: string; + name: string; + owner?: string | null; + }; +} | { + unregister: { + chain_id: string; + code_id: number; + }; +} | { + update_config: { + admin?: string | null; + payment_info?: PaymentInfo | null; + }; +}; +export type Binary = string; +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; + [k: string]: unknown; +} +export interface GetRegistrationResponse { + registration: Registration; +} +export interface Registration { + checksum: string; + code_id: number; + registered_by: Addr; + version: string; +} +export interface InfoForCodeIdResponse { + checksum: string; + name: string; + registered_by: Addr; + version: string; +} +export interface InstantiateMsg { + admin: string; + payment_info: PaymentInfo; +} +export interface ListRegistrationsResponse { + registrations: Registration[]; +} +export type QueryMsg = { + config: {}; +} | { + get_registration: { + chain_id: string; + name: string; + version?: string | null; + }; +} | { + info_for_code_id: { + chain_id: string; + code_id: number; + }; +} | { + list_registrations: { + chain_id: string; + name: string; + }; +}; +export type ReceiveMsg = { + register: { + chain_id: string; + checksum: string; + code_id: number; + name: string; + version: string; + }; +}; \ No newline at end of file diff --git a/__output__/builder/no-extends/CwSingle.client.ts b/__output__/builder/no-extends/CwSingle.client.ts new file mode 100644 index 00000000..05c0dc73 --- /dev/null +++ b/__output__/builder/no-extends/CwSingle.client.ts @@ -0,0 +1,381 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; +export interface CwSingleReadOnlyInterface { + contractAddress: string; + config: () => Promise; + proposal: ({ + proposalId + }: { + proposalId: number; + }) => Promise; + listProposals: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }) => Promise; + reverseProposals: ({ + limit, + startBefore + }: { + limit?: number; + startBefore?: number; + }) => Promise; + proposalCount: () => Promise; + vote: ({ + proposalId, + voter + }: { + proposalId: number; + voter: string; + }) => Promise; + listVotes: ({ + limit, + proposalId, + startAfter + }: { + limit?: number; + proposalId: number; + startAfter?: string; + }) => Promise; + proposalHooks: () => Promise; + voteHooks: () => Promise; + info: () => Promise; +} +export class CwSingleQueryClient implements CwSingleReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.proposal = this.proposal.bind(this); + this.listProposals = this.listProposals.bind(this); + this.reverseProposals = this.reverseProposals.bind(this); + this.proposalCount = this.proposalCount.bind(this); + this.vote = this.vote.bind(this); + this.listVotes = this.listVotes.bind(this); + this.proposalHooks = this.proposalHooks.bind(this); + this.voteHooks = this.voteHooks.bind(this); + this.info = this.info.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + proposal = async ({ + proposalId + }: { + proposalId: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + proposal: { + proposal_id: proposalId + } + }); + }; + listProposals = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + list_proposals: { + limit, + start_after: startAfter + } + }); + }; + reverseProposals = async ({ + limit, + startBefore + }: { + limit?: number; + startBefore?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + reverse_proposals: { + limit, + start_before: startBefore + } + }); + }; + proposalCount = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + proposal_count: {} + }); + }; + vote = async ({ + proposalId, + voter + }: { + proposalId: number; + voter: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + vote: { + proposal_id: proposalId, + voter + } + }); + }; + listVotes = async ({ + limit, + proposalId, + startAfter + }: { + limit?: number; + proposalId: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + list_votes: { + limit, + proposal_id: proposalId, + start_after: startAfter + } + }); + }; + proposalHooks = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + proposal_hooks: {} + }); + }; + voteHooks = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + vote_hooks: {} + }); + }; + info = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + info: {} + }); + }; +} +export interface CwSingleInterface { + contractAddress: string; + sender: string; + propose: ({ + description, + msgs, + title + }: { + description: string; + msgs: CosmosMsgForEmpty[]; + title: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + vote: ({ + proposalId, + vote + }: { + proposalId: number; + vote: Vote; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + execute: ({ + proposalId + }: { + proposalId: number; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + close: ({ + proposalId + }: { + proposalId: number; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateConfig: ({ + allowRevoting, + dao, + depositInfo, + maxVotingPeriod, + minVotingPeriod, + onlyMembersExecute, + threshold + }: { + allowRevoting: boolean; + dao: string; + depositInfo?: DepositInfo; + maxVotingPeriod: Duration; + minVotingPeriod?: Duration; + onlyMembersExecute: boolean; + threshold: Threshold; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + addProposalHook: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + removeProposalHook: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + addVoteHook: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + removeVoteHook: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; +} +export class CwSingleClient implements CwSingleInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.propose = this.propose.bind(this); + this.vote = this.vote.bind(this); + this.execute = this.execute.bind(this); + this.close = this.close.bind(this); + this.updateConfig = this.updateConfig.bind(this); + this.addProposalHook = this.addProposalHook.bind(this); + this.removeProposalHook = this.removeProposalHook.bind(this); + this.addVoteHook = this.addVoteHook.bind(this); + this.removeVoteHook = this.removeVoteHook.bind(this); + } + + propose = async ({ + description, + msgs, + title + }: { + description: string; + msgs: CosmosMsgForEmpty[]; + title: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + propose: { + description, + msgs, + title + } + }, fee, memo, funds); + }; + vote = async ({ + proposalId, + vote + }: { + proposalId: number; + vote: Vote; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + vote: { + proposal_id: proposalId, + vote + } + }, fee, memo, funds); + }; + execute = async ({ + proposalId + }: { + proposalId: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + execute: { + proposal_id: proposalId + } + }, fee, memo, funds); + }; + close = async ({ + proposalId + }: { + proposalId: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + close: { + proposal_id: proposalId + } + }, fee, memo, funds); + }; + updateConfig = async ({ + allowRevoting, + dao, + depositInfo, + maxVotingPeriod, + minVotingPeriod, + onlyMembersExecute, + threshold + }: { + allowRevoting: boolean; + dao: string; + depositInfo?: DepositInfo; + maxVotingPeriod: Duration; + minVotingPeriod?: Duration; + onlyMembersExecute: boolean; + threshold: Threshold; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_config: { + allow_revoting: allowRevoting, + dao, + deposit_info: depositInfo, + max_voting_period: maxVotingPeriod, + min_voting_period: minVotingPeriod, + only_members_execute: onlyMembersExecute, + threshold + } + }, fee, memo, funds); + }; + addProposalHook = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_proposal_hook: { + address + } + }, fee, memo, funds); + }; + removeProposalHook = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_proposal_hook: { + address + } + }, fee, memo, funds); + }; + addVoteHook = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_vote_hook: { + address + } + }, fee, memo, funds); + }; + removeVoteHook = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_vote_hook: { + address + } + }, fee, memo, funds); + }; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/CwSingle.message-composer.ts b/__output__/builder/no-extends/CwSingle.message-composer.ts new file mode 100644 index 00000000..0a8436fc --- /dev/null +++ b/__output__/builder/no-extends/CwSingle.message-composer.ts @@ -0,0 +1,294 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@cosmjs/encoding"; +import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; +export interface CwSingleMessage { + contractAddress: string; + sender: string; + propose: ({ + description, + msgs, + title + }: { + description: string; + msgs: CosmosMsgForEmpty[]; + title: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + vote: ({ + proposalId, + vote + }: { + proposalId: number; + vote: Vote; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + execute: ({ + proposalId + }: { + proposalId: number; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + close: ({ + proposalId + }: { + proposalId: number; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateConfig: ({ + allowRevoting, + dao, + depositInfo, + maxVotingPeriod, + minVotingPeriod, + onlyMembersExecute, + threshold + }: { + allowRevoting: boolean; + dao: string; + depositInfo?: DepositInfo; + maxVotingPeriod: Duration; + minVotingPeriod?: Duration; + onlyMembersExecute: boolean; + threshold: Threshold; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + addProposalHook: ({ + address + }: { + address: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + removeProposalHook: ({ + address + }: { + address: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + addVoteHook: ({ + address + }: { + address: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + removeVoteHook: ({ + address + }: { + address: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; +} +export class CwSingleMessageComposer implements CwSingleMessage { + sender: string; + contractAddress: string; + + constructor(sender: string, contractAddress: string) { + this.sender = sender; + this.contractAddress = contractAddress; + this.propose = this.propose.bind(this); + this.vote = this.vote.bind(this); + this.execute = this.execute.bind(this); + this.close = this.close.bind(this); + this.updateConfig = this.updateConfig.bind(this); + this.addProposalHook = this.addProposalHook.bind(this); + this.removeProposalHook = this.removeProposalHook.bind(this); + this.addVoteHook = this.addVoteHook.bind(this); + this.removeVoteHook = this.removeVoteHook.bind(this); + } + + propose = ({ + description, + msgs, + title + }: { + description: string; + msgs: CosmosMsgForEmpty[]; + title: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + propose: { + description, + msgs, + title + } + })), + funds + }) + }; + }; + vote = ({ + proposalId, + vote + }: { + proposalId: number; + vote: Vote; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + vote: { + proposal_id: proposalId, + vote + } + })), + funds + }) + }; + }; + execute = ({ + proposalId + }: { + proposalId: number; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + execute: { + proposal_id: proposalId + } + })), + funds + }) + }; + }; + close = ({ + proposalId + }: { + proposalId: number; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + close: { + proposal_id: proposalId + } + })), + funds + }) + }; + }; + updateConfig = ({ + allowRevoting, + dao, + depositInfo, + maxVotingPeriod, + minVotingPeriod, + onlyMembersExecute, + threshold + }: { + allowRevoting: boolean; + dao: string; + depositInfo?: DepositInfo; + maxVotingPeriod: Duration; + minVotingPeriod?: Duration; + onlyMembersExecute: boolean; + threshold: Threshold; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_config: { + allow_revoting: allowRevoting, + dao, + deposit_info: depositInfo, + max_voting_period: maxVotingPeriod, + min_voting_period: minVotingPeriod, + only_members_execute: onlyMembersExecute, + threshold + } + })), + funds + }) + }; + }; + addProposalHook = ({ + address + }: { + address: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + add_proposal_hook: { + address + } + })), + funds + }) + }; + }; + removeProposalHook = ({ + address + }: { + address: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + remove_proposal_hook: { + address + } + })), + funds + }) + }; + }; + addVoteHook = ({ + address + }: { + address: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + add_vote_hook: { + address + } + })), + funds + }) + }; + }; + removeVoteHook = ({ + address + }: { + address: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + remove_vote_hook: { + address + } + })), + funds + }) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/CwSingle.react-query.ts b/__output__/builder/no-extends/CwSingle.react-query.ts new file mode 100644 index 00000000..874561b4 --- /dev/null +++ b/__output__/builder/no-extends/CwSingle.react-query.ts @@ -0,0 +1,128 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions, useQuery } from "react-query"; +import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; +import { CwSingleQueryClient } from "./CwSingle.client"; +export interface CwSingleReactQuery { + client: CwSingleQueryClient; + options?: UseQueryOptions; +} +export interface CwSingleInfoQuery extends CwSingleReactQuery {} +export function useCwSingleInfoQuery({ + client, + options +}: CwSingleInfoQuery) { + return useQuery(["cwSingleInfo", client.contractAddress], () => client.info(), options); +} +export interface CwSingleVoteHooksQuery extends CwSingleReactQuery {} +export function useCwSingleVoteHooksQuery({ + client, + options +}: CwSingleVoteHooksQuery) { + return useQuery(["cwSingleVoteHooks", client.contractAddress], () => client.voteHooks(), options); +} +export interface CwSingleProposalHooksQuery extends CwSingleReactQuery {} +export function useCwSingleProposalHooksQuery({ + client, + options +}: CwSingleProposalHooksQuery) { + return useQuery(["cwSingleProposalHooks", client.contractAddress], () => client.proposalHooks(), options); +} +export interface CwSingleListVotesQuery extends CwSingleReactQuery { + args: { + limit?: number; + proposalId: number; + startAfter?: string; + }; +} +export function useCwSingleListVotesQuery({ + client, + args, + options +}: CwSingleListVotesQuery) { + return useQuery(["cwSingleListVotes", client.contractAddress, JSON.stringify(args)], () => client.listVotes({ + limit: args.limit, + proposalId: args.proposalId, + startAfter: args.startAfter + }), options); +} +export interface CwSingleVoteQuery extends CwSingleReactQuery { + args: { + proposalId: number; + voter: string; + }; +} +export function useCwSingleVoteQuery({ + client, + args, + options +}: CwSingleVoteQuery) { + return useQuery(["cwSingleVote", client.contractAddress, JSON.stringify(args)], () => client.vote({ + proposalId: args.proposalId, + voter: args.voter + }), options); +} +export interface CwSingleProposalCountQuery extends CwSingleReactQuery {} +export function useCwSingleProposalCountQuery({ + client, + options +}: CwSingleProposalCountQuery) { + return useQuery(["cwSingleProposalCount", client.contractAddress], () => client.proposalCount(), options); +} +export interface CwSingleReverseProposalsQuery extends CwSingleReactQuery { + args: { + limit?: number; + startBefore?: number; + }; +} +export function useCwSingleReverseProposalsQuery({ + client, + args, + options +}: CwSingleReverseProposalsQuery) { + return useQuery(["cwSingleReverseProposals", client.contractAddress, JSON.stringify(args)], () => client.reverseProposals({ + limit: args.limit, + startBefore: args.startBefore + }), options); +} +export interface CwSingleListProposalsQuery extends CwSingleReactQuery { + args: { + limit?: number; + startAfter?: number; + }; +} +export function useCwSingleListProposalsQuery({ + client, + args, + options +}: CwSingleListProposalsQuery) { + return useQuery(["cwSingleListProposals", client.contractAddress, JSON.stringify(args)], () => client.listProposals({ + limit: args.limit, + startAfter: args.startAfter + }), options); +} +export interface CwSingleProposalQuery extends CwSingleReactQuery { + args: { + proposalId: number; + }; +} +export function useCwSingleProposalQuery({ + client, + args, + options +}: CwSingleProposalQuery) { + return useQuery(["cwSingleProposal", client.contractAddress, JSON.stringify(args)], () => client.proposal({ + proposalId: args.proposalId + }), options); +} +export interface CwSingleConfigQuery extends CwSingleReactQuery {} +export function useCwSingleConfigQuery({ + client, + options +}: CwSingleConfigQuery) { + return useQuery(["cwSingleConfig", client.contractAddress], () => client.config(), options); +} \ No newline at end of file diff --git a/__output__/builder/no-extends/CwSingle.recoil.ts b/__output__/builder/no-extends/CwSingle.recoil.ts new file mode 100644 index 00000000..79b2c1ba --- /dev/null +++ b/__output__/builder/no-extends/CwSingle.recoil.ts @@ -0,0 +1,164 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { selectorFamily } from "recoil"; +import { cosmWasmClient } from "./chain"; +import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; +import { CwSingleQueryClient } from "./CwSingle.client"; +type QueryClientParams = { + contractAddress: string; +}; +export const queryClient = selectorFamily({ + key: "cwSingleQueryClient", + get: ({ + contractAddress + }) => ({ + get + }) => { + const client = get(cosmWasmClient); + return new CwSingleQueryClient(client, contractAddress); + } +}); +export const configSelector = selectorFamily; +}>({ + key: "cwSingleConfig", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.config(...params); + } +}); +export const proposalSelector = selectorFamily; +}>({ + key: "cwSingleProposal", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.proposal(...params); + } +}); +export const listProposalsSelector = selectorFamily; +}>({ + key: "cwSingleListProposals", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.listProposals(...params); + } +}); +export const reverseProposalsSelector = selectorFamily; +}>({ + key: "cwSingleReverseProposals", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.reverseProposals(...params); + } +}); +export const proposalCountSelector = selectorFamily; +}>({ + key: "cwSingleProposalCount", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.proposalCount(...params); + } +}); +export const voteSelector = selectorFamily; +}>({ + key: "cwSingleVote", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.vote(...params); + } +}); +export const listVotesSelector = selectorFamily; +}>({ + key: "cwSingleListVotes", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.listVotes(...params); + } +}); +export const proposalHooksSelector = selectorFamily; +}>({ + key: "cwSingleProposalHooks", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.proposalHooks(...params); + } +}); +export const voteHooksSelector = selectorFamily; +}>({ + key: "cwSingleVoteHooks", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.voteHooks(...params); + } +}); +export const infoSelector = selectorFamily; +}>({ + key: "cwSingleInfo", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.info(...params); + } +}); \ No newline at end of file diff --git a/__output__/builder/no-extends/CwSingle.types.ts b/__output__/builder/no-extends/CwSingle.types.ts new file mode 100644 index 00000000..01398dab --- /dev/null +++ b/__output__/builder/no-extends/CwSingle.types.ts @@ -0,0 +1,416 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Addr = string; +export type Uint128 = string; +export type Duration = { + height: number; +} | { + time: number; +}; +export type Threshold = { + absolute_percentage: { + percentage: PercentageThreshold; + [k: string]: unknown; + }; +} | { + threshold_quorum: { + quorum: PercentageThreshold; + threshold: PercentageThreshold; + [k: string]: unknown; + }; +} | { + absolute_count: { + threshold: Uint128; + [k: string]: unknown; + }; +}; +export type PercentageThreshold = { + majority: { + [k: string]: unknown; + }; +} | { + percent: Decimal; +}; +export type Decimal = string; +export interface ConfigResponse { + allow_revoting: boolean; + dao: Addr; + deposit_info?: CheckedDepositInfo | null; + max_voting_period: Duration; + min_voting_period?: Duration | null; + only_members_execute: boolean; + threshold: Threshold; + [k: string]: unknown; +} +export interface CheckedDepositInfo { + deposit: Uint128; + refund_failed_proposals: boolean; + token: Addr; + [k: string]: unknown; +} +export type ExecuteMsg = { + propose: { + description: string; + msgs: CosmosMsgForEmpty[]; + title: string; + [k: string]: unknown; + }; +} | { + vote: { + proposal_id: number; + vote: Vote; + [k: string]: unknown; + }; +} | { + execute: { + proposal_id: number; + [k: string]: unknown; + }; +} | { + close: { + proposal_id: number; + [k: string]: unknown; + }; +} | { + update_config: { + allow_revoting: boolean; + dao: string; + deposit_info?: DepositInfo | null; + max_voting_period: Duration; + min_voting_period?: Duration | null; + only_members_execute: boolean; + threshold: Threshold; + [k: string]: unknown; + }; +} | { + add_proposal_hook: { + address: string; + [k: string]: unknown; + }; +} | { + remove_proposal_hook: { + address: string; + [k: string]: unknown; + }; +} | { + add_vote_hook: { + address: string; + [k: string]: unknown; + }; +} | { + remove_vote_hook: { + address: string; + [k: string]: unknown; + }; +}; +export type CosmosMsgForEmpty = { + bank: BankMsg; +} | { + custom: Empty; +} | { + staking: StakingMsg; +} | { + distribution: DistributionMsg; +} | { + stargate: { + type_url: string; + value: Binary; + [k: string]: unknown; + }; +} | { + ibc: IbcMsg; +} | { + wasm: WasmMsg; +} | { + gov: GovMsg; +}; +export type BankMsg = { + send: { + amount: Coin[]; + to_address: string; + [k: string]: unknown; + }; +} | { + burn: { + amount: Coin[]; + [k: string]: unknown; + }; +}; +export type StakingMsg = { + delegate: { + amount: Coin; + validator: string; + [k: string]: unknown; + }; +} | { + undelegate: { + amount: Coin; + validator: string; + [k: string]: unknown; + }; +} | { + redelegate: { + amount: Coin; + dst_validator: string; + src_validator: string; + [k: string]: unknown; + }; +}; +export type DistributionMsg = { + set_withdraw_address: { + address: string; + [k: string]: unknown; + }; +} | { + withdraw_delegator_reward: { + validator: string; + [k: string]: unknown; + }; +}; +export type Binary = string; +export type IbcMsg = { + transfer: { + amount: Coin; + channel_id: string; + timeout: IbcTimeout; + to_address: string; + [k: string]: unknown; + }; +} | { + send_packet: { + channel_id: string; + data: Binary; + timeout: IbcTimeout; + [k: string]: unknown; + }; +} | { + close_channel: { + channel_id: string; + [k: string]: unknown; + }; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type WasmMsg = { + execute: { + contract_addr: string; + funds: Coin[]; + msg: Binary; + [k: string]: unknown; + }; +} | { + instantiate: { + admin?: string | null; + code_id: number; + funds: Coin[]; + label: string; + msg: Binary; + [k: string]: unknown; + }; +} | { + migrate: { + contract_addr: string; + msg: Binary; + new_code_id: number; + [k: string]: unknown; + }; +} | { + update_admin: { + admin: string; + contract_addr: string; + [k: string]: unknown; + }; +} | { + clear_admin: { + contract_addr: string; + [k: string]: unknown; + }; +}; +export type GovMsg = { + vote: { + proposal_id: number; + vote: VoteOption; + [k: string]: unknown; + }; +}; +export type VoteOption = "yes" | "no" | "abstain" | "no_with_veto"; +export type Vote = "yes" | "no" | "abstain"; +export type DepositToken = { + token: { + address: string; + [k: string]: unknown; + }; +} | { + voting_module_token: { + [k: string]: unknown; + }; +}; +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface Empty { + [k: string]: unknown; +} +export interface IbcTimeout { + block?: IbcTimeoutBlock | null; + timestamp?: Timestamp | null; + [k: string]: unknown; +} +export interface IbcTimeoutBlock { + height: number; + revision: number; + [k: string]: unknown; +} +export interface DepositInfo { + deposit: Uint128; + refund_failed_proposals: boolean; + token: DepositToken; + [k: string]: unknown; +} +export type GovernanceModulesResponse = Addr[]; +export interface InfoResponse { + info: ContractVersion; + [k: string]: unknown; +} +export interface ContractVersion { + contract: string; + version: string; + [k: string]: unknown; +} +export interface InstantiateMsg { + allow_revoting: boolean; + deposit_info?: DepositInfo | null; + max_voting_period: Duration; + min_voting_period?: Duration | null; + only_members_execute: boolean; + threshold: Threshold; + [k: string]: unknown; +} +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: { + [k: string]: unknown; + }; +}; +export type Status = "open" | "rejected" | "passed" | "executed" | "closed"; +export interface ListProposalsResponse { + proposals: ProposalResponse[]; + [k: string]: unknown; +} +export interface ProposalResponse { + id: number; + proposal: Proposal; + [k: string]: unknown; +} +export interface Proposal { + allow_revoting: boolean; + deposit_info?: CheckedDepositInfo | null; + description: string; + expiration: Expiration; + min_voting_period?: Expiration | null; + msgs: CosmosMsgForEmpty[]; + proposer: Addr; + start_height: number; + status: Status; + threshold: Threshold; + title: string; + total_power: Uint128; + votes: Votes; + [k: string]: unknown; +} +export interface Votes { + abstain: Uint128; + no: Uint128; + yes: Uint128; + [k: string]: unknown; +} +export interface ListVotesResponse { + votes: VoteInfo[]; + [k: string]: unknown; +} +export interface VoteInfo { + power: Uint128; + vote: Vote; + voter: Addr; + [k: string]: unknown; +} +export interface MigrateMsg { + [k: string]: unknown; +} +export type ProposalCountResponse = number; +export interface ProposalHooksResponse { + hooks: string[]; + [k: string]: unknown; +} +export type QueryMsg = { + config: { + [k: string]: unknown; + }; +} | { + proposal: { + proposal_id: number; + [k: string]: unknown; + }; +} | { + list_proposals: { + limit?: number | null; + start_after?: number | null; + [k: string]: unknown; + }; +} | { + reverse_proposals: { + limit?: number | null; + start_before?: number | null; + [k: string]: unknown; + }; +} | { + proposal_count: { + [k: string]: unknown; + }; +} | { + vote: { + proposal_id: number; + voter: string; + [k: string]: unknown; + }; +} | { + list_votes: { + limit?: number | null; + proposal_id: number; + start_after?: string | null; + [k: string]: unknown; + }; +} | { + proposal_hooks: { + [k: string]: unknown; + }; +} | { + vote_hooks: { + [k: string]: unknown; + }; +} | { + info: { + [k: string]: unknown; + }; +}; +export interface ReverseProposalsResponse { + proposals: ProposalResponse[]; + [k: string]: unknown; +} +export interface VoteHooksResponse { + hooks: string[]; + [k: string]: unknown; +} +export interface VoteResponse { + vote?: VoteInfo | null; + [k: string]: unknown; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/Factory.client.ts b/__output__/builder/no-extends/Factory.client.ts new file mode 100644 index 00000000..6e9897d6 --- /dev/null +++ b/__output__/builder/no-extends/Factory.client.ts @@ -0,0 +1,259 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; +export interface FactoryReadOnlyInterface { + contractAddress: string; + wallets: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: WalletQueryPrefix; + }) => Promise; + walletsOf: ({ + limit, + startAfter, + user + }: { + limit?: number; + startAfter?: string; + user: string; + }) => Promise; + codeId: ({ + ty + }: { + ty: CodeIdType; + }) => Promise; + fee: () => Promise; + govecAddr: () => Promise; + adminAddr: () => Promise; +} +export class FactoryQueryClient implements FactoryReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.wallets = this.wallets.bind(this); + this.walletsOf = this.walletsOf.bind(this); + this.codeId = this.codeId.bind(this); + this.fee = this.fee.bind(this); + this.govecAddr = this.govecAddr.bind(this); + this.adminAddr = this.adminAddr.bind(this); + } + + wallets = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: WalletQueryPrefix; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + wallets: { + limit, + start_after: startAfter + } + }); + }; + walletsOf = async ({ + limit, + startAfter, + user + }: { + limit?: number; + startAfter?: string; + user: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + wallets_of: { + limit, + start_after: startAfter, + user + } + }); + }; + codeId = async ({ + ty + }: { + ty: CodeIdType; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + code_id: { + ty + } + }); + }; + fee = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + fee: {} + }); + }; + govecAddr = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + govec_addr: {} + }); + }; + adminAddr = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + admin_addr: {} + }); + }; +} +export interface FactoryInterface { + contractAddress: string; + sender: string; + createWallet: ({ + createWalletMsg + }: { + createWalletMsg: CreateWalletMsg; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateProxyUser: ({ + newUser, + oldUser + }: { + newUser: Addr; + oldUser: Addr; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + migrateWallet: ({ + migrationMsg, + walletAddress + }: { + migrationMsg: ProxyMigrationTxMsg; + walletAddress: WalletAddr; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateCodeId: ({ + newCodeId, + ty + }: { + newCodeId: number; + ty: CodeIdType; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateWalletFee: ({ + newFee + }: { + newFee: Coin; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateGovecAddr: ({ + addr + }: { + addr: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateAdmin: ({ + addr + }: { + addr: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; +} +export class FactoryClient implements FactoryInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.createWallet = this.createWallet.bind(this); + this.updateProxyUser = this.updateProxyUser.bind(this); + this.migrateWallet = this.migrateWallet.bind(this); + this.updateCodeId = this.updateCodeId.bind(this); + this.updateWalletFee = this.updateWalletFee.bind(this); + this.updateGovecAddr = this.updateGovecAddr.bind(this); + this.updateAdmin = this.updateAdmin.bind(this); + } + + createWallet = async ({ + createWalletMsg + }: { + createWalletMsg: CreateWalletMsg; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + create_wallet: { + create_wallet_msg: createWalletMsg + } + }, fee, memo, funds); + }; + updateProxyUser = async ({ + newUser, + oldUser + }: { + newUser: Addr; + oldUser: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_proxy_user: { + new_user: newUser, + old_user: oldUser + } + }, fee, memo, funds); + }; + migrateWallet = async ({ + migrationMsg, + walletAddress + }: { + migrationMsg: ProxyMigrationTxMsg; + walletAddress: WalletAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + migrate_wallet: { + migration_msg: migrationMsg, + wallet_address: walletAddress + } + }, fee, memo, funds); + }; + updateCodeId = async ({ + newCodeId, + ty + }: { + newCodeId: number; + ty: CodeIdType; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_code_id: { + new_code_id: newCodeId, + ty + } + }, fee, memo, funds); + }; + updateWalletFee = async ({ + newFee + }: { + newFee: Coin; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_wallet_fee: { + new_fee: newFee + } + }, fee, memo, funds); + }; + updateGovecAddr = async ({ + addr + }: { + addr: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_govec_addr: { + addr + } + }, fee, memo, funds); + }; + updateAdmin = async ({ + addr + }: { + addr: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_admin: { + addr + } + }, fee, memo, funds); + }; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/Factory.message-composer.ts b/__output__/builder/no-extends/Factory.message-composer.ts new file mode 100644 index 00000000..21e5a2d1 --- /dev/null +++ b/__output__/builder/no-extends/Factory.message-composer.ts @@ -0,0 +1,214 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@cosmjs/encoding"; +import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; +export interface FactoryMessage { + contractAddress: string; + sender: string; + createWallet: ({ + createWalletMsg + }: { + createWalletMsg: CreateWalletMsg; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateProxyUser: ({ + newUser, + oldUser + }: { + newUser: Addr; + oldUser: Addr; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + migrateWallet: ({ + migrationMsg, + walletAddress + }: { + migrationMsg: ProxyMigrationTxMsg; + walletAddress: WalletAddr; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateCodeId: ({ + newCodeId, + ty + }: { + newCodeId: number; + ty: CodeIdType; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateWalletFee: ({ + newFee + }: { + newFee: Coin; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateGovecAddr: ({ + addr + }: { + addr: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateAdmin: ({ + addr + }: { + addr: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; +} +export class FactoryMessageComposer implements FactoryMessage { + sender: string; + contractAddress: string; + + constructor(sender: string, contractAddress: string) { + this.sender = sender; + this.contractAddress = contractAddress; + this.createWallet = this.createWallet.bind(this); + this.updateProxyUser = this.updateProxyUser.bind(this); + this.migrateWallet = this.migrateWallet.bind(this); + this.updateCodeId = this.updateCodeId.bind(this); + this.updateWalletFee = this.updateWalletFee.bind(this); + this.updateGovecAddr = this.updateGovecAddr.bind(this); + this.updateAdmin = this.updateAdmin.bind(this); + } + + createWallet = ({ + createWalletMsg + }: { + createWalletMsg: CreateWalletMsg; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + create_wallet: { + create_wallet_msg: createWalletMsg + } + })), + funds + }) + }; + }; + updateProxyUser = ({ + newUser, + oldUser + }: { + newUser: Addr; + oldUser: Addr; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_proxy_user: { + new_user: newUser, + old_user: oldUser + } + })), + funds + }) + }; + }; + migrateWallet = ({ + migrationMsg, + walletAddress + }: { + migrationMsg: ProxyMigrationTxMsg; + walletAddress: WalletAddr; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + migrate_wallet: { + migration_msg: migrationMsg, + wallet_address: walletAddress + } + })), + funds + }) + }; + }; + updateCodeId = ({ + newCodeId, + ty + }: { + newCodeId: number; + ty: CodeIdType; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_code_id: { + new_code_id: newCodeId, + ty + } + })), + funds + }) + }; + }; + updateWalletFee = ({ + newFee + }: { + newFee: Coin; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_wallet_fee: { + new_fee: newFee + } + })), + funds + }) + }; + }; + updateGovecAddr = ({ + addr + }: { + addr: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_govec_addr: { + addr + } + })), + funds + }) + }; + }; + updateAdmin = ({ + addr + }: { + addr: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_admin: { + addr + } + })), + funds + }) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/Factory.react-query.ts b/__output__/builder/no-extends/Factory.react-query.ts new file mode 100644 index 00000000..2d40ad5e --- /dev/null +++ b/__output__/builder/no-extends/Factory.react-query.ts @@ -0,0 +1,82 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions, useQuery } from "react-query"; +import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; +import { FactoryQueryClient } from "./Factory.client"; +export interface FactoryReactQuery { + client: FactoryQueryClient; + options?: UseQueryOptions; +} +export interface FactoryAdminAddrQuery extends FactoryReactQuery {} +export function useFactoryAdminAddrQuery({ + client, + options +}: FactoryAdminAddrQuery) { + return useQuery(["factoryAdminAddr", client.contractAddress], () => client.adminAddr(), options); +} +export interface FactoryGovecAddrQuery extends FactoryReactQuery {} +export function useFactoryGovecAddrQuery({ + client, + options +}: FactoryGovecAddrQuery) { + return useQuery(["factoryGovecAddr", client.contractAddress], () => client.govecAddr(), options); +} +export interface FactoryFeeQuery extends FactoryReactQuery {} +export function useFactoryFeeQuery({ + client, + options +}: FactoryFeeQuery) { + return useQuery(["factoryFee", client.contractAddress], () => client.fee(), options); +} +export interface FactoryCodeIdQuery extends FactoryReactQuery { + args: { + ty: CodeIdType; + }; +} +export function useFactoryCodeIdQuery({ + client, + args, + options +}: FactoryCodeIdQuery) { + return useQuery(["factoryCodeId", client.contractAddress, JSON.stringify(args)], () => client.codeId({ + ty: args.ty + }), options); +} +export interface FactoryWalletsOfQuery extends FactoryReactQuery { + args: { + limit?: number; + startAfter?: string; + user: string; + }; +} +export function useFactoryWalletsOfQuery({ + client, + args, + options +}: FactoryWalletsOfQuery) { + return useQuery(["factoryWalletsOf", client.contractAddress, JSON.stringify(args)], () => client.walletsOf({ + limit: args.limit, + startAfter: args.startAfter, + user: args.user + }), options); +} +export interface FactoryWalletsQuery extends FactoryReactQuery { + args: { + limit?: number; + startAfter?: WalletQueryPrefix; + }; +} +export function useFactoryWalletsQuery({ + client, + args, + options +}: FactoryWalletsQuery) { + return useQuery(["factoryWallets", client.contractAddress, JSON.stringify(args)], () => client.wallets({ + limit: args.limit, + startAfter: args.startAfter + }), options); +} \ No newline at end of file diff --git a/__output__/builder/no-extends/Factory.recoil.ts b/__output__/builder/no-extends/Factory.recoil.ts new file mode 100644 index 00000000..3e17ff15 --- /dev/null +++ b/__output__/builder/no-extends/Factory.recoil.ts @@ -0,0 +1,108 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { selectorFamily } from "recoil"; +import { cosmWasmClient } from "./chain"; +import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; +import { FactoryQueryClient } from "./Factory.client"; +type QueryClientParams = { + contractAddress: string; +}; +export const queryClient = selectorFamily({ + key: "factoryQueryClient", + get: ({ + contractAddress + }) => ({ + get + }) => { + const client = get(cosmWasmClient); + return new FactoryQueryClient(client, contractAddress); + } +}); +export const walletsSelector = selectorFamily; +}>({ + key: "factoryWallets", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.wallets(...params); + } +}); +export const walletsOfSelector = selectorFamily; +}>({ + key: "factoryWalletsOf", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.walletsOf(...params); + } +}); +export const codeIdSelector = selectorFamily; +}>({ + key: "factoryCodeId", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.codeId(...params); + } +}); +export const feeSelector = selectorFamily; +}>({ + key: "factoryFee", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.fee(...params); + } +}); +export const govecAddrSelector = selectorFamily; +}>({ + key: "factoryGovecAddr", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.govecAddr(...params); + } +}); +export const adminAddrSelector = selectorFamily; +}>({ + key: "factoryAdminAddr", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.adminAddr(...params); + } +}); \ No newline at end of file diff --git a/__output__/builder/no-extends/Factory.types.ts b/__output__/builder/no-extends/Factory.types.ts new file mode 100644 index 00000000..ddea5192 --- /dev/null +++ b/__output__/builder/no-extends/Factory.types.ts @@ -0,0 +1,183 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AdminAddrResponse = string; +export type CodeIdResponse = number; +export type CodeIdType = "Proxy" | "Multisig"; +export type Uint128 = string; +export type Binary = string; +export interface CreateWalletMsg { + guardians: Guardians; + label: string; + proxy_initial_funds: Coin[]; + relayers: string[]; + user_pubkey: Binary; + [k: string]: unknown; +} +export interface Guardians { + addresses: string[]; + guardians_multisig?: MultiSig | null; + [k: string]: unknown; +} +export interface MultiSig { + multisig_initial_funds: Coin[]; + threshold_absolute_count: number; + [k: string]: unknown; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface Cw20Coin { + address: string; + amount: Uint128; + [k: string]: unknown; +} +export type ExecuteMsg = { + create_wallet: { + create_wallet_msg: CreateWalletMsg; + [k: string]: unknown; + }; +} | { + update_proxy_user: { + new_user: Addr; + old_user: Addr; + [k: string]: unknown; + }; +} | { + migrate_wallet: { + migration_msg: ProxyMigrationTxMsg; + wallet_address: WalletAddr; + [k: string]: unknown; + }; +} | { + update_code_id: { + new_code_id: number; + ty: CodeIdType; + [k: string]: unknown; + }; +} | { + update_wallet_fee: { + new_fee: Coin; + [k: string]: unknown; + }; +} | { + update_govec_addr: { + addr: string; + [k: string]: unknown; + }; +} | { + update_admin: { + addr: string; + [k: string]: unknown; + }; +}; +export type Addr = string; +export type ProxyMigrationTxMsg = { + RelayTx: RelayTransaction; +} | { + DirectMigrationMsg: Binary; +}; +export type WalletAddr = { + Canonical: CanonicalAddr; +} | { + Addr: Addr; +}; +export type CanonicalAddr = string; +export interface RelayTransaction { + message: Binary; + nonce: number; + signature: Binary; + user_pubkey: Binary; + [k: string]: unknown; +} +export interface FeeResponse { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type GovecAddrResponse = string; +export interface InstantiateMsg { + addr_prefix: string; + govec?: string | null; + proxy_code_id: number; + proxy_multisig_code_id: number; + wallet_fee: Coin; + [k: string]: unknown; +} +export type QueryMsg = { + wallets: { + limit?: number | null; + start_after?: WalletQueryPrefix | null; + [k: string]: unknown; + }; +} | { + wallets_of: { + limit?: number | null; + start_after?: string | null; + user: string; + [k: string]: unknown; + }; +} | { + code_id: { + ty: CodeIdType; + [k: string]: unknown; + }; +} | { + fee: { + [k: string]: unknown; + }; +} | { + govec_addr: { + [k: string]: unknown; + }; +} | { + admin_addr: { + [k: string]: unknown; + }; +}; +export interface WalletQueryPrefix { + user_addr: string; + wallet_addr: string; + [k: string]: unknown; +} +export type Duration = { + height: number; +} | { + time: number; +}; +export interface StakingOptions { + code_id: number; + duration?: Duration | null; + [k: string]: unknown; +} +export interface WalletInfo { + code_id: number; + guardians: Addr[]; + is_frozen: boolean; + label: string; + multisig_address?: Addr | null; + multisig_code_id: number; + nonce: number; + relayers: Addr[]; + user_addr: Addr; + version: ContractVersion; + [k: string]: unknown; +} +export interface ContractVersion { + contract: string; + version: string; + [k: string]: unknown; +} +export interface WalletsOfResponse { + wallets: Addr[]; + [k: string]: unknown; +} +export interface WalletsResponse { + wallets: Addr[]; + [k: string]: unknown; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/Minter.client.ts b/__output__/builder/no-extends/Minter.client.ts new file mode 100644 index 00000000..deffa10a --- /dev/null +++ b/__output__/builder/no-extends/Minter.client.ts @@ -0,0 +1,177 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; +export interface MinterReadOnlyInterface { + contractAddress: string; + config: () => Promise; + mintableNumTokens: () => Promise; + startTime: () => Promise; + mintPrice: () => Promise; + mintCount: ({ + address + }: { + address: string; + }) => Promise; +} +export class MinterQueryClient implements MinterReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.mintableNumTokens = this.mintableNumTokens.bind(this); + this.startTime = this.startTime.bind(this); + this.mintPrice = this.mintPrice.bind(this); + this.mintCount = this.mintCount.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + mintableNumTokens = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + mintable_num_tokens: {} + }); + }; + startTime = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + start_time: {} + }); + }; + mintPrice = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + mint_price: {} + }); + }; + mintCount = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + mint_count: { + address + } + }); + }; +} +export interface MinterInterface { + contractAddress: string; + sender: string; + mint: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + setWhitelist: ({ + whitelist + }: { + whitelist: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateStartTime: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updatePerAddressLimit: ({ + perAddressLimit + }: { + perAddressLimit: number; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + mintTo: ({ + recipient + }: { + recipient: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + mintFor: ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: number; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + withdraw: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; +} +export class MinterClient implements MinterInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.mint = this.mint.bind(this); + this.setWhitelist = this.setWhitelist.bind(this); + this.updateStartTime = this.updateStartTime.bind(this); + this.updatePerAddressLimit = this.updatePerAddressLimit.bind(this); + this.mintTo = this.mintTo.bind(this); + this.mintFor = this.mintFor.bind(this); + this.withdraw = this.withdraw.bind(this); + } + + mint = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: {} + }, fee, memo, funds); + }; + setWhitelist = async ({ + whitelist + }: { + whitelist: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_whitelist: { + whitelist + } + }, fee, memo, funds); + }; + updateStartTime = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_start_time: {} + }, fee, memo, funds); + }; + updatePerAddressLimit = async ({ + perAddressLimit + }: { + perAddressLimit: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_per_address_limit: { + per_address_limit: perAddressLimit + } + }, fee, memo, funds); + }; + mintTo = async ({ + recipient + }: { + recipient: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint_to: { + recipient + } + }, fee, memo, funds); + }; + mintFor = async ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint_for: { + recipient, + token_id: tokenId + } + }, fee, memo, funds); + }; + withdraw = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw: {} + }, fee, memo, funds); + }; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/Minter.message-composer.ts b/__output__/builder/no-extends/Minter.message-composer.ts new file mode 100644 index 00000000..30a74b8b --- /dev/null +++ b/__output__/builder/no-extends/Minter.message-composer.ts @@ -0,0 +1,174 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@cosmjs/encoding"; +import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; +export interface MinterMessage { + contractAddress: string; + sender: string; + mint: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + setWhitelist: ({ + whitelist + }: { + whitelist: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateStartTime: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + updatePerAddressLimit: ({ + perAddressLimit + }: { + perAddressLimit: number; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + mintTo: ({ + recipient + }: { + recipient: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + mintFor: ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: number; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + withdraw: (funds?: Coin[]) => MsgExecuteContractEncodeObject; +} +export class MinterMessageComposer implements MinterMessage { + sender: string; + contractAddress: string; + + constructor(sender: string, contractAddress: string) { + this.sender = sender; + this.contractAddress = contractAddress; + this.mint = this.mint.bind(this); + this.setWhitelist = this.setWhitelist.bind(this); + this.updateStartTime = this.updateStartTime.bind(this); + this.updatePerAddressLimit = this.updatePerAddressLimit.bind(this); + this.mintTo = this.mintTo.bind(this); + this.mintFor = this.mintFor.bind(this); + this.withdraw = this.withdraw.bind(this); + } + + mint = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + mint: {} + })), + funds + }) + }; + }; + setWhitelist = ({ + whitelist + }: { + whitelist: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + set_whitelist: { + whitelist + } + })), + funds + }) + }; + }; + updateStartTime = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_start_time: {} + })), + funds + }) + }; + }; + updatePerAddressLimit = ({ + perAddressLimit + }: { + perAddressLimit: number; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_per_address_limit: { + per_address_limit: perAddressLimit + } + })), + funds + }) + }; + }; + mintTo = ({ + recipient + }: { + recipient: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + mint_to: { + recipient + } + })), + funds + }) + }; + }; + mintFor = ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: number; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + mint_for: { + recipient, + token_id: tokenId + } + })), + funds + }) + }; + }; + withdraw = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + withdraw: {} + })), + funds + }) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/Minter.react-query.ts b/__output__/builder/no-extends/Minter.react-query.ts new file mode 100644 index 00000000..007bcfd9 --- /dev/null +++ b/__output__/builder/no-extends/Minter.react-query.ts @@ -0,0 +1,55 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions, useQuery } from "react-query"; +import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; +import { MinterQueryClient } from "./Minter.client"; +export interface MinterReactQuery { + client: MinterQueryClient; + options?: UseQueryOptions; +} +export interface MinterMintCountQuery extends MinterReactQuery { + args: { + address: string; + }; +} +export function useMinterMintCountQuery({ + client, + args, + options +}: MinterMintCountQuery) { + return useQuery(["minterMintCount", client.contractAddress, JSON.stringify(args)], () => client.mintCount({ + address: args.address + }), options); +} +export interface MinterMintPriceQuery extends MinterReactQuery {} +export function useMinterMintPriceQuery({ + client, + options +}: MinterMintPriceQuery) { + return useQuery(["minterMintPrice", client.contractAddress], () => client.mintPrice(), options); +} +export interface MinterStartTimeQuery extends MinterReactQuery {} +export function useMinterStartTimeQuery({ + client, + options +}: MinterStartTimeQuery) { + return useQuery(["minterStartTime", client.contractAddress], () => client.startTime(), options); +} +export interface MinterMintableNumTokensQuery extends MinterReactQuery {} +export function useMinterMintableNumTokensQuery({ + client, + options +}: MinterMintableNumTokensQuery) { + return useQuery(["minterMintableNumTokens", client.contractAddress], () => client.mintableNumTokens(), options); +} +export interface MinterConfigQuery extends MinterReactQuery {} +export function useMinterConfigQuery({ + client, + options +}: MinterConfigQuery) { + return useQuery(["minterConfig", client.contractAddress], () => client.config(), options); +} \ No newline at end of file diff --git a/__output__/builder/no-extends/Minter.recoil.ts b/__output__/builder/no-extends/Minter.recoil.ts new file mode 100644 index 00000000..826fb57c --- /dev/null +++ b/__output__/builder/no-extends/Minter.recoil.ts @@ -0,0 +1,94 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { selectorFamily } from "recoil"; +import { cosmWasmClient } from "./chain"; +import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; +import { MinterQueryClient } from "./Minter.client"; +type QueryClientParams = { + contractAddress: string; +}; +export const queryClient = selectorFamily({ + key: "minterQueryClient", + get: ({ + contractAddress + }) => ({ + get + }) => { + const client = get(cosmWasmClient); + return new MinterQueryClient(client, contractAddress); + } +}); +export const configSelector = selectorFamily; +}>({ + key: "minterConfig", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.config(...params); + } +}); +export const mintableNumTokensSelector = selectorFamily; +}>({ + key: "minterMintableNumTokens", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.mintableNumTokens(...params); + } +}); +export const startTimeSelector = selectorFamily; +}>({ + key: "minterStartTime", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.startTime(...params); + } +}); +export const mintPriceSelector = selectorFamily; +}>({ + key: "minterMintPrice", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.mintPrice(...params); + } +}); +export const mintCountSelector = selectorFamily; +}>({ + key: "minterMintCount", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.mintCount(...params); + } +}); \ No newline at end of file diff --git a/__output__/builder/no-extends/Minter.types.ts b/__output__/builder/no-extends/Minter.types.ts new file mode 100644 index 00000000..55999b8d --- /dev/null +++ b/__output__/builder/no-extends/Minter.types.ts @@ -0,0 +1,124 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Timestamp = Uint64; +export type Uint64 = string; +export type Uint128 = string; +export interface ConfigResponse { + admin: string; + base_token_uri: string; + num_tokens: number; + per_address_limit: number; + sg721_address: string; + sg721_code_id: number; + start_time: Timestamp; + unit_price: Coin; + whitelist?: string | null; + [k: string]: unknown; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type Addr = string; +export interface Config { + admin: Addr; + base_token_uri: string; + num_tokens: number; + per_address_limit: number; + sg721_code_id: number; + start_time: Timestamp; + unit_price: Coin; + whitelist?: Addr | null; + [k: string]: unknown; +} +export type ExecuteMsg = { + mint: { + [k: string]: unknown; + }; +} | { + set_whitelist: { + whitelist: string; + [k: string]: unknown; + }; +} | { + update_start_time: Timestamp; +} | { + update_per_address_limit: { + per_address_limit: number; + [k: string]: unknown; + }; +} | { + mint_to: { + recipient: string; + [k: string]: unknown; + }; +} | { + mint_for: { + recipient: string; + token_id: number; + [k: string]: unknown; + }; +} | { + withdraw: { + [k: string]: unknown; + }; +}; +export type Decimal = string; +export interface InstantiateMsg { + base_token_uri: string; + num_tokens: number; + per_address_limit: number; + sg721_code_id: number; + sg721_instantiate_msg: InstantiateMsg1; + start_time: Timestamp; + unit_price: Coin; + whitelist?: string | null; + [k: string]: unknown; +} +export interface InstantiateMsg1 { + collection_info: CollectionInfoForRoyaltyInfoResponse; + minter: string; + name: string; + symbol: string; + [k: string]: unknown; +} +export interface CollectionInfoForRoyaltyInfoResponse { + creator: string; + description: string; + external_link?: string | null; + image: string; + royalty_info?: RoyaltyInfoResponse | null; + [k: string]: unknown; +} +export interface RoyaltyInfoResponse { + payment_address: string; + share: Decimal; + [k: string]: unknown; +} +export type QueryMsg = { + config: { + [k: string]: unknown; + }; +} | { + mintable_num_tokens: { + [k: string]: unknown; + }; +} | { + start_time: { + [k: string]: unknown; + }; +} | { + mint_price: { + [k: string]: unknown; + }; +} | { + mint_count: { + address: string; + [k: string]: unknown; + }; +}; \ No newline at end of file diff --git a/__output__/builder/no-extends/index.ts b/__output__/builder/no-extends/index.ts new file mode 100644 index 00000000..baf3d150 --- /dev/null +++ b/__output__/builder/no-extends/index.ts @@ -0,0 +1,65 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import * as _40 from "./Factory.types"; +import * as _41 from "./Factory.client"; +import * as _42 from "./Factory.message-composer"; +import * as _43 from "./Factory.react-query"; +import * as _44 from "./Factory.recoil"; +import * as _45 from "./Minter.types"; +import * as _46 from "./Minter.client"; +import * as _47 from "./Minter.message-composer"; +import * as _48 from "./Minter.react-query"; +import * as _49 from "./Minter.recoil"; +import * as _50 from "./CwAdminFactory.types"; +import * as _51 from "./CwAdminFactory.client"; +import * as _52 from "./CwAdminFactory.message-composer"; +import * as _53 from "./CwAdminFactory.react-query"; +import * as _54 from "./CwAdminFactory.recoil"; +import * as _55 from "./CwCodeIdRegistry.types"; +import * as _56 from "./CwCodeIdRegistry.client"; +import * as _57 from "./CwCodeIdRegistry.message-composer"; +import * as _58 from "./CwCodeIdRegistry.react-query"; +import * as _59 from "./CwCodeIdRegistry.recoil"; +import * as _60 from "./CwSingle.types"; +import * as _61 from "./CwSingle.client"; +import * as _62 from "./CwSingle.message-composer"; +import * as _63 from "./CwSingle.react-query"; +import * as _64 from "./CwSingle.recoil"; +export namespace smart { + export namespace contracts { + export const Factory = { ..._40, + ..._41, + ..._42, + ..._43, + ..._44 + }; + export const Minter = { ..._45, + ..._46, + ..._47, + ..._48, + ..._49 + }; + export const CwAdminFactory = { ..._50, + ..._51, + ..._52, + ..._53, + ..._54 + }; + export const CwCodeIdRegistry = { ..._55, + ..._56, + ..._57, + ..._58, + ..._59 + }; + export const CwSingle = { ..._60, + ..._61, + ..._62, + ..._63, + ..._64 + }; + } +} \ No newline at end of file diff --git a/package.json b/package.json index f21e06f9..707d8556 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "private": true, "scripts": { "build": "lerna run prepare --parallel", + "buidl": "lerna run buidl --parallel", "bootstrap": "lerna bootstrap --use-workspaces", "lint": "lerna run lint", "format": "lerna run format", diff --git a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap index 463da362..fb2cd3fa 100644 --- a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap +++ b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap @@ -11,6 +11,7 @@ TSBuilder { }, "client": Object { "enabled": true, + "execExtendsQuery": true, }, "messageComposer": Object { "enabled": false, @@ -45,6 +46,7 @@ TSBuilder { }, "client": Object { "enabled": true, + "execExtendsQuery": true, }, "messageComposer": Object { "enabled": false, diff --git a/packages/ts-codegen/__tests__/builder.test.ts b/packages/ts-codegen/__tests__/builder.test.ts index 72895b46..c06b8135 100644 --- a/packages/ts-codegen/__tests__/builder.test.ts +++ b/packages/ts-codegen/__tests__/builder.test.ts @@ -98,8 +98,49 @@ it('builder default', async () => { enabled: true }, client: { + enabled: true, + execExtendsQuery: true + }, + reactQuery: { + enabled: true + }, + recoil: { enabled: true }, + messageComposer: { + enabled: true + } + } + }); +}); + +it('builder no extends', async () => { + const outPath = OUTPUT_DIR + '/no-extends/'; + const s = (str) => FIXTURE_DIR + str; + await codegen({ + contracts: [ + s('/vectis/factory'), + s('/minter'), + s('/daodao/cw-admin-factory'), + s('/daodao/cw-code-id-registry'), + { + name: 'CwSingle', + dir: s('/daodao/cw-proposal-single') + } + ], + outPath, + options: { + bundle: { + bundleFile: 'index.ts', + scope: 'smart.contracts' + }, + types: { + enabled: true + }, + client: { + enabled: true, + execExtendsQuery: false + }, reactQuery: { enabled: true }, diff --git a/packages/ts-codegen/src/generators/client.ts b/packages/ts-codegen/src/generators/client.ts index 2ee571dd..2b838e41 100644 --- a/packages/ts-codegen/src/generators/client.ts +++ b/packages/ts-codegen/src/generators/client.ts @@ -66,16 +66,17 @@ export default async ( w.createExecuteInterface( context, Instance, - ReadOnlyInstance, + context.options.client.execExtendsQuery ? ReadOnlyInstance : null, ExecuteMsg ) ); + body.push( w.createExecuteClass( context, Client, Instance, - QueryClient, + context.options.client.execExtendsQuery ? QueryClient : null, ExecuteMsg ) ); diff --git a/packages/wasm-ast-types/src/client/client.ts b/packages/wasm-ast-types/src/client/client.ts index ca01115c..06265b33 100644 --- a/packages/wasm-ast-types/src/client/client.ts +++ b/packages/wasm-ast-types/src/client/client.ts @@ -346,7 +346,7 @@ export const createExecuteClass = ( context: RenderContext, className: string, implementsClassName: string, - extendsClassName: string, + extendsClassName: string | null, execMsg: ExecuteMsg ) => { diff --git a/packages/wasm-ast-types/src/context/context.ts b/packages/wasm-ast-types/src/context/context.ts index 23ec6b25..48bb0f00 100644 --- a/packages/wasm-ast-types/src/context/context.ts +++ b/packages/wasm-ast-types/src/context/context.ts @@ -14,6 +14,7 @@ export interface ReactQueryOptions { export interface TSClientOptions { enabled?: boolean; + execExtendsQuery?: boolean; } export interface MessageComposerOptions { enabled?: boolean; @@ -67,7 +68,8 @@ export const defaultOptions: RenderOptions = { aliasExecuteMsg: false }, client: { - enabled: true + enabled: true, + execExtendsQuery: true }, recoil: { enabled: false diff --git a/packages/wasm-ast-types/types/client/client.d.ts b/packages/wasm-ast-types/types/client/client.d.ts index 4c7ad20e..77f57150 100644 --- a/packages/wasm-ast-types/types/client/client.d.ts +++ b/packages/wasm-ast-types/types/client/client.d.ts @@ -8,7 +8,7 @@ export declare const createWasmQueryMethod: (context: RenderContext, jsonschema: export declare const createQueryClass: (context: RenderContext, className: string, implementsClassName: string, queryMsg: QueryMsg) => t.ExportNamedDeclaration; export declare const getWasmMethodArgs: (context: RenderContext, jsonschema: JSONSchema) => t.ObjectProperty[]; export declare const createWasmExecMethod: (context: RenderContext, jsonschema: JSONSchema) => t.ClassProperty; -export declare const createExecuteClass: (context: RenderContext, className: string, implementsClassName: string, extendsClassName: string, execMsg: ExecuteMsg) => t.ExportNamedDeclaration; +export declare const createExecuteClass: (context: RenderContext, className: string, implementsClassName: string, extendsClassName: string | null, execMsg: ExecuteMsg) => t.ExportNamedDeclaration; export declare const createExecuteInterface: (context: RenderContext, className: string, extendsClassName: string | null, execMsg: ExecuteMsg) => t.ExportNamedDeclaration; export declare const createPropertyFunctionWithObjectParams: (context: RenderContext, methodName: string, responseType: string, jsonschema: JSONSchema) => t.TSPropertySignature; export declare const createPropertyFunctionWithObjectParamsForExec: (context: RenderContext, methodName: string, responseType: string, jsonschema: JSONSchema) => t.TSPropertySignature; diff --git a/packages/wasm-ast-types/types/context/context.d.ts b/packages/wasm-ast-types/types/context/context.d.ts index 7464030c..28fe022d 100644 --- a/packages/wasm-ast-types/types/context/context.d.ts +++ b/packages/wasm-ast-types/types/context/context.d.ts @@ -9,6 +9,7 @@ export interface ReactQueryOptions { } export interface TSClientOptions { enabled?: boolean; + execExtendsQuery?: boolean; } export interface MessageComposerOptions { enabled?: boolean; From 10e4cbebd8a57a025ac1a466324bc1e914563ab6 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 10 Oct 2022 18:51:05 -0700 Subject: [PATCH 059/287] readme --- README.md | 1 + packages/ts-codegen/README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index b5f4dbea..1046ae9b 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ The `client` plugin will generate TS client classes for your contracts. This opt | option | description | | ----------------------------- | --------------------------------------------------- | | `client.enabled` | generate TS client classes for your contracts | + | `client.execExtendsQuery` | execute should extend query message clients | #### Client via CLI diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index b5f4dbea..1046ae9b 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -146,6 +146,7 @@ The `client` plugin will generate TS client classes for your contracts. This opt | option | description | | ----------------------------- | --------------------------------------------------- | | `client.enabled` | generate TS client classes for your contracts | + | `client.execExtendsQuery` | execute should extend query message clients | #### Client via CLI From e46828bd476d30465a35a8021e611938abf89846 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 10 Oct 2022 18:51:12 -0700 Subject: [PATCH 060/287] chore(release): publish - @cosmwasm/ts-codegen@0.19.0 - wasm-ast-types@0.13.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 81c3c15d..8a816d7c 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.19.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.18.0...@cosmwasm/ts-codegen@0.19.0) (2022-10-11) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.18.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.17.0...@cosmwasm/ts-codegen@0.18.0) (2022-10-11) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 81b5145f..1417f85d 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.18.0", + "version": "0.19.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.12.0" + "wasm-ast-types": "^0.13.0" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 27fd5784..3c40cd22 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.13.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.12.0...wasm-ast-types@0.13.0) (2022-10-11) + +**Note:** Version bump only for package wasm-ast-types + + + + + # [0.12.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.11.3...wasm-ast-types@0.12.0) (2022-10-11) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index f4a16143..cc2b381a 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.12.0", + "version": "0.13.0", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From 4d67923c3400768a862012e1d7e601fc16cc4f82 Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Tue, 27 Sep 2022 10:46:21 -0500 Subject: [PATCH 061/287] Lint react-query --- .../src/react-query/react-query.ts | 1468 ++++++++--------- 1 file changed, 714 insertions(+), 754 deletions(-) diff --git a/packages/wasm-ast-types/src/react-query/react-query.ts b/packages/wasm-ast-types/src/react-query/react-query.ts index 91935510..927b8e7f 100644 --- a/packages/wasm-ast-types/src/react-query/react-query.ts +++ b/packages/wasm-ast-types/src/react-query/react-query.ts @@ -2,283 +2,285 @@ import type { Expression } from '@babel/types'; import * as t from '@babel/types'; import { camel, pascal } from 'case'; import { ExecuteMsg, QueryMsg } from '../types'; -import { callExpression, getMessageProperties, identifier, tsObjectPattern, tsPropertySignature } from '../utils'; import { - omitTypeReference, - optionalConditionalExpression, - propertySignature, - shorthandProperty + callExpression, + getMessageProperties, + identifier, + tsObjectPattern, + tsPropertySignature +} from '../utils'; +import { + omitTypeReference, + optionalConditionalExpression, + propertySignature, + shorthandProperty } from '../utils/babel'; -import { getParamsTypeAnnotation, getPropertyType, getResponseType } from '../utils/types'; +import { + getParamsTypeAnnotation, + getPropertyType, + getResponseType +} from '../utils/types'; import { ReactQueryOptions, RenderContext } from '../context'; import { JSONSchema } from '../types'; import { FIXED_EXECUTE_PARAMS } from '../client'; interface ReactQueryHookQuery { - context: RenderContext, - hookName: string; - hookParamsTypeName: string; - hookKeyName: string; - queryKeysName: string - responseType: string; - methodName: string; - jsonschema: any; + context: RenderContext; + hookName: string; + hookParamsTypeName: string; + hookKeyName: string; + queryKeysName: string; + responseType: string; + methodName: string; + jsonschema: any; } interface ReactQueryHooks { - context: RenderContext; - queryMsg: QueryMsg; - contractName: string; - QueryClient: string; + context: RenderContext; + queryMsg: QueryMsg; + contractName: string; + QueryClient: string; } export const createReactQueryHooks = ({ - context, - queryMsg, - contractName, - QueryClient + context, + queryMsg, + contractName, + QueryClient }: ReactQueryHooks) => { - const options = context.options.reactQuery; + const options = context.options.reactQuery; - const genericQueryInterfaceName = `${pascal(contractName)}ReactQuery`; - const underscoreNames: string[] = getMessageProperties(queryMsg).map((schema) => (Object.keys(schema.properties)[0])) + const genericQueryInterfaceName = `${pascal(contractName)}ReactQuery`; + const underscoreNames: string[] = getMessageProperties(queryMsg).map( + (schema) => Object.keys(schema.properties)[0] + ); - const body = [] - - const queryKeysName = `${camel(contractName)}QueryKeys` - if (options.queryKeys) { - body.push( - createReactQueryKeys({ - context, - queryKeysName, - camelContractName: camel(contractName), - underscoreNames, - })) - } + const body = []; + const queryKeysName = `${camel(contractName)}QueryKeys`; + if (options.queryKeys) { body.push( - createReactQueryHookGenericInterface({ - context, - QueryClient, - genericQueryInterfaceName, - })) - - body.push(...getMessageProperties(queryMsg) - .reduce((m, schema) => { - // list_voters - const underscoreName = Object.keys(schema.properties)[0]; - // listVoters - const methodName = camel(underscoreName); - // Cw3FlexMultisigListVotersQuery - const hookParamsTypeName = `${pascal(contractName)}${pascal(methodName)}Query`; - // useCw3FlexMultisigListVotersQuery - const hookName = `use${hookParamsTypeName}`; - // listVotersResponse - const responseType = getResponseType(context, underscoreName); - // cw3FlexMultisigListVoters - const getterKey = camel(`${contractName}${pascal(methodName)}`); - const jsonschema = schema.properties[underscoreName]; - return [ - createReactQueryHookInterface({ - context, - hookParamsTypeName, - responseType, - queryInterfaceName: genericQueryInterfaceName, - QueryClient, - jsonschema, - }), - createReactQueryHook({ - context, - methodName, - hookName, - hookParamsTypeName, - queryKeysName, - responseType, - hookKeyName: getterKey, - jsonschema - }), - ...m, - ] - }, []) + createReactQueryKeys({ + context, + queryKeysName, + camelContractName: camel(contractName), + underscoreNames + }) ); + } - return body + body.push( + createReactQueryHookGenericInterface({ + context, + QueryClient, + genericQueryInterfaceName + }) + ); + + body.push( + ...getMessageProperties(queryMsg).reduce((m, schema) => { + // list_voters + const underscoreName = Object.keys(schema.properties)[0]; + // listVoters + const methodName = camel(underscoreName); + // Cw3FlexMultisigListVotersQuery + const hookParamsTypeName = `${pascal(contractName)}${pascal( + methodName + )}Query`; + // useCw3FlexMultisigListVotersQuery + const hookName = `use${hookParamsTypeName}`; + // listVotersResponse + const responseType = getResponseType(context, underscoreName); + // cw3FlexMultisigListVoters + const getterKey = camel(`${contractName}${pascal(methodName)}`); + const jsonschema = schema.properties[underscoreName]; + return [ + createReactQueryHookInterface({ + context, + hookParamsTypeName, + responseType, + queryInterfaceName: genericQueryInterfaceName, + QueryClient, + jsonschema + }), + createReactQueryHook({ + context, + methodName, + hookName, + hookParamsTypeName, + queryKeysName, + responseType, + hookKeyName: getterKey, + jsonschema + }), + ...m + ]; + }, []) + ); + + return body; }; - export const createReactQueryHook = ({ - context, - hookName, - hookParamsTypeName, - responseType, - hookKeyName, - queryKeysName, - methodName, - jsonschema + context, + hookName, + hookParamsTypeName, + responseType, + hookKeyName, + queryKeysName, + methodName, + jsonschema }: ReactQueryHookQuery) => { + context.addUtil('useQuery'); + context.addUtil('UseQueryOptions'); + + const options = context.options.reactQuery; + const keys = Object.keys(jsonschema.properties ?? {}); + let args = []; + if (keys.length) { + args = [ + t.objectExpression([ + ...keys.map((prop) => { + return t.objectProperty( + t.identifier(camel(prop)), + t.memberExpression(t.identifier('args'), t.identifier(camel(prop))) + ); + }) + ]) + ]; + } - context.addUtil('useQuery'); - context.addUtil('UseQueryOptions'); - - const options = context.options.reactQuery; - const keys = Object.keys(jsonschema.properties ?? {}); - let args = []; - if (keys.length) { - args = [ - t.objectExpression([ - ...keys.map(prop => { - return t.objectProperty( - t.identifier(camel(prop)), - t.memberExpression( - t.identifier('args'), - t.identifier(camel(prop)) - ) - ) - }) - ]) - ] - } - - let props = ['client', 'options']; - if (keys.length) { - props = ['client', 'args', 'options']; - } - - const selectResponseGenericTypeName = 'TData'; - - const queryFunctionDeclaration = - t.functionDeclaration( - t.identifier(hookName), - [ - tsObjectPattern( - [ - ...props.map(prop => { - return t.objectProperty( - t.identifier(prop), - t.identifier(prop), - false, - true - ) - }) - ], - t.tsTypeAnnotation(t.tsTypeReference( - t.identifier(hookParamsTypeName), - t.tsTypeParameterInstantiation([ - t.tsTypeReference(t.identifier(selectResponseGenericTypeName)) - ]) - )) - ) - ], - t.blockStatement( - [ - - t.returnStatement( - callExpression( - t.identifier('useQuery'), - [ - generateUseQueryQueryKey({ hookKeyName, queryKeysName, methodName, props, options }), - t.arrowFunctionExpression( - [], - optionalConditionalExpression( - t.identifier('client'), - t.callExpression( - t.memberExpression( - t.identifier('client'), - t.identifier(methodName) - ), - args - ), - t.callExpression( - t.memberExpression( - t.identifier('Promise'), - t.identifier('reject'), - ), - [ - t.newExpression( - t.identifier('Error'), - [ - t.stringLiteral('Invalid client') - ] - ) - ] - ), - options.optionalClient - ), - false - ), - options.optionalClient - ? t.objectExpression([ - t.spreadElement(t.identifier('options')), - t.objectProperty( - t.identifier('enabled'), - t.logicalExpression( - '&&', - t.unaryExpression( - '!', - t.unaryExpression('!', t.identifier('client')) - ), - t.conditionalExpression( - // explicitly check for undefined - t.binaryExpression( - '!=', - t.optionalMemberExpression( - t.identifier('options'), - t.identifier('enabled'), - false, - true - ), - t.identifier('undefined') - ), - t.memberExpression( - t.identifier('options'), - t.identifier('enabled') - ), - t.booleanLiteral(true) - ) - - )), - ]) - : t.identifier('options'), - ], - t.tsTypeParameterInstantiation( - [ - t.tsTypeReference( - t.identifier(responseType) - ), - t.tsTypeReference( - t.identifier('Error') - ), - t.tsTypeReference( - t.identifier(selectResponseGenericTypeName) - ) - ] - ) - ) - ) + let props = ['client', 'options']; + if (keys.length) { + props = ['client', 'args', 'options']; + } - ] - ), + const selectResponseGenericTypeName = 'TData'; + + const queryFunctionDeclaration = t.functionDeclaration( + t.identifier(hookName), + [ + tsObjectPattern( + [ + ...props.map((prop) => { + return t.objectProperty( + t.identifier(prop), + t.identifier(prop), + false, + true + ); + }) + ], + t.tsTypeAnnotation( + t.tsTypeReference( + t.identifier(hookParamsTypeName), + t.tsTypeParameterInstantiation([ + t.tsTypeReference(t.identifier(selectResponseGenericTypeName)) + ]) + ) ) - - // Add the TData type parameters - queryFunctionDeclaration.typeParameters = t.tsTypeParameterDeclaration([ - t.tsTypeParameter( - undefined, - t.tSTypeReference(t.identifier(responseType)), - selectResponseGenericTypeName + ) + ], + t.blockStatement([ + t.returnStatement( + callExpression( + t.identifier('useQuery'), + [ + generateUseQueryQueryKey({ + hookKeyName, + queryKeysName, + methodName, + props, + options + }), + t.arrowFunctionExpression( + [], + optionalConditionalExpression( + t.identifier('client'), + t.callExpression( + t.memberExpression( + t.identifier('client'), + t.identifier(methodName) + ), + args + ), + t.callExpression( + t.memberExpression( + t.identifier('Promise'), + t.identifier('reject') + ), + [ + t.newExpression(t.identifier('Error'), [ + t.stringLiteral('Invalid client') + ]) + ] + ), + options.optionalClient + ), + false + ), + options.optionalClient + ? t.objectExpression([ + t.spreadElement(t.identifier('options')), + t.objectProperty( + t.identifier('enabled'), + t.logicalExpression( + '&&', + t.unaryExpression( + '!', + t.unaryExpression('!', t.identifier('client')) + ), + t.conditionalExpression( + // explicitly check for undefined + t.binaryExpression( + '!=', + t.optionalMemberExpression( + t.identifier('options'), + t.identifier('enabled'), + false, + true + ), + t.identifier('undefined') + ), + t.memberExpression( + t.identifier('options'), + t.identifier('enabled') + ), + t.booleanLiteral(true) + ) + ) + ) + ]) + : t.identifier('options') + ], + t.tsTypeParameterInstantiation([ + t.tsTypeReference(t.identifier(responseType)), + t.tsTypeReference(t.identifier('Error')), + t.tsTypeReference(t.identifier(selectResponseGenericTypeName)) + ]) ) + ) ]) + ); + + // Add the TData type parameters + queryFunctionDeclaration.typeParameters = t.tsTypeParameterDeclaration([ + t.tsTypeParameter( + undefined, + t.tSTypeReference(t.identifier(responseType)), + selectResponseGenericTypeName + ) + ]); - return t.exportNamedDeclaration(queryFunctionDeclaration) - + return t.exportNamedDeclaration(queryFunctionDeclaration); }; interface ReactQueryMutationHookInterface { - context: RenderContext; - ExecuteClient: string; - mutationHookParamsTypeName: string; - jsonschema: JSONSchema; - useMutationTypeParameter: t.TSTypeParameterInstantiation; + context: RenderContext; + ExecuteClient: string; + mutationHookParamsTypeName: string; + jsonschema: JSONSchema; + useMutationTypeParameter: t.TSTypeParameterInstantiation; } /** @@ -298,167 +300,155 @@ export interface Cw4UpdateMembersMutation { ``` */ export const createReactQueryMutationArgsInterface = ({ - context, - ExecuteClient, - mutationHookParamsTypeName, - useMutationTypeParameter, - jsonschema, + context, + ExecuteClient, + mutationHookParamsTypeName, + useMutationTypeParameter, + jsonschema }: ReactQueryMutationHookInterface) => { - - const typedUseMutationOptions = t.tsTypeReference( - t.identifier('UseMutationOptions'), - useMutationTypeParameter + const typedUseMutationOptions = t.tsTypeReference( + t.identifier('UseMutationOptions'), + useMutationTypeParameter + ); + + const body = [ + tsPropertySignature( + t.identifier('client'), + t.tsTypeAnnotation(t.tsTypeReference(t.identifier(ExecuteClient))), + false ) + ]; - const body = [ - tsPropertySignature( - t.identifier('client'), - t.tsTypeAnnotation( - t.tsTypeReference( - t.identifier(ExecuteClient) - ) - ), - false - ), - ] - - const msgType: t.TSTypeAnnotation = getParamsTypeAnnotation(context, jsonschema) - - if (msgType) { - body.push( - t.tsPropertySignature( - t.identifier('msg'), - msgType - )) - } + const msgType: t.TSTypeAnnotation = getParamsTypeAnnotation( + context, + jsonschema + ); - context.addUtil('StdFee') - context.addUtil('Coin'); - // fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[] + if (msgType) { + body.push(t.tsPropertySignature(t.identifier('msg'), msgType)); + } - const optionalArgs = t.tsPropertySignature( - t.identifier('args'), - t.tsTypeAnnotation( + context.addUtil('StdFee'); + context.addUtil('Coin'); + // fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[] + + const optionalArgs = t.tsPropertySignature( + t.identifier('args'), + t.tsTypeAnnotation( + // @ts-ignore:next-line + t.tsTypeLiteral( + FIXED_EXECUTE_PARAMS.map((param) => + propertySignature( + param.name, // @ts-ignore:next-line - t.tsTypeLiteral(FIXED_EXECUTE_PARAMS.map(param => propertySignature( - param.name, - // @ts-ignore:next-line - param.typeAnnotation, - param.optional - ))) + param.typeAnnotation, + param.optional + ) ) + ) ) + ); - optionalArgs.optional = true - - body.push(optionalArgs) + optionalArgs.optional = true; + body.push(optionalArgs); - return t.exportNamedDeclaration(t.tsInterfaceDeclaration( - t.identifier(mutationHookParamsTypeName), - null, - [], - t.tsInterfaceBody( - body - ) - )) + return t.exportNamedDeclaration( + t.tsInterfaceDeclaration( + t.identifier(mutationHookParamsTypeName), + null, + [], + t.tsInterfaceBody(body) + ) + ); }; - interface ReactQueryMutationHooks { - context: RenderContext; - execMsg: ExecuteMsg; - contractName: string; - ExecuteClient: string; + context: RenderContext; + execMsg: ExecuteMsg; + contractName: string; + ExecuteClient: string; } export const createReactQueryMutationHooks = ({ - context, - execMsg, - contractName, - ExecuteClient + context, + execMsg, + contractName, + ExecuteClient }: ReactQueryMutationHooks) => { - // merge the user options with the defaults - return getMessageProperties(execMsg) - .reduce((m, schema) => { - // update_members - const execMethodUnderscoreName = Object.keys(schema.properties)[0]; - // updateMembers - const execMethodName = camel(execMethodUnderscoreName); - // Cw20UpdateMembersMutation - const mutationHookParamsTypeName = `${pascal(contractName)}${pascal(execMethodName)}Mutation`; - // useCw20UpdateMembersMutation - const mutationHookName = `use${mutationHookParamsTypeName}`; - - const jsonschema = schema.properties[execMethodUnderscoreName]; - - const properties = jsonschema.properties ?? {}; - - // TODO: there should be a better way to do this - const hasMsg = !!(Object.keys(properties)?.length || jsonschema?.$ref) - - // - const useMutationTypeParameter = generateMutationTypeParameter( - context, - mutationHookParamsTypeName - ); - + // merge the user options with the defaults + return getMessageProperties(execMsg).reduce((m, schema) => { + // update_members + const execMethodUnderscoreName = Object.keys(schema.properties)[0]; + // updateMembers + const execMethodName = camel(execMethodUnderscoreName); + // Cw20UpdateMembersMutation + const mutationHookParamsTypeName = `${pascal(contractName)}${pascal( + execMethodName + )}Mutation`; + // useCw20UpdateMembersMutation + const mutationHookName = `use${mutationHookParamsTypeName}`; + + const jsonschema = schema.properties[execMethodUnderscoreName]; + + const properties = jsonschema.properties ?? {}; + + // TODO: there should be a better way to do this + const hasMsg = !!(Object.keys(properties)?.length || jsonschema?.$ref); + + // + const useMutationTypeParameter = generateMutationTypeParameter( + context, + mutationHookParamsTypeName + ); - return [ - createReactQueryMutationArgsInterface({ - context, - mutationHookParamsTypeName, - ExecuteClient, - jsonschema, - useMutationTypeParameter - }), - createReactQueryMutationHook({ - context, - execMethodName, - mutationHookName, - mutationHookParamsTypeName, - hasMsg, - useMutationTypeParameter, - }), - ...m, - ] - }, []); + return [ + createReactQueryMutationArgsInterface({ + context, + mutationHookParamsTypeName, + ExecuteClient, + jsonschema, + useMutationTypeParameter + }), + createReactQueryMutationHook({ + context, + execMethodName, + mutationHookName, + mutationHookParamsTypeName, + hasMsg, + useMutationTypeParameter + }), + ...m + ]; + }, []); }; /** * Generates the mutation type parameter. If args exist, we use a pick. If not, we just return the params type. */ const generateMutationTypeParameter = ( - context: RenderContext, - mutationHookParamsTypeName: string + context: RenderContext, + mutationHookParamsTypeName: string ) => { - - context.addUtil('ExecuteResult'); - - return t.tsTypeParameterInstantiation([ - // Data - t.tSTypeReference( - t.identifier('ExecuteResult') - ), - // Error - t.tsTypeReference( - t.identifier('Error') - ), - // Variables - t.tsTypeReference( - t.identifier(mutationHookParamsTypeName) - ) - ]); -} - + context.addUtil('ExecuteResult'); + + return t.tsTypeParameterInstantiation([ + // Data + t.tSTypeReference(t.identifier('ExecuteResult')), + // Error + t.tsTypeReference(t.identifier('Error')), + // Variables + t.tsTypeReference(t.identifier(mutationHookParamsTypeName)) + ]); +}; interface ReactQueryMutationHook { - context: RenderContext; - mutationHookName: string; - mutationHookParamsTypeName: string; - execMethodName: string; - useMutationTypeParameter: t.TSTypeParameterInstantiation; - hasMsg: boolean; + context: RenderContext; + mutationHookName: string; + mutationHookParamsTypeName: string; + execMethodName: string; + useMutationTypeParameter: t.TSTypeParameterInstantiation; + hasMsg: boolean; } /** @@ -473,441 +463,411 @@ export const useCw4UpdateMembersMutation = ({ client, options }: Omit { - - context.addUtil('useMutation'); - context.addUtil('UseMutationOptions'); - - const useMutationFunctionArgs = [shorthandProperty('client')] - if (hasMsg) useMutationFunctionArgs.push(shorthandProperty('msg')) - useMutationFunctionArgs.push( - t.objectProperty( - t.identifier('args'), - t.assignmentPattern( - t.objectPattern(FIXED_EXECUTE_PARAMS.map(param => shorthandProperty(param.name))), - t.objectExpression([]) + context.addUtil('useMutation'); + context.addUtil('UseMutationOptions'); + + const useMutationFunctionArgs = [shorthandProperty('client')]; + if (hasMsg) useMutationFunctionArgs.push(shorthandProperty('msg')); + useMutationFunctionArgs.push( + t.objectProperty( + t.identifier('args'), + t.assignmentPattern( + t.objectPattern( + FIXED_EXECUTE_PARAMS.map((param) => shorthandProperty(param.name)) + ), + t.objectExpression([]) + ) + ) + ); + + return t.exportNamedDeclaration( + t.functionDeclaration( + t.identifier(mutationHookName), + [ + identifier( + 'options', + t.tsTypeAnnotation( + omitTypeReference( + t.tsTypeReference( + t.identifier('UseMutationOptions'), + useMutationTypeParameter + ), + 'mutationFn' ) + ), + true ) - ) - - return t.exportNamedDeclaration( - t.functionDeclaration( - t.identifier(mutationHookName), + ], + t.blockStatement([ + t.returnStatement( + callExpression( + t.identifier('useMutation'), [ - identifier('options', t.tsTypeAnnotation( - omitTypeReference( - t.tsTypeReference( - t.identifier('UseMutationOptions'), - useMutationTypeParameter - ), - 'mutationFn' + t.arrowFunctionExpression( + [t.objectPattern(useMutationFunctionArgs)], + t.callExpression( + t.memberExpression( + t.identifier('client'), + t.identifier(execMethodName) + ), + (hasMsg ? [t.identifier('msg')] : []).concat( + FIXED_EXECUTE_PARAMS.map((param) => + t.identifier(param.name) ) - ), true) + ) + ), + false // not async + ), + t.identifier('options') ], - t.blockStatement( - [ - t.returnStatement( - callExpression( - t.identifier('useMutation'), - [ - t.arrowFunctionExpression( - [t.objectPattern(useMutationFunctionArgs)], - t.callExpression( - t.memberExpression( - t.identifier('client'), - t.identifier(execMethodName) - ), - (hasMsg - ? [t.identifier('msg')] - : [] - ) - .concat(FIXED_EXECUTE_PARAMS.map(param => t.identifier(param.name))) - ), - false // not async - ), - t.identifier('options'), - ], - useMutationTypeParameter - ) - ) - - ] - ), + useMutationTypeParameter + ) ) + ]) ) - + ); }; function createReactQueryKeys({ - context, - queryKeysName, - camelContractName, - underscoreNames + context, + queryKeysName, + camelContractName, + underscoreNames }: { - context: RenderContext; - queryKeysName: string, - camelContractName: string; - underscoreNames: string[]; + context: RenderContext; + queryKeysName: string; + camelContractName: string; + underscoreNames: string[]; }) { - const options = context.options.reactQuery - - const contractAddressTypeAnnotation = t.tsTypeAnnotation( - options.optionalClient - ? t.tsUnionType([ - t.tsStringKeyword(), - t.tsUndefinedKeyword() - ]) - : t.tSStringKeyword() - ) - - return t.exportNamedDeclaration( - t.variableDeclaration('const', [ - t.variableDeclarator( - t.identifier(queryKeysName), + const options = context.options.reactQuery; + + const contractAddressTypeAnnotation = t.tsTypeAnnotation( + options.optionalClient + ? t.tsUnionType([t.tsStringKeyword(), t.tsUndefinedKeyword()]) + : t.tSStringKeyword() + ); + + return t.exportNamedDeclaration( + t.variableDeclaration('const', [ + t.variableDeclarator( + t.identifier(queryKeysName), + t.objectExpression([ + // 1: contract + t.objectProperty( + t.identifier('contract'), + t.tSAsExpression( + t.arrayExpression([ t.objectExpression([ - // 1: contract - t.objectProperty( - t.identifier('contract'), - t.tSAsExpression( - t.arrayExpression([ - t.objectExpression([ - t.objectProperty( - t.identifier('contract'), - t.stringLiteral(camelContractName) - ) - ]) - ]), - t.tSTypeReference(t.identifier('const')) - ) + t.objectProperty( + t.identifier('contract'), + t.stringLiteral(camelContractName) + ) + ]) + ]), + t.tSTypeReference(t.identifier('const')) + ) + ), + // 2: address + t.objectProperty( + t.identifier('address'), + t.arrowFunctionExpression( + [identifier('contractAddress', contractAddressTypeAnnotation)], + t.tSAsExpression( + t.arrayExpression([ + t.objectExpression([ + // 1 + t.spreadElement( + t.memberExpression( + t.memberExpression( + t.identifier(queryKeysName), + t.identifier('contract') + ), + t.numericLiteral(0), + true // computed + ) ), - // 2: address t.objectProperty( - t.identifier('address'), - t.arrowFunctionExpression( - [ - identifier( - 'contractAddress', - contractAddressTypeAnnotation - ) - ], - t.tSAsExpression( - t.arrayExpression([ - t.objectExpression([ - // 1 - t.spreadElement( - t.memberExpression( - t.memberExpression( - t.identifier(queryKeysName), - t.identifier('contract') - ), - t.numericLiteral(0), - true // computed - ) - ), - t.objectProperty( - t.identifier('address'), - t.identifier('contractAddress') - ) - ]) - ]), - t.tSTypeReference(t.identifier('const')) - ) - ) + t.identifier('address'), + t.identifier('contractAddress') + ) + ]) + ]), + t.tSTypeReference(t.identifier('const')) + ) + ) + ), + // 3: methods + ...underscoreNames.map((underscoreMethodName) => + t.objectProperty( + // key id is the camel method name + t.identifier(camel(underscoreMethodName)), + t.arrowFunctionExpression( + [ + identifier('contractAddress', contractAddressTypeAnnotation), + identifier( + 'args', + // Record + t.tSTypeAnnotation( + t.tsTypeReference( + t.identifier('Record'), + t.tsTypeParameterInstantiation([ + t.tsStringKeyword(), + t.tsUnknownKeyword() + ]) + ) ), - // 3: methods - ...underscoreNames.map((underscoreMethodName) => - t.objectProperty( - // key id is the camel method name - t.identifier(camel(underscoreMethodName)), - t.arrowFunctionExpression( - [ - identifier( - 'contractAddress', - contractAddressTypeAnnotation - ), - identifier( - 'args', - // Record - t.tSTypeAnnotation( - t.tsTypeReference( - t.identifier('Record'), - t.tsTypeParameterInstantiation([ - t.tsStringKeyword(), - t.tsUnknownKeyword() - ]) - ) - ), - true // optional - ) - ], - t.tSAsExpression( - t.arrayExpression([ - t.objectExpression([ - //...cw3FlexMultisigQueryKeys.address(contractAddress)[0] - t.spreadElement( - t.memberExpression( - t.callExpression( - t.memberExpression( - t.identifier(queryKeysName), - t.identifier('address') - ), - [t.identifier('contractAddress')] - ), - t.numericLiteral(0), - true // computed - ) - ), - // method: list_voters - t.objectProperty( - t.identifier('method'), - t.stringLiteral(underscoreMethodName) - ), - // args - shorthandProperty('args') - ]) - ]), - t.tSTypeReference(t.identifier('const')) - ) - ) + true // optional + ) + ], + t.tSAsExpression( + t.arrayExpression([ + t.objectExpression([ + //...cw3FlexMultisigQueryKeys.address(contractAddress)[0] + t.spreadElement( + t.memberExpression( + t.callExpression( + t.memberExpression( + t.identifier(queryKeysName), + t.identifier('address') + ), + [t.identifier('contractAddress')] + ), + t.numericLiteral(0), + true // computed ) - ) - ]) + ), + // method: list_voters + t.objectProperty( + t.identifier('method'), + t.stringLiteral(underscoreMethodName) + ), + // args + shorthandProperty('args') + ]) + ]), + t.tSTypeReference(t.identifier('const')) + ) + ) ) + ) ]) - ) + ) + ]) + ); } interface ReactQueryHookGenericInterface { - context: RenderContext, - QueryClient: string, - genericQueryInterfaceName: string + context: RenderContext; + QueryClient: string; + genericQueryInterfaceName: string; } function createReactQueryHookGenericInterface({ - context, - QueryClient, - genericQueryInterfaceName + context, + QueryClient, + genericQueryInterfaceName }: ReactQueryHookGenericInterface) { + const options = context.options.reactQuery; - const options = context.options.reactQuery; + const genericResponseTypeName = 'TResponse'; + const genericSelectResponseTypeName = 'TData'; - const genericResponseTypeName = 'TResponse' - const genericSelectResponseTypeName = 'TData' + context.addUtil('UseQueryOptions'); - context.addUtil('UseQueryOptions'); + // UseQueryOptions, + const typedUseQueryOptions = t.tsTypeReference( + t.identifier('UseQueryOptions'), + t.tsTypeParameterInstantiation([ + t.tsTypeReference(t.identifier(genericResponseTypeName)), + t.tsTypeReference(t.identifier('Error')), + t.tsTypeReference(t.identifier(genericSelectResponseTypeName)) + ]) + ); - // UseQueryOptions, - const typedUseQueryOptions = t.tsTypeReference( - t.identifier('UseQueryOptions'), - t.tsTypeParameterInstantiation( - [ - t.tsTypeReference( - t.identifier(genericResponseTypeName) - ), - t.tsTypeReference(t.identifier('Error')), - t.tsTypeReference( - t.identifier(genericSelectResponseTypeName) + const body = [ + tsPropertySignature( + t.identifier('client'), + t.tsTypeAnnotation( + options.optionalClient + ? t.tsUnionType([ + t.tsTypeReference(t.identifier(QueryClient)), + t.tsUndefinedKeyword() + ]) + : t.tsTypeReference(t.identifier(QueryClient)) + ), + false + ), + tsPropertySignature( + t.identifier('options'), + t.tsTypeAnnotation( + options.version === 'v4' + ? t.tSIntersectionType([ + omitTypeReference( + typedUseQueryOptions, + "'queryKey' | 'queryFn' | 'initialData'" + ), + t.tSTypeLiteral([ + t.tsPropertySignature( + t.identifier('initialData?'), + t.tsTypeAnnotation(t.tsUndefinedKeyword()) ) + ]) ]) + : typedUseQueryOptions + ), + true ) - - const body = [ - tsPropertySignature( - t.identifier('client'), - t.tsTypeAnnotation( - options.optionalClient - ? t.tsUnionType([ - t.tsTypeReference( - t.identifier(QueryClient) - ), - t.tsUndefinedKeyword() - ]) - : t.tsTypeReference( - t.identifier(QueryClient) - ) - ), - false - ), - tsPropertySignature( - t.identifier('options'), - t.tsTypeAnnotation( - options.version === 'v4' - ? t.tSIntersectionType([ - omitTypeReference(typedUseQueryOptions, "'queryKey' | 'queryFn' | 'initialData'"), - t.tSTypeLiteral([ - t.tsPropertySignature( - t.identifier('initialData?'), - t.tsTypeAnnotation( - t.tsUndefinedKeyword() - ) - ) - ]) - ]) - : typedUseQueryOptions - ), - true - ) - ]; - - return t.exportNamedDeclaration( - t.tsInterfaceDeclaration( - t.identifier(genericQueryInterfaceName), - t.tsTypeParameterDeclaration([ - // 1: TResponse - t.tsTypeParameter(undefined, undefined, genericResponseTypeName), - // 2: TData - t.tsTypeParameter( - undefined, - t.tSTypeReference(t.identifier(genericResponseTypeName)), - genericSelectResponseTypeName - ) - ]), - [], - t.tSInterfaceBody(body) + ]; + + return t.exportNamedDeclaration( + t.tsInterfaceDeclaration( + t.identifier(genericQueryInterfaceName), + t.tsTypeParameterDeclaration([ + // 1: TResponse + t.tsTypeParameter(undefined, undefined, genericResponseTypeName), + // 2: TData + t.tsTypeParameter( + undefined, + t.tSTypeReference(t.identifier(genericResponseTypeName)), + genericSelectResponseTypeName ) + ]), + [], + t.tSInterfaceBody(body) ) + ); } interface ReactQueryHookQueryInterface { - context: RenderContext, - QueryClient: string; - hookParamsTypeName: string; - queryInterfaceName: string - responseType: string; - jsonschema: any; + context: RenderContext; + QueryClient: string; + hookParamsTypeName: string; + queryInterfaceName: string; + responseType: string; + jsonschema: any; } export const createReactQueryHookInterface = ({ - context, - QueryClient, - hookParamsTypeName, - queryInterfaceName, - responseType, - jsonschema + context, + QueryClient, + hookParamsTypeName, + queryInterfaceName, + responseType, + jsonschema }: ReactQueryHookQueryInterface) => { - // merge the user options with the defaults - const options = context.options.reactQuery; - - const body = [] - - const props = getProps(context, jsonschema); - if (props.length) { - body.push(t.tsPropertySignature( - t.identifier('args'), - t.tsTypeAnnotation( - // @ts-ignore:next-line - t.tsTypeLiteral(props) - ) - )) - } + // merge the user options with the defaults + const options = context.options.reactQuery; + const body = []; - return t.exportNamedDeclaration( - t.tsInterfaceDeclaration( - t.identifier(hookParamsTypeName), - t.tsTypeParameterDeclaration([ - t.tSTypeParameter(undefined, undefined, 'TData') - ]), - [ - t.tSExpressionWithTypeArguments( - t.identifier(queryInterfaceName), - t.tsTypeParameterInstantiation([ - // 1: response - t.tsTypeReference(t.identifier(responseType)), - // 2: select generic - t.tSTypeReference(t.identifier('TData')) - ]) - ) - ], - t.tsInterfaceBody( - body - ) + const props = getProps(context, jsonschema); + if (props.length) { + body.push( + t.tsPropertySignature( + t.identifier('args'), + t.tsTypeAnnotation( + // @ts-ignore:next-line + t.tsTypeLiteral(props) + ) + ) + ); + } + + return t.exportNamedDeclaration( + t.tsInterfaceDeclaration( + t.identifier(hookParamsTypeName), + t.tsTypeParameterDeclaration([ + t.tSTypeParameter(undefined, undefined, 'TData') + ]), + [ + t.tSExpressionWithTypeArguments( + t.identifier(queryInterfaceName), + t.tsTypeParameterInstantiation([ + // 1: response + t.tsTypeReference(t.identifier(responseType)), + // 2: select generic + t.tSTypeReference(t.identifier('TData')) + ]) ) + ], + t.tsInterfaceBody(body) ) + ); }; -const getProps = ( - context: RenderContext, - jsonschema: JSONSchema -) => { - const keys = Object.keys(jsonschema.properties ?? {}); - if (!keys.length) return []; - - return keys.map(prop => { - const { type, optional } = getPropertyType(context, jsonschema, prop); - return propertySignature( - context.options.reactQuery.camelize ? camel(prop) : prop, - t.tsTypeAnnotation( - type - ), - optional - ) - }); -} +const getProps = (context: RenderContext, jsonschema: JSONSchema) => { + const keys = Object.keys(jsonschema.properties ?? {}); + if (!keys.length) return []; + + return keys.map((prop) => { + const { type, optional } = getPropertyType(context, jsonschema, prop); + return propertySignature( + context.options.reactQuery.camelize ? camel(prop) : prop, + t.tsTypeAnnotation(type), + optional + ); + }); +}; interface GenerateUseQueryQueryKeyParams { - hookKeyName: string; - queryKeysName: string; - methodName: string; - props: string[]; - options: ReactQueryOptions; + hookKeyName: string; + queryKeysName: string; + methodName: string; + props: string[]; + options: ReactQueryOptions; } const generateUseQueryQueryKey = ({ - hookKeyName, - queryKeysName, - methodName, - props, - options, + hookKeyName, + queryKeysName, + methodName, + props, + options }: GenerateUseQueryQueryKeyParams): t.ArrayExpression | t.CallExpression => { - const { optionalClient, queryKeys } = options - - const hasArgs = props.includes('args') + const { optionalClient, queryKeys } = options; - const contractAddressExpression = - t.optionalMemberExpression( - t.identifier('client'), - t.identifier('contractAddress'), - false, - optionalClient - ) + const hasArgs = props.includes('args'); - if (queryKeys) { + const contractAddressExpression = t.optionalMemberExpression( + t.identifier('client'), + t.identifier('contractAddress'), + false, + optionalClient + ); - const callArgs: Array = [contractAddressExpression] + if (queryKeys) { + const callArgs: Array = [contractAddressExpression]; - if (hasArgs) callArgs.push(t.identifier('args')) + if (hasArgs) callArgs.push(t.identifier('args')); - return t.callExpression( - t.memberExpression( - t.identifier(queryKeysName), - t.identifier(camel(methodName)) - ), - callArgs - ) - } - - const queryKey: Array = [ - t.stringLiteral(hookKeyName), - contractAddressExpression - ]; + return t.callExpression( + t.memberExpression( + t.identifier(queryKeysName), + t.identifier(camel(methodName)) + ), + callArgs + ); + } - if (hasArgs) { - queryKey.push(t.callExpression( - t.memberExpression( - t.identifier('JSON'), - t.identifier('stringify') - ), - [ - t.identifier('args') - ] - )) - } - return t.arrayExpression(queryKey) -} + const queryKey: Array = [ + t.stringLiteral(hookKeyName), + contractAddressExpression + ]; + + if (hasArgs) { + queryKey.push( + t.callExpression( + t.memberExpression(t.identifier('JSON'), t.identifier('stringify')), + [t.identifier('args')] + ) + ); + } + return t.arrayExpression(queryKey); +}; From b7a2bbbede2d39b689c86c8c5e0028f0f18562c5 Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Tue, 27 Sep 2022 16:41:06 -0500 Subject: [PATCH 062/287] Allow the user to generate a query factory --- .../Factory.react-query.ts | 114 +++++ .../factory-query-keys/Factory.react-query.ts | 68 +++ .../ts-codegen/__tests__/ts-codegen.test.ts | 10 + .../wasm-ast-types/src/context/context.ts | 1 + .../src/react-query/react-query.ts | 406 +++++++++++++----- .../wasm-ast-types/types/context/context.d.ts | 1 + 6 files changed, 493 insertions(+), 107 deletions(-) create mode 100644 __output__/vectis/factory-query-factory/Factory.react-query.ts diff --git a/__output__/vectis/factory-query-factory/Factory.react-query.ts b/__output__/vectis/factory-query-factory/Factory.react-query.ts new file mode 100644 index 00000000..e233c2bb --- /dev/null +++ b/__output__/vectis/factory-query-factory/Factory.react-query.ts @@ -0,0 +1,114 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions, useQuery } from "react-query"; +import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; +import { FactoryQueryClient } from "./Factory.client"; +export const factoryQueryKeys = { + contract: ([{ + contract: "factory" + }] as const), + address: (contractAddress: string) => ([{ ...factoryQueryKeys.contract[0], + address: contractAddress + }] as const), + wallets: (contractAddress: string, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + method: "wallets", + args + }] as const), + walletsOf: (contractAddress: string, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + method: "wallets_of", + args + }] as const), + codeId: (contractAddress: string, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + method: "code_id", + args + }] as const), + fee: (contractAddress: string, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + method: "fee", + args + }] as const), + govecAddr: (contractAddress: string, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + method: "govec_addr", + args + }] as const), + adminAddr: (contractAddress: string, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], + method: "admin_addr", + args + }] as const) +}; +export interface FactoryReactQuery { + client: FactoryQueryClient; + options?: UseQueryOptions; +} +export interface FactoryAdminAddrQuery extends FactoryReactQuery {} +export function useFactoryAdminAddrQuery({ + client, + options +}: FactoryAdminAddrQuery) { + return useQuery(factoryQueryKeys.adminAddr(client.contractAddress), () => client.adminAddr(), options); +} +export interface FactoryGovecAddrQuery extends FactoryReactQuery {} +export function useFactoryGovecAddrQuery({ + client, + options +}: FactoryGovecAddrQuery) { + return useQuery(factoryQueryKeys.govecAddr(client.contractAddress), () => client.govecAddr(), options); +} +export interface FactoryFeeQuery extends FactoryReactQuery {} +export function useFactoryFeeQuery({ + client, + options +}: FactoryFeeQuery) { + return useQuery(factoryQueryKeys.fee(client.contractAddress), () => client.fee(), options); +} +export interface FactoryCodeIdQuery extends FactoryReactQuery { + args: { + ty: CodeIdType; + }; +} +export function useFactoryCodeIdQuery({ + client, + args, + options +}: FactoryCodeIdQuery) { + return useQuery(factoryQueryKeys.codeId(client.contractAddress, args), () => client.codeId({ + ty: args.ty + }), options); +} +export interface FactoryWalletsOfQuery extends FactoryReactQuery { + args: { + limit?: number; + startAfter?: string; + user: string; + }; +} +export function useFactoryWalletsOfQuery({ + client, + args, + options +}: FactoryWalletsOfQuery) { + return useQuery(factoryQueryKeys.walletsOf(client.contractAddress, args), () => client.walletsOf({ + limit: args.limit, + startAfter: args.startAfter, + user: args.user + }), options); +} +export interface FactoryWalletsQuery extends FactoryReactQuery { + args: { + limit?: number; + startAfter?: WalletQueryPrefix; + }; +} +export function useFactoryWalletsQuery({ + client, + args, + options +}: FactoryWalletsQuery) { + return useQuery(factoryQueryKeys.wallets(client.contractAddress, args), () => client.wallets({ + limit: args.limit, + startAfter: args.startAfter + }), options); +} \ No newline at end of file diff --git a/__output__/vectis/factory-query-keys/Factory.react-query.ts b/__output__/vectis/factory-query-keys/Factory.react-query.ts index e233c2bb..76a77dda 100644 --- a/__output__/vectis/factory-query-keys/Factory.react-query.ts +++ b/__output__/vectis/factory-query-keys/Factory.react-query.ts @@ -39,6 +39,74 @@ export const factoryQueryKeys = { args }] as const) }; +export const factoryQueries = { + wallets: ({ + client, + options, + args + }: FactoryWalletsQuery): UseQueryOptions => ({ + queryKey: factoryQueryKeys.wallets(client?.contractAddress, args), + queryFn: () => client.wallets({ + limit: args.limit, + startAfter: args.startAfter + }), + ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }), + walletsOf: ({ + client, + options, + args + }: FactoryWalletsOfQuery): UseQueryOptions => ({ + queryKey: factoryQueryKeys.walletsOf(client?.contractAddress, args), + queryFn: () => client.walletsOf({ + limit: args.limit, + startAfter: args.startAfter, + user: args.user + }), + ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }), + codeId: ({ + client, + options, + args + }: FactoryCodeIdQuery): UseQueryOptions => ({ + queryKey: factoryQueryKeys.codeId(client?.contractAddress, args), + queryFn: () => client.codeId({ + ty: args.ty + }), + ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }), + fee: ({ + client, + options + }: FactoryFeeQuery): UseQueryOptions => ({ + queryKey: factoryQueryKeys.fee(client?.contractAddress), + queryFn: () => client.fee(), + ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }), + govecAddr: ({ + client, + options + }: FactoryGovecAddrQuery): UseQueryOptions => ({ + queryKey: factoryQueryKeys.govecAddr(client?.contractAddress), + queryFn: () => client.govecAddr(), + ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }), + adminAddr: ({ + client, + options + }: FactoryAdminAddrQuery): UseQueryOptions => ({ + queryKey: factoryQueryKeys.adminAddr(client?.contractAddress), + queryFn: () => client.adminAddr(), + ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }) +}; export interface FactoryReactQuery { client: FactoryQueryClient; options?: UseQueryOptions; diff --git a/packages/ts-codegen/__tests__/ts-codegen.test.ts b/packages/ts-codegen/__tests__/ts-codegen.test.ts index 74fa6618..692ee668 100644 --- a/packages/ts-codegen/__tests__/ts-codegen.test.ts +++ b/packages/ts-codegen/__tests__/ts-codegen.test.ts @@ -35,6 +35,16 @@ it('queryKeys', async () => { await generateReactQuery('Factory', contractInfo, outopt, { queryKeys: true }); }) +it('queryFactory', async () => { + const outopt = OUTPUT_DIR + '/vectis/factory-query-keys'; + const schemaDir = FIXTURE_DIR + '/vectis/factory/'; + const contractInfo = await readSchemas({ + schemaDir + }); + await generateReactQuery('Factory', contractInfo, outopt, { queryKeys: true, queryFactory: true }); +}) + + it('queryKeysOptionalClient', async () => { const outopt = OUTPUT_DIR + '/vectis/factory-query-keys-optional-client'; diff --git a/packages/wasm-ast-types/src/context/context.ts b/packages/wasm-ast-types/src/context/context.ts index 48bb0f00..27a070e2 100644 --- a/packages/wasm-ast-types/src/context/context.ts +++ b/packages/wasm-ast-types/src/context/context.ts @@ -10,6 +10,7 @@ export interface ReactQueryOptions { mutations?: boolean; camelize?: boolean; queryKeys?: boolean + queryFactory?: boolean } export interface TSClientOptions { diff --git a/packages/wasm-ast-types/src/react-query/react-query.ts b/packages/wasm-ast-types/src/react-query/react-query.ts index 927b8e7f..4156379a 100644 --- a/packages/wasm-ast-types/src/react-query/react-query.ts +++ b/packages/wasm-ast-types/src/react-query/react-query.ts @@ -23,6 +23,7 @@ import { import { ReactQueryOptions, RenderContext } from '../context'; import { JSONSchema } from '../types'; import { FIXED_EXECUTE_PARAMS } from '../client'; +import { ArrowFunctionExpression, objectExpression } from '@babel/types'; interface ReactQueryHookQuery { context: RenderContext; @@ -35,6 +36,17 @@ interface ReactQueryHookQuery { jsonschema: any; } +interface ParsedQueryMsg { + underscoreName: string; + methodName: string; + hookParamsTypeName: string; + hookName: string; + responseType: string; + getterKey: string; + jsonschema: any; + // jsonschema: JSONSchema; +} + interface ReactQueryHooks { context: RenderContext; queryMsg: QueryMsg; @@ -69,16 +81,8 @@ export const createReactQueryHooks = ({ ); } - body.push( - createReactQueryHookGenericInterface({ - context, - QueryClient, - genericQueryInterfaceName - }) - ); - - body.push( - ...getMessageProperties(queryMsg).reduce((m, schema) => { + const queryMsgs: ParsedQueryMsg[] = getMessageProperties(queryMsg).map( + (schema) => { // list_voters const underscoreName = Object.keys(schema.properties)[0]; // listVoters @@ -94,33 +98,184 @@ export const createReactQueryHooks = ({ // cw3FlexMultisigListVoters const getterKey = camel(`${contractName}${pascal(methodName)}`); const jsonschema = schema.properties[underscoreName]; - return [ - createReactQueryHookInterface({ - context, - hookParamsTypeName, - responseType, - queryInterfaceName: genericQueryInterfaceName, - QueryClient, - jsonschema - }), - createReactQueryHook({ - context, + + return { + underscoreName, + methodName, + hookParamsTypeName, + hookName, + responseType, + getterKey, + jsonschema + }; + } + ); + + const queryFactoryName = `${camel(contractName)}Queries`; + if (options.queryFactory) { + body.push( + createReactQueryFactory({ + context, + queryFactoryName, + queryKeysName, + queryMsgs, + }) + ); + } + + body.push( + createReactQueryHookGenericInterface({ + context, + QueryClient, + genericQueryInterfaceName + }) + ); + + body.push( + ...queryMsgs.reduce( + ( + m, + { methodName, - hookName, hookParamsTypeName, - queryKeysName, + hookName, responseType, - hookKeyName: getterKey, + getterKey, jsonschema - }), - ...m - ]; - }, []) + } + ) => { + return [ + createReactQueryHookInterface({ + context, + hookParamsTypeName, + responseType, + queryInterfaceName: genericQueryInterfaceName, + QueryClient, + jsonschema + }), + createReactQueryHook({ + context, + methodName, + hookName, + hookParamsTypeName, + queryKeysName, + responseType, + hookKeyName: getterKey, + jsonschema + }), + ...m + ]; + }, + [] + ) ); return body; }; +function buildQueryFn( + methodName: string, + jsonschema: any, + options: ReactQueryOptions +): ArrowFunctionExpression { + const keys = Object.keys(jsonschema.properties ?? {}); + let args = []; + if (keys.length) { + args = [ + t.objectExpression([ + ...keys.map((prop) => { + return t.objectProperty( + t.identifier(camel(prop)), + t.memberExpression(t.identifier('args'), t.identifier(camel(prop))) + ); + }) + ]) + ]; + } + + const rejectInvalidClient = t.callExpression( + t.memberExpression(t.identifier('Promise'), t.identifier('reject')), + [ + t.newExpression(t.identifier('Error'), [ + t.stringLiteral('Invalid client') + ]) + ] + ); + + return t.arrowFunctionExpression( + [], + optionalConditionalExpression( + t.identifier('client'), + t.callExpression( + t.memberExpression(t.identifier('client'), t.identifier(methodName)), + args + ), + rejectInvalidClient, + options.optionalClient + ), + false + ); +} + +const ENABLED_QUERY_OPTION = t.objectProperty( + t.identifier('enabled'), + t.logicalExpression( + '&&', + t.unaryExpression('!', t.unaryExpression('!', t.identifier('client'))), + t.conditionalExpression( + // explicitly check for undefined + t.binaryExpression( + '!=', + t.optionalMemberExpression( + t.identifier('options'), + t.identifier('enabled'), + false, + true + ), + t.identifier('undefined') + ), + t.memberExpression(t.identifier('options'), t.identifier('enabled')), + t.booleanLiteral(true) + ) + ) +); + +function buildQueryOptions(options: ReactQueryOptions) { + return options.optionalClient + ? t.objectExpression([ + t.spreadElement(t.identifier('options')), + t.objectProperty( + t.identifier('enabled'), + t.logicalExpression( + '&&', + t.unaryExpression( + '!', + t.unaryExpression('!', t.identifier('client')) + ), + t.conditionalExpression( + // explicitly check for undefined + t.binaryExpression( + '!=', + t.optionalMemberExpression( + t.identifier('options'), + t.identifier('enabled'), + false, + true + ), + t.identifier('undefined') + ), + t.memberExpression( + t.identifier('options'), + t.identifier('enabled') + ), + t.booleanLiteral(true) + ) + ) + ) + ]) + : t.identifier('options'); +} + export const createReactQueryHook = ({ context, hookName, @@ -136,26 +291,13 @@ export const createReactQueryHook = ({ const options = context.options.reactQuery; const keys = Object.keys(jsonschema.properties ?? {}); - let args = []; - if (keys.length) { - args = [ - t.objectExpression([ - ...keys.map((prop) => { - return t.objectProperty( - t.identifier(camel(prop)), - t.memberExpression(t.identifier('args'), t.identifier(camel(prop))) - ); - }) - ]) - ]; - } let props = ['client', 'options']; if (keys.length) { props = ['client', 'args', 'options']; } - const selectResponseGenericTypeName = 'TData'; + const selectResponseGenericTypeName = GENERIC_SELECT_RESPONSE_NAME; const queryFunctionDeclaration = t.functionDeclaration( t.identifier(hookName), @@ -193,65 +335,8 @@ export const createReactQueryHook = ({ props, options }), - t.arrowFunctionExpression( - [], - optionalConditionalExpression( - t.identifier('client'), - t.callExpression( - t.memberExpression( - t.identifier('client'), - t.identifier(methodName) - ), - args - ), - t.callExpression( - t.memberExpression( - t.identifier('Promise'), - t.identifier('reject') - ), - [ - t.newExpression(t.identifier('Error'), [ - t.stringLiteral('Invalid client') - ]) - ] - ), - options.optionalClient - ), - false - ), - options.optionalClient - ? t.objectExpression([ - t.spreadElement(t.identifier('options')), - t.objectProperty( - t.identifier('enabled'), - t.logicalExpression( - '&&', - t.unaryExpression( - '!', - t.unaryExpression('!', t.identifier('client')) - ), - t.conditionalExpression( - // explicitly check for undefined - t.binaryExpression( - '!=', - t.optionalMemberExpression( - t.identifier('options'), - t.identifier('enabled'), - false, - true - ), - t.identifier('undefined') - ), - t.memberExpression( - t.identifier('options'), - t.identifier('enabled') - ), - t.booleanLiteral(true) - ) - ) - ) - ]) - : t.identifier('options') + buildQueryFn(methodName, jsonschema, options), + buildQueryOptions(options) ], t.tsTypeParameterInstantiation([ t.tsTypeReference(t.identifier(responseType)), @@ -663,21 +748,128 @@ function createReactQueryKeys({ ); } +function createReactQueryFactory({ + context, + queryFactoryName, + queryKeysName, + queryMsgs +}: { + context: RenderContext; + queryFactoryName: string; + queryKeysName: string; + queryMsgs: ParsedQueryMsg[]; +}) { + const options = context.options.reactQuery; + + return t.exportNamedDeclaration( + t.variableDeclaration('const', [ + t.variableDeclarator( + t.identifier(queryFactoryName), + t.objectExpression([ + ...queryMsgs.map( + ({ methodName, hookParamsTypeName, responseType, jsonschema }) => { + const hasArgs = + Object.keys(jsonschema.properties ?? {}).length > 0; + + const methodQueryOptionsFn = t.arrowFunctionExpression( + [ + tsObjectPattern( + [ + shorthandProperty('client'), + ...(hasArgs ? [shorthandProperty('args')] : []), + shorthandProperty('options') + ], + t.tsTypeAnnotation( + t.tsTypeReference( + t.identifier(hookParamsTypeName), + t.tsTypeParameterInstantiation([ + t.tsTypeReference(t.identifier(GENERIC_SELECT_RESPONSE_NAME)) + ]) + ) + ) + ) + ], + t.objectExpression([ + // 1: queryKey + t.objectProperty( + t.identifier('queryKey'), + t.callExpression( + t.memberExpression( + t.identifier(queryKeysName), + t.identifier(methodName) + ), + [ + t.optionalMemberExpression( + t.identifier('client'), + t.identifier('contractAddress'), + false, + true + ), + ...(hasArgs ? [t.identifier('args')] : []) + ] + ) + ), + // 2: queryFn + t.objectProperty( + t.identifier('queryFn'), + buildQueryFn(methodName, jsonschema, options) + ), + // 3: spread options + t.spreadElement(t.identifier('options')), + // 4. enabled + ENABLED_QUERY_OPTION + ]) + ); + + methodQueryOptionsFn.typeParameters = + t.tsTypeParameterDeclaration([ + t.tsTypeParameter( + undefined, + t.tsTypeReference(t.identifier(responseType)), + GENERIC_SELECT_RESPONSE_NAME + ) + ]); + + methodQueryOptionsFn.returnType = t.tsTypeAnnotation( + t.tsTypeReference( + t.identifier('UseQueryOptions'), + t.tsTypeParameterInstantiation([ + t.tsTypeReference(t.identifier(responseType)), + t.tsTypeReference(t.identifier('Error')), + t.tsTypeReference(t.identifier(GENERIC_SELECT_RESPONSE_NAME)) + ]) + ) + ); + + return t.objectProperty( + // key id is the camel method name + t.identifier(camel(methodName)), + methodQueryOptionsFn + ); + } + ) + ]) + ) + ]) + ); +} + interface ReactQueryHookGenericInterface { context: RenderContext; QueryClient: string; genericQueryInterfaceName: string; } +const GENERIC_SELECT_RESPONSE_NAME = 'TData'; + function createReactQueryHookGenericInterface({ context, QueryClient, genericQueryInterfaceName }: ReactQueryHookGenericInterface) { - const options = context.options.reactQuery; + const options = context.options.reactQuery; const genericResponseTypeName = 'TResponse'; - const genericSelectResponseTypeName = 'TData'; context.addUtil('UseQueryOptions'); @@ -687,7 +879,7 @@ function createReactQueryHookGenericInterface({ t.tsTypeParameterInstantiation([ t.tsTypeReference(t.identifier(genericResponseTypeName)), t.tsTypeReference(t.identifier('Error')), - t.tsTypeReference(t.identifier(genericSelectResponseTypeName)) + t.tsTypeReference(t.identifier(GENERIC_SELECT_RESPONSE_NAME)) ]) ); @@ -736,7 +928,7 @@ function createReactQueryHookGenericInterface({ t.tsTypeParameter( undefined, t.tSTypeReference(t.identifier(genericResponseTypeName)), - genericSelectResponseTypeName + GENERIC_SELECT_RESPONSE_NAME ) ]), [], @@ -784,7 +976,7 @@ export const createReactQueryHookInterface = ({ t.tsInterfaceDeclaration( t.identifier(hookParamsTypeName), t.tsTypeParameterDeclaration([ - t.tSTypeParameter(undefined, undefined, 'TData') + t.tSTypeParameter(undefined, undefined, GENERIC_SELECT_RESPONSE_NAME) ]), [ t.tSExpressionWithTypeArguments( @@ -793,7 +985,7 @@ export const createReactQueryHookInterface = ({ // 1: response t.tsTypeReference(t.identifier(responseType)), // 2: select generic - t.tSTypeReference(t.identifier('TData')) + t.tSTypeReference(t.identifier(GENERIC_SELECT_RESPONSE_NAME)) ]) ) ], diff --git a/packages/wasm-ast-types/types/context/context.d.ts b/packages/wasm-ast-types/types/context/context.d.ts index 28fe022d..e595f00b 100644 --- a/packages/wasm-ast-types/types/context/context.d.ts +++ b/packages/wasm-ast-types/types/context/context.d.ts @@ -6,6 +6,7 @@ export interface ReactQueryOptions { mutations?: boolean; camelize?: boolean; queryKeys?: boolean; + queryFactory?: boolean; } export interface TSClientOptions { enabled?: boolean; From 1e700d5c10d2c1eda945e075e47493b13d43e5c2 Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Thu, 20 Oct 2022 10:21:03 -0500 Subject: [PATCH 063/287] Add factory snapshots --- .../__snapshots__/react-query.spec.ts.snap | 396 ++++++++++++++++++ .../src/react-query/react-query.spec.ts | 17 + 2 files changed, 413 insertions(+) diff --git a/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap b/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap index afd93450..f558323d 100644 --- a/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap +++ b/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap @@ -729,6 +729,402 @@ export function useSg721OwnerOfQuery({ `; exports[`createReactQueryHooks 5`] = ` +"export const sg721QueryKeys = { + contract: ([{ + contract: \\"sg721\\" + }] as const), + address: (contractAddress: string | undefined) => ([{ ...sg721QueryKeys.contract[0], + address: contractAddress + }] as const), + ownerOf: (contractAddress: string | undefined, args?: Record) => ([{ ...sg721QueryKeys.address(contractAddress)[0], + method: \\"owner_of\\", + args + }] as const), + approval: (contractAddress: string | undefined, args?: Record) => ([{ ...sg721QueryKeys.address(contractAddress)[0], + method: \\"approval\\", + args + }] as const), + approvals: (contractAddress: string | undefined, args?: Record) => ([{ ...sg721QueryKeys.address(contractAddress)[0], + method: \\"approvals\\", + args + }] as const), + allOperators: (contractAddress: string | undefined, args?: Record) => ([{ ...sg721QueryKeys.address(contractAddress)[0], + method: \\"all_operators\\", + args + }] as const), + numTokens: (contractAddress: string | undefined, args?: Record) => ([{ ...sg721QueryKeys.address(contractAddress)[0], + method: \\"num_tokens\\", + args + }] as const), + contractInfo: (contractAddress: string | undefined, args?: Record) => ([{ ...sg721QueryKeys.address(contractAddress)[0], + method: \\"contract_info\\", + args + }] as const), + nftInfo: (contractAddress: string | undefined, args?: Record) => ([{ ...sg721QueryKeys.address(contractAddress)[0], + method: \\"nft_info\\", + args + }] as const), + allNftInfo: (contractAddress: string | undefined, args?: Record) => ([{ ...sg721QueryKeys.address(contractAddress)[0], + method: \\"all_nft_info\\", + args + }] as const), + tokens: (contractAddress: string | undefined, args?: Record) => ([{ ...sg721QueryKeys.address(contractAddress)[0], + method: \\"tokens\\", + args + }] as const), + allTokens: (contractAddress: string | undefined, args?: Record) => ([{ ...sg721QueryKeys.address(contractAddress)[0], + method: \\"all_tokens\\", + args + }] as const), + minter: (contractAddress: string | undefined, args?: Record) => ([{ ...sg721QueryKeys.address(contractAddress)[0], + method: \\"minter\\", + args + }] as const), + collectionInfo: (contractAddress: string | undefined, args?: Record) => ([{ ...sg721QueryKeys.address(contractAddress)[0], + method: \\"collection_info\\", + args + }] as const) +}; +export const sg721Queries = { + ownerOf: ({ + client, + args, + options + }: Sg721OwnerOfQuery): UseQueryOptions => ({ + queryKey: sg721QueryKeys.ownerOf(client?.contractAddress, args), + queryFn: () => client ? client.ownerOf({ + includeExpired: args.includeExpired, + tokenId: args.tokenId + }) : Promise.reject(new Error(\\"Invalid client\\")), + ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }), + approval: ({ + client, + args, + options + }: Sg721ApprovalQuery): UseQueryOptions => ({ + queryKey: sg721QueryKeys.approval(client?.contractAddress, args), + queryFn: () => client ? client.approval({ + includeExpired: args.includeExpired, + spender: args.spender, + tokenId: args.tokenId + }) : Promise.reject(new Error(\\"Invalid client\\")), + ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }), + approvals: ({ + client, + args, + options + }: Sg721ApprovalsQuery): UseQueryOptions => ({ + queryKey: sg721QueryKeys.approvals(client?.contractAddress, args), + queryFn: () => client ? client.approvals({ + includeExpired: args.includeExpired, + tokenId: args.tokenId + }) : Promise.reject(new Error(\\"Invalid client\\")), + ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }), + allOperators: ({ + client, + args, + options + }: Sg721AllOperatorsQuery): UseQueryOptions => ({ + queryKey: sg721QueryKeys.allOperators(client?.contractAddress, args), + queryFn: () => client ? client.allOperators({ + includeExpired: args.includeExpired, + limit: args.limit, + owner: args.owner, + startAfter: args.startAfter + }) : Promise.reject(new Error(\\"Invalid client\\")), + ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }), + numTokens: ({ + client, + options + }: Sg721NumTokensQuery): UseQueryOptions => ({ + queryKey: sg721QueryKeys.numTokens(client?.contractAddress), + queryFn: () => client ? client.numTokens() : Promise.reject(new Error(\\"Invalid client\\")), + ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }), + contractInfo: ({ + client, + options + }: Sg721ContractInfoQuery): UseQueryOptions => ({ + queryKey: sg721QueryKeys.contractInfo(client?.contractAddress), + queryFn: () => client ? client.contractInfo() : Promise.reject(new Error(\\"Invalid client\\")), + ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }), + nftInfo: ({ + client, + args, + options + }: Sg721NftInfoQuery): UseQueryOptions => ({ + queryKey: sg721QueryKeys.nftInfo(client?.contractAddress, args), + queryFn: () => client ? client.nftInfo({ + tokenId: args.tokenId + }) : Promise.reject(new Error(\\"Invalid client\\")), + ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }), + allNftInfo: ({ + client, + args, + options + }: Sg721AllNftInfoQuery): UseQueryOptions => ({ + queryKey: sg721QueryKeys.allNftInfo(client?.contractAddress, args), + queryFn: () => client ? client.allNftInfo({ + includeExpired: args.includeExpired, + tokenId: args.tokenId + }) : Promise.reject(new Error(\\"Invalid client\\")), + ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }), + tokens: ({ + client, + args, + options + }: Sg721TokensQuery): UseQueryOptions => ({ + queryKey: sg721QueryKeys.tokens(client?.contractAddress, args), + queryFn: () => client ? client.tokens({ + limit: args.limit, + owner: args.owner, + startAfter: args.startAfter + }) : Promise.reject(new Error(\\"Invalid client\\")), + ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }), + allTokens: ({ + client, + args, + options + }: Sg721AllTokensQuery): UseQueryOptions => ({ + queryKey: sg721QueryKeys.allTokens(client?.contractAddress, args), + queryFn: () => client ? client.allTokens({ + limit: args.limit, + startAfter: args.startAfter + }) : Promise.reject(new Error(\\"Invalid client\\")), + ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }), + minter: ({ + client, + options + }: Sg721MinterQuery): UseQueryOptions => ({ + queryKey: sg721QueryKeys.minter(client?.contractAddress), + queryFn: () => client ? client.minter() : Promise.reject(new Error(\\"Invalid client\\")), + ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }), + collectionInfo: ({ + client, + options + }: Sg721CollectionInfoQuery): UseQueryOptions => ({ + queryKey: sg721QueryKeys.collectionInfo(client?.contractAddress), + queryFn: () => client ? client.collectionInfo() : Promise.reject(new Error(\\"Invalid client\\")), + ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }) +}; +export interface Sg721ReactQuery { + client: Sg721QueryClient | undefined; + options?: Omit, \\"'queryKey' | 'queryFn' | 'initialData'\\"> & { + initialData?: undefined; + }; +} +export interface Sg721CollectionInfoQuery extends Sg721ReactQuery {} +export function useSg721CollectionInfoQuery({ + client, + options +}: Sg721CollectionInfoQuery) { + return useQuery(sg721QueryKeys.collectionInfo(client?.contractAddress), () => client ? client.collectionInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }); +} +export interface Sg721MinterQuery extends Sg721ReactQuery {} +export function useSg721MinterQuery({ + client, + options +}: Sg721MinterQuery) { + return useQuery(sg721QueryKeys.minter(client?.contractAddress), () => client ? client.minter() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }); +} +export interface Sg721AllTokensQuery extends Sg721ReactQuery { + args: { + limit?: number; + startAfter?: string; + }; +} +export function useSg721AllTokensQuery({ + client, + args, + options +}: Sg721AllTokensQuery) { + return useQuery(sg721QueryKeys.allTokens(client?.contractAddress, args), () => client ? client.allTokens({ + limit: args.limit, + startAfter: args.startAfter + }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }); +} +export interface Sg721TokensQuery extends Sg721ReactQuery { + args: { + limit?: number; + owner: string; + startAfter?: string; + }; +} +export function useSg721TokensQuery({ + client, + args, + options +}: Sg721TokensQuery) { + return useQuery(sg721QueryKeys.tokens(client?.contractAddress, args), () => client ? client.tokens({ + limit: args.limit, + owner: args.owner, + startAfter: args.startAfter + }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }); +} +export interface Sg721AllNftInfoQuery extends Sg721ReactQuery { + args: { + includeExpired?: boolean; + tokenId: string; + }; +} +export function useSg721AllNftInfoQuery({ + client, + args, + options +}: Sg721AllNftInfoQuery) { + return useQuery(sg721QueryKeys.allNftInfo(client?.contractAddress, args), () => client ? client.allNftInfo({ + includeExpired: args.includeExpired, + tokenId: args.tokenId + }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }); +} +export interface Sg721NftInfoQuery extends Sg721ReactQuery { + args: { + tokenId: string; + }; +} +export function useSg721NftInfoQuery({ + client, + args, + options +}: Sg721NftInfoQuery) { + return useQuery(sg721QueryKeys.nftInfo(client?.contractAddress, args), () => client ? client.nftInfo({ + tokenId: args.tokenId + }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }); +} +export interface Sg721ContractInfoQuery extends Sg721ReactQuery {} +export function useSg721ContractInfoQuery({ + client, + options +}: Sg721ContractInfoQuery) { + return useQuery(sg721QueryKeys.contractInfo(client?.contractAddress), () => client ? client.contractInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }); +} +export interface Sg721NumTokensQuery extends Sg721ReactQuery {} +export function useSg721NumTokensQuery({ + client, + options +}: Sg721NumTokensQuery) { + return useQuery(sg721QueryKeys.numTokens(client?.contractAddress), () => client ? client.numTokens() : Promise.reject(new Error(\\"Invalid client\\")), { ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }); +} +export interface Sg721AllOperatorsQuery extends Sg721ReactQuery { + args: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }; +} +export function useSg721AllOperatorsQuery({ + client, + args, + options +}: Sg721AllOperatorsQuery) { + return useQuery(sg721QueryKeys.allOperators(client?.contractAddress, args), () => client ? client.allOperators({ + includeExpired: args.includeExpired, + limit: args.limit, + owner: args.owner, + startAfter: args.startAfter + }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }); +} +export interface Sg721ApprovalsQuery extends Sg721ReactQuery { + args: { + includeExpired?: boolean; + tokenId: string; + }; +} +export function useSg721ApprovalsQuery({ + client, + args, + options +}: Sg721ApprovalsQuery) { + return useQuery(sg721QueryKeys.approvals(client?.contractAddress, args), () => client ? client.approvals({ + includeExpired: args.includeExpired, + tokenId: args.tokenId + }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }); +} +export interface Sg721ApprovalQuery extends Sg721ReactQuery { + args: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }; +} +export function useSg721ApprovalQuery({ + client, + args, + options +}: Sg721ApprovalQuery) { + return useQuery(sg721QueryKeys.approval(client?.contractAddress, args), () => client ? client.approval({ + includeExpired: args.includeExpired, + spender: args.spender, + tokenId: args.tokenId + }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }); +} +export interface Sg721OwnerOfQuery extends Sg721ReactQuery { + args: { + includeExpired?: boolean; + tokenId: string; + }; +} +export function useSg721OwnerOfQuery({ + client, + args, + options +}: Sg721OwnerOfQuery) { + return useQuery(sg721QueryKeys.ownerOf(client?.contractAddress, args), () => client ? client.ownerOf({ + includeExpired: args.includeExpired, + tokenId: args.tokenId + }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options, + enabled: !!client && (options?.enabled != undefined ? options.enabled : true) + }); +}" +`; + +exports[`createReactQueryHooks 6`] = ` "export interface Sg721BurnMutation { client: Sg721Client; msg: { diff --git a/packages/wasm-ast-types/src/react-query/react-query.spec.ts b/packages/wasm-ast-types/src/react-query/react-query.spec.ts index 1a2dcdfb..7198b8a2 100644 --- a/packages/wasm-ast-types/src/react-query/react-query.spec.ts +++ b/packages/wasm-ast-types/src/react-query/react-query.spec.ts @@ -62,6 +62,23 @@ it('createReactQueryHooks', () => { QueryClient: 'Sg721QueryClient' } ))) + expectCode( + t.program( + createReactQueryHooks({ + context: makeContext(query_msg, { + reactQuery: { + optionalClient: true, + version: 'v4', + queryKeys: true, + queryFactory: true + } + }), + queryMsg: query_msg, + contractName: 'Sg721', + QueryClient: 'Sg721QueryClient' + }) + ) + ); expectCode(t.program( createReactQueryMutationHooks( { From fca2414cfa3dd06b5f2893f1b66c2f1a533141da Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Thu, 20 Oct 2022 10:25:58 -0500 Subject: [PATCH 064/287] Add query factory questions --- packages/ts-codegen/src/commands/generate.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/src/commands/generate.ts b/packages/ts-codegen/src/commands/generate.ts index 182313d7..db7351e7 100644 --- a/packages/ts-codegen/src/commands/generate.ts +++ b/packages/ts-codegen/src/commands/generate.ts @@ -90,6 +90,20 @@ export default async (argv) => { ]) }; const { mutations } = await prompt(questions3, argv); + + const queryFactoryQuestions = []; + if (queryKeys) { + [].push.apply(queryFactoryQuestions, [ + // Only can use queryFactory if queryKeys is enabled + { + type: 'confirm', + name: 'queryFactory', + message: 'queryFactory? ', + default: false + } + ]) + }; + const { queryFactory } = await prompt(queryFactoryQuestions, argv); ///////// END REACT QUERY ///////// BUNDLE @@ -128,7 +142,8 @@ export default async (argv) => { optionalClient, queryKeys, version, - mutations + mutations, + queryFactory }, recoil: { enabled: plugin.includes('recoil'), From 7dcdf7f36155332047f713ec4d00c00522ff0f62 Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Thu, 20 Oct 2022 10:27:05 -0500 Subject: [PATCH 065/287] Update vectis factory test --- .../vectis/factory-query-keys/Factory.react-query.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/__output__/vectis/factory-query-keys/Factory.react-query.ts b/__output__/vectis/factory-query-keys/Factory.react-query.ts index 76a77dda..83c13696 100644 --- a/__output__/vectis/factory-query-keys/Factory.react-query.ts +++ b/__output__/vectis/factory-query-keys/Factory.react-query.ts @@ -42,8 +42,8 @@ export const factoryQueryKeys = { export const factoryQueries = { wallets: ({ client, - options, - args + args, + options }: FactoryWalletsQuery): UseQueryOptions => ({ queryKey: factoryQueryKeys.wallets(client?.contractAddress, args), queryFn: () => client.wallets({ @@ -55,8 +55,8 @@ export const factoryQueries = { }), walletsOf: ({ client, - options, - args + args, + options }: FactoryWalletsOfQuery): UseQueryOptions => ({ queryKey: factoryQueryKeys.walletsOf(client?.contractAddress, args), queryFn: () => client.walletsOf({ @@ -69,8 +69,8 @@ export const factoryQueries = { }), codeId: ({ client, - options, - args + args, + options }: FactoryCodeIdQuery): UseQueryOptions => ({ queryKey: factoryQueryKeys.codeId(client?.contractAddress, args), queryFn: () => client.codeId({ From 79e4190c599ea7a40187e03374395c8a5af3dfee Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Mon, 24 Oct 2022 14:33:37 -0400 Subject: [PATCH 066/287] Update react-query ts-codegen readme with queryFactory --- README.md | 4 +++- packages/ts-codegen/README.md | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1046ae9b..058887e5 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,7 @@ codegen({ version: 'v4', mutations: true, queryKeys: true, + queryFactory: true, }, recoil: { enabled: false @@ -166,10 +167,11 @@ Generate [react-query v3](https://react-query-v3.tanstack.com/) or [react-query #### React Query Options | option | description | - | ----------------------------| ---------------------------------------------------------------------------- | +-----------------------------| ----------------------------| ---------------------------------------------------------------------------- | | `reactQuery.enabled` | enable the react-query plugin | | `reactQuery.optionalClient` | allows contract client to be undefined as the component renders | | `reactQuery.queryKeys` | generates a const queryKeys object for use with invalidations and set values | + | `reactQuery.queryFactory` | generates a const queryFactory object for useQueries and prefetchQueries use | | `reactQuery.version` | `v4` uses `@tanstack/react-query` and `v3` uses `react-query` | | `reactQuery.mutations` | also generate mutations | | `reactQuery.camelize` | use camelCase style for property names | diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index 1046ae9b..9cb50160 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -110,6 +110,7 @@ codegen({ version: 'v4', mutations: true, queryKeys: true, + queryFactory: true, }, recoil: { enabled: false @@ -170,6 +171,7 @@ Generate [react-query v3](https://react-query-v3.tanstack.com/) or [react-query | `reactQuery.enabled` | enable the react-query plugin | | `reactQuery.optionalClient` | allows contract client to be undefined as the component renders | | `reactQuery.queryKeys` | generates a const queryKeys object for use with invalidations and set values | + | `reactQuery.queryFactory` | generates a const queryFactory object for useQueries and prefetchQueries use | | `reactQuery.version` | `v4` uses `@tanstack/react-query` and `v3` uses `react-query` | | `reactQuery.mutations` | also generate mutations | | `reactQuery.camelize` | use camelCase style for property names | From 844a4c5a234001108b3942f01ffc2e869af304b6 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 26 Oct 2022 13:48:28 -0700 Subject: [PATCH 067/287] readme --- README.md | 2 ++ packages/ts-codegen/README.md | 1 + 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 058887e5..98b20239 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,13 @@ Generate TypeScript SDKs for your CosmWasm smart contracts +

+ ``` npm install -g @cosmwasm/ts-codegen ``` diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index 9cb50160..fe80ac88 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -10,6 +10,7 @@ Generate TypeScript SDKs for your CosmWasm smart contracts + From e58a660b6265fc94bdd11f311afe9fac11708c51 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 26 Oct 2022 13:48:47 -0700 Subject: [PATCH 068/287] chore(release): publish - @cosmwasm/ts-codegen@0.20.0 - wasm-ast-types@0.14.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 8a816d7c..cbd1be93 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.20.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.19.0...@cosmwasm/ts-codegen@0.20.0) (2022-10-26) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.19.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.18.0...@cosmwasm/ts-codegen@0.19.0) (2022-10-11) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 1417f85d..c46aa19f 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.19.0", + "version": "0.20.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.13.0" + "wasm-ast-types": "^0.14.0" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 3c40cd22..50c8bad7 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.14.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.13.0...wasm-ast-types@0.14.0) (2022-10-26) + +**Note:** Version bump only for package wasm-ast-types + + + + + # [0.13.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.12.0...wasm-ast-types@0.13.0) (2022-10-11) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index cc2b381a..896acee1 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.13.0", + "version": "0.14.0", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From 3fa99de6d6ac0536075000d7f1922a9d0e6bcd91 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 9 Nov 2022 15:25:02 -0800 Subject: [PATCH 069/287] noImplicitOverride option --- .../__tests__/__snapshots__/builder.test.ts.snap | 2 ++ packages/wasm-ast-types/src/client/client.ts | 6 ++++-- packages/wasm-ast-types/src/context/context.ts | 4 +++- packages/wasm-ast-types/src/utils/babel.ts | 9 ++++++++- packages/wasm-ast-types/types/context/context.d.ts | 1 + .../wasm-ast-types/types/react-query/react-query.d.ts | 4 ++-- packages/wasm-ast-types/types/utils/babel.d.ts | 2 +- 7 files changed, 21 insertions(+), 7 deletions(-) diff --git a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap index fb2cd3fa..f01767f9 100644 --- a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap +++ b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap @@ -12,6 +12,7 @@ TSBuilder { "client": Object { "enabled": true, "execExtendsQuery": true, + "noImplicitOverride": false, }, "messageComposer": Object { "enabled": false, @@ -47,6 +48,7 @@ TSBuilder { "client": Object { "enabled": true, "execExtendsQuery": true, + "noImplicitOverride": false, }, "messageComposer": Object { "enabled": false, diff --git a/packages/wasm-ast-types/src/client/client.ts b/packages/wasm-ast-types/src/client/client.ts index 06265b33..49b64984 100644 --- a/packages/wasm-ast-types/src/client/client.ts +++ b/packages/wasm-ast-types/src/client/client.ts @@ -414,13 +414,15 @@ export const createExecuteClass = ( ...bindings ]); + const noImplicitOverride = context.options.client.noImplicitOverride && extendsClassName && context.options.client.execExtendsQuery; + return t.exportNamedDeclaration( classDeclaration(className, [ // client classProperty('client', t.tsTypeAnnotation( t.tsTypeReference(t.identifier('SigningCosmWasmClient')) - )), + ), false, false, noImplicitOverride), // sender classProperty('sender', t.tsTypeAnnotation( @@ -430,7 +432,7 @@ export const createExecuteClass = ( // contractAddress classProperty('contractAddress', t.tsTypeAnnotation( t.tsStringKeyword() - )), + ), false, false, noImplicitOverride), // constructor t.classMethod('constructor', diff --git a/packages/wasm-ast-types/src/context/context.ts b/packages/wasm-ast-types/src/context/context.ts index 27a070e2..fdbc9edc 100644 --- a/packages/wasm-ast-types/src/context/context.ts +++ b/packages/wasm-ast-types/src/context/context.ts @@ -16,6 +16,7 @@ export interface ReactQueryOptions { export interface TSClientOptions { enabled?: boolean; execExtendsQuery?: boolean; + noImplicitOverride?: boolean; } export interface MessageComposerOptions { enabled?: boolean; @@ -70,7 +71,8 @@ export const defaultOptions: RenderOptions = { }, client: { enabled: true, - execExtendsQuery: true + execExtendsQuery: true, + noImplicitOverride: false, }, recoil: { enabled: false diff --git a/packages/wasm-ast-types/src/utils/babel.ts b/packages/wasm-ast-types/src/utils/babel.ts index a82ff161..4c686d6d 100644 --- a/packages/wasm-ast-types/src/utils/babel.ts +++ b/packages/wasm-ast-types/src/utils/babel.ts @@ -125,11 +125,18 @@ export const classDeclaration = (name: string, body: any[], implementsExressions }; -export const classProperty = (name: string, typeAnnotation: TSTypeAnnotation = null, isReadonly: boolean = false, isStatic: boolean = false) => { +export const classProperty = ( + name: string, + typeAnnotation: TSTypeAnnotation = null, + isReadonly: boolean = false, + isStatic: boolean = false, + noImplicitOverride: boolean = false +) => { const prop = t.classProperty(t.identifier(name)); if (isReadonly) prop.readonly = true; if (isStatic) prop.static = true; if (typeAnnotation) prop.typeAnnotation = typeAnnotation; + if (noImplicitOverride) prop.override = true; return prop; }; diff --git a/packages/wasm-ast-types/types/context/context.d.ts b/packages/wasm-ast-types/types/context/context.d.ts index e595f00b..a9d71793 100644 --- a/packages/wasm-ast-types/types/context/context.d.ts +++ b/packages/wasm-ast-types/types/context/context.d.ts @@ -11,6 +11,7 @@ export interface ReactQueryOptions { export interface TSClientOptions { enabled?: boolean; execExtendsQuery?: boolean; + noImplicitOverride?: boolean; } export interface MessageComposerOptions { enabled?: boolean; diff --git a/packages/wasm-ast-types/types/react-query/react-query.d.ts b/packages/wasm-ast-types/types/react-query/react-query.d.ts index b4ecf402..697ff0d7 100644 --- a/packages/wasm-ast-types/types/react-query/react-query.d.ts +++ b/packages/wasm-ast-types/types/react-query/react-query.d.ts @@ -43,7 +43,7 @@ export interface Cw4UpdateMembersMutation { } ``` */ -export declare const createReactQueryMutationArgsInterface: ({ context, ExecuteClient, mutationHookParamsTypeName, useMutationTypeParameter, jsonschema, }: ReactQueryMutationHookInterface) => t.ExportNamedDeclaration; +export declare const createReactQueryMutationArgsInterface: ({ context, ExecuteClient, mutationHookParamsTypeName, useMutationTypeParameter, jsonschema }: ReactQueryMutationHookInterface) => t.ExportNamedDeclaration; interface ReactQueryMutationHooks { context: RenderContext; execMsg: ExecuteMsg; @@ -70,7 +70,7 @@ export const useCw4UpdateMembersMutation = ({ client, options }: Omit t.ExportNamedDeclaration; +export declare const createReactQueryMutationHook: ({ context, mutationHookName, mutationHookParamsTypeName, execMethodName, useMutationTypeParameter, hasMsg }: ReactQueryMutationHook) => t.ExportNamedDeclaration; interface ReactQueryHookQueryInterface { context: RenderContext; QueryClient: string; diff --git a/packages/wasm-ast-types/types/utils/babel.d.ts b/packages/wasm-ast-types/types/utils/babel.d.ts index e4dbac2d..2a86d792 100644 --- a/packages/wasm-ast-types/types/utils/babel.d.ts +++ b/packages/wasm-ast-types/types/utils/babel.d.ts @@ -17,7 +17,7 @@ export declare const bindMethod: (name: string) => t.ExpressionStatement; export declare const typedIdentifier: (name: string, typeAnnotation: TSTypeAnnotation, optional?: boolean) => t.Identifier; export declare const promiseTypeAnnotation: (name: any) => t.TSTypeAnnotation; export declare const classDeclaration: (name: string, body: any[], implementsExressions?: TSExpressionWithTypeArguments[], superClass?: t.Identifier) => t.ClassDeclaration; -export declare const classProperty: (name: string, typeAnnotation?: TSTypeAnnotation, isReadonly?: boolean, isStatic?: boolean) => t.ClassProperty; +export declare const classProperty: (name: string, typeAnnotation?: TSTypeAnnotation, isReadonly?: boolean, isStatic?: boolean, noImplicitOverride?: boolean) => t.ClassProperty; export declare const arrowFunctionExpression: (params: (t.Identifier | t.Pattern | t.RestElement)[], body: t.BlockStatement, returnType: t.TSTypeAnnotation, isAsync?: boolean) => t.ArrowFunctionExpression; export declare const recursiveNamespace: (names: any, moduleBlockBody: any) => any; export declare const arrayTypeNDimensions: (body: any, n: any) => any; From 2bc52c783c63047afdc892a80413b5dfc323b119 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 9 Nov 2022 15:34:46 -0800 Subject: [PATCH 070/287] tests --- .../ts-client.overrides.spec.ts.snap | 709 ++++++++++++++++++ .../client/test/ts-client.overrides.spec.ts | 74 ++ 2 files changed, 783 insertions(+) create mode 100644 packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.overrides.spec.ts.snap create mode 100644 packages/wasm-ast-types/src/client/test/ts-client.overrides.spec.ts diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.overrides.spec.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.overrides.spec.ts.snap new file mode 100644 index 00000000..0993ff62 --- /dev/null +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.overrides.spec.ts.snap @@ -0,0 +1,709 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Impl, execExtends, ExtendsClass 1`] = ` +"export class SG721Client extends ExtendsClassName implements SG721Instance { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + super(client, contractAddress); + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.transferNft = this.transferNft.bind(this); + this.sendNft = this.sendNft.bind(this); + this.approve = this.approve.bind(this); + this.revoke = this.revoke.bind(this); + this.approveAll = this.approveAll.bind(this); + this.revokeAll = this.revokeAll.bind(this); + this.mint = this.mint.bind(this); + this.burn = this.burn.bind(this); + } + + transferNft = async ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_nft: { + recipient, + token_id: tokenId + } + }, fee, memo, funds); + }; + sendNft = async ({ + contract, + msg, + tokenId + }: { + contract: string; + msg: Binary; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send_nft: { + contract, + msg, + token_id: tokenId + } + }, fee, memo, funds); + }; + approve = async ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve: { + expires, + spender, + token_id: tokenId + } + }, fee, memo, funds); + }; + revoke = async ({ + spender, + tokenId + }: { + spender: string; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke: { + spender, + token_id: tokenId + } + }, fee, memo, funds); + }; + approveAll = async ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve_all: { + expires, + operator + } + }, fee, memo, funds); + }; + revokeAll = async ({ + operator + }: { + operator: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke_all: { + operator + } + }, fee, memo, funds); + }; + mint = async ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension: Empty; + owner: string; + tokenId: string; + tokenUri?: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: { + extension, + owner, + token_id: tokenId, + token_uri: tokenUri + } + }, fee, memo, funds); + }; + burn = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + token_id: tokenId + } + }, fee, memo, funds); + }; +}" +`; + +exports[`Impl, execExtends, noExtendsClass 1`] = ` +"export class SG721Client implements SG721Instance { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.transferNft = this.transferNft.bind(this); + this.sendNft = this.sendNft.bind(this); + this.approve = this.approve.bind(this); + this.revoke = this.revoke.bind(this); + this.approveAll = this.approveAll.bind(this); + this.revokeAll = this.revokeAll.bind(this); + this.mint = this.mint.bind(this); + this.burn = this.burn.bind(this); + } + + transferNft = async ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_nft: { + recipient, + token_id: tokenId + } + }, fee, memo, funds); + }; + sendNft = async ({ + contract, + msg, + tokenId + }: { + contract: string; + msg: Binary; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send_nft: { + contract, + msg, + token_id: tokenId + } + }, fee, memo, funds); + }; + approve = async ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve: { + expires, + spender, + token_id: tokenId + } + }, fee, memo, funds); + }; + revoke = async ({ + spender, + tokenId + }: { + spender: string; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke: { + spender, + token_id: tokenId + } + }, fee, memo, funds); + }; + approveAll = async ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve_all: { + expires, + operator + } + }, fee, memo, funds); + }; + revokeAll = async ({ + operator + }: { + operator: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke_all: { + operator + } + }, fee, memo, funds); + }; + mint = async ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension: Empty; + owner: string; + tokenId: string; + tokenUri?: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: { + extension, + owner, + token_id: tokenId, + token_uri: tokenUri + } + }, fee, memo, funds); + }; + burn = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + token_id: tokenId + } + }, fee, memo, funds); + }; +}" +`; + +exports[`noImpl, execExtends, ExtendsClass 1`] = ` +"export class SG721Client extends ExtendsClassName implements SG721Instance { + override client: SigningCosmWasmClient; + sender: string; + override contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + super(client, contractAddress); + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.transferNft = this.transferNft.bind(this); + this.sendNft = this.sendNft.bind(this); + this.approve = this.approve.bind(this); + this.revoke = this.revoke.bind(this); + this.approveAll = this.approveAll.bind(this); + this.revokeAll = this.revokeAll.bind(this); + this.mint = this.mint.bind(this); + this.burn = this.burn.bind(this); + } + + transferNft = async ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_nft: { + recipient, + token_id: tokenId + } + }, fee, memo, funds); + }; + sendNft = async ({ + contract, + msg, + tokenId + }: { + contract: string; + msg: Binary; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send_nft: { + contract, + msg, + token_id: tokenId + } + }, fee, memo, funds); + }; + approve = async ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve: { + expires, + spender, + token_id: tokenId + } + }, fee, memo, funds); + }; + revoke = async ({ + spender, + tokenId + }: { + spender: string; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke: { + spender, + token_id: tokenId + } + }, fee, memo, funds); + }; + approveAll = async ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve_all: { + expires, + operator + } + }, fee, memo, funds); + }; + revokeAll = async ({ + operator + }: { + operator: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke_all: { + operator + } + }, fee, memo, funds); + }; + mint = async ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension: Empty; + owner: string; + tokenId: string; + tokenUri?: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: { + extension, + owner, + token_id: tokenId, + token_uri: tokenUri + } + }, fee, memo, funds); + }; + burn = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + token_id: tokenId + } + }, fee, memo, funds); + }; +}" +`; + +exports[`noImpl, noExecExtends, ExtendsClass 1`] = ` +"export class SG721Client extends ExtendsClassName implements SG721Instance { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + super(client, contractAddress); + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.transferNft = this.transferNft.bind(this); + this.sendNft = this.sendNft.bind(this); + this.approve = this.approve.bind(this); + this.revoke = this.revoke.bind(this); + this.approveAll = this.approveAll.bind(this); + this.revokeAll = this.revokeAll.bind(this); + this.mint = this.mint.bind(this); + this.burn = this.burn.bind(this); + } + + transferNft = async ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_nft: { + recipient, + token_id: tokenId + } + }, fee, memo, funds); + }; + sendNft = async ({ + contract, + msg, + tokenId + }: { + contract: string; + msg: Binary; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send_nft: { + contract, + msg, + token_id: tokenId + } + }, fee, memo, funds); + }; + approve = async ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve: { + expires, + spender, + token_id: tokenId + } + }, fee, memo, funds); + }; + revoke = async ({ + spender, + tokenId + }: { + spender: string; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke: { + spender, + token_id: tokenId + } + }, fee, memo, funds); + }; + approveAll = async ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve_all: { + expires, + operator + } + }, fee, memo, funds); + }; + revokeAll = async ({ + operator + }: { + operator: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke_all: { + operator + } + }, fee, memo, funds); + }; + mint = async ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension: Empty; + owner: string; + tokenId: string; + tokenUri?: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: { + extension, + owner, + token_id: tokenId, + token_uri: tokenUri + } + }, fee, memo, funds); + }; + burn = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + token_id: tokenId + } + }, fee, memo, funds); + }; +}" +`; + +exports[`noImpl, noExecExtends, noExtendsClass 1`] = ` +"export class SG721Client implements SG721Instance { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.transferNft = this.transferNft.bind(this); + this.sendNft = this.sendNft.bind(this); + this.approve = this.approve.bind(this); + this.revoke = this.revoke.bind(this); + this.approveAll = this.approveAll.bind(this); + this.revokeAll = this.revokeAll.bind(this); + this.mint = this.mint.bind(this); + this.burn = this.burn.bind(this); + } + + transferNft = async ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_nft: { + recipient, + token_id: tokenId + } + }, fee, memo, funds); + }; + sendNft = async ({ + contract, + msg, + tokenId + }: { + contract: string; + msg: Binary; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send_nft: { + contract, + msg, + token_id: tokenId + } + }, fee, memo, funds); + }; + approve = async ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve: { + expires, + spender, + token_id: tokenId + } + }, fee, memo, funds); + }; + revoke = async ({ + spender, + tokenId + }: { + spender: string; + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke: { + spender, + token_id: tokenId + } + }, fee, memo, funds); + }; + approveAll = async ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve_all: { + expires, + operator + } + }, fee, memo, funds); + }; + revokeAll = async ({ + operator + }: { + operator: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke_all: { + operator + } + }, fee, memo, funds); + }; + mint = async ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension: Empty; + owner: string; + tokenId: string; + tokenUri?: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: { + extension, + owner, + token_id: tokenId, + token_uri: tokenUri + } + }, fee, memo, funds); + }; + burn = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + token_id: tokenId + } + }, fee, memo, funds); + }; +}" +`; diff --git a/packages/wasm-ast-types/src/client/test/ts-client.overrides.spec.ts b/packages/wasm-ast-types/src/client/test/ts-client.overrides.spec.ts new file mode 100644 index 00000000..c653d8b5 --- /dev/null +++ b/packages/wasm-ast-types/src/client/test/ts-client.overrides.spec.ts @@ -0,0 +1,74 @@ +import execute_msg_for__empty from '../../../../../__fixtures__/sg721/execute_msg_for__empty.json'; +import { + createQueryClass, + createExecuteClass, + createExecuteInterface, + createTypeInterface +} from '../client' +import { expectCode, makeContext } from '../../../test-utils'; + +const ctx = makeContext(execute_msg_for__empty); + +describe('exec', () => { + +}) + +it('Impl, execExtends, noExtendsClass', () => { + ctx.options.client.noImplicitOverride = false; + ctx.options.client.execExtendsQuery = true; + expectCode(createExecuteClass( + ctx, + 'SG721Client', + 'SG721Instance', + null, + execute_msg_for__empty + )) +}); + +it('Impl, execExtends, ExtendsClass', () => { + ctx.options.client.noImplicitOverride = false; + ctx.options.client.execExtendsQuery = true; + expectCode(createExecuteClass( + ctx, + 'SG721Client', + 'SG721Instance', + 'ExtendsClassName', + execute_msg_for__empty + )) +}); + +it('noImpl, execExtends, ExtendsClass', () => { + ctx.options.client.noImplicitOverride = true; + ctx.options.client.execExtendsQuery = true; + expectCode(createExecuteClass( + ctx, + 'SG721Client', + 'SG721Instance', + 'ExtendsClassName', + execute_msg_for__empty + )) +}); + +it('noImpl, noExecExtends, ExtendsClass', () => { + ctx.options.client.noImplicitOverride = true; + ctx.options.client.execExtendsQuery = false; + expectCode(createExecuteClass( + ctx, + 'SG721Client', + 'SG721Instance', + 'ExtendsClassName', + execute_msg_for__empty + )) +}); + +it('noImpl, noExecExtends, noExtendsClass', () => { + ctx.options.client.noImplicitOverride = true; + ctx.options.client.execExtendsQuery = false; + expectCode(createExecuteClass( + ctx, + 'SG721Client', + 'SG721Instance', + null, + execute_msg_for__empty + )) +}); From 058bdfb2b76325b47b9d9cc68922f689446c108e Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 9 Nov 2022 15:39:07 -0800 Subject: [PATCH 071/287] readme --- README.md | 12 +++++++----- packages/ts-codegen/README.md | 15 +++++++++------ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 98b20239..2dadb9ab 100644 --- a/README.md +++ b/README.md @@ -146,10 +146,11 @@ The `client` plugin will generate TS client classes for your contracts. This opt #### Client Options - | option | description | - | ----------------------------- | --------------------------------------------------- | - | `client.enabled` | generate TS client classes for your contracts | - | `client.execExtendsQuery` | execute should extend query message clients | + | option | description | + | --------------------------------------- | --------------------------------------------------- | + | `client.enabled` | generate TS client classes for your contracts | + | `client.execExtendsQuery` | execute should extend query message clients | + | `client.noImplicit.noImplicitOverride` | should match your tsconfig noImplicitOverride option | #### Client via CLI @@ -479,7 +480,8 @@ See the [docs](https://github.com/CosmWasm/ts-codegen/blob/main/packages/wasm-as Checkout these related projects: * [@osmonauts/telescope](https://github.com/osmosis-labs/telescope) a "babel for the Cosmos", Telescope is a TypeScript Transpiler for Cosmos Protobufs. - +* [chain-registry](https://github.com/cosmology-tech/chain-registry) Cosmos chain registry and chain info. +* [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) A wallet connector for the Cosmos. ## Credits 🛠 Built by Cosmology — if you like our tools, please consider delegating to [our validator ⚛️](https://cosmology.tech/validator) diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index fe80ac88..2dadb9ab 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -16,6 +16,7 @@ Generate TypeScript SDKs for your CosmWasm smart contracts

+ ``` npm install -g @cosmwasm/ts-codegen ``` @@ -145,10 +146,11 @@ The `client` plugin will generate TS client classes for your contracts. This opt #### Client Options - | option | description | - | ----------------------------- | --------------------------------------------------- | - | `client.enabled` | generate TS client classes for your contracts | - | `client.execExtendsQuery` | execute should extend query message clients | + | option | description | + | --------------------------------------- | --------------------------------------------------- | + | `client.enabled` | generate TS client classes for your contracts | + | `client.execExtendsQuery` | execute should extend query message clients | + | `client.noImplicit.noImplicitOverride` | should match your tsconfig noImplicitOverride option | #### Client via CLI @@ -168,7 +170,7 @@ Generate [react-query v3](https://react-query-v3.tanstack.com/) or [react-query #### React Query Options | option | description | - | ----------------------------| ---------------------------------------------------------------------------- | +-----------------------------| ----------------------------| ---------------------------------------------------------------------------- | | `reactQuery.enabled` | enable the react-query plugin | | `reactQuery.optionalClient` | allows contract client to be undefined as the component renders | | `reactQuery.queryKeys` | generates a const queryKeys object for use with invalidations and set values | @@ -478,7 +480,8 @@ See the [docs](https://github.com/CosmWasm/ts-codegen/blob/main/packages/wasm-as Checkout these related projects: * [@osmonauts/telescope](https://github.com/osmosis-labs/telescope) a "babel for the Cosmos", Telescope is a TypeScript Transpiler for Cosmos Protobufs. - +* [chain-registry](https://github.com/cosmology-tech/chain-registry) Cosmos chain registry and chain info. +* [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) A wallet connector for the Cosmos. ## Credits 🛠 Built by Cosmology — if you like our tools, please consider delegating to [our validator ⚛️](https://cosmology.tech/validator) From ef4b39134cf220c860469ae3cae49aeab91ee80d Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 9 Nov 2022 15:39:55 -0800 Subject: [PATCH 072/287] chore(release): publish - @cosmwasm/ts-codegen@0.21.0 - wasm-ast-types@0.15.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index cbd1be93..570442fb 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.21.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.20.0...@cosmwasm/ts-codegen@0.21.0) (2022-11-09) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.20.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.19.0...@cosmwasm/ts-codegen@0.20.0) (2022-10-26) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index c46aa19f..68f0c466 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.20.0", + "version": "0.21.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.14.0" + "wasm-ast-types": "^0.15.0" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 50c8bad7..13264366 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.15.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.14.0...wasm-ast-types@0.15.0) (2022-11-09) + +**Note:** Version bump only for package wasm-ast-types + + + + + # [0.14.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.13.0...wasm-ast-types@0.14.0) (2022-10-26) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index 896acee1..8118fe09 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.14.0", + "version": "0.15.0", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From 7b684a9d8d26e5a46006b3920909c5ad22b29bcf Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 9 Nov 2022 15:44:43 -0800 Subject: [PATCH 073/287] readme --- README.md | 2 +- packages/ts-codegen/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2dadb9ab..675ca22d 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ Generate [react-query v3](https://react-query-v3.tanstack.com/) or [react-query #### React Query Options | option | description | ------------------------------| ----------------------------| ---------------------------------------------------------------------------- | + | ---------------------------- | ---------------------------------------------------------------------------- | | `reactQuery.enabled` | enable the react-query plugin | | `reactQuery.optionalClient` | allows contract client to be undefined as the component renders | | `reactQuery.queryKeys` | generates a const queryKeys object for use with invalidations and set values | diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index 2dadb9ab..675ca22d 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -170,7 +170,7 @@ Generate [react-query v3](https://react-query-v3.tanstack.com/) or [react-query #### React Query Options | option | description | ------------------------------| ----------------------------| ---------------------------------------------------------------------------- | + | ---------------------------- | ---------------------------------------------------------------------------- | | `reactQuery.enabled` | enable the react-query plugin | | `reactQuery.optionalClient` | allows contract client to be undefined as the component renders | | `reactQuery.queryKeys` | generates a const queryKeys object for use with invalidations and set values | From 390e1a9c503c79e2a2f5276e479a7791bd63f7a7 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 9 Nov 2022 15:44:49 -0800 Subject: [PATCH 074/287] chore(release): publish - @cosmwasm/ts-codegen@0.21.1 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 570442fb..7c80e1af 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.21.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.21.0...@cosmwasm/ts-codegen@0.21.1) (2022-11-09) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.21.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.20.0...@cosmwasm/ts-codegen@0.21.0) (2022-11-09) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 68f0c466..b095014d 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.21.0", + "version": "0.21.1", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From 5a6c59c161c6c428232c37f2ceac82b0a27c0868 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Thu, 17 Nov 2022 14:18:56 -0800 Subject: [PATCH 075/287] readme --- README.md | 2 +- packages/ts-codegen/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 675ca22d..045b7bb8 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ The `client` plugin will generate TS client classes for your contracts. This opt | --------------------------------------- | --------------------------------------------------- | | `client.enabled` | generate TS client classes for your contracts | | `client.execExtendsQuery` | execute should extend query message clients | - | `client.noImplicit.noImplicitOverride` | should match your tsconfig noImplicitOverride option | + | `client.noImplicitOverride` | should match your tsconfig noImplicitOverride option | #### Client via CLI diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index 675ca22d..045b7bb8 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -150,7 +150,7 @@ The `client` plugin will generate TS client classes for your contracts. This opt | --------------------------------------- | --------------------------------------------------- | | `client.enabled` | generate TS client classes for your contracts | | `client.execExtendsQuery` | execute should extend query message clients | - | `client.noImplicit.noImplicitOverride` | should match your tsconfig noImplicitOverride option | + | `client.noImplicitOverride` | should match your tsconfig noImplicitOverride option | #### Client via CLI From 2c1947c57a11cb8c44542befe7513988a1ec248c Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Thu, 17 Nov 2022 14:19:02 -0800 Subject: [PATCH 076/287] chore(release): publish - @cosmwasm/ts-codegen@0.21.2 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 7c80e1af..eb91a628 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.21.2](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.21.1...@cosmwasm/ts-codegen@0.21.2) (2022-11-17) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.21.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.21.0...@cosmwasm/ts-codegen@0.21.1) (2022-11-09) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index b095014d..8fbc1acd 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.21.1", + "version": "0.21.2", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From d6c1ef88330acff0bff030bb52fc759f2956bfb2 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 18 Nov 2022 12:22:45 -0800 Subject: [PATCH 077/287] Option Nullable fix --- packages/ts-codegen/src/utils/cleanse.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/src/utils/cleanse.ts b/packages/ts-codegen/src/utils/cleanse.ts index 2e32b7c6..b62351b0 100644 --- a/packages/ts-codegen/src/utils/cleanse.ts +++ b/packages/ts-codegen/src/utils/cleanse.ts @@ -13,6 +13,14 @@ const cleanFor = (str) => { return str; }; +const cleanNullable = (str) => { + if (/^Nullable_/.test(str)) { + str = str.replace(/^Nullable_/, 'Nullable'); + } + + return str; +}; + export const cleanse = (obj) => { var copy; // Handle the 3 simple types, and null or undefined @@ -51,12 +59,16 @@ export const cleanse = (obj) => { if (/_for_/.test(attr)) { copy[cleanFor(attr)] = cleanse(obj[attr]); + } else if (/^Nullable_/.test(attr)) { + copy[cleanNullable(attr)] = cleanse(obj[attr]); } else { switch (attr) { case 'title': case '$ref': if (typeof obj[attr] === 'string') { - copy[attr] = cleanse(cleanFor(obj[attr])); + copy[attr] = cleanse( + cleanNullable(cleanFor(obj[attr])) + ); } else { copy[attr] = cleanse(obj[attr]); } From 9135105f4362a390946d93659a750d80a39e6df0 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 18 Nov 2022 12:25:45 -0800 Subject: [PATCH 078/287] chore(release): publish - @cosmwasm/ts-codegen@0.22.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index eb91a628..4a9d2e0a 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.22.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.21.2...@cosmwasm/ts-codegen@0.22.0) (2022-11-18) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.21.2](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.21.1...@cosmwasm/ts-codegen@0.21.2) (2022-11-17) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 8fbc1acd..fc966e57 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.21.2", + "version": "0.22.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From 0c1b60e73bf08bc491634cd2fec1a5bf49b6518c Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Fri, 25 Nov 2022 11:05:22 -0800 Subject: [PATCH 079/287] Expand the referenced types for react query mutations --- .../Factory.react-query.ts | 1 - .../__snapshots__/react-query.spec.ts.snap | 7 +++- .../src/react-query/react-query.ts | 39 ++++++++++--------- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/__output__/vectis/factory-w-mutations/Factory.react-query.ts b/__output__/vectis/factory-w-mutations/Factory.react-query.ts index 93a6f935..ff1c505d 100644 --- a/__output__/vectis/factory-w-mutations/Factory.react-query.ts +++ b/__output__/vectis/factory-w-mutations/Factory.react-query.ts @@ -6,7 +6,6 @@ import { UseQueryOptions, useQuery, useMutation, UseMutationOptions } from "@tanstack/react-query"; import { ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { FactoryQueryClient, FactoryClient } from "./Factory.client"; export interface FactoryReactQuery { diff --git a/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap b/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap index f558323d..276b8fe5 100644 --- a/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap +++ b/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap @@ -1149,7 +1149,12 @@ export function useSg721BurnMutation(options?: Omit>, - 'mutationFn' - > + export interface Cw721RevokeMutation { + client: Cw721Client; + msg: { + spender: string; + tokenId: string; + }; + args?: { + fee?: number | StdFee | "auto"; + memo?: string; + funds?: Coin[]; + }; } ``` */ @@ -404,19 +407,17 @@ export const createReactQueryMutationArgsInterface = ({ ) ]; - const msgType: t.TSTypeAnnotation = getParamsTypeAnnotation( - context, - jsonschema - ); + const msgType = createTypedObjectParams(context, jsonschema).typeAnnotation as unknown as t.TSTypeAnnotation if (msgType) { - body.push(t.tsPropertySignature(t.identifier('msg'), msgType)); + body.push( + t.tsPropertySignature( + t.identifier('msg'), + // @ts-ignore + msgType + )); } - context.addUtil('StdFee'); - context.addUtil('Coin'); - // fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[] - const optionalArgs = t.tsPropertySignature( t.identifier('args'), t.tsTypeAnnotation( From 4591946f899f4f545bd0048c75ef43f28725be47 Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Fri, 25 Nov 2022 11:12:23 -0800 Subject: [PATCH 080/287] Format --- packages/ts-codegen/src/cmds.js | 5 +---- packages/wasm-ast-types/src/react-query/react-query.ts | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/ts-codegen/src/cmds.js b/packages/ts-codegen/src/cmds.js index 1756a711..93fdec85 100644 --- a/packages/ts-codegen/src/cmds.js +++ b/packages/ts-codegen/src/cmds.js @@ -1,4 +1,3 @@ - import _create_boilerplate from './commands/create-boilerplate'; import _generate from './commands/generate'; import _install from './commands/install'; @@ -7,6 +6,4 @@ Commands['create-boilerplate'] = _create_boilerplate; Commands['generate'] = _generate; Commands['install'] = _install; - export { Commands }; - - \ No newline at end of file +export { Commands }; diff --git a/packages/wasm-ast-types/src/react-query/react-query.ts b/packages/wasm-ast-types/src/react-query/react-query.ts index bdb25618..1b283338 100644 --- a/packages/wasm-ast-types/src/react-query/react-query.ts +++ b/packages/wasm-ast-types/src/react-query/react-query.ts @@ -413,7 +413,6 @@ export const createReactQueryMutationArgsInterface = ({ body.push( t.tsPropertySignature( t.identifier('msg'), - // @ts-ignore msgType )); } From 4d78cf7a1e9bdccf07ee9d44d4c0286dd1df7e9d Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 25 Nov 2022 13:55:53 -0800 Subject: [PATCH 081/287] react-query --- __output__/vectis/factory-w-mutations/Factory.react-query.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/__output__/vectis/factory-w-mutations/Factory.react-query.ts b/__output__/vectis/factory-w-mutations/Factory.react-query.ts index ff1c505d..93a6f935 100644 --- a/__output__/vectis/factory-w-mutations/Factory.react-query.ts +++ b/__output__/vectis/factory-w-mutations/Factory.react-query.ts @@ -6,6 +6,7 @@ import { UseQueryOptions, useQuery, useMutation, UseMutationOptions } from "@tanstack/react-query"; import { ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { FactoryQueryClient, FactoryClient } from "./Factory.client"; export interface FactoryReactQuery { From 9724a2787e6427b62e874ece3b733b5bfa5be2af Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 25 Nov 2022 13:56:05 -0800 Subject: [PATCH 082/287] chore(release): publish - @cosmwasm/ts-codegen@0.23.0 - wasm-ast-types@0.16.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 4a9d2e0a..501d770b 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.23.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.22.0...@cosmwasm/ts-codegen@0.23.0) (2022-11-25) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.22.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.21.2...@cosmwasm/ts-codegen@0.22.0) (2022-11-18) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index fc966e57..8b305c71 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.22.0", + "version": "0.23.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.15.0" + "wasm-ast-types": "^0.16.0" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 13264366..3908c583 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.16.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.15.0...wasm-ast-types@0.16.0) (2022-11-25) + +**Note:** Version bump only for package wasm-ast-types + + + + + # [0.15.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.14.0...wasm-ast-types@0.15.0) (2022-11-09) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index 8118fe09..0b041e15 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.15.0", + "version": "0.16.0", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From e87d9f01d53288c7bf47f5072fa1d3d646240aca Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 25 Nov 2022 16:43:44 -0800 Subject: [PATCH 083/287] fixtures --- __output__/vectis/factory-w-mutations/Factory.react-query.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/__output__/vectis/factory-w-mutations/Factory.react-query.ts b/__output__/vectis/factory-w-mutations/Factory.react-query.ts index 93a6f935..ff1c505d 100644 --- a/__output__/vectis/factory-w-mutations/Factory.react-query.ts +++ b/__output__/vectis/factory-w-mutations/Factory.react-query.ts @@ -6,7 +6,6 @@ import { UseQueryOptions, useQuery, useMutation, UseMutationOptions } from "@tanstack/react-query"; import { ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { FactoryQueryClient, FactoryClient } from "./Factory.client"; export interface FactoryReactQuery { From 1530f4ef9d23fa18af8a577ecedb545af8aad33c Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Sun, 27 Nov 2022 22:24:23 -0800 Subject: [PATCH 084/287] Re-add missing StdFee and Coin imports to react query mutations --- .../vectis/factory-w-mutations/Factory.react-query.ts | 1 + packages/wasm-ast-types/src/react-query/react-query.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/__output__/vectis/factory-w-mutations/Factory.react-query.ts b/__output__/vectis/factory-w-mutations/Factory.react-query.ts index ff1c505d..93a6f935 100644 --- a/__output__/vectis/factory-w-mutations/Factory.react-query.ts +++ b/__output__/vectis/factory-w-mutations/Factory.react-query.ts @@ -6,6 +6,7 @@ import { UseQueryOptions, useQuery, useMutation, UseMutationOptions } from "@tanstack/react-query"; import { ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { FactoryQueryClient, FactoryClient } from "./Factory.client"; export interface FactoryReactQuery { diff --git a/packages/wasm-ast-types/src/react-query/react-query.ts b/packages/wasm-ast-types/src/react-query/react-query.ts index 1b283338..6a6a50a5 100644 --- a/packages/wasm-ast-types/src/react-query/react-query.ts +++ b/packages/wasm-ast-types/src/react-query/react-query.ts @@ -407,16 +407,20 @@ export const createReactQueryMutationArgsInterface = ({ ) ]; - const msgType = createTypedObjectParams(context, jsonschema).typeAnnotation as unknown as t.TSTypeAnnotation + const msgType = createTypedObjectParams(context, jsonschema)?.typeAnnotation if (msgType) { body.push( t.tsPropertySignature( t.identifier('msg'), + // @ts-ignore msgType )); } + context.addUtil('StdFee'); + context.addUtil('Coin'); + const optionalArgs = t.tsPropertySignature( t.identifier('args'), t.tsTypeAnnotation( From cffa2acebb86f3c1f96fb00c4abae5ba0987e63e Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 2 Dec 2022 15:38:44 +1000 Subject: [PATCH 085/287] chore(release): publish - @cosmwasm/ts-codegen@0.24.0 - wasm-ast-types@0.17.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 501d770b..6b1652f4 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.24.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.23.0...@cosmwasm/ts-codegen@0.24.0) (2022-12-02) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.23.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.22.0...@cosmwasm/ts-codegen@0.23.0) (2022-11-25) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 8b305c71..d0ba0a60 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.23.0", + "version": "0.24.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.16.0" + "wasm-ast-types": "^0.17.0" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 3908c583..4b71a8c3 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.17.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.16.0...wasm-ast-types@0.17.0) (2022-12-02) + +**Note:** Version bump only for package wasm-ast-types + + + + + # [0.16.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.15.0...wasm-ast-types@0.16.0) (2022-11-25) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index 0b041e15..4c853b3a 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.16.0", + "version": "0.17.0", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From 259629513d3bb037ab7d95d2062304521ebe687e Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Sat, 25 Feb 2023 19:28:27 -0800 Subject: [PATCH 086/287] arrays --- __fixtures__/wager/cw-wager.json | 1031 +++++++++++++++++ .../ts-client.wager.spec.ts.snap | 54 + .../src/client/test/ts-client.wager.spec.ts | 53 + packages/wasm-ast-types/src/utils/types.ts | 9 +- 4 files changed, 1146 insertions(+), 1 deletion(-) create mode 100644 __fixtures__/wager/cw-wager.json create mode 100644 packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.wager.spec.ts.snap create mode 100644 packages/wasm-ast-types/src/client/test/ts-client.wager.spec.ts diff --git a/__fixtures__/wager/cw-wager.json b/__fixtures__/wager/cw-wager.json new file mode 100644 index 00000000..f0460f1b --- /dev/null +++ b/__fixtures__/wager/cw-wager.json @@ -0,0 +1,1031 @@ +{ + "contract_name": "cw-wager", + "contract_version": "0.1.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "amounts", + "collection_address", + "expiries", + "fairburn_bps", + "fee_address", + "fee_bps", + "matchmaking_expiry", + "max_currencies" + ], + "properties": { + "amounts": { + "type": "array", + "items": { + "$ref": "#/definitions/Uint128" + } + }, + "collection_address": { + "type": "string" + }, + "expiries": { + "type": "array", + "items": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "fairburn_bps": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "fee_address": { + "type": "string" + }, + "fee_bps": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "matchmaking_expiry": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "max_currencies": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + }, + "additionalProperties": false, + "definitions": { + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "description": "Privileged", + "type": "object", + "required": [ + "update_config" + ], + "properties": { + "update_config": { + "type": "object", + "required": [ + "params" + ], + "properties": { + "params": { + "$ref": "#/definitions/ParamInfo" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Use Authz", + "type": "object", + "required": [ + "set_winner" + ], + "properties": { + "set_winner": { + "type": "object", + "required": [ + "current_prices", + "prev_prices", + "wager_key" + ], + "properties": { + "current_prices": { + "type": "array", + "items": [ + { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + ], + "maxItems": 2, + "minItems": 2 + }, + "prev_prices": { + "type": "array", + "items": [ + { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + ], + "maxItems": 2, + "minItems": 2 + }, + "wager_key": { + "type": "array", + "items": [ + { + "type": "array", + "items": [ + { + "$ref": "#/definitions/Addr" + }, + { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + ], + "maxItems": 2, + "minItems": 2 + }, + { + "type": "array", + "items": [ + { + "$ref": "#/definitions/Addr" + }, + { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + ], + "maxItems": 2, + "minItems": 2 + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "User-facing", + "type": "object", + "required": [ + "wager" + ], + "properties": { + "wager": { + "type": "object", + "required": [ + "against_currencies", + "currency", + "expiry", + "token" + ], + "properties": { + "against_currencies": { + "type": "array", + "items": { + "$ref": "#/definitions/Currency" + } + }, + "currency": { + "$ref": "#/definitions/Currency" + }, + "expiry": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "token": { + "type": "array", + "items": [ + { + "$ref": "#/definitions/Addr" + }, + { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "cancel" + ], + "properties": { + "cancel": { + "type": "object", + "required": [ + "token" + ], + "properties": { + "token": { + "type": "array", + "items": [ + { + "$ref": "#/definitions/Addr" + }, + { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "Currency": { + "type": "string", + "enum": [ + "dot", + "avax", + "uni", + "atom", + "link", + "near", + "icp", + "sand", + "btc", + "eth", + "bnb", + "xrp", + "ada", + "doge", + "sol", + "mana", + "cake", + "ar", + "osmo", + "rune", + "luna", + "ustc", + "stars", + "mir" + ] + }, + "ParamInfo": { + "type": "object", + "properties": { + "amounts": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Uint128" + } + }, + "collection_address": { + "type": [ + "string", + "null" + ] + }, + "expiries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "fairburn_bps": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "fee_address": { + "type": [ + "string", + "null" + ] + }, + "fee_bps": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "matchmaking_expiry": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "max_currencies": { + "type": [ + "integer", + "null" + ], + "format": "uint8", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + "query": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "wagers" + ], + "properties": { + "wagers": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "wager" + ], + "properties": { + "wager": { + "type": "object", + "required": [ + "token" + ], + "properties": { + "token": { + "type": "array", + "items": [ + { + "$ref": "#/definitions/Addr" + }, + { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "token_status" + ], + "properties": { + "token_status": { + "type": "object", + "required": [ + "token" + ], + "properties": { + "token": { + "type": "array", + "items": [ + { + "$ref": "#/definitions/Addr" + }, + { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "config" + ], + "properties": { + "config": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + } + } + }, + "migrate": null, + "sudo": null, + "responses": { + "config": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigResponse", + "type": "object", + "required": [ + "config" + ], + "properties": { + "config": { + "$ref": "#/definitions/Config" + } + }, + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "Config": { + "type": "object", + "required": [ + "amounts", + "collection_address", + "expiries", + "fairburn_percent", + "fee_address", + "fee_percent", + "matchmaking_expiry", + "max_currencies" + ], + "properties": { + "amounts": { + "type": "array", + "items": { + "$ref": "#/definitions/Uint128" + } + }, + "collection_address": { + "$ref": "#/definitions/Addr" + }, + "expiries": { + "type": "array", + "items": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "fairburn_percent": { + "$ref": "#/definitions/Decimal" + }, + "fee_address": { + "$ref": "#/definitions/Addr" + }, + "fee_percent": { + "$ref": "#/definitions/Decimal" + }, + "matchmaking_expiry": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "max_currencies": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + "token_status": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TokenStatusResponse", + "type": "object", + "required": [ + "token_status" + ], + "properties": { + "token_status": { + "$ref": "#/definitions/TokenStatus" + } + }, + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "Currency": { + "type": "string", + "enum": [ + "dot", + "avax", + "uni", + "atom", + "link", + "near", + "icp", + "sand", + "btc", + "eth", + "bnb", + "xrp", + "ada", + "doge", + "sol", + "mana", + "cake", + "ar", + "osmo", + "rune", + "luna", + "ustc", + "stars", + "mir" + ] + }, + "MatchmakingItemExport": { + "type": "object", + "required": [ + "against_currencies", + "amount", + "currency", + "expires_at", + "expiry", + "token" + ], + "properties": { + "against_currencies": { + "type": "array", + "items": { + "$ref": "#/definitions/Currency" + } + }, + "amount": { + "$ref": "#/definitions/Uint128" + }, + "currency": { + "$ref": "#/definitions/Currency" + }, + "expires_at": { + "$ref": "#/definitions/Timestamp" + }, + "expiry": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "token": { + "$ref": "#/definitions/NFT" + } + }, + "additionalProperties": false + }, + "NFT": { + "type": "object", + "required": [ + "collection", + "token_id" + ], + "properties": { + "collection": { + "$ref": "#/definitions/Addr" + }, + "token_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "TokenStatus": { + "oneOf": [ + { + "type": "string", + "enum": [ + "none" + ] + }, + { + "type": "object", + "required": [ + "matchmaking" + ], + "properties": { + "matchmaking": { + "$ref": "#/definitions/MatchmakingItemExport" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "wager" + ], + "properties": { + "wager": { + "$ref": "#/definitions/WagerExport" + } + }, + "additionalProperties": false + } + ] + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + }, + "WagerExport": { + "type": "object", + "required": [ + "amount", + "expires_at", + "wagers" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "expires_at": { + "$ref": "#/definitions/Timestamp" + }, + "wagers": { + "type": "array", + "items": [ + { + "$ref": "#/definitions/WagerInfo" + }, + { + "$ref": "#/definitions/WagerInfo" + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + "WagerInfo": { + "type": "object", + "required": [ + "currency", + "token" + ], + "properties": { + "currency": { + "$ref": "#/definitions/Currency" + }, + "token": { + "$ref": "#/definitions/NFT" + } + }, + "additionalProperties": false + } + } + }, + "wager": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WagerResponse", + "type": "object", + "required": [ + "wager" + ], + "properties": { + "wager": { + "$ref": "#/definitions/WagerExport" + } + }, + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "Currency": { + "type": "string", + "enum": [ + "dot", + "avax", + "uni", + "atom", + "link", + "near", + "icp", + "sand", + "btc", + "eth", + "bnb", + "xrp", + "ada", + "doge", + "sol", + "mana", + "cake", + "ar", + "osmo", + "rune", + "luna", + "ustc", + "stars", + "mir" + ] + }, + "NFT": { + "type": "object", + "required": [ + "collection", + "token_id" + ], + "properties": { + "collection": { + "$ref": "#/definitions/Addr" + }, + "token_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + }, + "WagerExport": { + "type": "object", + "required": [ + "amount", + "expires_at", + "wagers" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "expires_at": { + "$ref": "#/definitions/Timestamp" + }, + "wagers": { + "type": "array", + "items": [ + { + "$ref": "#/definitions/WagerInfo" + }, + { + "$ref": "#/definitions/WagerInfo" + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + "WagerInfo": { + "type": "object", + "required": [ + "currency", + "token" + ], + "properties": { + "currency": { + "$ref": "#/definitions/Currency" + }, + "token": { + "$ref": "#/definitions/NFT" + } + }, + "additionalProperties": false + } + } + }, + "wagers": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WagersResponse", + "type": "object", + "required": [ + "wagers" + ], + "properties": { + "wagers": { + "type": "array", + "items": { + "$ref": "#/definitions/WagerExport" + } + } + }, + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "Currency": { + "type": "string", + "enum": [ + "dot", + "avax", + "uni", + "atom", + "link", + "near", + "icp", + "sand", + "btc", + "eth", + "bnb", + "xrp", + "ada", + "doge", + "sol", + "mana", + "cake", + "ar", + "osmo", + "rune", + "luna", + "ustc", + "stars", + "mir" + ] + }, + "NFT": { + "type": "object", + "required": [ + "collection", + "token_id" + ], + "properties": { + "collection": { + "$ref": "#/definitions/Addr" + }, + "token_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + }, + "WagerExport": { + "type": "object", + "required": [ + "amount", + "expires_at", + "wagers" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "expires_at": { + "$ref": "#/definitions/Timestamp" + }, + "wagers": { + "type": "array", + "items": [ + { + "$ref": "#/definitions/WagerInfo" + }, + { + "$ref": "#/definitions/WagerInfo" + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + }, + "WagerInfo": { + "type": "object", + "required": [ + "currency", + "token" + ], + "properties": { + "currency": { + "$ref": "#/definitions/Currency" + }, + "token": { + "$ref": "#/definitions/NFT" + } + }, + "additionalProperties": false + } + } + } + } +} diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.wager.spec.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.wager.spec.ts.snap new file mode 100644 index 00000000..84720036 --- /dev/null +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.wager.spec.ts.snap @@ -0,0 +1,54 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`execute 1`] = `"export type ExecuteMsg = ExecuteMsg;"`; + +exports[`query 1`] = `"export type QueryMsg = QueryMsg;"`; + +exports[`query classes 1`] = ` +"export class WagerQueryClient implements WagerReadOnlyInstance { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.wagers = this.wagers.bind(this); + this.wager = this.wager.bind(this); + this.tokenStatus = this.tokenStatus.bind(this); + this.config = this.config.bind(this); + } + + wagers = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + wagers: {} + }); + }; + wager = async ({ + token + }: { + token: Addr[][]; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + wager: { + token + } + }); + }; + tokenStatus = async ({ + token + }: { + token: Addr[][]; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + token_status: { + token + } + }); + }; + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; +}" +`; diff --git a/packages/wasm-ast-types/src/client/test/ts-client.wager.spec.ts b/packages/wasm-ast-types/src/client/test/ts-client.wager.spec.ts new file mode 100644 index 00000000..17b91d7b --- /dev/null +++ b/packages/wasm-ast-types/src/client/test/ts-client.wager.spec.ts @@ -0,0 +1,53 @@ +import wagerJson from '../../../../../__fixtures__/wager/cw-wager.json'; +import { + createQueryClass, + createExecuteClass, + createExecuteInterface, + createTypeInterface +} from '../client' +import { expectCode, makeContext } from '../../../test-utils'; + +const queryCtx = makeContext(wagerJson.query); +const executeCtx = makeContext(wagerJson.execute); + +it('query', () => { + expectCode(createTypeInterface( + queryCtx, + wagerJson.query + )) +}) + +it('execute', () => { + expectCode(createTypeInterface( + executeCtx, + wagerJson.execute + )) +}) + +it('query classes', () => { + expectCode(createQueryClass( + queryCtx, + 'WagerQueryClient', + 'WagerReadOnlyInstance', + wagerJson.query + )) +}); + +// it('execute classes array types', () => { +// expectCode(createExecuteClass( +// ctx, +// 'SG721Client', +// 'SG721Instance', +// null, +// wagerJson +// )) +// }); + +// it('execute interfaces no extends', () => { +// expectCode(createExecuteInterface( +// ctx, +// 'SG721Instance', +// null, +// wagerJson +// )) +// }); diff --git a/packages/wasm-ast-types/src/utils/types.ts b/packages/wasm-ast-types/src/utils/types.ts index 01de42c3..005272a6 100644 --- a/packages/wasm-ast-types/src/utils/types.ts +++ b/packages/wasm-ast-types/src/utils/types.ts @@ -147,7 +147,14 @@ export const getTypeInfo = (info: JSONSchema) => { throw new Error('[info.items] case not handled by transpiler. contact maintainers.') } } else { - throw new Error('[info.items] case not handled by transpiler. contact maintainers.') + if (Array.isArray(info.items)) { + type = getArrayTypeFromItems(info.items); + // console.log(typeof info.items === 'object'); + // console.log(Array.isArray(info.items)); + // console.log(info); + } else { + throw new Error('[info.items] case not handled by transpiler. contact maintainers.') + } } } else { const detect = detectType(info.type); From 857ca4b9661677f7c1a72d0327fb327b0a318e33 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Sat, 25 Feb 2023 19:37:09 -0800 Subject: [PATCH 087/287] chore(release): publish - @cosmwasm/ts-codegen@0.25.0 - wasm-ast-types@0.18.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 6b1652f4..638f0b61 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.25.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.24.0...@cosmwasm/ts-codegen@0.25.0) (2023-02-26) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.24.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.23.0...@cosmwasm/ts-codegen@0.24.0) (2022-12-02) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index d0ba0a60..47389d8c 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.24.0", + "version": "0.25.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.17.0" + "wasm-ast-types": "^0.18.0" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 4b71a8c3..8f619724 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.18.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.17.0...wasm-ast-types@0.18.0) (2023-02-26) + +**Note:** Version bump only for package wasm-ast-types + + + + + # [0.17.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.16.0...wasm-ast-types@0.17.0) (2022-12-02) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index 4c853b3a..db531427 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.17.0", + "version": "0.18.0", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From 36dd8fb41449a3b02352ee72719878e00e59223a Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 1 Mar 2023 21:20:59 -0700 Subject: [PATCH 088/287] handle more array cases --- .../ts-client.wager.spec.ts.snap | 78 +++++++++++++++++++ .../src/client/test/ts-client.wager.spec.ts | 10 +++ packages/wasm-ast-types/src/utils/types.ts | 9 +++ 3 files changed, 97 insertions(+) diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.wager.spec.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.wager.spec.ts.snap index 84720036..9bc5571a 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.wager.spec.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.wager.spec.ts.snap @@ -2,6 +2,84 @@ exports[`execute 1`] = `"export type ExecuteMsg = ExecuteMsg;"`; +exports[`execute classes 1`] = ` +"export class WagerClient implements WagerInstance { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateConfig = this.updateConfig.bind(this); + this.setWinner = this.setWinner.bind(this); + this.wager = this.wager.bind(this); + this.cancel = this.cancel.bind(this); + } + + updateConfig = async ({ + params + }: { + params: ParamInfo; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_config: { + params + } + }, fee, memo, funds); + }; + setWinner = async ({ + currentPrices, + prevPrices, + wagerKey + }: { + currentPrices: number[][]; + prevPrices: number[][]; + wagerKey: Addr[][][][]; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_winner: { + current_prices: currentPrices, + prev_prices: prevPrices, + wager_key: wagerKey + } + }, fee, memo, funds); + }; + wager = async ({ + againstCurrencies, + currency, + expiry, + token + }: { + againstCurrencies: Currency[]; + currency: Currency; + expiry: number; + token: Addr[][]; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + wager: { + against_currencies: againstCurrencies, + currency, + expiry, + token + } + }, fee, memo, funds); + }; + cancel = async ({ + token + }: { + token: Addr[][]; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + cancel: { + token + } + }, fee, memo, funds); + }; +}" +`; + exports[`query 1`] = `"export type QueryMsg = QueryMsg;"`; exports[`query classes 1`] = ` diff --git a/packages/wasm-ast-types/src/client/test/ts-client.wager.spec.ts b/packages/wasm-ast-types/src/client/test/ts-client.wager.spec.ts index 17b91d7b..aa43f26b 100644 --- a/packages/wasm-ast-types/src/client/test/ts-client.wager.spec.ts +++ b/packages/wasm-ast-types/src/client/test/ts-client.wager.spec.ts @@ -33,6 +33,16 @@ it('query classes', () => { )) }); +it('execute classes', () => { + expectCode(createExecuteClass( + executeCtx, + 'WagerClient', + 'WagerInstance', + null, + wagerJson.execute + )) +}); + // it('execute classes array types', () => { // expectCode(createExecuteClass( // ctx, diff --git a/packages/wasm-ast-types/src/utils/types.ts b/packages/wasm-ast-types/src/utils/types.ts index 005272a6..5c1ad2c4 100644 --- a/packages/wasm-ast-types/src/utils/types.ts +++ b/packages/wasm-ast-types/src/utils/types.ts @@ -48,6 +48,15 @@ const getTypeOrRef = (obj) => { const getArrayTypeFromItems = (items) => { // passing in [{"type":"string"}] if (Array.isArray(items)) { + if (items[0]?.type === 'array') { + return t.tsArrayType( + t.tsArrayType( + getArrayTypeFromItems( + items[0] + ) + ) + ); + } return t.tsArrayType( t.tsArrayType( getTypeOrRef(items[0]) From e6daf701507cad95127613a815fc0fca1a883f8a Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 1 Mar 2023 21:21:07 -0700 Subject: [PATCH 089/287] chore(release): publish - @cosmwasm/ts-codegen@0.25.1 - wasm-ast-types@0.18.1 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 638f0b61..8b18bbba 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.25.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.25.0...@cosmwasm/ts-codegen@0.25.1) (2023-03-02) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.25.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.24.0...@cosmwasm/ts-codegen@0.25.0) (2023-02-26) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 47389d8c..b89b199f 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.25.0", + "version": "0.25.1", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.18.0" + "wasm-ast-types": "^0.18.1" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 8f619724..14749ac9 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.18.1](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.18.0...wasm-ast-types@0.18.1) (2023-03-02) + +**Note:** Version bump only for package wasm-ast-types + + + + + # [0.18.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.17.0...wasm-ast-types@0.18.0) (2023-02-26) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index db531427..4e2203a1 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.18.0", + "version": "0.18.1", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From 4cc8a793a43e1609377102c86a935feff7ec16f1 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 1 Mar 2023 21:23:15 -0700 Subject: [PATCH 090/287] fix array types --- .../test/__snapshots__/ts-client.wager.spec.ts.snap | 2 +- packages/wasm-ast-types/src/utils/types.ts | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.wager.spec.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.wager.spec.ts.snap index 9bc5571a..7e9bf03d 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.wager.spec.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.wager.spec.ts.snap @@ -36,7 +36,7 @@ exports[`execute classes 1`] = ` }: { currentPrices: number[][]; prevPrices: number[][]; - wagerKey: Addr[][][][]; + wagerKey: Addr[][]; }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_winner: { diff --git a/packages/wasm-ast-types/src/utils/types.ts b/packages/wasm-ast-types/src/utils/types.ts index 5c1ad2c4..a552f753 100644 --- a/packages/wasm-ast-types/src/utils/types.ts +++ b/packages/wasm-ast-types/src/utils/types.ts @@ -49,12 +49,8 @@ const getArrayTypeFromItems = (items) => { // passing in [{"type":"string"}] if (Array.isArray(items)) { if (items[0]?.type === 'array') { - return t.tsArrayType( - t.tsArrayType( - getArrayTypeFromItems( - items[0] - ) - ) + return getArrayTypeFromItems( + items[0] ); } return t.tsArrayType( From a980b8040099876a056027f4bb45e83de86fb278 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 1 Mar 2023 21:23:22 -0700 Subject: [PATCH 091/287] chore(release): publish - @cosmwasm/ts-codegen@0.25.2 - wasm-ast-types@0.18.2 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 8b18bbba..039dc42a 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.25.2](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.25.1...@cosmwasm/ts-codegen@0.25.2) (2023-03-02) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.25.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.25.0...@cosmwasm/ts-codegen@0.25.1) (2023-03-02) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index b89b199f..76411338 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.25.1", + "version": "0.25.2", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.18.1" + "wasm-ast-types": "^0.18.2" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 14749ac9..3e9be2cc 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.18.2](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.18.1...wasm-ast-types@0.18.2) (2023-03-02) + +**Note:** Version bump only for package wasm-ast-types + + + + + ## [0.18.1](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.18.0...wasm-ast-types@0.18.1) (2023-03-02) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index 4e2203a1..a83c24ff 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.18.1", + "version": "0.18.2", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From f6ffe03704c051d352c10c0fb61205f3fef804f2 Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Mon, 6 Mar 2023 13:35:20 +0800 Subject: [PATCH 092/287] add bundlePath for setting bundle file path. --- .../contracts/CwAdminFactory.client.ts | 65 +++ .../CwAdminFactory.message-composer.ts | 60 +++ .../contracts/CwAdminFactory.react-query.ts | 13 + .../contracts/CwAdminFactory.recoil.ts | 24 + .../contracts/CwAdminFactory.types.ts | 19 + .../contracts/CwCodeIdRegistry.client.ts | 251 +++++++++++ .../CwCodeIdRegistry.message-composer.ts | 200 +++++++++ .../contracts/CwCodeIdRegistry.react-query.ts | 70 +++ .../contracts/CwCodeIdRegistry.recoil.ts | 80 ++++ .../contracts/CwCodeIdRegistry.types.ts | 109 +++++ .../bundler_test/contracts/CwSingle.client.ts | 381 ++++++++++++++++ .../contracts/CwSingle.message-composer.ts | 294 +++++++++++++ .../contracts/CwSingle.react-query.ts | 128 ++++++ .../bundler_test/contracts/CwSingle.recoil.ts | 164 +++++++ .../bundler_test/contracts/CwSingle.types.ts | 416 ++++++++++++++++++ .../bundler_test/contracts/Factory.client.ts | 259 +++++++++++ .../contracts/Factory.message-composer.ts | 214 +++++++++ .../contracts/Factory.react-query.ts | 82 ++++ .../bundler_test/contracts/Factory.recoil.ts | 108 +++++ .../bundler_test/contracts/Factory.types.ts | 183 ++++++++ .../bundler_test/contracts/Minter.client.ts | 177 ++++++++ .../contracts/Minter.message-composer.ts | 174 ++++++++ .../contracts/Minter.react-query.ts | 55 +++ .../bundler_test/contracts/Minter.recoil.ts | 94 ++++ .../bundler_test/contracts/Minter.types.ts | 124 ++++++ __output__/builder/bundler_test/index.ts | 65 +++ packages/ts-codegen/__tests__/builder.test.ts | 310 +++++++------ packages/ts-codegen/src/builder/builder.ts | 342 +++++++------- .../ts-codegen/types/src/builder/builder.d.ts | 5 +- 29 files changed, 4168 insertions(+), 298 deletions(-) create mode 100644 __output__/builder/bundler_test/contracts/CwAdminFactory.client.ts create mode 100644 __output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts create mode 100644 __output__/builder/bundler_test/contracts/CwAdminFactory.react-query.ts create mode 100644 __output__/builder/bundler_test/contracts/CwAdminFactory.recoil.ts create mode 100644 __output__/builder/bundler_test/contracts/CwAdminFactory.types.ts create mode 100644 __output__/builder/bundler_test/contracts/CwCodeIdRegistry.client.ts create mode 100644 __output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts create mode 100644 __output__/builder/bundler_test/contracts/CwCodeIdRegistry.react-query.ts create mode 100644 __output__/builder/bundler_test/contracts/CwCodeIdRegistry.recoil.ts create mode 100644 __output__/builder/bundler_test/contracts/CwCodeIdRegistry.types.ts create mode 100644 __output__/builder/bundler_test/contracts/CwSingle.client.ts create mode 100644 __output__/builder/bundler_test/contracts/CwSingle.message-composer.ts create mode 100644 __output__/builder/bundler_test/contracts/CwSingle.react-query.ts create mode 100644 __output__/builder/bundler_test/contracts/CwSingle.recoil.ts create mode 100644 __output__/builder/bundler_test/contracts/CwSingle.types.ts create mode 100644 __output__/builder/bundler_test/contracts/Factory.client.ts create mode 100644 __output__/builder/bundler_test/contracts/Factory.message-composer.ts create mode 100644 __output__/builder/bundler_test/contracts/Factory.react-query.ts create mode 100644 __output__/builder/bundler_test/contracts/Factory.recoil.ts create mode 100644 __output__/builder/bundler_test/contracts/Factory.types.ts create mode 100644 __output__/builder/bundler_test/contracts/Minter.client.ts create mode 100644 __output__/builder/bundler_test/contracts/Minter.message-composer.ts create mode 100644 __output__/builder/bundler_test/contracts/Minter.react-query.ts create mode 100644 __output__/builder/bundler_test/contracts/Minter.recoil.ts create mode 100644 __output__/builder/bundler_test/contracts/Minter.types.ts create mode 100644 __output__/builder/bundler_test/index.ts diff --git a/__output__/builder/bundler_test/contracts/CwAdminFactory.client.ts b/__output__/builder/bundler_test/contracts/CwAdminFactory.client.ts new file mode 100644 index 00000000..3194c8c0 --- /dev/null +++ b/__output__/builder/bundler_test/contracts/CwAdminFactory.client.ts @@ -0,0 +1,65 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { Coin, StdFee } from "@cosmjs/amino"; +import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; +export interface CwAdminFactoryReadOnlyInterface { + contractAddress: string; +} +export class CwAdminFactoryQueryClient implements CwAdminFactoryReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + } + +} +export interface CwAdminFactoryInterface { + contractAddress: string; + sender: string; + instantiateContractWithSelfAdmin: ({ + codeId, + instantiateMsg, + label + }: { + codeId: number; + instantiateMsg: Binary; + label: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; +} +export class CwAdminFactoryClient implements CwAdminFactoryInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.instantiateContractWithSelfAdmin = this.instantiateContractWithSelfAdmin.bind(this); + } + + instantiateContractWithSelfAdmin = async ({ + codeId, + instantiateMsg, + label + }: { + codeId: number; + instantiateMsg: Binary; + label: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + instantiate_contract_with_self_admin: { + code_id: codeId, + instantiate_msg: instantiateMsg, + label + } + }, fee, memo, funds); + }; +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts b/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts new file mode 100644 index 00000000..6ff9c5fb --- /dev/null +++ b/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts @@ -0,0 +1,60 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Coin } from "@cosmjs/amino"; +import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@cosmjs/encoding"; +import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; +export interface CwAdminFactoryMessage { + contractAddress: string; + sender: string; + instantiateContractWithSelfAdmin: ({ + codeId, + instantiateMsg, + label + }: { + codeId: number; + instantiateMsg: Binary; + label: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; +} +export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { + sender: string; + contractAddress: string; + + constructor(sender: string, contractAddress: string) { + this.sender = sender; + this.contractAddress = contractAddress; + this.instantiateContractWithSelfAdmin = this.instantiateContractWithSelfAdmin.bind(this); + } + + instantiateContractWithSelfAdmin = ({ + codeId, + instantiateMsg, + label + }: { + codeId: number; + instantiateMsg: Binary; + label: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + instantiate_contract_with_self_admin: { + code_id: codeId, + instantiate_msg: instantiateMsg, + label + } + })), + funds + }) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwAdminFactory.react-query.ts b/__output__/builder/bundler_test/contracts/CwAdminFactory.react-query.ts new file mode 100644 index 00000000..be2aa1b7 --- /dev/null +++ b/__output__/builder/bundler_test/contracts/CwAdminFactory.react-query.ts @@ -0,0 +1,13 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions } from "react-query"; +import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; +import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; +export interface CwAdminFactoryReactQuery { + client: CwAdminFactoryQueryClient; + options?: UseQueryOptions; +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwAdminFactory.recoil.ts b/__output__/builder/bundler_test/contracts/CwAdminFactory.recoil.ts new file mode 100644 index 00000000..eddb158c --- /dev/null +++ b/__output__/builder/bundler_test/contracts/CwAdminFactory.recoil.ts @@ -0,0 +1,24 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { selectorFamily } from "recoil"; +import { cosmWasmClient } from "./chain"; +import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; +import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; +type QueryClientParams = { + contractAddress: string; +}; +export const queryClient = selectorFamily({ + key: "cwAdminFactoryQueryClient", + get: ({ + contractAddress + }) => ({ + get + }) => { + const client = get(cosmWasmClient); + return new CwAdminFactoryQueryClient(client, contractAddress); + } +}); \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwAdminFactory.types.ts b/__output__/builder/bundler_test/contracts/CwAdminFactory.types.ts new file mode 100644 index 00000000..11b47d44 --- /dev/null +++ b/__output__/builder/bundler_test/contracts/CwAdminFactory.types.ts @@ -0,0 +1,19 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type ExecuteMsg = { + instantiate_contract_with_self_admin: { + code_id: number; + instantiate_msg: Binary; + label: string; + [k: string]: unknown; + }; +}; +export type Binary = string; +export interface InstantiateMsg { + [k: string]: unknown; +} +export type QueryMsg = string; \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.client.ts b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.client.ts new file mode 100644 index 00000000..59e6506b --- /dev/null +++ b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.client.ts @@ -0,0 +1,251 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { Coin, StdFee } from "@cosmjs/amino"; +import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; +export interface CwCodeIdRegistryReadOnlyInterface { + contractAddress: string; + config: () => Promise; + getRegistration: ({ + chainId, + name, + version + }: { + chainId: string; + name: string; + version?: string; + }) => Promise; + infoForCodeId: ({ + chainId, + codeId + }: { + chainId: string; + codeId: number; + }) => Promise; + listRegistrations: ({ + chainId, + name + }: { + chainId: string; + name: string; + }) => Promise; +} +export class CwCodeIdRegistryQueryClient implements CwCodeIdRegistryReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.getRegistration = this.getRegistration.bind(this); + this.infoForCodeId = this.infoForCodeId.bind(this); + this.listRegistrations = this.listRegistrations.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + getRegistration = async ({ + chainId, + name, + version + }: { + chainId: string; + name: string; + version?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_registration: { + chain_id: chainId, + name, + version + } + }); + }; + infoForCodeId = async ({ + chainId, + codeId + }: { + chainId: string; + codeId: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + info_for_code_id: { + chain_id: chainId, + code_id: codeId + } + }); + }; + listRegistrations = async ({ + chainId, + name + }: { + chainId: string; + name: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + list_registrations: { + chain_id: chainId, + name + } + }); + }; +} +export interface CwCodeIdRegistryInterface { + contractAddress: string; + sender: string; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + register: ({ + chainId, + checksum, + codeId, + name, + version + }: { + chainId: string; + checksum: string; + codeId: number; + name: string; + version: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + setOwner: ({ + chainId, + name, + owner + }: { + chainId: string; + name: string; + owner?: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + unregister: ({ + chainId, + codeId + }: { + chainId: string; + codeId: number; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateConfig: ({ + admin, + paymentInfo + }: { + admin?: string; + paymentInfo?: PaymentInfo; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; +} +export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receive = this.receive.bind(this); + this.register = this.register.bind(this); + this.setOwner = this.setOwner.bind(this); + this.unregister = this.unregister.bind(this); + this.updateConfig = this.updateConfig.bind(this); + } + + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, funds); + }; + register = async ({ + chainId, + checksum, + codeId, + name, + version + }: { + chainId: string; + checksum: string; + codeId: number; + name: string; + version: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register: { + chain_id: chainId, + checksum, + code_id: codeId, + name, + version + } + }, fee, memo, funds); + }; + setOwner = async ({ + chainId, + name, + owner + }: { + chainId: string; + name: string; + owner?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_owner: { + chain_id: chainId, + name, + owner + } + }, fee, memo, funds); + }; + unregister = async ({ + chainId, + codeId + }: { + chainId: string; + codeId: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + unregister: { + chain_id: chainId, + code_id: codeId + } + }, fee, memo, funds); + }; + updateConfig = async ({ + admin, + paymentInfo + }: { + admin?: string; + paymentInfo?: PaymentInfo; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_config: { + admin, + payment_info: paymentInfo + } + }, fee, memo, funds); + }; +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts new file mode 100644 index 00000000..2590da00 --- /dev/null +++ b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts @@ -0,0 +1,200 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Coin } from "@cosmjs/amino"; +import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@cosmjs/encoding"; +import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; +export interface CwCodeIdRegistryMessage { + contractAddress: string; + sender: string; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + register: ({ + chainId, + checksum, + codeId, + name, + version + }: { + chainId: string; + checksum: string; + codeId: number; + name: string; + version: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + setOwner: ({ + chainId, + name, + owner + }: { + chainId: string; + name: string; + owner?: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + unregister: ({ + chainId, + codeId + }: { + chainId: string; + codeId: number; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateConfig: ({ + admin, + paymentInfo + }: { + admin?: string; + paymentInfo?: PaymentInfo; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; +} +export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage { + sender: string; + contractAddress: string; + + constructor(sender: string, contractAddress: string) { + this.sender = sender; + this.contractAddress = contractAddress; + this.receive = this.receive.bind(this); + this.register = this.register.bind(this); + this.setOwner = this.setOwner.bind(this); + this.unregister = this.unregister.bind(this); + this.updateConfig = this.updateConfig.bind(this); + } + + receive = ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + receive: { + amount, + msg, + sender + } + })), + funds + }) + }; + }; + register = ({ + chainId, + checksum, + codeId, + name, + version + }: { + chainId: string; + checksum: string; + codeId: number; + name: string; + version: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + register: { + chain_id: chainId, + checksum, + code_id: codeId, + name, + version + } + })), + funds + }) + }; + }; + setOwner = ({ + chainId, + name, + owner + }: { + chainId: string; + name: string; + owner?: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + set_owner: { + chain_id: chainId, + name, + owner + } + })), + funds + }) + }; + }; + unregister = ({ + chainId, + codeId + }: { + chainId: string; + codeId: number; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + unregister: { + chain_id: chainId, + code_id: codeId + } + })), + funds + }) + }; + }; + updateConfig = ({ + admin, + paymentInfo + }: { + admin?: string; + paymentInfo?: PaymentInfo; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_config: { + admin, + payment_info: paymentInfo + } + })), + funds + }) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.react-query.ts b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.react-query.ts new file mode 100644 index 00000000..d2bcdc8f --- /dev/null +++ b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.react-query.ts @@ -0,0 +1,70 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions, useQuery } from "react-query"; +import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; +import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; +export interface CwCodeIdRegistryReactQuery { + client: CwCodeIdRegistryQueryClient; + options?: UseQueryOptions; +} +export interface CwCodeIdRegistryListRegistrationsQuery extends CwCodeIdRegistryReactQuery { + args: { + chainId: string; + name: string; + }; +} +export function useCwCodeIdRegistryListRegistrationsQuery({ + client, + args, + options +}: CwCodeIdRegistryListRegistrationsQuery) { + return useQuery(["cwCodeIdRegistryListRegistrations", client.contractAddress, JSON.stringify(args)], () => client.listRegistrations({ + chainId: args.chainId, + name: args.name + }), options); +} +export interface CwCodeIdRegistryInfoForCodeIdQuery extends CwCodeIdRegistryReactQuery { + args: { + chainId: string; + codeId: number; + }; +} +export function useCwCodeIdRegistryInfoForCodeIdQuery({ + client, + args, + options +}: CwCodeIdRegistryInfoForCodeIdQuery) { + return useQuery(["cwCodeIdRegistryInfoForCodeId", client.contractAddress, JSON.stringify(args)], () => client.infoForCodeId({ + chainId: args.chainId, + codeId: args.codeId + }), options); +} +export interface CwCodeIdRegistryGetRegistrationQuery extends CwCodeIdRegistryReactQuery { + args: { + chainId: string; + name: string; + version?: string; + }; +} +export function useCwCodeIdRegistryGetRegistrationQuery({ + client, + args, + options +}: CwCodeIdRegistryGetRegistrationQuery) { + return useQuery(["cwCodeIdRegistryGetRegistration", client.contractAddress, JSON.stringify(args)], () => client.getRegistration({ + chainId: args.chainId, + name: args.name, + version: args.version + }), options); +} +export interface CwCodeIdRegistryConfigQuery extends CwCodeIdRegistryReactQuery {} +export function useCwCodeIdRegistryConfigQuery({ + client, + options +}: CwCodeIdRegistryConfigQuery) { + return useQuery(["cwCodeIdRegistryConfig", client.contractAddress], () => client.config(), options); +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.recoil.ts b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.recoil.ts new file mode 100644 index 00000000..c76fd755 --- /dev/null +++ b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.recoil.ts @@ -0,0 +1,80 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { selectorFamily } from "recoil"; +import { cosmWasmClient } from "./chain"; +import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; +import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; +type QueryClientParams = { + contractAddress: string; +}; +export const queryClient = selectorFamily({ + key: "cwCodeIdRegistryQueryClient", + get: ({ + contractAddress + }) => ({ + get + }) => { + const client = get(cosmWasmClient); + return new CwCodeIdRegistryQueryClient(client, contractAddress); + } +}); +export const configSelector = selectorFamily; +}>({ + key: "cwCodeIdRegistryConfig", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.config(...params); + } +}); +export const getRegistrationSelector = selectorFamily; +}>({ + key: "cwCodeIdRegistryGetRegistration", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.getRegistration(...params); + } +}); +export const infoForCodeIdSelector = selectorFamily; +}>({ + key: "cwCodeIdRegistryInfoForCodeId", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.infoForCodeId(...params); + } +}); +export const listRegistrationsSelector = selectorFamily; +}>({ + key: "cwCodeIdRegistryListRegistrations", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.listRegistrations(...params); + } +}); \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.types.ts b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.types.ts new file mode 100644 index 00000000..46a8c284 --- /dev/null +++ b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.types.ts @@ -0,0 +1,109 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Addr = string; +export type PaymentInfo = { + none: {}; +} | { + native_payment: { + payment_amount: Uint128; + token_denom: string; + }; +} | { + cw20_payment: { + payment_amount: Uint128; + token_address: string; + }; +}; +export type Uint128 = string; +export interface ConfigResponse { + admin: Addr; + payment_info: PaymentInfo; +} +export type ExecuteMsg = { + receive: Cw20ReceiveMsg; +} | { + register: { + chain_id: string; + checksum: string; + code_id: number; + name: string; + version: string; + }; +} | { + set_owner: { + chain_id: string; + name: string; + owner?: string | null; + }; +} | { + unregister: { + chain_id: string; + code_id: number; + }; +} | { + update_config: { + admin?: string | null; + payment_info?: PaymentInfo | null; + }; +}; +export type Binary = string; +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; + [k: string]: unknown; +} +export interface GetRegistrationResponse { + registration: Registration; +} +export interface Registration { + checksum: string; + code_id: number; + registered_by: Addr; + version: string; +} +export interface InfoForCodeIdResponse { + checksum: string; + name: string; + registered_by: Addr; + version: string; +} +export interface InstantiateMsg { + admin: string; + payment_info: PaymentInfo; +} +export interface ListRegistrationsResponse { + registrations: Registration[]; +} +export type QueryMsg = { + config: {}; +} | { + get_registration: { + chain_id: string; + name: string; + version?: string | null; + }; +} | { + info_for_code_id: { + chain_id: string; + code_id: number; + }; +} | { + list_registrations: { + chain_id: string; + name: string; + }; +}; +export type ReceiveMsg = { + register: { + chain_id: string; + checksum: string; + code_id: number; + name: string; + version: string; + }; +}; \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwSingle.client.ts b/__output__/builder/bundler_test/contracts/CwSingle.client.ts new file mode 100644 index 00000000..05c0dc73 --- /dev/null +++ b/__output__/builder/bundler_test/contracts/CwSingle.client.ts @@ -0,0 +1,381 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; +export interface CwSingleReadOnlyInterface { + contractAddress: string; + config: () => Promise; + proposal: ({ + proposalId + }: { + proposalId: number; + }) => Promise; + listProposals: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }) => Promise; + reverseProposals: ({ + limit, + startBefore + }: { + limit?: number; + startBefore?: number; + }) => Promise; + proposalCount: () => Promise; + vote: ({ + proposalId, + voter + }: { + proposalId: number; + voter: string; + }) => Promise; + listVotes: ({ + limit, + proposalId, + startAfter + }: { + limit?: number; + proposalId: number; + startAfter?: string; + }) => Promise; + proposalHooks: () => Promise; + voteHooks: () => Promise; + info: () => Promise; +} +export class CwSingleQueryClient implements CwSingleReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.proposal = this.proposal.bind(this); + this.listProposals = this.listProposals.bind(this); + this.reverseProposals = this.reverseProposals.bind(this); + this.proposalCount = this.proposalCount.bind(this); + this.vote = this.vote.bind(this); + this.listVotes = this.listVotes.bind(this); + this.proposalHooks = this.proposalHooks.bind(this); + this.voteHooks = this.voteHooks.bind(this); + this.info = this.info.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + proposal = async ({ + proposalId + }: { + proposalId: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + proposal: { + proposal_id: proposalId + } + }); + }; + listProposals = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + list_proposals: { + limit, + start_after: startAfter + } + }); + }; + reverseProposals = async ({ + limit, + startBefore + }: { + limit?: number; + startBefore?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + reverse_proposals: { + limit, + start_before: startBefore + } + }); + }; + proposalCount = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + proposal_count: {} + }); + }; + vote = async ({ + proposalId, + voter + }: { + proposalId: number; + voter: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + vote: { + proposal_id: proposalId, + voter + } + }); + }; + listVotes = async ({ + limit, + proposalId, + startAfter + }: { + limit?: number; + proposalId: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + list_votes: { + limit, + proposal_id: proposalId, + start_after: startAfter + } + }); + }; + proposalHooks = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + proposal_hooks: {} + }); + }; + voteHooks = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + vote_hooks: {} + }); + }; + info = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + info: {} + }); + }; +} +export interface CwSingleInterface { + contractAddress: string; + sender: string; + propose: ({ + description, + msgs, + title + }: { + description: string; + msgs: CosmosMsgForEmpty[]; + title: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + vote: ({ + proposalId, + vote + }: { + proposalId: number; + vote: Vote; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + execute: ({ + proposalId + }: { + proposalId: number; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + close: ({ + proposalId + }: { + proposalId: number; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateConfig: ({ + allowRevoting, + dao, + depositInfo, + maxVotingPeriod, + minVotingPeriod, + onlyMembersExecute, + threshold + }: { + allowRevoting: boolean; + dao: string; + depositInfo?: DepositInfo; + maxVotingPeriod: Duration; + minVotingPeriod?: Duration; + onlyMembersExecute: boolean; + threshold: Threshold; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + addProposalHook: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + removeProposalHook: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + addVoteHook: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + removeVoteHook: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; +} +export class CwSingleClient implements CwSingleInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.propose = this.propose.bind(this); + this.vote = this.vote.bind(this); + this.execute = this.execute.bind(this); + this.close = this.close.bind(this); + this.updateConfig = this.updateConfig.bind(this); + this.addProposalHook = this.addProposalHook.bind(this); + this.removeProposalHook = this.removeProposalHook.bind(this); + this.addVoteHook = this.addVoteHook.bind(this); + this.removeVoteHook = this.removeVoteHook.bind(this); + } + + propose = async ({ + description, + msgs, + title + }: { + description: string; + msgs: CosmosMsgForEmpty[]; + title: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + propose: { + description, + msgs, + title + } + }, fee, memo, funds); + }; + vote = async ({ + proposalId, + vote + }: { + proposalId: number; + vote: Vote; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + vote: { + proposal_id: proposalId, + vote + } + }, fee, memo, funds); + }; + execute = async ({ + proposalId + }: { + proposalId: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + execute: { + proposal_id: proposalId + } + }, fee, memo, funds); + }; + close = async ({ + proposalId + }: { + proposalId: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + close: { + proposal_id: proposalId + } + }, fee, memo, funds); + }; + updateConfig = async ({ + allowRevoting, + dao, + depositInfo, + maxVotingPeriod, + minVotingPeriod, + onlyMembersExecute, + threshold + }: { + allowRevoting: boolean; + dao: string; + depositInfo?: DepositInfo; + maxVotingPeriod: Duration; + minVotingPeriod?: Duration; + onlyMembersExecute: boolean; + threshold: Threshold; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_config: { + allow_revoting: allowRevoting, + dao, + deposit_info: depositInfo, + max_voting_period: maxVotingPeriod, + min_voting_period: minVotingPeriod, + only_members_execute: onlyMembersExecute, + threshold + } + }, fee, memo, funds); + }; + addProposalHook = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_proposal_hook: { + address + } + }, fee, memo, funds); + }; + removeProposalHook = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_proposal_hook: { + address + } + }, fee, memo, funds); + }; + addVoteHook = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_vote_hook: { + address + } + }, fee, memo, funds); + }; + removeVoteHook = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_vote_hook: { + address + } + }, fee, memo, funds); + }; +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts b/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts new file mode 100644 index 00000000..0a8436fc --- /dev/null +++ b/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts @@ -0,0 +1,294 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@cosmjs/encoding"; +import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; +export interface CwSingleMessage { + contractAddress: string; + sender: string; + propose: ({ + description, + msgs, + title + }: { + description: string; + msgs: CosmosMsgForEmpty[]; + title: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + vote: ({ + proposalId, + vote + }: { + proposalId: number; + vote: Vote; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + execute: ({ + proposalId + }: { + proposalId: number; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + close: ({ + proposalId + }: { + proposalId: number; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateConfig: ({ + allowRevoting, + dao, + depositInfo, + maxVotingPeriod, + minVotingPeriod, + onlyMembersExecute, + threshold + }: { + allowRevoting: boolean; + dao: string; + depositInfo?: DepositInfo; + maxVotingPeriod: Duration; + minVotingPeriod?: Duration; + onlyMembersExecute: boolean; + threshold: Threshold; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + addProposalHook: ({ + address + }: { + address: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + removeProposalHook: ({ + address + }: { + address: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + addVoteHook: ({ + address + }: { + address: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + removeVoteHook: ({ + address + }: { + address: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; +} +export class CwSingleMessageComposer implements CwSingleMessage { + sender: string; + contractAddress: string; + + constructor(sender: string, contractAddress: string) { + this.sender = sender; + this.contractAddress = contractAddress; + this.propose = this.propose.bind(this); + this.vote = this.vote.bind(this); + this.execute = this.execute.bind(this); + this.close = this.close.bind(this); + this.updateConfig = this.updateConfig.bind(this); + this.addProposalHook = this.addProposalHook.bind(this); + this.removeProposalHook = this.removeProposalHook.bind(this); + this.addVoteHook = this.addVoteHook.bind(this); + this.removeVoteHook = this.removeVoteHook.bind(this); + } + + propose = ({ + description, + msgs, + title + }: { + description: string; + msgs: CosmosMsgForEmpty[]; + title: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + propose: { + description, + msgs, + title + } + })), + funds + }) + }; + }; + vote = ({ + proposalId, + vote + }: { + proposalId: number; + vote: Vote; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + vote: { + proposal_id: proposalId, + vote + } + })), + funds + }) + }; + }; + execute = ({ + proposalId + }: { + proposalId: number; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + execute: { + proposal_id: proposalId + } + })), + funds + }) + }; + }; + close = ({ + proposalId + }: { + proposalId: number; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + close: { + proposal_id: proposalId + } + })), + funds + }) + }; + }; + updateConfig = ({ + allowRevoting, + dao, + depositInfo, + maxVotingPeriod, + minVotingPeriod, + onlyMembersExecute, + threshold + }: { + allowRevoting: boolean; + dao: string; + depositInfo?: DepositInfo; + maxVotingPeriod: Duration; + minVotingPeriod?: Duration; + onlyMembersExecute: boolean; + threshold: Threshold; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_config: { + allow_revoting: allowRevoting, + dao, + deposit_info: depositInfo, + max_voting_period: maxVotingPeriod, + min_voting_period: minVotingPeriod, + only_members_execute: onlyMembersExecute, + threshold + } + })), + funds + }) + }; + }; + addProposalHook = ({ + address + }: { + address: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + add_proposal_hook: { + address + } + })), + funds + }) + }; + }; + removeProposalHook = ({ + address + }: { + address: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + remove_proposal_hook: { + address + } + })), + funds + }) + }; + }; + addVoteHook = ({ + address + }: { + address: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + add_vote_hook: { + address + } + })), + funds + }) + }; + }; + removeVoteHook = ({ + address + }: { + address: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + remove_vote_hook: { + address + } + })), + funds + }) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwSingle.react-query.ts b/__output__/builder/bundler_test/contracts/CwSingle.react-query.ts new file mode 100644 index 00000000..874561b4 --- /dev/null +++ b/__output__/builder/bundler_test/contracts/CwSingle.react-query.ts @@ -0,0 +1,128 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions, useQuery } from "react-query"; +import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; +import { CwSingleQueryClient } from "./CwSingle.client"; +export interface CwSingleReactQuery { + client: CwSingleQueryClient; + options?: UseQueryOptions; +} +export interface CwSingleInfoQuery extends CwSingleReactQuery {} +export function useCwSingleInfoQuery({ + client, + options +}: CwSingleInfoQuery) { + return useQuery(["cwSingleInfo", client.contractAddress], () => client.info(), options); +} +export interface CwSingleVoteHooksQuery extends CwSingleReactQuery {} +export function useCwSingleVoteHooksQuery({ + client, + options +}: CwSingleVoteHooksQuery) { + return useQuery(["cwSingleVoteHooks", client.contractAddress], () => client.voteHooks(), options); +} +export interface CwSingleProposalHooksQuery extends CwSingleReactQuery {} +export function useCwSingleProposalHooksQuery({ + client, + options +}: CwSingleProposalHooksQuery) { + return useQuery(["cwSingleProposalHooks", client.contractAddress], () => client.proposalHooks(), options); +} +export interface CwSingleListVotesQuery extends CwSingleReactQuery { + args: { + limit?: number; + proposalId: number; + startAfter?: string; + }; +} +export function useCwSingleListVotesQuery({ + client, + args, + options +}: CwSingleListVotesQuery) { + return useQuery(["cwSingleListVotes", client.contractAddress, JSON.stringify(args)], () => client.listVotes({ + limit: args.limit, + proposalId: args.proposalId, + startAfter: args.startAfter + }), options); +} +export interface CwSingleVoteQuery extends CwSingleReactQuery { + args: { + proposalId: number; + voter: string; + }; +} +export function useCwSingleVoteQuery({ + client, + args, + options +}: CwSingleVoteQuery) { + return useQuery(["cwSingleVote", client.contractAddress, JSON.stringify(args)], () => client.vote({ + proposalId: args.proposalId, + voter: args.voter + }), options); +} +export interface CwSingleProposalCountQuery extends CwSingleReactQuery {} +export function useCwSingleProposalCountQuery({ + client, + options +}: CwSingleProposalCountQuery) { + return useQuery(["cwSingleProposalCount", client.contractAddress], () => client.proposalCount(), options); +} +export interface CwSingleReverseProposalsQuery extends CwSingleReactQuery { + args: { + limit?: number; + startBefore?: number; + }; +} +export function useCwSingleReverseProposalsQuery({ + client, + args, + options +}: CwSingleReverseProposalsQuery) { + return useQuery(["cwSingleReverseProposals", client.contractAddress, JSON.stringify(args)], () => client.reverseProposals({ + limit: args.limit, + startBefore: args.startBefore + }), options); +} +export interface CwSingleListProposalsQuery extends CwSingleReactQuery { + args: { + limit?: number; + startAfter?: number; + }; +} +export function useCwSingleListProposalsQuery({ + client, + args, + options +}: CwSingleListProposalsQuery) { + return useQuery(["cwSingleListProposals", client.contractAddress, JSON.stringify(args)], () => client.listProposals({ + limit: args.limit, + startAfter: args.startAfter + }), options); +} +export interface CwSingleProposalQuery extends CwSingleReactQuery { + args: { + proposalId: number; + }; +} +export function useCwSingleProposalQuery({ + client, + args, + options +}: CwSingleProposalQuery) { + return useQuery(["cwSingleProposal", client.contractAddress, JSON.stringify(args)], () => client.proposal({ + proposalId: args.proposalId + }), options); +} +export interface CwSingleConfigQuery extends CwSingleReactQuery {} +export function useCwSingleConfigQuery({ + client, + options +}: CwSingleConfigQuery) { + return useQuery(["cwSingleConfig", client.contractAddress], () => client.config(), options); +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwSingle.recoil.ts b/__output__/builder/bundler_test/contracts/CwSingle.recoil.ts new file mode 100644 index 00000000..79b2c1ba --- /dev/null +++ b/__output__/builder/bundler_test/contracts/CwSingle.recoil.ts @@ -0,0 +1,164 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { selectorFamily } from "recoil"; +import { cosmWasmClient } from "./chain"; +import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; +import { CwSingleQueryClient } from "./CwSingle.client"; +type QueryClientParams = { + contractAddress: string; +}; +export const queryClient = selectorFamily({ + key: "cwSingleQueryClient", + get: ({ + contractAddress + }) => ({ + get + }) => { + const client = get(cosmWasmClient); + return new CwSingleQueryClient(client, contractAddress); + } +}); +export const configSelector = selectorFamily; +}>({ + key: "cwSingleConfig", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.config(...params); + } +}); +export const proposalSelector = selectorFamily; +}>({ + key: "cwSingleProposal", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.proposal(...params); + } +}); +export const listProposalsSelector = selectorFamily; +}>({ + key: "cwSingleListProposals", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.listProposals(...params); + } +}); +export const reverseProposalsSelector = selectorFamily; +}>({ + key: "cwSingleReverseProposals", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.reverseProposals(...params); + } +}); +export const proposalCountSelector = selectorFamily; +}>({ + key: "cwSingleProposalCount", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.proposalCount(...params); + } +}); +export const voteSelector = selectorFamily; +}>({ + key: "cwSingleVote", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.vote(...params); + } +}); +export const listVotesSelector = selectorFamily; +}>({ + key: "cwSingleListVotes", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.listVotes(...params); + } +}); +export const proposalHooksSelector = selectorFamily; +}>({ + key: "cwSingleProposalHooks", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.proposalHooks(...params); + } +}); +export const voteHooksSelector = selectorFamily; +}>({ + key: "cwSingleVoteHooks", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.voteHooks(...params); + } +}); +export const infoSelector = selectorFamily; +}>({ + key: "cwSingleInfo", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.info(...params); + } +}); \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwSingle.types.ts b/__output__/builder/bundler_test/contracts/CwSingle.types.ts new file mode 100644 index 00000000..01398dab --- /dev/null +++ b/__output__/builder/bundler_test/contracts/CwSingle.types.ts @@ -0,0 +1,416 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Addr = string; +export type Uint128 = string; +export type Duration = { + height: number; +} | { + time: number; +}; +export type Threshold = { + absolute_percentage: { + percentage: PercentageThreshold; + [k: string]: unknown; + }; +} | { + threshold_quorum: { + quorum: PercentageThreshold; + threshold: PercentageThreshold; + [k: string]: unknown; + }; +} | { + absolute_count: { + threshold: Uint128; + [k: string]: unknown; + }; +}; +export type PercentageThreshold = { + majority: { + [k: string]: unknown; + }; +} | { + percent: Decimal; +}; +export type Decimal = string; +export interface ConfigResponse { + allow_revoting: boolean; + dao: Addr; + deposit_info?: CheckedDepositInfo | null; + max_voting_period: Duration; + min_voting_period?: Duration | null; + only_members_execute: boolean; + threshold: Threshold; + [k: string]: unknown; +} +export interface CheckedDepositInfo { + deposit: Uint128; + refund_failed_proposals: boolean; + token: Addr; + [k: string]: unknown; +} +export type ExecuteMsg = { + propose: { + description: string; + msgs: CosmosMsgForEmpty[]; + title: string; + [k: string]: unknown; + }; +} | { + vote: { + proposal_id: number; + vote: Vote; + [k: string]: unknown; + }; +} | { + execute: { + proposal_id: number; + [k: string]: unknown; + }; +} | { + close: { + proposal_id: number; + [k: string]: unknown; + }; +} | { + update_config: { + allow_revoting: boolean; + dao: string; + deposit_info?: DepositInfo | null; + max_voting_period: Duration; + min_voting_period?: Duration | null; + only_members_execute: boolean; + threshold: Threshold; + [k: string]: unknown; + }; +} | { + add_proposal_hook: { + address: string; + [k: string]: unknown; + }; +} | { + remove_proposal_hook: { + address: string; + [k: string]: unknown; + }; +} | { + add_vote_hook: { + address: string; + [k: string]: unknown; + }; +} | { + remove_vote_hook: { + address: string; + [k: string]: unknown; + }; +}; +export type CosmosMsgForEmpty = { + bank: BankMsg; +} | { + custom: Empty; +} | { + staking: StakingMsg; +} | { + distribution: DistributionMsg; +} | { + stargate: { + type_url: string; + value: Binary; + [k: string]: unknown; + }; +} | { + ibc: IbcMsg; +} | { + wasm: WasmMsg; +} | { + gov: GovMsg; +}; +export type BankMsg = { + send: { + amount: Coin[]; + to_address: string; + [k: string]: unknown; + }; +} | { + burn: { + amount: Coin[]; + [k: string]: unknown; + }; +}; +export type StakingMsg = { + delegate: { + amount: Coin; + validator: string; + [k: string]: unknown; + }; +} | { + undelegate: { + amount: Coin; + validator: string; + [k: string]: unknown; + }; +} | { + redelegate: { + amount: Coin; + dst_validator: string; + src_validator: string; + [k: string]: unknown; + }; +}; +export type DistributionMsg = { + set_withdraw_address: { + address: string; + [k: string]: unknown; + }; +} | { + withdraw_delegator_reward: { + validator: string; + [k: string]: unknown; + }; +}; +export type Binary = string; +export type IbcMsg = { + transfer: { + amount: Coin; + channel_id: string; + timeout: IbcTimeout; + to_address: string; + [k: string]: unknown; + }; +} | { + send_packet: { + channel_id: string; + data: Binary; + timeout: IbcTimeout; + [k: string]: unknown; + }; +} | { + close_channel: { + channel_id: string; + [k: string]: unknown; + }; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type WasmMsg = { + execute: { + contract_addr: string; + funds: Coin[]; + msg: Binary; + [k: string]: unknown; + }; +} | { + instantiate: { + admin?: string | null; + code_id: number; + funds: Coin[]; + label: string; + msg: Binary; + [k: string]: unknown; + }; +} | { + migrate: { + contract_addr: string; + msg: Binary; + new_code_id: number; + [k: string]: unknown; + }; +} | { + update_admin: { + admin: string; + contract_addr: string; + [k: string]: unknown; + }; +} | { + clear_admin: { + contract_addr: string; + [k: string]: unknown; + }; +}; +export type GovMsg = { + vote: { + proposal_id: number; + vote: VoteOption; + [k: string]: unknown; + }; +}; +export type VoteOption = "yes" | "no" | "abstain" | "no_with_veto"; +export type Vote = "yes" | "no" | "abstain"; +export type DepositToken = { + token: { + address: string; + [k: string]: unknown; + }; +} | { + voting_module_token: { + [k: string]: unknown; + }; +}; +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface Empty { + [k: string]: unknown; +} +export interface IbcTimeout { + block?: IbcTimeoutBlock | null; + timestamp?: Timestamp | null; + [k: string]: unknown; +} +export interface IbcTimeoutBlock { + height: number; + revision: number; + [k: string]: unknown; +} +export interface DepositInfo { + deposit: Uint128; + refund_failed_proposals: boolean; + token: DepositToken; + [k: string]: unknown; +} +export type GovernanceModulesResponse = Addr[]; +export interface InfoResponse { + info: ContractVersion; + [k: string]: unknown; +} +export interface ContractVersion { + contract: string; + version: string; + [k: string]: unknown; +} +export interface InstantiateMsg { + allow_revoting: boolean; + deposit_info?: DepositInfo | null; + max_voting_period: Duration; + min_voting_period?: Duration | null; + only_members_execute: boolean; + threshold: Threshold; + [k: string]: unknown; +} +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: { + [k: string]: unknown; + }; +}; +export type Status = "open" | "rejected" | "passed" | "executed" | "closed"; +export interface ListProposalsResponse { + proposals: ProposalResponse[]; + [k: string]: unknown; +} +export interface ProposalResponse { + id: number; + proposal: Proposal; + [k: string]: unknown; +} +export interface Proposal { + allow_revoting: boolean; + deposit_info?: CheckedDepositInfo | null; + description: string; + expiration: Expiration; + min_voting_period?: Expiration | null; + msgs: CosmosMsgForEmpty[]; + proposer: Addr; + start_height: number; + status: Status; + threshold: Threshold; + title: string; + total_power: Uint128; + votes: Votes; + [k: string]: unknown; +} +export interface Votes { + abstain: Uint128; + no: Uint128; + yes: Uint128; + [k: string]: unknown; +} +export interface ListVotesResponse { + votes: VoteInfo[]; + [k: string]: unknown; +} +export interface VoteInfo { + power: Uint128; + vote: Vote; + voter: Addr; + [k: string]: unknown; +} +export interface MigrateMsg { + [k: string]: unknown; +} +export type ProposalCountResponse = number; +export interface ProposalHooksResponse { + hooks: string[]; + [k: string]: unknown; +} +export type QueryMsg = { + config: { + [k: string]: unknown; + }; +} | { + proposal: { + proposal_id: number; + [k: string]: unknown; + }; +} | { + list_proposals: { + limit?: number | null; + start_after?: number | null; + [k: string]: unknown; + }; +} | { + reverse_proposals: { + limit?: number | null; + start_before?: number | null; + [k: string]: unknown; + }; +} | { + proposal_count: { + [k: string]: unknown; + }; +} | { + vote: { + proposal_id: number; + voter: string; + [k: string]: unknown; + }; +} | { + list_votes: { + limit?: number | null; + proposal_id: number; + start_after?: string | null; + [k: string]: unknown; + }; +} | { + proposal_hooks: { + [k: string]: unknown; + }; +} | { + vote_hooks: { + [k: string]: unknown; + }; +} | { + info: { + [k: string]: unknown; + }; +}; +export interface ReverseProposalsResponse { + proposals: ProposalResponse[]; + [k: string]: unknown; +} +export interface VoteHooksResponse { + hooks: string[]; + [k: string]: unknown; +} +export interface VoteResponse { + vote?: VoteInfo | null; + [k: string]: unknown; +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Factory.client.ts b/__output__/builder/bundler_test/contracts/Factory.client.ts new file mode 100644 index 00000000..6e9897d6 --- /dev/null +++ b/__output__/builder/bundler_test/contracts/Factory.client.ts @@ -0,0 +1,259 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; +export interface FactoryReadOnlyInterface { + contractAddress: string; + wallets: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: WalletQueryPrefix; + }) => Promise; + walletsOf: ({ + limit, + startAfter, + user + }: { + limit?: number; + startAfter?: string; + user: string; + }) => Promise; + codeId: ({ + ty + }: { + ty: CodeIdType; + }) => Promise; + fee: () => Promise; + govecAddr: () => Promise; + adminAddr: () => Promise; +} +export class FactoryQueryClient implements FactoryReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.wallets = this.wallets.bind(this); + this.walletsOf = this.walletsOf.bind(this); + this.codeId = this.codeId.bind(this); + this.fee = this.fee.bind(this); + this.govecAddr = this.govecAddr.bind(this); + this.adminAddr = this.adminAddr.bind(this); + } + + wallets = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: WalletQueryPrefix; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + wallets: { + limit, + start_after: startAfter + } + }); + }; + walletsOf = async ({ + limit, + startAfter, + user + }: { + limit?: number; + startAfter?: string; + user: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + wallets_of: { + limit, + start_after: startAfter, + user + } + }); + }; + codeId = async ({ + ty + }: { + ty: CodeIdType; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + code_id: { + ty + } + }); + }; + fee = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + fee: {} + }); + }; + govecAddr = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + govec_addr: {} + }); + }; + adminAddr = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + admin_addr: {} + }); + }; +} +export interface FactoryInterface { + contractAddress: string; + sender: string; + createWallet: ({ + createWalletMsg + }: { + createWalletMsg: CreateWalletMsg; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateProxyUser: ({ + newUser, + oldUser + }: { + newUser: Addr; + oldUser: Addr; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + migrateWallet: ({ + migrationMsg, + walletAddress + }: { + migrationMsg: ProxyMigrationTxMsg; + walletAddress: WalletAddr; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateCodeId: ({ + newCodeId, + ty + }: { + newCodeId: number; + ty: CodeIdType; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateWalletFee: ({ + newFee + }: { + newFee: Coin; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateGovecAddr: ({ + addr + }: { + addr: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateAdmin: ({ + addr + }: { + addr: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; +} +export class FactoryClient implements FactoryInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.createWallet = this.createWallet.bind(this); + this.updateProxyUser = this.updateProxyUser.bind(this); + this.migrateWallet = this.migrateWallet.bind(this); + this.updateCodeId = this.updateCodeId.bind(this); + this.updateWalletFee = this.updateWalletFee.bind(this); + this.updateGovecAddr = this.updateGovecAddr.bind(this); + this.updateAdmin = this.updateAdmin.bind(this); + } + + createWallet = async ({ + createWalletMsg + }: { + createWalletMsg: CreateWalletMsg; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + create_wallet: { + create_wallet_msg: createWalletMsg + } + }, fee, memo, funds); + }; + updateProxyUser = async ({ + newUser, + oldUser + }: { + newUser: Addr; + oldUser: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_proxy_user: { + new_user: newUser, + old_user: oldUser + } + }, fee, memo, funds); + }; + migrateWallet = async ({ + migrationMsg, + walletAddress + }: { + migrationMsg: ProxyMigrationTxMsg; + walletAddress: WalletAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + migrate_wallet: { + migration_msg: migrationMsg, + wallet_address: walletAddress + } + }, fee, memo, funds); + }; + updateCodeId = async ({ + newCodeId, + ty + }: { + newCodeId: number; + ty: CodeIdType; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_code_id: { + new_code_id: newCodeId, + ty + } + }, fee, memo, funds); + }; + updateWalletFee = async ({ + newFee + }: { + newFee: Coin; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_wallet_fee: { + new_fee: newFee + } + }, fee, memo, funds); + }; + updateGovecAddr = async ({ + addr + }: { + addr: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_govec_addr: { + addr + } + }, fee, memo, funds); + }; + updateAdmin = async ({ + addr + }: { + addr: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_admin: { + addr + } + }, fee, memo, funds); + }; +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Factory.message-composer.ts b/__output__/builder/bundler_test/contracts/Factory.message-composer.ts new file mode 100644 index 00000000..21e5a2d1 --- /dev/null +++ b/__output__/builder/bundler_test/contracts/Factory.message-composer.ts @@ -0,0 +1,214 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@cosmjs/encoding"; +import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; +export interface FactoryMessage { + contractAddress: string; + sender: string; + createWallet: ({ + createWalletMsg + }: { + createWalletMsg: CreateWalletMsg; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateProxyUser: ({ + newUser, + oldUser + }: { + newUser: Addr; + oldUser: Addr; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + migrateWallet: ({ + migrationMsg, + walletAddress + }: { + migrationMsg: ProxyMigrationTxMsg; + walletAddress: WalletAddr; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateCodeId: ({ + newCodeId, + ty + }: { + newCodeId: number; + ty: CodeIdType; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateWalletFee: ({ + newFee + }: { + newFee: Coin; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateGovecAddr: ({ + addr + }: { + addr: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateAdmin: ({ + addr + }: { + addr: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; +} +export class FactoryMessageComposer implements FactoryMessage { + sender: string; + contractAddress: string; + + constructor(sender: string, contractAddress: string) { + this.sender = sender; + this.contractAddress = contractAddress; + this.createWallet = this.createWallet.bind(this); + this.updateProxyUser = this.updateProxyUser.bind(this); + this.migrateWallet = this.migrateWallet.bind(this); + this.updateCodeId = this.updateCodeId.bind(this); + this.updateWalletFee = this.updateWalletFee.bind(this); + this.updateGovecAddr = this.updateGovecAddr.bind(this); + this.updateAdmin = this.updateAdmin.bind(this); + } + + createWallet = ({ + createWalletMsg + }: { + createWalletMsg: CreateWalletMsg; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + create_wallet: { + create_wallet_msg: createWalletMsg + } + })), + funds + }) + }; + }; + updateProxyUser = ({ + newUser, + oldUser + }: { + newUser: Addr; + oldUser: Addr; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_proxy_user: { + new_user: newUser, + old_user: oldUser + } + })), + funds + }) + }; + }; + migrateWallet = ({ + migrationMsg, + walletAddress + }: { + migrationMsg: ProxyMigrationTxMsg; + walletAddress: WalletAddr; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + migrate_wallet: { + migration_msg: migrationMsg, + wallet_address: walletAddress + } + })), + funds + }) + }; + }; + updateCodeId = ({ + newCodeId, + ty + }: { + newCodeId: number; + ty: CodeIdType; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_code_id: { + new_code_id: newCodeId, + ty + } + })), + funds + }) + }; + }; + updateWalletFee = ({ + newFee + }: { + newFee: Coin; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_wallet_fee: { + new_fee: newFee + } + })), + funds + }) + }; + }; + updateGovecAddr = ({ + addr + }: { + addr: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_govec_addr: { + addr + } + })), + funds + }) + }; + }; + updateAdmin = ({ + addr + }: { + addr: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_admin: { + addr + } + })), + funds + }) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Factory.react-query.ts b/__output__/builder/bundler_test/contracts/Factory.react-query.ts new file mode 100644 index 00000000..2d40ad5e --- /dev/null +++ b/__output__/builder/bundler_test/contracts/Factory.react-query.ts @@ -0,0 +1,82 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions, useQuery } from "react-query"; +import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; +import { FactoryQueryClient } from "./Factory.client"; +export interface FactoryReactQuery { + client: FactoryQueryClient; + options?: UseQueryOptions; +} +export interface FactoryAdminAddrQuery extends FactoryReactQuery {} +export function useFactoryAdminAddrQuery({ + client, + options +}: FactoryAdminAddrQuery) { + return useQuery(["factoryAdminAddr", client.contractAddress], () => client.adminAddr(), options); +} +export interface FactoryGovecAddrQuery extends FactoryReactQuery {} +export function useFactoryGovecAddrQuery({ + client, + options +}: FactoryGovecAddrQuery) { + return useQuery(["factoryGovecAddr", client.contractAddress], () => client.govecAddr(), options); +} +export interface FactoryFeeQuery extends FactoryReactQuery {} +export function useFactoryFeeQuery({ + client, + options +}: FactoryFeeQuery) { + return useQuery(["factoryFee", client.contractAddress], () => client.fee(), options); +} +export interface FactoryCodeIdQuery extends FactoryReactQuery { + args: { + ty: CodeIdType; + }; +} +export function useFactoryCodeIdQuery({ + client, + args, + options +}: FactoryCodeIdQuery) { + return useQuery(["factoryCodeId", client.contractAddress, JSON.stringify(args)], () => client.codeId({ + ty: args.ty + }), options); +} +export interface FactoryWalletsOfQuery extends FactoryReactQuery { + args: { + limit?: number; + startAfter?: string; + user: string; + }; +} +export function useFactoryWalletsOfQuery({ + client, + args, + options +}: FactoryWalletsOfQuery) { + return useQuery(["factoryWalletsOf", client.contractAddress, JSON.stringify(args)], () => client.walletsOf({ + limit: args.limit, + startAfter: args.startAfter, + user: args.user + }), options); +} +export interface FactoryWalletsQuery extends FactoryReactQuery { + args: { + limit?: number; + startAfter?: WalletQueryPrefix; + }; +} +export function useFactoryWalletsQuery({ + client, + args, + options +}: FactoryWalletsQuery) { + return useQuery(["factoryWallets", client.contractAddress, JSON.stringify(args)], () => client.wallets({ + limit: args.limit, + startAfter: args.startAfter + }), options); +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Factory.recoil.ts b/__output__/builder/bundler_test/contracts/Factory.recoil.ts new file mode 100644 index 00000000..3e17ff15 --- /dev/null +++ b/__output__/builder/bundler_test/contracts/Factory.recoil.ts @@ -0,0 +1,108 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { selectorFamily } from "recoil"; +import { cosmWasmClient } from "./chain"; +import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; +import { FactoryQueryClient } from "./Factory.client"; +type QueryClientParams = { + contractAddress: string; +}; +export const queryClient = selectorFamily({ + key: "factoryQueryClient", + get: ({ + contractAddress + }) => ({ + get + }) => { + const client = get(cosmWasmClient); + return new FactoryQueryClient(client, contractAddress); + } +}); +export const walletsSelector = selectorFamily; +}>({ + key: "factoryWallets", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.wallets(...params); + } +}); +export const walletsOfSelector = selectorFamily; +}>({ + key: "factoryWalletsOf", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.walletsOf(...params); + } +}); +export const codeIdSelector = selectorFamily; +}>({ + key: "factoryCodeId", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.codeId(...params); + } +}); +export const feeSelector = selectorFamily; +}>({ + key: "factoryFee", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.fee(...params); + } +}); +export const govecAddrSelector = selectorFamily; +}>({ + key: "factoryGovecAddr", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.govecAddr(...params); + } +}); +export const adminAddrSelector = selectorFamily; +}>({ + key: "factoryAdminAddr", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.adminAddr(...params); + } +}); \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Factory.types.ts b/__output__/builder/bundler_test/contracts/Factory.types.ts new file mode 100644 index 00000000..ddea5192 --- /dev/null +++ b/__output__/builder/bundler_test/contracts/Factory.types.ts @@ -0,0 +1,183 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AdminAddrResponse = string; +export type CodeIdResponse = number; +export type CodeIdType = "Proxy" | "Multisig"; +export type Uint128 = string; +export type Binary = string; +export interface CreateWalletMsg { + guardians: Guardians; + label: string; + proxy_initial_funds: Coin[]; + relayers: string[]; + user_pubkey: Binary; + [k: string]: unknown; +} +export interface Guardians { + addresses: string[]; + guardians_multisig?: MultiSig | null; + [k: string]: unknown; +} +export interface MultiSig { + multisig_initial_funds: Coin[]; + threshold_absolute_count: number; + [k: string]: unknown; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface Cw20Coin { + address: string; + amount: Uint128; + [k: string]: unknown; +} +export type ExecuteMsg = { + create_wallet: { + create_wallet_msg: CreateWalletMsg; + [k: string]: unknown; + }; +} | { + update_proxy_user: { + new_user: Addr; + old_user: Addr; + [k: string]: unknown; + }; +} | { + migrate_wallet: { + migration_msg: ProxyMigrationTxMsg; + wallet_address: WalletAddr; + [k: string]: unknown; + }; +} | { + update_code_id: { + new_code_id: number; + ty: CodeIdType; + [k: string]: unknown; + }; +} | { + update_wallet_fee: { + new_fee: Coin; + [k: string]: unknown; + }; +} | { + update_govec_addr: { + addr: string; + [k: string]: unknown; + }; +} | { + update_admin: { + addr: string; + [k: string]: unknown; + }; +}; +export type Addr = string; +export type ProxyMigrationTxMsg = { + RelayTx: RelayTransaction; +} | { + DirectMigrationMsg: Binary; +}; +export type WalletAddr = { + Canonical: CanonicalAddr; +} | { + Addr: Addr; +}; +export type CanonicalAddr = string; +export interface RelayTransaction { + message: Binary; + nonce: number; + signature: Binary; + user_pubkey: Binary; + [k: string]: unknown; +} +export interface FeeResponse { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type GovecAddrResponse = string; +export interface InstantiateMsg { + addr_prefix: string; + govec?: string | null; + proxy_code_id: number; + proxy_multisig_code_id: number; + wallet_fee: Coin; + [k: string]: unknown; +} +export type QueryMsg = { + wallets: { + limit?: number | null; + start_after?: WalletQueryPrefix | null; + [k: string]: unknown; + }; +} | { + wallets_of: { + limit?: number | null; + start_after?: string | null; + user: string; + [k: string]: unknown; + }; +} | { + code_id: { + ty: CodeIdType; + [k: string]: unknown; + }; +} | { + fee: { + [k: string]: unknown; + }; +} | { + govec_addr: { + [k: string]: unknown; + }; +} | { + admin_addr: { + [k: string]: unknown; + }; +}; +export interface WalletQueryPrefix { + user_addr: string; + wallet_addr: string; + [k: string]: unknown; +} +export type Duration = { + height: number; +} | { + time: number; +}; +export interface StakingOptions { + code_id: number; + duration?: Duration | null; + [k: string]: unknown; +} +export interface WalletInfo { + code_id: number; + guardians: Addr[]; + is_frozen: boolean; + label: string; + multisig_address?: Addr | null; + multisig_code_id: number; + nonce: number; + relayers: Addr[]; + user_addr: Addr; + version: ContractVersion; + [k: string]: unknown; +} +export interface ContractVersion { + contract: string; + version: string; + [k: string]: unknown; +} +export interface WalletsOfResponse { + wallets: Addr[]; + [k: string]: unknown; +} +export interface WalletsResponse { + wallets: Addr[]; + [k: string]: unknown; +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Minter.client.ts b/__output__/builder/bundler_test/contracts/Minter.client.ts new file mode 100644 index 00000000..deffa10a --- /dev/null +++ b/__output__/builder/bundler_test/contracts/Minter.client.ts @@ -0,0 +1,177 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; +export interface MinterReadOnlyInterface { + contractAddress: string; + config: () => Promise; + mintableNumTokens: () => Promise; + startTime: () => Promise; + mintPrice: () => Promise; + mintCount: ({ + address + }: { + address: string; + }) => Promise; +} +export class MinterQueryClient implements MinterReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.mintableNumTokens = this.mintableNumTokens.bind(this); + this.startTime = this.startTime.bind(this); + this.mintPrice = this.mintPrice.bind(this); + this.mintCount = this.mintCount.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + mintableNumTokens = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + mintable_num_tokens: {} + }); + }; + startTime = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + start_time: {} + }); + }; + mintPrice = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + mint_price: {} + }); + }; + mintCount = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + mint_count: { + address + } + }); + }; +} +export interface MinterInterface { + contractAddress: string; + sender: string; + mint: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + setWhitelist: ({ + whitelist + }: { + whitelist: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateStartTime: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updatePerAddressLimit: ({ + perAddressLimit + }: { + perAddressLimit: number; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + mintTo: ({ + recipient + }: { + recipient: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + mintFor: ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: number; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + withdraw: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; +} +export class MinterClient implements MinterInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.mint = this.mint.bind(this); + this.setWhitelist = this.setWhitelist.bind(this); + this.updateStartTime = this.updateStartTime.bind(this); + this.updatePerAddressLimit = this.updatePerAddressLimit.bind(this); + this.mintTo = this.mintTo.bind(this); + this.mintFor = this.mintFor.bind(this); + this.withdraw = this.withdraw.bind(this); + } + + mint = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: {} + }, fee, memo, funds); + }; + setWhitelist = async ({ + whitelist + }: { + whitelist: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_whitelist: { + whitelist + } + }, fee, memo, funds); + }; + updateStartTime = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_start_time: {} + }, fee, memo, funds); + }; + updatePerAddressLimit = async ({ + perAddressLimit + }: { + perAddressLimit: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_per_address_limit: { + per_address_limit: perAddressLimit + } + }, fee, memo, funds); + }; + mintTo = async ({ + recipient + }: { + recipient: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint_to: { + recipient + } + }, fee, memo, funds); + }; + mintFor = async ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint_for: { + recipient, + token_id: tokenId + } + }, fee, memo, funds); + }; + withdraw = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw: {} + }, fee, memo, funds); + }; +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Minter.message-composer.ts b/__output__/builder/bundler_test/contracts/Minter.message-composer.ts new file mode 100644 index 00000000..30a74b8b --- /dev/null +++ b/__output__/builder/bundler_test/contracts/Minter.message-composer.ts @@ -0,0 +1,174 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@cosmjs/encoding"; +import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; +export interface MinterMessage { + contractAddress: string; + sender: string; + mint: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + setWhitelist: ({ + whitelist + }: { + whitelist: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateStartTime: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + updatePerAddressLimit: ({ + perAddressLimit + }: { + perAddressLimit: number; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + mintTo: ({ + recipient + }: { + recipient: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + mintFor: ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: number; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + withdraw: (funds?: Coin[]) => MsgExecuteContractEncodeObject; +} +export class MinterMessageComposer implements MinterMessage { + sender: string; + contractAddress: string; + + constructor(sender: string, contractAddress: string) { + this.sender = sender; + this.contractAddress = contractAddress; + this.mint = this.mint.bind(this); + this.setWhitelist = this.setWhitelist.bind(this); + this.updateStartTime = this.updateStartTime.bind(this); + this.updatePerAddressLimit = this.updatePerAddressLimit.bind(this); + this.mintTo = this.mintTo.bind(this); + this.mintFor = this.mintFor.bind(this); + this.withdraw = this.withdraw.bind(this); + } + + mint = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + mint: {} + })), + funds + }) + }; + }; + setWhitelist = ({ + whitelist + }: { + whitelist: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + set_whitelist: { + whitelist + } + })), + funds + }) + }; + }; + updateStartTime = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_start_time: {} + })), + funds + }) + }; + }; + updatePerAddressLimit = ({ + perAddressLimit + }: { + perAddressLimit: number; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_per_address_limit: { + per_address_limit: perAddressLimit + } + })), + funds + }) + }; + }; + mintTo = ({ + recipient + }: { + recipient: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + mint_to: { + recipient + } + })), + funds + }) + }; + }; + mintFor = ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: number; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + mint_for: { + recipient, + token_id: tokenId + } + })), + funds + }) + }; + }; + withdraw = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + withdraw: {} + })), + funds + }) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Minter.react-query.ts b/__output__/builder/bundler_test/contracts/Minter.react-query.ts new file mode 100644 index 00000000..007bcfd9 --- /dev/null +++ b/__output__/builder/bundler_test/contracts/Minter.react-query.ts @@ -0,0 +1,55 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions, useQuery } from "react-query"; +import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; +import { MinterQueryClient } from "./Minter.client"; +export interface MinterReactQuery { + client: MinterQueryClient; + options?: UseQueryOptions; +} +export interface MinterMintCountQuery extends MinterReactQuery { + args: { + address: string; + }; +} +export function useMinterMintCountQuery({ + client, + args, + options +}: MinterMintCountQuery) { + return useQuery(["minterMintCount", client.contractAddress, JSON.stringify(args)], () => client.mintCount({ + address: args.address + }), options); +} +export interface MinterMintPriceQuery extends MinterReactQuery {} +export function useMinterMintPriceQuery({ + client, + options +}: MinterMintPriceQuery) { + return useQuery(["minterMintPrice", client.contractAddress], () => client.mintPrice(), options); +} +export interface MinterStartTimeQuery extends MinterReactQuery {} +export function useMinterStartTimeQuery({ + client, + options +}: MinterStartTimeQuery) { + return useQuery(["minterStartTime", client.contractAddress], () => client.startTime(), options); +} +export interface MinterMintableNumTokensQuery extends MinterReactQuery {} +export function useMinterMintableNumTokensQuery({ + client, + options +}: MinterMintableNumTokensQuery) { + return useQuery(["minterMintableNumTokens", client.contractAddress], () => client.mintableNumTokens(), options); +} +export interface MinterConfigQuery extends MinterReactQuery {} +export function useMinterConfigQuery({ + client, + options +}: MinterConfigQuery) { + return useQuery(["minterConfig", client.contractAddress], () => client.config(), options); +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Minter.recoil.ts b/__output__/builder/bundler_test/contracts/Minter.recoil.ts new file mode 100644 index 00000000..826fb57c --- /dev/null +++ b/__output__/builder/bundler_test/contracts/Minter.recoil.ts @@ -0,0 +1,94 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { selectorFamily } from "recoil"; +import { cosmWasmClient } from "./chain"; +import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; +import { MinterQueryClient } from "./Minter.client"; +type QueryClientParams = { + contractAddress: string; +}; +export const queryClient = selectorFamily({ + key: "minterQueryClient", + get: ({ + contractAddress + }) => ({ + get + }) => { + const client = get(cosmWasmClient); + return new MinterQueryClient(client, contractAddress); + } +}); +export const configSelector = selectorFamily; +}>({ + key: "minterConfig", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.config(...params); + } +}); +export const mintableNumTokensSelector = selectorFamily; +}>({ + key: "minterMintableNumTokens", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.mintableNumTokens(...params); + } +}); +export const startTimeSelector = selectorFamily; +}>({ + key: "minterStartTime", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.startTime(...params); + } +}); +export const mintPriceSelector = selectorFamily; +}>({ + key: "minterMintPrice", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.mintPrice(...params); + } +}); +export const mintCountSelector = selectorFamily; +}>({ + key: "minterMintCount", + get: ({ + params, + ...queryClientParams + }) => async ({ + get + }) => { + const client = get(queryClient(queryClientParams)); + return await client.mintCount(...params); + } +}); \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Minter.types.ts b/__output__/builder/bundler_test/contracts/Minter.types.ts new file mode 100644 index 00000000..55999b8d --- /dev/null +++ b/__output__/builder/bundler_test/contracts/Minter.types.ts @@ -0,0 +1,124 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Timestamp = Uint64; +export type Uint64 = string; +export type Uint128 = string; +export interface ConfigResponse { + admin: string; + base_token_uri: string; + num_tokens: number; + per_address_limit: number; + sg721_address: string; + sg721_code_id: number; + start_time: Timestamp; + unit_price: Coin; + whitelist?: string | null; + [k: string]: unknown; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type Addr = string; +export interface Config { + admin: Addr; + base_token_uri: string; + num_tokens: number; + per_address_limit: number; + sg721_code_id: number; + start_time: Timestamp; + unit_price: Coin; + whitelist?: Addr | null; + [k: string]: unknown; +} +export type ExecuteMsg = { + mint: { + [k: string]: unknown; + }; +} | { + set_whitelist: { + whitelist: string; + [k: string]: unknown; + }; +} | { + update_start_time: Timestamp; +} | { + update_per_address_limit: { + per_address_limit: number; + [k: string]: unknown; + }; +} | { + mint_to: { + recipient: string; + [k: string]: unknown; + }; +} | { + mint_for: { + recipient: string; + token_id: number; + [k: string]: unknown; + }; +} | { + withdraw: { + [k: string]: unknown; + }; +}; +export type Decimal = string; +export interface InstantiateMsg { + base_token_uri: string; + num_tokens: number; + per_address_limit: number; + sg721_code_id: number; + sg721_instantiate_msg: InstantiateMsg1; + start_time: Timestamp; + unit_price: Coin; + whitelist?: string | null; + [k: string]: unknown; +} +export interface InstantiateMsg1 { + collection_info: CollectionInfoForRoyaltyInfoResponse; + minter: string; + name: string; + symbol: string; + [k: string]: unknown; +} +export interface CollectionInfoForRoyaltyInfoResponse { + creator: string; + description: string; + external_link?: string | null; + image: string; + royalty_info?: RoyaltyInfoResponse | null; + [k: string]: unknown; +} +export interface RoyaltyInfoResponse { + payment_address: string; + share: Decimal; + [k: string]: unknown; +} +export type QueryMsg = { + config: { + [k: string]: unknown; + }; +} | { + mintable_num_tokens: { + [k: string]: unknown; + }; +} | { + start_time: { + [k: string]: unknown; + }; +} | { + mint_price: { + [k: string]: unknown; + }; +} | { + mint_count: { + address: string; + [k: string]: unknown; + }; +}; \ No newline at end of file diff --git a/__output__/builder/bundler_test/index.ts b/__output__/builder/bundler_test/index.ts new file mode 100644 index 00000000..563d49ab --- /dev/null +++ b/__output__/builder/bundler_test/index.ts @@ -0,0 +1,65 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import * as _65 from "./contracts/Factory.types"; +import * as _66 from "./contracts/Factory.client"; +import * as _67 from "./contracts/Factory.message-composer"; +import * as _68 from "./contracts/Factory.react-query"; +import * as _69 from "./contracts/Factory.recoil"; +import * as _70 from "./contracts/Minter.types"; +import * as _71 from "./contracts/Minter.client"; +import * as _72 from "./contracts/Minter.message-composer"; +import * as _73 from "./contracts/Minter.react-query"; +import * as _74 from "./contracts/Minter.recoil"; +import * as _75 from "./contracts/CwAdminFactory.types"; +import * as _76 from "./contracts/CwAdminFactory.client"; +import * as _77 from "./contracts/CwAdminFactory.message-composer"; +import * as _78 from "./contracts/CwAdminFactory.react-query"; +import * as _79 from "./contracts/CwAdminFactory.recoil"; +import * as _80 from "./contracts/CwCodeIdRegistry.types"; +import * as _81 from "./contracts/CwCodeIdRegistry.client"; +import * as _82 from "./contracts/CwCodeIdRegistry.message-composer"; +import * as _83 from "./contracts/CwCodeIdRegistry.react-query"; +import * as _84 from "./contracts/CwCodeIdRegistry.recoil"; +import * as _85 from "./contracts/CwSingle.types"; +import * as _86 from "./contracts/CwSingle.client"; +import * as _87 from "./contracts/CwSingle.message-composer"; +import * as _88 from "./contracts/CwSingle.react-query"; +import * as _89 from "./contracts/CwSingle.recoil"; +export namespace smart { + export namespace contracts { + export const Factory = { ..._65, + ..._66, + ..._67, + ..._68, + ..._69 + }; + export const Minter = { ..._70, + ..._71, + ..._72, + ..._73, + ..._74 + }; + export const CwAdminFactory = { ..._75, + ..._76, + ..._77, + ..._78, + ..._79 + }; + export const CwCodeIdRegistry = { ..._80, + ..._81, + ..._82, + ..._83, + ..._84 + }; + export const CwSingle = { ..._85, + ..._86, + ..._87, + ..._88, + ..._89 + }; + } +} \ No newline at end of file diff --git a/packages/ts-codegen/__tests__/builder.test.ts b/packages/ts-codegen/__tests__/builder.test.ts index c06b8135..8e26e23c 100644 --- a/packages/ts-codegen/__tests__/builder.test.ts +++ b/packages/ts-codegen/__tests__/builder.test.ts @@ -5,151 +5,189 @@ const FIXTURE_DIR = __dirname + '/../../../__fixtures__'; const OUTPUT_DIR = __dirname + '/../../../__output__/builder'; it('options undefined', async () => { - const outPath = OUTPUT_DIR + '/vectis/factory-opt'; - const schemaDir = FIXTURE_DIR + '/vectis/factory/'; - const builder = new TSBuilder({ - contracts: [ - schemaDir - ], - outPath, - options: undefined - }); - delete builder.contracts; - delete builder.outPath; - expect(builder).toMatchSnapshot(); + const outPath = OUTPUT_DIR + '/vectis/factory-opt'; + const schemaDir = FIXTURE_DIR + '/vectis/factory/'; + const builder = new TSBuilder({ + contracts: [schemaDir], + outPath, + options: undefined + }); + delete builder.contracts; + delete builder.outPath; + expect(builder).toMatchSnapshot(); }); it('options tsClient.enabled', async () => { - const outPath = OUTPUT_DIR + '/vectis/factory-opt'; - const schemaDir = FIXTURE_DIR + '/vectis/factory/'; - const builder = new TSBuilder({ - contracts: [ - schemaDir - ], - outPath, - options: { - types: { - enabled: true - }, - client: { - enabled: true - }, - reactQuery: { - enabled: true - } - } - }); - delete builder.contracts; - delete builder.outPath; - expect(builder).toMatchSnapshot(); + const outPath = OUTPUT_DIR + '/vectis/factory-opt'; + const schemaDir = FIXTURE_DIR + '/vectis/factory/'; + const builder = new TSBuilder({ + contracts: [schemaDir], + outPath, + options: { + types: { + enabled: true + }, + client: { + enabled: true + }, + reactQuery: { + enabled: true + } + } + }); + delete builder.contracts; + delete builder.outPath; + expect(builder).toMatchSnapshot(); }); it('builder invoke', async () => { - const outPath = OUTPUT_DIR + '/invoke/'; - const s = (str) => FIXTURE_DIR + str; - const builder = new TSBuilder({ - contracts: [ - s('/vectis/factory'), - s('/minter'), - s('/daodao/cw-admin-factory'), - s('/daodao/cw-code-id-registry'), - { - name: 'CwSingle', - dir: s('/daodao/cw-proposal-single') - } - ], - outPath, - options: { - types: { - enabled: true - }, - client: { - enabled: true - }, - reactQuery: { - enabled: true - } - } - }); - await builder.build(); + const outPath = OUTPUT_DIR + '/invoke/'; + const s = (str) => FIXTURE_DIR + str; + const builder = new TSBuilder({ + contracts: [ + s('/vectis/factory'), + s('/minter'), + s('/daodao/cw-admin-factory'), + s('/daodao/cw-code-id-registry'), + { + name: 'CwSingle', + dir: s('/daodao/cw-proposal-single') + } + ], + outPath, + options: { + types: { + enabled: true + }, + client: { + enabled: true + }, + reactQuery: { + enabled: true + } + } + }); + await builder.build(); }); it('builder default', async () => { - const outPath = OUTPUT_DIR + '/default/'; - const s = (str) => FIXTURE_DIR + str; - await codegen({ - contracts: [ - s('/vectis/factory'), - s('/minter'), - s('/daodao/cw-admin-factory'), - s('/daodao/cw-code-id-registry'), - { - name: 'CwSingle', - dir: s('/daodao/cw-proposal-single') - } - ], - outPath, - options: { - bundle: { - bundleFile: 'index.ts', - scope: 'smart.contracts' - }, - types: { - enabled: true - }, - client: { - enabled: true, - execExtendsQuery: true - }, - reactQuery: { - enabled: true - }, - recoil: { - enabled: true - }, - messageComposer: { - enabled: true - } - } - }); + const outPath = OUTPUT_DIR + '/default/'; + const s = (str) => FIXTURE_DIR + str; + await codegen({ + contracts: [ + s('/vectis/factory'), + s('/minter'), + s('/daodao/cw-admin-factory'), + s('/daodao/cw-code-id-registry'), + { + name: 'CwSingle', + dir: s('/daodao/cw-proposal-single') + } + ], + outPath, + options: { + bundle: { + bundleFile: 'index.ts', + scope: 'smart.contracts' + }, + types: { + enabled: true + }, + client: { + enabled: true, + execExtendsQuery: true + }, + reactQuery: { + enabled: true + }, + recoil: { + enabled: true + }, + messageComposer: { + enabled: true + } + } + }); }); it('builder no extends', async () => { - const outPath = OUTPUT_DIR + '/no-extends/'; - const s = (str) => FIXTURE_DIR + str; - await codegen({ - contracts: [ - s('/vectis/factory'), - s('/minter'), - s('/daodao/cw-admin-factory'), - s('/daodao/cw-code-id-registry'), - { - name: 'CwSingle', - dir: s('/daodao/cw-proposal-single') - } - ], - outPath, - options: { - bundle: { - bundleFile: 'index.ts', - scope: 'smart.contracts' - }, - types: { - enabled: true - }, - client: { - enabled: true, - execExtendsQuery: false - }, - reactQuery: { - enabled: true - }, - recoil: { - enabled: true - }, - messageComposer: { - enabled: true - } - } - }); -}); \ No newline at end of file + const outPath = OUTPUT_DIR + '/no-extends/'; + const s = (str) => FIXTURE_DIR + str; + await codegen({ + contracts: [ + s('/vectis/factory'), + s('/minter'), + s('/daodao/cw-admin-factory'), + s('/daodao/cw-code-id-registry'), + { + name: 'CwSingle', + dir: s('/daodao/cw-proposal-single') + } + ], + outPath, + options: { + bundle: { + bundleFile: 'index.ts', + scope: 'smart.contracts' + }, + types: { + enabled: true + }, + client: { + enabled: true, + execExtendsQuery: false + }, + reactQuery: { + enabled: true + }, + recoil: { + enabled: true + }, + messageComposer: { + enabled: true + } + } + }); +}); + +it('builder set bundler path', async () => { + const outPath = OUTPUT_DIR + '/bundler_test/contracts'; + const bundlerPath = OUTPUT_DIR + '/bundler_test/'; + const s = (str) => FIXTURE_DIR + str; + await codegen({ + contracts: [ + s('/vectis/factory'), + s('/minter'), + s('/daodao/cw-admin-factory'), + s('/daodao/cw-code-id-registry'), + { + name: 'CwSingle', + dir: s('/daodao/cw-proposal-single') + } + ], + outPath, + options: { + bundle: { + bundlePath: bundlerPath, + bundleFile: 'index.ts', + scope: 'smart.contracts' + }, + types: { + enabled: true + }, + client: { + enabled: true, + execExtendsQuery: false + }, + reactQuery: { + enabled: true + }, + recoil: { + enabled: true + }, + messageComposer: { + enabled: true + } + } + }); +}); diff --git a/packages/ts-codegen/src/builder/builder.ts b/packages/ts-codegen/src/builder/builder.ts index c4ae7739..2a276f53 100644 --- a/packages/ts-codegen/src/builder/builder.ts +++ b/packages/ts-codegen/src/builder/builder.ts @@ -1,9 +1,9 @@ -import { RenderOptions, defaultOptions } from "wasm-ast-types"; +import { RenderOptions, defaultOptions } from 'wasm-ast-types'; import { header } from '../utils/header'; -import { join } from "path"; +import { join } from 'path'; import { writeFileSync } from 'fs'; -import { sync as mkdirp } from "mkdirp"; +import { sync as mkdirp } from 'mkdirp'; import generateMessageComposer from '../generators/message-composer'; import generateTypes from '../generators/types'; @@ -15,180 +15,202 @@ import { basename } from 'path'; import { readSchemas } from '../utils'; import deepmerge from 'deepmerge'; -import { pascal } from "case"; -import { createFileBundle, recursiveModuleBundle } from "../bundler"; +import { pascal } from 'case'; +import { createFileBundle, recursiveModuleBundle } from '../bundler'; import generate from '@babel/generator'; import * as t from '@babel/types'; const defaultOpts: TSBuilderOptions = { - bundle: { - enabled: true, - scope: 'contracts', - bundleFile: 'bundle.ts' - } -} + bundle: { + enabled: true, + scope: 'contracts', + bundleFile: 'bundle.ts' + } +}; export interface TSBuilderInput { - contracts: Array; - outPath: string; - options?: TSBuilderOptions; -}; + contracts: Array; + outPath: string; + options?: TSBuilderOptions; +} export interface BundleOptions { - enabled?: boolean; - scope?: string; - bundleFile?: string; -}; + enabled?: boolean; + scope?: string; + bundleFile?: string; + bundlePath?: string; +} export type TSBuilderOptions = { - bundle?: BundleOptions; + bundle?: BundleOptions; } & RenderOptions; export interface BuilderFile { - type: 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer'; - contract: string; - localname: string; - filename: string; -}; + type: 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer'; + contract: string; + localname: string; + filename: string; +} export interface ContractFile { - name: string; - dir: string; + name: string; + dir: string; } export class TSBuilder { - contracts: Array; - outPath: string; - options?: TSBuilderOptions; - - protected files: BuilderFile[] = []; - - constructor({ contracts, outPath, options }: TSBuilderInput) { - this.contracts = contracts; - this.outPath = outPath; - this.options = deepmerge( - deepmerge( - defaultOptions, - defaultOpts - ), - options ?? {} - ); - } - - getContracts(): ContractFile[] { - return this.contracts.map(contractOpt => { - if (typeof contractOpt === 'string') { - const name = basename(contractOpt); - const contractName = pascal(name); - return { - name: contractName, - dir: contractOpt - } - } - return { - name: pascal(contractOpt.name), - dir: contractOpt.dir - }; - }); - } - - async renderTypes(contract: ContractFile) { - const { enabled, ...options } = this.options.types; - if (!enabled) return; - const contractInfo = await readSchemas({ - schemaDir: contract.dir - }); - const files = await generateTypes(contract.name, contractInfo, this.outPath, options); - [].push.apply(this.files, files); - } - - async renderClient(contract: ContractFile) { - const { enabled, ...options } = this.options.client; - if (!enabled) return; - const contractInfo = await readSchemas({ - schemaDir: contract.dir - }); - const files = await generateClient(contract.name, contractInfo, this.outPath, options); - [].push.apply(this.files, files); - } - - async renderRecoil(contract: ContractFile) { - const { enabled, ...options } = this.options.recoil; - if (!enabled) return; - const contractInfo = await readSchemas({ - schemaDir: contract.dir - }); - const files = await generateRecoil(contract.name, contractInfo, this.outPath, options); - [].push.apply(this.files, files); + contracts: Array; + outPath: string; + options?: TSBuilderOptions; + + protected files: BuilderFile[] = []; + + constructor({ contracts, outPath, options }: TSBuilderInput) { + this.contracts = contracts; + this.outPath = outPath; + this.options = deepmerge( + deepmerge(defaultOptions, defaultOpts), + options ?? {} + ); + } + + getContracts(): ContractFile[] { + return this.contracts.map((contractOpt) => { + if (typeof contractOpt === 'string') { + const name = basename(contractOpt); + const contractName = pascal(name); + return { + name: contractName, + dir: contractOpt + }; + } + return { + name: pascal(contractOpt.name), + dir: contractOpt.dir + }; + }); + } + + async renderTypes(contract: ContractFile) { + const { enabled, ...options } = this.options.types; + if (!enabled) return; + const contractInfo = await readSchemas({ + schemaDir: contract.dir + }); + const files = await generateTypes( + contract.name, + contractInfo, + this.outPath, + options + ); + [].push.apply(this.files, files); + } + + async renderClient(contract: ContractFile) { + const { enabled, ...options } = this.options.client; + if (!enabled) return; + const contractInfo = await readSchemas({ + schemaDir: contract.dir + }); + const files = await generateClient( + contract.name, + contractInfo, + this.outPath, + options + ); + [].push.apply(this.files, files); + } + + async renderRecoil(contract: ContractFile) { + const { enabled, ...options } = this.options.recoil; + if (!enabled) return; + const contractInfo = await readSchemas({ + schemaDir: contract.dir + }); + const files = await generateRecoil( + contract.name, + contractInfo, + this.outPath, + options + ); + [].push.apply(this.files, files); + } + + async renderReactQuery(contract: ContractFile) { + const { enabled, ...options } = this.options.reactQuery; + if (!enabled) return; + const contractInfo = await readSchemas({ + schemaDir: contract.dir + }); + const files = await generateReactQuery( + contract.name, + contractInfo, + this.outPath, + options + ); + [].push.apply(this.files, files); + } + + async renderMessageComposer(contract: ContractFile) { + const { enabled, ...options } = this.options.messageComposer; + if (!enabled) return; + const contractInfo = await readSchemas({ + schemaDir: contract.dir + }); + const files = await generateMessageComposer( + contract.name, + contractInfo, + this.outPath, + options + ); + [].push.apply(this.files, files); + } + + async build() { + const contracts = this.getContracts(); + for (let c = 0; c < contracts.length; c++) { + const contract = contracts[c]; + await this.renderTypes(contract); + await this.renderClient(contract); + await this.renderMessageComposer(contract); + await this.renderReactQuery(contract); + await this.renderRecoil(contract); } - - async renderReactQuery(contract: ContractFile) { - const { enabled, ...options } = this.options.reactQuery; - if (!enabled) return; - const contractInfo = await readSchemas({ - schemaDir: contract.dir - }); - const files = await generateReactQuery(contract.name, contractInfo, this.outPath, options); - [].push.apply(this.files, files); - } - - async renderMessageComposer(contract: ContractFile) { - const { enabled, ...options } = this.options.messageComposer; - if (!enabled) return; - const contractInfo = await readSchemas({ - schemaDir: contract.dir - }); - const files = await generateMessageComposer(contract.name, contractInfo, this.outPath, options); - [].push.apply(this.files, files); - } - - async build() { - const contracts = this.getContracts(); - for (let c = 0; c < contracts.length; c++) { - const contract = contracts[c]; - await this.renderTypes(contract); - await this.renderClient(contract); - await this.renderMessageComposer(contract); - await this.renderReactQuery(contract); - await this.renderRecoil(contract); - } - if (this.options.bundle.enabled) { - this.bundle(); - } + if (this.options.bundle.enabled) { + this.bundle(); } - - async bundle() { - - const allFiles = this.files; - - const bundleFile = this.options.bundle.bundleFile; - const bundleVariables = {}; - const importPaths = []; - - allFiles.forEach(file => { - createFileBundle( - `${this.options.bundle.scope}.${file.contract}`, - file.localname, - bundleFile, - importPaths, - bundleVariables - ); - - }); - - const ast = recursiveModuleBundle(bundleVariables); - let code = generate(t.program( - [ - ...importPaths, - ...ast - ] - )).code; - - mkdirp(this.outPath); - - if (code.trim() === '') code = 'export {};' - - writeFileSync(join(this.outPath, bundleFile), header + code); - - } -} \ No newline at end of file + } + + async bundle() { + const allFiles = this.files; + + const bundleFile = this.options.bundle.bundleFile; + const bundlePath = join( + this.options?.bundle?.bundlePath ?? this.outPath, + bundleFile + ); + const bundleVariables = {}; + const importPaths = []; + + allFiles.forEach((file) => { + createFileBundle( + `${this.options.bundle.scope}.${file.contract}`, + file.filename, + bundlePath, + importPaths, + bundleVariables + ); + }); + + const ast = recursiveModuleBundle(bundleVariables); + let code = generate(t.program([...importPaths, ...ast])).code; + + mkdirp(this.outPath); + + if (code.trim() === '') code = 'export {};'; + + writeFileSync( + bundlePath, + header + code + ); + } +} diff --git a/packages/ts-codegen/types/src/builder/builder.d.ts b/packages/ts-codegen/types/src/builder/builder.d.ts index 70939b47..b9c6aaf9 100644 --- a/packages/ts-codegen/types/src/builder/builder.d.ts +++ b/packages/ts-codegen/types/src/builder/builder.d.ts @@ -1,4 +1,4 @@ -import { RenderOptions } from "wasm-ast-types"; +import { RenderOptions } from 'wasm-ast-types'; export interface TSBuilderInput { contracts: Array; outPath: string; @@ -8,8 +8,9 @@ export interface BundleOptions { enabled?: boolean; scope?: string; bundleFile?: string; + bundlePath?: string; } -export declare type TSBuilderOptions = { +export type TSBuilderOptions = { bundle?: BundleOptions; } & RenderOptions; export interface BuilderFile { From 7482490871cb24131a5f337703c4e0b491d7eb4b Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Mon, 6 Mar 2023 13:49:02 +0800 Subject: [PATCH 093/287] fix format --- packages/ts-codegen/__tests__/builder.test.ts | 344 ++++++++--------- packages/ts-codegen/src/builder/builder.ts | 347 +++++++++--------- 2 files changed, 339 insertions(+), 352 deletions(-) diff --git a/packages/ts-codegen/__tests__/builder.test.ts b/packages/ts-codegen/__tests__/builder.test.ts index 8e26e23c..f23f9f14 100644 --- a/packages/ts-codegen/__tests__/builder.test.ts +++ b/packages/ts-codegen/__tests__/builder.test.ts @@ -5,189 +5,193 @@ const FIXTURE_DIR = __dirname + '/../../../__fixtures__'; const OUTPUT_DIR = __dirname + '/../../../__output__/builder'; it('options undefined', async () => { - const outPath = OUTPUT_DIR + '/vectis/factory-opt'; - const schemaDir = FIXTURE_DIR + '/vectis/factory/'; - const builder = new TSBuilder({ - contracts: [schemaDir], - outPath, - options: undefined - }); - delete builder.contracts; - delete builder.outPath; - expect(builder).toMatchSnapshot(); + const outPath = OUTPUT_DIR + '/vectis/factory-opt'; + const schemaDir = FIXTURE_DIR + '/vectis/factory/'; + const builder = new TSBuilder({ + contracts: [ + schemaDir + ], + outPath, + options: undefined + }); + delete builder.contracts; + delete builder.outPath; + expect(builder).toMatchSnapshot(); }); it('options tsClient.enabled', async () => { - const outPath = OUTPUT_DIR + '/vectis/factory-opt'; - const schemaDir = FIXTURE_DIR + '/vectis/factory/'; - const builder = new TSBuilder({ - contracts: [schemaDir], - outPath, - options: { - types: { - enabled: true - }, - client: { - enabled: true - }, - reactQuery: { - enabled: true - } - } - }); - delete builder.contracts; - delete builder.outPath; - expect(builder).toMatchSnapshot(); + const outPath = OUTPUT_DIR + '/vectis/factory-opt'; + const schemaDir = FIXTURE_DIR + '/vectis/factory/'; + const builder = new TSBuilder({ + contracts: [ + schemaDir + ], + outPath, + options: { + types: { + enabled: true + }, + client: { + enabled: true + }, + reactQuery: { + enabled: true + } + } + }); + delete builder.contracts; + delete builder.outPath; + expect(builder).toMatchSnapshot(); }); it('builder invoke', async () => { - const outPath = OUTPUT_DIR + '/invoke/'; - const s = (str) => FIXTURE_DIR + str; - const builder = new TSBuilder({ - contracts: [ - s('/vectis/factory'), - s('/minter'), - s('/daodao/cw-admin-factory'), - s('/daodao/cw-code-id-registry'), - { - name: 'CwSingle', - dir: s('/daodao/cw-proposal-single') - } - ], - outPath, - options: { - types: { - enabled: true - }, - client: { - enabled: true - }, - reactQuery: { - enabled: true - } - } - }); - await builder.build(); + const outPath = OUTPUT_DIR + '/invoke/'; + const s = (str) => FIXTURE_DIR + str; + const builder = new TSBuilder({ + contracts: [ + s('/vectis/factory'), + s('/minter'), + s('/daodao/cw-admin-factory'), + s('/daodao/cw-code-id-registry'), + { + name: 'CwSingle', + dir: s('/daodao/cw-proposal-single') + } + ], + outPath, + options: { + types: { + enabled: true + }, + client: { + enabled: true + }, + reactQuery: { + enabled: true + } + } + }); + await builder.build(); }); it('builder default', async () => { - const outPath = OUTPUT_DIR + '/default/'; - const s = (str) => FIXTURE_DIR + str; - await codegen({ - contracts: [ - s('/vectis/factory'), - s('/minter'), - s('/daodao/cw-admin-factory'), - s('/daodao/cw-code-id-registry'), - { - name: 'CwSingle', - dir: s('/daodao/cw-proposal-single') - } - ], - outPath, - options: { - bundle: { - bundleFile: 'index.ts', - scope: 'smart.contracts' - }, - types: { - enabled: true - }, - client: { - enabled: true, - execExtendsQuery: true - }, - reactQuery: { - enabled: true - }, - recoil: { - enabled: true - }, - messageComposer: { - enabled: true - } - } - }); + const outPath = OUTPUT_DIR + '/default/'; + const s = (str) => FIXTURE_DIR + str; + await codegen({ + contracts: [ + s('/vectis/factory'), + s('/minter'), + s('/daodao/cw-admin-factory'), + s('/daodao/cw-code-id-registry'), + { + name: 'CwSingle', + dir: s('/daodao/cw-proposal-single') + } + ], + outPath, + options: { + bundle: { + bundleFile: 'index.ts', + scope: 'smart.contracts' + }, + types: { + enabled: true + }, + client: { + enabled: true, + execExtendsQuery: true + }, + reactQuery: { + enabled: true + }, + recoil: { + enabled: true + }, + messageComposer: { + enabled: true + } + } + }); }); it('builder no extends', async () => { - const outPath = OUTPUT_DIR + '/no-extends/'; - const s = (str) => FIXTURE_DIR + str; - await codegen({ - contracts: [ - s('/vectis/factory'), - s('/minter'), - s('/daodao/cw-admin-factory'), - s('/daodao/cw-code-id-registry'), - { - name: 'CwSingle', - dir: s('/daodao/cw-proposal-single') - } - ], - outPath, - options: { - bundle: { - bundleFile: 'index.ts', - scope: 'smart.contracts' - }, - types: { - enabled: true - }, - client: { - enabled: true, - execExtendsQuery: false - }, - reactQuery: { - enabled: true - }, - recoil: { - enabled: true - }, - messageComposer: { - enabled: true - } - } - }); + const outPath = OUTPUT_DIR + '/no-extends/'; + const s = (str) => FIXTURE_DIR + str; + await codegen({ + contracts: [ + s('/vectis/factory'), + s('/minter'), + s('/daodao/cw-admin-factory'), + s('/daodao/cw-code-id-registry'), + { + name: 'CwSingle', + dir: s('/daodao/cw-proposal-single') + } + ], + outPath, + options: { + bundle: { + bundleFile: 'index.ts', + scope: 'smart.contracts' + }, + types: { + enabled: true + }, + client: { + enabled: true, + execExtendsQuery: false + }, + reactQuery: { + enabled: true + }, + recoil: { + enabled: true + }, + messageComposer: { + enabled: true + } + } + }); }); it('builder set bundler path', async () => { - const outPath = OUTPUT_DIR + '/bundler_test/contracts'; - const bundlerPath = OUTPUT_DIR + '/bundler_test/'; - const s = (str) => FIXTURE_DIR + str; - await codegen({ - contracts: [ - s('/vectis/factory'), - s('/minter'), - s('/daodao/cw-admin-factory'), - s('/daodao/cw-code-id-registry'), - { - name: 'CwSingle', - dir: s('/daodao/cw-proposal-single') - } - ], - outPath, - options: { - bundle: { - bundlePath: bundlerPath, - bundleFile: 'index.ts', - scope: 'smart.contracts' - }, - types: { - enabled: true - }, - client: { - enabled: true, - execExtendsQuery: false - }, - reactQuery: { - enabled: true - }, - recoil: { - enabled: true - }, - messageComposer: { - enabled: true - } - } - }); + const outPath = OUTPUT_DIR + '/bundler_test/contracts'; + const bundlerPath = OUTPUT_DIR + '/bundler_test/'; + const s = (str) => FIXTURE_DIR + str; + await codegen({ + contracts: [ + s('/vectis/factory'), + s('/minter'), + s('/daodao/cw-admin-factory'), + s('/daodao/cw-code-id-registry'), + { + name: 'CwSingle', + dir: s('/daodao/cw-proposal-single') + } + ], + outPath, + options: { + bundle: { + bundlePath: bundlerPath, + bundleFile: 'index.ts', + scope: 'smart.contracts' + }, + types: { + enabled: true + }, + client: { + enabled: true, + execExtendsQuery: false + }, + reactQuery: { + enabled: true + }, + recoil: { + enabled: true + }, + messageComposer: { + enabled: true + } + } + }); }); diff --git a/packages/ts-codegen/src/builder/builder.ts b/packages/ts-codegen/src/builder/builder.ts index 2a276f53..5d5a3e5d 100644 --- a/packages/ts-codegen/src/builder/builder.ts +++ b/packages/ts-codegen/src/builder/builder.ts @@ -1,9 +1,9 @@ -import { RenderOptions, defaultOptions } from 'wasm-ast-types'; +import { RenderOptions, defaultOptions } from "wasm-ast-types"; import { header } from '../utils/header'; -import { join } from 'path'; +import { join } from "path"; import { writeFileSync } from 'fs'; -import { sync as mkdirp } from 'mkdirp'; +import { sync as mkdirp } from "mkdirp"; import generateMessageComposer from '../generators/message-composer'; import generateTypes from '../generators/types'; @@ -15,202 +15,185 @@ import { basename } from 'path'; import { readSchemas } from '../utils'; import deepmerge from 'deepmerge'; -import { pascal } from 'case'; -import { createFileBundle, recursiveModuleBundle } from '../bundler'; +import { pascal } from "case"; +import { createFileBundle, recursiveModuleBundle } from "../bundler"; import generate from '@babel/generator'; import * as t from '@babel/types'; const defaultOpts: TSBuilderOptions = { - bundle: { - enabled: true, - scope: 'contracts', - bundleFile: 'bundle.ts' - } -}; + bundle: { + enabled: true, + scope: 'contracts', + bundleFile: 'bundle.ts' + } +} export interface TSBuilderInput { - contracts: Array; - outPath: string; - options?: TSBuilderOptions; -} + contracts: Array; + outPath: string; + options?: TSBuilderOptions; +}; export interface BundleOptions { - enabled?: boolean; - scope?: string; - bundleFile?: string; - bundlePath?: string; -} + enabled?: boolean; + scope?: string; + bundleFile?: string; + bundlePath?: string; +}; export type TSBuilderOptions = { - bundle?: BundleOptions; + bundle?: BundleOptions; } & RenderOptions; export interface BuilderFile { - type: 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer'; - contract: string; - localname: string; - filename: string; -} + type: 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer'; + contract: string; + localname: string; + filename: string; +}; export interface ContractFile { - name: string; - dir: string; + name: string; + dir: string; } export class TSBuilder { - contracts: Array; - outPath: string; - options?: TSBuilderOptions; - - protected files: BuilderFile[] = []; - - constructor({ contracts, outPath, options }: TSBuilderInput) { - this.contracts = contracts; - this.outPath = outPath; - this.options = deepmerge( - deepmerge(defaultOptions, defaultOpts), - options ?? {} - ); - } - - getContracts(): ContractFile[] { - return this.contracts.map((contractOpt) => { - if (typeof contractOpt === 'string') { - const name = basename(contractOpt); - const contractName = pascal(name); - return { - name: contractName, - dir: contractOpt - }; - } - return { - name: pascal(contractOpt.name), - dir: contractOpt.dir - }; - }); - } - - async renderTypes(contract: ContractFile) { - const { enabled, ...options } = this.options.types; - if (!enabled) return; - const contractInfo = await readSchemas({ - schemaDir: contract.dir - }); - const files = await generateTypes( - contract.name, - contractInfo, - this.outPath, - options - ); - [].push.apply(this.files, files); - } - - async renderClient(contract: ContractFile) { - const { enabled, ...options } = this.options.client; - if (!enabled) return; - const contractInfo = await readSchemas({ - schemaDir: contract.dir - }); - const files = await generateClient( - contract.name, - contractInfo, - this.outPath, - options - ); - [].push.apply(this.files, files); - } - - async renderRecoil(contract: ContractFile) { - const { enabled, ...options } = this.options.recoil; - if (!enabled) return; - const contractInfo = await readSchemas({ - schemaDir: contract.dir - }); - const files = await generateRecoil( - contract.name, - contractInfo, - this.outPath, - options - ); - [].push.apply(this.files, files); - } - - async renderReactQuery(contract: ContractFile) { - const { enabled, ...options } = this.options.reactQuery; - if (!enabled) return; - const contractInfo = await readSchemas({ - schemaDir: contract.dir - }); - const files = await generateReactQuery( - contract.name, - contractInfo, - this.outPath, - options - ); - [].push.apply(this.files, files); - } - - async renderMessageComposer(contract: ContractFile) { - const { enabled, ...options } = this.options.messageComposer; - if (!enabled) return; - const contractInfo = await readSchemas({ - schemaDir: contract.dir - }); - const files = await generateMessageComposer( - contract.name, - contractInfo, - this.outPath, - options - ); - [].push.apply(this.files, files); - } - - async build() { - const contracts = this.getContracts(); - for (let c = 0; c < contracts.length; c++) { - const contract = contracts[c]; - await this.renderTypes(contract); - await this.renderClient(contract); - await this.renderMessageComposer(contract); - await this.renderReactQuery(contract); - await this.renderRecoil(contract); + contracts: Array; + outPath: string; + options?: TSBuilderOptions; + + protected files: BuilderFile[] = []; + + constructor({ contracts, outPath, options }: TSBuilderInput) { + this.contracts = contracts; + this.outPath = outPath; + this.options = deepmerge( + deepmerge( + defaultOptions, + defaultOpts + ), + options ?? {} + ); } - if (this.options.bundle.enabled) { - this.bundle(); + + getContracts(): ContractFile[] { + return this.contracts.map(contractOpt => { + if (typeof contractOpt === 'string') { + const name = basename(contractOpt); + const contractName = pascal(name); + return { + name: contractName, + dir: contractOpt + } + } + return { + name: pascal(contractOpt.name), + dir: contractOpt.dir + }; + }); } - } - - async bundle() { - const allFiles = this.files; - - const bundleFile = this.options.bundle.bundleFile; - const bundlePath = join( - this.options?.bundle?.bundlePath ?? this.outPath, - bundleFile - ); - const bundleVariables = {}; - const importPaths = []; - - allFiles.forEach((file) => { - createFileBundle( - `${this.options.bundle.scope}.${file.contract}`, - file.filename, - bundlePath, - importPaths, - bundleVariables - ); - }); - - const ast = recursiveModuleBundle(bundleVariables); - let code = generate(t.program([...importPaths, ...ast])).code; - - mkdirp(this.outPath); - - if (code.trim() === '') code = 'export {};'; - - writeFileSync( - bundlePath, - header + code - ); - } -} + + async renderTypes(contract: ContractFile) { + const { enabled, ...options } = this.options.types; + if (!enabled) return; + const contractInfo = await readSchemas({ + schemaDir: contract.dir + }); + const files = await generateTypes(contract.name, contractInfo, this.outPath, options); + [].push.apply(this.files, files); + } + + async renderClient(contract: ContractFile) { + const { enabled, ...options } = this.options.client; + if (!enabled) return; + const contractInfo = await readSchemas({ + schemaDir: contract.dir + }); + const files = await generateClient(contract.name, contractInfo, this.outPath, options); + [].push.apply(this.files, files); + } + + async renderRecoil(contract: ContractFile) { + const { enabled, ...options } = this.options.recoil; + if (!enabled) return; + const contractInfo = await readSchemas({ + schemaDir: contract.dir + }); + const files = await generateRecoil(contract.name, contractInfo, this.outPath, options); + [].push.apply(this.files, files); + } + + async renderReactQuery(contract: ContractFile) { + const { enabled, ...options } = this.options.reactQuery; + if (!enabled) return; + const contractInfo = await readSchemas({ + schemaDir: contract.dir + }); + const files = await generateReactQuery(contract.name, contractInfo, this.outPath, options); + [].push.apply(this.files, files); + } + + async renderMessageComposer(contract: ContractFile) { + const { enabled, ...options } = this.options.messageComposer; + if (!enabled) return; + const contractInfo = await readSchemas({ + schemaDir: contract.dir + }); + const files = await generateMessageComposer(contract.name, contractInfo, this.outPath, options); + [].push.apply(this.files, files); + } + + async build() { + const contracts = this.getContracts(); + for (let c = 0; c < contracts.length; c++) { + const contract = contracts[c]; + await this.renderTypes(contract); + await this.renderClient(contract); + await this.renderMessageComposer(contract); + await this.renderReactQuery(contract); + await this.renderRecoil(contract); + } + if (this.options.bundle.enabled) { + this.bundle(); + } + } + + async bundle() { + + const allFiles = this.files; + + const bundleFile = this.options.bundle.bundleFile; + const bundlePath = join( + this.options?.bundle?.bundlePath ?? this.outPath, + bundleFile + ); + const bundleVariables = {}; + const importPaths = []; + + allFiles.forEach(file => { + createFileBundle( + `${this.options.bundle.scope}.${file.contract}`, + file.filename, + bundlePath, + importPaths, + bundleVariables + ); + + }); + + const ast = recursiveModuleBundle(bundleVariables); + let code = generate(t.program( + [ + ...importPaths, + ...ast + ] + )).code; + + mkdirp(this.outPath); + + if (code.trim() === '') code = 'export {};' + + writeFileSync(bundlePath, header + code); + + } +} \ No newline at end of file From 01c9c9d14027ed324b017a2b3123ae8144a24dde Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Mon, 6 Mar 2023 13:56:09 +0800 Subject: [PATCH 094/287] mkdir for bundle path --- packages/ts-codegen/src/builder/builder.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/ts-codegen/src/builder/builder.ts b/packages/ts-codegen/src/builder/builder.ts index 5d5a3e5d..640c89fe 100644 --- a/packages/ts-codegen/src/builder/builder.ts +++ b/packages/ts-codegen/src/builder/builder.ts @@ -189,6 +189,10 @@ export class TSBuilder { ] )).code; + if(this.options?.bundle?.bundlePath){ + mkdirp(this.options?.bundle?.bundlePath); + } + mkdirp(this.outPath); if (code.trim() === '') code = 'export {};' From 02ee56dce1e443466144485b146cac37b8769f51 Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Sun, 1 Jan 2023 18:48:47 +0100 Subject: [PATCH 095/287] Implement an entry point message builder --- .yarnrc.yml | 3 + .../default/CwAdminFactory.msg-builder.ts | 26 ++ .../default/CwCodeIdRegistry.msg-builder.ts | 146 ++++++++++ .../builder/default/CwSingle.msg-builder.ts | 232 +++++++++++++++ .../builder/default/Factory.msg-builder.ts | 154 ++++++++++ .../builder/default/Minter.msg-builder.ts | 104 +++++++ __output__/builder/default/index.ts | 86 +++--- .../no-extends/CwAdminFactory.msg-builder.ts | 26 ++ .../CwCodeIdRegistry.msg-builder.ts | 146 ++++++++++ .../no-extends/CwSingle.msg-builder.ts | 232 +++++++++++++++ .../builder/no-extends/Factory.msg-builder.ts | 154 ++++++++++ .../builder/no-extends/Minter.msg-builder.ts | 104 +++++++ __output__/builder/no-extends/index.ts | 100 ++++--- .../__snapshots__/builder.test.ts.snap | 6 + packages/ts-codegen/__tests__/builder.test.ts | 8 +- packages/ts-codegen/src/builder/builder.ts | 16 +- packages/ts-codegen/src/commands/generate.ts | 3 + .../ts-codegen/src/generators/msg-builder.ts | 78 +++++ .../ts-codegen/types/src/builder/builder.d.ts | 3 +- .../types/src/generators/msg-builder.ts | 5 + .../wasm-ast-types/src/context/context.ts | 7 + packages/wasm-ast-types/src/index.ts | 3 +- .../__snapshots__/msg-builder.spec.ts.snap | 270 ++++++++++++++++++ .../wasm-ast-types/src/msg-builder/index.ts | 1 + .../src/msg-builder/msg-builder.spec.ts | 18 ++ .../src/msg-builder/msg-builder.ts | 76 +++++ packages/wasm-ast-types/src/utils/babel.ts | 11 + .../wasm-ast-types/types/context/context.d.ts | 4 + packages/wasm-ast-types/types/index.d.ts | 1 + .../types/msg-builder/index.d.ts | 1 + .../types/msg-builder/msg-builder.d.ts | 5 + 31 files changed, 1941 insertions(+), 88 deletions(-) create mode 100644 .yarnrc.yml create mode 100644 __output__/builder/default/CwAdminFactory.msg-builder.ts create mode 100644 __output__/builder/default/CwCodeIdRegistry.msg-builder.ts create mode 100644 __output__/builder/default/CwSingle.msg-builder.ts create mode 100644 __output__/builder/default/Factory.msg-builder.ts create mode 100644 __output__/builder/default/Minter.msg-builder.ts create mode 100644 __output__/builder/no-extends/CwAdminFactory.msg-builder.ts create mode 100644 __output__/builder/no-extends/CwCodeIdRegistry.msg-builder.ts create mode 100644 __output__/builder/no-extends/CwSingle.msg-builder.ts create mode 100644 __output__/builder/no-extends/Factory.msg-builder.ts create mode 100644 __output__/builder/no-extends/Minter.msg-builder.ts create mode 100644 packages/ts-codegen/src/generators/msg-builder.ts create mode 100644 packages/ts-codegen/types/src/generators/msg-builder.ts create mode 100644 packages/wasm-ast-types/src/msg-builder/__snapshots__/msg-builder.spec.ts.snap create mode 100644 packages/wasm-ast-types/src/msg-builder/index.ts create mode 100644 packages/wasm-ast-types/src/msg-builder/msg-builder.spec.ts create mode 100644 packages/wasm-ast-types/src/msg-builder/msg-builder.ts create mode 100644 packages/wasm-ast-types/types/msg-builder/index.d.ts create mode 100644 packages/wasm-ast-types/types/msg-builder/msg-builder.d.ts diff --git a/.yarnrc.yml b/.yarnrc.yml new file mode 100644 index 00000000..8d823cc3 --- /dev/null +++ b/.yarnrc.yml @@ -0,0 +1,3 @@ +enableGlobalCache: true + +nodeLinker: node-modules diff --git a/__output__/builder/default/CwAdminFactory.msg-builder.ts b/__output__/builder/default/CwAdminFactory.msg-builder.ts new file mode 100644 index 00000000..776222d0 --- /dev/null +++ b/__output__/builder/default/CwAdminFactory.msg-builder.ts @@ -0,0 +1,26 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; +export abstract class CwAdminFactoryExecuteMsgBuilder { + static instantiateContractWithSelfAdmin = ({ + codeId, + instantiateMsg, + label + }: { + codeId: number; + instantiateMsg: Binary; + label: string; + }): ExecuteMsg => { + return { + instantiate_contract_with_self_admin: ({ + code_id: codeId, + instantiate_msg: instantiateMsg, + label + } as const) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/default/CwCodeIdRegistry.msg-builder.ts b/__output__/builder/default/CwCodeIdRegistry.msg-builder.ts new file mode 100644 index 00000000..d9388c55 --- /dev/null +++ b/__output__/builder/default/CwCodeIdRegistry.msg-builder.ts @@ -0,0 +1,146 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; +export abstract class CwCodeIdRegistryExecuteMsgBuilder { + static receive = ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static register = ({ + chainId, + checksum, + codeId, + name, + version + }: { + chainId: string; + checksum: string; + codeId: number; + name: string; + version: string; + }): ExecuteMsg => { + return { + register: ({ + chain_id: chainId, + checksum, + code_id: codeId, + name, + version + } as const) + }; + }; + static setOwner = ({ + chainId, + name, + owner + }: { + chainId: string; + name: string; + owner?: string; + }): ExecuteMsg => { + return { + set_owner: ({ + chain_id: chainId, + name, + owner + } as const) + }; + }; + static unregister = ({ + chainId, + codeId + }: { + chainId: string; + codeId: number; + }): ExecuteMsg => { + return { + unregister: ({ + chain_id: chainId, + code_id: codeId + } as const) + }; + }; + static updateConfig = ({ + admin, + paymentInfo + }: { + admin?: string; + paymentInfo?: PaymentInfo; + }): ExecuteMsg => { + return { + update_config: ({ + admin, + payment_info: paymentInfo + } as const) + }; + }; +} +export abstract class CwCodeIdRegistryQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static getRegistration = ({ + chainId, + name, + version + }: { + chainId: string; + name: string; + version?: string; + }): QueryMsg => { + return { + get_registration: ({ + chain_id: chainId, + name, + version + } as const) + }; + }; + static infoForCodeId = ({ + chainId, + codeId + }: { + chainId: string; + codeId: number; + }): QueryMsg => { + return { + info_for_code_id: ({ + chain_id: chainId, + code_id: codeId + } as const) + }; + }; + static listRegistrations = ({ + chainId, + name + }: { + chainId: string; + name: string; + }): QueryMsg => { + return { + list_registrations: ({ + chain_id: chainId, + name + } as const) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/default/CwSingle.msg-builder.ts b/__output__/builder/default/CwSingle.msg-builder.ts new file mode 100644 index 00000000..9a0e73fb --- /dev/null +++ b/__output__/builder/default/CwSingle.msg-builder.ts @@ -0,0 +1,232 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; +export abstract class CwSingleExecuteMsgBuilder { + static propose = ({ + description, + msgs, + title + }: { + description: string; + msgs: CosmosMsgForEmpty[]; + title: string; + }): ExecuteMsg => { + return { + propose: ({ + description, + msgs, + title + } as const) + }; + }; + static vote = ({ + proposalId, + vote + }: { + proposalId: number; + vote: Vote; + }): ExecuteMsg => { + return { + vote: ({ + proposal_id: proposalId, + vote + } as const) + }; + }; + static execute = ({ + proposalId + }: { + proposalId: number; + }): ExecuteMsg => { + return { + execute: ({ + proposal_id: proposalId + } as const) + }; + }; + static close = ({ + proposalId + }: { + proposalId: number; + }): ExecuteMsg => { + return { + close: ({ + proposal_id: proposalId + } as const) + }; + }; + static updateConfig = ({ + allowRevoting, + dao, + depositInfo, + maxVotingPeriod, + minVotingPeriod, + onlyMembersExecute, + threshold + }: { + allowRevoting: boolean; + dao: string; + depositInfo?: DepositInfo; + maxVotingPeriod: Duration; + minVotingPeriod?: Duration; + onlyMembersExecute: boolean; + threshold: Threshold; + }): ExecuteMsg => { + return { + update_config: ({ + allow_revoting: allowRevoting, + dao, + deposit_info: depositInfo, + max_voting_period: maxVotingPeriod, + min_voting_period: minVotingPeriod, + only_members_execute: onlyMembersExecute, + threshold + } as const) + }; + }; + static addProposalHook = ({ + address + }: { + address: string; + }): ExecuteMsg => { + return { + add_proposal_hook: ({ + address + } as const) + }; + }; + static removeProposalHook = ({ + address + }: { + address: string; + }): ExecuteMsg => { + return { + remove_proposal_hook: ({ + address + } as const) + }; + }; + static addVoteHook = ({ + address + }: { + address: string; + }): ExecuteMsg => { + return { + add_vote_hook: ({ + address + } as const) + }; + }; + static removeVoteHook = ({ + address + }: { + address: string; + }): ExecuteMsg => { + return { + remove_vote_hook: ({ + address + } as const) + }; + }; +} +export abstract class CwSingleQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static proposal = ({ + proposalId + }: { + proposalId: number; + }): QueryMsg => { + return { + proposal: ({ + proposal_id: proposalId + } as const) + }; + }; + static listProposals = ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }): QueryMsg => { + return { + list_proposals: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static reverseProposals = ({ + limit, + startBefore + }: { + limit?: number; + startBefore?: number; + }): QueryMsg => { + return { + reverse_proposals: ({ + limit, + start_before: startBefore + } as const) + }; + }; + static proposalCount = (): QueryMsg => { + return { + proposal_count: ({} as const) + }; + }; + static vote = ({ + proposalId, + voter + }: { + proposalId: number; + voter: string; + }): QueryMsg => { + return { + vote: ({ + proposal_id: proposalId, + voter + } as const) + }; + }; + static listVotes = ({ + limit, + proposalId, + startAfter + }: { + limit?: number; + proposalId: number; + startAfter?: string; + }): QueryMsg => { + return { + list_votes: ({ + limit, + proposal_id: proposalId, + start_after: startAfter + } as const) + }; + }; + static proposalHooks = (): QueryMsg => { + return { + proposal_hooks: ({} as const) + }; + }; + static voteHooks = (): QueryMsg => { + return { + vote_hooks: ({} as const) + }; + }; + static info = (): QueryMsg => { + return { + info: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/default/Factory.msg-builder.ts b/__output__/builder/default/Factory.msg-builder.ts new file mode 100644 index 00000000..4f5527b4 --- /dev/null +++ b/__output__/builder/default/Factory.msg-builder.ts @@ -0,0 +1,154 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; +export abstract class FactoryExecuteMsgBuilder { + static createWallet = ({ + createWalletMsg + }: { + createWalletMsg: CreateWalletMsg; + }): ExecuteMsg => { + return { + create_wallet: ({ + create_wallet_msg: createWalletMsg + } as const) + }; + }; + static updateProxyUser = ({ + newUser, + oldUser + }: { + newUser: Addr; + oldUser: Addr; + }): ExecuteMsg => { + return { + update_proxy_user: ({ + new_user: newUser, + old_user: oldUser + } as const) + }; + }; + static migrateWallet = ({ + migrationMsg, + walletAddress + }: { + migrationMsg: ProxyMigrationTxMsg; + walletAddress: WalletAddr; + }): ExecuteMsg => { + return { + migrate_wallet: ({ + migration_msg: migrationMsg, + wallet_address: walletAddress + } as const) + }; + }; + static updateCodeId = ({ + newCodeId, + ty + }: { + newCodeId: number; + ty: CodeIdType; + }): ExecuteMsg => { + return { + update_code_id: ({ + new_code_id: newCodeId, + ty + } as const) + }; + }; + static updateWalletFee = ({ + newFee + }: { + newFee: Coin; + }): ExecuteMsg => { + return { + update_wallet_fee: ({ + new_fee: newFee + } as const) + }; + }; + static updateGovecAddr = ({ + addr + }: { + addr: string; + }): ExecuteMsg => { + return { + update_govec_addr: ({ + addr + } as const) + }; + }; + static updateAdmin = ({ + addr + }: { + addr: string; + }): ExecuteMsg => { + return { + update_admin: ({ + addr + } as const) + }; + }; +} +export abstract class FactoryQueryMsgBuilder { + static wallets = ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: WalletQueryPrefix; + }): QueryMsg => { + return { + wallets: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static walletsOf = ({ + limit, + startAfter, + user + }: { + limit?: number; + startAfter?: string; + user: string; + }): QueryMsg => { + return { + wallets_of: ({ + limit, + start_after: startAfter, + user + } as const) + }; + }; + static codeId = ({ + ty + }: { + ty: CodeIdType; + }): QueryMsg => { + return { + code_id: ({ + ty + } as const) + }; + }; + static fee = (): QueryMsg => { + return { + fee: ({} as const) + }; + }; + static govecAddr = (): QueryMsg => { + return { + govec_addr: ({} as const) + }; + }; + static adminAddr = (): QueryMsg => { + return { + admin_addr: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/default/Minter.msg-builder.ts b/__output__/builder/default/Minter.msg-builder.ts new file mode 100644 index 00000000..e0b406ce --- /dev/null +++ b/__output__/builder/default/Minter.msg-builder.ts @@ -0,0 +1,104 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; +export abstract class MinterExecuteMsgBuilder { + static mint = (): ExecuteMsg => { + return { + mint: ({} as const) + }; + }; + static setWhitelist = ({ + whitelist + }: { + whitelist: string; + }): ExecuteMsg => { + return { + set_whitelist: ({ + whitelist + } as const) + }; + }; + static updateStartTime = (): ExecuteMsg => { + return { + update_start_time: ({} as const) + }; + }; + static updatePerAddressLimit = ({ + perAddressLimit + }: { + perAddressLimit: number; + }): ExecuteMsg => { + return { + update_per_address_limit: ({ + per_address_limit: perAddressLimit + } as const) + }; + }; + static mintTo = ({ + recipient + }: { + recipient: string; + }): ExecuteMsg => { + return { + mint_to: ({ + recipient + } as const) + }; + }; + static mintFor = ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: number; + }): ExecuteMsg => { + return { + mint_for: ({ + recipient, + token_id: tokenId + } as const) + }; + }; + static withdraw = (): ExecuteMsg => { + return { + withdraw: ({} as const) + }; + }; +} +export abstract class MinterQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static mintableNumTokens = (): QueryMsg => { + return { + mintable_num_tokens: ({} as const) + }; + }; + static startTime = (): QueryMsg => { + return { + start_time: ({} as const) + }; + }; + static mintPrice = (): QueryMsg => { + return { + mint_price: ({} as const) + }; + }; + static mintCount = ({ + address + }: { + address: string; + }): QueryMsg => { + return { + mint_count: ({ + address + } as const) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/default/index.ts b/__output__/builder/default/index.ts index 1dbf2dbe..7b947b6b 100644 --- a/__output__/builder/default/index.ts +++ b/__output__/builder/default/index.ts @@ -7,59 +7,69 @@ import * as _15 from "./Factory.types"; import * as _16 from "./Factory.client"; import * as _17 from "./Factory.message-composer"; -import * as _18 from "./Factory.react-query"; -import * as _19 from "./Factory.recoil"; -import * as _20 from "./Minter.types"; -import * as _21 from "./Minter.client"; -import * as _22 from "./Minter.message-composer"; -import * as _23 from "./Minter.react-query"; -import * as _24 from "./Minter.recoil"; -import * as _25 from "./CwAdminFactory.types"; -import * as _26 from "./CwAdminFactory.client"; -import * as _27 from "./CwAdminFactory.message-composer"; -import * as _28 from "./CwAdminFactory.react-query"; -import * as _29 from "./CwAdminFactory.recoil"; -import * as _30 from "./CwCodeIdRegistry.types"; -import * as _31 from "./CwCodeIdRegistry.client"; -import * as _32 from "./CwCodeIdRegistry.message-composer"; -import * as _33 from "./CwCodeIdRegistry.react-query"; -import * as _34 from "./CwCodeIdRegistry.recoil"; -import * as _35 from "./CwSingle.types"; -import * as _36 from "./CwSingle.client"; -import * as _37 from "./CwSingle.message-composer"; -import * as _38 from "./CwSingle.react-query"; -import * as _39 from "./CwSingle.recoil"; +import * as _18 from "./Factory.msg-builder"; +import * as _19 from "./Factory.react-query"; +import * as _20 from "./Factory.recoil"; +import * as _21 from "./Minter.types"; +import * as _22 from "./Minter.client"; +import * as _23 from "./Minter.message-composer"; +import * as _24 from "./Minter.msg-builder"; +import * as _25 from "./Minter.react-query"; +import * as _26 from "./Minter.recoil"; +import * as _27 from "./CwAdminFactory.types"; +import * as _28 from "./CwAdminFactory.client"; +import * as _29 from "./CwAdminFactory.message-composer"; +import * as _30 from "./CwAdminFactory.msg-builder"; +import * as _31 from "./CwAdminFactory.react-query"; +import * as _32 from "./CwAdminFactory.recoil"; +import * as _33 from "./CwCodeIdRegistry.types"; +import * as _34 from "./CwCodeIdRegistry.client"; +import * as _35 from "./CwCodeIdRegistry.message-composer"; +import * as _36 from "./CwCodeIdRegistry.msg-builder"; +import * as _37 from "./CwCodeIdRegistry.react-query"; +import * as _38 from "./CwCodeIdRegistry.recoil"; +import * as _39 from "./CwSingle.types"; +import * as _40 from "./CwSingle.client"; +import * as _41 from "./CwSingle.message-composer"; +import * as _42 from "./CwSingle.msg-builder"; +import * as _43 from "./CwSingle.react-query"; +import * as _44 from "./CwSingle.recoil"; export namespace smart { export namespace contracts { export const Factory = { ..._15, ..._16, ..._17, ..._18, - ..._19 + ..._19, + ..._20 }; - export const Minter = { ..._20, - ..._21, + export const Minter = { ..._21, ..._22, ..._23, - ..._24 + ..._24, + ..._25, + ..._26 }; - export const CwAdminFactory = { ..._25, - ..._26, - ..._27, + export const CwAdminFactory = { ..._27, ..._28, - ..._29 - }; - export const CwCodeIdRegistry = { ..._30, + ..._29, + ..._30, ..._31, - ..._32, - ..._33, - ..._34 + ..._32 }; - export const CwSingle = { ..._35, + export const CwCodeIdRegistry = { ..._33, + ..._34, + ..._35, ..._36, ..._37, - ..._38, - ..._39 + ..._38 + }; + export const CwSingle = { ..._39, + ..._40, + ..._41, + ..._42, + ..._43, + ..._44 }; } } \ No newline at end of file diff --git a/__output__/builder/no-extends/CwAdminFactory.msg-builder.ts b/__output__/builder/no-extends/CwAdminFactory.msg-builder.ts new file mode 100644 index 00000000..776222d0 --- /dev/null +++ b/__output__/builder/no-extends/CwAdminFactory.msg-builder.ts @@ -0,0 +1,26 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; +export abstract class CwAdminFactoryExecuteMsgBuilder { + static instantiateContractWithSelfAdmin = ({ + codeId, + instantiateMsg, + label + }: { + codeId: number; + instantiateMsg: Binary; + label: string; + }): ExecuteMsg => { + return { + instantiate_contract_with_self_admin: ({ + code_id: codeId, + instantiate_msg: instantiateMsg, + label + } as const) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/CwCodeIdRegistry.msg-builder.ts b/__output__/builder/no-extends/CwCodeIdRegistry.msg-builder.ts new file mode 100644 index 00000000..d9388c55 --- /dev/null +++ b/__output__/builder/no-extends/CwCodeIdRegistry.msg-builder.ts @@ -0,0 +1,146 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; +export abstract class CwCodeIdRegistryExecuteMsgBuilder { + static receive = ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static register = ({ + chainId, + checksum, + codeId, + name, + version + }: { + chainId: string; + checksum: string; + codeId: number; + name: string; + version: string; + }): ExecuteMsg => { + return { + register: ({ + chain_id: chainId, + checksum, + code_id: codeId, + name, + version + } as const) + }; + }; + static setOwner = ({ + chainId, + name, + owner + }: { + chainId: string; + name: string; + owner?: string; + }): ExecuteMsg => { + return { + set_owner: ({ + chain_id: chainId, + name, + owner + } as const) + }; + }; + static unregister = ({ + chainId, + codeId + }: { + chainId: string; + codeId: number; + }): ExecuteMsg => { + return { + unregister: ({ + chain_id: chainId, + code_id: codeId + } as const) + }; + }; + static updateConfig = ({ + admin, + paymentInfo + }: { + admin?: string; + paymentInfo?: PaymentInfo; + }): ExecuteMsg => { + return { + update_config: ({ + admin, + payment_info: paymentInfo + } as const) + }; + }; +} +export abstract class CwCodeIdRegistryQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static getRegistration = ({ + chainId, + name, + version + }: { + chainId: string; + name: string; + version?: string; + }): QueryMsg => { + return { + get_registration: ({ + chain_id: chainId, + name, + version + } as const) + }; + }; + static infoForCodeId = ({ + chainId, + codeId + }: { + chainId: string; + codeId: number; + }): QueryMsg => { + return { + info_for_code_id: ({ + chain_id: chainId, + code_id: codeId + } as const) + }; + }; + static listRegistrations = ({ + chainId, + name + }: { + chainId: string; + name: string; + }): QueryMsg => { + return { + list_registrations: ({ + chain_id: chainId, + name + } as const) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/CwSingle.msg-builder.ts b/__output__/builder/no-extends/CwSingle.msg-builder.ts new file mode 100644 index 00000000..9a0e73fb --- /dev/null +++ b/__output__/builder/no-extends/CwSingle.msg-builder.ts @@ -0,0 +1,232 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; +export abstract class CwSingleExecuteMsgBuilder { + static propose = ({ + description, + msgs, + title + }: { + description: string; + msgs: CosmosMsgForEmpty[]; + title: string; + }): ExecuteMsg => { + return { + propose: ({ + description, + msgs, + title + } as const) + }; + }; + static vote = ({ + proposalId, + vote + }: { + proposalId: number; + vote: Vote; + }): ExecuteMsg => { + return { + vote: ({ + proposal_id: proposalId, + vote + } as const) + }; + }; + static execute = ({ + proposalId + }: { + proposalId: number; + }): ExecuteMsg => { + return { + execute: ({ + proposal_id: proposalId + } as const) + }; + }; + static close = ({ + proposalId + }: { + proposalId: number; + }): ExecuteMsg => { + return { + close: ({ + proposal_id: proposalId + } as const) + }; + }; + static updateConfig = ({ + allowRevoting, + dao, + depositInfo, + maxVotingPeriod, + minVotingPeriod, + onlyMembersExecute, + threshold + }: { + allowRevoting: boolean; + dao: string; + depositInfo?: DepositInfo; + maxVotingPeriod: Duration; + minVotingPeriod?: Duration; + onlyMembersExecute: boolean; + threshold: Threshold; + }): ExecuteMsg => { + return { + update_config: ({ + allow_revoting: allowRevoting, + dao, + deposit_info: depositInfo, + max_voting_period: maxVotingPeriod, + min_voting_period: minVotingPeriod, + only_members_execute: onlyMembersExecute, + threshold + } as const) + }; + }; + static addProposalHook = ({ + address + }: { + address: string; + }): ExecuteMsg => { + return { + add_proposal_hook: ({ + address + } as const) + }; + }; + static removeProposalHook = ({ + address + }: { + address: string; + }): ExecuteMsg => { + return { + remove_proposal_hook: ({ + address + } as const) + }; + }; + static addVoteHook = ({ + address + }: { + address: string; + }): ExecuteMsg => { + return { + add_vote_hook: ({ + address + } as const) + }; + }; + static removeVoteHook = ({ + address + }: { + address: string; + }): ExecuteMsg => { + return { + remove_vote_hook: ({ + address + } as const) + }; + }; +} +export abstract class CwSingleQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static proposal = ({ + proposalId + }: { + proposalId: number; + }): QueryMsg => { + return { + proposal: ({ + proposal_id: proposalId + } as const) + }; + }; + static listProposals = ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }): QueryMsg => { + return { + list_proposals: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static reverseProposals = ({ + limit, + startBefore + }: { + limit?: number; + startBefore?: number; + }): QueryMsg => { + return { + reverse_proposals: ({ + limit, + start_before: startBefore + } as const) + }; + }; + static proposalCount = (): QueryMsg => { + return { + proposal_count: ({} as const) + }; + }; + static vote = ({ + proposalId, + voter + }: { + proposalId: number; + voter: string; + }): QueryMsg => { + return { + vote: ({ + proposal_id: proposalId, + voter + } as const) + }; + }; + static listVotes = ({ + limit, + proposalId, + startAfter + }: { + limit?: number; + proposalId: number; + startAfter?: string; + }): QueryMsg => { + return { + list_votes: ({ + limit, + proposal_id: proposalId, + start_after: startAfter + } as const) + }; + }; + static proposalHooks = (): QueryMsg => { + return { + proposal_hooks: ({} as const) + }; + }; + static voteHooks = (): QueryMsg => { + return { + vote_hooks: ({} as const) + }; + }; + static info = (): QueryMsg => { + return { + info: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/Factory.msg-builder.ts b/__output__/builder/no-extends/Factory.msg-builder.ts new file mode 100644 index 00000000..4f5527b4 --- /dev/null +++ b/__output__/builder/no-extends/Factory.msg-builder.ts @@ -0,0 +1,154 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; +export abstract class FactoryExecuteMsgBuilder { + static createWallet = ({ + createWalletMsg + }: { + createWalletMsg: CreateWalletMsg; + }): ExecuteMsg => { + return { + create_wallet: ({ + create_wallet_msg: createWalletMsg + } as const) + }; + }; + static updateProxyUser = ({ + newUser, + oldUser + }: { + newUser: Addr; + oldUser: Addr; + }): ExecuteMsg => { + return { + update_proxy_user: ({ + new_user: newUser, + old_user: oldUser + } as const) + }; + }; + static migrateWallet = ({ + migrationMsg, + walletAddress + }: { + migrationMsg: ProxyMigrationTxMsg; + walletAddress: WalletAddr; + }): ExecuteMsg => { + return { + migrate_wallet: ({ + migration_msg: migrationMsg, + wallet_address: walletAddress + } as const) + }; + }; + static updateCodeId = ({ + newCodeId, + ty + }: { + newCodeId: number; + ty: CodeIdType; + }): ExecuteMsg => { + return { + update_code_id: ({ + new_code_id: newCodeId, + ty + } as const) + }; + }; + static updateWalletFee = ({ + newFee + }: { + newFee: Coin; + }): ExecuteMsg => { + return { + update_wallet_fee: ({ + new_fee: newFee + } as const) + }; + }; + static updateGovecAddr = ({ + addr + }: { + addr: string; + }): ExecuteMsg => { + return { + update_govec_addr: ({ + addr + } as const) + }; + }; + static updateAdmin = ({ + addr + }: { + addr: string; + }): ExecuteMsg => { + return { + update_admin: ({ + addr + } as const) + }; + }; +} +export abstract class FactoryQueryMsgBuilder { + static wallets = ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: WalletQueryPrefix; + }): QueryMsg => { + return { + wallets: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static walletsOf = ({ + limit, + startAfter, + user + }: { + limit?: number; + startAfter?: string; + user: string; + }): QueryMsg => { + return { + wallets_of: ({ + limit, + start_after: startAfter, + user + } as const) + }; + }; + static codeId = ({ + ty + }: { + ty: CodeIdType; + }): QueryMsg => { + return { + code_id: ({ + ty + } as const) + }; + }; + static fee = (): QueryMsg => { + return { + fee: ({} as const) + }; + }; + static govecAddr = (): QueryMsg => { + return { + govec_addr: ({} as const) + }; + }; + static adminAddr = (): QueryMsg => { + return { + admin_addr: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/Minter.msg-builder.ts b/__output__/builder/no-extends/Minter.msg-builder.ts new file mode 100644 index 00000000..e0b406ce --- /dev/null +++ b/__output__/builder/no-extends/Minter.msg-builder.ts @@ -0,0 +1,104 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; +export abstract class MinterExecuteMsgBuilder { + static mint = (): ExecuteMsg => { + return { + mint: ({} as const) + }; + }; + static setWhitelist = ({ + whitelist + }: { + whitelist: string; + }): ExecuteMsg => { + return { + set_whitelist: ({ + whitelist + } as const) + }; + }; + static updateStartTime = (): ExecuteMsg => { + return { + update_start_time: ({} as const) + }; + }; + static updatePerAddressLimit = ({ + perAddressLimit + }: { + perAddressLimit: number; + }): ExecuteMsg => { + return { + update_per_address_limit: ({ + per_address_limit: perAddressLimit + } as const) + }; + }; + static mintTo = ({ + recipient + }: { + recipient: string; + }): ExecuteMsg => { + return { + mint_to: ({ + recipient + } as const) + }; + }; + static mintFor = ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: number; + }): ExecuteMsg => { + return { + mint_for: ({ + recipient, + token_id: tokenId + } as const) + }; + }; + static withdraw = (): ExecuteMsg => { + return { + withdraw: ({} as const) + }; + }; +} +export abstract class MinterQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static mintableNumTokens = (): QueryMsg => { + return { + mintable_num_tokens: ({} as const) + }; + }; + static startTime = (): QueryMsg => { + return { + start_time: ({} as const) + }; + }; + static mintPrice = (): QueryMsg => { + return { + mint_price: ({} as const) + }; + }; + static mintCount = ({ + address + }: { + address: string; + }): QueryMsg => { + return { + mint_count: ({ + address + } as const) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/index.ts b/__output__/builder/no-extends/index.ts index baf3d150..6a2abe65 100644 --- a/__output__/builder/no-extends/index.ts +++ b/__output__/builder/no-extends/index.ts @@ -4,62 +4,72 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import * as _40 from "./Factory.types"; -import * as _41 from "./Factory.client"; -import * as _42 from "./Factory.message-composer"; -import * as _43 from "./Factory.react-query"; -import * as _44 from "./Factory.recoil"; -import * as _45 from "./Minter.types"; -import * as _46 from "./Minter.client"; -import * as _47 from "./Minter.message-composer"; -import * as _48 from "./Minter.react-query"; -import * as _49 from "./Minter.recoil"; -import * as _50 from "./CwAdminFactory.types"; -import * as _51 from "./CwAdminFactory.client"; -import * as _52 from "./CwAdminFactory.message-composer"; -import * as _53 from "./CwAdminFactory.react-query"; -import * as _54 from "./CwAdminFactory.recoil"; -import * as _55 from "./CwCodeIdRegistry.types"; -import * as _56 from "./CwCodeIdRegistry.client"; -import * as _57 from "./CwCodeIdRegistry.message-composer"; -import * as _58 from "./CwCodeIdRegistry.react-query"; -import * as _59 from "./CwCodeIdRegistry.recoil"; -import * as _60 from "./CwSingle.types"; -import * as _61 from "./CwSingle.client"; -import * as _62 from "./CwSingle.message-composer"; -import * as _63 from "./CwSingle.react-query"; -import * as _64 from "./CwSingle.recoil"; +import * as _45 from "./Factory.types"; +import * as _46 from "./Factory.client"; +import * as _47 from "./Factory.message-composer"; +import * as _48 from "./Factory.msg-builder"; +import * as _49 from "./Factory.react-query"; +import * as _50 from "./Factory.recoil"; +import * as _51 from "./Minter.types"; +import * as _52 from "./Minter.client"; +import * as _53 from "./Minter.message-composer"; +import * as _54 from "./Minter.msg-builder"; +import * as _55 from "./Minter.react-query"; +import * as _56 from "./Minter.recoil"; +import * as _57 from "./CwAdminFactory.types"; +import * as _58 from "./CwAdminFactory.client"; +import * as _59 from "./CwAdminFactory.message-composer"; +import * as _60 from "./CwAdminFactory.msg-builder"; +import * as _61 from "./CwAdminFactory.react-query"; +import * as _62 from "./CwAdminFactory.recoil"; +import * as _63 from "./CwCodeIdRegistry.types"; +import * as _64 from "./CwCodeIdRegistry.client"; +import * as _65 from "./CwCodeIdRegistry.message-composer"; +import * as _66 from "./CwCodeIdRegistry.msg-builder"; +import * as _67 from "./CwCodeIdRegistry.react-query"; +import * as _68 from "./CwCodeIdRegistry.recoil"; +import * as _69 from "./CwSingle.types"; +import * as _70 from "./CwSingle.client"; +import * as _71 from "./CwSingle.message-composer"; +import * as _72 from "./CwSingle.msg-builder"; +import * as _73 from "./CwSingle.react-query"; +import * as _74 from "./CwSingle.recoil"; export namespace smart { export namespace contracts { - export const Factory = { ..._40, - ..._41, - ..._42, - ..._43, - ..._44 - }; - export const Minter = { ..._45, + export const Factory = { ..._45, ..._46, ..._47, ..._48, - ..._49 + ..._49, + ..._50 }; - export const CwAdminFactory = { ..._50, - ..._51, + export const Minter = { ..._51, ..._52, ..._53, - ..._54 + ..._54, + ..._55, + ..._56 }; - export const CwCodeIdRegistry = { ..._55, - ..._56, - ..._57, + export const CwAdminFactory = { ..._57, ..._58, - ..._59 - }; - export const CwSingle = { ..._60, + ..._59, + ..._60, ..._61, - ..._62, - ..._63, - ..._64 + ..._62 + }; + export const CwCodeIdRegistry = { ..._63, + ..._64, + ..._65, + ..._66, + ..._67, + ..._68 + }; + export const CwSingle = { ..._69, + ..._70, + ..._71, + ..._72, + ..._73, + ..._74 }; } } \ No newline at end of file diff --git a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap index f01767f9..a765e207 100644 --- a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap +++ b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap @@ -17,6 +17,9 @@ TSBuilder { "messageComposer": Object { "enabled": false, }, + "msgBuilder": Object { + "enabled": false, + }, "reactQuery": Object { "camelize": true, "enabled": true, @@ -53,6 +56,9 @@ TSBuilder { "messageComposer": Object { "enabled": false, }, + "msgBuilder": Object { + "enabled": false, + }, "reactQuery": Object { "camelize": true, "enabled": false, diff --git a/packages/ts-codegen/__tests__/builder.test.ts b/packages/ts-codegen/__tests__/builder.test.ts index c06b8135..f8424330 100644 --- a/packages/ts-codegen/__tests__/builder.test.ts +++ b/packages/ts-codegen/__tests__/builder.test.ts @@ -109,6 +109,9 @@ it('builder default', async () => { }, messageComposer: { enabled: true + }, + msgBuilder: { + enabled: true } } }); @@ -149,7 +152,10 @@ it('builder no extends', async () => { }, messageComposer: { enabled: true + }, + msgBuilder: { + enabled: true } } }); -}); \ No newline at end of file +}); diff --git a/packages/ts-codegen/src/builder/builder.ts b/packages/ts-codegen/src/builder/builder.ts index c4ae7739..7bbaaebc 100644 --- a/packages/ts-codegen/src/builder/builder.ts +++ b/packages/ts-codegen/src/builder/builder.ts @@ -6,6 +6,7 @@ import { writeFileSync } from 'fs'; import { sync as mkdirp } from "mkdirp"; import generateMessageComposer from '../generators/message-composer'; +import generateMsgBuilder from '../generators/msg-builder'; import generateTypes from '../generators/types'; import generateReactQuery from '../generators/react-query'; import generateRecoil from '../generators/recoil'; @@ -46,7 +47,7 @@ export type TSBuilderOptions = { } & RenderOptions; export interface BuilderFile { - type: 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer'; + type: 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer' | 'msg-builder'; contract: string; localname: string; filename: string; @@ -142,6 +143,16 @@ export class TSBuilder { [].push.apply(this.files, files); } + async renderMsgBuilder(contract: ContractFile) { + const { enabled, ...options } = this.options.messageComposer; + if (!enabled) return; + const contractInfo = await readSchemas({ + schemaDir: contract.dir + }); + const files = await generateMsgBuilder(contract.name, contractInfo, this.outPath, options); + [].push.apply(this.files, files); + } + async build() { const contracts = this.getContracts(); for (let c = 0; c < contracts.length; c++) { @@ -149,6 +160,7 @@ export class TSBuilder { await this.renderTypes(contract); await this.renderClient(contract); await this.renderMessageComposer(contract); + await this.renderMsgBuilder(contract); await this.renderReactQuery(contract); await this.renderRecoil(contract); } @@ -191,4 +203,4 @@ export class TSBuilder { writeFileSync(join(this.outPath, bundleFile), header + code); } -} \ No newline at end of file +} diff --git a/packages/ts-codegen/src/commands/generate.ts b/packages/ts-codegen/src/commands/generate.ts index db7351e7..2adee769 100644 --- a/packages/ts-codegen/src/commands/generate.ts +++ b/packages/ts-codegen/src/commands/generate.ts @@ -151,6 +151,9 @@ export default async (argv) => { messageComposer: { enabled: plugin.includes('message-composer') }, + msgBuilder: { + enabled: plugin.includes('msg-builder') + }, bundle: { enabled: bundle, scope: bundleScope, diff --git a/packages/ts-codegen/src/generators/msg-builder.ts b/packages/ts-codegen/src/generators/msg-builder.ts new file mode 100644 index 00000000..eaf3f754 --- /dev/null +++ b/packages/ts-codegen/src/generators/msg-builder.ts @@ -0,0 +1,78 @@ +import { pascal } from "case"; +import { header } from "../utils/header"; +import { join } from "path"; +import { sync as mkdirp } from "mkdirp"; +import * as w from "wasm-ast-types"; +import * as t from "@babel/types"; +import { writeFileSync } from "fs"; +import generate from "@babel/generator"; +import { ContractInfo, getMessageProperties } from "wasm-ast-types"; +import { findAndParseTypes, findExecuteMsg, findQueryMsg } from '../utils'; +import { RenderContext, MsgBuilderOptions } from 'wasm-ast-types'; +import { BuilderFile } from "../builder"; + +export default async ( + name: string, + contractInfo: ContractInfo, + outPath: string, + msgBuilderOptions?: MsgBuilderOptions +): Promise => { + const { schemas } = contractInfo; + const context = new RenderContext(contractInfo, { + msgBuilder: msgBuilderOptions ?? {}, + }); + // const options = context.options.msgBuilder; + + const localname = pascal(name) + ".msg-builder.ts"; + const TypesFile = pascal(name) + ".types"; + const ExecuteMsg = findExecuteMsg(schemas); + const typeHash = await findAndParseTypes(schemas); + + const body = []; + + body.push(w.importStmt(Object.keys(typeHash), `./${TypesFile}`)); + + // execute messages + if (ExecuteMsg) { + const children = getMessageProperties(ExecuteMsg); + if (children.length > 0) { + const className = pascal(`${name}ExecuteMsgBuilder`); + + body.push( + w.createMsgBuilderClass(context, className, ExecuteMsg) + ); + } + } + + const QueryMsg = findQueryMsg(schemas); + // query messages + if (QueryMsg) { + const children = getMessageProperties(QueryMsg); + if (children.length > 0) { + const className = pascal(`${name}QueryMsgBuilder`); + + body.push( + w.createMsgBuilderClass(context, className, QueryMsg) + ); + } + } + + if (typeHash.hasOwnProperty("Coin")) { + // @ts-ignore + delete context.utils.Coin; + } + const imports = context.getImports(); + const code = header + generate(t.program([...imports, ...body])).code; + + mkdirp(outPath); + writeFileSync(join(outPath, localname), code); + + return [ + { + type: "msg-builder", + contract: name, + localname, + filename: join(outPath, localname), + }, + ]; +}; diff --git a/packages/ts-codegen/types/src/builder/builder.d.ts b/packages/ts-codegen/types/src/builder/builder.d.ts index 70939b47..7bf170f9 100644 --- a/packages/ts-codegen/types/src/builder/builder.d.ts +++ b/packages/ts-codegen/types/src/builder/builder.d.ts @@ -13,7 +13,7 @@ export declare type TSBuilderOptions = { bundle?: BundleOptions; } & RenderOptions; export interface BuilderFile { - type: 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer'; + type: 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer' | 'msg-builder'; contract: string; localname: string; filename: string; @@ -34,6 +34,7 @@ export declare class TSBuilder { renderRecoil(contract: ContractFile): Promise; renderReactQuery(contract: ContractFile): Promise; renderMessageComposer(contract: ContractFile): Promise; + renderMsgBuilder(contract: ContractFile): Promise; build(): Promise; bundle(): Promise; } diff --git a/packages/ts-codegen/types/src/generators/msg-builder.ts b/packages/ts-codegen/types/src/generators/msg-builder.ts new file mode 100644 index 00000000..4db98a6b --- /dev/null +++ b/packages/ts-codegen/types/src/generators/msg-builder.ts @@ -0,0 +1,5 @@ +import { ContractInfo } from "wasm-ast-types"; +import { MsgBuilderOptions } from "wasm-ast-types"; +import { BuilderFile } from "../builder"; +declare const _default: (name: string, contractInfo: ContractInfo, outPath: string, msgBuilderOptions?: MsgBuilderOptions) => Promise; +export default _default; diff --git a/packages/wasm-ast-types/src/context/context.ts b/packages/wasm-ast-types/src/context/context.ts index fdbc9edc..b93ac877 100644 --- a/packages/wasm-ast-types/src/context/context.ts +++ b/packages/wasm-ast-types/src/context/context.ts @@ -21,6 +21,9 @@ export interface TSClientOptions { export interface MessageComposerOptions { enabled?: boolean; } +export interface MsgBuilderOptions { + enabled?: boolean; +} export interface RecoilOptions { enabled?: boolean; } @@ -55,6 +58,7 @@ export interface RenderOptions { types?: TSTypesOptions; recoil?: RecoilOptions; messageComposer?: MessageComposerOptions; + msgBuilder?: MsgBuilderOptions; client?: TSClientOptions; reactQuery?: ReactQueryOptions; } @@ -80,6 +84,9 @@ export const defaultOptions: RenderOptions = { messageComposer: { enabled: false }, + msgBuilder: { + enabled: false, + }, reactQuery: { enabled: false, optionalClient: false, diff --git a/packages/wasm-ast-types/src/index.ts b/packages/wasm-ast-types/src/index.ts index fddeeb45..9c493b78 100644 --- a/packages/wasm-ast-types/src/index.ts +++ b/packages/wasm-ast-types/src/index.ts @@ -4,4 +4,5 @@ export * from './context'; export * from './recoil'; export * from './message-composer'; export * from './react-query'; -export * from './types'; \ No newline at end of file +export * from './types'; +export * from './msg-builder'; diff --git a/packages/wasm-ast-types/src/msg-builder/__snapshots__/msg-builder.spec.ts.snap b/packages/wasm-ast-types/src/msg-builder/__snapshots__/msg-builder.spec.ts.snap new file mode 100644 index 00000000..e2b098e0 --- /dev/null +++ b/packages/wasm-ast-types/src/msg-builder/__snapshots__/msg-builder.spec.ts.snap @@ -0,0 +1,270 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`execute class 1`] = ` +"export abstract class SG721MsgBuilder { + static transferNft = ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: string; + }): ExecuteMsg_for_Empty => { + return { + transfer_nft: ({ + recipient, + token_id: tokenId + } as const) + }; + }; + static sendNft = ({ + contract, + msg, + tokenId + }: { + contract: string; + msg: Binary; + tokenId: string; + }): ExecuteMsg_for_Empty => { + return { + send_nft: ({ + contract, + msg, + token_id: tokenId + } as const) + }; + }; + static approve = ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }): ExecuteMsg_for_Empty => { + return { + approve: ({ + expires, + spender, + token_id: tokenId + } as const) + }; + }; + static revoke = ({ + spender, + tokenId + }: { + spender: string; + tokenId: string; + }): ExecuteMsg_for_Empty => { + return { + revoke: ({ + spender, + token_id: tokenId + } as const) + }; + }; + static approveAll = ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }): ExecuteMsg_for_Empty => { + return { + approve_all: ({ + expires, + operator + } as const) + }; + }; + static revokeAll = ({ + operator + }: { + operator: string; + }): ExecuteMsg_for_Empty => { + return { + revoke_all: ({ + operator + } as const) + }; + }; + static mint = ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension: Empty; + owner: string; + tokenId: string; + tokenUri?: string; + }): ExecuteMsg_for_Empty => { + return { + mint: ({ + extension, + owner, + token_id: tokenId, + token_uri: tokenUri + } as const) + }; + }; + static burn = ({ + tokenId + }: { + tokenId: string; + }): ExecuteMsg_for_Empty => { + return { + burn: ({ + token_id: tokenId + } as const) + }; + }; +}" +`; + +exports[`query class 1`] = ` +"export abstract class SG721MsgBuilder { + static ownerOf = ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): QueryMsg => { + return { + owner_of: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static approval = ({ + includeExpired, + spender, + tokenId + }: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }): QueryMsg => { + return { + approval: ({ + include_expired: includeExpired, + spender, + token_id: tokenId + } as const) + }; + }; + static approvals = ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): QueryMsg => { + return { + approvals: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static allOperators = ({ + includeExpired, + limit, + owner, + startAfter + }: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }): QueryMsg => { + return { + all_operators: ({ + include_expired: includeExpired, + limit, + owner, + start_after: startAfter + } as const) + }; + }; + static numTokens = (): QueryMsg => { + return { + num_tokens: ({} as const) + }; + }; + static contractInfo = (): QueryMsg => { + return { + contract_info: ({} as const) + }; + }; + static nftInfo = ({ + tokenId + }: { + tokenId: string; + }): QueryMsg => { + return { + nft_info: ({ + token_id: tokenId + } as const) + }; + }; + static allNftInfo = ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): QueryMsg => { + return { + all_nft_info: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static tokens = ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }): QueryMsg => { + return { + tokens: ({ + limit, + owner, + start_after: startAfter + } as const) + }; + }; + static allTokens = ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): QueryMsg => { + return { + all_tokens: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static minter = (): QueryMsg => { + return { + minter: ({} as const) + }; + }; + static collectionInfo = (): QueryMsg => { + return { + collection_info: ({} as const) + }; + }; +}" +`; diff --git a/packages/wasm-ast-types/src/msg-builder/index.ts b/packages/wasm-ast-types/src/msg-builder/index.ts new file mode 100644 index 00000000..8b5b3650 --- /dev/null +++ b/packages/wasm-ast-types/src/msg-builder/index.ts @@ -0,0 +1 @@ +export * from './msg-builder'; diff --git a/packages/wasm-ast-types/src/msg-builder/msg-builder.spec.ts b/packages/wasm-ast-types/src/msg-builder/msg-builder.spec.ts new file mode 100644 index 00000000..37f48461 --- /dev/null +++ b/packages/wasm-ast-types/src/msg-builder/msg-builder.spec.ts @@ -0,0 +1,18 @@ +import execute_msg from '../../../../__fixtures__/basic/execute_msg_for__empty.json'; +import query_msg from '../../../../__fixtures__/basic/query_msg.json'; +import { + createMsgBuilderClass, + createMsgBuilderInterface +} from './msg-builder' +import { expectCode, makeContext } from '../../test-utils'; + +it('execute class', () => { + const ctx = makeContext(execute_msg); + expectCode(createMsgBuilderClass(ctx, 'SG721MsgBuilder', execute_msg)) +}); + + +it('query class', () => { + const ctx = makeContext(execute_msg); + expectCode(createMsgBuilderClass(ctx, 'SG721MsgBuilder', query_msg)) +}); diff --git a/packages/wasm-ast-types/src/msg-builder/msg-builder.ts b/packages/wasm-ast-types/src/msg-builder/msg-builder.ts new file mode 100644 index 00000000..26a76152 --- /dev/null +++ b/packages/wasm-ast-types/src/msg-builder/msg-builder.ts @@ -0,0 +1,76 @@ +import * as t from "@babel/types"; +import { camel } from "case"; +import { + abstractClassDeclaration, + arrowFunctionExpression, + bindMethod, + classDeclaration, + getMessageProperties, +} from "../utils"; +import { ExecuteMsg, QueryMsg } from "../types"; +import { createTypedObjectParams } from "../utils/types"; +import { RenderContext } from "../context"; +import { getWasmMethodArgs } from "../client/client"; + +export const createMsgBuilderClass = ( + context: RenderContext, + className: string, + msg: ExecuteMsg | QueryMsg +) => { + const staticMethods = getMessageProperties(msg).map((schema) => { + return createStaticExecMethodMsgBuilder(context, schema, msg.title); + }); + + // const blockStmt = bindings; + + return t.exportNamedDeclaration( + abstractClassDeclaration(className, staticMethods, [], null) + ); +}; + +const createStaticExecMethodMsgBuilder = ( + context: RenderContext, + jsonschema: any, + msgTitle: string +) => { + const underscoreName = Object.keys(jsonschema.properties)[0]; + const methodName = camel(underscoreName); + const obj = createTypedObjectParams( + context, + jsonschema.properties[underscoreName] + ); + const args = getWasmMethodArgs( + context, + jsonschema.properties[underscoreName] + ); + + return t.classProperty( + t.identifier(methodName), + arrowFunctionExpression( + obj + ? [ + // props + obj, + ] + : [], + t.blockStatement([ + t.returnStatement( + t.objectExpression([ + t.objectProperty( + t.identifier(underscoreName), + t.tsAsExpression(t.objectExpression(args), t.tsTypeReference(t.identifier('const'))) + ), + ]) + ), + ]), + // return type + t.tsTypeAnnotation(t.tsTypeReference(t.identifier(msgTitle))), + false + ), + null, + null, + false, + // static + true + ); +}; diff --git a/packages/wasm-ast-types/src/utils/babel.ts b/packages/wasm-ast-types/src/utils/babel.ts index 4c686d6d..5cbe2d8c 100644 --- a/packages/wasm-ast-types/src/utils/babel.ts +++ b/packages/wasm-ast-types/src/utils/babel.ts @@ -112,6 +112,17 @@ export const promiseTypeAnnotation = (name) => { ); } +export const abstractClassDeclaration = (name: string, body: any[], implementsExressions: TSExpressionWithTypeArguments[] = [], superClass: t.Identifier = null) => { + const declaration = classDeclaration( + name, + body, + implementsExressions, + superClass + ); + declaration.abstract = true + return declaration; +}; + export const classDeclaration = (name: string, body: any[], implementsExressions: TSExpressionWithTypeArguments[] = [], superClass: t.Identifier = null) => { const declaration = t.classDeclaration( t.identifier(name), diff --git a/packages/wasm-ast-types/types/context/context.d.ts b/packages/wasm-ast-types/types/context/context.d.ts index a9d71793..a5a006ab 100644 --- a/packages/wasm-ast-types/types/context/context.d.ts +++ b/packages/wasm-ast-types/types/context/context.d.ts @@ -16,6 +16,9 @@ export interface TSClientOptions { export interface MessageComposerOptions { enabled?: boolean; } +export interface MsgBuilderOptions { + enabled?: boolean; +} export interface RecoilOptions { enabled?: boolean; } @@ -46,6 +49,7 @@ export interface RenderOptions { types?: TSTypesOptions; recoil?: RecoilOptions; messageComposer?: MessageComposerOptions; + msgBuilder?: MsgBuilderOptions; client?: TSClientOptions; reactQuery?: ReactQueryOptions; } diff --git a/packages/wasm-ast-types/types/index.d.ts b/packages/wasm-ast-types/types/index.d.ts index d28d8286..f92ecfa2 100644 --- a/packages/wasm-ast-types/types/index.d.ts +++ b/packages/wasm-ast-types/types/index.d.ts @@ -3,5 +3,6 @@ export * from './client'; export * from './context'; export * from './recoil'; export * from './message-composer'; +export * from './msg-builder'; export * from './react-query'; export * from './types'; diff --git a/packages/wasm-ast-types/types/msg-builder/index.d.ts b/packages/wasm-ast-types/types/msg-builder/index.d.ts new file mode 100644 index 00000000..8b5b3650 --- /dev/null +++ b/packages/wasm-ast-types/types/msg-builder/index.d.ts @@ -0,0 +1 @@ +export * from './msg-builder'; diff --git a/packages/wasm-ast-types/types/msg-builder/msg-builder.d.ts b/packages/wasm-ast-types/types/msg-builder/msg-builder.d.ts new file mode 100644 index 00000000..2e2c329e --- /dev/null +++ b/packages/wasm-ast-types/types/msg-builder/msg-builder.d.ts @@ -0,0 +1,5 @@ +import * as t from '@babel/types'; +import { ExecuteMsg } from '../types'; +import { RenderContext } from '../context'; +export declare const createMsgBuilderClass: (context: RenderContext, className: string, execMsg: ExecuteMsg) => t.ExportNamedDeclaration; +export declare const createMsgBuilderInterface: (context: RenderContext, className: string, execMsg: ExecuteMsg) => t.ExportNamedDeclaration; From 75fd3e8924a237513f0f7d80f9093a3ccde12af8 Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Wed, 8 Mar 2023 23:38:26 -0700 Subject: [PATCH 096/287] Use typescript magic for extracting camelcased types --- .../default/CwAdminFactory.msg-builder.ts | 9 +- .../default/CwCodeIdRegistry.msg-builder.ts | 63 ++++------ .../builder/default/CwSingle.msg-builder.ts | 99 +++++++-------- .../builder/default/Factory.msg-builder.ts | 67 +++++----- .../builder/default/Minter.msg-builder.ts | 32 ++--- .../no-extends/CwAdminFactory.msg-builder.ts | 9 +- .../CwCodeIdRegistry.msg-builder.ts | 63 ++++------ .../no-extends/CwSingle.msg-builder.ts | 99 +++++++-------- .../builder/no-extends/Factory.msg-builder.ts | 67 +++++----- .../builder/no-extends/Minter.msg-builder.ts | 32 ++--- .../ts-codegen/src/generators/msg-builder.ts | 4 +- .../__snapshots__/msg-builder.spec.ts.snap | 117 +++++++----------- .../src/msg-builder/msg-builder.spec.ts | 1 - .../src/msg-builder/msg-builder.ts | 33 ++++- .../types/msg-builder/msg-builder.d.ts | 5 +- yarn.lock | 12 ++ 16 files changed, 335 insertions(+), 377 deletions(-) diff --git a/__output__/builder/default/CwAdminFactory.msg-builder.ts b/__output__/builder/default/CwAdminFactory.msg-builder.ts index 776222d0..1e03ab7b 100644 --- a/__output__/builder/default/CwAdminFactory.msg-builder.ts +++ b/__output__/builder/default/CwAdminFactory.msg-builder.ts @@ -5,16 +5,15 @@ */ import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; +import { CamelCasedProperties } from "type-fest"; export abstract class CwAdminFactoryExecuteMsgBuilder { static instantiateContractWithSelfAdmin = ({ codeId, instantiateMsg, label - }: { - codeId: number; - instantiateMsg: Binary; - label: string; - }): ExecuteMsg => { + }: CamelCasedProperties["instantiate_contract_with_self_admin"]>): ExecuteMsg => { return { instantiate_contract_with_self_admin: ({ code_id: codeId, diff --git a/__output__/builder/default/CwCodeIdRegistry.msg-builder.ts b/__output__/builder/default/CwCodeIdRegistry.msg-builder.ts index d9388c55..3e15defb 100644 --- a/__output__/builder/default/CwCodeIdRegistry.msg-builder.ts +++ b/__output__/builder/default/CwCodeIdRegistry.msg-builder.ts @@ -5,16 +5,15 @@ */ import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; +import { CamelCasedProperties } from "type-fest"; export abstract class CwCodeIdRegistryExecuteMsgBuilder { static receive = ({ amount, msg, sender - }: { - amount: Uint128; - msg: Binary; - sender: string; - }): ExecuteMsg => { + }: CamelCasedProperties["receive"]>): ExecuteMsg => { return { receive: ({ amount, @@ -29,13 +28,9 @@ export abstract class CwCodeIdRegistryExecuteMsgBuilder { codeId, name, version - }: { - chainId: string; - checksum: string; - codeId: number; - name: string; - version: string; - }): ExecuteMsg => { + }: CamelCasedProperties["register"]>): ExecuteMsg => { return { register: ({ chain_id: chainId, @@ -50,11 +45,9 @@ export abstract class CwCodeIdRegistryExecuteMsgBuilder { chainId, name, owner - }: { - chainId: string; - name: string; - owner?: string; - }): ExecuteMsg => { + }: CamelCasedProperties["set_owner"]>): ExecuteMsg => { return { set_owner: ({ chain_id: chainId, @@ -66,10 +59,9 @@ export abstract class CwCodeIdRegistryExecuteMsgBuilder { static unregister = ({ chainId, codeId - }: { - chainId: string; - codeId: number; - }): ExecuteMsg => { + }: CamelCasedProperties["unregister"]>): ExecuteMsg => { return { unregister: ({ chain_id: chainId, @@ -80,10 +72,9 @@ export abstract class CwCodeIdRegistryExecuteMsgBuilder { static updateConfig = ({ admin, paymentInfo - }: { - admin?: string; - paymentInfo?: PaymentInfo; - }): ExecuteMsg => { + }: CamelCasedProperties["update_config"]>): ExecuteMsg => { return { update_config: ({ admin, @@ -102,11 +93,9 @@ export abstract class CwCodeIdRegistryQueryMsgBuilder { chainId, name, version - }: { - chainId: string; - name: string; - version?: string; - }): QueryMsg => { + }: CamelCasedProperties["get_registration"]>): QueryMsg => { return { get_registration: ({ chain_id: chainId, @@ -118,10 +107,9 @@ export abstract class CwCodeIdRegistryQueryMsgBuilder { static infoForCodeId = ({ chainId, codeId - }: { - chainId: string; - codeId: number; - }): QueryMsg => { + }: CamelCasedProperties["info_for_code_id"]>): QueryMsg => { return { info_for_code_id: ({ chain_id: chainId, @@ -132,10 +120,9 @@ export abstract class CwCodeIdRegistryQueryMsgBuilder { static listRegistrations = ({ chainId, name - }: { - chainId: string; - name: string; - }): QueryMsg => { + }: CamelCasedProperties["list_registrations"]>): QueryMsg => { return { list_registrations: ({ chain_id: chainId, diff --git a/__output__/builder/default/CwSingle.msg-builder.ts b/__output__/builder/default/CwSingle.msg-builder.ts index 9a0e73fb..1859f108 100644 --- a/__output__/builder/default/CwSingle.msg-builder.ts +++ b/__output__/builder/default/CwSingle.msg-builder.ts @@ -5,16 +5,15 @@ */ import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; +import { CamelCasedProperties } from "type-fest"; export abstract class CwSingleExecuteMsgBuilder { static propose = ({ description, msgs, title - }: { - description: string; - msgs: CosmosMsgForEmpty[]; - title: string; - }): ExecuteMsg => { + }: CamelCasedProperties["propose"]>): ExecuteMsg => { return { propose: ({ description, @@ -26,10 +25,9 @@ export abstract class CwSingleExecuteMsgBuilder { static vote = ({ proposalId, vote - }: { - proposalId: number; - vote: Vote; - }): ExecuteMsg => { + }: CamelCasedProperties["vote"]>): ExecuteMsg => { return { vote: ({ proposal_id: proposalId, @@ -39,9 +37,9 @@ export abstract class CwSingleExecuteMsgBuilder { }; static execute = ({ proposalId - }: { - proposalId: number; - }): ExecuteMsg => { + }: CamelCasedProperties["execute"]>): ExecuteMsg => { return { execute: ({ proposal_id: proposalId @@ -50,9 +48,9 @@ export abstract class CwSingleExecuteMsgBuilder { }; static close = ({ proposalId - }: { - proposalId: number; - }): ExecuteMsg => { + }: CamelCasedProperties["close"]>): ExecuteMsg => { return { close: ({ proposal_id: proposalId @@ -67,15 +65,9 @@ export abstract class CwSingleExecuteMsgBuilder { minVotingPeriod, onlyMembersExecute, threshold - }: { - allowRevoting: boolean; - dao: string; - depositInfo?: DepositInfo; - maxVotingPeriod: Duration; - minVotingPeriod?: Duration; - onlyMembersExecute: boolean; - threshold: Threshold; - }): ExecuteMsg => { + }: CamelCasedProperties["update_config"]>): ExecuteMsg => { return { update_config: ({ allow_revoting: allowRevoting, @@ -90,9 +82,9 @@ export abstract class CwSingleExecuteMsgBuilder { }; static addProposalHook = ({ address - }: { - address: string; - }): ExecuteMsg => { + }: CamelCasedProperties["add_proposal_hook"]>): ExecuteMsg => { return { add_proposal_hook: ({ address @@ -101,9 +93,9 @@ export abstract class CwSingleExecuteMsgBuilder { }; static removeProposalHook = ({ address - }: { - address: string; - }): ExecuteMsg => { + }: CamelCasedProperties["remove_proposal_hook"]>): ExecuteMsg => { return { remove_proposal_hook: ({ address @@ -112,9 +104,9 @@ export abstract class CwSingleExecuteMsgBuilder { }; static addVoteHook = ({ address - }: { - address: string; - }): ExecuteMsg => { + }: CamelCasedProperties["add_vote_hook"]>): ExecuteMsg => { return { add_vote_hook: ({ address @@ -123,9 +115,9 @@ export abstract class CwSingleExecuteMsgBuilder { }; static removeVoteHook = ({ address - }: { - address: string; - }): ExecuteMsg => { + }: CamelCasedProperties["remove_vote_hook"]>): ExecuteMsg => { return { remove_vote_hook: ({ address @@ -141,9 +133,9 @@ export abstract class CwSingleQueryMsgBuilder { }; static proposal = ({ proposalId - }: { - proposalId: number; - }): QueryMsg => { + }: CamelCasedProperties["proposal"]>): QueryMsg => { return { proposal: ({ proposal_id: proposalId @@ -153,10 +145,9 @@ export abstract class CwSingleQueryMsgBuilder { static listProposals = ({ limit, startAfter - }: { - limit?: number; - startAfter?: number; - }): QueryMsg => { + }: CamelCasedProperties["list_proposals"]>): QueryMsg => { return { list_proposals: ({ limit, @@ -167,10 +158,9 @@ export abstract class CwSingleQueryMsgBuilder { static reverseProposals = ({ limit, startBefore - }: { - limit?: number; - startBefore?: number; - }): QueryMsg => { + }: CamelCasedProperties["reverse_proposals"]>): QueryMsg => { return { reverse_proposals: ({ limit, @@ -186,10 +176,9 @@ export abstract class CwSingleQueryMsgBuilder { static vote = ({ proposalId, voter - }: { - proposalId: number; - voter: string; - }): QueryMsg => { + }: CamelCasedProperties["vote"]>): QueryMsg => { return { vote: ({ proposal_id: proposalId, @@ -201,11 +190,9 @@ export abstract class CwSingleQueryMsgBuilder { limit, proposalId, startAfter - }: { - limit?: number; - proposalId: number; - startAfter?: string; - }): QueryMsg => { + }: CamelCasedProperties["list_votes"]>): QueryMsg => { return { list_votes: ({ limit, diff --git a/__output__/builder/default/Factory.msg-builder.ts b/__output__/builder/default/Factory.msg-builder.ts index 4f5527b4..0c662c0a 100644 --- a/__output__/builder/default/Factory.msg-builder.ts +++ b/__output__/builder/default/Factory.msg-builder.ts @@ -5,12 +5,13 @@ */ import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; +import { CamelCasedProperties } from "type-fest"; export abstract class FactoryExecuteMsgBuilder { static createWallet = ({ createWalletMsg - }: { - createWalletMsg: CreateWalletMsg; - }): ExecuteMsg => { + }: CamelCasedProperties["create_wallet"]>): ExecuteMsg => { return { create_wallet: ({ create_wallet_msg: createWalletMsg @@ -20,10 +21,9 @@ export abstract class FactoryExecuteMsgBuilder { static updateProxyUser = ({ newUser, oldUser - }: { - newUser: Addr; - oldUser: Addr; - }): ExecuteMsg => { + }: CamelCasedProperties["update_proxy_user"]>): ExecuteMsg => { return { update_proxy_user: ({ new_user: newUser, @@ -34,10 +34,9 @@ export abstract class FactoryExecuteMsgBuilder { static migrateWallet = ({ migrationMsg, walletAddress - }: { - migrationMsg: ProxyMigrationTxMsg; - walletAddress: WalletAddr; - }): ExecuteMsg => { + }: CamelCasedProperties["migrate_wallet"]>): ExecuteMsg => { return { migrate_wallet: ({ migration_msg: migrationMsg, @@ -48,10 +47,9 @@ export abstract class FactoryExecuteMsgBuilder { static updateCodeId = ({ newCodeId, ty - }: { - newCodeId: number; - ty: CodeIdType; - }): ExecuteMsg => { + }: CamelCasedProperties["update_code_id"]>): ExecuteMsg => { return { update_code_id: ({ new_code_id: newCodeId, @@ -61,9 +59,9 @@ export abstract class FactoryExecuteMsgBuilder { }; static updateWalletFee = ({ newFee - }: { - newFee: Coin; - }): ExecuteMsg => { + }: CamelCasedProperties["update_wallet_fee"]>): ExecuteMsg => { return { update_wallet_fee: ({ new_fee: newFee @@ -72,9 +70,9 @@ export abstract class FactoryExecuteMsgBuilder { }; static updateGovecAddr = ({ addr - }: { - addr: string; - }): ExecuteMsg => { + }: CamelCasedProperties["update_govec_addr"]>): ExecuteMsg => { return { update_govec_addr: ({ addr @@ -83,9 +81,9 @@ export abstract class FactoryExecuteMsgBuilder { }; static updateAdmin = ({ addr - }: { - addr: string; - }): ExecuteMsg => { + }: CamelCasedProperties["update_admin"]>): ExecuteMsg => { return { update_admin: ({ addr @@ -97,10 +95,9 @@ export abstract class FactoryQueryMsgBuilder { static wallets = ({ limit, startAfter - }: { - limit?: number; - startAfter?: WalletQueryPrefix; - }): QueryMsg => { + }: CamelCasedProperties["wallets"]>): QueryMsg => { return { wallets: ({ limit, @@ -112,11 +109,9 @@ export abstract class FactoryQueryMsgBuilder { limit, startAfter, user - }: { - limit?: number; - startAfter?: string; - user: string; - }): QueryMsg => { + }: CamelCasedProperties["wallets_of"]>): QueryMsg => { return { wallets_of: ({ limit, @@ -127,9 +122,9 @@ export abstract class FactoryQueryMsgBuilder { }; static codeId = ({ ty - }: { - ty: CodeIdType; - }): QueryMsg => { + }: CamelCasedProperties["code_id"]>): QueryMsg => { return { code_id: ({ ty diff --git a/__output__/builder/default/Minter.msg-builder.ts b/__output__/builder/default/Minter.msg-builder.ts index e0b406ce..897f3fa8 100644 --- a/__output__/builder/default/Minter.msg-builder.ts +++ b/__output__/builder/default/Minter.msg-builder.ts @@ -5,6 +5,7 @@ */ import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; +import { CamelCasedProperties } from "type-fest"; export abstract class MinterExecuteMsgBuilder { static mint = (): ExecuteMsg => { return { @@ -13,9 +14,9 @@ export abstract class MinterExecuteMsgBuilder { }; static setWhitelist = ({ whitelist - }: { - whitelist: string; - }): ExecuteMsg => { + }: CamelCasedProperties["set_whitelist"]>): ExecuteMsg => { return { set_whitelist: ({ whitelist @@ -29,9 +30,9 @@ export abstract class MinterExecuteMsgBuilder { }; static updatePerAddressLimit = ({ perAddressLimit - }: { - perAddressLimit: number; - }): ExecuteMsg => { + }: CamelCasedProperties["update_per_address_limit"]>): ExecuteMsg => { return { update_per_address_limit: ({ per_address_limit: perAddressLimit @@ -40,9 +41,9 @@ export abstract class MinterExecuteMsgBuilder { }; static mintTo = ({ recipient - }: { - recipient: string; - }): ExecuteMsg => { + }: CamelCasedProperties["mint_to"]>): ExecuteMsg => { return { mint_to: ({ recipient @@ -52,10 +53,9 @@ export abstract class MinterExecuteMsgBuilder { static mintFor = ({ recipient, tokenId - }: { - recipient: string; - tokenId: number; - }): ExecuteMsg => { + }: CamelCasedProperties["mint_for"]>): ExecuteMsg => { return { mint_for: ({ recipient, @@ -92,9 +92,9 @@ export abstract class MinterQueryMsgBuilder { }; static mintCount = ({ address - }: { - address: string; - }): QueryMsg => { + }: CamelCasedProperties["mint_count"]>): QueryMsg => { return { mint_count: ({ address diff --git a/__output__/builder/no-extends/CwAdminFactory.msg-builder.ts b/__output__/builder/no-extends/CwAdminFactory.msg-builder.ts index 776222d0..1e03ab7b 100644 --- a/__output__/builder/no-extends/CwAdminFactory.msg-builder.ts +++ b/__output__/builder/no-extends/CwAdminFactory.msg-builder.ts @@ -5,16 +5,15 @@ */ import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; +import { CamelCasedProperties } from "type-fest"; export abstract class CwAdminFactoryExecuteMsgBuilder { static instantiateContractWithSelfAdmin = ({ codeId, instantiateMsg, label - }: { - codeId: number; - instantiateMsg: Binary; - label: string; - }): ExecuteMsg => { + }: CamelCasedProperties["instantiate_contract_with_self_admin"]>): ExecuteMsg => { return { instantiate_contract_with_self_admin: ({ code_id: codeId, diff --git a/__output__/builder/no-extends/CwCodeIdRegistry.msg-builder.ts b/__output__/builder/no-extends/CwCodeIdRegistry.msg-builder.ts index d9388c55..3e15defb 100644 --- a/__output__/builder/no-extends/CwCodeIdRegistry.msg-builder.ts +++ b/__output__/builder/no-extends/CwCodeIdRegistry.msg-builder.ts @@ -5,16 +5,15 @@ */ import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; +import { CamelCasedProperties } from "type-fest"; export abstract class CwCodeIdRegistryExecuteMsgBuilder { static receive = ({ amount, msg, sender - }: { - amount: Uint128; - msg: Binary; - sender: string; - }): ExecuteMsg => { + }: CamelCasedProperties["receive"]>): ExecuteMsg => { return { receive: ({ amount, @@ -29,13 +28,9 @@ export abstract class CwCodeIdRegistryExecuteMsgBuilder { codeId, name, version - }: { - chainId: string; - checksum: string; - codeId: number; - name: string; - version: string; - }): ExecuteMsg => { + }: CamelCasedProperties["register"]>): ExecuteMsg => { return { register: ({ chain_id: chainId, @@ -50,11 +45,9 @@ export abstract class CwCodeIdRegistryExecuteMsgBuilder { chainId, name, owner - }: { - chainId: string; - name: string; - owner?: string; - }): ExecuteMsg => { + }: CamelCasedProperties["set_owner"]>): ExecuteMsg => { return { set_owner: ({ chain_id: chainId, @@ -66,10 +59,9 @@ export abstract class CwCodeIdRegistryExecuteMsgBuilder { static unregister = ({ chainId, codeId - }: { - chainId: string; - codeId: number; - }): ExecuteMsg => { + }: CamelCasedProperties["unregister"]>): ExecuteMsg => { return { unregister: ({ chain_id: chainId, @@ -80,10 +72,9 @@ export abstract class CwCodeIdRegistryExecuteMsgBuilder { static updateConfig = ({ admin, paymentInfo - }: { - admin?: string; - paymentInfo?: PaymentInfo; - }): ExecuteMsg => { + }: CamelCasedProperties["update_config"]>): ExecuteMsg => { return { update_config: ({ admin, @@ -102,11 +93,9 @@ export abstract class CwCodeIdRegistryQueryMsgBuilder { chainId, name, version - }: { - chainId: string; - name: string; - version?: string; - }): QueryMsg => { + }: CamelCasedProperties["get_registration"]>): QueryMsg => { return { get_registration: ({ chain_id: chainId, @@ -118,10 +107,9 @@ export abstract class CwCodeIdRegistryQueryMsgBuilder { static infoForCodeId = ({ chainId, codeId - }: { - chainId: string; - codeId: number; - }): QueryMsg => { + }: CamelCasedProperties["info_for_code_id"]>): QueryMsg => { return { info_for_code_id: ({ chain_id: chainId, @@ -132,10 +120,9 @@ export abstract class CwCodeIdRegistryQueryMsgBuilder { static listRegistrations = ({ chainId, name - }: { - chainId: string; - name: string; - }): QueryMsg => { + }: CamelCasedProperties["list_registrations"]>): QueryMsg => { return { list_registrations: ({ chain_id: chainId, diff --git a/__output__/builder/no-extends/CwSingle.msg-builder.ts b/__output__/builder/no-extends/CwSingle.msg-builder.ts index 9a0e73fb..1859f108 100644 --- a/__output__/builder/no-extends/CwSingle.msg-builder.ts +++ b/__output__/builder/no-extends/CwSingle.msg-builder.ts @@ -5,16 +5,15 @@ */ import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; +import { CamelCasedProperties } from "type-fest"; export abstract class CwSingleExecuteMsgBuilder { static propose = ({ description, msgs, title - }: { - description: string; - msgs: CosmosMsgForEmpty[]; - title: string; - }): ExecuteMsg => { + }: CamelCasedProperties["propose"]>): ExecuteMsg => { return { propose: ({ description, @@ -26,10 +25,9 @@ export abstract class CwSingleExecuteMsgBuilder { static vote = ({ proposalId, vote - }: { - proposalId: number; - vote: Vote; - }): ExecuteMsg => { + }: CamelCasedProperties["vote"]>): ExecuteMsg => { return { vote: ({ proposal_id: proposalId, @@ -39,9 +37,9 @@ export abstract class CwSingleExecuteMsgBuilder { }; static execute = ({ proposalId - }: { - proposalId: number; - }): ExecuteMsg => { + }: CamelCasedProperties["execute"]>): ExecuteMsg => { return { execute: ({ proposal_id: proposalId @@ -50,9 +48,9 @@ export abstract class CwSingleExecuteMsgBuilder { }; static close = ({ proposalId - }: { - proposalId: number; - }): ExecuteMsg => { + }: CamelCasedProperties["close"]>): ExecuteMsg => { return { close: ({ proposal_id: proposalId @@ -67,15 +65,9 @@ export abstract class CwSingleExecuteMsgBuilder { minVotingPeriod, onlyMembersExecute, threshold - }: { - allowRevoting: boolean; - dao: string; - depositInfo?: DepositInfo; - maxVotingPeriod: Duration; - minVotingPeriod?: Duration; - onlyMembersExecute: boolean; - threshold: Threshold; - }): ExecuteMsg => { + }: CamelCasedProperties["update_config"]>): ExecuteMsg => { return { update_config: ({ allow_revoting: allowRevoting, @@ -90,9 +82,9 @@ export abstract class CwSingleExecuteMsgBuilder { }; static addProposalHook = ({ address - }: { - address: string; - }): ExecuteMsg => { + }: CamelCasedProperties["add_proposal_hook"]>): ExecuteMsg => { return { add_proposal_hook: ({ address @@ -101,9 +93,9 @@ export abstract class CwSingleExecuteMsgBuilder { }; static removeProposalHook = ({ address - }: { - address: string; - }): ExecuteMsg => { + }: CamelCasedProperties["remove_proposal_hook"]>): ExecuteMsg => { return { remove_proposal_hook: ({ address @@ -112,9 +104,9 @@ export abstract class CwSingleExecuteMsgBuilder { }; static addVoteHook = ({ address - }: { - address: string; - }): ExecuteMsg => { + }: CamelCasedProperties["add_vote_hook"]>): ExecuteMsg => { return { add_vote_hook: ({ address @@ -123,9 +115,9 @@ export abstract class CwSingleExecuteMsgBuilder { }; static removeVoteHook = ({ address - }: { - address: string; - }): ExecuteMsg => { + }: CamelCasedProperties["remove_vote_hook"]>): ExecuteMsg => { return { remove_vote_hook: ({ address @@ -141,9 +133,9 @@ export abstract class CwSingleQueryMsgBuilder { }; static proposal = ({ proposalId - }: { - proposalId: number; - }): QueryMsg => { + }: CamelCasedProperties["proposal"]>): QueryMsg => { return { proposal: ({ proposal_id: proposalId @@ -153,10 +145,9 @@ export abstract class CwSingleQueryMsgBuilder { static listProposals = ({ limit, startAfter - }: { - limit?: number; - startAfter?: number; - }): QueryMsg => { + }: CamelCasedProperties["list_proposals"]>): QueryMsg => { return { list_proposals: ({ limit, @@ -167,10 +158,9 @@ export abstract class CwSingleQueryMsgBuilder { static reverseProposals = ({ limit, startBefore - }: { - limit?: number; - startBefore?: number; - }): QueryMsg => { + }: CamelCasedProperties["reverse_proposals"]>): QueryMsg => { return { reverse_proposals: ({ limit, @@ -186,10 +176,9 @@ export abstract class CwSingleQueryMsgBuilder { static vote = ({ proposalId, voter - }: { - proposalId: number; - voter: string; - }): QueryMsg => { + }: CamelCasedProperties["vote"]>): QueryMsg => { return { vote: ({ proposal_id: proposalId, @@ -201,11 +190,9 @@ export abstract class CwSingleQueryMsgBuilder { limit, proposalId, startAfter - }: { - limit?: number; - proposalId: number; - startAfter?: string; - }): QueryMsg => { + }: CamelCasedProperties["list_votes"]>): QueryMsg => { return { list_votes: ({ limit, diff --git a/__output__/builder/no-extends/Factory.msg-builder.ts b/__output__/builder/no-extends/Factory.msg-builder.ts index 4f5527b4..0c662c0a 100644 --- a/__output__/builder/no-extends/Factory.msg-builder.ts +++ b/__output__/builder/no-extends/Factory.msg-builder.ts @@ -5,12 +5,13 @@ */ import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; +import { CamelCasedProperties } from "type-fest"; export abstract class FactoryExecuteMsgBuilder { static createWallet = ({ createWalletMsg - }: { - createWalletMsg: CreateWalletMsg; - }): ExecuteMsg => { + }: CamelCasedProperties["create_wallet"]>): ExecuteMsg => { return { create_wallet: ({ create_wallet_msg: createWalletMsg @@ -20,10 +21,9 @@ export abstract class FactoryExecuteMsgBuilder { static updateProxyUser = ({ newUser, oldUser - }: { - newUser: Addr; - oldUser: Addr; - }): ExecuteMsg => { + }: CamelCasedProperties["update_proxy_user"]>): ExecuteMsg => { return { update_proxy_user: ({ new_user: newUser, @@ -34,10 +34,9 @@ export abstract class FactoryExecuteMsgBuilder { static migrateWallet = ({ migrationMsg, walletAddress - }: { - migrationMsg: ProxyMigrationTxMsg; - walletAddress: WalletAddr; - }): ExecuteMsg => { + }: CamelCasedProperties["migrate_wallet"]>): ExecuteMsg => { return { migrate_wallet: ({ migration_msg: migrationMsg, @@ -48,10 +47,9 @@ export abstract class FactoryExecuteMsgBuilder { static updateCodeId = ({ newCodeId, ty - }: { - newCodeId: number; - ty: CodeIdType; - }): ExecuteMsg => { + }: CamelCasedProperties["update_code_id"]>): ExecuteMsg => { return { update_code_id: ({ new_code_id: newCodeId, @@ -61,9 +59,9 @@ export abstract class FactoryExecuteMsgBuilder { }; static updateWalletFee = ({ newFee - }: { - newFee: Coin; - }): ExecuteMsg => { + }: CamelCasedProperties["update_wallet_fee"]>): ExecuteMsg => { return { update_wallet_fee: ({ new_fee: newFee @@ -72,9 +70,9 @@ export abstract class FactoryExecuteMsgBuilder { }; static updateGovecAddr = ({ addr - }: { - addr: string; - }): ExecuteMsg => { + }: CamelCasedProperties["update_govec_addr"]>): ExecuteMsg => { return { update_govec_addr: ({ addr @@ -83,9 +81,9 @@ export abstract class FactoryExecuteMsgBuilder { }; static updateAdmin = ({ addr - }: { - addr: string; - }): ExecuteMsg => { + }: CamelCasedProperties["update_admin"]>): ExecuteMsg => { return { update_admin: ({ addr @@ -97,10 +95,9 @@ export abstract class FactoryQueryMsgBuilder { static wallets = ({ limit, startAfter - }: { - limit?: number; - startAfter?: WalletQueryPrefix; - }): QueryMsg => { + }: CamelCasedProperties["wallets"]>): QueryMsg => { return { wallets: ({ limit, @@ -112,11 +109,9 @@ export abstract class FactoryQueryMsgBuilder { limit, startAfter, user - }: { - limit?: number; - startAfter?: string; - user: string; - }): QueryMsg => { + }: CamelCasedProperties["wallets_of"]>): QueryMsg => { return { wallets_of: ({ limit, @@ -127,9 +122,9 @@ export abstract class FactoryQueryMsgBuilder { }; static codeId = ({ ty - }: { - ty: CodeIdType; - }): QueryMsg => { + }: CamelCasedProperties["code_id"]>): QueryMsg => { return { code_id: ({ ty diff --git a/__output__/builder/no-extends/Minter.msg-builder.ts b/__output__/builder/no-extends/Minter.msg-builder.ts index e0b406ce..897f3fa8 100644 --- a/__output__/builder/no-extends/Minter.msg-builder.ts +++ b/__output__/builder/no-extends/Minter.msg-builder.ts @@ -5,6 +5,7 @@ */ import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; +import { CamelCasedProperties } from "type-fest"; export abstract class MinterExecuteMsgBuilder { static mint = (): ExecuteMsg => { return { @@ -13,9 +14,9 @@ export abstract class MinterExecuteMsgBuilder { }; static setWhitelist = ({ whitelist - }: { - whitelist: string; - }): ExecuteMsg => { + }: CamelCasedProperties["set_whitelist"]>): ExecuteMsg => { return { set_whitelist: ({ whitelist @@ -29,9 +30,9 @@ export abstract class MinterExecuteMsgBuilder { }; static updatePerAddressLimit = ({ perAddressLimit - }: { - perAddressLimit: number; - }): ExecuteMsg => { + }: CamelCasedProperties["update_per_address_limit"]>): ExecuteMsg => { return { update_per_address_limit: ({ per_address_limit: perAddressLimit @@ -40,9 +41,9 @@ export abstract class MinterExecuteMsgBuilder { }; static mintTo = ({ recipient - }: { - recipient: string; - }): ExecuteMsg => { + }: CamelCasedProperties["mint_to"]>): ExecuteMsg => { return { mint_to: ({ recipient @@ -52,10 +53,9 @@ export abstract class MinterExecuteMsgBuilder { static mintFor = ({ recipient, tokenId - }: { - recipient: string; - tokenId: number; - }): ExecuteMsg => { + }: CamelCasedProperties["mint_for"]>): ExecuteMsg => { return { mint_for: ({ recipient, @@ -92,9 +92,9 @@ export abstract class MinterQueryMsgBuilder { }; static mintCount = ({ address - }: { - address: string; - }): QueryMsg => { + }: CamelCasedProperties["mint_count"]>): QueryMsg => { return { mint_count: ({ address diff --git a/packages/ts-codegen/src/generators/msg-builder.ts b/packages/ts-codegen/src/generators/msg-builder.ts index eaf3f754..5f6643b7 100644 --- a/packages/ts-codegen/src/generators/msg-builder.ts +++ b/packages/ts-codegen/src/generators/msg-builder.ts @@ -10,6 +10,8 @@ import { ContractInfo, getMessageProperties } from "wasm-ast-types"; import { findAndParseTypes, findExecuteMsg, findQueryMsg } from '../utils'; import { RenderContext, MsgBuilderOptions } from 'wasm-ast-types'; import { BuilderFile } from "../builder"; +import babelTraverse from '@babel/traverse'; +import { parse as babelParse } from '@babel/parser' export default async ( name: string, @@ -21,7 +23,6 @@ export default async ( const context = new RenderContext(contractInfo, { msgBuilder: msgBuilderOptions ?? {}, }); - // const options = context.options.msgBuilder; const localname = pascal(name) + ".msg-builder.ts"; const TypesFile = pascal(name) + ".types"; @@ -31,6 +32,7 @@ export default async ( const body = []; body.push(w.importStmt(Object.keys(typeHash), `./${TypesFile}`)); + body.push(w.importStmt(["CamelCasedProperties"], "type-fest")); // execute messages if (ExecuteMsg) { diff --git a/packages/wasm-ast-types/src/msg-builder/__snapshots__/msg-builder.spec.ts.snap b/packages/wasm-ast-types/src/msg-builder/__snapshots__/msg-builder.spec.ts.snap index e2b098e0..aafd28dd 100644 --- a/packages/wasm-ast-types/src/msg-builder/__snapshots__/msg-builder.spec.ts.snap +++ b/packages/wasm-ast-types/src/msg-builder/__snapshots__/msg-builder.spec.ts.snap @@ -5,10 +5,9 @@ exports[`execute class 1`] = ` static transferNft = ({ recipient, tokenId - }: { - recipient: string; - tokenId: string; - }): ExecuteMsg_for_Empty => { + }: CamelCasedProperties[\\"transfer_nft\\"]>): ExecuteMsg_for_Empty => { return { transfer_nft: ({ recipient, @@ -20,11 +19,9 @@ exports[`execute class 1`] = ` contract, msg, tokenId - }: { - contract: string; - msg: Binary; - tokenId: string; - }): ExecuteMsg_for_Empty => { + }: CamelCasedProperties[\\"send_nft\\"]>): ExecuteMsg_for_Empty => { return { send_nft: ({ contract, @@ -37,11 +34,9 @@ exports[`execute class 1`] = ` expires, spender, tokenId - }: { - expires?: Expiration; - spender: string; - tokenId: string; - }): ExecuteMsg_for_Empty => { + }: CamelCasedProperties[\\"approve\\"]>): ExecuteMsg_for_Empty => { return { approve: ({ expires, @@ -53,10 +48,9 @@ exports[`execute class 1`] = ` static revoke = ({ spender, tokenId - }: { - spender: string; - tokenId: string; - }): ExecuteMsg_for_Empty => { + }: CamelCasedProperties[\\"revoke\\"]>): ExecuteMsg_for_Empty => { return { revoke: ({ spender, @@ -67,10 +61,9 @@ exports[`execute class 1`] = ` static approveAll = ({ expires, operator - }: { - expires?: Expiration; - operator: string; - }): ExecuteMsg_for_Empty => { + }: CamelCasedProperties[\\"approve_all\\"]>): ExecuteMsg_for_Empty => { return { approve_all: ({ expires, @@ -80,9 +73,9 @@ exports[`execute class 1`] = ` }; static revokeAll = ({ operator - }: { - operator: string; - }): ExecuteMsg_for_Empty => { + }: CamelCasedProperties[\\"revoke_all\\"]>): ExecuteMsg_for_Empty => { return { revoke_all: ({ operator @@ -94,12 +87,9 @@ exports[`execute class 1`] = ` owner, tokenId, tokenUri - }: { - extension: Empty; - owner: string; - tokenId: string; - tokenUri?: string; - }): ExecuteMsg_for_Empty => { + }: CamelCasedProperties[\\"mint\\"]>): ExecuteMsg_for_Empty => { return { mint: ({ extension, @@ -111,9 +101,9 @@ exports[`execute class 1`] = ` }; static burn = ({ tokenId - }: { - tokenId: string; - }): ExecuteMsg_for_Empty => { + }: CamelCasedProperties[\\"burn\\"]>): ExecuteMsg_for_Empty => { return { burn: ({ token_id: tokenId @@ -128,10 +118,9 @@ exports[`query class 1`] = ` static ownerOf = ({ includeExpired, tokenId - }: { - includeExpired?: boolean; - tokenId: string; - }): QueryMsg => { + }: CamelCasedProperties[\\"owner_of\\"]>): QueryMsg => { return { owner_of: ({ include_expired: includeExpired, @@ -143,11 +132,9 @@ exports[`query class 1`] = ` includeExpired, spender, tokenId - }: { - includeExpired?: boolean; - spender: string; - tokenId: string; - }): QueryMsg => { + }: CamelCasedProperties[\\"approval\\"]>): QueryMsg => { return { approval: ({ include_expired: includeExpired, @@ -159,10 +146,9 @@ exports[`query class 1`] = ` static approvals = ({ includeExpired, tokenId - }: { - includeExpired?: boolean; - tokenId: string; - }): QueryMsg => { + }: CamelCasedProperties[\\"approvals\\"]>): QueryMsg => { return { approvals: ({ include_expired: includeExpired, @@ -175,12 +161,9 @@ exports[`query class 1`] = ` limit, owner, startAfter - }: { - includeExpired?: boolean; - limit?: number; - owner: string; - startAfter?: string; - }): QueryMsg => { + }: CamelCasedProperties[\\"all_operators\\"]>): QueryMsg => { return { all_operators: ({ include_expired: includeExpired, @@ -202,9 +185,9 @@ exports[`query class 1`] = ` }; static nftInfo = ({ tokenId - }: { - tokenId: string; - }): QueryMsg => { + }: CamelCasedProperties[\\"nft_info\\"]>): QueryMsg => { return { nft_info: ({ token_id: tokenId @@ -214,10 +197,9 @@ exports[`query class 1`] = ` static allNftInfo = ({ includeExpired, tokenId - }: { - includeExpired?: boolean; - tokenId: string; - }): QueryMsg => { + }: CamelCasedProperties[\\"all_nft_info\\"]>): QueryMsg => { return { all_nft_info: ({ include_expired: includeExpired, @@ -229,11 +211,9 @@ exports[`query class 1`] = ` limit, owner, startAfter - }: { - limit?: number; - owner: string; - startAfter?: string; - }): QueryMsg => { + }: CamelCasedProperties[\\"tokens\\"]>): QueryMsg => { return { tokens: ({ limit, @@ -245,10 +225,9 @@ exports[`query class 1`] = ` static allTokens = ({ limit, startAfter - }: { - limit?: number; - startAfter?: string; - }): QueryMsg => { + }: CamelCasedProperties[\\"all_tokens\\"]>): QueryMsg => { return { all_tokens: ({ limit, diff --git a/packages/wasm-ast-types/src/msg-builder/msg-builder.spec.ts b/packages/wasm-ast-types/src/msg-builder/msg-builder.spec.ts index 37f48461..5b1c43d4 100644 --- a/packages/wasm-ast-types/src/msg-builder/msg-builder.spec.ts +++ b/packages/wasm-ast-types/src/msg-builder/msg-builder.spec.ts @@ -2,7 +2,6 @@ import execute_msg from '../../../../__fixtures__/basic/execute_msg_for__empty.j import query_msg from '../../../../__fixtures__/basic/query_msg.json'; import { createMsgBuilderClass, - createMsgBuilderInterface } from './msg-builder' import { expectCode, makeContext } from '../../test-utils'; diff --git a/packages/wasm-ast-types/src/msg-builder/msg-builder.ts b/packages/wasm-ast-types/src/msg-builder/msg-builder.ts index 26a76152..fec31547 100644 --- a/packages/wasm-ast-types/src/msg-builder/msg-builder.ts +++ b/packages/wasm-ast-types/src/msg-builder/msg-builder.ts @@ -16,7 +16,7 @@ export const createMsgBuilderClass = ( context: RenderContext, className: string, msg: ExecuteMsg | QueryMsg -) => { +): t.ExportNamedDeclaration => { const staticMethods = getMessageProperties(msg).map((schema) => { return createStaticExecMethodMsgBuilder(context, schema, msg.title); }); @@ -28,6 +28,33 @@ export const createMsgBuilderClass = ( ); }; +/** + * CamelCasedProperties['exec_on_module']> + */ +function createExtractTypeAnnotation(underscoreName: string, msgTitle: string) { + return t.tsTypeAnnotation( + t.tsTypeReference( + t.identifier("CamelCasedProperties"), + t.tsTypeParameterInstantiation([ + t.tsIndexedAccessType( + t.tsTypeReference(t.identifier("Extract"), + t.tsTypeParameterInstantiation([ + t.tsTypeReference(t.identifier(msgTitle)), + t.tsTypeLiteral([ + t.tsPropertySignature( + t.identifier(underscoreName), + t.tsTypeAnnotation(t.tsUnknownKeyword()) + ) + ]) + ]) + ), + t.tsLiteralType(t.stringLiteral(underscoreName)) + ) + ]) + ) + ); +} + const createStaticExecMethodMsgBuilder = ( context: RenderContext, jsonschema: any, @@ -44,15 +71,19 @@ const createStaticExecMethodMsgBuilder = ( jsonschema.properties[underscoreName] ); + if (obj) obj.typeAnnotation = createExtractTypeAnnotation(underscoreName, msgTitle) + return t.classProperty( t.identifier(methodName), arrowFunctionExpression( + // params obj ? [ // props obj, ] : [], + // body t.blockStatement([ t.returnStatement( t.objectExpression([ diff --git a/packages/wasm-ast-types/types/msg-builder/msg-builder.d.ts b/packages/wasm-ast-types/types/msg-builder/msg-builder.d.ts index 2e2c329e..4a3f0edb 100644 --- a/packages/wasm-ast-types/types/msg-builder/msg-builder.d.ts +++ b/packages/wasm-ast-types/types/msg-builder/msg-builder.d.ts @@ -1,5 +1,4 @@ import * as t from '@babel/types'; -import { ExecuteMsg } from '../types'; +import { ExecuteMsg, QueryMsg } from '../types'; import { RenderContext } from '../context'; -export declare const createMsgBuilderClass: (context: RenderContext, className: string, execMsg: ExecuteMsg) => t.ExportNamedDeclaration; -export declare const createMsgBuilderInterface: (context: RenderContext, className: string, execMsg: ExecuteMsg) => t.ExportNamedDeclaration; +export declare const createMsgBuilderClass: (context: RenderContext, className: string, msg: ExecuteMsg | QueryMsg) => t.ExportNamedDeclaration; diff --git a/yarn.lock b/yarn.lock index 220b3fe5..5c41f663 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9218,6 +9218,18 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" +"wasm-ast-types@path:../wasm-ast-types": + version "0.17.0" + resolved "https://registry.npmjs.org/wasm-ast-types/-/wasm-ast-types-0.17.0.tgz#417280a61d60ea9964667cf2edb8f5281dc295d7" + integrity sha512-WeriXPbG67iI51Mf/5qRR0xcpEaTO/Wyjpl+vsmjZ5K6q/0W6iO03zHsESNIH/hpc5FPTpb0Y0L9xAtnnNe9Ow== + dependencies: + "@babel/runtime" "^7.18.9" + "@babel/types" "7.18.10" + "@jest/transform" "28.1.3" + ast-stringify "0.1.0" + case "1.6.3" + deepmerge "4.2.2" + wcwidth@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz" From 1f9aeae24ad28d2d53b899263f6a82865bdc8bb5 Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Wed, 15 Mar 2023 02:21:54 +0800 Subject: [PATCH 097/287] refactor builder into plugin style --- packages/ts-codegen/src/builder/builder.ts | 159 ++++++++---------- packages/ts-codegen/src/index.ts | 1 + packages/ts-codegen/src/plugins/client.ts | 108 ++++++++++++ packages/ts-codegen/src/plugins/index.ts | 1 + .../src/plugins/message-composer.ts | 80 +++++++++ .../ts-codegen/src/plugins/msg-builder.ts | 85 ++++++++++ .../ts-codegen/src/plugins/plugin-base.ts | 112 ++++++++++++ .../ts-codegen/src/plugins/react-query.ts | 115 +++++++++++++ packages/ts-codegen/src/plugins/recoil.ts | 89 ++++++++++ packages/ts-codegen/src/plugins/types.ts | 74 ++++++++ .../ts-codegen/types/src/builder/builder.d.ts | 20 ++- packages/ts-codegen/types/src/index.d.ts | 1 + .../ts-codegen/types/src/plugins/client.d.ts | 12 ++ .../ts-codegen/types/src/plugins/index.d.ts | 1 + .../types/src/plugins/message-composer.d.ts | 12 ++ .../types/src/plugins/msg-builder.d.ts | 12 ++ .../types/src/plugins/plugin-base.d.ts | 47 ++++++ .../types/src/plugins/react-query.d.ts | 12 ++ .../ts-codegen/types/src/plugins/recoil.d.ts | 13 ++ .../ts-codegen/types/src/plugins/types.d.ts | 12 ++ .../wasm-ast-types/src/context/context.ts | 44 ++++- .../wasm-ast-types/src/context/imports.ts | 64 +++++-- .../src/react-query/react-query.ts | 2 +- .../wasm-ast-types/types/context/context.d.ts | 31 +++- .../wasm-ast-types/types/context/imports.d.ts | 9 +- 25 files changed, 986 insertions(+), 130 deletions(-) create mode 100644 packages/ts-codegen/src/plugins/client.ts create mode 100644 packages/ts-codegen/src/plugins/index.ts create mode 100644 packages/ts-codegen/src/plugins/message-composer.ts create mode 100644 packages/ts-codegen/src/plugins/msg-builder.ts create mode 100644 packages/ts-codegen/src/plugins/plugin-base.ts create mode 100644 packages/ts-codegen/src/plugins/react-query.ts create mode 100644 packages/ts-codegen/src/plugins/recoil.ts create mode 100644 packages/ts-codegen/src/plugins/types.ts create mode 100644 packages/ts-codegen/types/src/plugins/client.d.ts create mode 100644 packages/ts-codegen/types/src/plugins/index.d.ts create mode 100644 packages/ts-codegen/types/src/plugins/message-composer.d.ts create mode 100644 packages/ts-codegen/types/src/plugins/msg-builder.d.ts create mode 100644 packages/ts-codegen/types/src/plugins/plugin-base.d.ts create mode 100644 packages/ts-codegen/types/src/plugins/react-query.d.ts create mode 100644 packages/ts-codegen/types/src/plugins/recoil.d.ts create mode 100644 packages/ts-codegen/types/src/plugins/types.d.ts diff --git a/packages/ts-codegen/src/builder/builder.ts b/packages/ts-codegen/src/builder/builder.ts index 1e0a35e5..b17ac22c 100644 --- a/packages/ts-codegen/src/builder/builder.ts +++ b/packages/ts-codegen/src/builder/builder.ts @@ -1,19 +1,13 @@ -import { RenderOptions, defaultOptions } from "wasm-ast-types"; +import { RenderOptions, defaultOptions, RenderContext, ContractInfo, MessageComposerOptions} from "wasm-ast-types"; import { header } from '../utils/header'; import { join } from "path"; import { writeFileSync } from 'fs'; import { sync as mkdirp } from "mkdirp"; -import generateMessageComposer from '../generators/message-composer'; -import generateMsgBuilder from '../generators/msg-builder'; -import generateTypes from '../generators/types'; -import generateReactQuery from '../generators/react-query'; -import generateRecoil from '../generators/recoil'; -import generateClient from '../generators/client'; - import { basename } from 'path'; import { readSchemas } from '../utils'; +import { IBuilderPlugin } from '../plugins'; import deepmerge from 'deepmerge'; import { pascal } from "case"; @@ -21,6 +15,12 @@ import { createFileBundle, recursiveModuleBundle } from "../bundler"; import generate from '@babel/generator'; import * as t from '@babel/types'; +import { ReactQueryPlugin } from "../plugins/react-query"; +import { RecoilPlugin } from "../plugins/recoil"; +import { MsgBuilderPlugin } from "../plugins/msg-builder"; +import { MessageComposerPlugin } from "../plugins/message-composer"; +import { ClientPlugin } from "../plugins/client"; +import { TypesPlugin } from "../plugins/types"; const defaultOpts: TSBuilderOptions = { bundle: { @@ -34,6 +34,7 @@ export interface TSBuilderInput { contracts: Array; outPath: string; options?: TSBuilderOptions; + plugins?: IBuilderPlugin[]; }; export interface BundleOptions { @@ -47,8 +48,11 @@ export type TSBuilderOptions = { bundle?: BundleOptions; } & RenderOptions; +export type BuilderFileType = 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer' | 'msg-builder' | 'plugin'; + export interface BuilderFile { - type: 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer' | 'msg-builder'; + type: BuilderFileType; + pluginType?: string; contract: string; localname: string; filename: string; @@ -58,14 +62,42 @@ export interface ContractFile { name: string; dir: string; } + +function getContract(contractOpt): ContractFile { + if (typeof contractOpt === 'string') { + const name = basename(contractOpt); + const contractName = pascal(name); + return { + name: contractName, + dir: contractOpt + } + } + return { + name: pascal(contractOpt.name), + dir: contractOpt.dir + }; +} + export class TSBuilder { contracts: Array; outPath: string; options?: TSBuilderOptions; + plugins: IBuilderPlugin[] = []; protected files: BuilderFile[] = []; - constructor({ contracts, outPath, options }: TSBuilderInput) { + loadDefaultPlugins() { + [].push.apply(this.plugins, [ + new TypesPlugin(this.options), + new ClientPlugin(this.options), + new MessageComposerPlugin(this.options), + new ReactQueryPlugin(this.options), + new RecoilPlugin(this.options), + new MsgBuilderPlugin(this.options), + ]); + } + + constructor({ contracts, outPath, options, plugins }: TSBuilderInput) { this.contracts = contracts; this.outPath = outPath; this.options = deepmerge( @@ -75,96 +107,43 @@ export class TSBuilder { ), options ?? {} ); - } - - getContracts(): ContractFile[] { - return this.contracts.map(contractOpt => { - if (typeof contractOpt === 'string') { - const name = basename(contractOpt); - const contractName = pascal(name); - return { - name: contractName, - dir: contractOpt - } - } - return { - name: pascal(contractOpt.name), - dir: contractOpt.dir - }; - }); - } - async renderTypes(contract: ContractFile) { - const { enabled, ...options } = this.options.types; - if (!enabled) return; - const contractInfo = await readSchemas({ - schemaDir: contract.dir - }); - const files = await generateTypes(contract.name, contractInfo, this.outPath, options); - [].push.apply(this.files, files); - } + this.loadDefaultPlugins(); - async renderClient(contract: ContractFile) { - const { enabled, ...options } = this.options.client; - if (!enabled) return; - const contractInfo = await readSchemas({ - schemaDir: contract.dir - }); - const files = await generateClient(contract.name, contractInfo, this.outPath, options); - [].push.apply(this.files, files); - } - - async renderRecoil(contract: ContractFile) { - const { enabled, ...options } = this.options.recoil; - if (!enabled) return; - const contractInfo = await readSchemas({ - schemaDir: contract.dir - }); - const files = await generateRecoil(contract.name, contractInfo, this.outPath, options); - [].push.apply(this.files, files); + if (plugins && plugins.length) { + [].push.apply(this.plugins, plugins); + } } - async renderReactQuery(contract: ContractFile) { - const { enabled, ...options } = this.options.reactQuery; - if (!enabled) return; - const contractInfo = await readSchemas({ - schemaDir: contract.dir - }); - const files = await generateReactQuery(contract.name, contractInfo, this.outPath, options); - [].push.apply(this.files, files); + async build() { + await this.process(); + await this.after(); } - async renderMessageComposer(contract: ContractFile) { - const { enabled, ...options } = this.options.messageComposer; - if (!enabled) return; - const contractInfo = await readSchemas({ - schemaDir: contract.dir - }); - const files = await generateMessageComposer(contract.name, contractInfo, this.outPath, options); - [].push.apply(this.files, files); + // lifecycle functions + private async process(){ + for (const contractOpt of this.contracts) { + const contract = getContract(contractOpt); + //resolve contract schema. + const contractInfo = await readSchemas({ + schemaDir: contract.dir + }); + + //lifecycle and plugins. + await this.render(contract.name, contractInfo); + } } - async renderMsgBuilder(contract: ContractFile) { - const { enabled, ...options } = this.options.messageComposer; - if (!enabled) return; - const contractInfo = await readSchemas({ - schemaDir: contract.dir - }); - const files = await generateMsgBuilder(contract.name, contractInfo, this.outPath, options); - [].push.apply(this.files, files); + private async render(name: string, contractInfo: ContractInfo){ + for (const plugin of this.plugins) { + let files = await plugin.render(name, contractInfo, this.outPath); + if(files && files.length){ + [].push.apply(this.files, files); + } + } } - async build() { - const contracts = this.getContracts(); - for (let c = 0; c < contracts.length; c++) { - const contract = contracts[c]; - await this.renderTypes(contract); - await this.renderClient(contract); - await this.renderMessageComposer(contract); - await this.renderMsgBuilder(contract); - await this.renderReactQuery(contract); - await this.renderRecoil(contract); - } + private async after(){ if (this.options.bundle.enabled) { this.bundle(); } diff --git a/packages/ts-codegen/src/index.ts b/packages/ts-codegen/src/index.ts index 472d70fe..f037df7b 100644 --- a/packages/ts-codegen/src/index.ts +++ b/packages/ts-codegen/src/index.ts @@ -9,6 +9,7 @@ export { default as generateRecoil } from './generators/recoil'; export * from './utils'; export * from './builder'; export * from './bundler'; +export * from './plugins'; export default async (input: TSBuilderInput) => { const builder = new TSBuilder(input); diff --git a/packages/ts-codegen/src/plugins/client.ts b/packages/ts-codegen/src/plugins/client.ts new file mode 100644 index 00000000..049e6702 --- /dev/null +++ b/packages/ts-codegen/src/plugins/client.ts @@ -0,0 +1,108 @@ +import { pascal } from 'case'; +import * as w from 'wasm-ast-types'; +import { findExecuteMsg, findAndParseTypes, findQueryMsg } from '../utils'; +import { + RenderContext, + ContractInfo, + RenderContextBase, + getMessageProperties, + RenderOptions +} from 'wasm-ast-types'; +import { BuilderFileType } from '../builder'; +import { BuilderPluginBase } from './plugin-base'; + +export class ClientPlugin extends BuilderPluginBase { + initContext( + contract: ContractInfo, + options?: RenderOptions + ): RenderContextBase { + return new RenderContext(contract, options); + } + + async doRender( + name: string, + context: RenderContext + ): Promise< + { + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[] + > { + const { enabled } = this.option.client; + + if (!enabled) { + return; + } + + const { schemas } = context.contract; + + const localname = pascal(name) + '.client.ts'; + const TypesFile = pascal(name) + '.types'; + const QueryMsg = findQueryMsg(schemas); + const ExecuteMsg = findExecuteMsg(schemas); + const typeHash = await findAndParseTypes(schemas); + + let Client = null; + let Instance = null; + let QueryClient = null; + let ReadOnlyInstance = null; + + const body = []; + + body.push(w.importStmt(Object.keys(typeHash), `./${TypesFile}`)); + + // query messages + if (QueryMsg) { + QueryClient = pascal(`${name}QueryClient`); + ReadOnlyInstance = pascal(`${name}ReadOnlyInterface`); + + body.push(w.createQueryInterface(context, ReadOnlyInstance, QueryMsg)); + body.push( + w.createQueryClass(context, QueryClient, ReadOnlyInstance, QueryMsg) + ); + } + + // execute messages + if (ExecuteMsg) { + const children = getMessageProperties(ExecuteMsg); + if (children.length > 0) { + Client = pascal(`${name}Client`); + Instance = pascal(`${name}Interface`); + + body.push( + w.createExecuteInterface( + context, + Instance, + this.option.client.execExtendsQuery ? ReadOnlyInstance : null, + ExecuteMsg + ) + ); + + body.push( + w.createExecuteClass( + context, + Client, + Instance, + this.option.client.execExtendsQuery ? QueryClient : null, + ExecuteMsg + ) + ); + } + } + + if (typeHash.hasOwnProperty('Coin')) { + // @ts-ignore + delete context.utils.Coin; + } + + return [ + { + type: 'client', + localname, + body + } + ]; + } +} diff --git a/packages/ts-codegen/src/plugins/index.ts b/packages/ts-codegen/src/plugins/index.ts new file mode 100644 index 00000000..58f95815 --- /dev/null +++ b/packages/ts-codegen/src/plugins/index.ts @@ -0,0 +1 @@ +export * from "./plugin-base" \ No newline at end of file diff --git a/packages/ts-codegen/src/plugins/message-composer.ts b/packages/ts-codegen/src/plugins/message-composer.ts new file mode 100644 index 00000000..6c6caa40 --- /dev/null +++ b/packages/ts-codegen/src/plugins/message-composer.ts @@ -0,0 +1,80 @@ +import { pascal } from 'case'; +import * as w from 'wasm-ast-types'; +import { findAndParseTypes, findExecuteMsg } from '../utils'; +import { + MessageComposerOptions, + getMessageProperties, + ContractInfo, + RenderContextBase, + RenderContext, + RenderOptions +} from 'wasm-ast-types'; +import { BuilderFileType } from '../builder'; +import { BuilderPluginBase } from './plugin-base'; + +export class MessageComposerPlugin extends BuilderPluginBase { + initContext( + contract: ContractInfo, + options?: RenderOptions + ): RenderContextBase { + return new RenderContext(contract, options); + } + + async doRender( + name: string, + context: RenderContext + ): Promise< + { + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[] + > { + const { enabled } = this.option.messageComposer; + + if (!enabled) { + return; + } + + const { schemas } = context.contract; + + const localname = pascal(name) + '.message-composer.ts'; + const TypesFile = pascal(name) + '.types'; + const ExecuteMsg = findExecuteMsg(schemas); + const typeHash = await findAndParseTypes(schemas); + + const body = []; + + body.push(w.importStmt(Object.keys(typeHash), `./${TypesFile}`)); + + // execute messages + if (ExecuteMsg) { + const children = getMessageProperties(ExecuteMsg); + if (children.length > 0) { + const TheClass = pascal(`${name}MessageComposer`); + const Interface = pascal(`${name}Message`); + + body.push( + w.createMessageComposerInterface(context, Interface, ExecuteMsg) + ); + body.push( + w.createMessageComposerClass(context, TheClass, Interface, ExecuteMsg) + ); + } + } + + if (typeHash.hasOwnProperty('Coin')) { + // @ts-ignore + delete context.utils.Coin; + } + + return [ + { + type: 'message-composer', + localname, + body + } + ]; + } +} diff --git a/packages/ts-codegen/src/plugins/msg-builder.ts b/packages/ts-codegen/src/plugins/msg-builder.ts new file mode 100644 index 00000000..918a3ad3 --- /dev/null +++ b/packages/ts-codegen/src/plugins/msg-builder.ts @@ -0,0 +1,85 @@ +import { pascal } from 'case'; +import * as w from 'wasm-ast-types'; +import { findAndParseTypes, findQueryMsg, findExecuteMsg } from '../utils'; +import { + getMessageProperties, + RenderContext, + RenderContextBase, + ContractInfo, + RenderOptions +} from 'wasm-ast-types'; +import { BuilderFileType } from '../builder'; +import { BuilderPluginBase } from './plugin-base'; + +export class MsgBuilderPlugin extends BuilderPluginBase { + initContext( + contract: ContractInfo, + options?: RenderOptions + ): RenderContextBase { + return new RenderContext(contract, options); + } + + async doRender( + name: string, + context: RenderContext + ): Promise< + { + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[] + > { + const { enabled } = this.option.msgBuilder; + + if (!enabled) { + return; + } + + const { schemas } = context.contract; + + const localname = pascal(name) + '.msg-builder.ts'; + const TypesFile = pascal(name) + '.types'; + const ExecuteMsg = findExecuteMsg(schemas); + const typeHash = await findAndParseTypes(schemas); + + const body = []; + + body.push(w.importStmt(Object.keys(typeHash), `./${TypesFile}`)); + body.push(w.importStmt(['CamelCasedProperties'], 'type-fest')); + + // execute messages + if (ExecuteMsg) { + const children = getMessageProperties(ExecuteMsg); + if (children.length > 0) { + const className = pascal(`${name}ExecuteMsgBuilder`); + + body.push(w.createMsgBuilderClass(context, className, ExecuteMsg)); + } + } + + const QueryMsg = findQueryMsg(schemas); + // query messages + if (QueryMsg) { + const children = getMessageProperties(QueryMsg); + if (children.length > 0) { + const className = pascal(`${name}QueryMsgBuilder`); + + body.push(w.createMsgBuilderClass(context, className, QueryMsg)); + } + } + + if (typeHash.hasOwnProperty('Coin')) { + // @ts-ignore + delete context.utils.Coin; + } + + return [ + { + type: 'msg-builder', + localname, + body + } + ]; + } +} diff --git a/packages/ts-codegen/src/plugins/plugin-base.ts b/packages/ts-codegen/src/plugins/plugin-base.ts new file mode 100644 index 00000000..c1dd4e58 --- /dev/null +++ b/packages/ts-codegen/src/plugins/plugin-base.ts @@ -0,0 +1,112 @@ +import { sync as mkdirp } from 'mkdirp'; +import { join } from 'path'; +import { writeFileSync } from 'fs'; +import { header } from '../utils/header'; +import { + ContractInfo, + UtilMapping, + IContext +} from 'wasm-ast-types'; +import generate from '@babel/generator'; +import * as t from '@babel/types'; +import { BuilderFile, BuilderFileType, TSBuilderOptions } from '../builder'; + +/** + * IBuilderPlugin is a common plugin that render generated code. + */ +export interface IBuilderPlugin { + /** + * a mapping of utils will be used in generated code. + */ + utils: UtilMapping; + + /** + * render generated cdoe. + * @param name the name of contract + * @param contractInfo contract + * @param outPath the path of generated code. + * @returns info of generated files. + */ + render( + name: string, + contractInfo: ContractInfo, + outPath: string, + ): Promise; +} + +/** + * BuilderPluginBase enable ts-codegen users implement their own plugins by only implement a few functions. + */ +export abstract class BuilderPluginBase implements IBuilderPlugin { + option: TOpt; + utils: UtilMapping; + + constructor(opt: TOpt) { + this.option = opt; + } + + async render( + name: string, + contractInfo: ContractInfo, + outPath: string + ): Promise { + const { enabled } = this.option; + + if (!enabled) { + return; + } + + const context = this.initContext(contractInfo, this.option); + + const results = await this.doRender(name, context); + + if (!results || !results.length) { + return []; + } + + return results.map((result) => { + const imports = context.getImports(this.utils); + const code = + header + generate(t.program([...imports, ...result.body])).code; + + mkdirp(outPath); + const filename = join(outPath, result.localname); + writeFileSync(filename, code); + + return { + type: result.type, + pluginType: result.pluginType, + contract: name, + localname: result.localname, + filename + }; + }); + } + + /** + * init context here + * @param contract + * @param options + */ + abstract initContext( + contract: ContractInfo, + options?: TOpt + ): IContext; + + /** + * render generated code here. + * @param name + * @param context + */ + abstract doRender( + name: string, + context: IContext + ): Promise< + { + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[] + >; +} diff --git a/packages/ts-codegen/src/plugins/react-query.ts b/packages/ts-codegen/src/plugins/react-query.ts new file mode 100644 index 00000000..67585351 --- /dev/null +++ b/packages/ts-codegen/src/plugins/react-query.ts @@ -0,0 +1,115 @@ +import { pascal } from 'case'; +import * as w from 'wasm-ast-types'; +import { findAndParseTypes, findExecuteMsg, findQueryMsg } from '../utils'; +import { + getMessageProperties, + ContractInfo, + RenderOptions, + RenderContextBase, + RenderContext +} from 'wasm-ast-types'; +import { BuilderFileType } from '../builder'; +import { BuilderPluginBase } from './plugin-base'; + +export class ReactQueryPlugin extends BuilderPluginBase { + initContext( + contract: ContractInfo, + options?: RenderOptions + ): RenderContextBase { + return new RenderContext(contract, options); + } + + async doRender( + name: string, + context: RenderContext + ): Promise< + { + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[] + > { + const options = this.option.reactQuery; + + const { enabled } = options; + + if (!enabled) { + return; + } + + const { schemas } = context.contract; + + const localname = pascal(`${name}`) + '.react-query.ts'; + const ContractFile = pascal(`${name}`) + '.client'; + const TypesFile = pascal(`${name}`) + '.types'; + + const QueryMsg = findQueryMsg(schemas); + const ExecuteMsg = findExecuteMsg(schemas); + const typeHash = await findAndParseTypes(schemas); + + const ExecuteClient = pascal(`${name}Client`); + const QueryClient = pascal(`${name}QueryClient`); + + const body = []; + + const clientImports = []; + + QueryMsg && clientImports.push(QueryClient); + + // check that there are commands within the exec msg + const shouldGenerateMutationHooks = + ExecuteMsg && + options?.version === 'v4' && + options?.mutations && + getMessageProperties(ExecuteMsg).length > 0; + + if (shouldGenerateMutationHooks) { + clientImports.push(ExecuteClient); + } + + // general contract imports + body.push(w.importStmt(Object.keys(typeHash), `./${TypesFile}`)); + + // client imports + body.push(w.importStmt(clientImports, `./${ContractFile}`)); + + // query messages + if (QueryMsg) { + [].push.apply( + body, + w.createReactQueryHooks({ + context, + queryMsg: QueryMsg, + contractName: name, + QueryClient + }) + ); + } + + if (shouldGenerateMutationHooks) { + [].push.apply( + body, + w.createReactQueryMutationHooks({ + context, + execMsg: ExecuteMsg, + contractName: name, + ExecuteClient + }) + ); + } + + if (typeHash.hasOwnProperty('Coin')) { + // @ts-ignore + delete context.utils.Coin; + } + + return [ + { + type: 'react-query', + localname, + body + } + ]; + } +} diff --git a/packages/ts-codegen/src/plugins/recoil.ts b/packages/ts-codegen/src/plugins/recoil.ts new file mode 100644 index 00000000..cb1803fa --- /dev/null +++ b/packages/ts-codegen/src/plugins/recoil.ts @@ -0,0 +1,89 @@ +import { pascal } from 'case'; +import * as w from 'wasm-ast-types'; +import { findAndParseTypes, findQueryMsg } from '../utils'; +import { + ContractInfo, + RenderContext, + RenderContextBase, + UtilMapping, + RenderOptions +} from 'wasm-ast-types'; +import { BuilderFileType } from '../builder'; +import { BuilderPluginBase } from './plugin-base'; + +export class RecoilPlugin extends BuilderPluginBase { + utils: UtilMapping = { + selectorFamily: 'recoil', + }; + initContext( + contract: ContractInfo, + options?: RenderOptions + ): RenderContextBase { + return new RenderContext(contract, options); + } + + async doRender( + name: string, + context: RenderContext + ): Promise< + { + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[] + > { + const { enabled } = this.option.recoil; + + if (!enabled) { + return; + } + + const { schemas } = context.contract; + + const localname = pascal(name) + '.recoil.ts'; + const ContractFile = pascal(name) + '.client'; + const TypesFile = pascal(name) + '.types'; + + const QueryMsg = findQueryMsg(schemas); + const typeHash = await findAndParseTypes(schemas); + + let QueryClient = null; + let ReadOnlyInstance = null; + + const body = []; + + body.push(w.importStmt(['cosmWasmClient'], './chain')); + + body.push(w.importStmt(Object.keys(typeHash), `./${TypesFile}`)); + + // query messages + if (QueryMsg) { + QueryClient = pascal(`${name}QueryClient`); + ReadOnlyInstance = pascal(`${name}ReadOnlyInterface`); + + body.push(w.importStmt([QueryClient], `./${ContractFile}`)); + + body.push(w.createRecoilQueryClientType()); + body.push(w.createRecoilQueryClient(context, name, QueryClient)); + + [].push.apply( + body, + w.createRecoilSelectors(context, name, QueryClient, QueryMsg) + ); + } + + if (typeHash.hasOwnProperty('Coin')) { + // @ts-ignore + delete context.utils.Coin; + } + + return [ + { + type: 'recoil', + localname, + body + } + ]; + } +} diff --git a/packages/ts-codegen/src/plugins/types.ts b/packages/ts-codegen/src/plugins/types.ts new file mode 100644 index 00000000..cfb74844 --- /dev/null +++ b/packages/ts-codegen/src/plugins/types.ts @@ -0,0 +1,74 @@ +import * as t from '@babel/types'; +import { clean } from '../utils/clean'; +import { pascal } from 'case'; +import { findExecuteMsg, findAndParseTypes, findQueryMsg } from '../utils'; +import { + ContractInfo, + RenderContext, + RenderContextBase, + RenderOptions +} from 'wasm-ast-types'; +import { BuilderFileType } from '../builder'; +import { BuilderPluginBase } from './plugin-base'; + +export class TypesPlugin extends BuilderPluginBase { + initContext( + contract: ContractInfo, + options?: RenderOptions + ): RenderContextBase { + return new RenderContext(contract, options); + } + + async doRender( + name: string, + context: RenderContext + ): Promise< + { + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[] + > { + const { enabled } = this.option.types; + + if (!enabled) { + return; + } + + const { schemas } = context.contract; + const options = this.option.types; + + const localname = pascal(name) + '.types.ts'; + const ExecuteMsg = findExecuteMsg(schemas); + const typeHash = await findAndParseTypes(schemas); + + const body = []; + + // TYPES + Object.values(typeHash).forEach((type: t.Node) => { + body.push(clean(type)); + }); + + // alias the ExecuteMsg + if (options.aliasExecuteMsg && ExecuteMsg) { + body.push( + t.exportNamedDeclaration( + t.tsTypeAliasDeclaration( + t.identifier(`${name}ExecuteMsg`), + null, + t.tsTypeReference(t.identifier('ExecuteMsg')) + ) + ) + ); + } + + return [ + { + type: 'type', + localname, + body + } + ]; + } +} diff --git a/packages/ts-codegen/types/src/builder/builder.d.ts b/packages/ts-codegen/types/src/builder/builder.d.ts index a18c95ed..fd4d598d 100644 --- a/packages/ts-codegen/types/src/builder/builder.d.ts +++ b/packages/ts-codegen/types/src/builder/builder.d.ts @@ -1,8 +1,10 @@ import { RenderOptions } from "wasm-ast-types"; +import { IBuilderPlugin } from '../plugins'; export interface TSBuilderInput { contracts: Array; outPath: string; options?: TSBuilderOptions; + plugins?: IBuilderPlugin[]; } export interface BundleOptions { enabled?: boolean; @@ -13,8 +15,10 @@ export interface BundleOptions { export type TSBuilderOptions = { bundle?: BundleOptions; } & RenderOptions; +export type BuilderFileType = 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer' | 'msg-builder' | 'plugin'; export interface BuilderFile { - type: 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer' | 'msg-builder'; + type: BuilderFileType; + pluginType?: string; contract: string; localname: string; filename: string; @@ -27,15 +31,13 @@ export declare class TSBuilder { contracts: Array; outPath: string; options?: TSBuilderOptions; + plugins: IBuilderPlugin[]; protected files: BuilderFile[]; - constructor({ contracts, outPath, options }: TSBuilderInput); - getContracts(): ContractFile[]; - renderTypes(contract: ContractFile): Promise; - renderClient(contract: ContractFile): Promise; - renderRecoil(contract: ContractFile): Promise; - renderReactQuery(contract: ContractFile): Promise; - renderMessageComposer(contract: ContractFile): Promise; - renderMsgBuilder(contract: ContractFile): Promise; + loadDefaultPlugins(): void; + constructor({ contracts, outPath, options, plugins }: TSBuilderInput); build(): Promise; + private process; + private render; + private after; bundle(): Promise; } diff --git a/packages/ts-codegen/types/src/index.d.ts b/packages/ts-codegen/types/src/index.d.ts index 871f47de..e53bb80f 100644 --- a/packages/ts-codegen/types/src/index.d.ts +++ b/packages/ts-codegen/types/src/index.d.ts @@ -7,5 +7,6 @@ export { default as generateRecoil } from './generators/recoil'; export * from './utils'; export * from './builder'; export * from './bundler'; +export * from './plugins'; declare const _default: (input: TSBuilderInput) => Promise; export default _default; diff --git a/packages/ts-codegen/types/src/plugins/client.d.ts b/packages/ts-codegen/types/src/plugins/client.d.ts new file mode 100644 index 00000000..43e278b5 --- /dev/null +++ b/packages/ts-codegen/types/src/plugins/client.d.ts @@ -0,0 +1,12 @@ +import { RenderContext, ContractInfo, RenderContextBase, RenderOptions } from 'wasm-ast-types'; +import { BuilderFileType } from '../builder'; +import { BuilderPluginBase } from './plugin-base'; +export declare class ClientPlugin extends BuilderPluginBase { + initContext(contract: ContractInfo, options?: RenderOptions): RenderContextBase; + doRender(name: string, context: RenderContext): Promise<{ + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[]>; +} diff --git a/packages/ts-codegen/types/src/plugins/index.d.ts b/packages/ts-codegen/types/src/plugins/index.d.ts new file mode 100644 index 00000000..b6bdd472 --- /dev/null +++ b/packages/ts-codegen/types/src/plugins/index.d.ts @@ -0,0 +1 @@ +export * from "./plugin-base"; diff --git a/packages/ts-codegen/types/src/plugins/message-composer.d.ts b/packages/ts-codegen/types/src/plugins/message-composer.d.ts new file mode 100644 index 00000000..80f98965 --- /dev/null +++ b/packages/ts-codegen/types/src/plugins/message-composer.d.ts @@ -0,0 +1,12 @@ +import { ContractInfo, RenderContextBase, RenderContext, RenderOptions } from 'wasm-ast-types'; +import { BuilderFileType } from '../builder'; +import { BuilderPluginBase } from './plugin-base'; +export declare class MessageComposerPlugin extends BuilderPluginBase { + initContext(contract: ContractInfo, options?: RenderOptions): RenderContextBase; + doRender(name: string, context: RenderContext): Promise<{ + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[]>; +} diff --git a/packages/ts-codegen/types/src/plugins/msg-builder.d.ts b/packages/ts-codegen/types/src/plugins/msg-builder.d.ts new file mode 100644 index 00000000..bd5e0467 --- /dev/null +++ b/packages/ts-codegen/types/src/plugins/msg-builder.d.ts @@ -0,0 +1,12 @@ +import { RenderContext, RenderContextBase, ContractInfo, RenderOptions } from 'wasm-ast-types'; +import { BuilderFileType } from '../builder'; +import { BuilderPluginBase } from './plugin-base'; +export declare class MsgBuilderPlugin extends BuilderPluginBase { + initContext(contract: ContractInfo, options?: RenderOptions): RenderContextBase; + doRender(name: string, context: RenderContext): Promise<{ + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[]>; +} diff --git a/packages/ts-codegen/types/src/plugins/plugin-base.d.ts b/packages/ts-codegen/types/src/plugins/plugin-base.d.ts new file mode 100644 index 00000000..efa14960 --- /dev/null +++ b/packages/ts-codegen/types/src/plugins/plugin-base.d.ts @@ -0,0 +1,47 @@ +import { ContractInfo, UtilMapping, IContext } from 'wasm-ast-types'; +import { BuilderFile, BuilderFileType } from '../builder'; +/** + * IBuilderPlugin is a common plugin that render generated code. + */ +export interface IBuilderPlugin { + /** + * a mapping of utils will be used in generated code. + */ + utils: UtilMapping; + /** + * render generated cdoe. + * @param name the name of contract + * @param contractInfo contract + * @param outPath the path of generated code. + * @returns info of generated files. + */ + render(name: string, contractInfo: ContractInfo, outPath: string): Promise; +} +/** + * BuilderPluginBase enable ts-codegen users implement their own plugins by only implement a few functions. + */ +export declare abstract class BuilderPluginBase implements IBuilderPlugin { + option: TOpt; + utils: UtilMapping; + constructor(opt: TOpt); + render(name: string, contractInfo: ContractInfo, outPath: string): Promise; + /** + * init context here + * @param contract + * @param options + */ + abstract initContext(contract: ContractInfo, options?: TOpt): IContext; + /** + * render generated code here. + * @param name + * @param context + */ + abstract doRender(name: string, context: IContext): Promise<{ + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[]>; +} diff --git a/packages/ts-codegen/types/src/plugins/react-query.d.ts b/packages/ts-codegen/types/src/plugins/react-query.d.ts new file mode 100644 index 00000000..ff34e39a --- /dev/null +++ b/packages/ts-codegen/types/src/plugins/react-query.d.ts @@ -0,0 +1,12 @@ +import { ContractInfo, RenderOptions, RenderContextBase, RenderContext } from 'wasm-ast-types'; +import { BuilderFileType } from '../builder'; +import { BuilderPluginBase } from './plugin-base'; +export declare class ReactQueryPlugin extends BuilderPluginBase { + initContext(contract: ContractInfo, options?: RenderOptions): RenderContextBase; + doRender(name: string, context: RenderContext): Promise<{ + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[]>; +} diff --git a/packages/ts-codegen/types/src/plugins/recoil.d.ts b/packages/ts-codegen/types/src/plugins/recoil.d.ts new file mode 100644 index 00000000..16c70a39 --- /dev/null +++ b/packages/ts-codegen/types/src/plugins/recoil.d.ts @@ -0,0 +1,13 @@ +import { ContractInfo, RenderContext, RenderContextBase, UtilMapping, RenderOptions } from 'wasm-ast-types'; +import { BuilderFileType } from '../builder'; +import { BuilderPluginBase } from './plugin-base'; +export declare class RecoilPlugin extends BuilderPluginBase { + utils: UtilMapping; + initContext(contract: ContractInfo, options?: RenderOptions): RenderContextBase; + doRender(name: string, context: RenderContext): Promise<{ + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[]>; +} diff --git a/packages/ts-codegen/types/src/plugins/types.d.ts b/packages/ts-codegen/types/src/plugins/types.d.ts new file mode 100644 index 00000000..b45d780c --- /dev/null +++ b/packages/ts-codegen/types/src/plugins/types.d.ts @@ -0,0 +1,12 @@ +import { ContractInfo, RenderContext, RenderContextBase, RenderOptions } from 'wasm-ast-types'; +import { BuilderFileType } from '../builder'; +import { BuilderPluginBase } from './plugin-base'; +export declare class TypesPlugin extends BuilderPluginBase { + initContext(contract: ContractInfo, options?: RenderOptions): RenderContextBase; + doRender(name: string, context: RenderContext): Promise<{ + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[]>; +} diff --git a/packages/wasm-ast-types/src/context/context.ts b/packages/wasm-ast-types/src/context/context.ts index b93ac877..2b325705 100644 --- a/packages/wasm-ast-types/src/context/context.ts +++ b/packages/wasm-ast-types/src/context/context.ts @@ -1,5 +1,5 @@ import { JSONSchema } from "../types"; -import { convertUtilsToImportList, getImportStatements } from "./imports"; +import { convertUtilsToImportList, getImportStatements, UtilMapping } from "./imports"; import deepmerge from "deepmerge"; /// Plugin Types @@ -55,6 +55,7 @@ export interface ContractInfo { idlObject?: IDLObject; }; export interface RenderOptions { + enabled?: boolean; types?: TSTypesOptions; recoil?: RecoilOptions; messageComposer?: MessageComposerOptions; @@ -63,12 +64,20 @@ export interface RenderOptions { reactQuery?: ReactQueryOptions; } -export interface RenderContext { + +export interface IContext { + refLookup($ref: string); + addUtil(util: string); + getImports(registeredUtils?: UtilMapping); +} + +export interface IRenderContext extends IContext { contract: ContractInfo; - options: RenderOptions; + options: TOpt; } export const defaultOptions: RenderOptions = { + enabled: true, types: { enabled: true, aliasExecuteMsg: false @@ -114,18 +123,30 @@ export const getDefinitionSchema = (schemas: JSONSchema[]): JSONSchema => { return aggregateSchema; }; -export class RenderContext implements RenderContext { + +/** + * context object for generating code. + * only mergeDefaultOpt needs to implementing for combine options and default options. + * @param TOpt option type + */ +export abstract class RenderContextBase implements IRenderContext { contract: ContractInfo; utils: string[] = []; schema: JSONSchema; + options: TOpt; constructor( contract: ContractInfo, - options?: RenderOptions + options?: TOpt ) { this.contract = contract; this.schema = getDefinitionSchema(contract.schemas); - this.options = deepmerge(defaultOptions, options ?? {}); + this.options = this.mergeDefaultOpt(options); } + /** + * merge options and default options + * @param options + */ + abstract mergeDefaultOpt(options: TOpt): TOpt; refLookup($ref: string) { const refName = $ref.replace('#/definitions/', '') return this.schema.definitions?.[refName]; @@ -133,12 +154,19 @@ export class RenderContext implements RenderContext { addUtil(util: string) { this.utils[util] = true; } - getImports() { + getImports(registeredUtils?: UtilMapping) { return getImportStatements( convertUtilsToImportList( this, - Object.keys(this.utils) + Object.keys(this.utils), + registeredUtils, ) ); } } + +export class RenderContext extends RenderContextBase{ + mergeDefaultOpt(options: RenderOptions): RenderOptions { + return deepmerge(defaultOptions, options ?? {}); + } +} diff --git a/packages/wasm-ast-types/src/context/imports.ts b/packages/wasm-ast-types/src/context/imports.ts index dcecdd29..8669b81a 100644 --- a/packages/wasm-ast-types/src/context/imports.ts +++ b/packages/wasm-ast-types/src/context/imports.ts @@ -2,6 +2,7 @@ import * as t from '@babel/types'; import { importAs, importStmt } from "../utils"; import { RenderContext } from './context'; + export interface ImportObj { type: 'import' | 'default' | 'namespace'; name: string; @@ -9,6 +10,14 @@ export interface ImportObj { importAs?: string; } +export type GetUtilFn = ((...args: any[]) => (context: TContext) => ImportObj); +export type UtilMapping = { + [key: string]: + | ImportObj + | string + | GetUtilFn +}; + const makeReactQuerySwitch = (varName) => { return (context: RenderContext) => { switch (context.options.reactQuery.version) { @@ -30,11 +39,11 @@ const makeReactQuerySwitch = (varName) => { } export const UTILS = { + selectorFamily: 'recoil', MsgExecuteContract: 'cosmjs-types/cosmwasm/wasm/v1/tx', MsgExecuteContractEncodeObject: 'cosmwasm', Coin: '@cosmjs/amino', toUtf8: '@cosmjs/encoding', - selectorFamily: 'recoil', StdFee: '@cosmjs/amino', CosmWasmClient: '@cosmjs/cosmwasm-stargate', ExecuteResult: '@cosmjs/cosmwasm-stargate', @@ -50,23 +59,48 @@ export const UTILS = { export const convertUtilsToImportList = ( context: RenderContext, - utils: string[] + utils: string[], + registeredUtils?: UtilMapping ): ImportObj[] => { - return utils.map(util => { - if (!UTILS.hasOwnProperty(util)) throw new Error(`missing Util! ::[${util}]`); - if (typeof UTILS[util] === 'string') { - return { - type: 'import', - path: UTILS[util], - name: util - }; - } else if (typeof UTILS[util] === 'function') { - return UTILS[util](context); - } else { - UTILS[util]; + return utils.map((util) => { + let result = null; + + if(registeredUtils){ + result = convertUtil(context, util, registeredUtils); + + if (result) { + return result; + } } + + result = convertUtil(context, util, UTILS); + + if (result) { + return result; + } + + throw new Error(`missing Util! ::[${util}]`); }); -} +}; + +export const convertUtil = ( + context: RenderContext, + util: string, + registeredUtils: object +): ImportObj => { + if (!registeredUtils.hasOwnProperty(util)) return null; + if (typeof registeredUtils[util] === 'string') { + return { + type: 'import', + path: registeredUtils[util], + name: util + }; + } else if (typeof registeredUtils[util] === 'function') { + return registeredUtils[util](context); + } else { + return registeredUtils[util]; + } +}; export const getImportStatements = (list: ImportObj[]) => { const imports = list.reduce((m, obj) => { diff --git a/packages/wasm-ast-types/src/react-query/react-query.ts b/packages/wasm-ast-types/src/react-query/react-query.ts index 6a6a50a5..29ddc4cb 100644 --- a/packages/wasm-ast-types/src/react-query/react-query.ts +++ b/packages/wasm-ast-types/src/react-query/react-query.ts @@ -432,7 +432,7 @@ export const createReactQueryMutationArgsInterface = ({ // @ts-ignore:next-line param.typeAnnotation, param.optional - ) + ) as t.TSTypeElement ) ) ) diff --git a/packages/wasm-ast-types/types/context/context.d.ts b/packages/wasm-ast-types/types/context/context.d.ts index a5a006ab..073ca6cd 100644 --- a/packages/wasm-ast-types/types/context/context.d.ts +++ b/packages/wasm-ast-types/types/context/context.d.ts @@ -1,4 +1,5 @@ import { JSONSchema } from "../types"; +import { UtilMapping } from "./imports"; export interface ReactQueryOptions { enabled?: boolean; optionalClient?: boolean; @@ -46,6 +47,7 @@ export interface ContractInfo { idlObject?: IDLObject; } export interface RenderOptions { + enabled?: boolean; types?: TSTypesOptions; recoil?: RecoilOptions; messageComposer?: MessageComposerOptions; @@ -53,19 +55,38 @@ export interface RenderOptions { client?: TSClientOptions; reactQuery?: ReactQueryOptions; } -export interface RenderContext { +export interface IContext { + refLookup($ref: string): any; + addUtil(util: string): any; + getImports(registeredUtils?: UtilMapping): any; +} +export interface IRenderContext extends IContext { contract: ContractInfo; - options: RenderOptions; + options: TOpt; } export declare const defaultOptions: RenderOptions; export declare const getDefinitionSchema: (schemas: JSONSchema[]) => JSONSchema; -export declare class RenderContext implements RenderContext { +/** + * context object for generating code. + * only mergeDefaultOpt needs to implementing for combine options and default options. + * @param TOpt option type + */ +export declare abstract class RenderContextBase implements IRenderContext { contract: ContractInfo; utils: string[]; schema: JSONSchema; - constructor(contract: ContractInfo, options?: RenderOptions); + options: TOpt; + constructor(contract: ContractInfo, options?: TOpt); + /** + * merge options and default options + * @param options + */ + abstract mergeDefaultOpt(options: TOpt): TOpt; refLookup($ref: string): JSONSchema; addUtil(util: string): void; - getImports(): any[]; + getImports(registeredUtils?: UtilMapping): any; +} +export declare class RenderContext extends RenderContextBase { + mergeDefaultOpt(options: RenderOptions): RenderOptions; } export {}; diff --git a/packages/wasm-ast-types/types/context/imports.d.ts b/packages/wasm-ast-types/types/context/imports.d.ts index c7b0ac7a..d88549ce 100644 --- a/packages/wasm-ast-types/types/context/imports.d.ts +++ b/packages/wasm-ast-types/types/context/imports.d.ts @@ -5,12 +5,16 @@ export interface ImportObj { path: string; importAs?: string; } +export type GetUtilFn = ((...args: any[]) => (context: TContext) => ImportObj); +export type UtilMapping = { + [key: string]: ImportObj | string | GetUtilFn; +}; export declare const UTILS: { + selectorFamily: string; MsgExecuteContract: string; MsgExecuteContractEncodeObject: string; Coin: string; toUtf8: string; - selectorFamily: string; StdFee: string; CosmWasmClient: string; ExecuteResult: string; @@ -36,5 +40,6 @@ export declare const UTILS: { name: any; }; }; -export declare const convertUtilsToImportList: (context: RenderContext, utils: string[]) => ImportObj[]; +export declare const convertUtilsToImportList: (context: RenderContext, utils: string[], registeredUtils?: UtilMapping) => ImportObj[]; +export declare const convertUtil: (context: RenderContext, util: string, registeredUtils: object) => ImportObj; export declare const getImportStatements: (list: ImportObj[]) => any[]; From d91a4f6949fdcfe408710ea2e9a1f2812680fe5d Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Wed, 15 Mar 2023 02:26:35 +0800 Subject: [PATCH 098/287] update test results --- __output__/builder/bundler_test/index.ts | 86 ++-- __output__/builder/default/index.ts | 30 +- __output__/builder/no-extends/index.ts | 30 +- .../__snapshots__/builder.test.ts.snap | 454 ++++++++++++++++++ 4 files changed, 522 insertions(+), 78 deletions(-) diff --git a/__output__/builder/bundler_test/index.ts b/__output__/builder/bundler_test/index.ts index a8cfa26a..8dedea79 100644 --- a/__output__/builder/bundler_test/index.ts +++ b/__output__/builder/bundler_test/index.ts @@ -7,69 +7,59 @@ import * as _75 from "./contracts/Factory.types"; import * as _76 from "./contracts/Factory.client"; import * as _77 from "./contracts/Factory.message-composer"; -import * as _78 from "./contracts/Factory.msg-builder"; -import * as _79 from "./contracts/Factory.react-query"; -import * as _80 from "./contracts/Factory.recoil"; -import * as _81 from "./contracts/Minter.types"; -import * as _82 from "./contracts/Minter.client"; -import * as _83 from "./contracts/Minter.message-composer"; -import * as _84 from "./contracts/Minter.msg-builder"; -import * as _85 from "./contracts/Minter.react-query"; -import * as _86 from "./contracts/Minter.recoil"; -import * as _87 from "./contracts/CwAdminFactory.types"; -import * as _88 from "./contracts/CwAdminFactory.client"; -import * as _89 from "./contracts/CwAdminFactory.message-composer"; -import * as _90 from "./contracts/CwAdminFactory.msg-builder"; -import * as _91 from "./contracts/CwAdminFactory.react-query"; -import * as _92 from "./contracts/CwAdminFactory.recoil"; -import * as _93 from "./contracts/CwCodeIdRegistry.types"; -import * as _94 from "./contracts/CwCodeIdRegistry.client"; -import * as _95 from "./contracts/CwCodeIdRegistry.message-composer"; -import * as _96 from "./contracts/CwCodeIdRegistry.msg-builder"; -import * as _97 from "./contracts/CwCodeIdRegistry.react-query"; -import * as _98 from "./contracts/CwCodeIdRegistry.recoil"; -import * as _99 from "./contracts/CwSingle.types"; -import * as _100 from "./contracts/CwSingle.client"; -import * as _101 from "./contracts/CwSingle.message-composer"; -import * as _102 from "./contracts/CwSingle.msg-builder"; -import * as _103 from "./contracts/CwSingle.react-query"; -import * as _104 from "./contracts/CwSingle.recoil"; +import * as _78 from "./contracts/Factory.react-query"; +import * as _79 from "./contracts/Factory.recoil"; +import * as _80 from "./contracts/Minter.types"; +import * as _81 from "./contracts/Minter.client"; +import * as _82 from "./contracts/Minter.message-composer"; +import * as _83 from "./contracts/Minter.react-query"; +import * as _84 from "./contracts/Minter.recoil"; +import * as _85 from "./contracts/CwAdminFactory.types"; +import * as _86 from "./contracts/CwAdminFactory.client"; +import * as _87 from "./contracts/CwAdminFactory.message-composer"; +import * as _88 from "./contracts/CwAdminFactory.react-query"; +import * as _89 from "./contracts/CwAdminFactory.recoil"; +import * as _90 from "./contracts/CwCodeIdRegistry.types"; +import * as _91 from "./contracts/CwCodeIdRegistry.client"; +import * as _92 from "./contracts/CwCodeIdRegistry.message-composer"; +import * as _93 from "./contracts/CwCodeIdRegistry.react-query"; +import * as _94 from "./contracts/CwCodeIdRegistry.recoil"; +import * as _95 from "./contracts/CwSingle.types"; +import * as _96 from "./contracts/CwSingle.client"; +import * as _97 from "./contracts/CwSingle.message-composer"; +import * as _98 from "./contracts/CwSingle.react-query"; +import * as _99 from "./contracts/CwSingle.recoil"; export namespace smart { export namespace contracts { export const Factory = { ..._75, ..._76, ..._77, ..._78, - ..._79, - ..._80 + ..._79 }; - export const Minter = { ..._81, + export const Minter = { ..._80, + ..._81, ..._82, ..._83, - ..._84, - ..._85, - ..._86 + ..._84 }; - export const CwAdminFactory = { ..._87, + export const CwAdminFactory = { ..._85, + ..._86, + ..._87, ..._88, - ..._89, - ..._90, + ..._89 + }; + export const CwCodeIdRegistry = { ..._90, ..._91, - ..._92 + ..._92, + ..._93, + ..._94 }; - export const CwCodeIdRegistry = { ..._93, - ..._94, - ..._95, + export const CwSingle = { ..._95, ..._96, ..._97, - ..._98 - }; - export const CwSingle = { ..._99, - ..._100, - ..._101, - ..._102, - ..._103, - ..._104 + ..._98, + ..._99 }; } } \ No newline at end of file diff --git a/__output__/builder/default/index.ts b/__output__/builder/default/index.ts index 7b947b6b..d991e94c 100644 --- a/__output__/builder/default/index.ts +++ b/__output__/builder/default/index.ts @@ -7,33 +7,33 @@ import * as _15 from "./Factory.types"; import * as _16 from "./Factory.client"; import * as _17 from "./Factory.message-composer"; -import * as _18 from "./Factory.msg-builder"; -import * as _19 from "./Factory.react-query"; -import * as _20 from "./Factory.recoil"; +import * as _18 from "./Factory.react-query"; +import * as _19 from "./Factory.recoil"; +import * as _20 from "./Factory.msg-builder"; import * as _21 from "./Minter.types"; import * as _22 from "./Minter.client"; import * as _23 from "./Minter.message-composer"; -import * as _24 from "./Minter.msg-builder"; -import * as _25 from "./Minter.react-query"; -import * as _26 from "./Minter.recoil"; +import * as _24 from "./Minter.react-query"; +import * as _25 from "./Minter.recoil"; +import * as _26 from "./Minter.msg-builder"; import * as _27 from "./CwAdminFactory.types"; import * as _28 from "./CwAdminFactory.client"; import * as _29 from "./CwAdminFactory.message-composer"; -import * as _30 from "./CwAdminFactory.msg-builder"; -import * as _31 from "./CwAdminFactory.react-query"; -import * as _32 from "./CwAdminFactory.recoil"; +import * as _30 from "./CwAdminFactory.react-query"; +import * as _31 from "./CwAdminFactory.recoil"; +import * as _32 from "./CwAdminFactory.msg-builder"; import * as _33 from "./CwCodeIdRegistry.types"; import * as _34 from "./CwCodeIdRegistry.client"; import * as _35 from "./CwCodeIdRegistry.message-composer"; -import * as _36 from "./CwCodeIdRegistry.msg-builder"; -import * as _37 from "./CwCodeIdRegistry.react-query"; -import * as _38 from "./CwCodeIdRegistry.recoil"; +import * as _36 from "./CwCodeIdRegistry.react-query"; +import * as _37 from "./CwCodeIdRegistry.recoil"; +import * as _38 from "./CwCodeIdRegistry.msg-builder"; import * as _39 from "./CwSingle.types"; import * as _40 from "./CwSingle.client"; import * as _41 from "./CwSingle.message-composer"; -import * as _42 from "./CwSingle.msg-builder"; -import * as _43 from "./CwSingle.react-query"; -import * as _44 from "./CwSingle.recoil"; +import * as _42 from "./CwSingle.react-query"; +import * as _43 from "./CwSingle.recoil"; +import * as _44 from "./CwSingle.msg-builder"; export namespace smart { export namespace contracts { export const Factory = { ..._15, diff --git a/__output__/builder/no-extends/index.ts b/__output__/builder/no-extends/index.ts index 6a2abe65..2c07b1e3 100644 --- a/__output__/builder/no-extends/index.ts +++ b/__output__/builder/no-extends/index.ts @@ -7,33 +7,33 @@ import * as _45 from "./Factory.types"; import * as _46 from "./Factory.client"; import * as _47 from "./Factory.message-composer"; -import * as _48 from "./Factory.msg-builder"; -import * as _49 from "./Factory.react-query"; -import * as _50 from "./Factory.recoil"; +import * as _48 from "./Factory.react-query"; +import * as _49 from "./Factory.recoil"; +import * as _50 from "./Factory.msg-builder"; import * as _51 from "./Minter.types"; import * as _52 from "./Minter.client"; import * as _53 from "./Minter.message-composer"; -import * as _54 from "./Minter.msg-builder"; -import * as _55 from "./Minter.react-query"; -import * as _56 from "./Minter.recoil"; +import * as _54 from "./Minter.react-query"; +import * as _55 from "./Minter.recoil"; +import * as _56 from "./Minter.msg-builder"; import * as _57 from "./CwAdminFactory.types"; import * as _58 from "./CwAdminFactory.client"; import * as _59 from "./CwAdminFactory.message-composer"; -import * as _60 from "./CwAdminFactory.msg-builder"; -import * as _61 from "./CwAdminFactory.react-query"; -import * as _62 from "./CwAdminFactory.recoil"; +import * as _60 from "./CwAdminFactory.react-query"; +import * as _61 from "./CwAdminFactory.recoil"; +import * as _62 from "./CwAdminFactory.msg-builder"; import * as _63 from "./CwCodeIdRegistry.types"; import * as _64 from "./CwCodeIdRegistry.client"; import * as _65 from "./CwCodeIdRegistry.message-composer"; -import * as _66 from "./CwCodeIdRegistry.msg-builder"; -import * as _67 from "./CwCodeIdRegistry.react-query"; -import * as _68 from "./CwCodeIdRegistry.recoil"; +import * as _66 from "./CwCodeIdRegistry.react-query"; +import * as _67 from "./CwCodeIdRegistry.recoil"; +import * as _68 from "./CwCodeIdRegistry.msg-builder"; import * as _69 from "./CwSingle.types"; import * as _70 from "./CwSingle.client"; import * as _71 from "./CwSingle.message-composer"; -import * as _72 from "./CwSingle.msg-builder"; -import * as _73 from "./CwSingle.react-query"; -import * as _74 from "./CwSingle.recoil"; +import * as _72 from "./CwSingle.react-query"; +import * as _73 from "./CwSingle.recoil"; +import * as _74 from "./CwSingle.msg-builder"; export namespace smart { export namespace contracts { export const Factory = { ..._45, diff --git a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap index a765e207..21f9e9a1 100644 --- a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap +++ b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap @@ -14,6 +14,7 @@ TSBuilder { "execExtendsQuery": true, "noImplicitOverride": false, }, + "enabled": true, "messageComposer": Object { "enabled": false, }, @@ -36,6 +37,232 @@ TSBuilder { "enabled": true, }, }, + "plugins": Array [ + TypesPlugin { + "option": Object { + "bundle": Object { + "bundleFile": "bundle.ts", + "enabled": true, + "scope": "contracts", + }, + "client": Object { + "enabled": true, + "execExtendsQuery": true, + "noImplicitOverride": false, + }, + "enabled": true, + "messageComposer": Object { + "enabled": false, + }, + "msgBuilder": Object { + "enabled": false, + }, + "reactQuery": Object { + "camelize": true, + "enabled": true, + "mutations": false, + "optionalClient": false, + "queryKeys": false, + "version": "v3", + }, + "recoil": Object { + "enabled": false, + }, + "types": Object { + "aliasExecuteMsg": false, + "enabled": true, + }, + }, + "utils": undefined, + }, + ClientPlugin { + "option": Object { + "bundle": Object { + "bundleFile": "bundle.ts", + "enabled": true, + "scope": "contracts", + }, + "client": Object { + "enabled": true, + "execExtendsQuery": true, + "noImplicitOverride": false, + }, + "enabled": true, + "messageComposer": Object { + "enabled": false, + }, + "msgBuilder": Object { + "enabled": false, + }, + "reactQuery": Object { + "camelize": true, + "enabled": true, + "mutations": false, + "optionalClient": false, + "queryKeys": false, + "version": "v3", + }, + "recoil": Object { + "enabled": false, + }, + "types": Object { + "aliasExecuteMsg": false, + "enabled": true, + }, + }, + "utils": undefined, + }, + MessageComposerPlugin { + "option": Object { + "bundle": Object { + "bundleFile": "bundle.ts", + "enabled": true, + "scope": "contracts", + }, + "client": Object { + "enabled": true, + "execExtendsQuery": true, + "noImplicitOverride": false, + }, + "enabled": true, + "messageComposer": Object { + "enabled": false, + }, + "msgBuilder": Object { + "enabled": false, + }, + "reactQuery": Object { + "camelize": true, + "enabled": true, + "mutations": false, + "optionalClient": false, + "queryKeys": false, + "version": "v3", + }, + "recoil": Object { + "enabled": false, + }, + "types": Object { + "aliasExecuteMsg": false, + "enabled": true, + }, + }, + "utils": undefined, + }, + ReactQueryPlugin { + "option": Object { + "bundle": Object { + "bundleFile": "bundle.ts", + "enabled": true, + "scope": "contracts", + }, + "client": Object { + "enabled": true, + "execExtendsQuery": true, + "noImplicitOverride": false, + }, + "enabled": true, + "messageComposer": Object { + "enabled": false, + }, + "msgBuilder": Object { + "enabled": false, + }, + "reactQuery": Object { + "camelize": true, + "enabled": true, + "mutations": false, + "optionalClient": false, + "queryKeys": false, + "version": "v3", + }, + "recoil": Object { + "enabled": false, + }, + "types": Object { + "aliasExecuteMsg": false, + "enabled": true, + }, + }, + "utils": undefined, + }, + RecoilPlugin { + "option": Object { + "bundle": Object { + "bundleFile": "bundle.ts", + "enabled": true, + "scope": "contracts", + }, + "client": Object { + "enabled": true, + "execExtendsQuery": true, + "noImplicitOverride": false, + }, + "enabled": true, + "messageComposer": Object { + "enabled": false, + }, + "msgBuilder": Object { + "enabled": false, + }, + "reactQuery": Object { + "camelize": true, + "enabled": true, + "mutations": false, + "optionalClient": false, + "queryKeys": false, + "version": "v3", + }, + "recoil": Object { + "enabled": false, + }, + "types": Object { + "aliasExecuteMsg": false, + "enabled": true, + }, + }, + "utils": Object { + "selectorFamily": "recoil", + }, + }, + MsgBuilderPlugin { + "option": Object { + "bundle": Object { + "bundleFile": "bundle.ts", + "enabled": true, + "scope": "contracts", + }, + "client": Object { + "enabled": true, + "execExtendsQuery": true, + "noImplicitOverride": false, + }, + "enabled": true, + "messageComposer": Object { + "enabled": false, + }, + "msgBuilder": Object { + "enabled": false, + }, + "reactQuery": Object { + "camelize": true, + "enabled": true, + "mutations": false, + "optionalClient": false, + "queryKeys": false, + "version": "v3", + }, + "recoil": Object { + "enabled": false, + }, + "types": Object { + "aliasExecuteMsg": false, + "enabled": true, + }, + }, + "utils": undefined, + }, + ], } `; @@ -53,6 +280,7 @@ TSBuilder { "execExtendsQuery": true, "noImplicitOverride": false, }, + "enabled": true, "messageComposer": Object { "enabled": false, }, @@ -75,5 +303,231 @@ TSBuilder { "enabled": true, }, }, + "plugins": Array [ + TypesPlugin { + "option": Object { + "bundle": Object { + "bundleFile": "bundle.ts", + "enabled": true, + "scope": "contracts", + }, + "client": Object { + "enabled": true, + "execExtendsQuery": true, + "noImplicitOverride": false, + }, + "enabled": true, + "messageComposer": Object { + "enabled": false, + }, + "msgBuilder": Object { + "enabled": false, + }, + "reactQuery": Object { + "camelize": true, + "enabled": false, + "mutations": false, + "optionalClient": false, + "queryKeys": false, + "version": "v3", + }, + "recoil": Object { + "enabled": false, + }, + "types": Object { + "aliasExecuteMsg": false, + "enabled": true, + }, + }, + "utils": undefined, + }, + ClientPlugin { + "option": Object { + "bundle": Object { + "bundleFile": "bundle.ts", + "enabled": true, + "scope": "contracts", + }, + "client": Object { + "enabled": true, + "execExtendsQuery": true, + "noImplicitOverride": false, + }, + "enabled": true, + "messageComposer": Object { + "enabled": false, + }, + "msgBuilder": Object { + "enabled": false, + }, + "reactQuery": Object { + "camelize": true, + "enabled": false, + "mutations": false, + "optionalClient": false, + "queryKeys": false, + "version": "v3", + }, + "recoil": Object { + "enabled": false, + }, + "types": Object { + "aliasExecuteMsg": false, + "enabled": true, + }, + }, + "utils": undefined, + }, + MessageComposerPlugin { + "option": Object { + "bundle": Object { + "bundleFile": "bundle.ts", + "enabled": true, + "scope": "contracts", + }, + "client": Object { + "enabled": true, + "execExtendsQuery": true, + "noImplicitOverride": false, + }, + "enabled": true, + "messageComposer": Object { + "enabled": false, + }, + "msgBuilder": Object { + "enabled": false, + }, + "reactQuery": Object { + "camelize": true, + "enabled": false, + "mutations": false, + "optionalClient": false, + "queryKeys": false, + "version": "v3", + }, + "recoil": Object { + "enabled": false, + }, + "types": Object { + "aliasExecuteMsg": false, + "enabled": true, + }, + }, + "utils": undefined, + }, + ReactQueryPlugin { + "option": Object { + "bundle": Object { + "bundleFile": "bundle.ts", + "enabled": true, + "scope": "contracts", + }, + "client": Object { + "enabled": true, + "execExtendsQuery": true, + "noImplicitOverride": false, + }, + "enabled": true, + "messageComposer": Object { + "enabled": false, + }, + "msgBuilder": Object { + "enabled": false, + }, + "reactQuery": Object { + "camelize": true, + "enabled": false, + "mutations": false, + "optionalClient": false, + "queryKeys": false, + "version": "v3", + }, + "recoil": Object { + "enabled": false, + }, + "types": Object { + "aliasExecuteMsg": false, + "enabled": true, + }, + }, + "utils": undefined, + }, + RecoilPlugin { + "option": Object { + "bundle": Object { + "bundleFile": "bundle.ts", + "enabled": true, + "scope": "contracts", + }, + "client": Object { + "enabled": true, + "execExtendsQuery": true, + "noImplicitOverride": false, + }, + "enabled": true, + "messageComposer": Object { + "enabled": false, + }, + "msgBuilder": Object { + "enabled": false, + }, + "reactQuery": Object { + "camelize": true, + "enabled": false, + "mutations": false, + "optionalClient": false, + "queryKeys": false, + "version": "v3", + }, + "recoil": Object { + "enabled": false, + }, + "types": Object { + "aliasExecuteMsg": false, + "enabled": true, + }, + }, + "utils": Object { + "selectorFamily": "recoil", + }, + }, + MsgBuilderPlugin { + "option": Object { + "bundle": Object { + "bundleFile": "bundle.ts", + "enabled": true, + "scope": "contracts", + }, + "client": Object { + "enabled": true, + "execExtendsQuery": true, + "noImplicitOverride": false, + }, + "enabled": true, + "messageComposer": Object { + "enabled": false, + }, + "msgBuilder": Object { + "enabled": false, + }, + "reactQuery": Object { + "camelize": true, + "enabled": false, + "mutations": false, + "optionalClient": false, + "queryKeys": false, + "version": "v3", + }, + "recoil": Object { + "enabled": false, + }, + "types": Object { + "aliasExecuteMsg": false, + "enabled": true, + }, + }, + "utils": undefined, + }, + ], } `; From 227d87135d7e2e2694632138d34e6e583d13ac5b Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Tue, 11 Apr 2023 07:17:06 +0800 Subject: [PATCH 099/287] fix can't get properties when msgs are $ref --- __fixtures__/issues/98/out/98.client.ts | 247 ++++++++ __fixtures__/issues/98/out/98.react-query.ts | 50 ++ __fixtures__/issues/98/out/98.types.ts | 100 ++++ __fixtures__/issues/98/out/bundle.ts | 15 + __fixtures__/issues/98/schema.json | 550 ++++++++++++++++++ .../__tests__/ts-codegen.issue-98.test.ts | 28 + .../ts-client.issue-98.test.ts.snap | 117 ++++ .../client/test/ts-client.issue-98.test.ts | 55 ++ .../wasm-ast-types/src/context/context.ts | 4 +- packages/wasm-ast-types/src/utils/babel.ts | 28 +- packages/wasm-ast-types/src/utils/index.ts | 1 + packages/wasm-ast-types/src/utils/ref.ts | 6 + .../wasm-ast-types/types/recoil/recoil.d.ts | 2 +- .../wasm-ast-types/types/utils/babel.d.ts | 4 +- .../wasm-ast-types/types/utils/index.d.ts | 1 + packages/wasm-ast-types/types/utils/ref.d.ts | 2 + 16 files changed, 1200 insertions(+), 10 deletions(-) create mode 100644 __fixtures__/issues/98/out/98.client.ts create mode 100644 __fixtures__/issues/98/out/98.react-query.ts create mode 100644 __fixtures__/issues/98/out/98.types.ts create mode 100644 __fixtures__/issues/98/out/bundle.ts create mode 100644 __fixtures__/issues/98/schema.json create mode 100644 packages/ts-codegen/__tests__/ts-codegen.issue-98.test.ts create mode 100644 packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-98.test.ts.snap create mode 100644 packages/wasm-ast-types/src/client/test/ts-client.issue-98.test.ts create mode 100644 packages/wasm-ast-types/src/utils/ref.ts create mode 100644 packages/wasm-ast-types/types/utils/ref.d.ts diff --git a/__fixtures__/issues/98/out/98.client.ts b/__fixtures__/issues/98/out/98.client.ts new file mode 100644 index 00000000..b4e37f5b --- /dev/null +++ b/__fixtures__/issues/98/out/98.client.ts @@ -0,0 +1,247 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Uint128, InstantiateMsg, Coin, ExecuteMsg, InstallableExecMsg, Binary, ExecMsg, QueryMsg, InstallableQueryMsg, QueryMsg1, ConfigResponse, NullablePlugin, CanonicalAddr, Plugin, PluginsResponse } from "./98.types"; +export interface 98ReadOnlyInterface { + contractAddress: string; + getConfig: () => Promise; + getPlugins: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }) => Promise; + getPluginById: ({ + id + }: { + id: number; + }) => Promise; +} +export class 98QueryClient implements 98ReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getConfig = this.getConfig.bind(this); + this.getPlugins = this.getPlugins.bind(this); + this.getPluginById = this.getPluginById.bind(this); + } + + getConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_config: {} + }); + }; + getPlugins = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_plugins: { + limit, + start_after: startAfter + } + }); + }; + getPluginById = async ({ + id + }: { + id: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_plugin_by_id: { + id + } + }); + }; +} +export interface 98Interface extends 98ReadOnlyInterface { + contractAddress: string; + sender: string; + proxyInstallPlugin: ({ + id, + instantiateMsg + }: { + id: number; + instantiateMsg: Binary; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + registerPlugin: ({ + checksum, + codeId, + creator, + ipfsHash, + name, + version + }: { + checksum: string; + codeId: number; + creator: string; + ipfsHash: string; + name: string; + version: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + unregisterPlugin: ({ + id + }: { + id: number; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updatePlugin: ({ + checksum, + codeId, + creator, + id, + ipfsHash, + name, + version + }: { + checksum?: string; + codeId?: number; + creator?: string; + id: number; + ipfsHash?: string; + name?: string; + version?: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateRegistryFee: ({ + newFee + }: { + newFee: Coin; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateDaoAddr: ({ + newAddr + }: { + newAddr: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; +} +export class 98Client extends 98QueryClient implements 98Interface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + super(client, contractAddress); + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.proxyInstallPlugin = this.proxyInstallPlugin.bind(this); + this.registerPlugin = this.registerPlugin.bind(this); + this.unregisterPlugin = this.unregisterPlugin.bind(this); + this.updatePlugin = this.updatePlugin.bind(this); + this.updateRegistryFee = this.updateRegistryFee.bind(this); + this.updateDaoAddr = this.updateDaoAddr.bind(this); + } + + proxyInstallPlugin = async ({ + id, + instantiateMsg + }: { + id: number; + instantiateMsg: Binary; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + proxy_install_plugin: { + id, + instantiate_msg: instantiateMsg + } + }, fee, memo, funds); + }; + registerPlugin = async ({ + checksum, + codeId, + creator, + ipfsHash, + name, + version + }: { + checksum: string; + codeId: number; + creator: string; + ipfsHash: string; + name: string; + version: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_plugin: { + checksum, + code_id: codeId, + creator, + ipfs_hash: ipfsHash, + name, + version + } + }, fee, memo, funds); + }; + unregisterPlugin = async ({ + id + }: { + id: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + unregister_plugin: { + id + } + }, fee, memo, funds); + }; + updatePlugin = async ({ + checksum, + codeId, + creator, + id, + ipfsHash, + name, + version + }: { + checksum?: string; + codeId?: number; + creator?: string; + id: number; + ipfsHash?: string; + name?: string; + version?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_plugin: { + checksum, + code_id: codeId, + creator, + id, + ipfs_hash: ipfsHash, + name, + version + } + }, fee, memo, funds); + }; + updateRegistryFee = async ({ + newFee + }: { + newFee: Coin; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_registry_fee: { + new_fee: newFee + } + }, fee, memo, funds); + }; + updateDaoAddr = async ({ + newAddr + }: { + newAddr: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_dao_addr: { + new_addr: newAddr + } + }, fee, memo, funds); + }; +} \ No newline at end of file diff --git a/__fixtures__/issues/98/out/98.react-query.ts b/__fixtures__/issues/98/out/98.react-query.ts new file mode 100644 index 00000000..f9e31110 --- /dev/null +++ b/__fixtures__/issues/98/out/98.react-query.ts @@ -0,0 +1,50 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions, useQuery } from "react-query"; +import { Uint128, InstantiateMsg, Coin, ExecuteMsg, InstallableExecMsg, Binary, ExecMsg, QueryMsg, InstallableQueryMsg, QueryMsg1, ConfigResponse, NullablePlugin, CanonicalAddr, Plugin, PluginsResponse } from "./98.types"; +import { 98QueryClient } from "./98.client"; +export interface 98ReactQuery { + client: 98QueryClient; + options?: UseQueryOptions; +} +export interface 98GetPluginByIdQuery extends 98ReactQuery { + args: { + id: number; + }; +} +export function use98GetPluginByIdQuery({ + client, + args, + options +}: 98GetPluginByIdQuery) { + return useQuery(["98GetPluginById", client.contractAddress, JSON.stringify(args)], () => client.getPluginById({ + id: args.id + }), options); +} +export interface 98GetPluginsQuery extends 98ReactQuery { + args: { + limit?: number; + startAfter?: number; + }; +} +export function use98GetPluginsQuery({ + client, + args, + options +}: 98GetPluginsQuery) { + return useQuery(["98GetPlugins", client.contractAddress, JSON.stringify(args)], () => client.getPlugins({ + limit: args.limit, + startAfter: args.startAfter + }), options); +} +export interface 98GetConfigQuery extends 98ReactQuery {} +export function use98GetConfigQuery({ + client, + options +}: 98GetConfigQuery) { + return useQuery(["98GetConfig", client.contractAddress], () => client.getConfig(), options); +} \ No newline at end of file diff --git a/__fixtures__/issues/98/out/98.types.ts b/__fixtures__/issues/98/out/98.types.ts new file mode 100644 index 00000000..3fa99382 --- /dev/null +++ b/__fixtures__/issues/98/out/98.types.ts @@ -0,0 +1,100 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Uint128 = string; +export interface InstantiateMsg { + install_fee: Coin; + registry_fee: Coin; + [k: string]: unknown; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type ExecuteMsg = InstallableExecMsg | ExecMsg; +export type InstallableExecMsg = { + proxy_install_plugin: { + id: number; + instantiate_msg: Binary; + [k: string]: unknown; + }; +}; +export type Binary = string; +export type ExecMsg = { + register_plugin: { + checksum: string; + code_id: number; + creator: string; + ipfs_hash: string; + name: string; + version: string; + [k: string]: unknown; + }; +} | { + unregister_plugin: { + id: number; + [k: string]: unknown; + }; +} | { + update_plugin: { + checksum?: string | null; + code_id?: number | null; + creator?: string | null; + id: number; + ipfs_hash?: string | null; + name?: string | null; + version?: string | null; + [k: string]: unknown; + }; +} | { + update_registry_fee: { + new_fee: Coin; + [k: string]: unknown; + }; +} | { + update_dao_addr: { + new_addr: string; + [k: string]: unknown; + }; +}; +export type QueryMsg = InstallableQueryMsg | QueryMsg1; +export type InstallableQueryMsg = string; +export type QueryMsg1 = { + get_config: { + [k: string]: unknown; + }; +} | { + get_plugins: { + limit?: number | null; + start_after?: number | null; + [k: string]: unknown; + }; +} | { + get_plugin_by_id: { + id: number; + [k: string]: unknown; + }; +}; +export interface ConfigResponse { + dao_addr: string; + registry_fee: Coin; +} +export type NullablePlugin = Plugin | null; +export type CanonicalAddr = Binary; +export interface Plugin { + checksum: string; + code_id: number; + creator: CanonicalAddr; + id: number; + ipfs_hash: string; + name: string; + version: string; +} +export interface PluginsResponse { + plugins: Plugin[]; + total: number; +} \ No newline at end of file diff --git a/__fixtures__/issues/98/out/bundle.ts b/__fixtures__/issues/98/out/bundle.ts new file mode 100644 index 00000000..4f76a61e --- /dev/null +++ b/__fixtures__/issues/98/out/bundle.ts @@ -0,0 +1,15 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import * as _0 from "./98.types"; +import * as _1 from "./98.client"; +import * as _2 from "./98.react-query"; +export namespace contracts { + export const 98 = { ..._0, + ..._1, + ..._2 + }; +} \ No newline at end of file diff --git a/__fixtures__/issues/98/schema.json b/__fixtures__/issues/98/schema.json new file mode 100644 index 00000000..e0f7fdcf --- /dev/null +++ b/__fixtures__/issues/98/schema.json @@ -0,0 +1,550 @@ +{ + "contract_name": "vectis-plugin-registry", + "contract_version": "0.1.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "install_fee", + "registry_fee" + ], + "properties": { + "install_fee": { + "$ref": "#/definitions/Coin" + }, + "registry_fee": { + "$ref": "#/definitions/Coin" + } + }, + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "anyOf": [ + { + "$ref": "#/definitions/InstallableExecMsg" + }, + { + "$ref": "#/definitions/ExecMsg" + } + ], + "definitions": { + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + }, + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "ExecMsg": { + "oneOf": [ + { + "type": "object", + "required": [ + "register_plugin" + ], + "properties": { + "register_plugin": { + "type": "object", + "required": [ + "checksum", + "code_id", + "creator", + "ipfs_hash", + "name", + "version" + ], + "properties": { + "checksum": { + "type": "string" + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "creator": { + "type": "string" + }, + "ipfs_hash": { + "type": "string" + }, + "name": { + "type": "string" + }, + "version": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "unregister_plugin" + ], + "properties": { + "unregister_plugin": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "update_plugin" + ], + "properties": { + "update_plugin": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "checksum": { + "type": [ + "string", + "null" + ] + }, + "code_id": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "creator": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "ipfs_hash": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "version": { + "type": [ + "string", + "null" + ] + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "update_registry_fee" + ], + "properties": { + "update_registry_fee": { + "type": "object", + "required": [ + "new_fee" + ], + "properties": { + "new_fee": { + "$ref": "#/definitions/Coin" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "update_dao_addr" + ], + "properties": { + "update_dao_addr": { + "type": "object", + "required": [ + "new_addr" + ], + "properties": { + "new_addr": { + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ] + }, + "InstallableExecMsg": { + "oneOf": [ + { + "type": "object", + "required": [ + "proxy_install_plugin" + ], + "properties": { + "proxy_install_plugin": { + "type": "object", + "required": [ + "id", + "instantiate_msg" + ], + "properties": { + "id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "instantiate_msg": { + "$ref": "#/definitions/Binary" + } + } + } + }, + "additionalProperties": false + } + ] + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + "query": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "anyOf": [ + { + "$ref": "#/definitions/InstallableQueryMsg" + }, + { + "$ref": "#/definitions/QueryMsg" + } + ], + "definitions": { + "InstallableQueryMsg": { + "type": "string", + "enum": [] + }, + "QueryMsg": { + "oneOf": [ + { + "type": "object", + "required": [ + "get_config" + ], + "properties": { + "get_config": { + "type": "object" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "get_plugins" + ], + "properties": { + "get_plugins": { + "type": "object", + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "start_after": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "get_plugin_by_id" + ], + "properties": { + "get_plugin_by_id": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + } + ] + } + } + }, + "migrate": null, + "sudo": null, + "responses": { + "get_config": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigResponse", + "type": "object", + "required": [ + "dao_addr", + "registry_fee" + ], + "properties": { + "dao_addr": { + "type": "string" + }, + "registry_fee": { + "$ref": "#/definitions/Coin" + } + }, + "additionalProperties": false, + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + "get_plugin_by_id": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Nullable_Plugin", + "anyOf": [ + { + "$ref": "#/definitions/Plugin" + }, + { + "type": "null" + } + ], + "definitions": { + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + }, + "CanonicalAddr": { + "description": "A blockchain address in its binary form.\n\nThe specific implementation is up to the underlying chain and CosmWasm as well as contracts should not make assumptions on that data. In Ethereum for example, an `Addr` would contain a user visible address like 0x14d3cc818735723ab86eaf9502376e847a64ddad and the corresponding `CanonicalAddr` would store the 20 bytes 0x14, 0xD3, ..., 0xAD. In Cosmos, the bech32 format is used for `Addr`s and the `CanonicalAddr` holds the encoded bech32 data without the checksum. Typical sizes are 20 bytes for externally owned addresses and 32 bytes for module addresses (such as x/wasm contract addresses). That being said, a chain might decide to use any size other than 20 or 32 bytes.\n\nThe safe way to obtain a valid `CanonicalAddr` is using `Api::addr_canonicalize`. In addition to that there are many unsafe ways to convert any binary data into an instance. So the type shoud be treated as a marker to express the intended data type, not as a validity guarantee of any sort.", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "Plugin": { + "type": "object", + "required": [ + "checksum", + "code_id", + "creator", + "id", + "ipfs_hash", + "name", + "version" + ], + "properties": { + "checksum": { + "type": "string" + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "creator": { + "$ref": "#/definitions/CanonicalAddr" + }, + "id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "ipfs_hash": { + "type": "string" + }, + "name": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false + } + } + }, + "get_plugins": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginsResponse", + "type": "object", + "required": [ + "plugins", + "total" + ], + "properties": { + "plugins": { + "type": "array", + "items": { + "$ref": "#/definitions/Plugin" + } + }, + "total": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false, + "definitions": { + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + }, + "CanonicalAddr": { + "description": "A blockchain address in its binary form.\n\nThe specific implementation is up to the underlying chain and CosmWasm as well as contracts should not make assumptions on that data. In Ethereum for example, an `Addr` would contain a user visible address like 0x14d3cc818735723ab86eaf9502376e847a64ddad and the corresponding `CanonicalAddr` would store the 20 bytes 0x14, 0xD3, ..., 0xAD. In Cosmos, the bech32 format is used for `Addr`s and the `CanonicalAddr` holds the encoded bech32 data without the checksum. Typical sizes are 20 bytes for externally owned addresses and 32 bytes for module addresses (such as x/wasm contract addresses). That being said, a chain might decide to use any size other than 20 or 32 bytes.\n\nThe safe way to obtain a valid `CanonicalAddr` is using `Api::addr_canonicalize`. In addition to that there are many unsafe ways to convert any binary data into an instance. So the type shoud be treated as a marker to express the intended data type, not as a validity guarantee of any sort.", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "Plugin": { + "type": "object", + "required": [ + "checksum", + "code_id", + "creator", + "id", + "ipfs_hash", + "name", + "version" + ], + "properties": { + "checksum": { + "type": "string" + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "creator": { + "$ref": "#/definitions/CanonicalAddr" + }, + "id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "ipfs_hash": { + "type": "string" + }, + "name": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false + } + } + } + } +} \ No newline at end of file diff --git a/packages/ts-codegen/__tests__/ts-codegen.issue-98.test.ts b/packages/ts-codegen/__tests__/ts-codegen.issue-98.test.ts new file mode 100644 index 00000000..f3748160 --- /dev/null +++ b/packages/ts-codegen/__tests__/ts-codegen.issue-98.test.ts @@ -0,0 +1,28 @@ +import { TSBuilder } from '../src/builder'; + +const FIXTURE_DIR = __dirname + '/../../../__fixtures__'; +const OUTPUT_DIR = __dirname + '/../../../__output__'; + +it('issue-98', async () => { + const outPath = FIXTURE_DIR + '/issues/98/out'; + const schemaDir = FIXTURE_DIR + '/issues/98/'; + + const builder = new TSBuilder({ + contracts: [ + schemaDir + ], + outPath, + options: { + types: { + enabled: true + }, + client: { + enabled: true + }, + reactQuery: { + enabled: true + } + } + }); + await builder.build(); +}); \ No newline at end of file diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-98.test.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-98.test.ts.snap new file mode 100644 index 00000000..2ec7781f --- /dev/null +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-98.test.ts.snap @@ -0,0 +1,117 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`execute classes array types 1`] = ` +"export class SG721Client implements SG721Instance { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.getConfig = this.getConfig.bind(this); + this.getPlugins = this.getPlugins.bind(this); + this.getPluginById = this.getPluginById.bind(this); + } + + getConfig = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + get_config: {} + }, fee, memo, funds); + }; + getPlugins = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + get_plugins: { + limit, + start_after: startAfter + } + }, fee, memo, funds); + }; + getPluginById = async ({ + id + }: { + id: number; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + get_plugin_by_id: { + id + } + }, fee, memo, funds); + }; +}" +`; + +exports[`execute interfaces no extends 1`] = ` +"export interface SG721Instance { + contractAddress: string; + sender: string; + getConfig: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + getPlugins: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + getPluginById: ({ + id + }: { + id: number; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; +}" +`; + +exports[`execute_msg_for__empty 1`] = `"export type QueryMsg = QueryMsg;"`; + +exports[`query classes 1`] = ` +"export class SG721QueryClient implements SG721ReadOnlyInstance { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getConfig = this.getConfig.bind(this); + this.getPlugins = this.getPlugins.bind(this); + this.getPluginById = this.getPluginById.bind(this); + } + + getConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_config: {} + }); + }; + getPlugins = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_plugins: { + limit, + start_after: startAfter + } + }); + }; + getPluginById = async ({ + id + }: { + id: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_plugin_by_id: { + id + } + }); + }; +}" +`; diff --git a/packages/wasm-ast-types/src/client/test/ts-client.issue-98.test.ts b/packages/wasm-ast-types/src/client/test/ts-client.issue-98.test.ts new file mode 100644 index 00000000..d5fa6905 --- /dev/null +++ b/packages/wasm-ast-types/src/client/test/ts-client.issue-98.test.ts @@ -0,0 +1,55 @@ +import contract from '../../../../../__fixtures__/issues/98/schema.json'; + +import { + createQueryClass, + createExecuteClass, + createExecuteInterface, + createTypeInterface +} from '../client' +import { expectCode, printCode, makeContext } from '../../../test-utils'; + +const message = contract.query +const ctx = makeContext(message); + +it('execute_msg_for__empty', () => { + expectCode(createTypeInterface( + ctx, + message + )) +}) + + +it('query classes', () => { + expectCode(createQueryClass( + ctx, + 'SG721QueryClient', + 'SG721ReadOnlyInstance', + message + )) +}); + +// it('query classes response', () => { +// expectCode(createTypeInterface( +// ctx, +// contract.responses.all_debt_shares +// )) +// }); + +it('execute classes array types', () => { + expectCode(createExecuteClass( + ctx, + 'SG721Client', + 'SG721Instance', + null, + message + )) +}); + +it('execute interfaces no extends', () => { + expectCode(createExecuteInterface( + ctx, + 'SG721Instance', + null, + message + )) +}); diff --git a/packages/wasm-ast-types/src/context/context.ts b/packages/wasm-ast-types/src/context/context.ts index 2b325705..cde2a123 100644 --- a/packages/wasm-ast-types/src/context/context.ts +++ b/packages/wasm-ast-types/src/context/context.ts @@ -1,4 +1,5 @@ import { JSONSchema } from "../types"; +import { refLookup } from "../utils"; import { convertUtilsToImportList, getImportStatements, UtilMapping } from "./imports"; import deepmerge from "deepmerge"; @@ -148,8 +149,7 @@ export abstract class RenderContextBase implements IRender */ abstract mergeDefaultOpt(options: TOpt): TOpt; refLookup($ref: string) { - const refName = $ref.replace('#/definitions/', '') - return this.schema.definitions?.[refName]; + return refLookup($ref, this.schema) } addUtil(util: string) { this.utils[util] = true; diff --git a/packages/wasm-ast-types/src/utils/babel.ts b/packages/wasm-ast-types/src/utils/babel.ts index 5cbe2d8c..8515f192 100644 --- a/packages/wasm-ast-types/src/utils/babel.ts +++ b/packages/wasm-ast-types/src/utils/babel.ts @@ -2,6 +2,7 @@ import * as t from '@babel/types'; import { snake } from "case"; import { Field, QueryMsg, ExecuteMsg } from '../types'; import { TSTypeAnnotation, TSExpressionWithTypeArguments } from '@babel/types'; +import { refLookup } from './ref'; // t.TSPropertySignature - kind? export const propertySignature = ( @@ -30,11 +31,28 @@ export const tsTypeOperator = (typeAnnotation: t.TSType, operator: string) => { return obj; }; -export const getMessageProperties = (msg: QueryMsg | ExecuteMsg) => { - if (msg.anyOf) return msg.anyOf; - if (msg.oneOf) return msg.oneOf; - if (msg.allOf) return msg.allOf; - return []; +export const getMessageProperties = (msg) => { + let results = []; + let objs = []; + if (msg.anyOf) { objs = msg.anyOf; } + else if (msg.oneOf) { objs = msg.oneOf; } + else if (msg.allOf) { objs = msg.allOf; } + + for (const obj of objs) { + if(obj.properties){ + results.push(obj); + } else{ + if(obj.$ref){ + const ref = refLookup(obj.$ref, msg) + + const refProps = getMessageProperties(ref); + + results = [...results, ...refProps]; + } + } + } + + return results; } export const tsPropertySignature = ( diff --git a/packages/wasm-ast-types/src/utils/index.ts b/packages/wasm-ast-types/src/utils/index.ts index d19d5ac7..2e232599 100644 --- a/packages/wasm-ast-types/src/utils/index.ts +++ b/packages/wasm-ast-types/src/utils/index.ts @@ -1,2 +1,3 @@ export * from './babel'; export * from './types'; +export * from './ref'; diff --git a/packages/wasm-ast-types/src/utils/ref.ts b/packages/wasm-ast-types/src/utils/ref.ts new file mode 100644 index 00000000..8c720289 --- /dev/null +++ b/packages/wasm-ast-types/src/utils/ref.ts @@ -0,0 +1,6 @@ +import { JSONSchema } from "../types"; + +export const refLookup = ($ref: string, schema: JSONSchema) => { + const refName = $ref.replace('#/definitions/', '') + return schema.definitions?.[refName]; +} \ No newline at end of file diff --git a/packages/wasm-ast-types/types/recoil/recoil.d.ts b/packages/wasm-ast-types/types/recoil/recoil.d.ts index 03ee4b37..e296e779 100644 --- a/packages/wasm-ast-types/types/recoil/recoil.d.ts +++ b/packages/wasm-ast-types/types/recoil/recoil.d.ts @@ -2,7 +2,7 @@ import * as t from '@babel/types'; import { QueryMsg } from '../types'; import { RenderContext } from '../context'; export declare const createRecoilSelector: (context: RenderContext, keyPrefix: string, QueryClient: string, methodName: string, responseType: string) => t.ExportNamedDeclaration; -export declare const createRecoilSelectors: (context: RenderContext, keyPrefix: string, QueryClient: string, queryMsg: QueryMsg) => any; +export declare const createRecoilSelectors: (context: RenderContext, keyPrefix: string, QueryClient: string, queryMsg: QueryMsg) => t.ExportNamedDeclaration[]; export declare const createRecoilQueryClientType: () => { type: string; id: { diff --git a/packages/wasm-ast-types/types/utils/babel.d.ts b/packages/wasm-ast-types/types/utils/babel.d.ts index 9147f72e..4b9a5919 100644 --- a/packages/wasm-ast-types/types/utils/babel.d.ts +++ b/packages/wasm-ast-types/types/utils/babel.d.ts @@ -1,5 +1,5 @@ import * as t from '@babel/types'; -import { Field, QueryMsg, ExecuteMsg } from '../types'; +import { Field } from '../types'; import { TSTypeAnnotation, TSExpressionWithTypeArguments } from '@babel/types'; export declare const propertySignature: (name: string, typeAnnotation: t.TSTypeAnnotation, optional?: boolean) => { type: string; @@ -9,7 +9,7 @@ export declare const propertySignature: (name: string, typeAnnotation: t.TSTypeA }; export declare const identifier: (name: string, typeAnnotation: t.TSTypeAnnotation, optional?: boolean) => t.Identifier; export declare const tsTypeOperator: (typeAnnotation: t.TSType, operator: string) => t.TSTypeOperator; -export declare const getMessageProperties: (msg: QueryMsg | ExecuteMsg) => any; +export declare const getMessageProperties: (msg: any) => any[]; export declare const tsPropertySignature: (key: t.Expression, typeAnnotation: t.TSTypeAnnotation, optional: boolean) => t.TSPropertySignature; export declare const tsObjectPattern: (properties: (t.RestElement | t.ObjectProperty)[], typeAnnotation: t.TSTypeAnnotation) => t.ObjectPattern; export declare const callExpression: (callee: t.Expression | t.V8IntrinsicIdentifier, _arguments: (t.Expression | t.SpreadElement | t.ArgumentPlaceholder)[], typeParameters: t.TSTypeParameterInstantiation) => t.CallExpression; diff --git a/packages/wasm-ast-types/types/utils/index.d.ts b/packages/wasm-ast-types/types/utils/index.d.ts index d19d5ac7..2e232599 100644 --- a/packages/wasm-ast-types/types/utils/index.d.ts +++ b/packages/wasm-ast-types/types/utils/index.d.ts @@ -1,2 +1,3 @@ export * from './babel'; export * from './types'; +export * from './ref'; diff --git a/packages/wasm-ast-types/types/utils/ref.d.ts b/packages/wasm-ast-types/types/utils/ref.d.ts new file mode 100644 index 00000000..30c8b2c1 --- /dev/null +++ b/packages/wasm-ast-types/types/utils/ref.d.ts @@ -0,0 +1,2 @@ +import { JSONSchema } from "../types"; +export declare const refLookup: ($ref: string, schema: JSONSchema) => JSONSchema; From dccd0edd182dc4d5e58b30e7f46732e0be483bc1 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 10 Apr 2023 16:30:50 -0700 Subject: [PATCH 100/287] chore(release): publish - @cosmwasm/ts-codegen@0.26.0 - wasm-ast-types@0.19.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 039dc42a..4ac37d9a 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.26.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.25.2...@cosmwasm/ts-codegen@0.26.0) (2023-04-10) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.25.2](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.25.1...@cosmwasm/ts-codegen@0.25.2) (2023-03-02) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 76411338..cf13b9bb 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.25.2", + "version": "0.26.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.18.2" + "wasm-ast-types": "^0.19.0" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 3e9be2cc..693ebd85 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.19.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.18.2...wasm-ast-types@0.19.0) (2023-04-10) + +**Note:** Version bump only for package wasm-ast-types + + + + + ## [0.18.2](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.18.1...wasm-ast-types@0.18.2) (2023-03-02) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index a83c24ff..387e7fe3 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.18.2", + "version": "0.19.0", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From f98a8bdfc52cd6fc568e67b38b3dbc67ea93249d Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Fri, 14 Apr 2023 09:22:49 +0200 Subject: [PATCH 101/287] Generate parameters for tuple types --- __fixtures__/basic/ownership.json | 154 ++++++++++++++++++ packages/wasm-ast-types/src/client/client.ts | 53 +++--- .../ts-client.issue-101.spec.ts.snap | 47 ++++++ .../ts-client.vectis.spec.ts.snap | 16 +- .../client/test/ts-client.issue-101.spec.ts | 37 +++++ .../message-composer.spec.ts.snap | 60 +++++++ .../message-composer/message-composer.spec.ts | 61 ++++--- .../src/message-composer/message-composer.ts | 18 +- .../__snapshots__/msg-builder.spec.ts.snap | 21 +++ .../src/msg-builder/msg-builder.spec.ts | 10 +- .../src/msg-builder/msg-builder.ts | 60 ++++--- .../__snapshots__/react-query.spec.ts.snap | 45 +++++ .../src/react-query/react-query.spec.ts | 18 +- packages/wasm-ast-types/src/utils/types.ts | 15 +- 14 files changed, 528 insertions(+), 87 deletions(-) create mode 100644 __fixtures__/basic/ownership.json create mode 100644 packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-101.spec.ts.snap create mode 100644 packages/wasm-ast-types/src/client/test/ts-client.issue-101.spec.ts diff --git a/__fixtures__/basic/ownership.json b/__fixtures__/basic/ownership.json new file mode 100644 index 00000000..c97252fd --- /dev/null +++ b/__fixtures__/basic/ownership.json @@ -0,0 +1,154 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "description": "Ownership Execute msg", + "oneOf": [ + { + "description": "Sets a new Factory", + "type": "object", + "required": [ + "set_factory" + ], + "properties": { + "set_factory": { + "type": "object", + "required": [ + "new_factory" + ], + "properties": { + "new_factory": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Update the contract's ownership. The `action` to be provided can be either to propose transferring ownership to an account, accept a pending ownership transfer, or renounce the ownership permanently.", + "type": "object", + "required": [ + "update_ownership" + ], + "properties": { + "update_ownership": { + "$ref": "#/definitions/Action" + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Action": { + "description": "Actions that can be taken to alter the contract's ownership", + "oneOf": [ + { + "description": "Propose to transfer the contract's ownership to another account, optionally with an expiry time.\n\nCan only be called by the contract's current owner.\n\nAny existing pending ownership transfer is overwritten.", + "type": "object", + "required": [ + "transfer_ownership" + ], + "properties": { + "transfer_ownership": { + "type": "object", + "required": [ + "new_owner" + ], + "properties": { + "expiry": { + "anyOf": [ + { + "$ref": "#/definitions/Expiration" + }, + { + "type": "null" + } + ] + }, + "new_owner": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Accept the pending ownership transfer.\n\nCan only be called by the pending owner.", + "type": "string", + "enum": [ + "accept_ownership" + ] + }, + { + "description": "Give up the contract's ownership and the possibility of appointing a new owner.\n\nCan only be invoked by the contract's current owner.\n\nAny existing pending ownership transfer is canceled.", + "type": "string", + "enum": [ + "renounce_ownership" + ] + } + ] + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false + }, + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } + } diff --git a/packages/wasm-ast-types/src/client/client.ts b/packages/wasm-ast-types/src/client/client.ts index 49b64984..a91dfe09 100644 --- a/packages/wasm-ast-types/src/client/client.ts +++ b/packages/wasm-ast-types/src/client/client.ts @@ -1,23 +1,19 @@ import * as t from '@babel/types'; -import { camel, pascal } from 'case'; +import { camel } from 'case'; import { + arrowFunctionExpression, bindMethod, - typedIdentifier, - promiseTypeAnnotation, classDeclaration, classProperty, - arrowFunctionExpression, - getMessageProperties -} from '../utils' + getMessageProperties, + promiseTypeAnnotation, + typedIdentifier +} from '../utils'; -import { - QueryMsg, - ExecuteMsg -} from '../types'; +import { ExecuteMsg, JSONSchema, QueryMsg } from '../types'; -import { getPropertyType, getType, createTypedObjectParams, getResponseType } from '../utils/types'; +import { createTypedObjectParams, getPropertyType, getResponseType, getType } from '../utils/types'; import { RenderContext } from '../context'; -import { JSONSchema } from '../types'; import { identifier, propertySignature } from '../utils/babel'; export const CONSTANT_EXEC_PARAMS = [ @@ -89,7 +85,7 @@ export const createWasmQueryMethod = ( const methodName = camel(underscoreName); const responseType = getResponseType(context, underscoreName); - const obj = createTypedObjectParams( + const param = createTypedObjectParams( context, jsonschema.properties[underscoreName] ); @@ -99,13 +95,14 @@ export const createWasmQueryMethod = ( jsonschema.properties[underscoreName] ); - const actionArg = - t.objectProperty(t.identifier(underscoreName), t.objectExpression(args)); + const msgAction = t.identifier(underscoreName); + // If the param is an identifier, we can just use it as is + const msgActionValue = param?.type === 'Identifier' ? t.identifier(param.name) : t.objectExpression(args) return t.classProperty( t.identifier(methodName), arrowFunctionExpression( - obj ? [obj] : [], + param ? [param] : [], t.blockStatement( [ t.returnStatement( @@ -120,7 +117,7 @@ export const createWasmQueryMethod = ( [ t.memberExpression(t.thisExpression(), t.identifier('contractAddress')), t.objectExpression([ - actionArg + t.objectProperty(msgAction, msgActionValue) ]) ] ) @@ -237,9 +234,15 @@ export const getWasmMethodArgs = ( // only 1 degree $ref-lookup if (!keys.length && jsonschema.$ref) { const obj = context.refLookup(jsonschema.$ref); + // properties if (obj) { keys = Object.keys(obj.properties ?? {}) } + + // tuple struct or otherwise, use the name of the reference + if (!keys.length && obj?.oneOf) { +// TODO????? ADAIR + } } const args = keys.map(prop => { @@ -265,7 +268,7 @@ export const createWasmExecMethod = ( const underscoreName = Object.keys(jsonschema.properties)[0]; const methodName = camel(underscoreName); - const obj = createTypedObjectParams( + const param = createTypedObjectParams( context, jsonschema.properties[underscoreName] ); @@ -274,12 +277,16 @@ export const createWasmExecMethod = ( jsonschema.properties[underscoreName] ); + const msgAction = t.identifier(underscoreName); + // If the param is an identifier, we can just use it as is + const msgActionValue = param?.type === 'Identifier' ? t.identifier(param.name) : t.objectExpression(args) + return t.classProperty( t.identifier(methodName), arrowFunctionExpression( - obj ? [ + param ? [ // props - obj, + param, ...CONSTANT_EXEC_PARAMS ] : CONSTANT_EXEC_PARAMS, t.blockStatement( @@ -306,10 +313,8 @@ export const createWasmExecMethod = ( t.objectExpression( [ t.objectProperty( - t.identifier(underscoreName), - t.objectExpression([ - ...args - ]) + msgAction, + msgActionValue ) ] diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-101.spec.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-101.spec.ts.snap new file mode 100644 index 00000000..17159f90 --- /dev/null +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-101.spec.ts.snap @@ -0,0 +1,47 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`execute interfaces no extends 1`] = ` +"export interface OwnershipInstance { + contractAddress: string; + sender: string; + setFactory: ({ + newFactory + }: { + newFactory: string; + }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + updateOwnership: (action: Action, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; +}" +`; + +exports[`ownership client with tuple 1`] = ` +"export class OwnershipClient implements OwnershipInstance { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.setFactory = this.setFactory.bind(this); + this.updateOwnership = this.updateOwnership.bind(this); + } + + setFactory = async ({ + newFactory + }: { + newFactory: string; + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_factory: { + new_factory: newFactory + } + }, fee, memo, funds); + }; + updateOwnership = async (action: Action, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_ownership: action + }, fee, memo, funds); + }; +}" +`; diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.vectis.spec.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.vectis.spec.ts.snap index ef9254e6..e2b809bf 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.vectis.spec.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.vectis.spec.ts.snap @@ -193,9 +193,9 @@ exports[`query classes 1`] = ` this.wasm = this.wasm.bind(this); } - bank = async (): Promise => { + bank = async (bankMsg: BankMsg): Promise => { return this.client.queryContractSmart(this.contractAddress, { - bank: {} + bank: bankMsg }); }; custom = async (): Promise => { @@ -203,19 +203,19 @@ exports[`query classes 1`] = ` custom: {} }); }; - staking = async (): Promise => { + staking = async (stakingMsg: StakingMsg): Promise => { return this.client.queryContractSmart(this.contractAddress, { - staking: {} + staking: stakingMsg }); }; - distribution = async (): Promise => { + distribution = async (distributionMsg: DistributionMsg): Promise => { return this.client.queryContractSmart(this.contractAddress, { - distribution: {} + distribution: distributionMsg }); }; - wasm = async (): Promise => { + wasm = async (wasmMsg: WasmMsg): Promise => { return this.client.queryContractSmart(this.contractAddress, { - wasm: {} + wasm: wasmMsg }); }; }" diff --git a/packages/wasm-ast-types/src/client/test/ts-client.issue-101.spec.ts b/packages/wasm-ast-types/src/client/test/ts-client.issue-101.spec.ts new file mode 100644 index 00000000..71b4efa1 --- /dev/null +++ b/packages/wasm-ast-types/src/client/test/ts-client.issue-101.spec.ts @@ -0,0 +1,37 @@ +import { createExecuteClass, createExecuteInterface } from '../client'; +import { expectCode, makeContext } from '../../../test-utils'; +import ownership from '../../../../../__fixtures__/basic/ownership.json'; + + +// it('query classes', () => { +// const ctx = makeContext(cosmos_msg_for__empty); +// expectCode(createQueryClass( +// ctx, +// 'SG721QueryClient', +// 'SG721ReadOnlyInstance', +// cosmos_msg_for__empty +// )) +// }); + +it('execute interfaces no extends', () => { + const ctx = makeContext(ownership); + expectCode(createExecuteInterface( + ctx, + 'OwnershipInstance', + null, + ownership + )) +}); + +it('ownership client with tuple', () => { + const ctx = makeContext(ownership); + expectCode(createExecuteClass( + ctx, + 'OwnershipClient', + 'OwnershipInstance', + null, + ownership + )) +}); + + diff --git a/packages/wasm-ast-types/src/message-composer/__snapshots__/message-composer.spec.ts.snap b/packages/wasm-ast-types/src/message-composer/__snapshots__/message-composer.spec.ts.snap index 8973cd20..2fa4a2fb 100644 --- a/packages/wasm-ast-types/src/message-composer/__snapshots__/message-composer.spec.ts.snap +++ b/packages/wasm-ast-types/src/message-composer/__snapshots__/message-composer.spec.ts.snap @@ -269,3 +269,63 @@ exports[`execute classes 1`] = ` }; }" `; + +exports[`ownershipClass 1`] = ` +"export class OwnershipMessageComposer implements OwnershipMessage { + sender: string; + contractAddress: string; + + constructor(sender: string, contractAddress: string) { + this.sender = sender; + this.contractAddress = contractAddress; + this.setFactory = this.setFactory.bind(this); + this.updateOwnership = this.updateOwnership.bind(this); + } + + setFactory = ({ + newFactory + }: { + newFactory: string; + }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: \\"/cosmwasm.wasm.v1.MsgExecuteContract\\", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + set_factory: { + new_factory: newFactory + } + })), + funds + }) + }; + }; + updateOwnership = (action: Action, funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: \\"/cosmwasm.wasm.v1.MsgExecuteContract\\", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_ownership: action + })), + funds + }) + }; + }; +}" +`; + +exports[`ownershipInterface 1`] = ` +"export interface OwnershipMessage { + contractAddress: string; + sender: string; + setFactory: ({ + newFactory + }: { + newFactory: string; + }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateOwnership: (action: Action, funds?: Coin[]) => MsgExecuteContractEncodeObject; +}" +`; diff --git a/packages/wasm-ast-types/src/message-composer/message-composer.spec.ts b/packages/wasm-ast-types/src/message-composer/message-composer.spec.ts index 5b840aaf..e8a8f62b 100644 --- a/packages/wasm-ast-types/src/message-composer/message-composer.spec.ts +++ b/packages/wasm-ast-types/src/message-composer/message-composer.spec.ts @@ -1,25 +1,46 @@ -import execute_msg from '../../../../__fixtures__/basic/execute_msg_for__empty.json'; +import execute_msg from "../../../../__fixtures__/basic/execute_msg_for__empty.json"; +import ownership from "../../../../__fixtures__/basic/ownership.json"; + import { - createMessageComposerClass, - createMessageComposerInterface -} from './message-composer' -import { expectCode, makeContext } from '../../test-utils'; + createMessageComposerClass, + createMessageComposerInterface, +} from "./message-composer"; +import { expectCode, makeContext } from "../../test-utils"; +import * as t from "@babel/types"; +import { createReactQueryMutationHooks } from "../react-query"; + +it("execute classes", () => { + const ctx = makeContext(execute_msg); + expectCode( + createMessageComposerClass( + ctx, + "SG721MessageComposer", + "SG721Message", + execute_msg + ) + ); +}); + +it("createMessageComposerInterface", () => { + const ctx = makeContext(execute_msg); + expectCode(createMessageComposerInterface(ctx, "SG721Message", execute_msg)); +}); -it('execute classes', () => { - const ctx = makeContext(execute_msg); - expectCode(createMessageComposerClass( - ctx, - 'SG721MessageComposer', - 'SG721Message', - execute_msg - )) +it("ownershipClass", () => { + const ctx = makeContext(ownership); + expectCode( + createMessageComposerClass( + ctx, + "OwnershipMessageComposer", + "OwnershipMessage", + ownership + ) + ); }); -it('createMessageComposerInterface', () => { - const ctx = makeContext(execute_msg); - expectCode(createMessageComposerInterface( - ctx, - 'SG721Message', - execute_msg - )) +it("ownershipInterface", () => { + const ownershipCtx = makeContext(ownership); + expectCode( + createMessageComposerInterface(ownershipCtx, "OwnershipMessage", ownership) + ); }); diff --git a/packages/wasm-ast-types/src/message-composer/message-composer.ts b/packages/wasm-ast-types/src/message-composer/message-composer.ts index 80fc35c3..255b3327 100644 --- a/packages/wasm-ast-types/src/message-composer/message-composer.ts +++ b/packages/wasm-ast-types/src/message-composer/message-composer.ts @@ -14,6 +14,7 @@ import { JSONSchema } from '../types'; import { RenderContext } from '../context'; import { identifier } from '../utils/babel'; import { getWasmMethodArgs } from '../client/client'; +import { Expression } from '@babel/types'; const createWasmExecMethodMessageComposer = ( context: RenderContext, @@ -27,12 +28,20 @@ const createWasmExecMethodMessageComposer = ( const underscoreName = Object.keys(jsonschema.properties)[0]; const methodName = camel(underscoreName); - const obj = createTypedObjectParams(context, jsonschema.properties[underscoreName]); + const param = createTypedObjectParams(context, jsonschema.properties[underscoreName]); const args = getWasmMethodArgs( context, jsonschema.properties[underscoreName] ); + // what the underscore named property in the message is assigned to + let actionValue: Expression + if (param?.type === 'Identifier') { + actionValue = t.identifier(param.name); + } else { + actionValue = t.objectExpression(args) + } + const constantParams = [ identifier('funds', t.tsTypeAnnotation( t.tsArrayType( @@ -46,9 +55,9 @@ const createWasmExecMethodMessageComposer = ( return t.classProperty( t.identifier(methodName), arrowFunctionExpression( - obj ? [ + param ? [ // props - obj, + param, ...constantParams ] : constantParams, t.blockStatement( @@ -95,10 +104,9 @@ const createWasmExecMethodMessageComposer = ( ), [ t.objectExpression( - [ t.objectProperty( - t.identifier(underscoreName), t.objectExpression(args) + t.identifier(underscoreName), actionValue ) ] diff --git a/packages/wasm-ast-types/src/msg-builder/__snapshots__/msg-builder.spec.ts.snap b/packages/wasm-ast-types/src/msg-builder/__snapshots__/msg-builder.spec.ts.snap index aafd28dd..4f1c022e 100644 --- a/packages/wasm-ast-types/src/msg-builder/__snapshots__/msg-builder.spec.ts.snap +++ b/packages/wasm-ast-types/src/msg-builder/__snapshots__/msg-builder.spec.ts.snap @@ -113,6 +113,27 @@ exports[`execute class 1`] = ` }" `; +exports[`ownership 1`] = ` +"export abstract class Ownership { + static setFactory = ({ + newFactory + }: CamelCasedProperties[\\"set_factory\\"]>): ExecuteMsg => { + return { + set_factory: ({ + new_factory: newFactory + } as const) + }; + }; + static updateOwnership = (action: Action): ExecuteMsg => { + return { + update_ownership: action + }; + }; +}" +`; + exports[`query class 1`] = ` "export abstract class SG721MsgBuilder { static ownerOf = ({ diff --git a/packages/wasm-ast-types/src/msg-builder/msg-builder.spec.ts b/packages/wasm-ast-types/src/msg-builder/msg-builder.spec.ts index 5b1c43d4..54dcee2d 100644 --- a/packages/wasm-ast-types/src/msg-builder/msg-builder.spec.ts +++ b/packages/wasm-ast-types/src/msg-builder/msg-builder.spec.ts @@ -1,9 +1,12 @@ import execute_msg from '../../../../__fixtures__/basic/execute_msg_for__empty.json'; import query_msg from '../../../../__fixtures__/basic/query_msg.json'; +import ownership from '../../../../__fixtures__/basic/ownership.json'; + import { createMsgBuilderClass, } from './msg-builder' import { expectCode, makeContext } from '../../test-utils'; +import { findExecuteMsg } from '@cosmwasm/ts-codegen/src'; it('execute class', () => { const ctx = makeContext(execute_msg); @@ -12,6 +15,11 @@ it('execute class', () => { it('query class', () => { - const ctx = makeContext(execute_msg); + const ctx = makeContext(query_msg); expectCode(createMsgBuilderClass(ctx, 'SG721MsgBuilder', query_msg)) }); + +it('ownership', () => { + const ctx = makeContext(ownership); + expectCode(createMsgBuilderClass(ctx, 'Ownership', ownership)) +}); diff --git a/packages/wasm-ast-types/src/msg-builder/msg-builder.ts b/packages/wasm-ast-types/src/msg-builder/msg-builder.ts index fec31547..df7fa8a4 100644 --- a/packages/wasm-ast-types/src/msg-builder/msg-builder.ts +++ b/packages/wasm-ast-types/src/msg-builder/msg-builder.ts @@ -1,16 +1,11 @@ -import * as t from "@babel/types"; -import { camel } from "case"; -import { - abstractClassDeclaration, - arrowFunctionExpression, - bindMethod, - classDeclaration, - getMessageProperties, -} from "../utils"; -import { ExecuteMsg, QueryMsg } from "../types"; -import { createTypedObjectParams } from "../utils/types"; -import { RenderContext } from "../context"; -import { getWasmMethodArgs } from "../client/client"; +import * as t from '@babel/types'; +import { camel } from 'case'; +import { abstractClassDeclaration, arrowFunctionExpression, getMessageProperties } from '../utils'; +import { ExecuteMsg, QueryMsg } from '../types'; +import { createTypedObjectParams } from '../utils/types'; +import { RenderContext } from '../context'; +import { getWasmMethodArgs } from '../client/client'; +import { Expression, Identifier, PatternLike, TSAsExpression } from '@babel/types'; export const createMsgBuilderClass = ( context: RenderContext, @@ -34,10 +29,10 @@ export const createMsgBuilderClass = ( function createExtractTypeAnnotation(underscoreName: string, msgTitle: string) { return t.tsTypeAnnotation( t.tsTypeReference( - t.identifier("CamelCasedProperties"), + t.identifier('CamelCasedProperties'), t.tsTypeParameterInstantiation([ t.tsIndexedAccessType( - t.tsTypeReference(t.identifier("Extract"), + t.tsTypeReference(t.identifier('Extract'), t.tsTypeParameterInstantiation([ t.tsTypeReference(t.identifier(msgTitle)), t.tsTypeLiteral([ @@ -62,7 +57,7 @@ const createStaticExecMethodMsgBuilder = ( ) => { const underscoreName = Object.keys(jsonschema.properties)[0]; const methodName = camel(underscoreName); - const obj = createTypedObjectParams( + const param = createTypedObjectParams( context, jsonschema.properties[underscoreName] ); @@ -71,17 +66,34 @@ const createStaticExecMethodMsgBuilder = ( jsonschema.properties[underscoreName] ); - if (obj) obj.typeAnnotation = createExtractTypeAnnotation(underscoreName, msgTitle) + // what the underscore named property in the message is assigned to + let actionValue: Expression + if (param?.type === 'Identifier') { + actionValue = t.identifier(param.name); + } else { + actionValue = t.tsAsExpression(t.objectExpression(args), t.tsTypeReference(t.identifier('const'))); + } + + + // TODO: this is a hack to get the type annotation to work + // all type annotations in the future should be the extracted and camelized type + if ( + param && + param.typeAnnotation.type === 'TSTypeAnnotation' && + param.typeAnnotation.typeAnnotation.type === 'TSTypeLiteral' + ) { + param.typeAnnotation = createExtractTypeAnnotation(underscoreName, msgTitle); + } return t.classProperty( t.identifier(methodName), arrowFunctionExpression( // params - obj + param ? [ - // props - obj, - ] + // props + param + ] : [], // body t.blockStatement([ @@ -89,10 +101,10 @@ const createStaticExecMethodMsgBuilder = ( t.objectExpression([ t.objectProperty( t.identifier(underscoreName), - t.tsAsExpression(t.objectExpression(args), t.tsTypeReference(t.identifier('const'))) - ), + actionValue + ) ]) - ), + ) ]), // return type t.tsTypeAnnotation(t.tsTypeReference(t.identifier(msgTitle))), diff --git a/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap b/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap index 276b8fe5..0da3f360 100644 --- a/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap +++ b/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap @@ -1312,3 +1312,48 @@ export function useSg721TransferNftMutation(options?: Omit client.transferNft(msg, fee, memo, funds), options); }" `; + +exports[`ownership 1`] = ` +"export interface OwnershipUpdateOwnershipMutation { + client: OwnershipClient; + msg: Action; + args?: { + fee?: number | StdFee | \\"auto\\"; + memo?: string; + funds?: Coin[]; + }; +} +export function useOwnershipUpdateOwnershipMutation(options?: Omit, \\"mutationFn\\">) { + return useMutation(({ + client, + msg, + args: { + fee, + memo, + funds + } = {} + }) => client.updateOwnership(msg, fee, memo, funds), options); +} +export interface OwnershipSetFactoryMutation { + client: OwnershipClient; + msg: { + newFactory: string; + }; + args?: { + fee?: number | StdFee | \\"auto\\"; + memo?: string; + funds?: Coin[]; + }; +} +export function useOwnershipSetFactoryMutation(options?: Omit, \\"mutationFn\\">) { + return useMutation(({ + client, + msg, + args: { + fee, + memo, + funds + } = {} + }) => client.setFactory(msg, fee, memo, funds), options); +}" +`; diff --git a/packages/wasm-ast-types/src/react-query/react-query.spec.ts b/packages/wasm-ast-types/src/react-query/react-query.spec.ts index 7198b8a2..c959bd73 100644 --- a/packages/wasm-ast-types/src/react-query/react-query.spec.ts +++ b/packages/wasm-ast-types/src/react-query/react-query.spec.ts @@ -1,13 +1,15 @@ import * as t from '@babel/types'; import query_msg from '../../../../__fixtures__/basic/query_msg.json'; import execute_msg from '../../../../__fixtures__/basic/execute_msg_for__empty.json'; -import { RenderContext } from '../context'; +import ownership from '../../../../__fixtures__/basic/ownership.json'; + import { createReactQueryHooks, createReactQueryMutationHooks, } from './react-query' import { expectCode, makeContext } from '../../test-utils'; +import { createMsgBuilderClass } from '../msg-builder'; const execCtx = makeContext(execute_msg); const queryCtx = makeContext(query_msg); @@ -90,3 +92,17 @@ it('createReactQueryHooks', () => { ))) }); +it('ownership', () => { + const ownershipCtx = makeContext(ownership); + expectCode(t.program( + createReactQueryMutationHooks( + { + context: ownershipCtx, + execMsg: ownership, + contractName: 'Ownership', + ExecuteClient: 'OwnershipClient', + } + ))) +}); + + diff --git a/packages/wasm-ast-types/src/utils/types.ts b/packages/wasm-ast-types/src/utils/types.ts index a552f753..8693107d 100644 --- a/packages/wasm-ast-types/src/utils/types.ts +++ b/packages/wasm-ast-types/src/utils/types.ts @@ -1,5 +1,5 @@ import * as t from '@babel/types'; -import { camel, pascal } from 'case'; +import { camel, pascal, snake } from 'case'; import { propertySignature } from './babel'; import { TSTypeAnnotation } from '@babel/types'; import { RenderContext } from '../context'; @@ -425,15 +425,22 @@ export const createTypedObjectParams = ( context: RenderContext, jsonschema: JSONSchema, camelize: boolean = true -): t.ObjectPattern => { +): (t.Identifier | t.Pattern | t.RestElement) => { const keys = Object.keys(jsonschema.properties ?? {}); if (!keys.length) { - // is there a ref? if (jsonschema.$ref) { const obj = context.refLookup(jsonschema.$ref); - if (obj) { + // If there is a oneOf, then we need to create a type for it + if (obj?.oneOf) { + // the actual type of the ref + const refType = jsonschema.$ref.split('/').pop(); + const refName = camel(refType); + const id = t.identifier(refName); + id.typeAnnotation = t.tsTypeAnnotation(t.tsTypeReference(t.identifier(refType))); + return id + } else if (obj) { return createTypedObjectParams( context, obj, From 85e69d3dd3bae5ebb50676bdba1fa35d44505cb8 Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Fri, 14 Apr 2023 09:29:22 +0200 Subject: [PATCH 102/287] Add msg-builder readme --- README.md | 29 +++++++++++++++++++++++++++++ packages/ts-codegen/README.md | 26 ++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/README.md b/README.md index 045b7bb8..a51ac9f9 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,9 @@ codegen({ }, messageComposer: { enabled: false + }, + msgBuilder: { + enabled: false } } }).then(() => { @@ -252,6 +255,28 @@ cosmwasm-ts-codegen generate \ | ------------------------------ | ------------------------------------------------------------------- | | `messageComposer.enabled` | enable the messageComposer plugin | +### Msg Builder + +Generate raw message jsons for use in your application with the `msg-builder` command. + +[see example output code](https://gist.github.com/adairrr/b394e62beb9856b0351883f776650f26) + +#### Msg Builder via CLI + +```sh +cosmwasm-ts-codegen generate \ + --plugin msg-builder \ + --schema ./schema \ + --out ./ts \ + --name MyContractName +``` +#### Message Composer Options + +| option | description | +-------------| ------------------------------ | ------------------------------------------------------------------- | +| `msgBuilder.enabled` | enable the msgBilder plugin | + + ### Bundles The bundler will make a nice package of all your contracts. For example: @@ -389,6 +414,10 @@ https://gist.github.com/pyramation/a9520ccf131177b1841e02a97d7d3731 https://gist.github.com/pyramation/43320e8b952751a0bd5a77dbc5b601f4 +- `cosmwasm-ts-codegen generate --plugin msg-builder` + +https://gist.github.com/adairrr/b394e62beb9856b0351883f776650f26 + ### JSON Schema diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index 045b7bb8..4fc0e4b6 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -36,6 +36,7 @@ The quickest and easiest way to interact with CosmWasm Contracts. `@cosmwasm/ts- - [React Query](#react-query) - [Recoil](#recoil) - [Message Composer](#message-composer) + - [Msg Builder](#msg-builder) - [Bundles](#bundles) - [CLI Usage and Examples](#cli-usage-and-examples) - [Advanced Usage](#advanced-usage) @@ -119,6 +120,9 @@ codegen({ }, messageComposer: { enabled: false + }, + msgBuilder: { + enabled: false } } }).then(() => { @@ -252,6 +256,28 @@ cosmwasm-ts-codegen generate \ | ------------------------------ | ------------------------------------------------------------------- | | `messageComposer.enabled` | enable the messageComposer plugin | +### Msg Builder + +Generate raw message jsons for use in your application with the `msg-builder` command. + +[see example output code](https://gist.github.com/adairrr/b394e62beb9856b0351883f776650f26) + +#### Msg Builder via CLI + +```sh +cosmwasm-ts-codegen generate \ + --plugin msg-builder \ + --schema ./schema \ + --out ./ts \ + --name MyContractName +``` +#### Message Composer Options + +| option | description | +-------------| ------------------------------ | ------------------------------------------------------------------- | +| `msgBuilder.enabled` | enable the msgBilder plugin | + + ### Bundles The bundler will make a nice package of all your contracts. For example: From d2edba320c63e2db5fe2db0bfb1f4cd5e44f2188 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 17 Apr 2023 13:40:37 -0700 Subject: [PATCH 103/287] chore(release): publish - @cosmwasm/ts-codegen@0.27.0 - wasm-ast-types@0.20.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 4ac37d9a..4d482ce9 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.27.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.26.0...@cosmwasm/ts-codegen@0.27.0) (2023-04-17) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.26.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.25.2...@cosmwasm/ts-codegen@0.26.0) (2023-04-10) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index cf13b9bb..d87898ff 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.26.0", + "version": "0.27.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.19.0" + "wasm-ast-types": "^0.20.0" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 693ebd85..65d6171c 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.20.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.19.0...wasm-ast-types@0.20.0) (2023-04-17) + +**Note:** Version bump only for package wasm-ast-types + + + + + # [0.19.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.18.2...wasm-ast-types@0.19.0) (2023-04-10) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index 387e7fe3..1711fffc 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.19.0", + "version": "0.20.0", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From 4dac35df2d19499c32aa057d2eeb94388e52508a Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Tue, 16 May 2023 10:48:04 -0700 Subject: [PATCH 104/287] test --- __fixtures__/issues/103/schema.json | 58 ++++ __fixtures__/issues/98/out/98.client.ts | 247 ------------------ __fixtures__/issues/98/out/98.react-query.ts | 50 ---- __fixtures__/issues/98/out/98.types.ts | 100 ------- __fixtures__/issues/98/out/bundle.ts | 15 -- .../ts-client.issue-103.test.ts.snap | 38 +++ .../client/test/ts-client.issue-103.test.ts | 55 ++++ 7 files changed, 151 insertions(+), 412 deletions(-) create mode 100644 __fixtures__/issues/103/schema.json delete mode 100644 __fixtures__/issues/98/out/98.client.ts delete mode 100644 __fixtures__/issues/98/out/98.react-query.ts delete mode 100644 __fixtures__/issues/98/out/98.types.ts delete mode 100644 __fixtures__/issues/98/out/bundle.ts create mode 100644 packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-103.test.ts.snap create mode 100644 packages/wasm-ast-types/src/client/test/ts-client.issue-103.test.ts diff --git a/__fixtures__/issues/103/schema.json b/__fixtures__/issues/103/schema.json new file mode 100644 index 00000000..25c934ae --- /dev/null +++ b/__fixtures__/issues/103/schema.json @@ -0,0 +1,58 @@ +{ + "contract_name": "cw1-whitelist", + "contract_version": "0.3.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "admins", + "mutable" + ], + "properties": { + "admins": { + "type": "array", + "items": { + "type": "string" + } + }, + "mutable": { + "type": "boolean" + } + } + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "anyOf": [ + { + "$ref": "#/definitions/ExecMsg" + } + ], + "definitions": { + "ExecMsg": { + "type": "string", + "enum": [] + } + } + }, + "query": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "anyOf": [ + { + "$ref": "#/definitions/QueryMsg" + } + ], + "definitions": { + "QueryMsg": { + "type": "string", + "enum": [] + } + } + }, + "migrate": null, + "sudo": null, + "responses": {} +} \ No newline at end of file diff --git a/__fixtures__/issues/98/out/98.client.ts b/__fixtures__/issues/98/out/98.client.ts deleted file mode 100644 index b4e37f5b..00000000 --- a/__fixtures__/issues/98/out/98.client.ts +++ /dev/null @@ -1,247 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; -import { Uint128, InstantiateMsg, Coin, ExecuteMsg, InstallableExecMsg, Binary, ExecMsg, QueryMsg, InstallableQueryMsg, QueryMsg1, ConfigResponse, NullablePlugin, CanonicalAddr, Plugin, PluginsResponse } from "./98.types"; -export interface 98ReadOnlyInterface { - contractAddress: string; - getConfig: () => Promise; - getPlugins: ({ - limit, - startAfter - }: { - limit?: number; - startAfter?: number; - }) => Promise; - getPluginById: ({ - id - }: { - id: number; - }) => Promise; -} -export class 98QueryClient implements 98ReadOnlyInterface { - client: CosmWasmClient; - contractAddress: string; - - constructor(client: CosmWasmClient, contractAddress: string) { - this.client = client; - this.contractAddress = contractAddress; - this.getConfig = this.getConfig.bind(this); - this.getPlugins = this.getPlugins.bind(this); - this.getPluginById = this.getPluginById.bind(this); - } - - getConfig = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - get_config: {} - }); - }; - getPlugins = async ({ - limit, - startAfter - }: { - limit?: number; - startAfter?: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - get_plugins: { - limit, - start_after: startAfter - } - }); - }; - getPluginById = async ({ - id - }: { - id: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - get_plugin_by_id: { - id - } - }); - }; -} -export interface 98Interface extends 98ReadOnlyInterface { - contractAddress: string; - sender: string; - proxyInstallPlugin: ({ - id, - instantiateMsg - }: { - id: number; - instantiateMsg: Binary; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - registerPlugin: ({ - checksum, - codeId, - creator, - ipfsHash, - name, - version - }: { - checksum: string; - codeId: number; - creator: string; - ipfsHash: string; - name: string; - version: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - unregisterPlugin: ({ - id - }: { - id: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - updatePlugin: ({ - checksum, - codeId, - creator, - id, - ipfsHash, - name, - version - }: { - checksum?: string; - codeId?: number; - creator?: string; - id: number; - ipfsHash?: string; - name?: string; - version?: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - updateRegistryFee: ({ - newFee - }: { - newFee: Coin; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - updateDaoAddr: ({ - newAddr - }: { - newAddr: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; -} -export class 98Client extends 98QueryClient implements 98Interface { - client: SigningCosmWasmClient; - sender: string; - contractAddress: string; - - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { - super(client, contractAddress); - this.client = client; - this.sender = sender; - this.contractAddress = contractAddress; - this.proxyInstallPlugin = this.proxyInstallPlugin.bind(this); - this.registerPlugin = this.registerPlugin.bind(this); - this.unregisterPlugin = this.unregisterPlugin.bind(this); - this.updatePlugin = this.updatePlugin.bind(this); - this.updateRegistryFee = this.updateRegistryFee.bind(this); - this.updateDaoAddr = this.updateDaoAddr.bind(this); - } - - proxyInstallPlugin = async ({ - id, - instantiateMsg - }: { - id: number; - instantiateMsg: Binary; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - proxy_install_plugin: { - id, - instantiate_msg: instantiateMsg - } - }, fee, memo, funds); - }; - registerPlugin = async ({ - checksum, - codeId, - creator, - ipfsHash, - name, - version - }: { - checksum: string; - codeId: number; - creator: string; - ipfsHash: string; - name: string; - version: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - register_plugin: { - checksum, - code_id: codeId, - creator, - ipfs_hash: ipfsHash, - name, - version - } - }, fee, memo, funds); - }; - unregisterPlugin = async ({ - id - }: { - id: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - unregister_plugin: { - id - } - }, fee, memo, funds); - }; - updatePlugin = async ({ - checksum, - codeId, - creator, - id, - ipfsHash, - name, - version - }: { - checksum?: string; - codeId?: number; - creator?: string; - id: number; - ipfsHash?: string; - name?: string; - version?: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - update_plugin: { - checksum, - code_id: codeId, - creator, - id, - ipfs_hash: ipfsHash, - name, - version - } - }, fee, memo, funds); - }; - updateRegistryFee = async ({ - newFee - }: { - newFee: Coin; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - update_registry_fee: { - new_fee: newFee - } - }, fee, memo, funds); - }; - updateDaoAddr = async ({ - newAddr - }: { - newAddr: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - update_dao_addr: { - new_addr: newAddr - } - }, fee, memo, funds); - }; -} \ No newline at end of file diff --git a/__fixtures__/issues/98/out/98.react-query.ts b/__fixtures__/issues/98/out/98.react-query.ts deleted file mode 100644 index f9e31110..00000000 --- a/__fixtures__/issues/98/out/98.react-query.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { UseQueryOptions, useQuery } from "react-query"; -import { Uint128, InstantiateMsg, Coin, ExecuteMsg, InstallableExecMsg, Binary, ExecMsg, QueryMsg, InstallableQueryMsg, QueryMsg1, ConfigResponse, NullablePlugin, CanonicalAddr, Plugin, PluginsResponse } from "./98.types"; -import { 98QueryClient } from "./98.client"; -export interface 98ReactQuery { - client: 98QueryClient; - options?: UseQueryOptions; -} -export interface 98GetPluginByIdQuery extends 98ReactQuery { - args: { - id: number; - }; -} -export function use98GetPluginByIdQuery({ - client, - args, - options -}: 98GetPluginByIdQuery) { - return useQuery(["98GetPluginById", client.contractAddress, JSON.stringify(args)], () => client.getPluginById({ - id: args.id - }), options); -} -export interface 98GetPluginsQuery extends 98ReactQuery { - args: { - limit?: number; - startAfter?: number; - }; -} -export function use98GetPluginsQuery({ - client, - args, - options -}: 98GetPluginsQuery) { - return useQuery(["98GetPlugins", client.contractAddress, JSON.stringify(args)], () => client.getPlugins({ - limit: args.limit, - startAfter: args.startAfter - }), options); -} -export interface 98GetConfigQuery extends 98ReactQuery {} -export function use98GetConfigQuery({ - client, - options -}: 98GetConfigQuery) { - return useQuery(["98GetConfig", client.contractAddress], () => client.getConfig(), options); -} \ No newline at end of file diff --git a/__fixtures__/issues/98/out/98.types.ts b/__fixtures__/issues/98/out/98.types.ts deleted file mode 100644 index 3fa99382..00000000 --- a/__fixtures__/issues/98/out/98.types.ts +++ /dev/null @@ -1,100 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -export type Uint128 = string; -export interface InstantiateMsg { - install_fee: Coin; - registry_fee: Coin; - [k: string]: unknown; -} -export interface Coin { - amount: Uint128; - denom: string; - [k: string]: unknown; -} -export type ExecuteMsg = InstallableExecMsg | ExecMsg; -export type InstallableExecMsg = { - proxy_install_plugin: { - id: number; - instantiate_msg: Binary; - [k: string]: unknown; - }; -}; -export type Binary = string; -export type ExecMsg = { - register_plugin: { - checksum: string; - code_id: number; - creator: string; - ipfs_hash: string; - name: string; - version: string; - [k: string]: unknown; - }; -} | { - unregister_plugin: { - id: number; - [k: string]: unknown; - }; -} | { - update_plugin: { - checksum?: string | null; - code_id?: number | null; - creator?: string | null; - id: number; - ipfs_hash?: string | null; - name?: string | null; - version?: string | null; - [k: string]: unknown; - }; -} | { - update_registry_fee: { - new_fee: Coin; - [k: string]: unknown; - }; -} | { - update_dao_addr: { - new_addr: string; - [k: string]: unknown; - }; -}; -export type QueryMsg = InstallableQueryMsg | QueryMsg1; -export type InstallableQueryMsg = string; -export type QueryMsg1 = { - get_config: { - [k: string]: unknown; - }; -} | { - get_plugins: { - limit?: number | null; - start_after?: number | null; - [k: string]: unknown; - }; -} | { - get_plugin_by_id: { - id: number; - [k: string]: unknown; - }; -}; -export interface ConfigResponse { - dao_addr: string; - registry_fee: Coin; -} -export type NullablePlugin = Plugin | null; -export type CanonicalAddr = Binary; -export interface Plugin { - checksum: string; - code_id: number; - creator: CanonicalAddr; - id: number; - ipfs_hash: string; - name: string; - version: string; -} -export interface PluginsResponse { - plugins: Plugin[]; - total: number; -} \ No newline at end of file diff --git a/__fixtures__/issues/98/out/bundle.ts b/__fixtures__/issues/98/out/bundle.ts deleted file mode 100644 index 4f76a61e..00000000 --- a/__fixtures__/issues/98/out/bundle.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import * as _0 from "./98.types"; -import * as _1 from "./98.client"; -import * as _2 from "./98.react-query"; -export namespace contracts { - export const 98 = { ..._0, - ..._1, - ..._2 - }; -} \ No newline at end of file diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-103.test.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-103.test.ts.snap new file mode 100644 index 00000000..fe203434 --- /dev/null +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-103.test.ts.snap @@ -0,0 +1,38 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`execute classes array types 1`] = ` +"export class Client implements Instance { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + } + +}" +`; + +exports[`execute interfaces no extends 1`] = ` +"export interface SG721Instance { + contractAddress: string; + sender: string; +}" +`; + +exports[`execute_msg_for__empty 1`] = `"export type QueryMsg = QueryMsg;"`; + +exports[`query classes 1`] = ` +"export class QueryClient implements ReadOnlyInstance { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + } + +}" +`; diff --git a/packages/wasm-ast-types/src/client/test/ts-client.issue-103.test.ts b/packages/wasm-ast-types/src/client/test/ts-client.issue-103.test.ts new file mode 100644 index 00000000..686d5484 --- /dev/null +++ b/packages/wasm-ast-types/src/client/test/ts-client.issue-103.test.ts @@ -0,0 +1,55 @@ +import contract from '../../../../../__fixtures__/issues/103/schema.json'; + +import { + createQueryClass, + createExecuteClass, + createExecuteInterface, + createTypeInterface +} from '../client' +import { expectCode, printCode, makeContext } from '../../../test-utils'; + +const message = contract.query +const ctx = makeContext(message); + +it('execute_msg_for__empty', () => { + expectCode(createTypeInterface( + ctx, + message + )) +}) + + +it('query classes', () => { + expectCode(createQueryClass( + ctx, + 'QueryClient', + 'ReadOnlyInstance', + message + )) +}); + +// it('query classes response', () => { +// expectCode(createTypeInterface( +// ctx, +// contract.responses.all_debt_shares +// )) +// }); + +it('execute classes array types', () => { + expectCode(createExecuteClass( + ctx, + 'Client', + 'Instance', + null, + message + )) +}); + +it('execute interfaces no extends', () => { + expectCode(createExecuteInterface( + ctx, + 'SG721Instance', + null, + message + )) +}); From e18a55116b7f186a3399318843308a4ea68a8e4c Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Tue, 16 May 2023 10:52:30 -0700 Subject: [PATCH 105/287] test --- .../ts-client.issue-103.test.ts.snap | 49 ++++++- .../client/test/ts-client.issue-103.test.ts | 133 ++++++++++++------ 2 files changed, 137 insertions(+), 45 deletions(-) diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-103.test.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-103.test.ts.snap index fe203434..ba311655 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-103.test.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-103.test.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`execute classes array types 1`] = ` +exports[`execute execute classes array types 1`] = ` "export class Client implements Instance { client: SigningCosmWasmClient; sender: string; @@ -15,16 +15,16 @@ exports[`execute classes array types 1`] = ` }" `; -exports[`execute interfaces no extends 1`] = ` +exports[`execute execute interfaces no extends 1`] = ` "export interface SG721Instance { contractAddress: string; sender: string; }" `; -exports[`execute_msg_for__empty 1`] = `"export type QueryMsg = QueryMsg;"`; +exports[`execute execute_msg_for__empty 1`] = `"export type ExecuteMsg = ExecuteMsg;"`; -exports[`query classes 1`] = ` +exports[`execute query classes 1`] = ` "export class QueryClient implements ReadOnlyInstance { client: CosmWasmClient; contractAddress: string; @@ -36,3 +36,44 @@ exports[`query classes 1`] = ` }" `; + +exports[`execute query classes response 1`] = `"export type QueryMsg = QueryMsg;"`; + +exports[`query execute classes array types 1`] = ` +"export class Client implements Instance { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + } + +}" +`; + +exports[`query execute interfaces no extends 1`] = ` +"export interface SG721Instance { + contractAddress: string; + sender: string; +}" +`; + +exports[`query execute_msg_for__empty 1`] = `"export type QueryMsg = QueryMsg;"`; + +exports[`query query classes 1`] = ` +"export class QueryClient implements ReadOnlyInstance { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + } + +}" +`; + +exports[`query query classes response 1`] = `"export type QueryMsg = QueryMsg;"`; diff --git a/packages/wasm-ast-types/src/client/test/ts-client.issue-103.test.ts b/packages/wasm-ast-types/src/client/test/ts-client.issue-103.test.ts index 686d5484..4f394115 100644 --- a/packages/wasm-ast-types/src/client/test/ts-client.issue-103.test.ts +++ b/packages/wasm-ast-types/src/client/test/ts-client.issue-103.test.ts @@ -8,48 +8,99 @@ import { } from '../client' import { expectCode, printCode, makeContext } from '../../../test-utils'; -const message = contract.query -const ctx = makeContext(message); - -it('execute_msg_for__empty', () => { - expectCode(createTypeInterface( - ctx, - message - )) -}) - - -it('query classes', () => { - expectCode(createQueryClass( - ctx, - 'QueryClient', - 'ReadOnlyInstance', - message - )) -}); +const queryMessage = contract.query +const executeMessage = contract.execute +const queryCtx = makeContext(queryMessage); +const executeCtx = makeContext(executeMessage); + +describe('query', () => { + it('execute_msg_for__empty', () => { + expectCode(createTypeInterface( + queryCtx, + queryMessage + )) + }) + + + it('query classes', () => { + expectCode(createQueryClass( + queryCtx, + 'QueryClient', + 'ReadOnlyInstance', + queryMessage + )) + }); + + it('query classes response', () => { + expectCode(createTypeInterface( + queryCtx, + contract.query + )) + }); + + it('execute classes array types', () => { + expectCode(createExecuteClass( + queryCtx, + 'Client', + 'Instance', + null, + queryMessage + )) + }); + + it('execute interfaces no extends', () => { + expectCode(createExecuteInterface( + queryCtx, + 'SG721Instance', + null, + queryMessage + )) + }); -// it('query classes response', () => { -// expectCode(createTypeInterface( -// ctx, -// contract.responses.all_debt_shares -// )) -// }); - -it('execute classes array types', () => { - expectCode(createExecuteClass( - ctx, - 'Client', - 'Instance', - null, - message - )) }); -it('execute interfaces no extends', () => { - expectCode(createExecuteInterface( - ctx, - 'SG721Instance', - null, - message - )) +describe('execute', () => { + it('execute_msg_for__empty', () => { + expectCode(createTypeInterface( + executeCtx, + executeMessage + )) + }) + + + it('query classes', () => { + expectCode(createQueryClass( + executeCtx, + 'QueryClient', + 'ReadOnlyInstance', + executeMessage + )) + }); + + it('query classes response', () => { + expectCode(createTypeInterface( + executeCtx, + contract.query + )) + }); + + it('execute classes array types', () => { + expectCode(createExecuteClass( + executeCtx, + 'Client', + 'Instance', + null, + executeMessage + )) + }); + + it('execute interfaces no extends', () => { + expectCode(createExecuteInterface( + executeCtx, + 'SG721Instance', + null, + executeMessage + )) + }); + }); From b5d8d50e154b6b6a595f6877ff82d7b89db10efc Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Tue, 16 May 2023 17:00:58 -0700 Subject: [PATCH 106/287] fix for raw/ --- __fixtures__/issues/103/raw/duplicate.json | 3 + __fixtures__/issues/98/out/98.client.ts | 247 ++++++++++++++++++ __fixtures__/issues/98/out/98.react-query.ts | 50 ++++ __fixtures__/issues/98/out/98.types.ts | 100 +++++++ __fixtures__/issues/98/out/bundle.ts | 15 ++ __output__/issues/103/clean.json | 109 ++++++++ __output__/issues/103/orig.json | 113 ++++++++ packages/ts-codegen/__tests__/cleanse.test.ts | 11 + packages/ts-codegen/src/utils/schemas.ts | 4 +- 9 files changed, 651 insertions(+), 1 deletion(-) create mode 100644 __fixtures__/issues/103/raw/duplicate.json create mode 100644 __fixtures__/issues/98/out/98.client.ts create mode 100644 __fixtures__/issues/98/out/98.react-query.ts create mode 100644 __fixtures__/issues/98/out/98.types.ts create mode 100644 __fixtures__/issues/98/out/bundle.ts create mode 100644 __output__/issues/103/clean.json create mode 100644 __output__/issues/103/orig.json diff --git a/__fixtures__/issues/103/raw/duplicate.json b/__fixtures__/issues/103/raw/duplicate.json new file mode 100644 index 00000000..22b92543 --- /dev/null +++ b/__fixtures__/issues/103/raw/duplicate.json @@ -0,0 +1,3 @@ +{ + "contract_name": "something-in-raw-folder" +} \ No newline at end of file diff --git a/__fixtures__/issues/98/out/98.client.ts b/__fixtures__/issues/98/out/98.client.ts new file mode 100644 index 00000000..b4e37f5b --- /dev/null +++ b/__fixtures__/issues/98/out/98.client.ts @@ -0,0 +1,247 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Uint128, InstantiateMsg, Coin, ExecuteMsg, InstallableExecMsg, Binary, ExecMsg, QueryMsg, InstallableQueryMsg, QueryMsg1, ConfigResponse, NullablePlugin, CanonicalAddr, Plugin, PluginsResponse } from "./98.types"; +export interface 98ReadOnlyInterface { + contractAddress: string; + getConfig: () => Promise; + getPlugins: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }) => Promise; + getPluginById: ({ + id + }: { + id: number; + }) => Promise; +} +export class 98QueryClient implements 98ReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getConfig = this.getConfig.bind(this); + this.getPlugins = this.getPlugins.bind(this); + this.getPluginById = this.getPluginById.bind(this); + } + + getConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_config: {} + }); + }; + getPlugins = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_plugins: { + limit, + start_after: startAfter + } + }); + }; + getPluginById = async ({ + id + }: { + id: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_plugin_by_id: { + id + } + }); + }; +} +export interface 98Interface extends 98ReadOnlyInterface { + contractAddress: string; + sender: string; + proxyInstallPlugin: ({ + id, + instantiateMsg + }: { + id: number; + instantiateMsg: Binary; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + registerPlugin: ({ + checksum, + codeId, + creator, + ipfsHash, + name, + version + }: { + checksum: string; + codeId: number; + creator: string; + ipfsHash: string; + name: string; + version: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + unregisterPlugin: ({ + id + }: { + id: number; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updatePlugin: ({ + checksum, + codeId, + creator, + id, + ipfsHash, + name, + version + }: { + checksum?: string; + codeId?: number; + creator?: string; + id: number; + ipfsHash?: string; + name?: string; + version?: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateRegistryFee: ({ + newFee + }: { + newFee: Coin; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + updateDaoAddr: ({ + newAddr + }: { + newAddr: string; + }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; +} +export class 98Client extends 98QueryClient implements 98Interface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + super(client, contractAddress); + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.proxyInstallPlugin = this.proxyInstallPlugin.bind(this); + this.registerPlugin = this.registerPlugin.bind(this); + this.unregisterPlugin = this.unregisterPlugin.bind(this); + this.updatePlugin = this.updatePlugin.bind(this); + this.updateRegistryFee = this.updateRegistryFee.bind(this); + this.updateDaoAddr = this.updateDaoAddr.bind(this); + } + + proxyInstallPlugin = async ({ + id, + instantiateMsg + }: { + id: number; + instantiateMsg: Binary; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + proxy_install_plugin: { + id, + instantiate_msg: instantiateMsg + } + }, fee, memo, funds); + }; + registerPlugin = async ({ + checksum, + codeId, + creator, + ipfsHash, + name, + version + }: { + checksum: string; + codeId: number; + creator: string; + ipfsHash: string; + name: string; + version: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_plugin: { + checksum, + code_id: codeId, + creator, + ipfs_hash: ipfsHash, + name, + version + } + }, fee, memo, funds); + }; + unregisterPlugin = async ({ + id + }: { + id: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + unregister_plugin: { + id + } + }, fee, memo, funds); + }; + updatePlugin = async ({ + checksum, + codeId, + creator, + id, + ipfsHash, + name, + version + }: { + checksum?: string; + codeId?: number; + creator?: string; + id: number; + ipfsHash?: string; + name?: string; + version?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_plugin: { + checksum, + code_id: codeId, + creator, + id, + ipfs_hash: ipfsHash, + name, + version + } + }, fee, memo, funds); + }; + updateRegistryFee = async ({ + newFee + }: { + newFee: Coin; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_registry_fee: { + new_fee: newFee + } + }, fee, memo, funds); + }; + updateDaoAddr = async ({ + newAddr + }: { + newAddr: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_dao_addr: { + new_addr: newAddr + } + }, fee, memo, funds); + }; +} \ No newline at end of file diff --git a/__fixtures__/issues/98/out/98.react-query.ts b/__fixtures__/issues/98/out/98.react-query.ts new file mode 100644 index 00000000..f9e31110 --- /dev/null +++ b/__fixtures__/issues/98/out/98.react-query.ts @@ -0,0 +1,50 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions, useQuery } from "react-query"; +import { Uint128, InstantiateMsg, Coin, ExecuteMsg, InstallableExecMsg, Binary, ExecMsg, QueryMsg, InstallableQueryMsg, QueryMsg1, ConfigResponse, NullablePlugin, CanonicalAddr, Plugin, PluginsResponse } from "./98.types"; +import { 98QueryClient } from "./98.client"; +export interface 98ReactQuery { + client: 98QueryClient; + options?: UseQueryOptions; +} +export interface 98GetPluginByIdQuery extends 98ReactQuery { + args: { + id: number; + }; +} +export function use98GetPluginByIdQuery({ + client, + args, + options +}: 98GetPluginByIdQuery) { + return useQuery(["98GetPluginById", client.contractAddress, JSON.stringify(args)], () => client.getPluginById({ + id: args.id + }), options); +} +export interface 98GetPluginsQuery extends 98ReactQuery { + args: { + limit?: number; + startAfter?: number; + }; +} +export function use98GetPluginsQuery({ + client, + args, + options +}: 98GetPluginsQuery) { + return useQuery(["98GetPlugins", client.contractAddress, JSON.stringify(args)], () => client.getPlugins({ + limit: args.limit, + startAfter: args.startAfter + }), options); +} +export interface 98GetConfigQuery extends 98ReactQuery {} +export function use98GetConfigQuery({ + client, + options +}: 98GetConfigQuery) { + return useQuery(["98GetConfig", client.contractAddress], () => client.getConfig(), options); +} \ No newline at end of file diff --git a/__fixtures__/issues/98/out/98.types.ts b/__fixtures__/issues/98/out/98.types.ts new file mode 100644 index 00000000..3fa99382 --- /dev/null +++ b/__fixtures__/issues/98/out/98.types.ts @@ -0,0 +1,100 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Uint128 = string; +export interface InstantiateMsg { + install_fee: Coin; + registry_fee: Coin; + [k: string]: unknown; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type ExecuteMsg = InstallableExecMsg | ExecMsg; +export type InstallableExecMsg = { + proxy_install_plugin: { + id: number; + instantiate_msg: Binary; + [k: string]: unknown; + }; +}; +export type Binary = string; +export type ExecMsg = { + register_plugin: { + checksum: string; + code_id: number; + creator: string; + ipfs_hash: string; + name: string; + version: string; + [k: string]: unknown; + }; +} | { + unregister_plugin: { + id: number; + [k: string]: unknown; + }; +} | { + update_plugin: { + checksum?: string | null; + code_id?: number | null; + creator?: string | null; + id: number; + ipfs_hash?: string | null; + name?: string | null; + version?: string | null; + [k: string]: unknown; + }; +} | { + update_registry_fee: { + new_fee: Coin; + [k: string]: unknown; + }; +} | { + update_dao_addr: { + new_addr: string; + [k: string]: unknown; + }; +}; +export type QueryMsg = InstallableQueryMsg | QueryMsg1; +export type InstallableQueryMsg = string; +export type QueryMsg1 = { + get_config: { + [k: string]: unknown; + }; +} | { + get_plugins: { + limit?: number | null; + start_after?: number | null; + [k: string]: unknown; + }; +} | { + get_plugin_by_id: { + id: number; + [k: string]: unknown; + }; +}; +export interface ConfigResponse { + dao_addr: string; + registry_fee: Coin; +} +export type NullablePlugin = Plugin | null; +export type CanonicalAddr = Binary; +export interface Plugin { + checksum: string; + code_id: number; + creator: CanonicalAddr; + id: number; + ipfs_hash: string; + name: string; + version: string; +} +export interface PluginsResponse { + plugins: Plugin[]; + total: number; +} \ No newline at end of file diff --git a/__fixtures__/issues/98/out/bundle.ts b/__fixtures__/issues/98/out/bundle.ts new file mode 100644 index 00000000..4f76a61e --- /dev/null +++ b/__fixtures__/issues/98/out/bundle.ts @@ -0,0 +1,15 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import * as _0 from "./98.types"; +import * as _1 from "./98.client"; +import * as _2 from "./98.react-query"; +export namespace contracts { + export const 98 = { ..._0, + ..._1, + ..._2 + }; +} \ No newline at end of file diff --git a/__output__/issues/103/clean.json b/__output__/issues/103/clean.json new file mode 100644 index 00000000..a799739a --- /dev/null +++ b/__output__/issues/103/clean.json @@ -0,0 +1,109 @@ +{ + "schemas": [ + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "admins", + "mutable" + ], + "properties": { + "admins": { + "type": "array", + "items": { + "type": "string" + } + }, + "mutable": { + "type": "boolean" + } + } + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "anyOf": [ + { + "$ref": "#/definitions/ExecMsg" + } + ], + "definitions": { + "ExecMsg": { + "type": "string" + } + } + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "anyOf": [ + { + "$ref": "#/definitions/QueryMsg" + } + ], + "definitions": { + "QueryMsg": { + "type": "string" + } + } + } + ], + "responses": {}, + "idlObject": { + "contract_name": "cw1-whitelist", + "contract_version": "0.3.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "admins", + "mutable" + ], + "properties": { + "admins": { + "type": "array", + "items": { + "type": "string" + } + }, + "mutable": { + "type": "boolean" + } + } + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "anyOf": [ + { + "$ref": "#/definitions/ExecMsg" + } + ], + "definitions": { + "ExecMsg": { + "type": "string" + } + } + }, + "query": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "anyOf": [ + { + "$ref": "#/definitions/QueryMsg" + } + ], + "definitions": { + "QueryMsg": { + "type": "string" + } + } + }, + "migrate": null, + "sudo": null, + "responses": {} + } +} \ No newline at end of file diff --git a/__output__/issues/103/orig.json b/__output__/issues/103/orig.json new file mode 100644 index 00000000..b4c7a8f0 --- /dev/null +++ b/__output__/issues/103/orig.json @@ -0,0 +1,113 @@ +{ + "schemas": [ + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "admins", + "mutable" + ], + "properties": { + "admins": { + "type": "array", + "items": { + "type": "string" + } + }, + "mutable": { + "type": "boolean" + } + } + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "anyOf": [ + { + "$ref": "#/definitions/ExecMsg" + } + ], + "definitions": { + "ExecMsg": { + "type": "string", + "enum": [] + } + } + }, + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "anyOf": [ + { + "$ref": "#/definitions/QueryMsg" + } + ], + "definitions": { + "QueryMsg": { + "type": "string", + "enum": [] + } + } + } + ], + "responses": {}, + "idlObject": { + "contract_name": "cw1-whitelist", + "contract_version": "0.3.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "admins", + "mutable" + ], + "properties": { + "admins": { + "type": "array", + "items": { + "type": "string" + } + }, + "mutable": { + "type": "boolean" + } + } + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "anyOf": [ + { + "$ref": "#/definitions/ExecMsg" + } + ], + "definitions": { + "ExecMsg": { + "type": "string", + "enum": [] + } + } + }, + "query": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "anyOf": [ + { + "$ref": "#/definitions/QueryMsg" + } + ], + "definitions": { + "QueryMsg": { + "type": "string", + "enum": [] + } + } + }, + "migrate": null, + "sudo": null, + "responses": {} + } +} \ No newline at end of file diff --git a/packages/ts-codegen/__tests__/cleanse.test.ts b/packages/ts-codegen/__tests__/cleanse.test.ts index c60a838d..6b79b3ab 100644 --- a/packages/ts-codegen/__tests__/cleanse.test.ts +++ b/packages/ts-codegen/__tests__/cleanse.test.ts @@ -29,6 +29,17 @@ it('daodao/cw-code-id-registry', async () => { mkdirp(out); writeFileSync(out + '/orig.json', JSON.stringify(orig, null, 2)); writeFileSync(out + '/clean.json', JSON.stringify(clean, null, 2)); +}) + +it('issues/103', async () => { + const out = OUTPUT_DIR + '/issues/103'; + const schemaDir = FIXTURE_DIR + '/issues/103/'; + + const clean = await readSchemas({ schemaDir, clean: true }); + const orig = await readSchemas({ schemaDir, clean: false }); + mkdirp(out); + writeFileSync(out + '/orig.json', JSON.stringify(orig, null, 2)); + writeFileSync(out + '/clean.json', JSON.stringify(clean, null, 2)); }) diff --git a/packages/ts-codegen/src/utils/schemas.ts b/packages/ts-codegen/src/utils/schemas.ts index 8d4ffcaa..a1206a65 100644 --- a/packages/ts-codegen/src/utils/schemas.ts +++ b/packages/ts-codegen/src/utils/schemas.ts @@ -13,7 +13,9 @@ export const readSchemas = async ({ schemaDir, clean = true }: ReadSchemaOpts): Promise => { const fn = clean ? cleanse : (str) => str; - const files = glob(schemaDir + '/**/*.json'); + const files = glob(schemaDir + '/**/*.json') + .filter(file => !file.match(/\/raw\//)); + const schemas = files .map(file => JSON.parse(readFileSync(file, 'utf-8'))); From 90fb688d19f477d246f9021ac91d824c96b8f3fc Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Tue, 16 May 2023 17:06:00 -0700 Subject: [PATCH 107/287] chore(release): publish - @cosmwasm/ts-codegen@0.28.0 - wasm-ast-types@0.21.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 4d482ce9..0b20b401 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.28.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.27.0...@cosmwasm/ts-codegen@0.28.0) (2023-05-17) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.27.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.26.0...@cosmwasm/ts-codegen@0.27.0) (2023-04-17) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index d87898ff..2f19d9b1 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.27.0", + "version": "0.28.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.20.0" + "wasm-ast-types": "^0.21.0" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 65d6171c..5068315d 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.21.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.20.0...wasm-ast-types@0.21.0) (2023-05-17) + +**Note:** Version bump only for package wasm-ast-types + + + + + # [0.20.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.19.0...wasm-ast-types@0.20.0) (2023-04-17) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index 1711fffc..8bda2efb 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.20.0", + "version": "0.21.0", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From 14689316a62db86b53230131d154ee32aa6a41f6 Mon Sep 17 00:00:00 2001 From: "M. Daeva" Date: Sat, 20 May 2023 20:57:47 +0300 Subject: [PATCH 108/287] cosmwasm -> @cosmjs/cosmwasm-stargate --- packages/ts-codegen/package.json | 2 +- .../wasm-ast-types/src/context/imports.ts | 2 +- yarn.lock | 579 +++++------------- 3 files changed, 166 insertions(+), 417 deletions(-) diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 2f19d9b1..be57d7c9 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -52,12 +52,12 @@ "@babel/cli": "7.18.10", "@babel/eslint-parser": "^7.18.9", "@babel/node": "^7.18.10", + "@cosmjs/cosmwasm-stargate": "0.30.1", "@types/jest": "^28.1.6", "ast-stringify": "0.1.0", "babel-core": "7.0.0-bridge.0", "babel-jest": "28.1.3", "babel-watch": "^7.0.0", - "cosmwasm": "1.1.1", "cross-env": "^7.0.2", "eslint": "8.21.0", "eslint-config-prettier": "^8.5.0", diff --git a/packages/wasm-ast-types/src/context/imports.ts b/packages/wasm-ast-types/src/context/imports.ts index 8669b81a..cf10b276 100644 --- a/packages/wasm-ast-types/src/context/imports.ts +++ b/packages/wasm-ast-types/src/context/imports.ts @@ -41,7 +41,7 @@ const makeReactQuerySwitch = (varName) => { export const UTILS = { selectorFamily: 'recoil', MsgExecuteContract: 'cosmjs-types/cosmwasm/wasm/v1/tx', - MsgExecuteContractEncodeObject: 'cosmwasm', + MsgExecuteContractEncodeObject: '@cosmjs/cosmwasm-stargate', Coin: '@cosmjs/amino', toUtf8: '@cosmjs/encoding', StdFee: '@cosmjs/amino', diff --git a/yarn.lock b/yarn.lock index 5c41f663..a7fa340b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1753,189 +1753,144 @@ "@confio/ics23@^0.6.8": version "0.6.8" - resolved "https://registry.npmjs.org/@confio/ics23/-/ics23-0.6.8.tgz" + resolved "https://registry.npmjs.org/@confio/ics23/-/ics23-0.6.8.tgz#2a6b4f1f2b7b20a35d9a0745bb5a446e72930b3d" integrity sha512-wB6uo+3A50m0sW/EWcU64xpV/8wShZ6bMTa7pF8eYsTrSkQA7oLUIJcs/wb8g4y2Oyq701BaGiO6n/ak5WXO1w== dependencies: "@noble/hashes" "^1.0.0" protobufjs "^6.8.8" -"@cosmjs/amino@0.28.7", "@cosmjs/amino@^0.28.3": - version "0.28.7" - resolved "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.28.7.tgz" - integrity sha512-NTCUS3+u9bxwW8moC0N1RS4Gk/fs3JPHTKcp7ksH39V4+7uOKM2rGsyFAekiHNxYngnQ+1hU5x2tddS25soK6Q== - dependencies: - "@cosmjs/crypto" "0.28.7" - "@cosmjs/encoding" "0.28.7" - "@cosmjs/math" "0.28.7" - "@cosmjs/utils" "0.28.7" - -"@cosmjs/cli@^0.28.3": - version "0.28.7" - resolved "https://registry.npmjs.org/@cosmjs/cli/-/cli-0.28.7.tgz" - integrity sha512-Cmdp9Ln23A2jem7G+Qun28+lWr40WCVVM7NT7qgtrjLPc1RdEvTN8zdGvIyeROsTNS5Qjr5Mb7bx5AJUyC/Bqw== - dependencies: - "@cosmjs/amino" "0.28.7" - "@cosmjs/cosmwasm-stargate" "0.28.7" - "@cosmjs/crypto" "0.28.7" - "@cosmjs/encoding" "0.28.7" - "@cosmjs/faucet-client" "0.28.7" - "@cosmjs/math" "0.28.7" - "@cosmjs/proto-signing" "0.28.7" - "@cosmjs/stargate" "0.28.7" - "@cosmjs/tendermint-rpc" "0.28.7" - "@cosmjs/utils" "0.28.7" - axios "^0.21.2" - babylon "^6.18.0" - chalk "^4" - cosmjs-types "^0.4.0" - diff "^4" - recast "^0.20" - ts-node "^8" - typescript "~4.4" - yargs "^15.3.1" - -"@cosmjs/cosmwasm-stargate@0.28.7", "@cosmjs/cosmwasm-stargate@^0.28.3": - version "0.28.7" - resolved "https://registry.npmjs.org/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.28.7.tgz" - integrity sha512-pUIHu8ssLFnUqQJlva3AWuXgIiqfCrpmyIe+B61x8GMz/MxDsoiojQHsNQFh4vV518DgIx3bJu6hXF6YPwA+Kg== - dependencies: - "@cosmjs/amino" "0.28.7" - "@cosmjs/crypto" "0.28.7" - "@cosmjs/encoding" "0.28.7" - "@cosmjs/math" "0.28.7" - "@cosmjs/proto-signing" "0.28.7" - "@cosmjs/stargate" "0.28.7" - "@cosmjs/tendermint-rpc" "0.28.7" - "@cosmjs/utils" "0.28.7" - cosmjs-types "^0.4.0" +"@cosmjs/amino@^0.30.1": + version "0.30.1" + resolved "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.30.1.tgz#7c18c14627361ba6c88e3495700ceea1f76baace" + integrity sha512-yNHnzmvAlkETDYIpeCTdVqgvrdt1qgkOXwuRVi8s27UKI5hfqyE9fJ/fuunXE6ZZPnKkjIecDznmuUOMrMvw4w== + dependencies: + "@cosmjs/crypto" "^0.30.1" + "@cosmjs/encoding" "^0.30.1" + "@cosmjs/math" "^0.30.1" + "@cosmjs/utils" "^0.30.1" + +"@cosmjs/cosmwasm-stargate@0.30.1": + version "0.30.1" + resolved "https://registry.npmjs.org/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.30.1.tgz#6f9ca310f75433a3e30d683bc6aa24eadb345d79" + integrity sha512-W/6SLUCJAJGBN+sJLXouLZikVgmqDd9LCdlMzQaxczcCHTWeJAmRvOiZGSZaSy3shw/JN1qc6g6PKpvTVgj10A== + dependencies: + "@cosmjs/amino" "^0.30.1" + "@cosmjs/crypto" "^0.30.1" + "@cosmjs/encoding" "^0.30.1" + "@cosmjs/math" "^0.30.1" + "@cosmjs/proto-signing" "^0.30.1" + "@cosmjs/stargate" "^0.30.1" + "@cosmjs/tendermint-rpc" "^0.30.1" + "@cosmjs/utils" "^0.30.1" + cosmjs-types "^0.7.1" long "^4.0.0" pako "^2.0.2" -"@cosmjs/crypto@0.28.7", "@cosmjs/crypto@^0.28.3": - version "0.28.7" - resolved "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.28.7.tgz" - integrity sha512-Fuq90nnqXQb6VvUadGtPy1X6arXY+yhqB95VzN8GM/ZdBLeigu6a3XjOvFki4lKO94QdLn2e9huD8dm4tDQDsA== +"@cosmjs/crypto@^0.30.1": + version "0.30.1" + resolved "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.30.1.tgz#21e94d5ca8f8ded16eee1389d2639cb5c43c3eb5" + integrity sha512-rAljUlake3MSXs9xAm87mu34GfBLN0h/1uPPV6jEwClWjNkAMotzjC0ab9MARy5FFAvYHL3lWb57bhkbt2GtzQ== dependencies: - "@cosmjs/encoding" "0.28.7" - "@cosmjs/math" "0.28.7" - "@cosmjs/utils" "0.28.7" + "@cosmjs/encoding" "^0.30.1" + "@cosmjs/math" "^0.30.1" + "@cosmjs/utils" "^0.30.1" "@noble/hashes" "^1" bn.js "^5.2.0" - elliptic "^6.5.3" + elliptic "^6.5.4" libsodium-wrappers "^0.7.6" -"@cosmjs/encoding@0.28.7", "@cosmjs/encoding@^0.28.3": - version "0.28.7" - resolved "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.28.7.tgz" - integrity sha512-m2OuRhxux0YacvtjTocEOHyjnKO/KKGjqXlAY5HXGJpyntr+PIlJFdoS9tHax+1rNRrblZXwYIT+UqOs+kSk5Q== +"@cosmjs/encoding@^0.30.1": + version "0.30.1" + resolved "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.30.1.tgz#b5c4e0ef7ceb1f2753688eb96400ed70f35c6058" + integrity sha512-rXmrTbgqwihORwJ3xYhIgQFfMSrwLu1s43RIK9I8EBudPx3KmnmyAKzMOVsRDo9edLFNuZ9GIvysUCwQfq3WlQ== dependencies: base64-js "^1.3.0" bech32 "^1.1.4" readonly-date "^1.0.0" -"@cosmjs/faucet-client@0.28.7", "@cosmjs/faucet-client@^0.28.3": - version "0.28.7" - resolved "https://registry.npmjs.org/@cosmjs/faucet-client/-/faucet-client-0.28.7.tgz" - integrity sha512-cIzADy9CbA5xsuEKwYqsw20H6DPOneXa9kTBFofjN/ivDBHw/rV3/DOjrUGuvNMLD+FSJgaHrctw4/nRcxtLQA== +"@cosmjs/json-rpc@^0.30.1": + version "0.30.1" + resolved "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.30.1.tgz#16f21305fc167598c8a23a45549b85106b2372bc" + integrity sha512-pitfC/2YN9t+kXZCbNuyrZ6M8abnCC2n62m+JtU9vQUfaEtVsgy+1Fk4TRQ175+pIWSdBMFi2wT8FWVEE4RhxQ== dependencies: - axios "^0.21.2" - -"@cosmjs/json-rpc@0.28.7": - version "0.28.7" - resolved "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.28.7.tgz" - integrity sha512-2qgRL/9ih/ZYU/8LmtDQopaCKJBKqsuoSXfb2XO3yv6EkE28yiA8YAwLW5IrXjl1tfSiolHaBWarEASS/8Q5xA== - dependencies: - "@cosmjs/stream" "0.28.7" + "@cosmjs/stream" "^0.30.1" xstream "^11.14.0" -"@cosmjs/ledger-amino@^0.28.3": - version "0.28.7" - resolved "https://registry.npmjs.org/@cosmjs/ledger-amino/-/ledger-amino-0.28.7.tgz" - integrity sha512-3Ke5j+BEYs+OwL7vY8zGiglvJs5A9dhmicx7Ln7rMdpprKBROgXsvhvk0GuoYq97QngsI8DlJph4kxdHvVkHbg== - dependencies: - "@cosmjs/amino" "0.28.7" - "@cosmjs/crypto" "0.28.7" - "@cosmjs/encoding" "0.28.7" - "@cosmjs/math" "0.28.7" - "@cosmjs/utils" "0.28.7" - ledger-cosmos-js "^2.1.8" - semver "^7.3.2" - -"@cosmjs/math@0.28.7", "@cosmjs/math@^0.28.3": - version "0.28.7" - resolved "https://registry.npmjs.org/@cosmjs/math/-/math-0.28.7.tgz" - integrity sha512-wSXIOOGVzgtRFsGwScpvQ6C6DUx97K7Ez3KyvRALNzspEnIoKPDgTXf438zhZnb+0+ERAwgdkb/6zWaDoVBfUA== +"@cosmjs/math@^0.30.1": + version "0.30.1" + resolved "https://registry.npmjs.org/@cosmjs/math/-/math-0.30.1.tgz#8b816ef4de5d3afa66cb9fdfb5df2357a7845b8a" + integrity sha512-yaoeI23pin9ZiPHIisa6qqLngfnBR/25tSaWpkTm8Cy10MX70UF5oN4+/t1heLaM6SSmRrhk3psRkV4+7mH51Q== dependencies: bn.js "^5.2.0" -"@cosmjs/proto-signing@0.28.7", "@cosmjs/proto-signing@^0.28.3": - version "0.28.7" - resolved "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.28.7.tgz" - integrity sha512-cOwDQVv95KnpHWlkrtxZ+2Q+z2Qp8Co//g+bwNc+YZ403iGHXSK5PRe3YsPa4f3elKJkJpHVi5oyzp4DB8p7mA== - dependencies: - "@cosmjs/amino" "0.28.7" - "@cosmjs/crypto" "0.28.7" - "@cosmjs/encoding" "0.28.7" - "@cosmjs/math" "0.28.7" - "@cosmjs/utils" "0.28.7" - cosmjs-types "^0.4.0" +"@cosmjs/proto-signing@^0.30.1": + version "0.30.1" + resolved "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.30.1.tgz#f0dda372488df9cd2677150b89b3e9c72b3cb713" + integrity sha512-tXh8pPYXV4aiJVhTKHGyeZekjj+K9s2KKojMB93Gcob2DxUjfKapFYBMJSgfKPuWUPEmyr8Q9km2hplI38ILgQ== + dependencies: + "@cosmjs/amino" "^0.30.1" + "@cosmjs/crypto" "^0.30.1" + "@cosmjs/encoding" "^0.30.1" + "@cosmjs/math" "^0.30.1" + "@cosmjs/utils" "^0.30.1" + cosmjs-types "^0.7.1" long "^4.0.0" -"@cosmjs/socket@0.28.7": - version "0.28.7" - resolved "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.28.7.tgz" - integrity sha512-+sCR5AzjjsKlA0K7m8YdxldMvgJa3Tqnx0AAyQXlNw2VXmW1zu9DkKZWW475XFhwO9UYfrdIsOe1vbhnUjQb5g== +"@cosmjs/socket@^0.30.1": + version "0.30.1" + resolved "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.30.1.tgz#00b22f4b5e2ab01f4d82ccdb7b2e59536bfe5ce0" + integrity sha512-r6MpDL+9N+qOS/D5VaxnPaMJ3flwQ36G+vPvYJsXArj93BjgyFB7BwWwXCQDzZ+23cfChPUfhbINOenr8N2Kow== dependencies: - "@cosmjs/stream" "0.28.7" + "@cosmjs/stream" "^0.30.1" isomorphic-ws "^4.0.1" ws "^7" xstream "^11.14.0" -"@cosmjs/stargate@0.28.7", "@cosmjs/stargate@^0.28.3": - version "0.28.7" - resolved "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.28.7.tgz" - integrity sha512-3nY7czFUaY74gacbQAZuNji1qJWWQjv2C1cxYNqe7qAZAvCiz6A9adJVUmCJRL4peeG7tKiOny1J5IFbsgRu0g== +"@cosmjs/stargate@^0.30.1": + version "0.30.1" + resolved "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.30.1.tgz#e1b22e1226cffc6e93914a410755f1f61057ba04" + integrity sha512-RdbYKZCGOH8gWebO7r6WvNnQMxHrNXInY/gPHPzMjbQF6UatA6fNM2G2tdgS5j5u7FTqlCI10stNXrknaNdzog== dependencies: "@confio/ics23" "^0.6.8" - "@cosmjs/amino" "0.28.7" - "@cosmjs/encoding" "0.28.7" - "@cosmjs/math" "0.28.7" - "@cosmjs/proto-signing" "0.28.7" - "@cosmjs/stream" "0.28.7" - "@cosmjs/tendermint-rpc" "0.28.7" - "@cosmjs/utils" "0.28.7" - cosmjs-types "^0.4.0" + "@cosmjs/amino" "^0.30.1" + "@cosmjs/encoding" "^0.30.1" + "@cosmjs/math" "^0.30.1" + "@cosmjs/proto-signing" "^0.30.1" + "@cosmjs/stream" "^0.30.1" + "@cosmjs/tendermint-rpc" "^0.30.1" + "@cosmjs/utils" "^0.30.1" + cosmjs-types "^0.7.1" long "^4.0.0" protobufjs "~6.11.3" xstream "^11.14.0" -"@cosmjs/stream@0.28.7": - version "0.28.7" - resolved "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.28.7.tgz" - integrity sha512-zTMZadlpmxAMtKUHX/dnYs1STung392+P50WgSUAjllG7CZYl7SAY03AKgc+aoF1ohYQcgH9H7VSgabEgLPhmg== +"@cosmjs/stream@^0.30.1": + version "0.30.1" + resolved "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.30.1.tgz#ba038a2aaf41343696b1e6e759d8e03a9516ec1a" + integrity sha512-Fg0pWz1zXQdoxQZpdHRMGvUH5RqS6tPv+j9Eh7Q953UjMlrwZVo0YFLC8OTf/HKVf10E4i0u6aM8D69Q6cNkgQ== dependencies: xstream "^11.14.0" -"@cosmjs/tendermint-rpc@0.28.7": - version "0.28.7" - resolved "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.28.7.tgz" - integrity sha512-xhIVJL3ol+fZxywP76Ik9pHqCvBdU/BGAw6p48mhla3L3xNcFN2Nf+EnJWcIZPqZl8bHm5QHzPk9VqVFVYCMCw== - dependencies: - "@cosmjs/crypto" "0.28.7" - "@cosmjs/encoding" "0.28.7" - "@cosmjs/json-rpc" "0.28.7" - "@cosmjs/math" "0.28.7" - "@cosmjs/socket" "0.28.7" - "@cosmjs/stream" "0.28.7" - "@cosmjs/utils" "0.28.7" +"@cosmjs/tendermint-rpc@^0.30.1": + version "0.30.1" + resolved "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.30.1.tgz#c16378892ba1ac63f72803fdf7567eab9d4f0aa0" + integrity sha512-Z3nCwhXSbPZJ++v85zHObeUggrEHVfm1u18ZRwXxFE9ZMl5mXTybnwYhczuYOl7KRskgwlB+rID0WYACxj4wdQ== + dependencies: + "@cosmjs/crypto" "^0.30.1" + "@cosmjs/encoding" "^0.30.1" + "@cosmjs/json-rpc" "^0.30.1" + "@cosmjs/math" "^0.30.1" + "@cosmjs/socket" "^0.30.1" + "@cosmjs/stream" "^0.30.1" + "@cosmjs/utils" "^0.30.1" axios "^0.21.2" readonly-date "^1.0.0" xstream "^11.14.0" -"@cosmjs/utils@0.28.7", "@cosmjs/utils@^0.28.3": - version "0.28.7" - resolved "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.28.7.tgz" - integrity sha512-0ya5mRaDY956n87dKjx6wfqgH/uEfrZyMswIhcEPqQPegwp4FDd6cwJtSdv/d5S7fgvoEs2UABvUFNzCT5C0hg== +"@cosmjs/utils@^0.30.1": + version "0.30.1" + resolved "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.30.1.tgz#6d92582341be3c2ec8d82090253cfa4b7f959edb" + integrity sha512-KvvX58MGMWh7xA+N+deCfunkA/ZNDvFLw4YbOmX3f/XBIkqrVY7qlotfy2aNb1kgp6h4B6Yc8YawJPDTfvWX7g== "@eslint/eslintrc@^1.3.0": version "1.3.0" @@ -2254,35 +2209,6 @@ resolved "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz" integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== -"@ledgerhq/devices@^5.51.1": - version "5.51.1" - resolved "https://registry.npmjs.org/@ledgerhq/devices/-/devices-5.51.1.tgz" - integrity sha512-4w+P0VkbjzEXC7kv8T1GJ/9AVaP9I6uasMZ/JcdwZBS3qwvKo5A5z9uGhP5c7TvItzcmPb44b5Mw2kT+WjUuAA== - dependencies: - "@ledgerhq/errors" "^5.50.0" - "@ledgerhq/logs" "^5.50.0" - rxjs "6" - semver "^7.3.5" - -"@ledgerhq/errors@^5.50.0": - version "5.50.0" - resolved "https://registry.npmjs.org/@ledgerhq/errors/-/errors-5.50.0.tgz" - integrity sha512-gu6aJ/BHuRlpU7kgVpy2vcYk6atjB4iauP2ymF7Gk0ez0Y/6VSMVSJvubeEQN+IV60+OBK0JgeIZG7OiHaw8ow== - -"@ledgerhq/hw-transport@^5.25.0": - version "5.51.1" - resolved "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-5.51.1.tgz" - integrity sha512-6wDYdbWrw9VwHIcoDnqWBaDFyviyjZWv6H9vz9Vyhe4Qd7TIFmbTl/eWs6hZvtZBza9K8y7zD8ChHwRI4s9tSw== - dependencies: - "@ledgerhq/devices" "^5.51.1" - "@ledgerhq/errors" "^5.50.0" - events "^3.3.0" - -"@ledgerhq/logs@^5.50.0": - version "5.50.0" - resolved "https://registry.npmjs.org/@ledgerhq/logs/-/logs-5.50.0.tgz" - integrity sha512-swKHYCOZUGyVt4ge0u8a7AwNcA//h4nx5wIi0sruGye1IJ5Cva0GyK9L2/WdX+kWVTKp92ZiEo1df31lrWGPgA== - "@lerna/add@4.0.0": version "4.0.0" resolved "https://registry.npmjs.org/@lerna/add/-/add-4.0.0.tgz" @@ -2960,9 +2886,9 @@ integrity sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ== "@noble/hashes@^1", "@noble/hashes@^1.0.0": - version "1.1.1" - resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.1.1.tgz" - integrity sha512-Lkp9+NijmV7eSVZqiUvt3UCuuHeJpUVmRrvh430gyJjJiuJMqkeHf6/A9lQ/smmbWV/0spDeJscscPzyB4waZg== + version "1.3.0" + resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.0.tgz#085fd70f6d7d9d109671090ccae1d3bec62554a1" + integrity sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -3158,27 +3084,27 @@ "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": version "1.1.2" - resolved "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz" + resolved "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" integrity sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ== "@protobufjs/base64@^1.1.2": version "1.1.2" - resolved "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz" + resolved "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== "@protobufjs/codegen@^2.0.4": version "2.0.4" - resolved "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz" + resolved "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== "@protobufjs/eventemitter@^1.1.0": version "1.1.0" - resolved "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz" + resolved "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" integrity sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q== "@protobufjs/fetch@^1.1.0": version "1.1.0" - resolved "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz" + resolved "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" integrity sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ== dependencies: "@protobufjs/aspromise" "^1.1.1" @@ -3186,27 +3112,27 @@ "@protobufjs/float@^1.0.2": version "1.0.2" - resolved "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz" + resolved "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" integrity sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ== "@protobufjs/inquire@^1.1.0": version "1.1.0" - resolved "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz" + resolved "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q== "@protobufjs/path@^1.1.2": version "1.1.2" - resolved "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz" + resolved "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" integrity sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA== "@protobufjs/pool@^1.1.0": version "1.1.0" - resolved "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz" + resolved "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw== "@protobufjs/utf8@^1.1.0": version "1.1.0" - resolved "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz" + resolved "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== "@pyramation/babel-preset-env@0.1.0": @@ -3368,7 +3294,7 @@ "@types/long@^4.0.1": version "4.0.2" - resolved "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz" + resolved "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== "@types/minimatch@*", "@types/minimatch@^3.0.3": @@ -3387,9 +3313,9 @@ integrity sha512-Xjt5ZGUa5WusGZJ4WJPbOT8QOqp6nDynVFRKcUt32bOgvXEoc6o085WNkYTMO7ifAj2isEfQQ2cseE+wT6jsRw== "@types/node@>=13.7.0": - version "18.0.0" - resolved "https://registry.npmjs.org/@types/node/-/node-18.0.0.tgz" - integrity sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA== + version "20.2.1" + resolved "https://registry.npmjs.org/@types/node/-/node-20.2.1.tgz#de559d4b33be9a808fd43372ccee822c70f39704" + integrity sha512-DqJociPbZP1lbZ5SQPk4oag6W7AyaGMO6gSfRwq3PWl4PXTwJpRQJhDq4W0kzrg3w6tJ1SwlvGZ5uKFHY13LIg== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -3577,11 +3503,6 @@ are-we-there-yet@~1.1.2: delegates "^1.0.0" readable-stream "^2.0.6" -arg@^4.1.0: - version "4.1.3" - resolved "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz" - integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== - argparse@^1.0.7: version "1.0.10" resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -3654,13 +3575,6 @@ ast-stringify@0.1.0: dependencies: "@babel/runtime" "^7.11.2" -ast-types@0.14.2: - version "0.14.2" - resolved "https://registry.npmjs.org/ast-types/-/ast-types-0.14.2.tgz" - integrity sha512-O0yuUDnZeQDL+ncNGlJ78BiO4jnYI3bvMsD5prT0/nsgijG/LpNBIr63gTjVTNsiGkgQhiyCShTgxt8oXOrklA== - dependencies: - tslib "^2.0.1" - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" @@ -3683,7 +3597,7 @@ aws4@^1.8.0: axios@^0.21.2: version "0.21.4" - resolved "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz" + resolved "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== dependencies: follow-redirects "^1.14.0" @@ -3808,11 +3722,6 @@ babel-watch@^7.0.0: source-map-support "^0.5.19" string-argv "^0.3.1" -babylon@^6.18.0: - version "6.18.0" - resolved "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz" - integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== - balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -3820,7 +3729,7 @@ balanced-match@^1.0.0: base64-js@^1.3.0: version "1.5.1" - resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" + resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== bcrypt-pbkdf@^1.0.0: @@ -3832,7 +3741,7 @@ bcrypt-pbkdf@^1.0.0: bech32@^1.1.4: version "1.1.4" - resolved "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz" + resolved "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== before-after-hook@^2.2.0: @@ -3847,12 +3756,12 @@ binary-extensions@^2.0.0: bn.js@^4.11.9: version "4.12.0" - resolved "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz" + resolved "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== bn.js@^5.2.0: version "5.2.1" - resolved "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz" + resolved "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== brace-expansion@^1.1.7: @@ -3879,7 +3788,7 @@ braces@^3.0.2, braces@~3.0.2: brorand@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz" + resolved "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== browserslist@^4.11.1, browserslist@^4.20.4: @@ -3988,7 +3897,7 @@ camelcase-keys@^6.2.2: map-obj "^4.0.0" quick-lru "^4.0.1" -camelcase@^5.0.0, camelcase@^5.3.1: +camelcase@^5.3.1: version "5.3.1" resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== @@ -4033,7 +3942,7 @@ chalk@^2.0.0, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4, chalk@^4.0.0, chalk@^4.1.0: +chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -4136,15 +4045,6 @@ cli-width@^3.0.0: resolved "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz" integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== -cliui@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz" - integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^6.2.0" - cliui@^7.0.2: version "7.0.4" resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" @@ -4419,31 +4319,14 @@ cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.0" -cosmjs-types@^0.4.0: - version "0.4.1" - resolved "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.4.1.tgz" - integrity sha512-I7E/cHkIgoJzMNQdFF0YVqPlaTqrqKHrskuSTIqlEyxfB5Lf3WKCajSXVK2yHOfOFfSux/RxEdpMzw/eO4DIog== +cosmjs-types@^0.7.1: + version "0.7.2" + resolved "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.7.2.tgz#a757371abd340949c5bd5d49c6f8379ae1ffd7e2" + integrity sha512-vf2uLyktjr/XVAgEq0DjMxeAWh1yYREe7AMHDKd7EiHVqxBPCaBS+qEEQUkXbR9ndnckqr1sUG8BQhazh4X5lA== dependencies: long "^4.0.0" protobufjs "~6.11.2" -cosmwasm@1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/cosmwasm/-/cosmwasm-1.1.1.tgz" - integrity sha512-tjpjwnRIQ6VEcTVB0Pq8+F+Xp6jdnC3BcXmcDHCJHIc5Gg4Mm++AA+6fTfR0yuiPbEAk6wYkokfLtv12I0sPNQ== - dependencies: - "@cosmjs/amino" "^0.28.3" - "@cosmjs/cli" "^0.28.3" - "@cosmjs/cosmwasm-stargate" "^0.28.3" - "@cosmjs/crypto" "^0.28.3" - "@cosmjs/encoding" "^0.28.3" - "@cosmjs/faucet-client" "^0.28.3" - "@cosmjs/ledger-amino" "^0.28.3" - "@cosmjs/math" "^0.28.3" - "@cosmjs/proto-signing" "^0.28.3" - "@cosmjs/stargate" "^0.28.3" - "@cosmjs/utils" "^0.28.3" - cross-env@^7.0.2: version "7.0.3" resolved "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz" @@ -4505,7 +4388,7 @@ decamelize-keys@^1.1.0: decamelize "^1.1.0" map-obj "^1.0.0" -decamelize@^1.1.0, decamelize@^1.2.0: +decamelize@^1.1.0: version "1.2.0" resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== @@ -4593,11 +4476,6 @@ diff-sequences@^28.1.1: resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-28.1.1.tgz#9989dc731266dc2903457a70e996f3a041913ac6" integrity sha512-FU0iFaH/E23a+a718l8Qa/19bF9p06kgE0KipMOMadwa3SjnaElKzPaUC0vnibs6/B/9ni97s61mcejk8W1fQw== -diff@^4, diff@^4.0.1: - version "4.0.2" - resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -4654,9 +4532,9 @@ electron-to-chromium@^1.4.202: resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.212.tgz#20cd48e88288fd2428138c108804edb1961bf559" integrity sha512-LjQUg1SpLj2GfyaPDVBUHdhmlDU1vDB4f0mJWSGkISoXQrn5/lH3ECPCuo2Bkvf6Y30wO+b69te+rZK/llZmjg== -elliptic@^6.5.3: +elliptic@^6.5.4: version "6.5.4" - resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz" + resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== dependencies: bn.js "^4.11.9" @@ -4913,7 +4791,7 @@ espree@^9.3.2, espree@^9.3.3: acorn-jsx "^5.3.2" eslint-visitor-keys "^3.3.0" -esprima@^4.0.0, esprima@~4.0.0: +esprima@^4.0.0: version "4.0.1" resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== @@ -4960,11 +4838,6 @@ eventemitter3@^4.0.4: resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== -events@^3.3.0: - version "3.3.0" - resolved "https://registry.npmjs.org/events/-/events-3.3.0.tgz" - integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== - execa@^5.0.0: version "5.1.1" resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" @@ -5167,9 +5040,9 @@ flatted@^3.1.0: integrity sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ== follow-redirects@^1.14.0: - version "1.15.1" - resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz" - integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA== + version "1.15.2" + resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== forever-agent@~0.6.1: version "0.6.1" @@ -5273,7 +5146,7 @@ gensync@^1.0.0-beta.1, gensync@^1.0.0-beta.2: resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== -get-caller-file@^2.0.1, get-caller-file@^2.0.5: +get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== @@ -5439,7 +5312,7 @@ globals@^13.15.0: globalthis@^1.0.1: version "1.0.3" - resolved "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz" + resolved "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== dependencies: define-properties "^1.1.3" @@ -5549,18 +5422,9 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -hash-base@^3.0.0: - version "3.1.0" - resolved "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz" - integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== - dependencies: - inherits "^2.0.4" - readable-stream "^3.6.0" - safe-buffer "^5.2.0" - hash.js@^1.0.0, hash.js@^1.0.3: version "1.1.7" - resolved "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz" + resolved "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== dependencies: inherits "^2.0.3" @@ -5568,7 +5432,7 @@ hash.js@^1.0.0, hash.js@^1.0.3: hmac-drbg@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz" + resolved "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== dependencies: hash.js "^1.0.3" @@ -5707,7 +5571,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: +inherits@2, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -6066,7 +5930,7 @@ isobject@^3.0.1: isomorphic-ws@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz" + resolved "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc" integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== isstream@~0.1.2: @@ -6615,16 +6479,6 @@ kleur@^3.0.3: resolved "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== -ledger-cosmos-js@^2.1.8: - version "2.1.8" - resolved "https://registry.npmjs.org/ledger-cosmos-js/-/ledger-cosmos-js-2.1.8.tgz" - integrity sha512-Gl7SWMq+3R9OTkF1hLlg5+1geGOmcHX9OdS+INDsGNxSiKRWlsWCvQipGoDnRIQ6CPo2i/Ze58Dw0Mt/l3UYyA== - dependencies: - "@babel/runtime" "^7.11.2" - "@ledgerhq/hw-transport" "^5.25.0" - bech32 "^1.1.4" - ripemd160 "^2.0.2" - lerna@4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/lerna/-/lerna-4.0.0.tgz" @@ -6691,16 +6545,16 @@ libnpmpublish@^4.0.0: ssri "^8.0.1" libsodium-wrappers@^0.7.6: - version "0.7.10" - resolved "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.10.tgz" - integrity sha512-pO3F1Q9NPLB/MWIhehim42b/Fwb30JNScCNh8TcQ/kIc+qGLQch8ag8wb0keK3EP5kbGakk1H8Wwo7v+36rNQg== + version "0.7.11" + resolved "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.11.tgz#53bd20606dffcc54ea2122133c7da38218f575f7" + integrity sha512-SrcLtXj7BM19vUKtQuyQKiQCRJPgbpauzl3s0rSwD+60wtHqSUuqcoawlMDheCJga85nKOQwxNYQxf/CKAvs6Q== dependencies: - libsodium "^0.7.0" + libsodium "^0.7.11" -libsodium@^0.7.0: - version "0.7.10" - resolved "https://registry.npmjs.org/libsodium/-/libsodium-0.7.10.tgz" - integrity sha512-eY+z7hDrDKxkAK+QKZVNv92A5KYkxfvIshtBJkmg5TSiCnYqZP3i9OO9whE79Pwgm4jGaoHgkM4ao/b9Cyu4zQ== +libsodium@^0.7.11: + version "0.7.11" + resolved "https://registry.npmjs.org/libsodium/-/libsodium-0.7.11.tgz#cd10aae7bcc34a300cc6ad0ac88fcca674cfbc2e" + integrity sha512-WPfJ7sS53I2s4iM58QxY3Inb83/6mjlYgcmZs7DJsvDlnmVUwNinBCi5vBT43P6bHRy01O4zsMU2CoVR6xJ40A== lines-and-columns@^1.1.6: version "1.2.4" @@ -6814,7 +6668,7 @@ lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17 long@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/long/-/long-4.0.0.tgz" + resolved "https://registry.npmjs.org/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== long@^5.2.0: @@ -6858,7 +6712,7 @@ make-dir@^3.0.0: dependencies: semver "^6.0.0" -make-error@1.x, make-error@^1.1.1: +make-error@1.x: version "1.3.6" resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== @@ -7001,12 +6855,12 @@ min-indent@^1.0.0: minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz" + resolved "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== minimalistic-crypto-utils@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz" + resolved "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: @@ -7638,9 +7492,9 @@ pacote@^11.2.6: tar "^6.1.0" pako@^2.0.2: - version "2.0.4" - resolved "https://registry.npmjs.org/pako/-/pako-2.0.4.tgz" - integrity sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg== + version "2.1.0" + resolved "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86" + integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug== parent-module@^1.0.0: version "1.0.1" @@ -7865,7 +7719,7 @@ proto-list@~1.2.1: protobufjs@^6.8.8, protobufjs@~6.11.2, protobufjs@~6.11.3: version "6.11.3" - resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz" + resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74" integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg== dependencies: "@protobufjs/aspromise" "^1.1.2" @@ -8034,7 +7888,7 @@ read@1, read@~1.0.1: dependencies: mute-stream "~0.0.4" -readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.6.0: +readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2: version "3.6.0" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -8075,19 +7929,9 @@ readdirp@~3.6.0: readonly-date@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/readonly-date/-/readonly-date-1.0.0.tgz" + resolved "https://registry.npmjs.org/readonly-date/-/readonly-date-1.0.0.tgz#5af785464d8c7d7c40b9d738cbde8c646f97dcd9" integrity sha512-tMKIV7hlk0h4mO3JTmmVuIlJVXjKk3Sep9Bf5OH0O+758ruuVkUy2J9SttDLm91IEX/WHlXPSpxMGjPj4beMIQ== -recast@^0.20: - version "0.20.5" - resolved "https://registry.npmjs.org/recast/-/recast-0.20.5.tgz" - integrity sha512-E5qICoPoNL4yU0H0NoBDntNB0Q5oMSNh9usFctYniLBluTthi3RsQVBXIJNbApOlvSwW/RGxIuokPcAc59J5fQ== - dependencies: - ast-types "0.14.2" - esprima "~4.0.0" - source-map "~0.6.1" - tslib "^2.0.1" - rechoir@^0.6.2: version "0.6.2" resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz" @@ -8208,11 +8052,6 @@ require-directory@^2.1.1: resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" @@ -8293,14 +8132,6 @@ rimraf@^2.6.3: dependencies: glob "^7.1.3" -ripemd160@^2.0.2: - version "2.0.2" - resolved "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz" - integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - run-async@^2.2.0, run-async@^2.3.0, run-async@^2.4.0: version "2.4.1" resolved "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz" @@ -8325,14 +8156,14 @@ rx-lite@*, rx-lite@^4.0.8: resolved "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz" integrity sha512-Cun9QucwK6MIrp3mry/Y7hqD1oFqTYLQ4pGxaHTjIdaFDWRGGLikqp6u8LcWJnzpoALg9hap+JGk8sFIUuEGNA== -rxjs@6, rxjs@^6.4.0, rxjs@^6.6.0: +rxjs@^6.4.0, rxjs@^6.6.0: version "6.6.7" resolved "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== dependencies: tslib "^1.9.0" -safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: +safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -8369,7 +8200,7 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -set-blocking@^2.0.0, set-blocking@~2.0.0: +set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== @@ -8489,7 +8320,7 @@ source-map-support@0.5.13: buffer-from "^1.0.0" source-map "^0.6.0" -source-map-support@^0.5.16, source-map-support@^0.5.17, source-map-support@^0.5.19: +source-map-support@^0.5.16, source-map-support@^0.5.19: version "0.5.21" resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz" integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== @@ -8502,7 +8333,7 @@ source-map@^0.5.0: resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz" integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: +source-map@^0.6.0, source-map@^0.6.1: version "0.6.1" resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== @@ -8767,7 +8598,7 @@ supports-preserve-symlinks-flag@^1.0.0: symbol-observable@^2.0.3: version "2.0.3" - resolved "https://registry.npmjs.org/symbol-observable/-/symbol-observable-2.0.3.tgz" + resolved "https://registry.npmjs.org/symbol-observable/-/symbol-observable-2.0.3.tgz#5b521d3d07a43c351055fa43b8355b62d33fd16a" integrity sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA== tar@^4.4.12: @@ -8943,27 +8774,11 @@ ts-jest@^28.0.7: semver "7.x" yargs-parser "^21.0.1" -ts-node@^8: - version "8.10.2" - resolved "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz" - integrity sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA== - dependencies: - arg "^4.1.0" - diff "^4.0.1" - make-error "^1.1.1" - source-map-support "^0.5.17" - yn "3.1.1" - tslib@^1.9.0: version "1.14.1" resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.1: - version "2.4.0" - resolved "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz" - integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== - tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz" @@ -9045,11 +8860,6 @@ typescript@^4.7.4: resolved "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz" integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== -typescript@~4.4: - version "4.4.4" - resolved "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz" - integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA== - uglify-js@^3.1.4: version "3.16.1" resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.16.1.tgz" @@ -9218,18 +9028,6 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" -"wasm-ast-types@path:../wasm-ast-types": - version "0.17.0" - resolved "https://registry.npmjs.org/wasm-ast-types/-/wasm-ast-types-0.17.0.tgz#417280a61d60ea9964667cf2edb8f5281dc295d7" - integrity sha512-WeriXPbG67iI51Mf/5qRR0xcpEaTO/Wyjpl+vsmjZ5K6q/0W6iO03zHsESNIH/hpc5FPTpb0Y0L9xAtnnNe9Ow== - dependencies: - "@babel/runtime" "^7.18.9" - "@babel/types" "7.18.10" - "@jest/transform" "28.1.3" - ast-stringify "0.1.0" - case "1.6.3" - deepmerge "4.2.2" - wcwidth@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz" @@ -9275,11 +9073,6 @@ which-boxed-primitive@^1.0.2: is-string "^1.0.5" is-symbol "^1.0.3" -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz" - integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q== - which@^1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz" @@ -9311,15 +9104,6 @@ wordwrap@^1.0.0: resolved "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== -wrap-ansi@^6.2.0: - version "6.2.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz" - integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" @@ -9395,13 +9179,13 @@ write-pkg@^4.0.0: write-json-file "^3.2.0" ws@^7: - version "7.5.8" - resolved "https://registry.npmjs.org/ws/-/ws-7.5.8.tgz" - integrity sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw== + version "7.5.9" + resolved "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" + integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== xstream@^11.14.0: version "11.14.0" - resolved "https://registry.npmjs.org/xstream/-/xstream-11.14.0.tgz" + resolved "https://registry.npmjs.org/xstream/-/xstream-11.14.0.tgz#2c071d26b18310523b6877e86b4e54df068a9ae5" integrity sha512-1bLb+kKKtKPbgTK6i/BaoAn03g47PpFstlbe1BA+y3pNS/LfvcaghS5BFf9+EE1J+KwSQsEpfJvFN5GqFtiNmw== dependencies: globalthis "^1.0.1" @@ -9412,11 +9196,6 @@ xtend@~4.0.1: resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== -y18n@^4.0.0: - version "4.0.3" - resolved "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz" - integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== - y18n@^5.0.5: version "5.0.8" resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" @@ -9442,14 +9221,6 @@ yargs-parser@20.2.4: resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz" integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== -yargs-parser@^18.1.2: - version "18.1.3" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz" - integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - yargs-parser@^20.2.2, yargs-parser@^20.2.3: version "20.2.9" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" @@ -9465,23 +9236,6 @@ yargs-parser@^21.0.1: resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz" integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg== -yargs@^15.3.1: - version "15.4.1" - resolved "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz" - integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== - dependencies: - cliui "^6.0.0" - decamelize "^1.2.0" - find-up "^4.1.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^4.2.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^18.1.2" - yargs@^16.2.0: version "16.2.0" resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz" @@ -9508,11 +9262,6 @@ yargs@^17.3.1: y18n "^5.0.5" yargs-parser "^21.0.0" -yn@3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== - yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" From 062b01d94a1951ee70fe617e5176efffa2d40489 Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Sun, 21 May 2023 14:30:17 +0300 Subject: [PATCH 109/287] Udpate message composer to use underscored funds parameter --- .../CwAdminFactory.message-composer.ts | 6 +- .../CwCodeIdRegistry.message-composer.ts | 30 +- .../contracts/CwSingle.message-composer.ts | 54 +- .../contracts/Factory.message-composer.ts | 42 +- .../contracts/Minter.message-composer.ts | 42 +- .../CwAdminFactory.message-composer.ts | 6 +- .../CwCodeIdRegistry.message-composer.ts | 30 +- .../default/CwSingle.message-composer.ts | 54 +- .../default/Factory.message-composer.ts | 42 +- .../default/Minter.message-composer.ts | 42 +- .../CwAdminFactory.message-composer.ts | 6 +- .../CwCodeIdRegistry.message-composer.ts | 30 +- .../no-extends/CwSingle.message-composer.ts | 54 +- .../no-extends/Factory.message-composer.ts | 42 +- .../no-extends/Minter.message-composer.ts | 42 +- .../CwAdminFactory.message-composer.ts | 6 +- .../CwCodeIdRegistry.message-composer.ts | 30 +- .../CwNamedGroups.message-composer.ts | 18 +- .../CwProposalSingle.message-composer.ts | 54 +- .../AccountsNft.message-composer.ts | 60 +-- .../Cw3FixedMultiSig.message-composer.ts | 24 +- .../cw4-group/Cw4Group.message-composer.ts | 24 +- .../cyberpunk/CyberPunk.message-composer.ts | 12 +- .../hackatom/HackAtom.message-composer.ts | 48 +- __output__/minter/Minter.message-composer.ts | 42 +- __output__/sg721/Sg721.message-composer.ts | 48 +- .../factory/Factory.message-composer.ts | 42 +- .../vectis/govec/Govec.message-composer.ts | 48 +- .../vectis/proxy/Proxy.message-composer.ts | 48 +- .../message-composer.spec.ts.snap | 60 +-- .../src/message-composer/message-composer.ts | 482 ++++++++---------- yarn.lock | 12 - 32 files changed, 762 insertions(+), 818 deletions(-) diff --git a/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts b/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts index 6ff9c5fb..5b6dd320 100644 --- a/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts @@ -20,7 +20,7 @@ export interface CwAdminFactoryMessage { codeId: number; instantiateMsg: Binary; label: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { sender: string; @@ -40,7 +40,7 @@ export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { codeId: number; instantiateMsg: Binary; label: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -53,7 +53,7 @@ export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { label } })), - funds + _funds: funds }) }; }; diff --git a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts index 2590da00..97e190f6 100644 --- a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts @@ -20,7 +20,7 @@ export interface CwCodeIdRegistryMessage { amount: Uint128; msg: Binary; sender: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; register: ({ chainId, checksum, @@ -33,7 +33,7 @@ export interface CwCodeIdRegistryMessage { codeId: number; name: string; version: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; setOwner: ({ chainId, name, @@ -42,21 +42,21 @@ export interface CwCodeIdRegistryMessage { chainId: string; name: string; owner?: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; unregister: ({ chainId, codeId }: { chainId: string; codeId: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateConfig: ({ admin, paymentInfo }: { admin?: string; paymentInfo?: PaymentInfo; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage { sender: string; @@ -80,7 +80,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage amount: Uint128; msg: Binary; sender: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -93,7 +93,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage sender } })), - funds + _funds: funds }) }; }; @@ -109,7 +109,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage codeId: number; name: string; version: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -124,7 +124,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage version } })), - funds + _funds: funds }) }; }; @@ -136,7 +136,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage chainId: string; name: string; owner?: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -149,7 +149,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage owner } })), - funds + _funds: funds }) }; }; @@ -159,7 +159,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage }: { chainId: string; codeId: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -171,7 +171,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage code_id: codeId } })), - funds + _funds: funds }) }; }; @@ -181,7 +181,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage }: { admin?: string; paymentInfo?: PaymentInfo; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -193,7 +193,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage payment_info: paymentInfo } })), - funds + _funds: funds }) }; }; diff --git a/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts b/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts index 0a8436fc..48004019 100644 --- a/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts @@ -19,24 +19,24 @@ export interface CwSingleMessage { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; execute: ({ proposalId }: { proposalId: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; close: ({ proposalId }: { proposalId: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateConfig: ({ allowRevoting, dao, @@ -53,27 +53,27 @@ export interface CwSingleMessage { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; addProposalHook: ({ address }: { address: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; removeProposalHook: ({ address }: { address: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; addVoteHook: ({ address }: { address: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; removeVoteHook: ({ address }: { address: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class CwSingleMessageComposer implements CwSingleMessage { sender: string; @@ -101,7 +101,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -114,7 +114,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { title } })), - funds + _funds: funds }) }; }; @@ -124,7 +124,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { }: { proposalId: number; vote: Vote; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -136,7 +136,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { vote } })), - funds + _funds: funds }) }; }; @@ -144,7 +144,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { proposalId }: { proposalId: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -155,7 +155,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { proposal_id: proposalId } })), - funds + _funds: funds }) }; }; @@ -163,7 +163,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { proposalId }: { proposalId: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -174,7 +174,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { proposal_id: proposalId } })), - funds + _funds: funds }) }; }; @@ -194,7 +194,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -211,7 +211,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { threshold } })), - funds + _funds: funds }) }; }; @@ -219,7 +219,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address }: { address: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -230,7 +230,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - funds + _funds: funds }) }; }; @@ -238,7 +238,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address }: { address: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -249,7 +249,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - funds + _funds: funds }) }; }; @@ -257,7 +257,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address }: { address: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -268,7 +268,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - funds + _funds: funds }) }; }; @@ -276,7 +276,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address }: { address: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -287,7 +287,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - funds + _funds: funds }) }; }; diff --git a/__output__/builder/bundler_test/contracts/Factory.message-composer.ts b/__output__/builder/bundler_test/contracts/Factory.message-composer.ts index 21e5a2d1..5eaf412b 100644 --- a/__output__/builder/bundler_test/contracts/Factory.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/Factory.message-composer.ts @@ -15,43 +15,43 @@ export interface FactoryMessage { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateProxyUser: ({ newUser, oldUser }: { newUser: Addr; oldUser: Addr; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; migrateWallet: ({ migrationMsg, walletAddress }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateCodeId: ({ newCodeId, ty }: { newCodeId: number; ty: CodeIdType; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateWalletFee: ({ newFee }: { newFee: Coin; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateGovecAddr: ({ addr }: { addr: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateAdmin: ({ addr }: { addr: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class FactoryMessageComposer implements FactoryMessage { sender: string; @@ -73,7 +73,7 @@ export class FactoryMessageComposer implements FactoryMessage { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -84,7 +84,7 @@ export class FactoryMessageComposer implements FactoryMessage { create_wallet_msg: createWalletMsg } })), - funds + _funds: funds }) }; }; @@ -94,7 +94,7 @@ export class FactoryMessageComposer implements FactoryMessage { }: { newUser: Addr; oldUser: Addr; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -106,7 +106,7 @@ export class FactoryMessageComposer implements FactoryMessage { old_user: oldUser } })), - funds + _funds: funds }) }; }; @@ -116,7 +116,7 @@ export class FactoryMessageComposer implements FactoryMessage { }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -128,7 +128,7 @@ export class FactoryMessageComposer implements FactoryMessage { wallet_address: walletAddress } })), - funds + _funds: funds }) }; }; @@ -138,7 +138,7 @@ export class FactoryMessageComposer implements FactoryMessage { }: { newCodeId: number; ty: CodeIdType; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -150,7 +150,7 @@ export class FactoryMessageComposer implements FactoryMessage { ty } })), - funds + _funds: funds }) }; }; @@ -158,7 +158,7 @@ export class FactoryMessageComposer implements FactoryMessage { newFee }: { newFee: Coin; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -169,7 +169,7 @@ export class FactoryMessageComposer implements FactoryMessage { new_fee: newFee } })), - funds + _funds: funds }) }; }; @@ -177,7 +177,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr }: { addr: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -188,7 +188,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr } })), - funds + _funds: funds }) }; }; @@ -196,7 +196,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr }: { addr: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -207,7 +207,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr } })), - funds + _funds: funds }) }; }; diff --git a/__output__/builder/bundler_test/contracts/Minter.message-composer.ts b/__output__/builder/bundler_test/contracts/Minter.message-composer.ts index 30a74b8b..8c951ac0 100644 --- a/__output__/builder/bundler_test/contracts/Minter.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/Minter.message-composer.ts @@ -11,31 +11,31 @@ import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, Execute export interface MinterMessage { contractAddress: string; sender: string; - mint: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + mint: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; setWhitelist: ({ whitelist }: { whitelist: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; - updateStartTime: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateStartTime: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; updatePerAddressLimit: ({ perAddressLimit }: { perAddressLimit: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; mintTo: ({ recipient }: { recipient: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; mintFor: ({ recipient, tokenId }: { recipient: string; tokenId: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; - withdraw: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + withdraw: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class MinterMessageComposer implements MinterMessage { sender: string; @@ -53,7 +53,7 @@ export class MinterMessageComposer implements MinterMessage { this.withdraw = this.withdraw.bind(this); } - mint = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + mint = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -62,7 +62,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ mint: {} })), - funds + _funds: funds }) }; }; @@ -70,7 +70,7 @@ export class MinterMessageComposer implements MinterMessage { whitelist }: { whitelist: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -81,11 +81,11 @@ export class MinterMessageComposer implements MinterMessage { whitelist } })), - funds + _funds: funds }) }; }; - updateStartTime = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + updateStartTime = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -94,7 +94,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ update_start_time: {} })), - funds + _funds: funds }) }; }; @@ -102,7 +102,7 @@ export class MinterMessageComposer implements MinterMessage { perAddressLimit }: { perAddressLimit: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -113,7 +113,7 @@ export class MinterMessageComposer implements MinterMessage { per_address_limit: perAddressLimit } })), - funds + _funds: funds }) }; }; @@ -121,7 +121,7 @@ export class MinterMessageComposer implements MinterMessage { recipient }: { recipient: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -132,7 +132,7 @@ export class MinterMessageComposer implements MinterMessage { recipient } })), - funds + _funds: funds }) }; }; @@ -142,7 +142,7 @@ export class MinterMessageComposer implements MinterMessage { }: { recipient: string; tokenId: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -154,11 +154,11 @@ export class MinterMessageComposer implements MinterMessage { token_id: tokenId } })), - funds + _funds: funds }) }; }; - withdraw = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + withdraw = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -167,7 +167,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ withdraw: {} })), - funds + _funds: funds }) }; }; diff --git a/__output__/builder/default/CwAdminFactory.message-composer.ts b/__output__/builder/default/CwAdminFactory.message-composer.ts index 6ff9c5fb..5b6dd320 100644 --- a/__output__/builder/default/CwAdminFactory.message-composer.ts +++ b/__output__/builder/default/CwAdminFactory.message-composer.ts @@ -20,7 +20,7 @@ export interface CwAdminFactoryMessage { codeId: number; instantiateMsg: Binary; label: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { sender: string; @@ -40,7 +40,7 @@ export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { codeId: number; instantiateMsg: Binary; label: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -53,7 +53,7 @@ export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { label } })), - funds + _funds: funds }) }; }; diff --git a/__output__/builder/default/CwCodeIdRegistry.message-composer.ts b/__output__/builder/default/CwCodeIdRegistry.message-composer.ts index 2590da00..97e190f6 100644 --- a/__output__/builder/default/CwCodeIdRegistry.message-composer.ts +++ b/__output__/builder/default/CwCodeIdRegistry.message-composer.ts @@ -20,7 +20,7 @@ export interface CwCodeIdRegistryMessage { amount: Uint128; msg: Binary; sender: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; register: ({ chainId, checksum, @@ -33,7 +33,7 @@ export interface CwCodeIdRegistryMessage { codeId: number; name: string; version: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; setOwner: ({ chainId, name, @@ -42,21 +42,21 @@ export interface CwCodeIdRegistryMessage { chainId: string; name: string; owner?: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; unregister: ({ chainId, codeId }: { chainId: string; codeId: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateConfig: ({ admin, paymentInfo }: { admin?: string; paymentInfo?: PaymentInfo; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage { sender: string; @@ -80,7 +80,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage amount: Uint128; msg: Binary; sender: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -93,7 +93,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage sender } })), - funds + _funds: funds }) }; }; @@ -109,7 +109,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage codeId: number; name: string; version: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -124,7 +124,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage version } })), - funds + _funds: funds }) }; }; @@ -136,7 +136,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage chainId: string; name: string; owner?: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -149,7 +149,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage owner } })), - funds + _funds: funds }) }; }; @@ -159,7 +159,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage }: { chainId: string; codeId: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -171,7 +171,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage code_id: codeId } })), - funds + _funds: funds }) }; }; @@ -181,7 +181,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage }: { admin?: string; paymentInfo?: PaymentInfo; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -193,7 +193,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage payment_info: paymentInfo } })), - funds + _funds: funds }) }; }; diff --git a/__output__/builder/default/CwSingle.message-composer.ts b/__output__/builder/default/CwSingle.message-composer.ts index 0a8436fc..48004019 100644 --- a/__output__/builder/default/CwSingle.message-composer.ts +++ b/__output__/builder/default/CwSingle.message-composer.ts @@ -19,24 +19,24 @@ export interface CwSingleMessage { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; execute: ({ proposalId }: { proposalId: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; close: ({ proposalId }: { proposalId: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateConfig: ({ allowRevoting, dao, @@ -53,27 +53,27 @@ export interface CwSingleMessage { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; addProposalHook: ({ address }: { address: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; removeProposalHook: ({ address }: { address: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; addVoteHook: ({ address }: { address: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; removeVoteHook: ({ address }: { address: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class CwSingleMessageComposer implements CwSingleMessage { sender: string; @@ -101,7 +101,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -114,7 +114,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { title } })), - funds + _funds: funds }) }; }; @@ -124,7 +124,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { }: { proposalId: number; vote: Vote; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -136,7 +136,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { vote } })), - funds + _funds: funds }) }; }; @@ -144,7 +144,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { proposalId }: { proposalId: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -155,7 +155,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { proposal_id: proposalId } })), - funds + _funds: funds }) }; }; @@ -163,7 +163,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { proposalId }: { proposalId: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -174,7 +174,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { proposal_id: proposalId } })), - funds + _funds: funds }) }; }; @@ -194,7 +194,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -211,7 +211,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { threshold } })), - funds + _funds: funds }) }; }; @@ -219,7 +219,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address }: { address: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -230,7 +230,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - funds + _funds: funds }) }; }; @@ -238,7 +238,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address }: { address: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -249,7 +249,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - funds + _funds: funds }) }; }; @@ -257,7 +257,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address }: { address: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -268,7 +268,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - funds + _funds: funds }) }; }; @@ -276,7 +276,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address }: { address: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -287,7 +287,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - funds + _funds: funds }) }; }; diff --git a/__output__/builder/default/Factory.message-composer.ts b/__output__/builder/default/Factory.message-composer.ts index 21e5a2d1..5eaf412b 100644 --- a/__output__/builder/default/Factory.message-composer.ts +++ b/__output__/builder/default/Factory.message-composer.ts @@ -15,43 +15,43 @@ export interface FactoryMessage { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateProxyUser: ({ newUser, oldUser }: { newUser: Addr; oldUser: Addr; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; migrateWallet: ({ migrationMsg, walletAddress }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateCodeId: ({ newCodeId, ty }: { newCodeId: number; ty: CodeIdType; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateWalletFee: ({ newFee }: { newFee: Coin; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateGovecAddr: ({ addr }: { addr: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateAdmin: ({ addr }: { addr: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class FactoryMessageComposer implements FactoryMessage { sender: string; @@ -73,7 +73,7 @@ export class FactoryMessageComposer implements FactoryMessage { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -84,7 +84,7 @@ export class FactoryMessageComposer implements FactoryMessage { create_wallet_msg: createWalletMsg } })), - funds + _funds: funds }) }; }; @@ -94,7 +94,7 @@ export class FactoryMessageComposer implements FactoryMessage { }: { newUser: Addr; oldUser: Addr; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -106,7 +106,7 @@ export class FactoryMessageComposer implements FactoryMessage { old_user: oldUser } })), - funds + _funds: funds }) }; }; @@ -116,7 +116,7 @@ export class FactoryMessageComposer implements FactoryMessage { }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -128,7 +128,7 @@ export class FactoryMessageComposer implements FactoryMessage { wallet_address: walletAddress } })), - funds + _funds: funds }) }; }; @@ -138,7 +138,7 @@ export class FactoryMessageComposer implements FactoryMessage { }: { newCodeId: number; ty: CodeIdType; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -150,7 +150,7 @@ export class FactoryMessageComposer implements FactoryMessage { ty } })), - funds + _funds: funds }) }; }; @@ -158,7 +158,7 @@ export class FactoryMessageComposer implements FactoryMessage { newFee }: { newFee: Coin; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -169,7 +169,7 @@ export class FactoryMessageComposer implements FactoryMessage { new_fee: newFee } })), - funds + _funds: funds }) }; }; @@ -177,7 +177,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr }: { addr: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -188,7 +188,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr } })), - funds + _funds: funds }) }; }; @@ -196,7 +196,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr }: { addr: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -207,7 +207,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr } })), - funds + _funds: funds }) }; }; diff --git a/__output__/builder/default/Minter.message-composer.ts b/__output__/builder/default/Minter.message-composer.ts index 30a74b8b..8c951ac0 100644 --- a/__output__/builder/default/Minter.message-composer.ts +++ b/__output__/builder/default/Minter.message-composer.ts @@ -11,31 +11,31 @@ import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, Execute export interface MinterMessage { contractAddress: string; sender: string; - mint: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + mint: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; setWhitelist: ({ whitelist }: { whitelist: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; - updateStartTime: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateStartTime: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; updatePerAddressLimit: ({ perAddressLimit }: { perAddressLimit: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; mintTo: ({ recipient }: { recipient: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; mintFor: ({ recipient, tokenId }: { recipient: string; tokenId: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; - withdraw: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + withdraw: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class MinterMessageComposer implements MinterMessage { sender: string; @@ -53,7 +53,7 @@ export class MinterMessageComposer implements MinterMessage { this.withdraw = this.withdraw.bind(this); } - mint = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + mint = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -62,7 +62,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ mint: {} })), - funds + _funds: funds }) }; }; @@ -70,7 +70,7 @@ export class MinterMessageComposer implements MinterMessage { whitelist }: { whitelist: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -81,11 +81,11 @@ export class MinterMessageComposer implements MinterMessage { whitelist } })), - funds + _funds: funds }) }; }; - updateStartTime = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + updateStartTime = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -94,7 +94,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ update_start_time: {} })), - funds + _funds: funds }) }; }; @@ -102,7 +102,7 @@ export class MinterMessageComposer implements MinterMessage { perAddressLimit }: { perAddressLimit: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -113,7 +113,7 @@ export class MinterMessageComposer implements MinterMessage { per_address_limit: perAddressLimit } })), - funds + _funds: funds }) }; }; @@ -121,7 +121,7 @@ export class MinterMessageComposer implements MinterMessage { recipient }: { recipient: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -132,7 +132,7 @@ export class MinterMessageComposer implements MinterMessage { recipient } })), - funds + _funds: funds }) }; }; @@ -142,7 +142,7 @@ export class MinterMessageComposer implements MinterMessage { }: { recipient: string; tokenId: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -154,11 +154,11 @@ export class MinterMessageComposer implements MinterMessage { token_id: tokenId } })), - funds + _funds: funds }) }; }; - withdraw = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + withdraw = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -167,7 +167,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ withdraw: {} })), - funds + _funds: funds }) }; }; diff --git a/__output__/builder/no-extends/CwAdminFactory.message-composer.ts b/__output__/builder/no-extends/CwAdminFactory.message-composer.ts index 6ff9c5fb..5b6dd320 100644 --- a/__output__/builder/no-extends/CwAdminFactory.message-composer.ts +++ b/__output__/builder/no-extends/CwAdminFactory.message-composer.ts @@ -20,7 +20,7 @@ export interface CwAdminFactoryMessage { codeId: number; instantiateMsg: Binary; label: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { sender: string; @@ -40,7 +40,7 @@ export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { codeId: number; instantiateMsg: Binary; label: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -53,7 +53,7 @@ export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { label } })), - funds + _funds: funds }) }; }; diff --git a/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts b/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts index 2590da00..97e190f6 100644 --- a/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts +++ b/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts @@ -20,7 +20,7 @@ export interface CwCodeIdRegistryMessage { amount: Uint128; msg: Binary; sender: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; register: ({ chainId, checksum, @@ -33,7 +33,7 @@ export interface CwCodeIdRegistryMessage { codeId: number; name: string; version: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; setOwner: ({ chainId, name, @@ -42,21 +42,21 @@ export interface CwCodeIdRegistryMessage { chainId: string; name: string; owner?: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; unregister: ({ chainId, codeId }: { chainId: string; codeId: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateConfig: ({ admin, paymentInfo }: { admin?: string; paymentInfo?: PaymentInfo; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage { sender: string; @@ -80,7 +80,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage amount: Uint128; msg: Binary; sender: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -93,7 +93,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage sender } })), - funds + _funds: funds }) }; }; @@ -109,7 +109,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage codeId: number; name: string; version: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -124,7 +124,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage version } })), - funds + _funds: funds }) }; }; @@ -136,7 +136,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage chainId: string; name: string; owner?: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -149,7 +149,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage owner } })), - funds + _funds: funds }) }; }; @@ -159,7 +159,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage }: { chainId: string; codeId: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -171,7 +171,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage code_id: codeId } })), - funds + _funds: funds }) }; }; @@ -181,7 +181,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage }: { admin?: string; paymentInfo?: PaymentInfo; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -193,7 +193,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage payment_info: paymentInfo } })), - funds + _funds: funds }) }; }; diff --git a/__output__/builder/no-extends/CwSingle.message-composer.ts b/__output__/builder/no-extends/CwSingle.message-composer.ts index 0a8436fc..48004019 100644 --- a/__output__/builder/no-extends/CwSingle.message-composer.ts +++ b/__output__/builder/no-extends/CwSingle.message-composer.ts @@ -19,24 +19,24 @@ export interface CwSingleMessage { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; execute: ({ proposalId }: { proposalId: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; close: ({ proposalId }: { proposalId: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateConfig: ({ allowRevoting, dao, @@ -53,27 +53,27 @@ export interface CwSingleMessage { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; addProposalHook: ({ address }: { address: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; removeProposalHook: ({ address }: { address: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; addVoteHook: ({ address }: { address: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; removeVoteHook: ({ address }: { address: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class CwSingleMessageComposer implements CwSingleMessage { sender: string; @@ -101,7 +101,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -114,7 +114,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { title } })), - funds + _funds: funds }) }; }; @@ -124,7 +124,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { }: { proposalId: number; vote: Vote; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -136,7 +136,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { vote } })), - funds + _funds: funds }) }; }; @@ -144,7 +144,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { proposalId }: { proposalId: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -155,7 +155,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { proposal_id: proposalId } })), - funds + _funds: funds }) }; }; @@ -163,7 +163,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { proposalId }: { proposalId: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -174,7 +174,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { proposal_id: proposalId } })), - funds + _funds: funds }) }; }; @@ -194,7 +194,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -211,7 +211,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { threshold } })), - funds + _funds: funds }) }; }; @@ -219,7 +219,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address }: { address: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -230,7 +230,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - funds + _funds: funds }) }; }; @@ -238,7 +238,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address }: { address: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -249,7 +249,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - funds + _funds: funds }) }; }; @@ -257,7 +257,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address }: { address: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -268,7 +268,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - funds + _funds: funds }) }; }; @@ -276,7 +276,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address }: { address: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -287,7 +287,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - funds + _funds: funds }) }; }; diff --git a/__output__/builder/no-extends/Factory.message-composer.ts b/__output__/builder/no-extends/Factory.message-composer.ts index 21e5a2d1..5eaf412b 100644 --- a/__output__/builder/no-extends/Factory.message-composer.ts +++ b/__output__/builder/no-extends/Factory.message-composer.ts @@ -15,43 +15,43 @@ export interface FactoryMessage { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateProxyUser: ({ newUser, oldUser }: { newUser: Addr; oldUser: Addr; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; migrateWallet: ({ migrationMsg, walletAddress }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateCodeId: ({ newCodeId, ty }: { newCodeId: number; ty: CodeIdType; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateWalletFee: ({ newFee }: { newFee: Coin; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateGovecAddr: ({ addr }: { addr: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateAdmin: ({ addr }: { addr: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class FactoryMessageComposer implements FactoryMessage { sender: string; @@ -73,7 +73,7 @@ export class FactoryMessageComposer implements FactoryMessage { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -84,7 +84,7 @@ export class FactoryMessageComposer implements FactoryMessage { create_wallet_msg: createWalletMsg } })), - funds + _funds: funds }) }; }; @@ -94,7 +94,7 @@ export class FactoryMessageComposer implements FactoryMessage { }: { newUser: Addr; oldUser: Addr; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -106,7 +106,7 @@ export class FactoryMessageComposer implements FactoryMessage { old_user: oldUser } })), - funds + _funds: funds }) }; }; @@ -116,7 +116,7 @@ export class FactoryMessageComposer implements FactoryMessage { }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -128,7 +128,7 @@ export class FactoryMessageComposer implements FactoryMessage { wallet_address: walletAddress } })), - funds + _funds: funds }) }; }; @@ -138,7 +138,7 @@ export class FactoryMessageComposer implements FactoryMessage { }: { newCodeId: number; ty: CodeIdType; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -150,7 +150,7 @@ export class FactoryMessageComposer implements FactoryMessage { ty } })), - funds + _funds: funds }) }; }; @@ -158,7 +158,7 @@ export class FactoryMessageComposer implements FactoryMessage { newFee }: { newFee: Coin; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -169,7 +169,7 @@ export class FactoryMessageComposer implements FactoryMessage { new_fee: newFee } })), - funds + _funds: funds }) }; }; @@ -177,7 +177,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr }: { addr: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -188,7 +188,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr } })), - funds + _funds: funds }) }; }; @@ -196,7 +196,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr }: { addr: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -207,7 +207,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr } })), - funds + _funds: funds }) }; }; diff --git a/__output__/builder/no-extends/Minter.message-composer.ts b/__output__/builder/no-extends/Minter.message-composer.ts index 30a74b8b..8c951ac0 100644 --- a/__output__/builder/no-extends/Minter.message-composer.ts +++ b/__output__/builder/no-extends/Minter.message-composer.ts @@ -11,31 +11,31 @@ import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, Execute export interface MinterMessage { contractAddress: string; sender: string; - mint: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + mint: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; setWhitelist: ({ whitelist }: { whitelist: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; - updateStartTime: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateStartTime: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; updatePerAddressLimit: ({ perAddressLimit }: { perAddressLimit: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; mintTo: ({ recipient }: { recipient: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; mintFor: ({ recipient, tokenId }: { recipient: string; tokenId: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; - withdraw: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + withdraw: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class MinterMessageComposer implements MinterMessage { sender: string; @@ -53,7 +53,7 @@ export class MinterMessageComposer implements MinterMessage { this.withdraw = this.withdraw.bind(this); } - mint = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + mint = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -62,7 +62,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ mint: {} })), - funds + _funds: funds }) }; }; @@ -70,7 +70,7 @@ export class MinterMessageComposer implements MinterMessage { whitelist }: { whitelist: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -81,11 +81,11 @@ export class MinterMessageComposer implements MinterMessage { whitelist } })), - funds + _funds: funds }) }; }; - updateStartTime = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + updateStartTime = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -94,7 +94,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ update_start_time: {} })), - funds + _funds: funds }) }; }; @@ -102,7 +102,7 @@ export class MinterMessageComposer implements MinterMessage { perAddressLimit }: { perAddressLimit: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -113,7 +113,7 @@ export class MinterMessageComposer implements MinterMessage { per_address_limit: perAddressLimit } })), - funds + _funds: funds }) }; }; @@ -121,7 +121,7 @@ export class MinterMessageComposer implements MinterMessage { recipient }: { recipient: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -132,7 +132,7 @@ export class MinterMessageComposer implements MinterMessage { recipient } })), - funds + _funds: funds }) }; }; @@ -142,7 +142,7 @@ export class MinterMessageComposer implements MinterMessage { }: { recipient: string; tokenId: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -154,11 +154,11 @@ export class MinterMessageComposer implements MinterMessage { token_id: tokenId } })), - funds + _funds: funds }) }; }; - withdraw = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + withdraw = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -167,7 +167,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ withdraw: {} })), - funds + _funds: funds }) }; }; diff --git a/__output__/daodao/cw-admin-factory/CwAdminFactory.message-composer.ts b/__output__/daodao/cw-admin-factory/CwAdminFactory.message-composer.ts index 6ff9c5fb..5b6dd320 100644 --- a/__output__/daodao/cw-admin-factory/CwAdminFactory.message-composer.ts +++ b/__output__/daodao/cw-admin-factory/CwAdminFactory.message-composer.ts @@ -20,7 +20,7 @@ export interface CwAdminFactoryMessage { codeId: number; instantiateMsg: Binary; label: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { sender: string; @@ -40,7 +40,7 @@ export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { codeId: number; instantiateMsg: Binary; label: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -53,7 +53,7 @@ export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { label } })), - funds + _funds: funds }) }; }; diff --git a/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.message-composer.ts b/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.message-composer.ts index 2590da00..97e190f6 100644 --- a/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.message-composer.ts +++ b/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.message-composer.ts @@ -20,7 +20,7 @@ export interface CwCodeIdRegistryMessage { amount: Uint128; msg: Binary; sender: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; register: ({ chainId, checksum, @@ -33,7 +33,7 @@ export interface CwCodeIdRegistryMessage { codeId: number; name: string; version: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; setOwner: ({ chainId, name, @@ -42,21 +42,21 @@ export interface CwCodeIdRegistryMessage { chainId: string; name: string; owner?: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; unregister: ({ chainId, codeId }: { chainId: string; codeId: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateConfig: ({ admin, paymentInfo }: { admin?: string; paymentInfo?: PaymentInfo; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage { sender: string; @@ -80,7 +80,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage amount: Uint128; msg: Binary; sender: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -93,7 +93,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage sender } })), - funds + _funds: funds }) }; }; @@ -109,7 +109,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage codeId: number; name: string; version: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -124,7 +124,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage version } })), - funds + _funds: funds }) }; }; @@ -136,7 +136,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage chainId: string; name: string; owner?: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -149,7 +149,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage owner } })), - funds + _funds: funds }) }; }; @@ -159,7 +159,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage }: { chainId: string; codeId: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -171,7 +171,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage code_id: codeId } })), - funds + _funds: funds }) }; }; @@ -181,7 +181,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage }: { admin?: string; paymentInfo?: PaymentInfo; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -193,7 +193,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage payment_info: paymentInfo } })), - funds + _funds: funds }) }; }; diff --git a/__output__/daodao/cw-named-groups/CwNamedGroups.message-composer.ts b/__output__/daodao/cw-named-groups/CwNamedGroups.message-composer.ts index f49ec3cf..1c15918a 100644 --- a/__output__/daodao/cw-named-groups/CwNamedGroups.message-composer.ts +++ b/__output__/daodao/cw-named-groups/CwNamedGroups.message-composer.ts @@ -20,17 +20,17 @@ export interface CwNamedGroupsMessage { addressesToAdd?: string[]; addressesToRemove?: string[]; group: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; removeGroup: ({ group }: { group: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateOwner: ({ owner }: { owner: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class CwNamedGroupsMessageComposer implements CwNamedGroupsMessage { sender: string; @@ -52,7 +52,7 @@ export class CwNamedGroupsMessageComposer implements CwNamedGroupsMessage { addressesToAdd?: string[]; addressesToRemove?: string[]; group: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -65,7 +65,7 @@ export class CwNamedGroupsMessageComposer implements CwNamedGroupsMessage { group } })), - funds + _funds: funds }) }; }; @@ -73,7 +73,7 @@ export class CwNamedGroupsMessageComposer implements CwNamedGroupsMessage { group }: { group: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -84,7 +84,7 @@ export class CwNamedGroupsMessageComposer implements CwNamedGroupsMessage { group } })), - funds + _funds: funds }) }; }; @@ -92,7 +92,7 @@ export class CwNamedGroupsMessageComposer implements CwNamedGroupsMessage { owner }: { owner: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -103,7 +103,7 @@ export class CwNamedGroupsMessageComposer implements CwNamedGroupsMessage { owner } })), - funds + _funds: funds }) }; }; diff --git a/__output__/daodao/cw-proposal-single/CwProposalSingle.message-composer.ts b/__output__/daodao/cw-proposal-single/CwProposalSingle.message-composer.ts index ac90dfbe..c07212cd 100644 --- a/__output__/daodao/cw-proposal-single/CwProposalSingle.message-composer.ts +++ b/__output__/daodao/cw-proposal-single/CwProposalSingle.message-composer.ts @@ -19,24 +19,24 @@ export interface CwProposalSingleMessage { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; execute: ({ proposalId }: { proposalId: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; close: ({ proposalId }: { proposalId: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateConfig: ({ allowRevoting, dao, @@ -53,27 +53,27 @@ export interface CwProposalSingleMessage { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; addProposalHook: ({ address }: { address: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; removeProposalHook: ({ address }: { address: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; addVoteHook: ({ address }: { address: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; removeVoteHook: ({ address }: { address: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class CwProposalSingleMessageComposer implements CwProposalSingleMessage { sender: string; @@ -101,7 +101,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -114,7 +114,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage title } })), - funds + _funds: funds }) }; }; @@ -124,7 +124,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage }: { proposalId: number; vote: Vote; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -136,7 +136,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage vote } })), - funds + _funds: funds }) }; }; @@ -144,7 +144,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage proposalId }: { proposalId: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -155,7 +155,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage proposal_id: proposalId } })), - funds + _funds: funds }) }; }; @@ -163,7 +163,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage proposalId }: { proposalId: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -174,7 +174,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage proposal_id: proposalId } })), - funds + _funds: funds }) }; }; @@ -194,7 +194,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -211,7 +211,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage threshold } })), - funds + _funds: funds }) }; }; @@ -219,7 +219,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage address }: { address: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -230,7 +230,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage address } })), - funds + _funds: funds }) }; }; @@ -238,7 +238,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage address }: { address: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -249,7 +249,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage address } })), - funds + _funds: funds }) }; }; @@ -257,7 +257,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage address }: { address: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -268,7 +268,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage address } })), - funds + _funds: funds }) }; }; @@ -276,7 +276,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage address }: { address: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -287,7 +287,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage address } })), - funds + _funds: funds }) }; }; diff --git a/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts b/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts index f0397c4a..a34e8c51 100644 --- a/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts +++ b/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts @@ -16,20 +16,20 @@ export interface AccountsNftMessage { newOwner }: { newOwner: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; - acceptOwnership: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + acceptOwnership: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; mint: ({ user }: { user: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; transferNft: ({ recipient, tokenId }: { recipient: string; tokenId: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; sendNft: ({ contract, msg, @@ -38,7 +38,7 @@ export interface AccountsNftMessage { contract: string; msg: Binary; tokenId: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; approve: ({ expires, spender, @@ -47,31 +47,31 @@ export interface AccountsNftMessage { expires?: Expiration; spender: string; tokenId: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; revoke: ({ spender, tokenId }: { spender: string; tokenId: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; approveAll: ({ expires, operator }: { expires?: Expiration; operator: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; revokeAll: ({ operator }: { operator: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; burn: ({ tokenId }: { tokenId: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class AccountsNftMessageComposer implements AccountsNftMessage { sender: string; @@ -96,7 +96,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { newOwner }: { newOwner: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -107,11 +107,11 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { new_owner: newOwner } })), - funds + _funds: funds }) }; }; - acceptOwnership = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + acceptOwnership = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -120,7 +120,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { msg: toUtf8(JSON.stringify({ accept_ownership: {} })), - funds + _funds: funds }) }; }; @@ -128,7 +128,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { user }: { user: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -139,7 +139,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { user } })), - funds + _funds: funds }) }; }; @@ -149,7 +149,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { }: { recipient: string; tokenId: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -161,7 +161,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { token_id: tokenId } })), - funds + _funds: funds }) }; }; @@ -173,7 +173,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { contract: string; msg: Binary; tokenId: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -186,7 +186,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { token_id: tokenId } })), - funds + _funds: funds }) }; }; @@ -198,7 +198,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { expires?: Expiration; spender: string; tokenId: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -211,7 +211,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { token_id: tokenId } })), - funds + _funds: funds }) }; }; @@ -221,7 +221,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { }: { spender: string; tokenId: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -233,7 +233,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { token_id: tokenId } })), - funds + _funds: funds }) }; }; @@ -243,7 +243,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { }: { expires?: Expiration; operator: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -255,7 +255,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { operator } })), - funds + _funds: funds }) }; }; @@ -263,7 +263,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { operator }: { operator: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -274,7 +274,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { operator } })), - funds + _funds: funds }) }; }; @@ -282,7 +282,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { tokenId }: { tokenId: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -293,7 +293,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { token_id: tokenId } })), - funds + _funds: funds }) }; }; diff --git a/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.message-composer.ts b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.message-composer.ts index a191ec12..4df5e0e6 100644 --- a/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.message-composer.ts +++ b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.message-composer.ts @@ -21,24 +21,24 @@ export interface Cw3FixedMultiSigMessage { latest?: Expiration; msgs: CosmosMsgForEmpty[]; title: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; execute: ({ proposalId }: { proposalId: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; close: ({ proposalId }: { proposalId: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class Cw3FixedMultiSigMessageComposer implements Cw3FixedMultiSigMessage { sender: string; @@ -63,7 +63,7 @@ export class Cw3FixedMultiSigMessageComposer implements Cw3FixedMultiSigMessage latest?: Expiration; msgs: CosmosMsgForEmpty[]; title: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -77,7 +77,7 @@ export class Cw3FixedMultiSigMessageComposer implements Cw3FixedMultiSigMessage title } })), - funds + _funds: funds }) }; }; @@ -87,7 +87,7 @@ export class Cw3FixedMultiSigMessageComposer implements Cw3FixedMultiSigMessage }: { proposalId: number; vote: Vote; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -99,7 +99,7 @@ export class Cw3FixedMultiSigMessageComposer implements Cw3FixedMultiSigMessage vote } })), - funds + _funds: funds }) }; }; @@ -107,7 +107,7 @@ export class Cw3FixedMultiSigMessageComposer implements Cw3FixedMultiSigMessage proposalId }: { proposalId: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -118,7 +118,7 @@ export class Cw3FixedMultiSigMessageComposer implements Cw3FixedMultiSigMessage proposal_id: proposalId } })), - funds + _funds: funds }) }; }; @@ -126,7 +126,7 @@ export class Cw3FixedMultiSigMessageComposer implements Cw3FixedMultiSigMessage proposalId }: { proposalId: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -137,7 +137,7 @@ export class Cw3FixedMultiSigMessageComposer implements Cw3FixedMultiSigMessage proposal_id: proposalId } })), - funds + _funds: funds }) }; }; diff --git a/__output__/idl-version/cw4-group/Cw4Group.message-composer.ts b/__output__/idl-version/cw4-group/Cw4Group.message-composer.ts index e516b7ca..02af046e 100644 --- a/__output__/idl-version/cw4-group/Cw4Group.message-composer.ts +++ b/__output__/idl-version/cw4-group/Cw4Group.message-composer.ts @@ -16,24 +16,24 @@ export interface Cw4GroupMessage { admin }: { admin?: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateMembers: ({ add, remove }: { add: Member[]; remove: string[]; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; addHook: ({ addr }: { addr: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; removeHook: ({ addr }: { addr: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class Cw4GroupMessageComposer implements Cw4GroupMessage { sender: string; @@ -52,7 +52,7 @@ export class Cw4GroupMessageComposer implements Cw4GroupMessage { admin }: { admin?: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -63,7 +63,7 @@ export class Cw4GroupMessageComposer implements Cw4GroupMessage { admin } })), - funds + _funds: funds }) }; }; @@ -73,7 +73,7 @@ export class Cw4GroupMessageComposer implements Cw4GroupMessage { }: { add: Member[]; remove: string[]; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -85,7 +85,7 @@ export class Cw4GroupMessageComposer implements Cw4GroupMessage { remove } })), - funds + _funds: funds }) }; }; @@ -93,7 +93,7 @@ export class Cw4GroupMessageComposer implements Cw4GroupMessage { addr }: { addr: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -104,7 +104,7 @@ export class Cw4GroupMessageComposer implements Cw4GroupMessage { addr } })), - funds + _funds: funds }) }; }; @@ -112,7 +112,7 @@ export class Cw4GroupMessageComposer implements Cw4GroupMessage { addr }: { addr: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -123,7 +123,7 @@ export class Cw4GroupMessageComposer implements Cw4GroupMessage { addr } })), - funds + _funds: funds }) }; }; diff --git a/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts b/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts index 22f9edde..132e7a67 100644 --- a/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts +++ b/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts @@ -18,8 +18,8 @@ export interface CyberPunkMessage { }: { memCost: number; timeCost: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; - mirrorEnv: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + mirrorEnv: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class CyberPunkMessageComposer implements CyberPunkMessage { sender: string; @@ -38,7 +38,7 @@ export class CyberPunkMessageComposer implements CyberPunkMessage { }: { memCost: number; timeCost: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -50,11 +50,11 @@ export class CyberPunkMessageComposer implements CyberPunkMessage { time_cost: timeCost } })), - funds + _funds: funds }) }; }; - mirrorEnv = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + mirrorEnv = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -63,7 +63,7 @@ export class CyberPunkMessageComposer implements CyberPunkMessage { msg: toUtf8(JSON.stringify({ mirror_env: {} })), - funds + _funds: funds }) }; }; diff --git a/__output__/idl-version/hackatom/HackAtom.message-composer.ts b/__output__/idl-version/hackatom/HackAtom.message-composer.ts index 6fade775..26ac2d28 100644 --- a/__output__/idl-version/hackatom/HackAtom.message-composer.ts +++ b/__output__/idl-version/hackatom/HackAtom.message-composer.ts @@ -11,18 +11,18 @@ import { InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, SudoMsg, Uint128, Coi export interface HackAtomMessage { contractAddress: string; sender: string; - release: (funds?: Coin[]) => MsgExecuteContractEncodeObject; - cpuLoop: (funds?: Coin[]) => MsgExecuteContractEncodeObject; - storageLoop: (funds?: Coin[]) => MsgExecuteContractEncodeObject; - memoryLoop: (funds?: Coin[]) => MsgExecuteContractEncodeObject; - messageLoop: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + release: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; + cpuLoop: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; + storageLoop: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; + memoryLoop: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; + messageLoop: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; allocateLargeMemory: ({ pages }: { pages: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; - panic: (funds?: Coin[]) => MsgExecuteContractEncodeObject; - userErrorsInApiCalls: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + panic: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; + userErrorsInApiCalls: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class HackAtomMessageComposer implements HackAtomMessage { sender: string; @@ -41,7 +41,7 @@ export class HackAtomMessageComposer implements HackAtomMessage { this.userErrorsInApiCalls = this.userErrorsInApiCalls.bind(this); } - release = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + release = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -50,11 +50,11 @@ export class HackAtomMessageComposer implements HackAtomMessage { msg: toUtf8(JSON.stringify({ release: {} })), - funds + _funds: funds }) }; }; - cpuLoop = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + cpuLoop = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -63,11 +63,11 @@ export class HackAtomMessageComposer implements HackAtomMessage { msg: toUtf8(JSON.stringify({ cpu_loop: {} })), - funds + _funds: funds }) }; }; - storageLoop = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + storageLoop = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -76,11 +76,11 @@ export class HackAtomMessageComposer implements HackAtomMessage { msg: toUtf8(JSON.stringify({ storage_loop: {} })), - funds + _funds: funds }) }; }; - memoryLoop = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + memoryLoop = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -89,11 +89,11 @@ export class HackAtomMessageComposer implements HackAtomMessage { msg: toUtf8(JSON.stringify({ memory_loop: {} })), - funds + _funds: funds }) }; }; - messageLoop = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + messageLoop = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -102,7 +102,7 @@ export class HackAtomMessageComposer implements HackAtomMessage { msg: toUtf8(JSON.stringify({ message_loop: {} })), - funds + _funds: funds }) }; }; @@ -110,7 +110,7 @@ export class HackAtomMessageComposer implements HackAtomMessage { pages }: { pages: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -121,11 +121,11 @@ export class HackAtomMessageComposer implements HackAtomMessage { pages } })), - funds + _funds: funds }) }; }; - panic = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + panic = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -134,11 +134,11 @@ export class HackAtomMessageComposer implements HackAtomMessage { msg: toUtf8(JSON.stringify({ panic: {} })), - funds + _funds: funds }) }; }; - userErrorsInApiCalls = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + userErrorsInApiCalls = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -147,7 +147,7 @@ export class HackAtomMessageComposer implements HackAtomMessage { msg: toUtf8(JSON.stringify({ user_errors_in_api_calls: {} })), - funds + _funds: funds }) }; }; diff --git a/__output__/minter/Minter.message-composer.ts b/__output__/minter/Minter.message-composer.ts index 30a74b8b..8c951ac0 100644 --- a/__output__/minter/Minter.message-composer.ts +++ b/__output__/minter/Minter.message-composer.ts @@ -11,31 +11,31 @@ import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, Execute export interface MinterMessage { contractAddress: string; sender: string; - mint: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + mint: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; setWhitelist: ({ whitelist }: { whitelist: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; - updateStartTime: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateStartTime: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; updatePerAddressLimit: ({ perAddressLimit }: { perAddressLimit: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; mintTo: ({ recipient }: { recipient: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; mintFor: ({ recipient, tokenId }: { recipient: string; tokenId: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; - withdraw: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + withdraw: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class MinterMessageComposer implements MinterMessage { sender: string; @@ -53,7 +53,7 @@ export class MinterMessageComposer implements MinterMessage { this.withdraw = this.withdraw.bind(this); } - mint = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + mint = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -62,7 +62,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ mint: {} })), - funds + _funds: funds }) }; }; @@ -70,7 +70,7 @@ export class MinterMessageComposer implements MinterMessage { whitelist }: { whitelist: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -81,11 +81,11 @@ export class MinterMessageComposer implements MinterMessage { whitelist } })), - funds + _funds: funds }) }; }; - updateStartTime = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + updateStartTime = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -94,7 +94,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ update_start_time: {} })), - funds + _funds: funds }) }; }; @@ -102,7 +102,7 @@ export class MinterMessageComposer implements MinterMessage { perAddressLimit }: { perAddressLimit: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -113,7 +113,7 @@ export class MinterMessageComposer implements MinterMessage { per_address_limit: perAddressLimit } })), - funds + _funds: funds }) }; }; @@ -121,7 +121,7 @@ export class MinterMessageComposer implements MinterMessage { recipient }: { recipient: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -132,7 +132,7 @@ export class MinterMessageComposer implements MinterMessage { recipient } })), - funds + _funds: funds }) }; }; @@ -142,7 +142,7 @@ export class MinterMessageComposer implements MinterMessage { }: { recipient: string; tokenId: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -154,11 +154,11 @@ export class MinterMessageComposer implements MinterMessage { token_id: tokenId } })), - funds + _funds: funds }) }; }; - withdraw = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + withdraw = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -167,7 +167,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ withdraw: {} })), - funds + _funds: funds }) }; }; diff --git a/__output__/sg721/Sg721.message-composer.ts b/__output__/sg721/Sg721.message-composer.ts index 9d9017d9..ab6d060a 100644 --- a/__output__/sg721/Sg721.message-composer.ts +++ b/__output__/sg721/Sg721.message-composer.ts @@ -18,7 +18,7 @@ export interface Sg721Message { }: { recipient: string; tokenId: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; sendNft: ({ contract, msg, @@ -27,7 +27,7 @@ export interface Sg721Message { contract: string; msg: Binary; tokenId: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; approve: ({ expires, spender, @@ -36,26 +36,26 @@ export interface Sg721Message { expires?: Expiration; spender: string; tokenId: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; revoke: ({ spender, tokenId }: { spender: string; tokenId: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; approveAll: ({ expires, operator }: { expires?: Expiration; operator: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; revokeAll: ({ operator }: { operator: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; mint: ({ extension, owner, @@ -66,12 +66,12 @@ export interface Sg721Message { owner: string; tokenId: string; tokenUri?: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; burn: ({ tokenId }: { tokenId: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class Sg721MessageComposer implements Sg721Message { sender: string; @@ -96,7 +96,7 @@ export class Sg721MessageComposer implements Sg721Message { }: { recipient: string; tokenId: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -108,7 +108,7 @@ export class Sg721MessageComposer implements Sg721Message { token_id: tokenId } })), - funds + _funds: funds }) }; }; @@ -120,7 +120,7 @@ export class Sg721MessageComposer implements Sg721Message { contract: string; msg: Binary; tokenId: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -133,7 +133,7 @@ export class Sg721MessageComposer implements Sg721Message { token_id: tokenId } })), - funds + _funds: funds }) }; }; @@ -145,7 +145,7 @@ export class Sg721MessageComposer implements Sg721Message { expires?: Expiration; spender: string; tokenId: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -158,7 +158,7 @@ export class Sg721MessageComposer implements Sg721Message { token_id: tokenId } })), - funds + _funds: funds }) }; }; @@ -168,7 +168,7 @@ export class Sg721MessageComposer implements Sg721Message { }: { spender: string; tokenId: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -180,7 +180,7 @@ export class Sg721MessageComposer implements Sg721Message { token_id: tokenId } })), - funds + _funds: funds }) }; }; @@ -190,7 +190,7 @@ export class Sg721MessageComposer implements Sg721Message { }: { expires?: Expiration; operator: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -202,7 +202,7 @@ export class Sg721MessageComposer implements Sg721Message { operator } })), - funds + _funds: funds }) }; }; @@ -210,7 +210,7 @@ export class Sg721MessageComposer implements Sg721Message { operator }: { operator: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -221,7 +221,7 @@ export class Sg721MessageComposer implements Sg721Message { operator } })), - funds + _funds: funds }) }; }; @@ -235,7 +235,7 @@ export class Sg721MessageComposer implements Sg721Message { owner: string; tokenId: string; tokenUri?: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -249,7 +249,7 @@ export class Sg721MessageComposer implements Sg721Message { token_uri: tokenUri } })), - funds + _funds: funds }) }; }; @@ -257,7 +257,7 @@ export class Sg721MessageComposer implements Sg721Message { tokenId }: { tokenId: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -268,7 +268,7 @@ export class Sg721MessageComposer implements Sg721Message { token_id: tokenId } })), - funds + _funds: funds }) }; }; diff --git a/__output__/vectis/factory/Factory.message-composer.ts b/__output__/vectis/factory/Factory.message-composer.ts index 21e5a2d1..5eaf412b 100644 --- a/__output__/vectis/factory/Factory.message-composer.ts +++ b/__output__/vectis/factory/Factory.message-composer.ts @@ -15,43 +15,43 @@ export interface FactoryMessage { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateProxyUser: ({ newUser, oldUser }: { newUser: Addr; oldUser: Addr; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; migrateWallet: ({ migrationMsg, walletAddress }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateCodeId: ({ newCodeId, ty }: { newCodeId: number; ty: CodeIdType; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateWalletFee: ({ newFee }: { newFee: Coin; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateGovecAddr: ({ addr }: { addr: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateAdmin: ({ addr }: { addr: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class FactoryMessageComposer implements FactoryMessage { sender: string; @@ -73,7 +73,7 @@ export class FactoryMessageComposer implements FactoryMessage { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -84,7 +84,7 @@ export class FactoryMessageComposer implements FactoryMessage { create_wallet_msg: createWalletMsg } })), - funds + _funds: funds }) }; }; @@ -94,7 +94,7 @@ export class FactoryMessageComposer implements FactoryMessage { }: { newUser: Addr; oldUser: Addr; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -106,7 +106,7 @@ export class FactoryMessageComposer implements FactoryMessage { old_user: oldUser } })), - funds + _funds: funds }) }; }; @@ -116,7 +116,7 @@ export class FactoryMessageComposer implements FactoryMessage { }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -128,7 +128,7 @@ export class FactoryMessageComposer implements FactoryMessage { wallet_address: walletAddress } })), - funds + _funds: funds }) }; }; @@ -138,7 +138,7 @@ export class FactoryMessageComposer implements FactoryMessage { }: { newCodeId: number; ty: CodeIdType; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -150,7 +150,7 @@ export class FactoryMessageComposer implements FactoryMessage { ty } })), - funds + _funds: funds }) }; }; @@ -158,7 +158,7 @@ export class FactoryMessageComposer implements FactoryMessage { newFee }: { newFee: Coin; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -169,7 +169,7 @@ export class FactoryMessageComposer implements FactoryMessage { new_fee: newFee } })), - funds + _funds: funds }) }; }; @@ -177,7 +177,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr }: { addr: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -188,7 +188,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr } })), - funds + _funds: funds }) }; }; @@ -196,7 +196,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr }: { addr: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -207,7 +207,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr } })), - funds + _funds: funds }) }; }; diff --git a/__output__/vectis/govec/Govec.message-composer.ts b/__output__/vectis/govec/Govec.message-composer.ts index 02030e9f..7b030c9f 100644 --- a/__output__/vectis/govec/Govec.message-composer.ts +++ b/__output__/vectis/govec/Govec.message-composer.ts @@ -15,40 +15,40 @@ export interface GovecMessage { msgs }: { msgs: CosmosMsgForEmpty[]; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; - revertFreezeStatus: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + revertFreezeStatus: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; relay: ({ transaction }: { transaction: RelayTransaction; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; rotateUserKey: ({ newUserAddress }: { newUserAddress: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; addRelayer: ({ newRelayerAddress }: { newRelayerAddress: Addr; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; removeRelayer: ({ relayerAddress }: { relayerAddress: Addr; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateGuardians: ({ guardians, newMultisigCodeId }: { guardians: Guardians; newMultisigCodeId?: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateLabel: ({ newLabel }: { newLabel: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class GovecMessageComposer implements GovecMessage { sender: string; @@ -71,7 +71,7 @@ export class GovecMessageComposer implements GovecMessage { msgs }: { msgs: CosmosMsgForEmpty[]; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -82,11 +82,11 @@ export class GovecMessageComposer implements GovecMessage { msgs } })), - funds + _funds: funds }) }; }; - revertFreezeStatus = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + revertFreezeStatus = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -95,7 +95,7 @@ export class GovecMessageComposer implements GovecMessage { msg: toUtf8(JSON.stringify({ revert_freeze_status: {} })), - funds + _funds: funds }) }; }; @@ -103,7 +103,7 @@ export class GovecMessageComposer implements GovecMessage { transaction }: { transaction: RelayTransaction; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -114,7 +114,7 @@ export class GovecMessageComposer implements GovecMessage { transaction } })), - funds + _funds: funds }) }; }; @@ -122,7 +122,7 @@ export class GovecMessageComposer implements GovecMessage { newUserAddress }: { newUserAddress: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -133,7 +133,7 @@ export class GovecMessageComposer implements GovecMessage { new_user_address: newUserAddress } })), - funds + _funds: funds }) }; }; @@ -141,7 +141,7 @@ export class GovecMessageComposer implements GovecMessage { newRelayerAddress }: { newRelayerAddress: Addr; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -152,7 +152,7 @@ export class GovecMessageComposer implements GovecMessage { new_relayer_address: newRelayerAddress } })), - funds + _funds: funds }) }; }; @@ -160,7 +160,7 @@ export class GovecMessageComposer implements GovecMessage { relayerAddress }: { relayerAddress: Addr; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -171,7 +171,7 @@ export class GovecMessageComposer implements GovecMessage { relayer_address: relayerAddress } })), - funds + _funds: funds }) }; }; @@ -181,7 +181,7 @@ export class GovecMessageComposer implements GovecMessage { }: { guardians: Guardians; newMultisigCodeId?: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -193,7 +193,7 @@ export class GovecMessageComposer implements GovecMessage { new_multisig_code_id: newMultisigCodeId } })), - funds + _funds: funds }) }; }; @@ -201,7 +201,7 @@ export class GovecMessageComposer implements GovecMessage { newLabel }: { newLabel: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -212,7 +212,7 @@ export class GovecMessageComposer implements GovecMessage { new_label: newLabel } })), - funds + _funds: funds }) }; }; diff --git a/__output__/vectis/proxy/Proxy.message-composer.ts b/__output__/vectis/proxy/Proxy.message-composer.ts index 6470ade8..44fa3716 100644 --- a/__output__/vectis/proxy/Proxy.message-composer.ts +++ b/__output__/vectis/proxy/Proxy.message-composer.ts @@ -15,40 +15,40 @@ export interface ProxyMessage { msgs }: { msgs: CosmosMsgForEmpty[]; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; - revertFreezeStatus: (funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + revertFreezeStatus: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; relay: ({ transaction }: { transaction: RelayTransaction; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; rotateUserKey: ({ newUserAddress }: { newUserAddress: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; addRelayer: ({ newRelayerAddress }: { newRelayerAddress: Addr; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; removeRelayer: ({ relayerAddress }: { relayerAddress: Addr; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateGuardians: ({ guardians, newMultisigCodeId }: { guardians: Guardians; newMultisigCodeId?: number; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; updateLabel: ({ newLabel }: { newLabel: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } export class ProxyMessageComposer implements ProxyMessage { sender: string; @@ -71,7 +71,7 @@ export class ProxyMessageComposer implements ProxyMessage { msgs }: { msgs: CosmosMsgForEmpty[]; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -82,11 +82,11 @@ export class ProxyMessageComposer implements ProxyMessage { msgs } })), - funds + _funds: funds }) }; }; - revertFreezeStatus = (funds?: Coin[]): MsgExecuteContractEncodeObject => { + revertFreezeStatus = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -95,7 +95,7 @@ export class ProxyMessageComposer implements ProxyMessage { msg: toUtf8(JSON.stringify({ revert_freeze_status: {} })), - funds + _funds: funds }) }; }; @@ -103,7 +103,7 @@ export class ProxyMessageComposer implements ProxyMessage { transaction }: { transaction: RelayTransaction; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -114,7 +114,7 @@ export class ProxyMessageComposer implements ProxyMessage { transaction } })), - funds + _funds: funds }) }; }; @@ -122,7 +122,7 @@ export class ProxyMessageComposer implements ProxyMessage { newUserAddress }: { newUserAddress: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -133,7 +133,7 @@ export class ProxyMessageComposer implements ProxyMessage { new_user_address: newUserAddress } })), - funds + _funds: funds }) }; }; @@ -141,7 +141,7 @@ export class ProxyMessageComposer implements ProxyMessage { newRelayerAddress }: { newRelayerAddress: Addr; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -152,7 +152,7 @@ export class ProxyMessageComposer implements ProxyMessage { new_relayer_address: newRelayerAddress } })), - funds + _funds: funds }) }; }; @@ -160,7 +160,7 @@ export class ProxyMessageComposer implements ProxyMessage { relayerAddress }: { relayerAddress: Addr; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -171,7 +171,7 @@ export class ProxyMessageComposer implements ProxyMessage { relayer_address: relayerAddress } })), - funds + _funds: funds }) }; }; @@ -181,7 +181,7 @@ export class ProxyMessageComposer implements ProxyMessage { }: { guardians: Guardians; newMultisigCodeId?: number; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -193,7 +193,7 @@ export class ProxyMessageComposer implements ProxyMessage { new_multisig_code_id: newMultisigCodeId } })), - funds + _funds: funds }) }; }; @@ -201,7 +201,7 @@ export class ProxyMessageComposer implements ProxyMessage { newLabel }: { newLabel: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -212,7 +212,7 @@ export class ProxyMessageComposer implements ProxyMessage { new_label: newLabel } })), - funds + _funds: funds }) }; }; diff --git a/packages/wasm-ast-types/src/message-composer/__snapshots__/message-composer.spec.ts.snap b/packages/wasm-ast-types/src/message-composer/__snapshots__/message-composer.spec.ts.snap index 2fa4a2fb..a211534f 100644 --- a/packages/wasm-ast-types/src/message-composer/__snapshots__/message-composer.spec.ts.snap +++ b/packages/wasm-ast-types/src/message-composer/__snapshots__/message-composer.spec.ts.snap @@ -10,7 +10,7 @@ exports[`createMessageComposerInterface 1`] = ` }: { recipient: string; tokenId: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; sendNft: ({ contract, msg, @@ -19,7 +19,7 @@ exports[`createMessageComposerInterface 1`] = ` contract: string; msg: Binary; tokenId: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; approve: ({ expires, spender, @@ -28,26 +28,26 @@ exports[`createMessageComposerInterface 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; revoke: ({ spender, tokenId }: { spender: string; tokenId: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; approveAll: ({ expires, operator }: { expires?: Expiration; operator: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; revokeAll: ({ operator }: { operator: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; mint: ({ extension, owner, @@ -58,12 +58,12 @@ exports[`createMessageComposerInterface 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; burn: ({ tokenId }: { tokenId: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; }" `; @@ -91,7 +91,7 @@ exports[`execute classes 1`] = ` }: { recipient: string; tokenId: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: \\"/cosmwasm.wasm.v1.MsgExecuteContract\\", value: MsgExecuteContract.fromPartial({ @@ -103,7 +103,7 @@ exports[`execute classes 1`] = ` token_id: tokenId } })), - funds + _funds: funds }) }; }; @@ -115,7 +115,7 @@ exports[`execute classes 1`] = ` contract: string; msg: Binary; tokenId: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: \\"/cosmwasm.wasm.v1.MsgExecuteContract\\", value: MsgExecuteContract.fromPartial({ @@ -128,7 +128,7 @@ exports[`execute classes 1`] = ` token_id: tokenId } })), - funds + _funds: funds }) }; }; @@ -140,7 +140,7 @@ exports[`execute classes 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: \\"/cosmwasm.wasm.v1.MsgExecuteContract\\", value: MsgExecuteContract.fromPartial({ @@ -153,7 +153,7 @@ exports[`execute classes 1`] = ` token_id: tokenId } })), - funds + _funds: funds }) }; }; @@ -163,7 +163,7 @@ exports[`execute classes 1`] = ` }: { spender: string; tokenId: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: \\"/cosmwasm.wasm.v1.MsgExecuteContract\\", value: MsgExecuteContract.fromPartial({ @@ -175,7 +175,7 @@ exports[`execute classes 1`] = ` token_id: tokenId } })), - funds + _funds: funds }) }; }; @@ -185,7 +185,7 @@ exports[`execute classes 1`] = ` }: { expires?: Expiration; operator: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: \\"/cosmwasm.wasm.v1.MsgExecuteContract\\", value: MsgExecuteContract.fromPartial({ @@ -197,7 +197,7 @@ exports[`execute classes 1`] = ` operator } })), - funds + _funds: funds }) }; }; @@ -205,7 +205,7 @@ exports[`execute classes 1`] = ` operator }: { operator: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: \\"/cosmwasm.wasm.v1.MsgExecuteContract\\", value: MsgExecuteContract.fromPartial({ @@ -216,7 +216,7 @@ exports[`execute classes 1`] = ` operator } })), - funds + _funds: funds }) }; }; @@ -230,7 +230,7 @@ exports[`execute classes 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: \\"/cosmwasm.wasm.v1.MsgExecuteContract\\", value: MsgExecuteContract.fromPartial({ @@ -244,7 +244,7 @@ exports[`execute classes 1`] = ` token_uri: tokenUri } })), - funds + _funds: funds }) }; }; @@ -252,7 +252,7 @@ exports[`execute classes 1`] = ` tokenId }: { tokenId: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: \\"/cosmwasm.wasm.v1.MsgExecuteContract\\", value: MsgExecuteContract.fromPartial({ @@ -263,7 +263,7 @@ exports[`execute classes 1`] = ` token_id: tokenId } })), - funds + _funds: funds }) }; }; @@ -286,7 +286,7 @@ exports[`ownershipClass 1`] = ` newFactory }: { newFactory: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: \\"/cosmwasm.wasm.v1.MsgExecuteContract\\", value: MsgExecuteContract.fromPartial({ @@ -297,11 +297,11 @@ exports[`ownershipClass 1`] = ` new_factory: newFactory } })), - funds + _funds: funds }) }; }; - updateOwnership = (action: Action, funds?: Coin[]): MsgExecuteContractEncodeObject => { + updateOwnership = (action: Action, _funds?: Coin[]): MsgExecuteContractEncodeObject => { return { typeUrl: \\"/cosmwasm.wasm.v1.MsgExecuteContract\\", value: MsgExecuteContract.fromPartial({ @@ -310,7 +310,7 @@ exports[`ownershipClass 1`] = ` msg: toUtf8(JSON.stringify({ update_ownership: action })), - funds + _funds: funds }) }; }; @@ -325,7 +325,7 @@ exports[`ownershipInterface 1`] = ` newFactory }: { newFactory: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; - updateOwnership: (action: Action, funds?: Coin[]) => MsgExecuteContractEncodeObject; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateOwnership: (action: Action, _funds?: Coin[]) => MsgExecuteContractEncodeObject; }" `; diff --git a/packages/wasm-ast-types/src/message-composer/message-composer.ts b/packages/wasm-ast-types/src/message-composer/message-composer.ts index 255b3327..0c1a5eeb 100644 --- a/packages/wasm-ast-types/src/message-composer/message-composer.ts +++ b/packages/wasm-ast-types/src/message-composer/message-composer.ts @@ -1,13 +1,13 @@ import * as t from '@babel/types'; import { camel } from 'case'; import { - bindMethod, - typedIdentifier, - classDeclaration, - classProperty, - arrowFunctionExpression, - getMessageProperties -} from '../utils' + bindMethod, + typedIdentifier, + classDeclaration, + classProperty, + arrowFunctionExpression, + getMessageProperties +} from '../utils'; import { ExecuteMsg } from '../types'; import { createTypedObjectParams } from '../utils/types'; import { JSONSchema } from '../types'; @@ -16,298 +16,254 @@ import { identifier } from '../utils/babel'; import { getWasmMethodArgs } from '../client/client'; import { Expression } from '@babel/types'; +const OPTIONAL_FUNDS = identifier( + '_funds', + t.tsTypeAnnotation(t.tsArrayType(t.tsTypeReference(t.identifier('Coin')))), + true +); + const createWasmExecMethodMessageComposer = ( - context: RenderContext, - jsonschema: any + context: RenderContext, + jsonschema: any ) => { + context.addUtil('Coin'); + context.addUtil('MsgExecuteContractEncodeObject'); + context.addUtil('MsgExecuteContract'); + context.addUtil('toUtf8'); - context.addUtil('Coin'); - context.addUtil('MsgExecuteContractEncodeObject'); - context.addUtil('MsgExecuteContract'); - context.addUtil('toUtf8'); - - const underscoreName = Object.keys(jsonschema.properties)[0]; - const methodName = camel(underscoreName); - const param = createTypedObjectParams(context, jsonschema.properties[underscoreName]); - const args = getWasmMethodArgs( - context, - jsonschema.properties[underscoreName] - ); + const underscoreName = Object.keys(jsonschema.properties)[0]; + const methodName = camel(underscoreName); + const param = createTypedObjectParams( + context, + jsonschema.properties[underscoreName] + ); + const args = getWasmMethodArgs( + context, + jsonschema.properties[underscoreName] + ); // what the underscore named property in the message is assigned to - let actionValue: Expression + let actionValue: Expression; if (param?.type === 'Identifier') { actionValue = t.identifier(param.name); } else { - actionValue = t.objectExpression(args) + actionValue = t.objectExpression(args); } - const constantParams = [ - identifier('funds', t.tsTypeAnnotation( - t.tsArrayType( - t.tsTypeReference( - t.identifier('Coin') - ) - ) - ), true) - ]; + const constantParams = [OPTIONAL_FUNDS]; - return t.classProperty( - t.identifier(methodName), - arrowFunctionExpression( - param ? [ - // props - param, - ...constantParams - ] : constantParams, - t.blockStatement( + return t.classProperty( + t.identifier(methodName), + arrowFunctionExpression( + param + ? [ + // props + param, + ...constantParams + ] + : constantParams, + t.blockStatement([ + t.returnStatement( + t.objectExpression([ + t.objectProperty( + t.identifier('typeUrl'), + t.stringLiteral('/cosmwasm.wasm.v1.MsgExecuteContract') + ), + t.objectProperty( + t.identifier('value'), + t.callExpression( + t.memberExpression( + t.identifier('MsgExecuteContract'), + t.identifier('fromPartial') + ), [ - t.returnStatement( - - t.objectExpression([ - t.objectProperty( - t.identifier('typeUrl'), - t.stringLiteral('/cosmwasm.wasm.v1.MsgExecuteContract') - ), - t.objectProperty( - t.identifier('value'), - t.callExpression( - t.memberExpression( - t.identifier('MsgExecuteContract'), - t.identifier('fromPartial') - ), - [ - t.objectExpression([ - t.objectProperty( - t.identifier('sender'), - t.memberExpression( - t.thisExpression(), - t.identifier('sender') - ) - ), - t.objectProperty( - t.identifier('contract'), - t.memberExpression( - t.thisExpression(), - t.identifier('contractAddress') - ) - ), - t.objectProperty( - t.identifier('msg'), - t.callExpression( - t.identifier('toUtf8'), - [ - t.callExpression( - t.memberExpression( - t.identifier('JSON'), - t.identifier('stringify') - ), - [ - t.objectExpression( - [ - t.objectProperty( - t.identifier(underscoreName), actionValue - ) - ] - - ) - ] - ) - ] - ) - ), - t.objectProperty( - t.identifier('funds'), - t.identifier('funds'), - false, - true - ), - ]) - ] - ) - ) - ]) + t.objectExpression([ + t.objectProperty( + t.identifier('sender'), + t.memberExpression( + t.thisExpression(), + t.identifier('sender') + ) + ), + t.objectProperty( + t.identifier('contract'), + t.memberExpression( + t.thisExpression(), + t.identifier('contractAddress') + ) + ), + t.objectProperty( + t.identifier('msg'), + t.callExpression(t.identifier('toUtf8'), [ + t.callExpression( + t.memberExpression( + t.identifier('JSON'), + t.identifier('stringify') + ), + [ + t.objectExpression([ + t.objectProperty( + t.identifier(underscoreName), + actionValue + ) + ]) + ] + ) + ]) + ), + t.objectProperty( + t.identifier('_funds'), + t.identifier('funds') ) + ]) ] - ), - // return type - t.tsTypeAnnotation( - t.tsTypeReference( - t.identifier('MsgExecuteContractEncodeObject') - ) - ), - false + ) + ) + ]) ) - ); - -} + ]), + // return type + t.tsTypeAnnotation( + t.tsTypeReference(t.identifier('MsgExecuteContractEncodeObject')) + ), + false + ) + ); +}; export const createMessageComposerClass = ( - context: RenderContext, - className: string, - implementsClassName: string, - execMsg: ExecuteMsg + context: RenderContext, + className: string, + implementsClassName: string, + execMsg: ExecuteMsg ) => { + const propertyNames = getMessageProperties(execMsg) + .map((method) => Object.keys(method.properties)?.[0]) + .filter(Boolean); - const propertyNames = getMessageProperties(execMsg) - .map(method => Object.keys(method.properties)?.[0]) - .filter(Boolean); + const bindings = propertyNames.map(camel).map(bindMethod); - const bindings = propertyNames - .map(camel) - .map(bindMethod); + const methods = getMessageProperties(execMsg).map((schema) => { + return createWasmExecMethodMessageComposer(context, schema); + }); - const methods = getMessageProperties(execMsg) - .map(schema => { - return createWasmExecMethodMessageComposer(context, schema) - }); + const blockStmt = []; - const blockStmt = []; + [].push.apply(blockStmt, [ + t.expressionStatement( + t.assignmentExpression( + '=', + t.memberExpression(t.thisExpression(), t.identifier('sender')), + t.identifier('sender') + ) + ), + t.expressionStatement( + t.assignmentExpression( + '=', + t.memberExpression(t.thisExpression(), t.identifier('contractAddress')), + t.identifier('contractAddress') + ) + ), + ...bindings + ]); - [].push.apply(blockStmt, [ - t.expressionStatement( - t.assignmentExpression( - '=', - t.memberExpression( - t.thisExpression(), - t.identifier('sender') - ), - t.identifier('sender') - ) + return t.exportNamedDeclaration( + classDeclaration( + className, + [ + // sender + classProperty('sender', t.tsTypeAnnotation(t.tsStringKeyword())), + + // contractAddress + classProperty( + 'contractAddress', + t.tsTypeAnnotation(t.tsStringKeyword()) ), - t.expressionStatement( - t.assignmentExpression( - '=', - t.memberExpression( - t.thisExpression(), - t.identifier('contractAddress') - ), - t.identifier('contractAddress') + + // constructor + t.classMethod( + 'constructor', + t.identifier('constructor'), + [ + typedIdentifier('sender', t.tsTypeAnnotation(t.tsStringKeyword())), + typedIdentifier( + 'contractAddress', + t.tsTypeAnnotation(t.tsStringKeyword()) ) + ], + t.blockStatement(blockStmt) ), - ...bindings - ]); - - return t.exportNamedDeclaration( - classDeclaration(className, - [ - // sender - classProperty('sender', t.tsTypeAnnotation( - t.tsStringKeyword() - )), - - // contractAddress - classProperty('contractAddress', t.tsTypeAnnotation( - t.tsStringKeyword() - )), - - // constructor - t.classMethod('constructor', - t.identifier('constructor'), - [ - typedIdentifier('sender', t.tsTypeAnnotation(t.tsStringKeyword())), - typedIdentifier('contractAddress', t.tsTypeAnnotation(t.tsStringKeyword())) - ], - t.blockStatement( - blockStmt - )), - ...methods - ], - [ - t.tSExpressionWithTypeArguments( - t.identifier(implementsClassName) - ) - ], - null - ) - ); -} + ...methods + ], + [t.tSExpressionWithTypeArguments(t.identifier(implementsClassName))], + null + ) + ); +}; export const createMessageComposerInterface = ( - context: RenderContext, - className: string, - execMsg: ExecuteMsg + context: RenderContext, + className: string, + execMsg: ExecuteMsg ) => { + const methods = getMessageProperties(execMsg).map((jsonschema) => { + const underscoreName = Object.keys(jsonschema.properties)[0]; + const methodName = camel(underscoreName); + return createPropertyFunctionWithObjectParamsForMessageComposer( + context, + methodName, + 'MsgExecuteContractEncodeObject', + jsonschema.properties[underscoreName] + ); + }); - const methods = getMessageProperties(execMsg) - .map(jsonschema => { - const underscoreName = Object.keys(jsonschema.properties)[0]; - const methodName = camel(underscoreName); - return createPropertyFunctionWithObjectParamsForMessageComposer( - context, - methodName, - 'MsgExecuteContractEncodeObject', - jsonschema.properties[underscoreName] - ); - }); - - const extendsAst = []; + const extendsAst = []; - return t.exportNamedDeclaration( - t.tsInterfaceDeclaration( - t.identifier(className), - null, - extendsAst, - t.tSInterfaceBody( - [ - - // contract address - t.tSPropertySignature( - t.identifier('contractAddress'), - t.tsTypeAnnotation( - t.tsStringKeyword() - ) - ), + return t.exportNamedDeclaration( + t.tsInterfaceDeclaration( + t.identifier(className), + null, + extendsAst, + t.tSInterfaceBody([ + // contract address + t.tSPropertySignature( + t.identifier('contractAddress'), + t.tsTypeAnnotation(t.tsStringKeyword()) + ), - // contract address - t.tSPropertySignature( - t.identifier('sender'), - t.tsTypeAnnotation( - t.tsStringKeyword() - ) - ), + // contract address + t.tSPropertySignature( + t.identifier('sender'), + t.tsTypeAnnotation(t.tsStringKeyword()) + ), - ...methods, - ] - ) - ) - ); + ...methods + ]) + ) + ); }; const createPropertyFunctionWithObjectParamsForMessageComposer = ( - context: RenderContext, - methodName: string, - responseType: string, - jsonschema: JSONSchema + context: RenderContext, + methodName: string, + responseType: string, + jsonschema: JSONSchema ) => { - const obj = createTypedObjectParams(context, jsonschema); - const fixedParams = [ - identifier('funds', t.tsTypeAnnotation( - t.tsArrayType( - t.tsTypeReference( - t.identifier('Coin') - ) - ) - ), true) - ]; - const func = { - type: 'TSFunctionType', - typeAnnotation: t.tsTypeAnnotation(t.tsTypeReference( - t.identifier(responseType) - )), - parameters: obj ? [ - obj, - ...fixedParams - - ] : fixedParams - } + const obj = createTypedObjectParams(context, jsonschema); + const fixedParams = [OPTIONAL_FUNDS]; + const func = { + type: 'TSFunctionType', + typeAnnotation: t.tsTypeAnnotation( + t.tsTypeReference(t.identifier(responseType)) + ), + parameters: obj ? [obj, ...fixedParams] : fixedParams + }; - return t.tSPropertySignature( - t.identifier(methodName), - t.tsTypeAnnotation( - // @ts-ignore:next-line - func - ) - ); + return t.tSPropertySignature( + t.identifier(methodName), + t.tsTypeAnnotation( + // @ts-ignore:next-line + func + ) + ); }; - diff --git a/yarn.lock b/yarn.lock index 5c41f663..220b3fe5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9218,18 +9218,6 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" -"wasm-ast-types@path:../wasm-ast-types": - version "0.17.0" - resolved "https://registry.npmjs.org/wasm-ast-types/-/wasm-ast-types-0.17.0.tgz#417280a61d60ea9964667cf2edb8f5281dc295d7" - integrity sha512-WeriXPbG67iI51Mf/5qRR0xcpEaTO/Wyjpl+vsmjZ5K6q/0W6iO03zHsESNIH/hpc5FPTpb0Y0L9xAtnnNe9Ow== - dependencies: - "@babel/runtime" "^7.18.9" - "@babel/types" "7.18.10" - "@jest/transform" "28.1.3" - ast-stringify "0.1.0" - case "1.6.3" - deepmerge "4.2.2" - wcwidth@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz" From 73ecb0163187bdd78539fdc4c149ffbcb280ba14 Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Sun, 21 May 2023 14:35:32 +0300 Subject: [PATCH 110/287] Udpate client to use underscored funds parameter --- packages/wasm-ast-types/src/client/client.ts | 558 ++++++++---------- .../ts-client.account-nfts.spec.ts.snap | 90 +-- .../ts-client.arrays-ref.spec.ts.snap | 84 +-- .../ts-client.arrays.spec.ts.snap | 6 +- .../ts-client.cw-named-groups.test.ts.snap | 18 +- .../ts-client.cw-proposal-single.test.ts.snap | 54 +- .../ts-client.issue-101.spec.ts.snap | 12 +- .../ts-client.issue-71.test.ts.snap | 60 +- .../ts-client.issue-98.test.ts.snap | 18 +- .../ts-client.issues.test.ts.snap | 156 ++--- .../ts-client.overrides.spec.ts.snap | 160 ++--- .../ts-client.sg721.spec.ts.snap | 48 +- .../test/__snapshots__/ts-client.spec.ts.snap | 92 +-- .../ts-client.vectis.spec.ts.snap | 48 +- .../ts-client.wager.spec.ts.snap | 16 +- .../src/message-composer/message-composer.ts | 23 +- .../__snapshots__/react-query.spec.ts.snap | 60 +- .../src/react-query/react-query.ts | 3 +- .../wasm-ast-types/src/utils/constants.ts | 23 + packages/wasm-ast-types/src/utils/index.ts | 2 + 20 files changed, 730 insertions(+), 801 deletions(-) create mode 100644 packages/wasm-ast-types/src/utils/constants.ts diff --git a/packages/wasm-ast-types/src/client/client.ts b/packages/wasm-ast-types/src/client/client.ts index a91dfe09..055cf6cb 100644 --- a/packages/wasm-ast-types/src/client/client.ts +++ b/packages/wasm-ast-types/src/client/client.ts @@ -5,14 +5,21 @@ import { bindMethod, classDeclaration, classProperty, + FIXED_EXECUTE_PARAMS, getMessageProperties, + OPTIONAL_FUNDS_PARAM, promiseTypeAnnotation, typedIdentifier } from '../utils'; import { ExecuteMsg, JSONSchema, QueryMsg } from '../types'; -import { createTypedObjectParams, getPropertyType, getResponseType, getType } from '../utils/types'; +import { + createTypedObjectParams, + getPropertyType, + getResponseType, + getType +} from '../utils/types'; import { RenderContext } from '../context'; import { identifier, propertySignature } from '../utils/babel'; @@ -21,66 +28,24 @@ export const CONSTANT_EXEC_PARAMS = [ identifier( 'fee', t.tsTypeAnnotation( - t.tsUnionType( - [ - t.tSNumberKeyword(), - t.tsTypeReference( - t.identifier('StdFee') - ), - t.tsLiteralType( - t.stringLiteral('auto') - ) - ] - ) + t.tsUnionType([ + t.tSNumberKeyword(), + t.tsTypeReference(t.identifier('StdFee')), + t.tsLiteralType(t.stringLiteral('auto')) + ]) ), false ), t.stringLiteral('auto') ), - identifier('memo', t.tsTypeAnnotation( - t.tsStringKeyword() - ), true), - identifier('funds', t.tsTypeAnnotation( - t.tsArrayType( - t.tsTypeReference( - t.identifier('Coin') - ) - ) - ), true) -]; - -export const FIXED_EXECUTE_PARAMS = [ - identifier('fee', t.tsTypeAnnotation( - t.tsUnionType( - [ - t.tsNumberKeyword(), - t.tsTypeReference( - t.identifier('StdFee') - ), - t.tsLiteralType( - t.stringLiteral('auto') - ) - ] - ) - ), true), - identifier('memo', t.tsTypeAnnotation( - t.tsStringKeyword() - ), true), - identifier('funds', t.tsTypeAnnotation( - t.tsArrayType( - t.tsTypeReference( - t.identifier('Coin') - ) - ) - ), true) + identifier('memo', t.tsTypeAnnotation(t.tsStringKeyword()), true), + OPTIONAL_FUNDS_PARAM ]; - export const createWasmQueryMethod = ( context: RenderContext, jsonschema: any ) => { - const underscoreName = Object.keys(jsonschema.properties)[0]; const methodName = camel(underscoreName); const responseType = getResponseType(context, underscoreName); @@ -97,49 +62,44 @@ export const createWasmQueryMethod = ( const msgAction = t.identifier(underscoreName); // If the param is an identifier, we can just use it as is - const msgActionValue = param?.type === 'Identifier' ? t.identifier(param.name) : t.objectExpression(args) + const msgActionValue = + param?.type === 'Identifier' + ? t.identifier(param.name) + : t.objectExpression(args); return t.classProperty( t.identifier(methodName), arrowFunctionExpression( param ? [param] : [], - t.blockStatement( - [ - t.returnStatement( - t.callExpression( + t.blockStatement([ + t.returnStatement( + t.callExpression( + t.memberExpression( + t.memberExpression(t.thisExpression(), t.identifier('client')), + t.identifier('queryContractSmart') + ), + [ t.memberExpression( - t.memberExpression( - t.thisExpression(), - t.identifier('client') - ), - t.identifier('queryContractSmart') + t.thisExpression(), + t.identifier('contractAddress') ), - [ - t.memberExpression(t.thisExpression(), t.identifier('contractAddress')), - t.objectExpression([ - t.objectProperty(msgAction, msgActionValue) - ]) - ] - ) + t.objectExpression([t.objectProperty(msgAction, msgActionValue)]) + ] ) - ] - ), + ) + ]), t.tsTypeAnnotation( t.tsTypeReference( t.identifier('Promise'), - t.tsTypeParameterInstantiation( - [ - t.tSTypeReference( - t.identifier(responseType) - ) - ] - ) + t.tsTypeParameterInstantiation([ + t.tSTypeReference(t.identifier(responseType)) + ]) ) ), true ) ); -} +}; export const createQueryClass = ( context: RenderContext, @@ -147,81 +107,78 @@ export const createQueryClass = ( implementsClassName: string, queryMsg: QueryMsg ) => { - context.addUtil('CosmWasmClient'); const propertyNames = getMessageProperties(queryMsg) - .map(method => Object.keys(method.properties)?.[0]) + .map((method) => Object.keys(method.properties)?.[0]) .filter(Boolean); - const bindings = propertyNames - .map(camel) - .map(bindMethod); + const bindings = propertyNames.map(camel).map(bindMethod); - const methods = getMessageProperties(queryMsg) - .map(schema => { - return createWasmQueryMethod(context, schema) - }); + const methods = getMessageProperties(queryMsg).map((schema) => { + return createWasmQueryMethod(context, schema); + }); return t.exportNamedDeclaration( - classDeclaration(className, + classDeclaration( + className, [ // client - classProperty('client', t.tsTypeAnnotation( - t.tsTypeReference(t.identifier('CosmWasmClient')) - )), + classProperty( + 'client', + t.tsTypeAnnotation(t.tsTypeReference(t.identifier('CosmWasmClient'))) + ), // contractAddress - classProperty('contractAddress', t.tsTypeAnnotation( - t.tsStringKeyword() - )), + classProperty( + 'contractAddress', + t.tsTypeAnnotation(t.tsStringKeyword()) + ), // constructor - t.classMethod('constructor', + t.classMethod( + 'constructor', t.identifier('constructor'), [ - typedIdentifier('client', t.tsTypeAnnotation(t.tsTypeReference(t.identifier('CosmWasmClient')))), - typedIdentifier('contractAddress', t.tsTypeAnnotation(t.tsStringKeyword())) - + typedIdentifier( + 'client', + t.tsTypeAnnotation( + t.tsTypeReference(t.identifier('CosmWasmClient')) + ) + ), + typedIdentifier( + 'contractAddress', + t.tsTypeAnnotation(t.tsStringKeyword()) + ) ], - t.blockStatement( - [ - - // client/contract set - t.expressionStatement( - t.assignmentExpression( - '=', - t.memberExpression( - t.thisExpression(), - t.identifier('client') - ), - t.identifier('client') - ) - ), - t.expressionStatement( - t.assignmentExpression( - '=', - t.memberExpression( - t.thisExpression(), - t.identifier('contractAddress') - ), + t.blockStatement([ + // client/contract set + t.expressionStatement( + t.assignmentExpression( + '=', + t.memberExpression(t.thisExpression(), t.identifier('client')), + t.identifier('client') + ) + ), + t.expressionStatement( + t.assignmentExpression( + '=', + t.memberExpression( + t.thisExpression(), t.identifier('contractAddress') - ) - ), - - ...bindings + ), + t.identifier('contractAddress') + ) + ), - ] - )), + ...bindings + ]) + ), ...methods - ], - [ - t.tSExpressionWithTypeArguments( - t.identifier(implementsClassName) - ) - ]) + [t.tSExpressionWithTypeArguments(t.identifier(implementsClassName))] + ) ); }; @@ -236,16 +193,16 @@ export const getWasmMethodArgs = ( const obj = context.refLookup(jsonschema.$ref); // properties if (obj) { - keys = Object.keys(obj.properties ?? {}) + keys = Object.keys(obj.properties ?? {}); } // tuple struct or otherwise, use the name of the reference if (!keys.length && obj?.oneOf) { -// TODO????? ADAIR + // TODO????? ADAIR } } - const args = keys.map(prop => { + const args = keys.map((prop) => { return t.objectProperty( t.identifier(prop), t.identifier(camel(prop)), @@ -261,7 +218,6 @@ export const createWasmExecMethod = ( context: RenderContext, jsonschema: JSONSchema ) => { - context.addUtil('ExecuteResult'); context.addUtil('StdFee'); context.addUtil('Coin'); @@ -279,73 +235,59 @@ export const createWasmExecMethod = ( const msgAction = t.identifier(underscoreName); // If the param is an identifier, we can just use it as is - const msgActionValue = param?.type === 'Identifier' ? t.identifier(param.name) : t.objectExpression(args) + const msgActionValue = + param?.type === 'Identifier' + ? t.identifier(param.name) + : t.objectExpression(args); return t.classProperty( t.identifier(methodName), arrowFunctionExpression( - param ? [ - // props - param, - ...CONSTANT_EXEC_PARAMS - ] : CONSTANT_EXEC_PARAMS, - t.blockStatement( - [ - t.returnStatement( - t.awaitExpression( - t.callExpression( + param + ? [ + // props + param, + ...CONSTANT_EXEC_PARAMS + ] + : CONSTANT_EXEC_PARAMS, + t.blockStatement([ + t.returnStatement( + t.awaitExpression( + t.callExpression( + t.memberExpression( + t.memberExpression(t.thisExpression(), t.identifier('client')), + t.identifier('execute') + ), + [ + t.memberExpression(t.thisExpression(), t.identifier('sender')), t.memberExpression( - t.memberExpression( - t.thisExpression(), - t.identifier('client') - ), - t.identifier('execute') + t.thisExpression(), + t.identifier('contractAddress') ), - [ - t.memberExpression( - t.thisExpression(), - t.identifier('sender') - ), - t.memberExpression( - t.thisExpression(), - t.identifier('contractAddress') - ), - t.objectExpression( - [ - t.objectProperty( - msgAction, - msgActionValue - ) - - ] - ), - t.identifier('fee'), - t.identifier('memo'), - t.identifier('funds') - ] - ) + t.objectExpression([ + t.objectProperty(msgAction, msgActionValue) + ]), + t.identifier('fee'), + t.identifier('memo'), + t.identifier('_funds') + ] ) ) - ] - ), + ) + ]), // return type t.tsTypeAnnotation( t.tsTypeReference( t.identifier('Promise'), - t.tsTypeParameterInstantiation( - [ - t.tSTypeReference( - t.identifier('ExecuteResult') - ) - ] - ) + t.tsTypeParameterInstantiation([ + t.tSTypeReference(t.identifier('ExecuteResult')) + ]) ) ), true ) ); - -} +}; export const createExecuteClass = ( context: RenderContext, @@ -354,33 +296,29 @@ export const createExecuteClass = ( extendsClassName: string | null, execMsg: ExecuteMsg ) => { - context.addUtil('SigningCosmWasmClient'); const propertyNames = getMessageProperties(execMsg) - .map(method => Object.keys(method.properties)?.[0]) + .map((method) => Object.keys(method.properties)?.[0]) .filter(Boolean); - const bindings = propertyNames - .map(camel) - .map(bindMethod); + const bindings = propertyNames.map(camel).map(bindMethod); - const methods = getMessageProperties(execMsg) - .map(schema => { - return createWasmExecMethod(context, schema) - }); + const methods = getMessageProperties(execMsg).map((schema) => { + return createWasmExecMethod(context, schema); + }); const blockStmt = []; if (extendsClassName) { - blockStmt.push( // super() - t.expressionStatement(t.callExpression( - t.super(), - [ + blockStmt.push( + // super() + t.expressionStatement( + t.callExpression(t.super(), [ t.identifier('client'), t.identifier('contractAddress') - ] - )) + ]) + ) ); } @@ -389,78 +327,85 @@ export const createExecuteClass = ( t.expressionStatement( t.assignmentExpression( '=', - t.memberExpression( - t.thisExpression(), - t.identifier('client') - ), + t.memberExpression(t.thisExpression(), t.identifier('client')), t.identifier('client') ) ), t.expressionStatement( t.assignmentExpression( '=', - t.memberExpression( - t.thisExpression(), - t.identifier('sender') - ), + t.memberExpression(t.thisExpression(), t.identifier('sender')), t.identifier('sender') ) ), t.expressionStatement( t.assignmentExpression( '=', - t.memberExpression( - t.thisExpression(), - t.identifier('contractAddress') - ), + t.memberExpression(t.thisExpression(), t.identifier('contractAddress')), t.identifier('contractAddress') ) ), ...bindings ]); - const noImplicitOverride = context.options.client.noImplicitOverride && extendsClassName && context.options.client.execExtendsQuery; + const noImplicitOverride = + context.options.client.noImplicitOverride && + extendsClassName && + context.options.client.execExtendsQuery; return t.exportNamedDeclaration( - classDeclaration(className, + classDeclaration( + className, [ // client - classProperty('client', t.tsTypeAnnotation( - t.tsTypeReference(t.identifier('SigningCosmWasmClient')) - ), false, false, noImplicitOverride), + classProperty( + 'client', + t.tsTypeAnnotation( + t.tsTypeReference(t.identifier('SigningCosmWasmClient')) + ), + false, + false, + noImplicitOverride + ), // sender - classProperty('sender', t.tsTypeAnnotation( - t.tsStringKeyword() - )), + classProperty('sender', t.tsTypeAnnotation(t.tsStringKeyword())), // contractAddress - classProperty('contractAddress', t.tsTypeAnnotation( - t.tsStringKeyword() - ), false, false, noImplicitOverride), + classProperty( + 'contractAddress', + t.tsTypeAnnotation(t.tsStringKeyword()), + false, + false, + noImplicitOverride + ), // constructor - t.classMethod('constructor', + t.classMethod( + 'constructor', t.identifier('constructor'), [ - typedIdentifier('client', t.tsTypeAnnotation(t.tsTypeReference(t.identifier('SigningCosmWasmClient')))), + typedIdentifier( + 'client', + t.tsTypeAnnotation( + t.tsTypeReference(t.identifier('SigningCosmWasmClient')) + ) + ), typedIdentifier('sender', t.tsTypeAnnotation(t.tsStringKeyword())), - typedIdentifier('contractAddress', t.tsTypeAnnotation(t.tsStringKeyword())) + typedIdentifier( + 'contractAddress', + t.tsTypeAnnotation(t.tsStringKeyword()) + ) ], - t.blockStatement( - blockStmt - )), + t.blockStatement(blockStmt) + ), ...methods ], - [ - t.tSExpressionWithTypeArguments( - t.identifier(implementsClassName) - ) - ], + [t.tSExpressionWithTypeArguments(t.identifier(implementsClassName))], extendsClassName ? t.identifier(extendsClassName) : null ) ); -} +}; export const createExecuteInterface = ( context: RenderContext, @@ -468,50 +413,41 @@ export const createExecuteInterface = ( extendsClassName: string | null, execMsg: ExecuteMsg ) => { + const methods = getMessageProperties(execMsg).map((jsonschema) => { + const underscoreName = Object.keys(jsonschema.properties)[0]; + const methodName = camel(underscoreName); + return createPropertyFunctionWithObjectParamsForExec( + context, + methodName, + 'ExecuteResult', + jsonschema.properties[underscoreName] + ); + }); - const methods = getMessageProperties(execMsg) - .map(jsonschema => { - const underscoreName = Object.keys(jsonschema.properties)[0]; - const methodName = camel(underscoreName); - return createPropertyFunctionWithObjectParamsForExec( - context, - methodName, - 'ExecuteResult', - jsonschema.properties[underscoreName] - ); - }); - - const extendsAst = extendsClassName ? [t.tSExpressionWithTypeArguments( - t.identifier(extendsClassName) - )] : [] + const extendsAst = extendsClassName + ? [t.tSExpressionWithTypeArguments(t.identifier(extendsClassName))] + : []; return t.exportNamedDeclaration( t.tsInterfaceDeclaration( t.identifier(className), null, extendsAst, - t.tSInterfaceBody( - [ - - // contract address - t.tSPropertySignature( - t.identifier('contractAddress'), - t.tsTypeAnnotation( - t.tsStringKeyword() - ) - ), + t.tSInterfaceBody([ + // contract address + t.tSPropertySignature( + t.identifier('contractAddress'), + t.tsTypeAnnotation(t.tsStringKeyword()) + ), - // contract address - t.tSPropertySignature( - t.identifier('sender'), - t.tsTypeAnnotation( - t.tsStringKeyword() - ) - ), + // contract address + t.tSPropertySignature( + t.identifier('sender'), + t.tsTypeAnnotation(t.tsStringKeyword()) + ), - ...methods, - ] - ) + ...methods + ]) ) ); }; @@ -527,10 +463,8 @@ export const createPropertyFunctionWithObjectParams = ( const func = { type: 'TSFunctionType', typeAnnotation: promiseTypeAnnotation(responseType), - parameters: obj ? [ - obj - ] : [] - } + parameters: obj ? [obj] : [] + }; return t.tSPropertySignature( t.identifier(methodName), @@ -547,7 +481,6 @@ export const createPropertyFunctionWithObjectParamsForExec = ( responseType: string, jsonschema: JSONSchema ) => { - context.addUtil('Coin'); const obj = createTypedObjectParams(context, jsonschema); @@ -555,12 +488,8 @@ export const createPropertyFunctionWithObjectParamsForExec = ( const func = { type: 'TSFunctionType', typeAnnotation: promiseTypeAnnotation(responseType), - parameters: obj ? [ - obj, - ...FIXED_EXECUTE_PARAMS - - ] : FIXED_EXECUTE_PARAMS - } + parameters: obj ? [obj, ...FIXED_EXECUTE_PARAMS] : FIXED_EXECUTE_PARAMS + }; return t.tSPropertySignature( t.identifier(methodName), @@ -576,47 +505,40 @@ export const createQueryInterface = ( className: string, queryMsg: QueryMsg ) => { - const methods = getMessageProperties(queryMsg) - .map(jsonschema => { - const underscoreName = Object.keys(jsonschema.properties)[0]; - const methodName = camel(underscoreName); - const responseType = getResponseType(context, underscoreName); - return createPropertyFunctionWithObjectParams( - context, - methodName, - responseType, - jsonschema.properties[underscoreName] - ); - }); + const methods = getMessageProperties(queryMsg).map((jsonschema) => { + const underscoreName = Object.keys(jsonschema.properties)[0]; + const methodName = camel(underscoreName); + const responseType = getResponseType(context, underscoreName); + return createPropertyFunctionWithObjectParams( + context, + methodName, + responseType, + jsonschema.properties[underscoreName] + ); + }); return t.exportNamedDeclaration( t.tsInterfaceDeclaration( t.identifier(className), null, [], - t.tSInterfaceBody( - [ - t.tSPropertySignature( - t.identifier('contractAddress'), - t.tsTypeAnnotation( - t.tsStringKeyword() - ) - ), - ...methods - ] - ) + t.tSInterfaceBody([ + t.tSPropertySignature( + t.identifier('contractAddress'), + t.tsTypeAnnotation(t.tsStringKeyword()) + ), + ...methods + ]) ) ); }; - export const createTypeOrInterface = ( context: RenderContext, Type: string, jsonschema: JSONSchema ) => { if (jsonschema.type !== 'object') { - if (!jsonschema.type) { return t.exportNamedDeclaration( t.tsTypeAliasDeclaration( @@ -624,7 +546,7 @@ export const createTypeOrInterface = ( null, t.tsTypeReference(t.identifier(jsonschema.title)) ) - ) + ); } return t.exportNamedDeclaration( @@ -635,14 +557,10 @@ export const createTypeOrInterface = ( ) ); } - const props = Object.keys(jsonschema.properties ?? {}) - .map(prop => { - const { type, optional } = getPropertyType(context, jsonschema, prop); - return propertySignature(camel(prop), t.tsTypeAnnotation( - type - ), optional); - }); - + const props = Object.keys(jsonschema.properties ?? {}).map((prop) => { + const { type, optional } = getPropertyType(context, jsonschema, prop); + return propertySignature(camel(prop), t.tsTypeAnnotation(type), optional); + }); return t.exportNamedDeclaration( t.tsInterfaceDeclaration( @@ -651,12 +569,10 @@ export const createTypeOrInterface = ( [], t.tsInterfaceBody( // @ts-ignore:next-line - [ - ...props - ] + [...props] ) ) - ) + ); }; export const createTypeInterface = ( @@ -664,9 +580,5 @@ export const createTypeInterface = ( jsonschema: JSONSchema ) => { const Type = jsonschema.title; - return createTypeOrInterface( - context, - Type, - jsonschema - ); + return createTypeOrInterface(context, Type, jsonschema); }; diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap index 254ba6b0..70d9f1b6 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap @@ -27,10 +27,10 @@ exports[`execute classes array types 1`] = ` this.minter = this.minter.bind(this); } - proposedNewOwner = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + proposedNewOwner = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { proposed_new_owner: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; allowedVaults = async ({ limit, @@ -38,13 +38,13 @@ exports[`execute classes array types 1`] = ` }: { limit?: number; startAfter?: VaultBase_for_String; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { allowed_vaults: { limit, start_after: startAfter } - }, fee, memo, funds); + }, fee, memo, _funds); }; allDebtShares = async ({ limit, @@ -52,18 +52,18 @@ exports[`execute classes array types 1`] = ` }: { limit?: number; startAfter?: string[][]; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { all_debt_shares: { limit, start_after: startAfter } - }, fee, memo, funds); + }, fee, memo, _funds); }; - allPreviousOwners = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + allPreviousOwners = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { all_previous_owners: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; ownerOf = async ({ includeExpired, @@ -71,13 +71,13 @@ exports[`execute classes array types 1`] = ` }: { includeExpired?: boolean; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { owner_of: { include_expired: includeExpired, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approval = async ({ includeExpired, @@ -87,14 +87,14 @@ exports[`execute classes array types 1`] = ` includeExpired?: boolean; spender: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approval: { include_expired: includeExpired, spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approvals = async ({ includeExpired, @@ -102,13 +102,13 @@ exports[`execute classes array types 1`] = ` }: { includeExpired?: boolean; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approvals: { include_expired: includeExpired, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; allOperators = async ({ includeExpired, @@ -120,7 +120,7 @@ exports[`execute classes array types 1`] = ` limit?: number; owner: string; startAfter?: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { all_operators: { include_expired: includeExpired, @@ -128,28 +128,28 @@ exports[`execute classes array types 1`] = ` owner, start_after: startAfter } - }, fee, memo, funds); + }, fee, memo, _funds); }; - numTokens = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + numTokens = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { num_tokens: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; - contractInfo = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + contractInfo = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { contract_info: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; nftInfo = async ({ tokenId }: { tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { nft_info: { token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; allNftInfo = async ({ includeExpired, @@ -157,13 +157,13 @@ exports[`execute classes array types 1`] = ` }: { includeExpired?: boolean; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { all_nft_info: { include_expired: includeExpired, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; tokens = async ({ limit, @@ -173,14 +173,14 @@ exports[`execute classes array types 1`] = ` limit?: number; owner: string; startAfter?: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { tokens: { limit, owner, start_after: startAfter } - }, fee, memo, funds); + }, fee, memo, _funds); }; allTokens = async ({ limit, @@ -188,18 +188,18 @@ exports[`execute classes array types 1`] = ` }: { limit?: number; startAfter?: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { all_tokens: { limit, start_after: startAfter } - }, fee, memo, funds); + }, fee, memo, _funds); }; - minter = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + minter = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { minter: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; @@ -208,29 +208,29 @@ exports[`execute interfaces no extends 1`] = ` "export interface SG721Instance { contractAddress: string; sender: string; - proposedNewOwner: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + proposedNewOwner: (fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; allowedVaults: ({ limit, startAfter }: { limit?: number; startAfter?: VaultBase_for_String; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; allDebtShares: ({ limit, startAfter }: { limit?: number; startAfter?: string[][]; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - allPreviousOwners: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; + allPreviousOwners: (fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; ownerOf: ({ includeExpired, tokenId }: { includeExpired?: boolean; tokenId: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; approval: ({ includeExpired, spender, @@ -239,14 +239,14 @@ exports[`execute interfaces no extends 1`] = ` includeExpired?: boolean; spender: string; tokenId: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; approvals: ({ includeExpired, tokenId }: { includeExpired?: boolean; tokenId: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; allOperators: ({ includeExpired, limit, @@ -257,21 +257,21 @@ exports[`execute interfaces no extends 1`] = ` limit?: number; owner: string; startAfter?: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - numTokens: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - contractInfo: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; + numTokens: (fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; + contractInfo: (fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; nftInfo: ({ tokenId }: { tokenId: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; allNftInfo: ({ includeExpired, tokenId }: { includeExpired?: boolean; tokenId: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; tokens: ({ limit, owner, @@ -280,15 +280,15 @@ exports[`execute interfaces no extends 1`] = ` limit?: number; owner: string; startAfter?: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; allTokens: ({ limit, startAfter }: { limit?: number; startAfter?: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - minter: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; + minter: (fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; }" `; diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.arrays-ref.spec.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.arrays-ref.spec.ts.snap index 1c35275e..14cfcf4c 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.arrays-ref.spec.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.arrays-ref.spec.ts.snap @@ -32,13 +32,13 @@ exports[`execute classes array types 1`] = ` }: { amount: number; creditor: Addr; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_edge: { amount, creditor } - }, fee, memo, funds); + }, fee, memo, _funds); }; editEdge = async ({ amount, @@ -48,36 +48,36 @@ exports[`execute classes array types 1`] = ` amount: number; creditor: Addr; edgeId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { edit_edge: { amount, creditor, edge_id: edgeId } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeEdge = async ({ edgeId }: { edgeId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_edge: { edge_id: edgeId } - }, fee, memo, funds); + }, fee, memo, _funds); }; createGraph = async ({ graph }: { graph: Edge[]; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_graph: { graph } - }, fee, memo, funds); + }, fee, memo, _funds); }; createGraphSimplified = async ({ graph, @@ -85,13 +85,13 @@ exports[`execute classes array types 1`] = ` }: { graph: Addr[][]; graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_graph_simplified: { graph, graph_id: graphId } - }, fee, memo, funds); + }, fee, memo, _funds); }; editGraphSimplified = async ({ graph, @@ -99,89 +99,89 @@ exports[`execute classes array types 1`] = ` }: { graph: Addr[][]; graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { edit_graph_simplified: { graph, graph_id: graphId } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeGraph = async ({ graphId }: { graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_graph: { graph_id: graphId } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateEdges = async ({ edges }: { edges: number[][]; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_edges: { edges } - }, fee, memo, funds); + }, fee, memo, _funds); }; - findSavings = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + findSavings = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { find_savings: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; findSavingsInAGraph = async ({ graphId }: { graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { find_savings_in_a_graph: { graph_id: graphId } - }, fee, memo, funds); + }, fee, memo, _funds); }; - reset = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + reset = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { reset: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; saveNetworkToFile = async ({ filepath }: { filepath: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { save_network_to_file: { filepath } - }, fee, memo, funds); + }, fee, memo, _funds); }; createGraphFromFile = async ({ filepath }: { filepath: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_graph_from_file: { filepath } - }, fee, memo, funds); + }, fee, memo, _funds); }; applySetOffFromFile = async ({ filepath }: { filepath: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { apply_set_off_from_file: { filepath } - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; @@ -196,7 +196,7 @@ exports[`execute interfaces no extends 1`] = ` }: { amount: number; creditor: Addr; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; editEdge: ({ amount, creditor, @@ -205,63 +205,63 @@ exports[`execute interfaces no extends 1`] = ` amount: number; creditor: Addr; edgeId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; removeEdge: ({ edgeId }: { edgeId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; createGraph: ({ graph }: { graph: Edge[]; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; createGraphSimplified: ({ graph, graphId }: { graph: Addr[][]; graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; editGraphSimplified: ({ graph, graphId }: { graph: Addr[][]; graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; removeGraph: ({ graphId }: { graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; updateEdges: ({ edges }: { edges: number[][]; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - findSavings: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; + findSavings: (fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; findSavingsInAGraph: ({ graphId }: { graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - reset: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; + reset: (fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; saveNetworkToFile: ({ filepath }: { filepath: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; createGraphFromFile: ({ filepath }: { filepath: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; applySetOffFromFile: ({ filepath }: { filepath: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; }" `; diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.arrays.spec.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.arrays.spec.ts.snap index 911ff10a..6a8486b4 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.arrays.spec.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.arrays.spec.ts.snap @@ -25,7 +25,7 @@ exports[`execute classes array types 1`] = ` edges: number[][]; nested: number[][][]; supernested: string[][][][][][]; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_edges: { edges3, @@ -34,7 +34,7 @@ exports[`execute classes array types 1`] = ` nested, supernested } - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; @@ -55,7 +55,7 @@ exports[`execute interfaces no extends 1`] = ` edges: number[][]; nested: number[][][]; supernested: string[][][][][][]; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; }" `; diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.cw-named-groups.test.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.cw-named-groups.test.ts.snap index 9a28efbb..92121685 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.cw-named-groups.test.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.cw-named-groups.test.ts.snap @@ -23,36 +23,36 @@ exports[`execute classes array types 1`] = ` addressesToAdd?: string[]; addressesToRemove?: string[]; group: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update: { addresses_to_add: addressesToAdd, addresses_to_remove: addressesToRemove, group } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeGroup = async ({ group }: { group: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_group: { group } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateOwner = async ({ owner }: { owner: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_owner: { owner } - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; @@ -69,17 +69,17 @@ exports[`execute interfaces no extends 1`] = ` addressesToAdd?: string[]; addressesToRemove?: string[]; group: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; removeGroup: ({ group }: { group: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; updateOwner: ({ owner }: { owner: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; }" `; diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.cw-proposal-single.test.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.cw-proposal-single.test.ts.snap index 107b236e..034b1eb3 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.cw-proposal-single.test.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.cw-proposal-single.test.ts.snap @@ -29,14 +29,14 @@ exports[`execute classes array types 1`] = ` description: string; msgs: CosmosMsg_for_Empty[]; title: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { propose: { description, msgs, title } - }, fee, memo, funds); + }, fee, memo, _funds); }; vote = async ({ proposalId, @@ -44,35 +44,35 @@ exports[`execute classes array types 1`] = ` }: { proposalId: number; vote: Vote; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { vote: { proposal_id: proposalId, vote } - }, fee, memo, funds); + }, fee, memo, _funds); }; execute = async ({ proposalId }: { proposalId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { execute: { proposal_id: proposalId } - }, fee, memo, funds); + }, fee, memo, _funds); }; close = async ({ proposalId }: { proposalId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { close: { proposal_id: proposalId } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateConfig = async ({ allowRevoting, @@ -90,7 +90,7 @@ exports[`execute classes array types 1`] = ` minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { allow_revoting: allowRevoting, @@ -101,51 +101,51 @@ exports[`execute classes array types 1`] = ` only_members_execute: onlyMembersExecute, threshold } - }, fee, memo, funds); + }, fee, memo, _funds); }; addProposalHook = async ({ address }: { address: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_proposal_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeProposalHook = async ({ address }: { address: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_proposal_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; addVoteHook = async ({ address }: { address: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_vote_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeVoteHook = async ({ address }: { address: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_vote_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; @@ -162,24 +162,24 @@ exports[`execute interfaces no extends 1`] = ` description: string; msgs: CosmosMsg_for_Empty[]; title: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; execute: ({ proposalId }: { proposalId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; close: ({ proposalId }: { proposalId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; updateConfig: ({ allowRevoting, dao, @@ -196,27 +196,27 @@ exports[`execute interfaces no extends 1`] = ` minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; addProposalHook: ({ address }: { address: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; removeProposalHook: ({ address }: { address: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; addVoteHook: ({ address }: { address: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; removeVoteHook: ({ address }: { address: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; }" `; diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-101.spec.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-101.spec.ts.snap index 17159f90..1a480530 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-101.spec.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-101.spec.ts.snap @@ -8,8 +8,8 @@ exports[`execute interfaces no extends 1`] = ` newFactory }: { newFactory: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - updateOwnership: (action: Action, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; + updateOwnership: (action: Action, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; }" `; @@ -31,17 +31,17 @@ exports[`ownership client with tuple 1`] = ` newFactory }: { newFactory: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_factory: { new_factory: newFactory } - }, fee, memo, funds); + }, fee, memo, _funds); }; - updateOwnership = async (action: Action, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + updateOwnership = async (action: Action, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_ownership: action - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-71.test.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-71.test.ts.snap index 29fbf717..6d9321de 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-71.test.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-71.test.ts.snap @@ -30,14 +30,14 @@ exports[`execute class /issues/71/execute_msg.json 1`] = ` amount: Uint128; msg: Binary; sender: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { receive: { amount, msg, sender } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateConfig = async ({ feeCollector, @@ -47,14 +47,14 @@ exports[`execute class /issues/71/execute_msg.json 1`] = ` feeCollector?: string; generatorAddress?: string; lpTokenCodeId?: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { fee_collector: feeCollector, generator_address: generatorAddress, lp_token_code_id: lpTokenCodeId } - }, fee, memo, funds); + }, fee, memo, _funds); }; updatePoolConfig = async ({ isDisabled, @@ -64,25 +64,25 @@ exports[`execute class /issues/71/execute_msg.json 1`] = ` isDisabled?: boolean; newFeeInfo?: FeeInfo; poolType: PoolType; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_pool_config: { is_disabled: isDisabled, new_fee_info: newFeeInfo, pool_type: poolType } - }, fee, memo, funds); + }, fee, memo, _funds); }; addToRegistery = async ({ newPoolConfig }: { newPoolConfig: PoolConfig; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_to_registery: { new_pool_config: newPoolConfig } - }, fee, memo, funds); + }, fee, memo, _funds); }; createPoolInstance = async ({ assetInfos, @@ -96,7 +96,7 @@ exports[`execute class /issues/71/execute_msg.json 1`] = ` lpTokenName?: string; lpTokenSymbol?: string; poolType: PoolType; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_pool_instance: { asset_infos: assetInfos, @@ -105,7 +105,7 @@ exports[`execute class /issues/71/execute_msg.json 1`] = ` lp_token_symbol: lpTokenSymbol, pool_type: poolType } - }, fee, memo, funds); + }, fee, memo, _funds); }; joinPool = async ({ assets, @@ -121,7 +121,7 @@ exports[`execute class /issues/71/execute_msg.json 1`] = ` poolId: Uint128; recipient?: string; slippageTolerance?: Decimal; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { join_pool: { assets, @@ -131,7 +131,7 @@ exports[`execute class /issues/71/execute_msg.json 1`] = ` recipient, slippage_tolerance: slippageTolerance } - }, fee, memo, funds); + }, fee, memo, _funds); }; swap = async ({ recipient, @@ -139,13 +139,13 @@ exports[`execute class /issues/71/execute_msg.json 1`] = ` }: { recipient?: string; swapRequest: SingleSwapRequest; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { swap: { recipient, swap_request: swapRequest } - }, fee, memo, funds); + }, fee, memo, _funds); }; proposeNewOwner = async ({ expiresIn, @@ -153,23 +153,23 @@ exports[`execute class /issues/71/execute_msg.json 1`] = ` }: { expiresIn: number; owner: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { propose_new_owner: { expires_in: expiresIn, owner } - }, fee, memo, funds); + }, fee, memo, _funds); }; - dropOwnershipProposal = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + dropOwnershipProposal = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { drop_ownership_proposal: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; - claimOwnership = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + claimOwnership = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { claim_ownership: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; @@ -186,7 +186,7 @@ exports[`execute interface /issues/71/execute_msg.json 1`] = ` amount: Uint128; msg: Binary; sender: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; updateConfig: ({ feeCollector, generatorAddress, @@ -195,7 +195,7 @@ exports[`execute interface /issues/71/execute_msg.json 1`] = ` feeCollector?: string; generatorAddress?: string; lpTokenCodeId?: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; updatePoolConfig: ({ isDisabled, newFeeInfo, @@ -204,12 +204,12 @@ exports[`execute interface /issues/71/execute_msg.json 1`] = ` isDisabled?: boolean; newFeeInfo?: FeeInfo; poolType: PoolType; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; addToRegistery: ({ newPoolConfig }: { newPoolConfig: PoolConfig; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; createPoolInstance: ({ assetInfos, initParams, @@ -222,7 +222,7 @@ exports[`execute interface /issues/71/execute_msg.json 1`] = ` lpTokenName?: string; lpTokenSymbol?: string; poolType: PoolType; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; joinPool: ({ assets, autoStake, @@ -237,23 +237,23 @@ exports[`execute interface /issues/71/execute_msg.json 1`] = ` poolId: Uint128; recipient?: string; slippageTolerance?: Decimal; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; swap: ({ recipient, swapRequest }: { recipient?: string; swapRequest: SingleSwapRequest; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; proposeNewOwner: ({ expiresIn, owner }: { expiresIn: number; owner: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - dropOwnershipProposal: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - claimOwnership: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; + dropOwnershipProposal: (fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; + claimOwnership: (fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; }" `; diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-98.test.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-98.test.ts.snap index 2ec7781f..b3e4ecb2 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-98.test.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issue-98.test.ts.snap @@ -15,10 +15,10 @@ exports[`execute classes array types 1`] = ` this.getPluginById = this.getPluginById.bind(this); } - getConfig = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + getConfig = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_config: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; getPlugins = async ({ limit, @@ -26,24 +26,24 @@ exports[`execute classes array types 1`] = ` }: { limit?: number; startAfter?: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_plugins: { limit, start_after: startAfter } - }, fee, memo, funds); + }, fee, memo, _funds); }; getPluginById = async ({ id }: { id: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_plugin_by_id: { id } - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; @@ -52,19 +52,19 @@ exports[`execute interfaces no extends 1`] = ` "export interface SG721Instance { contractAddress: string; sender: string; - getConfig: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + getConfig: (fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; getPlugins: ({ limit, startAfter }: { limit?: number; startAfter?: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; getPluginById: ({ id }: { id: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; }" `; diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issues.test.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issues.test.ts.snap index 583d6b99..590aac7f 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issues.test.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.issues.test.ts.snap @@ -77,13 +77,13 @@ exports[`execute class /issues/55/execute_msg.json 1`] = ` }: { amount: number; creditor: Addr; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_edge: { amount, creditor } - }, fee, memo, funds); + }, fee, memo, _funds); }; editEdge = async ({ amount, @@ -93,36 +93,36 @@ exports[`execute class /issues/55/execute_msg.json 1`] = ` amount: number; creditor: Addr; edgeId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { edit_edge: { amount, creditor, edge_id: edgeId } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeEdge = async ({ edgeId }: { edgeId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_edge: { edge_id: edgeId } - }, fee, memo, funds); + }, fee, memo, _funds); }; createGraph = async ({ graph }: { graph: Edge[]; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_graph: { graph } - }, fee, memo, funds); + }, fee, memo, _funds); }; createGraphSimplified = async ({ graph, @@ -130,13 +130,13 @@ exports[`execute class /issues/55/execute_msg.json 1`] = ` }: { graph: Addr[][]; graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_graph_simplified: { graph, graph_id: graphId } - }, fee, memo, funds); + }, fee, memo, _funds); }; editGraphSimplified = async ({ graph, @@ -144,89 +144,89 @@ exports[`execute class /issues/55/execute_msg.json 1`] = ` }: { graph: Addr[][]; graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { edit_graph_simplified: { graph, graph_id: graphId } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeGraph = async ({ graphId }: { graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_graph: { graph_id: graphId } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateEdges = async ({ edges }: { edges: number[][]; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_edges: { edges } - }, fee, memo, funds); + }, fee, memo, _funds); }; - findSavings = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + findSavings = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { find_savings: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; findSavingsInAGraph = async ({ graphId }: { graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { find_savings_in_a_graph: { graph_id: graphId } - }, fee, memo, funds); + }, fee, memo, _funds); }; - reset = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + reset = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { reset: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; saveNetworkToFile = async ({ filepath }: { filepath: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { save_network_to_file: { filepath } - }, fee, memo, funds); + }, fee, memo, _funds); }; createGraphFromFile = async ({ filepath }: { filepath: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_graph_from_file: { filepath } - }, fee, memo, funds); + }, fee, memo, _funds); }; applySetOffFromFile = async ({ filepath }: { filepath: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { apply_set_off_from_file: { filepath } - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; @@ -285,113 +285,113 @@ exports[`execute class /issues/55/query_msg.json 1`] = ` this.getTotalDebt = this.getTotalDebt.bind(this); } - getDenom = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + getDenom = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_denom: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; - getOwner = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + getOwner = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_owner: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; - allEdges = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + allEdges = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { all_edges: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; oneEdge = async ({ edgeId }: { edgeId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { one_edge: { edge_id: edgeId } - }, fee, memo, funds); + }, fee, memo, _funds); }; oneBatch = async ({ batchId }: { batchId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { one_batch: { batch_id: batchId } - }, fee, memo, funds); + }, fee, memo, _funds); }; oneGraph = async ({ graphId }: { graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { one_graph: { graph_id: graphId } - }, fee, memo, funds); + }, fee, memo, _funds); }; getEdgesByAddress = async ({ address }: { address: Addr; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_edges_by_address: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; getEdgesAsCounterparty = async ({ address }: { address: Addr; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_edges_as_counterparty: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; getTotalDebtPerAddress = async ({ address }: { address: Addr; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_total_debt_per_address: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; getTotalCreditPerAddress = async ({ address }: { address: Addr; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_total_credit_per_address: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; getTotalDebtByGraph = async ({ graphId }: { graphId: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_total_debt_by_graph: { graph_id: graphId } - }, fee, memo, funds); + }, fee, memo, _funds); }; - getTotalDebt = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + getTotalDebt = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_total_debt: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; @@ -427,7 +427,7 @@ exports[`execute interface /issues/55/execute_msg.json 1`] = ` }: { amount: number; creditor: Addr; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; editEdge: ({ amount, creditor, @@ -436,63 +436,63 @@ exports[`execute interface /issues/55/execute_msg.json 1`] = ` amount: number; creditor: Addr; edgeId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; removeEdge: ({ edgeId }: { edgeId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; createGraph: ({ graph }: { graph: Edge[]; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; createGraphSimplified: ({ graph, graphId }: { graph: Addr[][]; graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; editGraphSimplified: ({ graph, graphId }: { graph: Addr[][]; graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; removeGraph: ({ graphId }: { graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; updateEdges: ({ edges }: { edges: number[][]; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - findSavings: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; + findSavings: (fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; findSavingsInAGraph: ({ graphId }: { graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - reset: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; + reset: (fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; saveNetworkToFile: ({ filepath }: { filepath: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; createGraphFromFile: ({ filepath }: { filepath: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; applySetOffFromFile: ({ filepath }: { filepath: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; }" `; @@ -514,50 +514,50 @@ exports[`execute interface /issues/55/query_msg.json 1`] = ` "export interface SG721Instance { contractAddress: string; sender: string; - getDenom: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - getOwner: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - allEdges: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + getDenom: (fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; + getOwner: (fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; + allEdges: (fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; oneEdge: ({ edgeId }: { edgeId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; oneBatch: ({ batchId }: { batchId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; oneGraph: ({ graphId }: { graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; getEdgesByAddress: ({ address }: { address: Addr; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; getEdgesAsCounterparty: ({ address }: { address: Addr; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; getTotalDebtPerAddress: ({ address }: { address: Addr; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; getTotalCreditPerAddress: ({ address }: { address: Addr; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; getTotalDebtByGraph: ({ graphId }: { graphId: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - getTotalDebt: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; + getTotalDebt: (fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; }" `; diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.overrides.spec.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.overrides.spec.ts.snap index 0993ff62..66212ac8 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.overrides.spec.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.overrides.spec.ts.snap @@ -27,13 +27,13 @@ exports[`Impl, execExtends, ExtendsClass 1`] = ` }: { recipient: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; sendNft = async ({ contract, @@ -43,14 +43,14 @@ exports[`Impl, execExtends, ExtendsClass 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, msg, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approve = async ({ expires, @@ -60,14 +60,14 @@ exports[`Impl, execExtends, ExtendsClass 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; revoke = async ({ spender, @@ -75,13 +75,13 @@ exports[`Impl, execExtends, ExtendsClass 1`] = ` }: { spender: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approveAll = async ({ expires, @@ -89,24 +89,24 @@ exports[`Impl, execExtends, ExtendsClass 1`] = ` }: { expires?: Expiration; operator: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, operator } - }, fee, memo, funds); + }, fee, memo, _funds); }; revokeAll = async ({ operator }: { operator: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator } - }, fee, memo, funds); + }, fee, memo, _funds); }; mint = async ({ extension, @@ -118,7 +118,7 @@ exports[`Impl, execExtends, ExtendsClass 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -126,18 +126,18 @@ exports[`Impl, execExtends, ExtendsClass 1`] = ` token_id: tokenId, token_uri: tokenUri } - }, fee, memo, funds); + }, fee, memo, _funds); }; burn = async ({ tokenId }: { tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; @@ -168,13 +168,13 @@ exports[`Impl, execExtends, noExtendsClass 1`] = ` }: { recipient: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; sendNft = async ({ contract, @@ -184,14 +184,14 @@ exports[`Impl, execExtends, noExtendsClass 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, msg, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approve = async ({ expires, @@ -201,14 +201,14 @@ exports[`Impl, execExtends, noExtendsClass 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; revoke = async ({ spender, @@ -216,13 +216,13 @@ exports[`Impl, execExtends, noExtendsClass 1`] = ` }: { spender: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approveAll = async ({ expires, @@ -230,24 +230,24 @@ exports[`Impl, execExtends, noExtendsClass 1`] = ` }: { expires?: Expiration; operator: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, operator } - }, fee, memo, funds); + }, fee, memo, _funds); }; revokeAll = async ({ operator }: { operator: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator } - }, fee, memo, funds); + }, fee, memo, _funds); }; mint = async ({ extension, @@ -259,7 +259,7 @@ exports[`Impl, execExtends, noExtendsClass 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -267,18 +267,18 @@ exports[`Impl, execExtends, noExtendsClass 1`] = ` token_id: tokenId, token_uri: tokenUri } - }, fee, memo, funds); + }, fee, memo, _funds); }; burn = async ({ tokenId }: { tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; @@ -310,13 +310,13 @@ exports[`noImpl, execExtends, ExtendsClass 1`] = ` }: { recipient: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; sendNft = async ({ contract, @@ -326,14 +326,14 @@ exports[`noImpl, execExtends, ExtendsClass 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, msg, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approve = async ({ expires, @@ -343,14 +343,14 @@ exports[`noImpl, execExtends, ExtendsClass 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; revoke = async ({ spender, @@ -358,13 +358,13 @@ exports[`noImpl, execExtends, ExtendsClass 1`] = ` }: { spender: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approveAll = async ({ expires, @@ -372,24 +372,24 @@ exports[`noImpl, execExtends, ExtendsClass 1`] = ` }: { expires?: Expiration; operator: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, operator } - }, fee, memo, funds); + }, fee, memo, _funds); }; revokeAll = async ({ operator }: { operator: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator } - }, fee, memo, funds); + }, fee, memo, _funds); }; mint = async ({ extension, @@ -401,7 +401,7 @@ exports[`noImpl, execExtends, ExtendsClass 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -409,18 +409,18 @@ exports[`noImpl, execExtends, ExtendsClass 1`] = ` token_id: tokenId, token_uri: tokenUri } - }, fee, memo, funds); + }, fee, memo, _funds); }; burn = async ({ tokenId }: { tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; @@ -452,13 +452,13 @@ exports[`noImpl, noExecExtends, ExtendsClass 1`] = ` }: { recipient: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; sendNft = async ({ contract, @@ -468,14 +468,14 @@ exports[`noImpl, noExecExtends, ExtendsClass 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, msg, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approve = async ({ expires, @@ -485,14 +485,14 @@ exports[`noImpl, noExecExtends, ExtendsClass 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; revoke = async ({ spender, @@ -500,13 +500,13 @@ exports[`noImpl, noExecExtends, ExtendsClass 1`] = ` }: { spender: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approveAll = async ({ expires, @@ -514,24 +514,24 @@ exports[`noImpl, noExecExtends, ExtendsClass 1`] = ` }: { expires?: Expiration; operator: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, operator } - }, fee, memo, funds); + }, fee, memo, _funds); }; revokeAll = async ({ operator }: { operator: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator } - }, fee, memo, funds); + }, fee, memo, _funds); }; mint = async ({ extension, @@ -543,7 +543,7 @@ exports[`noImpl, noExecExtends, ExtendsClass 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -551,18 +551,18 @@ exports[`noImpl, noExecExtends, ExtendsClass 1`] = ` token_id: tokenId, token_uri: tokenUri } - }, fee, memo, funds); + }, fee, memo, _funds); }; burn = async ({ tokenId }: { tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; @@ -593,13 +593,13 @@ exports[`noImpl, noExecExtends, noExtendsClass 1`] = ` }: { recipient: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; sendNft = async ({ contract, @@ -609,14 +609,14 @@ exports[`noImpl, noExecExtends, noExtendsClass 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, msg, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approve = async ({ expires, @@ -626,14 +626,14 @@ exports[`noImpl, noExecExtends, noExtendsClass 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; revoke = async ({ spender, @@ -641,13 +641,13 @@ exports[`noImpl, noExecExtends, noExtendsClass 1`] = ` }: { spender: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approveAll = async ({ expires, @@ -655,24 +655,24 @@ exports[`noImpl, noExecExtends, noExtendsClass 1`] = ` }: { expires?: Expiration; operator: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, operator } - }, fee, memo, funds); + }, fee, memo, _funds); }; revokeAll = async ({ operator }: { operator: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator } - }, fee, memo, funds); + }, fee, memo, _funds); }; mint = async ({ extension, @@ -684,7 +684,7 @@ exports[`noImpl, noExecExtends, noExtendsClass 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -692,18 +692,18 @@ exports[`noImpl, noExecExtends, noExtendsClass 1`] = ` token_id: tokenId, token_uri: tokenUri } - }, fee, memo, funds); + }, fee, memo, _funds); }; burn = async ({ tokenId }: { tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.sg721.spec.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.sg721.spec.ts.snap index f28e0e0e..92b55319 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.sg721.spec.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.sg721.spec.ts.snap @@ -26,13 +26,13 @@ exports[`execute classes array types 1`] = ` }: { recipient: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; sendNft = async ({ contract, @@ -42,14 +42,14 @@ exports[`execute classes array types 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, msg, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approve = async ({ expires, @@ -59,14 +59,14 @@ exports[`execute classes array types 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; revoke = async ({ spender, @@ -74,13 +74,13 @@ exports[`execute classes array types 1`] = ` }: { spender: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approveAll = async ({ expires, @@ -88,24 +88,24 @@ exports[`execute classes array types 1`] = ` }: { expires?: Expiration; operator: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, operator } - }, fee, memo, funds); + }, fee, memo, _funds); }; revokeAll = async ({ operator }: { operator: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator } - }, fee, memo, funds); + }, fee, memo, _funds); }; mint = async ({ extension, @@ -117,7 +117,7 @@ exports[`execute classes array types 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -125,18 +125,18 @@ exports[`execute classes array types 1`] = ` token_id: tokenId, token_uri: tokenUri } - }, fee, memo, funds); + }, fee, memo, _funds); }; burn = async ({ tokenId }: { tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; @@ -151,7 +151,7 @@ exports[`execute interfaces no extends 1`] = ` }: { recipient: string; tokenId: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; sendNft: ({ contract, msg, @@ -160,7 +160,7 @@ exports[`execute interfaces no extends 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; approve: ({ expires, spender, @@ -169,26 +169,26 @@ exports[`execute interfaces no extends 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; revoke: ({ spender, tokenId }: { spender: string; tokenId: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; approveAll: ({ expires, operator }: { expires?: Expiration; operator: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; revokeAll: ({ operator }: { operator: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; mint: ({ extension, owner, @@ -199,12 +199,12 @@ exports[`execute interfaces no extends 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; burn: ({ tokenId }: { tokenId: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; }" `; diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.spec.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.spec.ts.snap index 761ca3cc..a70c59a9 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.spec.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.spec.ts.snap @@ -63,13 +63,13 @@ exports[`execute classes 1`] = ` }: { recipient: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; sendNft = async ({ contract, @@ -79,14 +79,14 @@ exports[`execute classes 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, msg, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approve = async ({ expires, @@ -96,14 +96,14 @@ exports[`execute classes 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; revoke = async ({ spender, @@ -111,13 +111,13 @@ exports[`execute classes 1`] = ` }: { spender: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approveAll = async ({ expires, @@ -125,24 +125,24 @@ exports[`execute classes 1`] = ` }: { expires?: Expiration; operator: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, operator } - }, fee, memo, funds); + }, fee, memo, _funds); }; revokeAll = async ({ operator }: { operator: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator } - }, fee, memo, funds); + }, fee, memo, _funds); }; mint = async ({ extension, @@ -154,7 +154,7 @@ exports[`execute classes 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -162,18 +162,18 @@ exports[`execute classes 1`] = ` token_id: tokenId, token_uri: tokenUri } - }, fee, memo, funds); + }, fee, memo, _funds); }; burn = async ({ tokenId }: { tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; @@ -201,36 +201,36 @@ exports[`execute classes array types 1`] = ` addressesToAdd?: string[]; addressesToRemove?: string[]; group: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update: { addresses_to_add: addressesToAdd, addresses_to_remove: addressesToRemove, group } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeGroup = async ({ group }: { group: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_group: { group } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateOwner = async ({ owner }: { owner: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_owner: { owner } - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; @@ -261,13 +261,13 @@ exports[`execute classes no extends 1`] = ` }: { recipient: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; sendNft = async ({ contract, @@ -277,14 +277,14 @@ exports[`execute classes no extends 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, msg, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approve = async ({ expires, @@ -294,14 +294,14 @@ exports[`execute classes no extends 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; revoke = async ({ spender, @@ -309,13 +309,13 @@ exports[`execute classes no extends 1`] = ` }: { spender: string; tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approveAll = async ({ expires, @@ -323,24 +323,24 @@ exports[`execute classes no extends 1`] = ` }: { expires?: Expiration; operator: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, operator } - }, fee, memo, funds); + }, fee, memo, _funds); }; revokeAll = async ({ operator }: { operator: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator } - }, fee, memo, funds); + }, fee, memo, _funds); }; mint = async ({ extension, @@ -352,7 +352,7 @@ exports[`execute classes no extends 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -360,18 +360,18 @@ exports[`execute classes no extends 1`] = ` token_id: tokenId, token_uri: tokenUri } - }, fee, memo, funds); + }, fee, memo, _funds); }; burn = async ({ tokenId }: { tokenId: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; @@ -386,7 +386,7 @@ exports[`execute interfaces no extends 1`] = ` }: { recipient: string; tokenId: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; sendNft: ({ contract, msg, @@ -395,7 +395,7 @@ exports[`execute interfaces no extends 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; approve: ({ expires, spender, @@ -404,26 +404,26 @@ exports[`execute interfaces no extends 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; revoke: ({ spender, tokenId }: { spender: string; tokenId: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; approveAll: ({ expires, operator }: { expires?: Expiration; operator: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; revokeAll: ({ operator }: { operator: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; mint: ({ extension, owner, @@ -434,12 +434,12 @@ exports[`execute interfaces no extends 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; burn: ({ tokenId }: { tokenId: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; }" `; diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.vectis.spec.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.vectis.spec.ts.snap index e2b809bf..9810be84 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.vectis.spec.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.vectis.spec.ts.snap @@ -32,61 +32,61 @@ exports[`execute classes array types 1`] = ` msgs }: { msgs: CosmosMsg_for_Empty[]; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { execute: { msgs } - }, fee, memo, funds); + }, fee, memo, _funds); }; - revertFreezeStatus = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + revertFreezeStatus = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revert_freeze_status: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; relay = async ({ transaction }: { transaction: RelayTransaction; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { relay: { transaction } - }, fee, memo, funds); + }, fee, memo, _funds); }; rotateUserKey = async ({ newUserAddress }: { newUserAddress: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { rotate_user_key: { new_user_address: newUserAddress } - }, fee, memo, funds); + }, fee, memo, _funds); }; addRelayer = async ({ newRelayerAddress }: { newRelayerAddress: Addr; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_relayer: { new_relayer_address: newRelayerAddress } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeRelayer = async ({ relayerAddress }: { relayerAddress: Addr; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_relayer: { relayer_address: relayerAddress } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateGuardians = async ({ guardians, @@ -94,24 +94,24 @@ exports[`execute classes array types 1`] = ` }: { guardians: Guardians; newMultisigCodeId?: number; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_guardians: { guardians, new_multisig_code_id: newMultisigCodeId } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateLabel = async ({ newLabel }: { newLabel: string; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_label: { new_label: newLabel } - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; @@ -124,40 +124,40 @@ exports[`execute interfaces no extends 1`] = ` msgs }: { msgs: CosmosMsg_for_Empty[]; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; - revertFreezeStatus: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; + revertFreezeStatus: (fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; relay: ({ transaction }: { transaction: RelayTransaction; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; rotateUserKey: ({ newUserAddress }: { newUserAddress: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; addRelayer: ({ newRelayerAddress }: { newRelayerAddress: Addr; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; removeRelayer: ({ relayerAddress }: { relayerAddress: Addr; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; updateGuardians: ({ guardians, newMultisigCodeId }: { guardians: Guardians; newMultisigCodeId?: number; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; updateLabel: ({ newLabel }: { newLabel: string; - }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | \\"auto\\", memo?: string, _funds?: Coin[]) => Promise; }" `; diff --git a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.wager.spec.ts.snap b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.wager.spec.ts.snap index 7e9bf03d..8d311888 100644 --- a/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.wager.spec.ts.snap +++ b/packages/wasm-ast-types/src/client/test/__snapshots__/ts-client.wager.spec.ts.snap @@ -22,12 +22,12 @@ exports[`execute classes 1`] = ` params }: { params: ParamInfo; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { params } - }, fee, memo, funds); + }, fee, memo, _funds); }; setWinner = async ({ currentPrices, @@ -37,14 +37,14 @@ exports[`execute classes 1`] = ` currentPrices: number[][]; prevPrices: number[][]; wagerKey: Addr[][]; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_winner: { current_prices: currentPrices, prev_prices: prevPrices, wager_key: wagerKey } - }, fee, memo, funds); + }, fee, memo, _funds); }; wager = async ({ againstCurrencies, @@ -56,7 +56,7 @@ exports[`execute classes 1`] = ` currency: Currency; expiry: number; token: Addr[][]; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { wager: { against_currencies: againstCurrencies, @@ -64,18 +64,18 @@ exports[`execute classes 1`] = ` expiry, token } - }, fee, memo, funds); + }, fee, memo, _funds); }; cancel = async ({ token }: { token: Addr[][]; - }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { cancel: { token } - }, fee, memo, funds); + }, fee, memo, _funds); }; }" `; diff --git a/packages/wasm-ast-types/src/message-composer/message-composer.ts b/packages/wasm-ast-types/src/message-composer/message-composer.ts index 0c1a5eeb..99ad1f64 100644 --- a/packages/wasm-ast-types/src/message-composer/message-composer.ts +++ b/packages/wasm-ast-types/src/message-composer/message-composer.ts @@ -1,26 +1,19 @@ import * as t from '@babel/types'; +import { Expression } from '@babel/types'; import { camel } from 'case'; import { + arrowFunctionExpression, bindMethod, - typedIdentifier, classDeclaration, classProperty, - arrowFunctionExpression, - getMessageProperties + getMessageProperties, + OPTIONAL_FUNDS_PARAM, + typedIdentifier } from '../utils'; -import { ExecuteMsg } from '../types'; +import { ExecuteMsg, JSONSchema } from '../types'; import { createTypedObjectParams } from '../utils/types'; -import { JSONSchema } from '../types'; import { RenderContext } from '../context'; -import { identifier } from '../utils/babel'; import { getWasmMethodArgs } from '../client/client'; -import { Expression } from '@babel/types'; - -const OPTIONAL_FUNDS = identifier( - '_funds', - t.tsTypeAnnotation(t.tsArrayType(t.tsTypeReference(t.identifier('Coin')))), - true -); const createWasmExecMethodMessageComposer = ( context: RenderContext, @@ -50,7 +43,7 @@ const createWasmExecMethodMessageComposer = ( actionValue = t.objectExpression(args); } - const constantParams = [OPTIONAL_FUNDS]; + const constantParams = [OPTIONAL_FUNDS_PARAM]; return t.classProperty( t.identifier(methodName), @@ -250,7 +243,7 @@ const createPropertyFunctionWithObjectParamsForMessageComposer = ( jsonschema: JSONSchema ) => { const obj = createTypedObjectParams(context, jsonschema); - const fixedParams = [OPTIONAL_FUNDS]; + const fixedParams = [OPTIONAL_FUNDS_PARAM]; const func = { type: 'TSFunctionType', typeAnnotation: t.tsTypeAnnotation( diff --git a/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap b/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap index 0da3f360..6f0a3ecb 100644 --- a/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap +++ b/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap @@ -1133,7 +1133,7 @@ exports[`createReactQueryHooks 6`] = ` args?: { fee?: number | StdFee | \\"auto\\"; memo?: string; - funds?: Coin[]; + _funds?: Coin[]; }; } export function useSg721BurnMutation(options?: Omit, \\"mutationFn\\">) { @@ -1143,9 +1143,9 @@ export function useSg721BurnMutation(options?: Omit client.burn(msg, fee, memo, funds), options); + }) => client.burn(msg, fee, memo, _funds), options); } export interface Sg721MintMutation { client: Sg721Client; @@ -1158,7 +1158,7 @@ export interface Sg721MintMutation { args?: { fee?: number | StdFee | \\"auto\\"; memo?: string; - funds?: Coin[]; + _funds?: Coin[]; }; } export function useSg721MintMutation(options?: Omit, \\"mutationFn\\">) { @@ -1168,9 +1168,9 @@ export function useSg721MintMutation(options?: Omit client.mint(msg, fee, memo, funds), options); + }) => client.mint(msg, fee, memo, _funds), options); } export interface Sg721RevokeAllMutation { client: Sg721Client; @@ -1180,7 +1180,7 @@ export interface Sg721RevokeAllMutation { args?: { fee?: number | StdFee | \\"auto\\"; memo?: string; - funds?: Coin[]; + _funds?: Coin[]; }; } export function useSg721RevokeAllMutation(options?: Omit, \\"mutationFn\\">) { @@ -1190,9 +1190,9 @@ export function useSg721RevokeAllMutation(options?: Omit client.revokeAll(msg, fee, memo, funds), options); + }) => client.revokeAll(msg, fee, memo, _funds), options); } export interface Sg721ApproveAllMutation { client: Sg721Client; @@ -1203,7 +1203,7 @@ export interface Sg721ApproveAllMutation { args?: { fee?: number | StdFee | \\"auto\\"; memo?: string; - funds?: Coin[]; + _funds?: Coin[]; }; } export function useSg721ApproveAllMutation(options?: Omit, \\"mutationFn\\">) { @@ -1213,9 +1213,9 @@ export function useSg721ApproveAllMutation(options?: Omit client.approveAll(msg, fee, memo, funds), options); + }) => client.approveAll(msg, fee, memo, _funds), options); } export interface Sg721RevokeMutation { client: Sg721Client; @@ -1226,7 +1226,7 @@ export interface Sg721RevokeMutation { args?: { fee?: number | StdFee | \\"auto\\"; memo?: string; - funds?: Coin[]; + _funds?: Coin[]; }; } export function useSg721RevokeMutation(options?: Omit, \\"mutationFn\\">) { @@ -1236,9 +1236,9 @@ export function useSg721RevokeMutation(options?: Omit client.revoke(msg, fee, memo, funds), options); + }) => client.revoke(msg, fee, memo, _funds), options); } export interface Sg721ApproveMutation { client: Sg721Client; @@ -1250,7 +1250,7 @@ export interface Sg721ApproveMutation { args?: { fee?: number | StdFee | \\"auto\\"; memo?: string; - funds?: Coin[]; + _funds?: Coin[]; }; } export function useSg721ApproveMutation(options?: Omit, \\"mutationFn\\">) { @@ -1260,9 +1260,9 @@ export function useSg721ApproveMutation(options?: Omit client.approve(msg, fee, memo, funds), options); + }) => client.approve(msg, fee, memo, _funds), options); } export interface Sg721SendNftMutation { client: Sg721Client; @@ -1274,7 +1274,7 @@ export interface Sg721SendNftMutation { args?: { fee?: number | StdFee | \\"auto\\"; memo?: string; - funds?: Coin[]; + _funds?: Coin[]; }; } export function useSg721SendNftMutation(options?: Omit, \\"mutationFn\\">) { @@ -1284,9 +1284,9 @@ export function useSg721SendNftMutation(options?: Omit client.sendNft(msg, fee, memo, funds), options); + }) => client.sendNft(msg, fee, memo, _funds), options); } export interface Sg721TransferNftMutation { client: Sg721Client; @@ -1297,7 +1297,7 @@ export interface Sg721TransferNftMutation { args?: { fee?: number | StdFee | \\"auto\\"; memo?: string; - funds?: Coin[]; + _funds?: Coin[]; }; } export function useSg721TransferNftMutation(options?: Omit, \\"mutationFn\\">) { @@ -1307,9 +1307,9 @@ export function useSg721TransferNftMutation(options?: Omit client.transferNft(msg, fee, memo, funds), options); + }) => client.transferNft(msg, fee, memo, _funds), options); }" `; @@ -1320,7 +1320,7 @@ exports[`ownership 1`] = ` args?: { fee?: number | StdFee | \\"auto\\"; memo?: string; - funds?: Coin[]; + _funds?: Coin[]; }; } export function useOwnershipUpdateOwnershipMutation(options?: Omit, \\"mutationFn\\">) { @@ -1330,9 +1330,9 @@ export function useOwnershipUpdateOwnershipMutation(options?: Omit client.updateOwnership(msg, fee, memo, funds), options); + }) => client.updateOwnership(msg, fee, memo, _funds), options); } export interface OwnershipSetFactoryMutation { client: OwnershipClient; @@ -1342,7 +1342,7 @@ export interface OwnershipSetFactoryMutation { args?: { fee?: number | StdFee | \\"auto\\"; memo?: string; - funds?: Coin[]; + _funds?: Coin[]; }; } export function useOwnershipSetFactoryMutation(options?: Omit, \\"mutationFn\\">) { @@ -1352,8 +1352,8 @@ export function useOwnershipSetFactoryMutation(options?: Omit client.setFactory(msg, fee, memo, funds), options); + }) => client.setFactory(msg, fee, memo, _funds), options); }" `; diff --git a/packages/wasm-ast-types/src/react-query/react-query.ts b/packages/wasm-ast-types/src/react-query/react-query.ts index 29ddc4cb..167db1ca 100644 --- a/packages/wasm-ast-types/src/react-query/react-query.ts +++ b/packages/wasm-ast-types/src/react-query/react-query.ts @@ -4,7 +4,7 @@ import { camel, pascal } from 'case'; import { ExecuteMsg, QueryMsg } from '../types'; import { callExpression, - createTypedObjectParams, + createTypedObjectParams, FIXED_EXECUTE_PARAMS, getMessageProperties, identifier, tsObjectPattern, @@ -24,7 +24,6 @@ import { } from '../utils/types'; import { ReactQueryOptions, RenderContext } from '../context'; import { JSONSchema } from '../types'; -import { FIXED_EXECUTE_PARAMS } from '../client'; import { ArrowFunctionExpression, objectExpression } from '@babel/types'; interface ReactQueryHookQuery { diff --git a/packages/wasm-ast-types/src/utils/constants.ts b/packages/wasm-ast-types/src/utils/constants.ts new file mode 100644 index 00000000..46122904 --- /dev/null +++ b/packages/wasm-ast-types/src/utils/constants.ts @@ -0,0 +1,23 @@ +import { identifier } from './babel'; +import * as t from '@babel/types'; + +export const OPTIONAL_FUNDS_PARAM = identifier( + '_funds', + t.tsTypeAnnotation(t.tsArrayType(t.tsTypeReference(t.identifier('Coin')))), + true +); +export const FIXED_EXECUTE_PARAMS = [ + identifier( + 'fee', + t.tsTypeAnnotation( + t.tsUnionType([ + t.tsNumberKeyword(), + t.tsTypeReference(t.identifier('StdFee')), + t.tsLiteralType(t.stringLiteral('auto')) + ]) + ), + true + ), + identifier('memo', t.tsTypeAnnotation(t.tsStringKeyword()), true), + OPTIONAL_FUNDS_PARAM +]; diff --git a/packages/wasm-ast-types/src/utils/index.ts b/packages/wasm-ast-types/src/utils/index.ts index 2e232599..aa3643b7 100644 --- a/packages/wasm-ast-types/src/utils/index.ts +++ b/packages/wasm-ast-types/src/utils/index.ts @@ -1,3 +1,5 @@ export * from './babel'; export * from './types'; export * from './ref'; +export { OPTIONAL_FUNDS_PARAM } from './constants'; +export { FIXED_EXECUTE_PARAMS } from './constants'; From 39b6ae2e72fd6a6ef23528b951dbbb1038666bfa Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Sun, 21 May 2023 14:37:13 +0300 Subject: [PATCH 111/287] Update ts-codegen tests --- __fixtures__/issues/98/out/98.client.ts | 36 +++++------ .../contracts/CwAdminFactory.client.ts | 6 +- .../contracts/CwCodeIdRegistry.client.ts | 30 +++++----- .../bundler_test/contracts/CwSingle.client.ts | 54 ++++++++--------- .../bundler_test/contracts/Factory.client.ts | 42 ++++++------- .../bundler_test/contracts/Minter.client.ts | 42 ++++++------- .../builder/default/CwAdminFactory.client.ts | 6 +- .../default/CwCodeIdRegistry.client.ts | 30 +++++----- __output__/builder/default/CwSingle.client.ts | 54 ++++++++--------- __output__/builder/default/Factory.client.ts | 42 ++++++------- __output__/builder/default/Minter.client.ts | 42 ++++++------- .../builder/invoke/CwAdminFactory.client.ts | 6 +- .../builder/invoke/CwCodeIdRegistry.client.ts | 30 +++++----- __output__/builder/invoke/CwSingle.client.ts | 54 ++++++++--------- __output__/builder/invoke/Factory.client.ts | 42 ++++++------- __output__/builder/invoke/Minter.client.ts | 42 ++++++------- .../no-extends/CwAdminFactory.client.ts | 6 +- .../no-extends/CwCodeIdRegistry.client.ts | 30 +++++----- .../builder/no-extends/CwSingle.client.ts | 54 ++++++++--------- .../builder/no-extends/Factory.client.ts | 42 ++++++------- .../builder/no-extends/Minter.client.ts | 42 ++++++------- .../cw-admin-factory/CwAdminFactory.client.ts | 6 +- .../CwCodeIdRegistry.client.ts | 30 +++++----- .../cw-named-groups/CwNamedGroups.client.ts | 18 +++--- .../CwProposalSingle.client.ts | 54 ++++++++--------- .../accounts-nft/AccountsNft.client.ts | 60 +++++++++---------- .../Cw3FixedMultiSig.client.ts | 24 ++++---- .../idl-version/cw4-group/Cw4Group.client.ts | 24 ++++---- .../idl-version/cyberpunk/CyberPunk.client.ts | 12 ++-- .../idl-version/hackatom/HackAtom.client.ts | 48 +++++++-------- __output__/minter/Minter.client.ts | 42 ++++++------- __output__/sg721/Sg721.client.ts | 48 +++++++-------- .../Factory.react-query.ts | 42 ++++++------- __output__/vectis/factory/Factory.client.ts | 42 ++++++------- __output__/vectis/govec/Govec.client.ts | 48 +++++++-------- __output__/vectis/proxy/Proxy.client.ts | 48 +++++++-------- yarn.lock | 10 ++++ 37 files changed, 649 insertions(+), 639 deletions(-) diff --git a/__fixtures__/issues/98/out/98.client.ts b/__fixtures__/issues/98/out/98.client.ts index b4e37f5b..a0e4740d 100644 --- a/__fixtures__/issues/98/out/98.client.ts +++ b/__fixtures__/issues/98/out/98.client.ts @@ -75,7 +75,7 @@ export interface 98Interface extends 98ReadOnlyInterface { }: { id: number; instantiateMsg: Binary; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; registerPlugin: ({ checksum, codeId, @@ -90,12 +90,12 @@ export interface 98Interface extends 98ReadOnlyInterface { ipfsHash: string; name: string; version: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; unregisterPlugin: ({ id }: { id: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updatePlugin: ({ checksum, codeId, @@ -112,17 +112,17 @@ export interface 98Interface extends 98ReadOnlyInterface { ipfsHash?: string; name?: string; version?: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateRegistryFee: ({ newFee }: { newFee: Coin; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateDaoAddr: ({ newAddr }: { newAddr: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class 98Client extends 98QueryClient implements 98Interface { client: SigningCosmWasmClient; @@ -148,13 +148,13 @@ export class 98Client extends 98QueryClient implements 98Interface { }: { id: number; instantiateMsg: Binary; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { proxy_install_plugin: { id, instantiate_msg: instantiateMsg } - }, fee, memo, funds); + }, fee, memo, _funds); }; registerPlugin = async ({ checksum, @@ -170,7 +170,7 @@ export class 98Client extends 98QueryClient implements 98Interface { ipfsHash: string; name: string; version: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { register_plugin: { checksum, @@ -180,18 +180,18 @@ export class 98Client extends 98QueryClient implements 98Interface { name, version } - }, fee, memo, funds); + }, fee, memo, _funds); }; unregisterPlugin = async ({ id }: { id: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { unregister_plugin: { id } - }, fee, memo, funds); + }, fee, memo, _funds); }; updatePlugin = async ({ checksum, @@ -209,7 +209,7 @@ export class 98Client extends 98QueryClient implements 98Interface { ipfsHash?: string; name?: string; version?: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_plugin: { checksum, @@ -220,28 +220,28 @@ export class 98Client extends 98QueryClient implements 98Interface { name, version } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateRegistryFee = async ({ newFee }: { newFee: Coin; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_registry_fee: { new_fee: newFee } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateDaoAddr = async ({ newAddr }: { newAddr: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_dao_addr: { new_addr: newAddr } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwAdminFactory.client.ts b/__output__/builder/bundler_test/contracts/CwAdminFactory.client.ts index 3194c8c0..edbba1e6 100644 --- a/__output__/builder/bundler_test/contracts/CwAdminFactory.client.ts +++ b/__output__/builder/bundler_test/contracts/CwAdminFactory.client.ts @@ -31,7 +31,7 @@ export interface CwAdminFactoryInterface { codeId: number; instantiateMsg: Binary; label: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class CwAdminFactoryClient implements CwAdminFactoryInterface { client: SigningCosmWasmClient; @@ -53,13 +53,13 @@ export class CwAdminFactoryClient implements CwAdminFactoryInterface { codeId: number; instantiateMsg: Binary; label: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { instantiate_contract_with_self_admin: { code_id: codeId, instantiate_msg: instantiateMsg, label } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.client.ts b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.client.ts index 59e6506b..d95b2ee4 100644 --- a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.client.ts +++ b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.client.ts @@ -109,7 +109,7 @@ export interface CwCodeIdRegistryInterface { amount: Uint128; msg: Binary; sender: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; register: ({ chainId, checksum, @@ -122,7 +122,7 @@ export interface CwCodeIdRegistryInterface { codeId: number; name: string; version: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; setOwner: ({ chainId, name, @@ -131,21 +131,21 @@ export interface CwCodeIdRegistryInterface { chainId: string; name: string; owner?: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; unregister: ({ chainId, codeId }: { chainId: string; codeId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateConfig: ({ admin, paymentInfo }: { admin?: string; paymentInfo?: PaymentInfo; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { client: SigningCosmWasmClient; @@ -171,14 +171,14 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { amount: Uint128; msg: Binary; sender: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { receive: { amount, msg, sender } - }, fee, memo, funds); + }, fee, memo, _funds); }; register = async ({ chainId, @@ -192,7 +192,7 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { codeId: number; name: string; version: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { register: { chain_id: chainId, @@ -201,7 +201,7 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { name, version } - }, fee, memo, funds); + }, fee, memo, _funds); }; setOwner = async ({ chainId, @@ -211,14 +211,14 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { chainId: string; name: string; owner?: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_owner: { chain_id: chainId, name, owner } - }, fee, memo, funds); + }, fee, memo, _funds); }; unregister = async ({ chainId, @@ -226,13 +226,13 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { }: { chainId: string; codeId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { unregister: { chain_id: chainId, code_id: codeId } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateConfig = async ({ admin, @@ -240,12 +240,12 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { }: { admin?: string; paymentInfo?: PaymentInfo; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { admin, payment_info: paymentInfo } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwSingle.client.ts b/__output__/builder/bundler_test/contracts/CwSingle.client.ts index 05c0dc73..62d3092c 100644 --- a/__output__/builder/bundler_test/contracts/CwSingle.client.ts +++ b/__output__/builder/bundler_test/contracts/CwSingle.client.ts @@ -176,24 +176,24 @@ export interface CwSingleInterface { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; execute: ({ proposalId }: { proposalId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; close: ({ proposalId }: { proposalId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateConfig: ({ allowRevoting, dao, @@ -210,27 +210,27 @@ export interface CwSingleInterface { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; addProposalHook: ({ address }: { address: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; removeProposalHook: ({ address }: { address: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; addVoteHook: ({ address }: { address: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; removeVoteHook: ({ address }: { address: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class CwSingleClient implements CwSingleInterface { client: SigningCosmWasmClient; @@ -260,14 +260,14 @@ export class CwSingleClient implements CwSingleInterface { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { propose: { description, msgs, title } - }, fee, memo, funds); + }, fee, memo, _funds); }; vote = async ({ proposalId, @@ -275,35 +275,35 @@ export class CwSingleClient implements CwSingleInterface { }: { proposalId: number; vote: Vote; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { vote: { proposal_id: proposalId, vote } - }, fee, memo, funds); + }, fee, memo, _funds); }; execute = async ({ proposalId }: { proposalId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { execute: { proposal_id: proposalId } - }, fee, memo, funds); + }, fee, memo, _funds); }; close = async ({ proposalId }: { proposalId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { close: { proposal_id: proposalId } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateConfig = async ({ allowRevoting, @@ -321,7 +321,7 @@ export class CwSingleClient implements CwSingleInterface { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { allow_revoting: allowRevoting, @@ -332,50 +332,50 @@ export class CwSingleClient implements CwSingleInterface { only_members_execute: onlyMembersExecute, threshold } - }, fee, memo, funds); + }, fee, memo, _funds); }; addProposalHook = async ({ address }: { address: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_proposal_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeProposalHook = async ({ address }: { address: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_proposal_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; addVoteHook = async ({ address }: { address: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_vote_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeVoteHook = async ({ address }: { address: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_vote_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Factory.client.ts b/__output__/builder/bundler_test/contracts/Factory.client.ts index 6e9897d6..8c545bda 100644 --- a/__output__/builder/bundler_test/contracts/Factory.client.ts +++ b/__output__/builder/bundler_test/contracts/Factory.client.ts @@ -114,43 +114,43 @@ export interface FactoryInterface { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateProxyUser: ({ newUser, oldUser }: { newUser: Addr; oldUser: Addr; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; migrateWallet: ({ migrationMsg, walletAddress }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateCodeId: ({ newCodeId, ty }: { newCodeId: number; ty: CodeIdType; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateWalletFee: ({ newFee }: { newFee: Coin; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateGovecAddr: ({ addr }: { addr: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateAdmin: ({ addr }: { addr: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class FactoryClient implements FactoryInterface { client: SigningCosmWasmClient; @@ -174,12 +174,12 @@ export class FactoryClient implements FactoryInterface { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_wallet: { create_wallet_msg: createWalletMsg } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateProxyUser = async ({ newUser, @@ -187,13 +187,13 @@ export class FactoryClient implements FactoryInterface { }: { newUser: Addr; oldUser: Addr; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_proxy_user: { new_user: newUser, old_user: oldUser } - }, fee, memo, funds); + }, fee, memo, _funds); }; migrateWallet = async ({ migrationMsg, @@ -201,13 +201,13 @@ export class FactoryClient implements FactoryInterface { }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { migrate_wallet: { migration_msg: migrationMsg, wallet_address: walletAddress } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateCodeId = async ({ newCodeId, @@ -215,45 +215,45 @@ export class FactoryClient implements FactoryInterface { }: { newCodeId: number; ty: CodeIdType; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_code_id: { new_code_id: newCodeId, ty } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateWalletFee = async ({ newFee }: { newFee: Coin; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_wallet_fee: { new_fee: newFee } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateGovecAddr = async ({ addr }: { addr: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_govec_addr: { addr } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateAdmin = async ({ addr }: { addr: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_admin: { addr } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Minter.client.ts b/__output__/builder/bundler_test/contracts/Minter.client.ts index deffa10a..6901674a 100644 --- a/__output__/builder/bundler_test/contracts/Minter.client.ts +++ b/__output__/builder/bundler_test/contracts/Minter.client.ts @@ -68,31 +68,31 @@ export class MinterQueryClient implements MinterReadOnlyInterface { export interface MinterInterface { contractAddress: string; sender: string; - mint: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + mint: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; setWhitelist: ({ whitelist }: { whitelist: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - updateStartTime: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateStartTime: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updatePerAddressLimit: ({ perAddressLimit }: { perAddressLimit: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; mintTo: ({ recipient }: { recipient: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; mintFor: ({ recipient, tokenId }: { recipient: string; tokenId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - withdraw: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdraw: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class MinterClient implements MinterInterface { client: SigningCosmWasmClient; @@ -112,48 +112,48 @@ export class MinterClient implements MinterInterface { this.withdraw = this.withdraw.bind(this); } - mint = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + mint = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; setWhitelist = async ({ whitelist }: { whitelist: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_whitelist: { whitelist } - }, fee, memo, funds); + }, fee, memo, _funds); }; - updateStartTime = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + updateStartTime = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_start_time: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; updatePerAddressLimit = async ({ perAddressLimit }: { perAddressLimit: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_per_address_limit: { per_address_limit: perAddressLimit } - }, fee, memo, funds); + }, fee, memo, _funds); }; mintTo = async ({ recipient }: { recipient: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint_to: { recipient } - }, fee, memo, funds); + }, fee, memo, _funds); }; mintFor = async ({ recipient, @@ -161,17 +161,17 @@ export class MinterClient implements MinterInterface { }: { recipient: string; tokenId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint_for: { recipient, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; - withdraw = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + withdraw = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { withdraw: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/builder/default/CwAdminFactory.client.ts b/__output__/builder/default/CwAdminFactory.client.ts index e5bab7f2..7a3c1f78 100644 --- a/__output__/builder/default/CwAdminFactory.client.ts +++ b/__output__/builder/default/CwAdminFactory.client.ts @@ -31,7 +31,7 @@ export interface CwAdminFactoryInterface extends CwAdminFactoryReadOnlyInterface codeId: number; instantiateMsg: Binary; label: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class CwAdminFactoryClient extends CwAdminFactoryQueryClient implements CwAdminFactoryInterface { client: SigningCosmWasmClient; @@ -54,13 +54,13 @@ export class CwAdminFactoryClient extends CwAdminFactoryQueryClient implements C codeId: number; instantiateMsg: Binary; label: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { instantiate_contract_with_self_admin: { code_id: codeId, instantiate_msg: instantiateMsg, label } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/builder/default/CwCodeIdRegistry.client.ts b/__output__/builder/default/CwCodeIdRegistry.client.ts index 78840c67..5e0b5f2c 100644 --- a/__output__/builder/default/CwCodeIdRegistry.client.ts +++ b/__output__/builder/default/CwCodeIdRegistry.client.ts @@ -109,7 +109,7 @@ export interface CwCodeIdRegistryInterface extends CwCodeIdRegistryReadOnlyInter amount: Uint128; msg: Binary; sender: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; register: ({ chainId, checksum, @@ -122,7 +122,7 @@ export interface CwCodeIdRegistryInterface extends CwCodeIdRegistryReadOnlyInter codeId: number; name: string; version: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; setOwner: ({ chainId, name, @@ -131,21 +131,21 @@ export interface CwCodeIdRegistryInterface extends CwCodeIdRegistryReadOnlyInter chainId: string; name: string; owner?: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; unregister: ({ chainId, codeId }: { chainId: string; codeId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateConfig: ({ admin, paymentInfo }: { admin?: string; paymentInfo?: PaymentInfo; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implements CwCodeIdRegistryInterface { client: SigningCosmWasmClient; @@ -172,14 +172,14 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen amount: Uint128; msg: Binary; sender: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { receive: { amount, msg, sender } - }, fee, memo, funds); + }, fee, memo, _funds); }; register = async ({ chainId, @@ -193,7 +193,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen codeId: number; name: string; version: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { register: { chain_id: chainId, @@ -202,7 +202,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen name, version } - }, fee, memo, funds); + }, fee, memo, _funds); }; setOwner = async ({ chainId, @@ -212,14 +212,14 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen chainId: string; name: string; owner?: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_owner: { chain_id: chainId, name, owner } - }, fee, memo, funds); + }, fee, memo, _funds); }; unregister = async ({ chainId, @@ -227,13 +227,13 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen }: { chainId: string; codeId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { unregister: { chain_id: chainId, code_id: codeId } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateConfig = async ({ admin, @@ -241,12 +241,12 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen }: { admin?: string; paymentInfo?: PaymentInfo; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { admin, payment_info: paymentInfo } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/builder/default/CwSingle.client.ts b/__output__/builder/default/CwSingle.client.ts index 7ed4b900..69625750 100644 --- a/__output__/builder/default/CwSingle.client.ts +++ b/__output__/builder/default/CwSingle.client.ts @@ -176,24 +176,24 @@ export interface CwSingleInterface extends CwSingleReadOnlyInterface { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; execute: ({ proposalId }: { proposalId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; close: ({ proposalId }: { proposalId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateConfig: ({ allowRevoting, dao, @@ -210,27 +210,27 @@ export interface CwSingleInterface extends CwSingleReadOnlyInterface { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; addProposalHook: ({ address }: { address: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; removeProposalHook: ({ address }: { address: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; addVoteHook: ({ address }: { address: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; removeVoteHook: ({ address }: { address: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class CwSingleClient extends CwSingleQueryClient implements CwSingleInterface { client: SigningCosmWasmClient; @@ -261,14 +261,14 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { propose: { description, msgs, title } - }, fee, memo, funds); + }, fee, memo, _funds); }; vote = async ({ proposalId, @@ -276,35 +276,35 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter }: { proposalId: number; vote: Vote; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { vote: { proposal_id: proposalId, vote } - }, fee, memo, funds); + }, fee, memo, _funds); }; execute = async ({ proposalId }: { proposalId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { execute: { proposal_id: proposalId } - }, fee, memo, funds); + }, fee, memo, _funds); }; close = async ({ proposalId }: { proposalId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { close: { proposal_id: proposalId } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateConfig = async ({ allowRevoting, @@ -322,7 +322,7 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { allow_revoting: allowRevoting, @@ -333,50 +333,50 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter only_members_execute: onlyMembersExecute, threshold } - }, fee, memo, funds); + }, fee, memo, _funds); }; addProposalHook = async ({ address }: { address: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_proposal_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeProposalHook = async ({ address }: { address: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_proposal_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; addVoteHook = async ({ address }: { address: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_vote_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeVoteHook = async ({ address }: { address: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_vote_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/builder/default/Factory.client.ts b/__output__/builder/default/Factory.client.ts index f7ff49ac..7ef4e86f 100644 --- a/__output__/builder/default/Factory.client.ts +++ b/__output__/builder/default/Factory.client.ts @@ -114,43 +114,43 @@ export interface FactoryInterface extends FactoryReadOnlyInterface { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateProxyUser: ({ newUser, oldUser }: { newUser: Addr; oldUser: Addr; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; migrateWallet: ({ migrationMsg, walletAddress }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateCodeId: ({ newCodeId, ty }: { newCodeId: number; ty: CodeIdType; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateWalletFee: ({ newFee }: { newFee: Coin; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateGovecAddr: ({ addr }: { addr: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateAdmin: ({ addr }: { addr: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class FactoryClient extends FactoryQueryClient implements FactoryInterface { client: SigningCosmWasmClient; @@ -175,12 +175,12 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_wallet: { create_wallet_msg: createWalletMsg } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateProxyUser = async ({ newUser, @@ -188,13 +188,13 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac }: { newUser: Addr; oldUser: Addr; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_proxy_user: { new_user: newUser, old_user: oldUser } - }, fee, memo, funds); + }, fee, memo, _funds); }; migrateWallet = async ({ migrationMsg, @@ -202,13 +202,13 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { migrate_wallet: { migration_msg: migrationMsg, wallet_address: walletAddress } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateCodeId = async ({ newCodeId, @@ -216,45 +216,45 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac }: { newCodeId: number; ty: CodeIdType; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_code_id: { new_code_id: newCodeId, ty } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateWalletFee = async ({ newFee }: { newFee: Coin; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_wallet_fee: { new_fee: newFee } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateGovecAddr = async ({ addr }: { addr: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_govec_addr: { addr } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateAdmin = async ({ addr }: { addr: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_admin: { addr } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/builder/default/Minter.client.ts b/__output__/builder/default/Minter.client.ts index 0a2f6b24..24fd0088 100644 --- a/__output__/builder/default/Minter.client.ts +++ b/__output__/builder/default/Minter.client.ts @@ -68,31 +68,31 @@ export class MinterQueryClient implements MinterReadOnlyInterface { export interface MinterInterface extends MinterReadOnlyInterface { contractAddress: string; sender: string; - mint: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + mint: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; setWhitelist: ({ whitelist }: { whitelist: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - updateStartTime: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateStartTime: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updatePerAddressLimit: ({ perAddressLimit }: { perAddressLimit: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; mintTo: ({ recipient }: { recipient: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; mintFor: ({ recipient, tokenId }: { recipient: string; tokenId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - withdraw: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdraw: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class MinterClient extends MinterQueryClient implements MinterInterface { client: SigningCosmWasmClient; @@ -113,48 +113,48 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { this.withdraw = this.withdraw.bind(this); } - mint = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + mint = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; setWhitelist = async ({ whitelist }: { whitelist: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_whitelist: { whitelist } - }, fee, memo, funds); + }, fee, memo, _funds); }; - updateStartTime = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + updateStartTime = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_start_time: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; updatePerAddressLimit = async ({ perAddressLimit }: { perAddressLimit: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_per_address_limit: { per_address_limit: perAddressLimit } - }, fee, memo, funds); + }, fee, memo, _funds); }; mintTo = async ({ recipient }: { recipient: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint_to: { recipient } - }, fee, memo, funds); + }, fee, memo, _funds); }; mintFor = async ({ recipient, @@ -162,17 +162,17 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { }: { recipient: string; tokenId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint_for: { recipient, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; - withdraw = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + withdraw = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { withdraw: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/builder/invoke/CwAdminFactory.client.ts b/__output__/builder/invoke/CwAdminFactory.client.ts index e5bab7f2..7a3c1f78 100644 --- a/__output__/builder/invoke/CwAdminFactory.client.ts +++ b/__output__/builder/invoke/CwAdminFactory.client.ts @@ -31,7 +31,7 @@ export interface CwAdminFactoryInterface extends CwAdminFactoryReadOnlyInterface codeId: number; instantiateMsg: Binary; label: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class CwAdminFactoryClient extends CwAdminFactoryQueryClient implements CwAdminFactoryInterface { client: SigningCosmWasmClient; @@ -54,13 +54,13 @@ export class CwAdminFactoryClient extends CwAdminFactoryQueryClient implements C codeId: number; instantiateMsg: Binary; label: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { instantiate_contract_with_self_admin: { code_id: codeId, instantiate_msg: instantiateMsg, label } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/builder/invoke/CwCodeIdRegistry.client.ts b/__output__/builder/invoke/CwCodeIdRegistry.client.ts index 78840c67..5e0b5f2c 100644 --- a/__output__/builder/invoke/CwCodeIdRegistry.client.ts +++ b/__output__/builder/invoke/CwCodeIdRegistry.client.ts @@ -109,7 +109,7 @@ export interface CwCodeIdRegistryInterface extends CwCodeIdRegistryReadOnlyInter amount: Uint128; msg: Binary; sender: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; register: ({ chainId, checksum, @@ -122,7 +122,7 @@ export interface CwCodeIdRegistryInterface extends CwCodeIdRegistryReadOnlyInter codeId: number; name: string; version: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; setOwner: ({ chainId, name, @@ -131,21 +131,21 @@ export interface CwCodeIdRegistryInterface extends CwCodeIdRegistryReadOnlyInter chainId: string; name: string; owner?: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; unregister: ({ chainId, codeId }: { chainId: string; codeId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateConfig: ({ admin, paymentInfo }: { admin?: string; paymentInfo?: PaymentInfo; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implements CwCodeIdRegistryInterface { client: SigningCosmWasmClient; @@ -172,14 +172,14 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen amount: Uint128; msg: Binary; sender: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { receive: { amount, msg, sender } - }, fee, memo, funds); + }, fee, memo, _funds); }; register = async ({ chainId, @@ -193,7 +193,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen codeId: number; name: string; version: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { register: { chain_id: chainId, @@ -202,7 +202,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen name, version } - }, fee, memo, funds); + }, fee, memo, _funds); }; setOwner = async ({ chainId, @@ -212,14 +212,14 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen chainId: string; name: string; owner?: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_owner: { chain_id: chainId, name, owner } - }, fee, memo, funds); + }, fee, memo, _funds); }; unregister = async ({ chainId, @@ -227,13 +227,13 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen }: { chainId: string; codeId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { unregister: { chain_id: chainId, code_id: codeId } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateConfig = async ({ admin, @@ -241,12 +241,12 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen }: { admin?: string; paymentInfo?: PaymentInfo; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { admin, payment_info: paymentInfo } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/builder/invoke/CwSingle.client.ts b/__output__/builder/invoke/CwSingle.client.ts index 7ed4b900..69625750 100644 --- a/__output__/builder/invoke/CwSingle.client.ts +++ b/__output__/builder/invoke/CwSingle.client.ts @@ -176,24 +176,24 @@ export interface CwSingleInterface extends CwSingleReadOnlyInterface { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; execute: ({ proposalId }: { proposalId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; close: ({ proposalId }: { proposalId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateConfig: ({ allowRevoting, dao, @@ -210,27 +210,27 @@ export interface CwSingleInterface extends CwSingleReadOnlyInterface { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; addProposalHook: ({ address }: { address: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; removeProposalHook: ({ address }: { address: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; addVoteHook: ({ address }: { address: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; removeVoteHook: ({ address }: { address: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class CwSingleClient extends CwSingleQueryClient implements CwSingleInterface { client: SigningCosmWasmClient; @@ -261,14 +261,14 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { propose: { description, msgs, title } - }, fee, memo, funds); + }, fee, memo, _funds); }; vote = async ({ proposalId, @@ -276,35 +276,35 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter }: { proposalId: number; vote: Vote; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { vote: { proposal_id: proposalId, vote } - }, fee, memo, funds); + }, fee, memo, _funds); }; execute = async ({ proposalId }: { proposalId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { execute: { proposal_id: proposalId } - }, fee, memo, funds); + }, fee, memo, _funds); }; close = async ({ proposalId }: { proposalId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { close: { proposal_id: proposalId } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateConfig = async ({ allowRevoting, @@ -322,7 +322,7 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { allow_revoting: allowRevoting, @@ -333,50 +333,50 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter only_members_execute: onlyMembersExecute, threshold } - }, fee, memo, funds); + }, fee, memo, _funds); }; addProposalHook = async ({ address }: { address: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_proposal_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeProposalHook = async ({ address }: { address: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_proposal_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; addVoteHook = async ({ address }: { address: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_vote_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeVoteHook = async ({ address }: { address: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_vote_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/builder/invoke/Factory.client.ts b/__output__/builder/invoke/Factory.client.ts index f7ff49ac..7ef4e86f 100644 --- a/__output__/builder/invoke/Factory.client.ts +++ b/__output__/builder/invoke/Factory.client.ts @@ -114,43 +114,43 @@ export interface FactoryInterface extends FactoryReadOnlyInterface { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateProxyUser: ({ newUser, oldUser }: { newUser: Addr; oldUser: Addr; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; migrateWallet: ({ migrationMsg, walletAddress }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateCodeId: ({ newCodeId, ty }: { newCodeId: number; ty: CodeIdType; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateWalletFee: ({ newFee }: { newFee: Coin; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateGovecAddr: ({ addr }: { addr: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateAdmin: ({ addr }: { addr: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class FactoryClient extends FactoryQueryClient implements FactoryInterface { client: SigningCosmWasmClient; @@ -175,12 +175,12 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_wallet: { create_wallet_msg: createWalletMsg } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateProxyUser = async ({ newUser, @@ -188,13 +188,13 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac }: { newUser: Addr; oldUser: Addr; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_proxy_user: { new_user: newUser, old_user: oldUser } - }, fee, memo, funds); + }, fee, memo, _funds); }; migrateWallet = async ({ migrationMsg, @@ -202,13 +202,13 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { migrate_wallet: { migration_msg: migrationMsg, wallet_address: walletAddress } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateCodeId = async ({ newCodeId, @@ -216,45 +216,45 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac }: { newCodeId: number; ty: CodeIdType; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_code_id: { new_code_id: newCodeId, ty } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateWalletFee = async ({ newFee }: { newFee: Coin; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_wallet_fee: { new_fee: newFee } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateGovecAddr = async ({ addr }: { addr: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_govec_addr: { addr } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateAdmin = async ({ addr }: { addr: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_admin: { addr } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/builder/invoke/Minter.client.ts b/__output__/builder/invoke/Minter.client.ts index 0a2f6b24..24fd0088 100644 --- a/__output__/builder/invoke/Minter.client.ts +++ b/__output__/builder/invoke/Minter.client.ts @@ -68,31 +68,31 @@ export class MinterQueryClient implements MinterReadOnlyInterface { export interface MinterInterface extends MinterReadOnlyInterface { contractAddress: string; sender: string; - mint: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + mint: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; setWhitelist: ({ whitelist }: { whitelist: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - updateStartTime: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateStartTime: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updatePerAddressLimit: ({ perAddressLimit }: { perAddressLimit: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; mintTo: ({ recipient }: { recipient: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; mintFor: ({ recipient, tokenId }: { recipient: string; tokenId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - withdraw: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdraw: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class MinterClient extends MinterQueryClient implements MinterInterface { client: SigningCosmWasmClient; @@ -113,48 +113,48 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { this.withdraw = this.withdraw.bind(this); } - mint = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + mint = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; setWhitelist = async ({ whitelist }: { whitelist: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_whitelist: { whitelist } - }, fee, memo, funds); + }, fee, memo, _funds); }; - updateStartTime = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + updateStartTime = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_start_time: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; updatePerAddressLimit = async ({ perAddressLimit }: { perAddressLimit: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_per_address_limit: { per_address_limit: perAddressLimit } - }, fee, memo, funds); + }, fee, memo, _funds); }; mintTo = async ({ recipient }: { recipient: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint_to: { recipient } - }, fee, memo, funds); + }, fee, memo, _funds); }; mintFor = async ({ recipient, @@ -162,17 +162,17 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { }: { recipient: string; tokenId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint_for: { recipient, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; - withdraw = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + withdraw = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { withdraw: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/builder/no-extends/CwAdminFactory.client.ts b/__output__/builder/no-extends/CwAdminFactory.client.ts index 3194c8c0..edbba1e6 100644 --- a/__output__/builder/no-extends/CwAdminFactory.client.ts +++ b/__output__/builder/no-extends/CwAdminFactory.client.ts @@ -31,7 +31,7 @@ export interface CwAdminFactoryInterface { codeId: number; instantiateMsg: Binary; label: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class CwAdminFactoryClient implements CwAdminFactoryInterface { client: SigningCosmWasmClient; @@ -53,13 +53,13 @@ export class CwAdminFactoryClient implements CwAdminFactoryInterface { codeId: number; instantiateMsg: Binary; label: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { instantiate_contract_with_self_admin: { code_id: codeId, instantiate_msg: instantiateMsg, label } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/builder/no-extends/CwCodeIdRegistry.client.ts b/__output__/builder/no-extends/CwCodeIdRegistry.client.ts index 59e6506b..d95b2ee4 100644 --- a/__output__/builder/no-extends/CwCodeIdRegistry.client.ts +++ b/__output__/builder/no-extends/CwCodeIdRegistry.client.ts @@ -109,7 +109,7 @@ export interface CwCodeIdRegistryInterface { amount: Uint128; msg: Binary; sender: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; register: ({ chainId, checksum, @@ -122,7 +122,7 @@ export interface CwCodeIdRegistryInterface { codeId: number; name: string; version: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; setOwner: ({ chainId, name, @@ -131,21 +131,21 @@ export interface CwCodeIdRegistryInterface { chainId: string; name: string; owner?: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; unregister: ({ chainId, codeId }: { chainId: string; codeId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateConfig: ({ admin, paymentInfo }: { admin?: string; paymentInfo?: PaymentInfo; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { client: SigningCosmWasmClient; @@ -171,14 +171,14 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { amount: Uint128; msg: Binary; sender: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { receive: { amount, msg, sender } - }, fee, memo, funds); + }, fee, memo, _funds); }; register = async ({ chainId, @@ -192,7 +192,7 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { codeId: number; name: string; version: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { register: { chain_id: chainId, @@ -201,7 +201,7 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { name, version } - }, fee, memo, funds); + }, fee, memo, _funds); }; setOwner = async ({ chainId, @@ -211,14 +211,14 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { chainId: string; name: string; owner?: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_owner: { chain_id: chainId, name, owner } - }, fee, memo, funds); + }, fee, memo, _funds); }; unregister = async ({ chainId, @@ -226,13 +226,13 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { }: { chainId: string; codeId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { unregister: { chain_id: chainId, code_id: codeId } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateConfig = async ({ admin, @@ -240,12 +240,12 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { }: { admin?: string; paymentInfo?: PaymentInfo; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { admin, payment_info: paymentInfo } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/builder/no-extends/CwSingle.client.ts b/__output__/builder/no-extends/CwSingle.client.ts index 05c0dc73..62d3092c 100644 --- a/__output__/builder/no-extends/CwSingle.client.ts +++ b/__output__/builder/no-extends/CwSingle.client.ts @@ -176,24 +176,24 @@ export interface CwSingleInterface { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; execute: ({ proposalId }: { proposalId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; close: ({ proposalId }: { proposalId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateConfig: ({ allowRevoting, dao, @@ -210,27 +210,27 @@ export interface CwSingleInterface { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; addProposalHook: ({ address }: { address: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; removeProposalHook: ({ address }: { address: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; addVoteHook: ({ address }: { address: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; removeVoteHook: ({ address }: { address: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class CwSingleClient implements CwSingleInterface { client: SigningCosmWasmClient; @@ -260,14 +260,14 @@ export class CwSingleClient implements CwSingleInterface { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { propose: { description, msgs, title } - }, fee, memo, funds); + }, fee, memo, _funds); }; vote = async ({ proposalId, @@ -275,35 +275,35 @@ export class CwSingleClient implements CwSingleInterface { }: { proposalId: number; vote: Vote; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { vote: { proposal_id: proposalId, vote } - }, fee, memo, funds); + }, fee, memo, _funds); }; execute = async ({ proposalId }: { proposalId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { execute: { proposal_id: proposalId } - }, fee, memo, funds); + }, fee, memo, _funds); }; close = async ({ proposalId }: { proposalId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { close: { proposal_id: proposalId } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateConfig = async ({ allowRevoting, @@ -321,7 +321,7 @@ export class CwSingleClient implements CwSingleInterface { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { allow_revoting: allowRevoting, @@ -332,50 +332,50 @@ export class CwSingleClient implements CwSingleInterface { only_members_execute: onlyMembersExecute, threshold } - }, fee, memo, funds); + }, fee, memo, _funds); }; addProposalHook = async ({ address }: { address: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_proposal_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeProposalHook = async ({ address }: { address: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_proposal_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; addVoteHook = async ({ address }: { address: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_vote_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeVoteHook = async ({ address }: { address: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_vote_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/builder/no-extends/Factory.client.ts b/__output__/builder/no-extends/Factory.client.ts index 6e9897d6..8c545bda 100644 --- a/__output__/builder/no-extends/Factory.client.ts +++ b/__output__/builder/no-extends/Factory.client.ts @@ -114,43 +114,43 @@ export interface FactoryInterface { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateProxyUser: ({ newUser, oldUser }: { newUser: Addr; oldUser: Addr; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; migrateWallet: ({ migrationMsg, walletAddress }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateCodeId: ({ newCodeId, ty }: { newCodeId: number; ty: CodeIdType; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateWalletFee: ({ newFee }: { newFee: Coin; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateGovecAddr: ({ addr }: { addr: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateAdmin: ({ addr }: { addr: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class FactoryClient implements FactoryInterface { client: SigningCosmWasmClient; @@ -174,12 +174,12 @@ export class FactoryClient implements FactoryInterface { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_wallet: { create_wallet_msg: createWalletMsg } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateProxyUser = async ({ newUser, @@ -187,13 +187,13 @@ export class FactoryClient implements FactoryInterface { }: { newUser: Addr; oldUser: Addr; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_proxy_user: { new_user: newUser, old_user: oldUser } - }, fee, memo, funds); + }, fee, memo, _funds); }; migrateWallet = async ({ migrationMsg, @@ -201,13 +201,13 @@ export class FactoryClient implements FactoryInterface { }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { migrate_wallet: { migration_msg: migrationMsg, wallet_address: walletAddress } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateCodeId = async ({ newCodeId, @@ -215,45 +215,45 @@ export class FactoryClient implements FactoryInterface { }: { newCodeId: number; ty: CodeIdType; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_code_id: { new_code_id: newCodeId, ty } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateWalletFee = async ({ newFee }: { newFee: Coin; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_wallet_fee: { new_fee: newFee } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateGovecAddr = async ({ addr }: { addr: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_govec_addr: { addr } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateAdmin = async ({ addr }: { addr: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_admin: { addr } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/builder/no-extends/Minter.client.ts b/__output__/builder/no-extends/Minter.client.ts index deffa10a..6901674a 100644 --- a/__output__/builder/no-extends/Minter.client.ts +++ b/__output__/builder/no-extends/Minter.client.ts @@ -68,31 +68,31 @@ export class MinterQueryClient implements MinterReadOnlyInterface { export interface MinterInterface { contractAddress: string; sender: string; - mint: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + mint: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; setWhitelist: ({ whitelist }: { whitelist: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - updateStartTime: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateStartTime: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updatePerAddressLimit: ({ perAddressLimit }: { perAddressLimit: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; mintTo: ({ recipient }: { recipient: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; mintFor: ({ recipient, tokenId }: { recipient: string; tokenId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - withdraw: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdraw: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class MinterClient implements MinterInterface { client: SigningCosmWasmClient; @@ -112,48 +112,48 @@ export class MinterClient implements MinterInterface { this.withdraw = this.withdraw.bind(this); } - mint = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + mint = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; setWhitelist = async ({ whitelist }: { whitelist: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_whitelist: { whitelist } - }, fee, memo, funds); + }, fee, memo, _funds); }; - updateStartTime = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + updateStartTime = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_start_time: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; updatePerAddressLimit = async ({ perAddressLimit }: { perAddressLimit: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_per_address_limit: { per_address_limit: perAddressLimit } - }, fee, memo, funds); + }, fee, memo, _funds); }; mintTo = async ({ recipient }: { recipient: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint_to: { recipient } - }, fee, memo, funds); + }, fee, memo, _funds); }; mintFor = async ({ recipient, @@ -161,17 +161,17 @@ export class MinterClient implements MinterInterface { }: { recipient: string; tokenId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint_for: { recipient, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; - withdraw = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + withdraw = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { withdraw: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/daodao/cw-admin-factory/CwAdminFactory.client.ts b/__output__/daodao/cw-admin-factory/CwAdminFactory.client.ts index e5bab7f2..7a3c1f78 100644 --- a/__output__/daodao/cw-admin-factory/CwAdminFactory.client.ts +++ b/__output__/daodao/cw-admin-factory/CwAdminFactory.client.ts @@ -31,7 +31,7 @@ export interface CwAdminFactoryInterface extends CwAdminFactoryReadOnlyInterface codeId: number; instantiateMsg: Binary; label: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class CwAdminFactoryClient extends CwAdminFactoryQueryClient implements CwAdminFactoryInterface { client: SigningCosmWasmClient; @@ -54,13 +54,13 @@ export class CwAdminFactoryClient extends CwAdminFactoryQueryClient implements C codeId: number; instantiateMsg: Binary; label: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { instantiate_contract_with_self_admin: { code_id: codeId, instantiate_msg: instantiateMsg, label } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.client.ts b/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.client.ts index 78840c67..5e0b5f2c 100644 --- a/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.client.ts +++ b/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.client.ts @@ -109,7 +109,7 @@ export interface CwCodeIdRegistryInterface extends CwCodeIdRegistryReadOnlyInter amount: Uint128; msg: Binary; sender: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; register: ({ chainId, checksum, @@ -122,7 +122,7 @@ export interface CwCodeIdRegistryInterface extends CwCodeIdRegistryReadOnlyInter codeId: number; name: string; version: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; setOwner: ({ chainId, name, @@ -131,21 +131,21 @@ export interface CwCodeIdRegistryInterface extends CwCodeIdRegistryReadOnlyInter chainId: string; name: string; owner?: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; unregister: ({ chainId, codeId }: { chainId: string; codeId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateConfig: ({ admin, paymentInfo }: { admin?: string; paymentInfo?: PaymentInfo; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implements CwCodeIdRegistryInterface { client: SigningCosmWasmClient; @@ -172,14 +172,14 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen amount: Uint128; msg: Binary; sender: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { receive: { amount, msg, sender } - }, fee, memo, funds); + }, fee, memo, _funds); }; register = async ({ chainId, @@ -193,7 +193,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen codeId: number; name: string; version: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { register: { chain_id: chainId, @@ -202,7 +202,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen name, version } - }, fee, memo, funds); + }, fee, memo, _funds); }; setOwner = async ({ chainId, @@ -212,14 +212,14 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen chainId: string; name: string; owner?: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_owner: { chain_id: chainId, name, owner } - }, fee, memo, funds); + }, fee, memo, _funds); }; unregister = async ({ chainId, @@ -227,13 +227,13 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen }: { chainId: string; codeId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { unregister: { chain_id: chainId, code_id: codeId } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateConfig = async ({ admin, @@ -241,12 +241,12 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen }: { admin?: string; paymentInfo?: PaymentInfo; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { admin, payment_info: paymentInfo } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/daodao/cw-named-groups/CwNamedGroups.client.ts b/__output__/daodao/cw-named-groups/CwNamedGroups.client.ts index 3d0ad599..25793dcc 100644 --- a/__output__/daodao/cw-named-groups/CwNamedGroups.client.ts +++ b/__output__/daodao/cw-named-groups/CwNamedGroups.client.ts @@ -114,17 +114,17 @@ export interface CwNamedGroupsInterface extends CwNamedGroupsReadOnlyInterface { addressesToAdd?: string[]; addressesToRemove?: string[]; group: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; removeGroup: ({ group }: { group: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateOwner: ({ owner }: { owner: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class CwNamedGroupsClient extends CwNamedGroupsQueryClient implements CwNamedGroupsInterface { client: SigningCosmWasmClient; @@ -149,35 +149,35 @@ export class CwNamedGroupsClient extends CwNamedGroupsQueryClient implements CwN addressesToAdd?: string[]; addressesToRemove?: string[]; group: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update: { addresses_to_add: addressesToAdd, addresses_to_remove: addressesToRemove, group } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeGroup = async ({ group }: { group: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_group: { group } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateOwner = async ({ owner }: { owner: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_owner: { owner } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/daodao/cw-proposal-single/CwProposalSingle.client.ts b/__output__/daodao/cw-proposal-single/CwProposalSingle.client.ts index e468ac20..2c19498a 100644 --- a/__output__/daodao/cw-proposal-single/CwProposalSingle.client.ts +++ b/__output__/daodao/cw-proposal-single/CwProposalSingle.client.ts @@ -176,24 +176,24 @@ export interface CwProposalSingleInterface extends CwProposalSingleReadOnlyInter description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; execute: ({ proposalId }: { proposalId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; close: ({ proposalId }: { proposalId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateConfig: ({ allowRevoting, dao, @@ -210,27 +210,27 @@ export interface CwProposalSingleInterface extends CwProposalSingleReadOnlyInter minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; addProposalHook: ({ address }: { address: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; removeProposalHook: ({ address }: { address: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; addVoteHook: ({ address }: { address: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; removeVoteHook: ({ address }: { address: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class CwProposalSingleClient extends CwProposalSingleQueryClient implements CwProposalSingleInterface { client: SigningCosmWasmClient; @@ -261,14 +261,14 @@ export class CwProposalSingleClient extends CwProposalSingleQueryClient implemen description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { propose: { description, msgs, title } - }, fee, memo, funds); + }, fee, memo, _funds); }; vote = async ({ proposalId, @@ -276,35 +276,35 @@ export class CwProposalSingleClient extends CwProposalSingleQueryClient implemen }: { proposalId: number; vote: Vote; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { vote: { proposal_id: proposalId, vote } - }, fee, memo, funds); + }, fee, memo, _funds); }; execute = async ({ proposalId }: { proposalId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { execute: { proposal_id: proposalId } - }, fee, memo, funds); + }, fee, memo, _funds); }; close = async ({ proposalId }: { proposalId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { close: { proposal_id: proposalId } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateConfig = async ({ allowRevoting, @@ -322,7 +322,7 @@ export class CwProposalSingleClient extends CwProposalSingleQueryClient implemen minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { allow_revoting: allowRevoting, @@ -333,50 +333,50 @@ export class CwProposalSingleClient extends CwProposalSingleQueryClient implemen only_members_execute: onlyMembersExecute, threshold } - }, fee, memo, funds); + }, fee, memo, _funds); }; addProposalHook = async ({ address }: { address: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_proposal_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeProposalHook = async ({ address }: { address: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_proposal_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; addVoteHook = async ({ address }: { address: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_vote_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeVoteHook = async ({ address }: { address: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_vote_hook: { address } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/idl-version/accounts-nft/AccountsNft.client.ts b/__output__/idl-version/accounts-nft/AccountsNft.client.ts index 02276b5d..5dc0d928 100644 --- a/__output__/idl-version/accounts-nft/AccountsNft.client.ts +++ b/__output__/idl-version/accounts-nft/AccountsNft.client.ts @@ -297,20 +297,20 @@ export interface AccountsNftInterface extends AccountsNftReadOnlyInterface { newOwner }: { newOwner: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - acceptOwnership: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + acceptOwnership: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; mint: ({ user }: { user: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; transferNft: ({ recipient, tokenId }: { recipient: string; tokenId: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; sendNft: ({ contract, msg, @@ -319,7 +319,7 @@ export interface AccountsNftInterface extends AccountsNftReadOnlyInterface { contract: string; msg: Binary; tokenId: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; approve: ({ expires, spender, @@ -328,31 +328,31 @@ export interface AccountsNftInterface extends AccountsNftReadOnlyInterface { expires?: Expiration; spender: string; tokenId: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; revoke: ({ spender, tokenId }: { spender: string; tokenId: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; approveAll: ({ expires, operator }: { expires?: Expiration; operator: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; revokeAll: ({ operator }: { operator: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; burn: ({ tokenId }: { tokenId: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class AccountsNftClient extends AccountsNftQueryClient implements AccountsNftInterface { client: SigningCosmWasmClient; @@ -380,28 +380,28 @@ export class AccountsNftClient extends AccountsNftQueryClient implements Account newOwner }: { newOwner: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { propose_new_owner: { new_owner: newOwner } - }, fee, memo, funds); + }, fee, memo, _funds); }; - acceptOwnership = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + acceptOwnership = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { accept_ownership: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; mint = async ({ user }: { user: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { user } - }, fee, memo, funds); + }, fee, memo, _funds); }; transferNft = async ({ recipient, @@ -409,13 +409,13 @@ export class AccountsNftClient extends AccountsNftQueryClient implements Account }: { recipient: string; tokenId: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; sendNft = async ({ contract, @@ -425,14 +425,14 @@ export class AccountsNftClient extends AccountsNftQueryClient implements Account contract: string; msg: Binary; tokenId: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, msg, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approve = async ({ expires, @@ -442,14 +442,14 @@ export class AccountsNftClient extends AccountsNftQueryClient implements Account expires?: Expiration; spender: string; tokenId: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; revoke = async ({ spender, @@ -457,13 +457,13 @@ export class AccountsNftClient extends AccountsNftQueryClient implements Account }: { spender: string; tokenId: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approveAll = async ({ expires, @@ -471,34 +471,34 @@ export class AccountsNftClient extends AccountsNftQueryClient implements Account }: { expires?: Expiration; operator: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, operator } - }, fee, memo, funds); + }, fee, memo, _funds); }; revokeAll = async ({ operator }: { operator: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator } - }, fee, memo, funds); + }, fee, memo, _funds); }; burn = async ({ tokenId }: { tokenId: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.client.ts b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.client.ts index 6f780f31..98d790bf 100644 --- a/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.client.ts +++ b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.client.ts @@ -189,24 +189,24 @@ export interface Cw3FixedMultiSigInterface extends Cw3FixedMultiSigReadOnlyInter latest?: Expiration; msgs: CosmosMsgForEmpty[]; title: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; execute: ({ proposalId }: { proposalId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; close: ({ proposalId }: { proposalId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class Cw3FixedMultiSigClient extends Cw3FixedMultiSigQueryClient implements Cw3FixedMultiSigInterface { client: SigningCosmWasmClient; @@ -234,7 +234,7 @@ export class Cw3FixedMultiSigClient extends Cw3FixedMultiSigQueryClient implemen latest?: Expiration; msgs: CosmosMsgForEmpty[]; title: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { propose: { description, @@ -242,7 +242,7 @@ export class Cw3FixedMultiSigClient extends Cw3FixedMultiSigQueryClient implemen msgs, title } - }, fee, memo, funds); + }, fee, memo, _funds); }; vote = async ({ proposalId, @@ -250,34 +250,34 @@ export class Cw3FixedMultiSigClient extends Cw3FixedMultiSigQueryClient implemen }: { proposalId: number; vote: Vote; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { vote: { proposal_id: proposalId, vote } - }, fee, memo, funds); + }, fee, memo, _funds); }; execute = async ({ proposalId }: { proposalId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { execute: { proposal_id: proposalId } - }, fee, memo, funds); + }, fee, memo, _funds); }; close = async ({ proposalId }: { proposalId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { close: { proposal_id: proposalId } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/idl-version/cw4-group/Cw4Group.client.ts b/__output__/idl-version/cw4-group/Cw4Group.client.ts index c438469b..9b68c374 100644 --- a/__output__/idl-version/cw4-group/Cw4Group.client.ts +++ b/__output__/idl-version/cw4-group/Cw4Group.client.ts @@ -92,24 +92,24 @@ export interface Cw4GroupInterface extends Cw4GroupReadOnlyInterface { admin }: { admin?: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateMembers: ({ add, remove }: { add: Member[]; remove: string[]; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; addHook: ({ addr }: { addr: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; removeHook: ({ addr }: { addr: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class Cw4GroupClient extends Cw4GroupQueryClient implements Cw4GroupInterface { client: SigningCosmWasmClient; @@ -131,12 +131,12 @@ export class Cw4GroupClient extends Cw4GroupQueryClient implements Cw4GroupInter admin }: { admin?: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_admin: { admin } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateMembers = async ({ add, @@ -144,34 +144,34 @@ export class Cw4GroupClient extends Cw4GroupQueryClient implements Cw4GroupInter }: { add: Member[]; remove: string[]; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_members: { add, remove } - }, fee, memo, funds); + }, fee, memo, _funds); }; addHook = async ({ addr }: { addr: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_hook: { addr } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeHook = async ({ addr }: { addr: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_hook: { addr } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/idl-version/cyberpunk/CyberPunk.client.ts b/__output__/idl-version/cyberpunk/CyberPunk.client.ts index 70e3100c..fc2fd386 100644 --- a/__output__/idl-version/cyberpunk/CyberPunk.client.ts +++ b/__output__/idl-version/cyberpunk/CyberPunk.client.ts @@ -36,8 +36,8 @@ export interface CyberPunkInterface extends CyberPunkReadOnlyInterface { }: { memCost: number; timeCost: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - mirrorEnv: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + mirrorEnv: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class CyberPunkClient extends CyberPunkQueryClient implements CyberPunkInterface { client: SigningCosmWasmClient; @@ -59,17 +59,17 @@ export class CyberPunkClient extends CyberPunkQueryClient implements CyberPunkIn }: { memCost: number; timeCost: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { argon2: { mem_cost: memCost, time_cost: timeCost } - }, fee, memo, funds); + }, fee, memo, _funds); }; - mirrorEnv = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + mirrorEnv = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mirror_env: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/idl-version/hackatom/HackAtom.client.ts b/__output__/idl-version/hackatom/HackAtom.client.ts index bce1ebde..c3139417 100644 --- a/__output__/idl-version/hackatom/HackAtom.client.ts +++ b/__output__/idl-version/hackatom/HackAtom.client.ts @@ -76,18 +76,18 @@ export class HackAtomQueryClient implements HackAtomReadOnlyInterface { export interface HackAtomInterface extends HackAtomReadOnlyInterface { contractAddress: string; sender: string; - release: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - cpuLoop: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - storageLoop: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - memoryLoop: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - messageLoop: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + release: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + cpuLoop: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + storageLoop: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + memoryLoop: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + messageLoop: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; allocateLargeMemory: ({ pages }: { pages: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - panic: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - userErrorsInApiCalls: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + panic: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + userErrorsInApiCalls: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class HackAtomClient extends HackAtomQueryClient implements HackAtomInterface { client: SigningCosmWasmClient; @@ -109,50 +109,50 @@ export class HackAtomClient extends HackAtomQueryClient implements HackAtomInter this.userErrorsInApiCalls = this.userErrorsInApiCalls.bind(this); } - release = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + release = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { release: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; - cpuLoop = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + cpuLoop = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { cpu_loop: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; - storageLoop = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + storageLoop = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { storage_loop: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; - memoryLoop = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + memoryLoop = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { memory_loop: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; - messageLoop = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + messageLoop = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { message_loop: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; allocateLargeMemory = async ({ pages }: { pages: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { allocate_large_memory: { pages } - }, fee, memo, funds); + }, fee, memo, _funds); }; - panic = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + panic = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { panic: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; - userErrorsInApiCalls = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + userErrorsInApiCalls = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { user_errors_in_api_calls: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/minter/Minter.client.ts b/__output__/minter/Minter.client.ts index 0a2f6b24..24fd0088 100644 --- a/__output__/minter/Minter.client.ts +++ b/__output__/minter/Minter.client.ts @@ -68,31 +68,31 @@ export class MinterQueryClient implements MinterReadOnlyInterface { export interface MinterInterface extends MinterReadOnlyInterface { contractAddress: string; sender: string; - mint: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + mint: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; setWhitelist: ({ whitelist }: { whitelist: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - updateStartTime: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateStartTime: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updatePerAddressLimit: ({ perAddressLimit }: { perAddressLimit: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; mintTo: ({ recipient }: { recipient: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; mintFor: ({ recipient, tokenId }: { recipient: string; tokenId: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - withdraw: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdraw: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class MinterClient extends MinterQueryClient implements MinterInterface { client: SigningCosmWasmClient; @@ -113,48 +113,48 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { this.withdraw = this.withdraw.bind(this); } - mint = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + mint = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; setWhitelist = async ({ whitelist }: { whitelist: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_whitelist: { whitelist } - }, fee, memo, funds); + }, fee, memo, _funds); }; - updateStartTime = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + updateStartTime = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_start_time: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; updatePerAddressLimit = async ({ perAddressLimit }: { perAddressLimit: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_per_address_limit: { per_address_limit: perAddressLimit } - }, fee, memo, funds); + }, fee, memo, _funds); }; mintTo = async ({ recipient }: { recipient: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint_to: { recipient } - }, fee, memo, funds); + }, fee, memo, _funds); }; mintFor = async ({ recipient, @@ -162,17 +162,17 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { }: { recipient: string; tokenId: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint_for: { recipient, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; - withdraw = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + withdraw = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { withdraw: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/sg721/Sg721.client.ts b/__output__/sg721/Sg721.client.ts index 7946534b..ef6d836b 100644 --- a/__output__/sg721/Sg721.client.ts +++ b/__output__/sg721/Sg721.client.ts @@ -248,7 +248,7 @@ export interface Sg721Interface extends Sg721ReadOnlyInterface { }: { recipient: string; tokenId: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; sendNft: ({ contract, msg, @@ -257,7 +257,7 @@ export interface Sg721Interface extends Sg721ReadOnlyInterface { contract: string; msg: Binary; tokenId: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; approve: ({ expires, spender, @@ -266,26 +266,26 @@ export interface Sg721Interface extends Sg721ReadOnlyInterface { expires?: Expiration; spender: string; tokenId: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; revoke: ({ spender, tokenId }: { spender: string; tokenId: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; approveAll: ({ expires, operator }: { expires?: Expiration; operator: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; revokeAll: ({ operator }: { operator: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; mint: ({ extension, owner, @@ -296,12 +296,12 @@ export interface Sg721Interface extends Sg721ReadOnlyInterface { owner: string; tokenId: string; tokenUri?: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; burn: ({ tokenId }: { tokenId: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class Sg721Client extends Sg721QueryClient implements Sg721Interface { client: SigningCosmWasmClient; @@ -329,13 +329,13 @@ export class Sg721Client extends Sg721QueryClient implements Sg721Interface { }: { recipient: string; tokenId: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; sendNft = async ({ contract, @@ -345,14 +345,14 @@ export class Sg721Client extends Sg721QueryClient implements Sg721Interface { contract: string; msg: Binary; tokenId: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, msg, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approve = async ({ expires, @@ -362,14 +362,14 @@ export class Sg721Client extends Sg721QueryClient implements Sg721Interface { expires?: Expiration; spender: string; tokenId: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; revoke = async ({ spender, @@ -377,13 +377,13 @@ export class Sg721Client extends Sg721QueryClient implements Sg721Interface { }: { spender: string; tokenId: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; approveAll = async ({ expires, @@ -391,24 +391,24 @@ export class Sg721Client extends Sg721QueryClient implements Sg721Interface { }: { expires?: Expiration; operator: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, operator } - }, fee, memo, funds); + }, fee, memo, _funds); }; revokeAll = async ({ operator }: { operator: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator } - }, fee, memo, funds); + }, fee, memo, _funds); }; mint = async ({ extension, @@ -420,7 +420,7 @@ export class Sg721Client extends Sg721QueryClient implements Sg721Interface { owner: string; tokenId: string; tokenUri?: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -428,17 +428,17 @@ export class Sg721Client extends Sg721QueryClient implements Sg721Interface { token_id: tokenId, token_uri: tokenUri } - }, fee, memo, funds); + }, fee, memo, _funds); }; burn = async ({ tokenId }: { tokenId: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/vectis/factory-w-mutations/Factory.react-query.ts b/__output__/vectis/factory-w-mutations/Factory.react-query.ts index 93a6f935..d00d3933 100644 --- a/__output__/vectis/factory-w-mutations/Factory.react-query.ts +++ b/__output__/vectis/factory-w-mutations/Factory.react-query.ts @@ -92,7 +92,7 @@ export interface FactoryUpdateAdminMutation { args?: { fee?: number | StdFee | "auto"; memo?: string; - funds?: Coin[]; + _funds?: Coin[]; }; } export function useFactoryUpdateAdminMutation(options?: Omit, "mutationFn">) { @@ -102,9 +102,9 @@ export function useFactoryUpdateAdminMutation(options?: Omit client.updateAdmin(msg, fee, memo, funds), options); + }) => client.updateAdmin(msg, fee, memo, _funds), options); } export interface FactoryUpdateGovecAddrMutation { client: FactoryClient; @@ -114,7 +114,7 @@ export interface FactoryUpdateGovecAddrMutation { args?: { fee?: number | StdFee | "auto"; memo?: string; - funds?: Coin[]; + _funds?: Coin[]; }; } export function useFactoryUpdateGovecAddrMutation(options?: Omit, "mutationFn">) { @@ -124,9 +124,9 @@ export function useFactoryUpdateGovecAddrMutation(options?: Omit client.updateGovecAddr(msg, fee, memo, funds), options); + }) => client.updateGovecAddr(msg, fee, memo, _funds), options); } export interface FactoryUpdateWalletFeeMutation { client: FactoryClient; @@ -136,7 +136,7 @@ export interface FactoryUpdateWalletFeeMutation { args?: { fee?: number | StdFee | "auto"; memo?: string; - funds?: Coin[]; + _funds?: Coin[]; }; } export function useFactoryUpdateWalletFeeMutation(options?: Omit, "mutationFn">) { @@ -146,9 +146,9 @@ export function useFactoryUpdateWalletFeeMutation(options?: Omit client.updateWalletFee(msg, fee, memo, funds), options); + }) => client.updateWalletFee(msg, fee, memo, _funds), options); } export interface FactoryUpdateCodeIdMutation { client: FactoryClient; @@ -159,7 +159,7 @@ export interface FactoryUpdateCodeIdMutation { args?: { fee?: number | StdFee | "auto"; memo?: string; - funds?: Coin[]; + _funds?: Coin[]; }; } export function useFactoryUpdateCodeIdMutation(options?: Omit, "mutationFn">) { @@ -169,9 +169,9 @@ export function useFactoryUpdateCodeIdMutation(options?: Omit client.updateCodeId(msg, fee, memo, funds), options); + }) => client.updateCodeId(msg, fee, memo, _funds), options); } export interface FactoryMigrateWalletMutation { client: FactoryClient; @@ -182,7 +182,7 @@ export interface FactoryMigrateWalletMutation { args?: { fee?: number | StdFee | "auto"; memo?: string; - funds?: Coin[]; + _funds?: Coin[]; }; } export function useFactoryMigrateWalletMutation(options?: Omit, "mutationFn">) { @@ -192,9 +192,9 @@ export function useFactoryMigrateWalletMutation(options?: Omit client.migrateWallet(msg, fee, memo, funds), options); + }) => client.migrateWallet(msg, fee, memo, _funds), options); } export interface FactoryUpdateProxyUserMutation { client: FactoryClient; @@ -205,7 +205,7 @@ export interface FactoryUpdateProxyUserMutation { args?: { fee?: number | StdFee | "auto"; memo?: string; - funds?: Coin[]; + _funds?: Coin[]; }; } export function useFactoryUpdateProxyUserMutation(options?: Omit, "mutationFn">) { @@ -215,9 +215,9 @@ export function useFactoryUpdateProxyUserMutation(options?: Omit client.updateProxyUser(msg, fee, memo, funds), options); + }) => client.updateProxyUser(msg, fee, memo, _funds), options); } export interface FactoryCreateWalletMutation { client: FactoryClient; @@ -227,7 +227,7 @@ export interface FactoryCreateWalletMutation { args?: { fee?: number | StdFee | "auto"; memo?: string; - funds?: Coin[]; + _funds?: Coin[]; }; } export function useFactoryCreateWalletMutation(options?: Omit, "mutationFn">) { @@ -237,7 +237,7 @@ export function useFactoryCreateWalletMutation(options?: Omit client.createWallet(msg, fee, memo, funds), options); + }) => client.createWallet(msg, fee, memo, _funds), options); } \ No newline at end of file diff --git a/__output__/vectis/factory/Factory.client.ts b/__output__/vectis/factory/Factory.client.ts index f7ff49ac..7ef4e86f 100644 --- a/__output__/vectis/factory/Factory.client.ts +++ b/__output__/vectis/factory/Factory.client.ts @@ -114,43 +114,43 @@ export interface FactoryInterface extends FactoryReadOnlyInterface { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateProxyUser: ({ newUser, oldUser }: { newUser: Addr; oldUser: Addr; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; migrateWallet: ({ migrationMsg, walletAddress }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateCodeId: ({ newCodeId, ty }: { newCodeId: number; ty: CodeIdType; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateWalletFee: ({ newFee }: { newFee: Coin; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateGovecAddr: ({ addr }: { addr: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateAdmin: ({ addr }: { addr: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class FactoryClient extends FactoryQueryClient implements FactoryInterface { client: SigningCosmWasmClient; @@ -175,12 +175,12 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_wallet: { create_wallet_msg: createWalletMsg } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateProxyUser = async ({ newUser, @@ -188,13 +188,13 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac }: { newUser: Addr; oldUser: Addr; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_proxy_user: { new_user: newUser, old_user: oldUser } - }, fee, memo, funds); + }, fee, memo, _funds); }; migrateWallet = async ({ migrationMsg, @@ -202,13 +202,13 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { migrate_wallet: { migration_msg: migrationMsg, wallet_address: walletAddress } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateCodeId = async ({ newCodeId, @@ -216,45 +216,45 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac }: { newCodeId: number; ty: CodeIdType; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_code_id: { new_code_id: newCodeId, ty } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateWalletFee = async ({ newFee }: { newFee: Coin; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_wallet_fee: { new_fee: newFee } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateGovecAddr = async ({ addr }: { addr: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_govec_addr: { addr } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateAdmin = async ({ addr }: { addr: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_admin: { addr } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/vectis/govec/Govec.client.ts b/__output__/vectis/govec/Govec.client.ts index 1fcf7a57..0e457046 100644 --- a/__output__/vectis/govec/Govec.client.ts +++ b/__output__/vectis/govec/Govec.client.ts @@ -51,40 +51,40 @@ export interface GovecInterface extends GovecReadOnlyInterface { msgs }: { msgs: CosmosMsgForEmpty[]; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - revertFreezeStatus: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + revertFreezeStatus: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; relay: ({ transaction }: { transaction: RelayTransaction; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; rotateUserKey: ({ newUserAddress }: { newUserAddress: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; addRelayer: ({ newRelayerAddress }: { newRelayerAddress: Addr; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; removeRelayer: ({ relayerAddress }: { relayerAddress: Addr; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateGuardians: ({ guardians, newMultisigCodeId }: { guardians: Guardians; newMultisigCodeId?: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateLabel: ({ newLabel }: { newLabel: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class GovecClient extends GovecQueryClient implements GovecInterface { client: SigningCosmWasmClient; @@ -110,61 +110,61 @@ export class GovecClient extends GovecQueryClient implements GovecInterface { msgs }: { msgs: CosmosMsgForEmpty[]; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { execute: { msgs } - }, fee, memo, funds); + }, fee, memo, _funds); }; - revertFreezeStatus = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + revertFreezeStatus = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revert_freeze_status: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; relay = async ({ transaction }: { transaction: RelayTransaction; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { relay: { transaction } - }, fee, memo, funds); + }, fee, memo, _funds); }; rotateUserKey = async ({ newUserAddress }: { newUserAddress: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { rotate_user_key: { new_user_address: newUserAddress } - }, fee, memo, funds); + }, fee, memo, _funds); }; addRelayer = async ({ newRelayerAddress }: { newRelayerAddress: Addr; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_relayer: { new_relayer_address: newRelayerAddress } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeRelayer = async ({ relayerAddress }: { relayerAddress: Addr; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_relayer: { relayer_address: relayerAddress } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateGuardians = async ({ guardians, @@ -172,23 +172,23 @@ export class GovecClient extends GovecQueryClient implements GovecInterface { }: { guardians: Guardians; newMultisigCodeId?: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_guardians: { guardians, new_multisig_code_id: newMultisigCodeId } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateLabel = async ({ newLabel }: { newLabel: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_label: { new_label: newLabel } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/__output__/vectis/proxy/Proxy.client.ts b/__output__/vectis/proxy/Proxy.client.ts index 37b7e570..39b36049 100644 --- a/__output__/vectis/proxy/Proxy.client.ts +++ b/__output__/vectis/proxy/Proxy.client.ts @@ -51,40 +51,40 @@ export interface ProxyInterface extends ProxyReadOnlyInterface { msgs }: { msgs: CosmosMsgForEmpty[]; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - revertFreezeStatus: (fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + revertFreezeStatus: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; relay: ({ transaction }: { transaction: RelayTransaction; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; rotateUserKey: ({ newUserAddress }: { newUserAddress: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; addRelayer: ({ newRelayerAddress }: { newRelayerAddress: Addr; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; removeRelayer: ({ relayerAddress }: { relayerAddress: Addr; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateGuardians: ({ guardians, newMultisigCodeId }: { guardians: Guardians; newMultisigCodeId?: number; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateLabel: ({ newLabel }: { newLabel: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } export class ProxyClient extends ProxyQueryClient implements ProxyInterface { client: SigningCosmWasmClient; @@ -110,61 +110,61 @@ export class ProxyClient extends ProxyQueryClient implements ProxyInterface { msgs }: { msgs: CosmosMsgForEmpty[]; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { execute: { msgs } - }, fee, memo, funds); + }, fee, memo, _funds); }; - revertFreezeStatus = async (fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + revertFreezeStatus = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revert_freeze_status: {} - }, fee, memo, funds); + }, fee, memo, _funds); }; relay = async ({ transaction }: { transaction: RelayTransaction; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { relay: { transaction } - }, fee, memo, funds); + }, fee, memo, _funds); }; rotateUserKey = async ({ newUserAddress }: { newUserAddress: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { rotate_user_key: { new_user_address: newUserAddress } - }, fee, memo, funds); + }, fee, memo, _funds); }; addRelayer = async ({ newRelayerAddress }: { newRelayerAddress: Addr; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_relayer: { new_relayer_address: newRelayerAddress } - }, fee, memo, funds); + }, fee, memo, _funds); }; removeRelayer = async ({ relayerAddress }: { relayerAddress: Addr; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_relayer: { relayer_address: relayerAddress } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateGuardians = async ({ guardians, @@ -172,23 +172,23 @@ export class ProxyClient extends ProxyQueryClient implements ProxyInterface { }: { guardians: Guardians; newMultisigCodeId?: number; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_guardians: { guardians, new_multisig_code_id: newMultisigCodeId } - }, fee, memo, funds); + }, fee, memo, _funds); }; updateLabel = async ({ newLabel }: { newLabel: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_label: { new_label: newLabel } - }, fee, memo, funds); + }, fee, memo, _funds); }; } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 220b3fe5..c515cc58 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9218,6 +9218,16 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" +"wasm-ast-types@file:packages/wasm-ast-types": + version "0.21.0" + dependencies: + "@babel/runtime" "^7.18.9" + "@babel/types" "7.18.10" + "@jest/transform" "28.1.3" + ast-stringify "0.1.0" + case "1.6.3" + deepmerge "4.2.2" + wcwidth@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz" From 1da0b2ce40cd85f69c3325bc0de0d3e0f2b55335 Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Sun, 21 May 2023 14:52:59 +0300 Subject: [PATCH 112/287] Reverse funds and _funds --- .../CwAdminFactory.message-composer.ts | 2 +- .../CwCodeIdRegistry.message-composer.ts | 10 +++++----- .../contracts/CwSingle.message-composer.ts | 18 ++++++++--------- .../contracts/Factory.message-composer.ts | 14 ++++++------- .../contracts/Minter.message-composer.ts | 14 ++++++------- .../CwAdminFactory.message-composer.ts | 2 +- .../CwCodeIdRegistry.message-composer.ts | 10 +++++----- .../default/CwSingle.message-composer.ts | 18 ++++++++--------- .../default/Factory.message-composer.ts | 14 ++++++------- .../default/Minter.message-composer.ts | 14 ++++++------- .../CwAdminFactory.message-composer.ts | 2 +- .../CwCodeIdRegistry.message-composer.ts | 10 +++++----- .../no-extends/CwSingle.message-composer.ts | 18 ++++++++--------- .../no-extends/Factory.message-composer.ts | 14 ++++++------- .../no-extends/Minter.message-composer.ts | 14 ++++++------- .../CwAdminFactory.message-composer.ts | 2 +- .../CwCodeIdRegistry.message-composer.ts | 10 +++++----- .../CwNamedGroups.message-composer.ts | 6 +++--- .../CwProposalSingle.message-composer.ts | 18 ++++++++--------- .../AccountsNft.message-composer.ts | 20 +++++++++---------- .../Cw3FixedMultiSig.message-composer.ts | 8 ++++---- .../cw4-group/Cw4Group.message-composer.ts | 8 ++++---- .../cyberpunk/CyberPunk.message-composer.ts | 4 ++-- .../hackatom/HackAtom.message-composer.ts | 16 +++++++-------- __output__/minter/Minter.message-composer.ts | 14 ++++++------- __output__/sg721/Sg721.message-composer.ts | 16 +++++++-------- .../factory/Factory.message-composer.ts | 14 ++++++------- .../vectis/govec/Govec.message-composer.ts | 16 +++++++-------- .../vectis/proxy/Proxy.message-composer.ts | 16 +++++++-------- .../message-composer.spec.ts.snap | 20 +++++++++---------- .../src/message-composer/message-composer.ts | 4 ++-- yarn.lock | 10 ---------- 32 files changed, 183 insertions(+), 193 deletions(-) diff --git a/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts b/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts index 5b6dd320..6770e937 100644 --- a/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts @@ -53,7 +53,7 @@ export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { label } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts index 97e190f6..fe110741 100644 --- a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts @@ -93,7 +93,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage sender } })), - _funds: funds + funds: _funds }) }; }; @@ -124,7 +124,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage version } })), - _funds: funds + funds: _funds }) }; }; @@ -149,7 +149,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage owner } })), - _funds: funds + funds: _funds }) }; }; @@ -171,7 +171,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage code_id: codeId } })), - _funds: funds + funds: _funds }) }; }; @@ -193,7 +193,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage payment_info: paymentInfo } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts b/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts index 48004019..73d8b24d 100644 --- a/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts @@ -114,7 +114,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { title } })), - _funds: funds + funds: _funds }) }; }; @@ -136,7 +136,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { vote } })), - _funds: funds + funds: _funds }) }; }; @@ -155,7 +155,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { proposal_id: proposalId } })), - _funds: funds + funds: _funds }) }; }; @@ -174,7 +174,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { proposal_id: proposalId } })), - _funds: funds + funds: _funds }) }; }; @@ -211,7 +211,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { threshold } })), - _funds: funds + funds: _funds }) }; }; @@ -230,7 +230,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - _funds: funds + funds: _funds }) }; }; @@ -249,7 +249,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - _funds: funds + funds: _funds }) }; }; @@ -268,7 +268,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - _funds: funds + funds: _funds }) }; }; @@ -287,7 +287,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/builder/bundler_test/contracts/Factory.message-composer.ts b/__output__/builder/bundler_test/contracts/Factory.message-composer.ts index 5eaf412b..e5d6c5de 100644 --- a/__output__/builder/bundler_test/contracts/Factory.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/Factory.message-composer.ts @@ -84,7 +84,7 @@ export class FactoryMessageComposer implements FactoryMessage { create_wallet_msg: createWalletMsg } })), - _funds: funds + funds: _funds }) }; }; @@ -106,7 +106,7 @@ export class FactoryMessageComposer implements FactoryMessage { old_user: oldUser } })), - _funds: funds + funds: _funds }) }; }; @@ -128,7 +128,7 @@ export class FactoryMessageComposer implements FactoryMessage { wallet_address: walletAddress } })), - _funds: funds + funds: _funds }) }; }; @@ -150,7 +150,7 @@ export class FactoryMessageComposer implements FactoryMessage { ty } })), - _funds: funds + funds: _funds }) }; }; @@ -169,7 +169,7 @@ export class FactoryMessageComposer implements FactoryMessage { new_fee: newFee } })), - _funds: funds + funds: _funds }) }; }; @@ -188,7 +188,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr } })), - _funds: funds + funds: _funds }) }; }; @@ -207,7 +207,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/builder/bundler_test/contracts/Minter.message-composer.ts b/__output__/builder/bundler_test/contracts/Minter.message-composer.ts index 8c951ac0..78472c03 100644 --- a/__output__/builder/bundler_test/contracts/Minter.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/Minter.message-composer.ts @@ -62,7 +62,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ mint: {} })), - _funds: funds + funds: _funds }) }; }; @@ -81,7 +81,7 @@ export class MinterMessageComposer implements MinterMessage { whitelist } })), - _funds: funds + funds: _funds }) }; }; @@ -94,7 +94,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ update_start_time: {} })), - _funds: funds + funds: _funds }) }; }; @@ -113,7 +113,7 @@ export class MinterMessageComposer implements MinterMessage { per_address_limit: perAddressLimit } })), - _funds: funds + funds: _funds }) }; }; @@ -132,7 +132,7 @@ export class MinterMessageComposer implements MinterMessage { recipient } })), - _funds: funds + funds: _funds }) }; }; @@ -154,7 +154,7 @@ export class MinterMessageComposer implements MinterMessage { token_id: tokenId } })), - _funds: funds + funds: _funds }) }; }; @@ -167,7 +167,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ withdraw: {} })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/builder/default/CwAdminFactory.message-composer.ts b/__output__/builder/default/CwAdminFactory.message-composer.ts index 5b6dd320..6770e937 100644 --- a/__output__/builder/default/CwAdminFactory.message-composer.ts +++ b/__output__/builder/default/CwAdminFactory.message-composer.ts @@ -53,7 +53,7 @@ export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { label } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/builder/default/CwCodeIdRegistry.message-composer.ts b/__output__/builder/default/CwCodeIdRegistry.message-composer.ts index 97e190f6..fe110741 100644 --- a/__output__/builder/default/CwCodeIdRegistry.message-composer.ts +++ b/__output__/builder/default/CwCodeIdRegistry.message-composer.ts @@ -93,7 +93,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage sender } })), - _funds: funds + funds: _funds }) }; }; @@ -124,7 +124,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage version } })), - _funds: funds + funds: _funds }) }; }; @@ -149,7 +149,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage owner } })), - _funds: funds + funds: _funds }) }; }; @@ -171,7 +171,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage code_id: codeId } })), - _funds: funds + funds: _funds }) }; }; @@ -193,7 +193,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage payment_info: paymentInfo } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/builder/default/CwSingle.message-composer.ts b/__output__/builder/default/CwSingle.message-composer.ts index 48004019..73d8b24d 100644 --- a/__output__/builder/default/CwSingle.message-composer.ts +++ b/__output__/builder/default/CwSingle.message-composer.ts @@ -114,7 +114,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { title } })), - _funds: funds + funds: _funds }) }; }; @@ -136,7 +136,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { vote } })), - _funds: funds + funds: _funds }) }; }; @@ -155,7 +155,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { proposal_id: proposalId } })), - _funds: funds + funds: _funds }) }; }; @@ -174,7 +174,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { proposal_id: proposalId } })), - _funds: funds + funds: _funds }) }; }; @@ -211,7 +211,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { threshold } })), - _funds: funds + funds: _funds }) }; }; @@ -230,7 +230,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - _funds: funds + funds: _funds }) }; }; @@ -249,7 +249,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - _funds: funds + funds: _funds }) }; }; @@ -268,7 +268,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - _funds: funds + funds: _funds }) }; }; @@ -287,7 +287,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/builder/default/Factory.message-composer.ts b/__output__/builder/default/Factory.message-composer.ts index 5eaf412b..e5d6c5de 100644 --- a/__output__/builder/default/Factory.message-composer.ts +++ b/__output__/builder/default/Factory.message-composer.ts @@ -84,7 +84,7 @@ export class FactoryMessageComposer implements FactoryMessage { create_wallet_msg: createWalletMsg } })), - _funds: funds + funds: _funds }) }; }; @@ -106,7 +106,7 @@ export class FactoryMessageComposer implements FactoryMessage { old_user: oldUser } })), - _funds: funds + funds: _funds }) }; }; @@ -128,7 +128,7 @@ export class FactoryMessageComposer implements FactoryMessage { wallet_address: walletAddress } })), - _funds: funds + funds: _funds }) }; }; @@ -150,7 +150,7 @@ export class FactoryMessageComposer implements FactoryMessage { ty } })), - _funds: funds + funds: _funds }) }; }; @@ -169,7 +169,7 @@ export class FactoryMessageComposer implements FactoryMessage { new_fee: newFee } })), - _funds: funds + funds: _funds }) }; }; @@ -188,7 +188,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr } })), - _funds: funds + funds: _funds }) }; }; @@ -207,7 +207,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/builder/default/Minter.message-composer.ts b/__output__/builder/default/Minter.message-composer.ts index 8c951ac0..78472c03 100644 --- a/__output__/builder/default/Minter.message-composer.ts +++ b/__output__/builder/default/Minter.message-composer.ts @@ -62,7 +62,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ mint: {} })), - _funds: funds + funds: _funds }) }; }; @@ -81,7 +81,7 @@ export class MinterMessageComposer implements MinterMessage { whitelist } })), - _funds: funds + funds: _funds }) }; }; @@ -94,7 +94,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ update_start_time: {} })), - _funds: funds + funds: _funds }) }; }; @@ -113,7 +113,7 @@ export class MinterMessageComposer implements MinterMessage { per_address_limit: perAddressLimit } })), - _funds: funds + funds: _funds }) }; }; @@ -132,7 +132,7 @@ export class MinterMessageComposer implements MinterMessage { recipient } })), - _funds: funds + funds: _funds }) }; }; @@ -154,7 +154,7 @@ export class MinterMessageComposer implements MinterMessage { token_id: tokenId } })), - _funds: funds + funds: _funds }) }; }; @@ -167,7 +167,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ withdraw: {} })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/builder/no-extends/CwAdminFactory.message-composer.ts b/__output__/builder/no-extends/CwAdminFactory.message-composer.ts index 5b6dd320..6770e937 100644 --- a/__output__/builder/no-extends/CwAdminFactory.message-composer.ts +++ b/__output__/builder/no-extends/CwAdminFactory.message-composer.ts @@ -53,7 +53,7 @@ export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { label } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts b/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts index 97e190f6..fe110741 100644 --- a/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts +++ b/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts @@ -93,7 +93,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage sender } })), - _funds: funds + funds: _funds }) }; }; @@ -124,7 +124,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage version } })), - _funds: funds + funds: _funds }) }; }; @@ -149,7 +149,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage owner } })), - _funds: funds + funds: _funds }) }; }; @@ -171,7 +171,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage code_id: codeId } })), - _funds: funds + funds: _funds }) }; }; @@ -193,7 +193,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage payment_info: paymentInfo } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/builder/no-extends/CwSingle.message-composer.ts b/__output__/builder/no-extends/CwSingle.message-composer.ts index 48004019..73d8b24d 100644 --- a/__output__/builder/no-extends/CwSingle.message-composer.ts +++ b/__output__/builder/no-extends/CwSingle.message-composer.ts @@ -114,7 +114,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { title } })), - _funds: funds + funds: _funds }) }; }; @@ -136,7 +136,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { vote } })), - _funds: funds + funds: _funds }) }; }; @@ -155,7 +155,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { proposal_id: proposalId } })), - _funds: funds + funds: _funds }) }; }; @@ -174,7 +174,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { proposal_id: proposalId } })), - _funds: funds + funds: _funds }) }; }; @@ -211,7 +211,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { threshold } })), - _funds: funds + funds: _funds }) }; }; @@ -230,7 +230,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - _funds: funds + funds: _funds }) }; }; @@ -249,7 +249,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - _funds: funds + funds: _funds }) }; }; @@ -268,7 +268,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - _funds: funds + funds: _funds }) }; }; @@ -287,7 +287,7 @@ export class CwSingleMessageComposer implements CwSingleMessage { address } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/builder/no-extends/Factory.message-composer.ts b/__output__/builder/no-extends/Factory.message-composer.ts index 5eaf412b..e5d6c5de 100644 --- a/__output__/builder/no-extends/Factory.message-composer.ts +++ b/__output__/builder/no-extends/Factory.message-composer.ts @@ -84,7 +84,7 @@ export class FactoryMessageComposer implements FactoryMessage { create_wallet_msg: createWalletMsg } })), - _funds: funds + funds: _funds }) }; }; @@ -106,7 +106,7 @@ export class FactoryMessageComposer implements FactoryMessage { old_user: oldUser } })), - _funds: funds + funds: _funds }) }; }; @@ -128,7 +128,7 @@ export class FactoryMessageComposer implements FactoryMessage { wallet_address: walletAddress } })), - _funds: funds + funds: _funds }) }; }; @@ -150,7 +150,7 @@ export class FactoryMessageComposer implements FactoryMessage { ty } })), - _funds: funds + funds: _funds }) }; }; @@ -169,7 +169,7 @@ export class FactoryMessageComposer implements FactoryMessage { new_fee: newFee } })), - _funds: funds + funds: _funds }) }; }; @@ -188,7 +188,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr } })), - _funds: funds + funds: _funds }) }; }; @@ -207,7 +207,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/builder/no-extends/Minter.message-composer.ts b/__output__/builder/no-extends/Minter.message-composer.ts index 8c951ac0..78472c03 100644 --- a/__output__/builder/no-extends/Minter.message-composer.ts +++ b/__output__/builder/no-extends/Minter.message-composer.ts @@ -62,7 +62,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ mint: {} })), - _funds: funds + funds: _funds }) }; }; @@ -81,7 +81,7 @@ export class MinterMessageComposer implements MinterMessage { whitelist } })), - _funds: funds + funds: _funds }) }; }; @@ -94,7 +94,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ update_start_time: {} })), - _funds: funds + funds: _funds }) }; }; @@ -113,7 +113,7 @@ export class MinterMessageComposer implements MinterMessage { per_address_limit: perAddressLimit } })), - _funds: funds + funds: _funds }) }; }; @@ -132,7 +132,7 @@ export class MinterMessageComposer implements MinterMessage { recipient } })), - _funds: funds + funds: _funds }) }; }; @@ -154,7 +154,7 @@ export class MinterMessageComposer implements MinterMessage { token_id: tokenId } })), - _funds: funds + funds: _funds }) }; }; @@ -167,7 +167,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ withdraw: {} })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/daodao/cw-admin-factory/CwAdminFactory.message-composer.ts b/__output__/daodao/cw-admin-factory/CwAdminFactory.message-composer.ts index 5b6dd320..6770e937 100644 --- a/__output__/daodao/cw-admin-factory/CwAdminFactory.message-composer.ts +++ b/__output__/daodao/cw-admin-factory/CwAdminFactory.message-composer.ts @@ -53,7 +53,7 @@ export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { label } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.message-composer.ts b/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.message-composer.ts index 97e190f6..fe110741 100644 --- a/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.message-composer.ts +++ b/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.message-composer.ts @@ -93,7 +93,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage sender } })), - _funds: funds + funds: _funds }) }; }; @@ -124,7 +124,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage version } })), - _funds: funds + funds: _funds }) }; }; @@ -149,7 +149,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage owner } })), - _funds: funds + funds: _funds }) }; }; @@ -171,7 +171,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage code_id: codeId } })), - _funds: funds + funds: _funds }) }; }; @@ -193,7 +193,7 @@ export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage payment_info: paymentInfo } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/daodao/cw-named-groups/CwNamedGroups.message-composer.ts b/__output__/daodao/cw-named-groups/CwNamedGroups.message-composer.ts index 1c15918a..4836e52f 100644 --- a/__output__/daodao/cw-named-groups/CwNamedGroups.message-composer.ts +++ b/__output__/daodao/cw-named-groups/CwNamedGroups.message-composer.ts @@ -65,7 +65,7 @@ export class CwNamedGroupsMessageComposer implements CwNamedGroupsMessage { group } })), - _funds: funds + funds: _funds }) }; }; @@ -84,7 +84,7 @@ export class CwNamedGroupsMessageComposer implements CwNamedGroupsMessage { group } })), - _funds: funds + funds: _funds }) }; }; @@ -103,7 +103,7 @@ export class CwNamedGroupsMessageComposer implements CwNamedGroupsMessage { owner } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/daodao/cw-proposal-single/CwProposalSingle.message-composer.ts b/__output__/daodao/cw-proposal-single/CwProposalSingle.message-composer.ts index c07212cd..8843416c 100644 --- a/__output__/daodao/cw-proposal-single/CwProposalSingle.message-composer.ts +++ b/__output__/daodao/cw-proposal-single/CwProposalSingle.message-composer.ts @@ -114,7 +114,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage title } })), - _funds: funds + funds: _funds }) }; }; @@ -136,7 +136,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage vote } })), - _funds: funds + funds: _funds }) }; }; @@ -155,7 +155,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage proposal_id: proposalId } })), - _funds: funds + funds: _funds }) }; }; @@ -174,7 +174,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage proposal_id: proposalId } })), - _funds: funds + funds: _funds }) }; }; @@ -211,7 +211,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage threshold } })), - _funds: funds + funds: _funds }) }; }; @@ -230,7 +230,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage address } })), - _funds: funds + funds: _funds }) }; }; @@ -249,7 +249,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage address } })), - _funds: funds + funds: _funds }) }; }; @@ -268,7 +268,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage address } })), - _funds: funds + funds: _funds }) }; }; @@ -287,7 +287,7 @@ export class CwProposalSingleMessageComposer implements CwProposalSingleMessage address } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts b/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts index a34e8c51..e7f1a152 100644 --- a/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts +++ b/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts @@ -107,7 +107,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { new_owner: newOwner } })), - _funds: funds + funds: _funds }) }; }; @@ -120,7 +120,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { msg: toUtf8(JSON.stringify({ accept_ownership: {} })), - _funds: funds + funds: _funds }) }; }; @@ -139,7 +139,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { user } })), - _funds: funds + funds: _funds }) }; }; @@ -161,7 +161,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { token_id: tokenId } })), - _funds: funds + funds: _funds }) }; }; @@ -186,7 +186,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { token_id: tokenId } })), - _funds: funds + funds: _funds }) }; }; @@ -211,7 +211,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { token_id: tokenId } })), - _funds: funds + funds: _funds }) }; }; @@ -233,7 +233,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { token_id: tokenId } })), - _funds: funds + funds: _funds }) }; }; @@ -255,7 +255,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { operator } })), - _funds: funds + funds: _funds }) }; }; @@ -274,7 +274,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { operator } })), - _funds: funds + funds: _funds }) }; }; @@ -293,7 +293,7 @@ export class AccountsNftMessageComposer implements AccountsNftMessage { token_id: tokenId } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.message-composer.ts b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.message-composer.ts index 4df5e0e6..f29fcb55 100644 --- a/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.message-composer.ts +++ b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.message-composer.ts @@ -77,7 +77,7 @@ export class Cw3FixedMultiSigMessageComposer implements Cw3FixedMultiSigMessage title } })), - _funds: funds + funds: _funds }) }; }; @@ -99,7 +99,7 @@ export class Cw3FixedMultiSigMessageComposer implements Cw3FixedMultiSigMessage vote } })), - _funds: funds + funds: _funds }) }; }; @@ -118,7 +118,7 @@ export class Cw3FixedMultiSigMessageComposer implements Cw3FixedMultiSigMessage proposal_id: proposalId } })), - _funds: funds + funds: _funds }) }; }; @@ -137,7 +137,7 @@ export class Cw3FixedMultiSigMessageComposer implements Cw3FixedMultiSigMessage proposal_id: proposalId } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/idl-version/cw4-group/Cw4Group.message-composer.ts b/__output__/idl-version/cw4-group/Cw4Group.message-composer.ts index 02af046e..e9cdd0d6 100644 --- a/__output__/idl-version/cw4-group/Cw4Group.message-composer.ts +++ b/__output__/idl-version/cw4-group/Cw4Group.message-composer.ts @@ -63,7 +63,7 @@ export class Cw4GroupMessageComposer implements Cw4GroupMessage { admin } })), - _funds: funds + funds: _funds }) }; }; @@ -85,7 +85,7 @@ export class Cw4GroupMessageComposer implements Cw4GroupMessage { remove } })), - _funds: funds + funds: _funds }) }; }; @@ -104,7 +104,7 @@ export class Cw4GroupMessageComposer implements Cw4GroupMessage { addr } })), - _funds: funds + funds: _funds }) }; }; @@ -123,7 +123,7 @@ export class Cw4GroupMessageComposer implements Cw4GroupMessage { addr } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts b/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts index 132e7a67..fe8d0b77 100644 --- a/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts +++ b/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts @@ -50,7 +50,7 @@ export class CyberPunkMessageComposer implements CyberPunkMessage { time_cost: timeCost } })), - _funds: funds + funds: _funds }) }; }; @@ -63,7 +63,7 @@ export class CyberPunkMessageComposer implements CyberPunkMessage { msg: toUtf8(JSON.stringify({ mirror_env: {} })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/idl-version/hackatom/HackAtom.message-composer.ts b/__output__/idl-version/hackatom/HackAtom.message-composer.ts index 26ac2d28..c7463089 100644 --- a/__output__/idl-version/hackatom/HackAtom.message-composer.ts +++ b/__output__/idl-version/hackatom/HackAtom.message-composer.ts @@ -50,7 +50,7 @@ export class HackAtomMessageComposer implements HackAtomMessage { msg: toUtf8(JSON.stringify({ release: {} })), - _funds: funds + funds: _funds }) }; }; @@ -63,7 +63,7 @@ export class HackAtomMessageComposer implements HackAtomMessage { msg: toUtf8(JSON.stringify({ cpu_loop: {} })), - _funds: funds + funds: _funds }) }; }; @@ -76,7 +76,7 @@ export class HackAtomMessageComposer implements HackAtomMessage { msg: toUtf8(JSON.stringify({ storage_loop: {} })), - _funds: funds + funds: _funds }) }; }; @@ -89,7 +89,7 @@ export class HackAtomMessageComposer implements HackAtomMessage { msg: toUtf8(JSON.stringify({ memory_loop: {} })), - _funds: funds + funds: _funds }) }; }; @@ -102,7 +102,7 @@ export class HackAtomMessageComposer implements HackAtomMessage { msg: toUtf8(JSON.stringify({ message_loop: {} })), - _funds: funds + funds: _funds }) }; }; @@ -121,7 +121,7 @@ export class HackAtomMessageComposer implements HackAtomMessage { pages } })), - _funds: funds + funds: _funds }) }; }; @@ -134,7 +134,7 @@ export class HackAtomMessageComposer implements HackAtomMessage { msg: toUtf8(JSON.stringify({ panic: {} })), - _funds: funds + funds: _funds }) }; }; @@ -147,7 +147,7 @@ export class HackAtomMessageComposer implements HackAtomMessage { msg: toUtf8(JSON.stringify({ user_errors_in_api_calls: {} })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/minter/Minter.message-composer.ts b/__output__/minter/Minter.message-composer.ts index 8c951ac0..78472c03 100644 --- a/__output__/minter/Minter.message-composer.ts +++ b/__output__/minter/Minter.message-composer.ts @@ -62,7 +62,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ mint: {} })), - _funds: funds + funds: _funds }) }; }; @@ -81,7 +81,7 @@ export class MinterMessageComposer implements MinterMessage { whitelist } })), - _funds: funds + funds: _funds }) }; }; @@ -94,7 +94,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ update_start_time: {} })), - _funds: funds + funds: _funds }) }; }; @@ -113,7 +113,7 @@ export class MinterMessageComposer implements MinterMessage { per_address_limit: perAddressLimit } })), - _funds: funds + funds: _funds }) }; }; @@ -132,7 +132,7 @@ export class MinterMessageComposer implements MinterMessage { recipient } })), - _funds: funds + funds: _funds }) }; }; @@ -154,7 +154,7 @@ export class MinterMessageComposer implements MinterMessage { token_id: tokenId } })), - _funds: funds + funds: _funds }) }; }; @@ -167,7 +167,7 @@ export class MinterMessageComposer implements MinterMessage { msg: toUtf8(JSON.stringify({ withdraw: {} })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/sg721/Sg721.message-composer.ts b/__output__/sg721/Sg721.message-composer.ts index ab6d060a..84f6d2bd 100644 --- a/__output__/sg721/Sg721.message-composer.ts +++ b/__output__/sg721/Sg721.message-composer.ts @@ -108,7 +108,7 @@ export class Sg721MessageComposer implements Sg721Message { token_id: tokenId } })), - _funds: funds + funds: _funds }) }; }; @@ -133,7 +133,7 @@ export class Sg721MessageComposer implements Sg721Message { token_id: tokenId } })), - _funds: funds + funds: _funds }) }; }; @@ -158,7 +158,7 @@ export class Sg721MessageComposer implements Sg721Message { token_id: tokenId } })), - _funds: funds + funds: _funds }) }; }; @@ -180,7 +180,7 @@ export class Sg721MessageComposer implements Sg721Message { token_id: tokenId } })), - _funds: funds + funds: _funds }) }; }; @@ -202,7 +202,7 @@ export class Sg721MessageComposer implements Sg721Message { operator } })), - _funds: funds + funds: _funds }) }; }; @@ -221,7 +221,7 @@ export class Sg721MessageComposer implements Sg721Message { operator } })), - _funds: funds + funds: _funds }) }; }; @@ -249,7 +249,7 @@ export class Sg721MessageComposer implements Sg721Message { token_uri: tokenUri } })), - _funds: funds + funds: _funds }) }; }; @@ -268,7 +268,7 @@ export class Sg721MessageComposer implements Sg721Message { token_id: tokenId } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/vectis/factory/Factory.message-composer.ts b/__output__/vectis/factory/Factory.message-composer.ts index 5eaf412b..e5d6c5de 100644 --- a/__output__/vectis/factory/Factory.message-composer.ts +++ b/__output__/vectis/factory/Factory.message-composer.ts @@ -84,7 +84,7 @@ export class FactoryMessageComposer implements FactoryMessage { create_wallet_msg: createWalletMsg } })), - _funds: funds + funds: _funds }) }; }; @@ -106,7 +106,7 @@ export class FactoryMessageComposer implements FactoryMessage { old_user: oldUser } })), - _funds: funds + funds: _funds }) }; }; @@ -128,7 +128,7 @@ export class FactoryMessageComposer implements FactoryMessage { wallet_address: walletAddress } })), - _funds: funds + funds: _funds }) }; }; @@ -150,7 +150,7 @@ export class FactoryMessageComposer implements FactoryMessage { ty } })), - _funds: funds + funds: _funds }) }; }; @@ -169,7 +169,7 @@ export class FactoryMessageComposer implements FactoryMessage { new_fee: newFee } })), - _funds: funds + funds: _funds }) }; }; @@ -188,7 +188,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr } })), - _funds: funds + funds: _funds }) }; }; @@ -207,7 +207,7 @@ export class FactoryMessageComposer implements FactoryMessage { addr } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/vectis/govec/Govec.message-composer.ts b/__output__/vectis/govec/Govec.message-composer.ts index 7b030c9f..4c0426bc 100644 --- a/__output__/vectis/govec/Govec.message-composer.ts +++ b/__output__/vectis/govec/Govec.message-composer.ts @@ -82,7 +82,7 @@ export class GovecMessageComposer implements GovecMessage { msgs } })), - _funds: funds + funds: _funds }) }; }; @@ -95,7 +95,7 @@ export class GovecMessageComposer implements GovecMessage { msg: toUtf8(JSON.stringify({ revert_freeze_status: {} })), - _funds: funds + funds: _funds }) }; }; @@ -114,7 +114,7 @@ export class GovecMessageComposer implements GovecMessage { transaction } })), - _funds: funds + funds: _funds }) }; }; @@ -133,7 +133,7 @@ export class GovecMessageComposer implements GovecMessage { new_user_address: newUserAddress } })), - _funds: funds + funds: _funds }) }; }; @@ -152,7 +152,7 @@ export class GovecMessageComposer implements GovecMessage { new_relayer_address: newRelayerAddress } })), - _funds: funds + funds: _funds }) }; }; @@ -171,7 +171,7 @@ export class GovecMessageComposer implements GovecMessage { relayer_address: relayerAddress } })), - _funds: funds + funds: _funds }) }; }; @@ -193,7 +193,7 @@ export class GovecMessageComposer implements GovecMessage { new_multisig_code_id: newMultisigCodeId } })), - _funds: funds + funds: _funds }) }; }; @@ -212,7 +212,7 @@ export class GovecMessageComposer implements GovecMessage { new_label: newLabel } })), - _funds: funds + funds: _funds }) }; }; diff --git a/__output__/vectis/proxy/Proxy.message-composer.ts b/__output__/vectis/proxy/Proxy.message-composer.ts index 44fa3716..92591221 100644 --- a/__output__/vectis/proxy/Proxy.message-composer.ts +++ b/__output__/vectis/proxy/Proxy.message-composer.ts @@ -82,7 +82,7 @@ export class ProxyMessageComposer implements ProxyMessage { msgs } })), - _funds: funds + funds: _funds }) }; }; @@ -95,7 +95,7 @@ export class ProxyMessageComposer implements ProxyMessage { msg: toUtf8(JSON.stringify({ revert_freeze_status: {} })), - _funds: funds + funds: _funds }) }; }; @@ -114,7 +114,7 @@ export class ProxyMessageComposer implements ProxyMessage { transaction } })), - _funds: funds + funds: _funds }) }; }; @@ -133,7 +133,7 @@ export class ProxyMessageComposer implements ProxyMessage { new_user_address: newUserAddress } })), - _funds: funds + funds: _funds }) }; }; @@ -152,7 +152,7 @@ export class ProxyMessageComposer implements ProxyMessage { new_relayer_address: newRelayerAddress } })), - _funds: funds + funds: _funds }) }; }; @@ -171,7 +171,7 @@ export class ProxyMessageComposer implements ProxyMessage { relayer_address: relayerAddress } })), - _funds: funds + funds: _funds }) }; }; @@ -193,7 +193,7 @@ export class ProxyMessageComposer implements ProxyMessage { new_multisig_code_id: newMultisigCodeId } })), - _funds: funds + funds: _funds }) }; }; @@ -212,7 +212,7 @@ export class ProxyMessageComposer implements ProxyMessage { new_label: newLabel } })), - _funds: funds + funds: _funds }) }; }; diff --git a/packages/wasm-ast-types/src/message-composer/__snapshots__/message-composer.spec.ts.snap b/packages/wasm-ast-types/src/message-composer/__snapshots__/message-composer.spec.ts.snap index a211534f..2fdcb0a8 100644 --- a/packages/wasm-ast-types/src/message-composer/__snapshots__/message-composer.spec.ts.snap +++ b/packages/wasm-ast-types/src/message-composer/__snapshots__/message-composer.spec.ts.snap @@ -103,7 +103,7 @@ exports[`execute classes 1`] = ` token_id: tokenId } })), - _funds: funds + funds: _funds }) }; }; @@ -128,7 +128,7 @@ exports[`execute classes 1`] = ` token_id: tokenId } })), - _funds: funds + funds: _funds }) }; }; @@ -153,7 +153,7 @@ exports[`execute classes 1`] = ` token_id: tokenId } })), - _funds: funds + funds: _funds }) }; }; @@ -175,7 +175,7 @@ exports[`execute classes 1`] = ` token_id: tokenId } })), - _funds: funds + funds: _funds }) }; }; @@ -197,7 +197,7 @@ exports[`execute classes 1`] = ` operator } })), - _funds: funds + funds: _funds }) }; }; @@ -216,7 +216,7 @@ exports[`execute classes 1`] = ` operator } })), - _funds: funds + funds: _funds }) }; }; @@ -244,7 +244,7 @@ exports[`execute classes 1`] = ` token_uri: tokenUri } })), - _funds: funds + funds: _funds }) }; }; @@ -263,7 +263,7 @@ exports[`execute classes 1`] = ` token_id: tokenId } })), - _funds: funds + funds: _funds }) }; }; @@ -297,7 +297,7 @@ exports[`ownershipClass 1`] = ` new_factory: newFactory } })), - _funds: funds + funds: _funds }) }; }; @@ -310,7 +310,7 @@ exports[`ownershipClass 1`] = ` msg: toUtf8(JSON.stringify({ update_ownership: action })), - _funds: funds + funds: _funds }) }; }; diff --git a/packages/wasm-ast-types/src/message-composer/message-composer.ts b/packages/wasm-ast-types/src/message-composer/message-composer.ts index 99ad1f64..841d666b 100644 --- a/packages/wasm-ast-types/src/message-composer/message-composer.ts +++ b/packages/wasm-ast-types/src/message-composer/message-composer.ts @@ -105,8 +105,8 @@ const createWasmExecMethodMessageComposer = ( ]) ), t.objectProperty( - t.identifier('_funds'), - t.identifier('funds') + t.identifier('funds'), + t.identifier('_funds') ) ]) ] diff --git a/yarn.lock b/yarn.lock index c515cc58..220b3fe5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9218,16 +9218,6 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" -"wasm-ast-types@file:packages/wasm-ast-types": - version "0.21.0" - dependencies: - "@babel/runtime" "^7.18.9" - "@babel/types" "7.18.10" - "@jest/transform" "28.1.3" - ast-stringify "0.1.0" - case "1.6.3" - deepmerge "4.2.2" - wcwidth@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz" From 8dc8c227bee95009c65b021de1677a1f2385c02e Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Sun, 21 May 2023 15:53:32 +0300 Subject: [PATCH 113/287] Update react-query to use normal funds --- .../Factory.react-query.ts | 14 +++--- .../__snapshots__/react-query.spec.ts.snap | 20 ++++----- .../src/react-query/react-query.ts | 43 +++++++++++-------- packages/wasm-ast-types/src/utils/babel.ts | 7 +-- .../wasm-ast-types/src/utils/constants.ts | 31 +++++++------ 5 files changed, 66 insertions(+), 49 deletions(-) diff --git a/__output__/vectis/factory-w-mutations/Factory.react-query.ts b/__output__/vectis/factory-w-mutations/Factory.react-query.ts index d00d3933..2945c3b6 100644 --- a/__output__/vectis/factory-w-mutations/Factory.react-query.ts +++ b/__output__/vectis/factory-w-mutations/Factory.react-query.ts @@ -92,7 +92,7 @@ export interface FactoryUpdateAdminMutation { args?: { fee?: number | StdFee | "auto"; memo?: string; - _funds?: Coin[]; + funds?: Coin[]; }; } export function useFactoryUpdateAdminMutation(options?: Omit, "mutationFn">) { @@ -114,7 +114,7 @@ export interface FactoryUpdateGovecAddrMutation { args?: { fee?: number | StdFee | "auto"; memo?: string; - _funds?: Coin[]; + funds?: Coin[]; }; } export function useFactoryUpdateGovecAddrMutation(options?: Omit, "mutationFn">) { @@ -136,7 +136,7 @@ export interface FactoryUpdateWalletFeeMutation { args?: { fee?: number | StdFee | "auto"; memo?: string; - _funds?: Coin[]; + funds?: Coin[]; }; } export function useFactoryUpdateWalletFeeMutation(options?: Omit, "mutationFn">) { @@ -159,7 +159,7 @@ export interface FactoryUpdateCodeIdMutation { args?: { fee?: number | StdFee | "auto"; memo?: string; - _funds?: Coin[]; + funds?: Coin[]; }; } export function useFactoryUpdateCodeIdMutation(options?: Omit, "mutationFn">) { @@ -182,7 +182,7 @@ export interface FactoryMigrateWalletMutation { args?: { fee?: number | StdFee | "auto"; memo?: string; - _funds?: Coin[]; + funds?: Coin[]; }; } export function useFactoryMigrateWalletMutation(options?: Omit, "mutationFn">) { @@ -205,7 +205,7 @@ export interface FactoryUpdateProxyUserMutation { args?: { fee?: number | StdFee | "auto"; memo?: string; - _funds?: Coin[]; + funds?: Coin[]; }; } export function useFactoryUpdateProxyUserMutation(options?: Omit, "mutationFn">) { @@ -227,7 +227,7 @@ export interface FactoryCreateWalletMutation { args?: { fee?: number | StdFee | "auto"; memo?: string; - _funds?: Coin[]; + funds?: Coin[]; }; } export function useFactoryCreateWalletMutation(options?: Omit, "mutationFn">) { diff --git a/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap b/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap index 6f0a3ecb..6990d5d9 100644 --- a/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap +++ b/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap @@ -1133,7 +1133,7 @@ exports[`createReactQueryHooks 6`] = ` args?: { fee?: number | StdFee | \\"auto\\"; memo?: string; - _funds?: Coin[]; + funds?: Coin[]; }; } export function useSg721BurnMutation(options?: Omit, \\"mutationFn\\">) { @@ -1158,7 +1158,7 @@ export interface Sg721MintMutation { args?: { fee?: number | StdFee | \\"auto\\"; memo?: string; - _funds?: Coin[]; + funds?: Coin[]; }; } export function useSg721MintMutation(options?: Omit, \\"mutationFn\\">) { @@ -1180,7 +1180,7 @@ export interface Sg721RevokeAllMutation { args?: { fee?: number | StdFee | \\"auto\\"; memo?: string; - _funds?: Coin[]; + funds?: Coin[]; }; } export function useSg721RevokeAllMutation(options?: Omit, \\"mutationFn\\">) { @@ -1203,7 +1203,7 @@ export interface Sg721ApproveAllMutation { args?: { fee?: number | StdFee | \\"auto\\"; memo?: string; - _funds?: Coin[]; + funds?: Coin[]; }; } export function useSg721ApproveAllMutation(options?: Omit, \\"mutationFn\\">) { @@ -1226,7 +1226,7 @@ export interface Sg721RevokeMutation { args?: { fee?: number | StdFee | \\"auto\\"; memo?: string; - _funds?: Coin[]; + funds?: Coin[]; }; } export function useSg721RevokeMutation(options?: Omit, \\"mutationFn\\">) { @@ -1250,7 +1250,7 @@ export interface Sg721ApproveMutation { args?: { fee?: number | StdFee | \\"auto\\"; memo?: string; - _funds?: Coin[]; + funds?: Coin[]; }; } export function useSg721ApproveMutation(options?: Omit, \\"mutationFn\\">) { @@ -1274,7 +1274,7 @@ export interface Sg721SendNftMutation { args?: { fee?: number | StdFee | \\"auto\\"; memo?: string; - _funds?: Coin[]; + funds?: Coin[]; }; } export function useSg721SendNftMutation(options?: Omit, \\"mutationFn\\">) { @@ -1297,7 +1297,7 @@ export interface Sg721TransferNftMutation { args?: { fee?: number | StdFee | \\"auto\\"; memo?: string; - _funds?: Coin[]; + funds?: Coin[]; }; } export function useSg721TransferNftMutation(options?: Omit, \\"mutationFn\\">) { @@ -1320,7 +1320,7 @@ exports[`ownership 1`] = ` args?: { fee?: number | StdFee | \\"auto\\"; memo?: string; - _funds?: Coin[]; + funds?: Coin[]; }; } export function useOwnershipUpdateOwnershipMutation(options?: Omit, \\"mutationFn\\">) { @@ -1342,7 +1342,7 @@ export interface OwnershipSetFactoryMutation { args?: { fee?: number | StdFee | \\"auto\\"; memo?: string; - _funds?: Coin[]; + funds?: Coin[]; }; } export function useOwnershipSetFactoryMutation(options?: Omit, \\"mutationFn\\">) { diff --git a/packages/wasm-ast-types/src/react-query/react-query.ts b/packages/wasm-ast-types/src/react-query/react-query.ts index 167db1ca..7f123b5c 100644 --- a/packages/wasm-ast-types/src/react-query/react-query.ts +++ b/packages/wasm-ast-types/src/react-query/react-query.ts @@ -4,9 +4,11 @@ import { camel, pascal } from 'case'; import { ExecuteMsg, QueryMsg } from '../types'; import { callExpression, - createTypedObjectParams, FIXED_EXECUTE_PARAMS, + createTypedObjectParams, + FIXED_EXECUTE_PARAMS, getMessageProperties, identifier, + OPTIONAL_FUNDS_PARAM, tsObjectPattern, tsPropertySignature } from '../utils'; @@ -25,6 +27,7 @@ import { import { ReactQueryOptions, RenderContext } from '../context'; import { JSONSchema } from '../types'; import { ArrowFunctionExpression, objectExpression } from '@babel/types'; +import { OPTIONAL_FEE_PARAM, OPTIONAL_MEMO_PARAM } from '../utils/constants'; interface ReactQueryHookQuery { context: RenderContext; @@ -119,7 +122,7 @@ export const createReactQueryHooks = ({ context, queryFactoryName, queryKeysName, - queryMsgs, + queryMsgs }) ); } @@ -406,7 +409,7 @@ export const createReactQueryMutationArgsInterface = ({ ) ]; - const msgType = createTypedObjectParams(context, jsonschema)?.typeAnnotation + const msgType = createTypedObjectParams(context, jsonschema)?.typeAnnotation; if (msgType) { body.push( @@ -414,7 +417,8 @@ export const createReactQueryMutationArgsInterface = ({ t.identifier('msg'), // @ts-ignore msgType - )); + ) + ); } context.addUtil('StdFee'); @@ -424,16 +428,18 @@ export const createReactQueryMutationArgsInterface = ({ t.identifier('args'), t.tsTypeAnnotation( // @ts-ignore:next-line - t.tsTypeLiteral( - FIXED_EXECUTE_PARAMS.map((param) => - propertySignature( - param.name, - // @ts-ignore:next-line - param.typeAnnotation, - param.optional - ) as t.TSTypeElement - ) - ) + t.tsTypeLiteral([ + propertySignature('fee', OPTIONAL_FEE_PARAM.typeAnnotation, true), + propertySignature('memo', OPTIONAL_MEMO_PARAM.typeAnnotation, true), + { + ...propertySignature( + 'funds', + OPTIONAL_FUNDS_PARAM.typeAnnotation, + true + ), + value: '_funds' + } + ]) ) ); @@ -786,7 +792,9 @@ function createReactQueryFactory({ t.tsTypeReference( t.identifier(hookParamsTypeName), t.tsTypeParameterInstantiation([ - t.tsTypeReference(t.identifier(GENERIC_SELECT_RESPONSE_NAME)) + t.tsTypeReference( + t.identifier(GENERIC_SELECT_RESPONSE_NAME) + ) ]) ) ) @@ -839,7 +847,9 @@ function createReactQueryFactory({ t.tsTypeParameterInstantiation([ t.tsTypeReference(t.identifier(responseType)), t.tsTypeReference(t.identifier('Error')), - t.tsTypeReference(t.identifier(GENERIC_SELECT_RESPONSE_NAME)) + t.tsTypeReference( + t.identifier(GENERIC_SELECT_RESPONSE_NAME) + ) ]) ) ); @@ -870,7 +880,6 @@ function createReactQueryHookGenericInterface({ QueryClient, genericQueryInterfaceName }: ReactQueryHookGenericInterface) { - const options = context.options.reactQuery; const genericResponseTypeName = 'TResponse'; diff --git a/packages/wasm-ast-types/src/utils/babel.ts b/packages/wasm-ast-types/src/utils/babel.ts index 8515f192..93e68dee 100644 --- a/packages/wasm-ast-types/src/utils/babel.ts +++ b/packages/wasm-ast-types/src/utils/babel.ts @@ -1,18 +1,19 @@ import * as t from '@babel/types'; import { snake } from "case"; import { Field, QueryMsg, ExecuteMsg } from '../types'; -import { TSTypeAnnotation, TSExpressionWithTypeArguments } from '@babel/types'; +import { TSTypeAnnotation, TSExpressionWithTypeArguments, Noop, TypeAnnotation } from '@babel/types'; import { refLookup } from './ref'; // t.TSPropertySignature - kind? export const propertySignature = ( name: string, - typeAnnotation: t.TSTypeAnnotation, + typeAnnotation: TSTypeAnnotation, optional: boolean = false -) => { +): t.TSPropertySignature => { return { type: 'TSPropertySignature', key: t.identifier(name), + kind: 'get', typeAnnotation, optional } diff --git a/packages/wasm-ast-types/src/utils/constants.ts b/packages/wasm-ast-types/src/utils/constants.ts index 46122904..ab2a3e23 100644 --- a/packages/wasm-ast-types/src/utils/constants.ts +++ b/packages/wasm-ast-types/src/utils/constants.ts @@ -6,18 +6,25 @@ export const OPTIONAL_FUNDS_PARAM = identifier( t.tsTypeAnnotation(t.tsArrayType(t.tsTypeReference(t.identifier('Coin')))), true ); -export const FIXED_EXECUTE_PARAMS = [ - identifier( - 'fee', - t.tsTypeAnnotation( - t.tsUnionType([ - t.tsNumberKeyword(), - t.tsTypeReference(t.identifier('StdFee')), - t.tsLiteralType(t.stringLiteral('auto')) - ]) - ), - true +export const OPTIONAL_FEE_PARAM = identifier( + 'fee', + t.tsTypeAnnotation( + t.tsUnionType([ + t.tsNumberKeyword(), + t.tsTypeReference(t.identifier('StdFee')), + t.tsLiteralType(t.stringLiteral('auto')) + ]) ), - identifier('memo', t.tsTypeAnnotation(t.tsStringKeyword()), true), + true +); +export const OPTIONAL_MEMO_PARAM = identifier( + 'memo', + t.tsTypeAnnotation(t.tsStringKeyword()), + true +); + +export const FIXED_EXECUTE_PARAMS = [ + OPTIONAL_FEE_PARAM, + OPTIONAL_MEMO_PARAM, OPTIONAL_FUNDS_PARAM ]; From a9d3a034ab80639f46fede8a42d92910149375af Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Sun, 21 May 2023 16:00:19 +0300 Subject: [PATCH 114/287] Update react-query to use normal funds in mutations --- .../__snapshots__/react-query.spec.ts.snap | 40 +++++++++---------- .../src/react-query/react-query.ts | 27 +++++-------- 2 files changed, 31 insertions(+), 36 deletions(-) diff --git a/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap b/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap index 6990d5d9..0da3f360 100644 --- a/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap +++ b/packages/wasm-ast-types/src/react-query/__snapshots__/react-query.spec.ts.snap @@ -1143,9 +1143,9 @@ export function useSg721BurnMutation(options?: Omit client.burn(msg, fee, memo, _funds), options); + }) => client.burn(msg, fee, memo, funds), options); } export interface Sg721MintMutation { client: Sg721Client; @@ -1168,9 +1168,9 @@ export function useSg721MintMutation(options?: Omit client.mint(msg, fee, memo, _funds), options); + }) => client.mint(msg, fee, memo, funds), options); } export interface Sg721RevokeAllMutation { client: Sg721Client; @@ -1190,9 +1190,9 @@ export function useSg721RevokeAllMutation(options?: Omit client.revokeAll(msg, fee, memo, _funds), options); + }) => client.revokeAll(msg, fee, memo, funds), options); } export interface Sg721ApproveAllMutation { client: Sg721Client; @@ -1213,9 +1213,9 @@ export function useSg721ApproveAllMutation(options?: Omit client.approveAll(msg, fee, memo, _funds), options); + }) => client.approveAll(msg, fee, memo, funds), options); } export interface Sg721RevokeMutation { client: Sg721Client; @@ -1236,9 +1236,9 @@ export function useSg721RevokeMutation(options?: Omit client.revoke(msg, fee, memo, _funds), options); + }) => client.revoke(msg, fee, memo, funds), options); } export interface Sg721ApproveMutation { client: Sg721Client; @@ -1260,9 +1260,9 @@ export function useSg721ApproveMutation(options?: Omit client.approve(msg, fee, memo, _funds), options); + }) => client.approve(msg, fee, memo, funds), options); } export interface Sg721SendNftMutation { client: Sg721Client; @@ -1284,9 +1284,9 @@ export function useSg721SendNftMutation(options?: Omit client.sendNft(msg, fee, memo, _funds), options); + }) => client.sendNft(msg, fee, memo, funds), options); } export interface Sg721TransferNftMutation { client: Sg721Client; @@ -1307,9 +1307,9 @@ export function useSg721TransferNftMutation(options?: Omit client.transferNft(msg, fee, memo, _funds), options); + }) => client.transferNft(msg, fee, memo, funds), options); }" `; @@ -1330,9 +1330,9 @@ export function useOwnershipUpdateOwnershipMutation(options?: Omit client.updateOwnership(msg, fee, memo, _funds), options); + }) => client.updateOwnership(msg, fee, memo, funds), options); } export interface OwnershipSetFactoryMutation { client: OwnershipClient; @@ -1352,8 +1352,8 @@ export function useOwnershipSetFactoryMutation(options?: Omit client.setFactory(msg, fee, memo, _funds), options); + }) => client.setFactory(msg, fee, memo, funds), options); }" `; diff --git a/packages/wasm-ast-types/src/react-query/react-query.ts b/packages/wasm-ast-types/src/react-query/react-query.ts index 7f123b5c..655c1349 100644 --- a/packages/wasm-ast-types/src/react-query/react-query.ts +++ b/packages/wasm-ast-types/src/react-query/react-query.ts @@ -431,14 +431,7 @@ export const createReactQueryMutationArgsInterface = ({ t.tsTypeLiteral([ propertySignature('fee', OPTIONAL_FEE_PARAM.typeAnnotation, true), propertySignature('memo', OPTIONAL_MEMO_PARAM.typeAnnotation, true), - { - ...propertySignature( - 'funds', - OPTIONAL_FUNDS_PARAM.typeAnnotation, - true - ), - value: '_funds' - } + propertySignature('funds', OPTIONAL_FUNDS_PARAM.typeAnnotation, true) ]) ) ); @@ -573,9 +566,11 @@ export const createReactQueryMutationHook = ({ t.objectProperty( t.identifier('args'), t.assignmentPattern( - t.objectPattern( - FIXED_EXECUTE_PARAMS.map((param) => shorthandProperty(param.name)) - ), + t.objectPattern([ + shorthandProperty('fee'), + shorthandProperty('memo'), + shorthandProperty('funds') + ]), t.objectExpression([]) ) ) @@ -611,11 +606,11 @@ export const createReactQueryMutationHook = ({ t.identifier('client'), t.identifier(execMethodName) ), - (hasMsg ? [t.identifier('msg')] : []).concat( - FIXED_EXECUTE_PARAMS.map((param) => - t.identifier(param.name) - ) - ) + (hasMsg ? [t.identifier('msg')] : []).concat([ + t.identifier('fee'), + t.identifier('memo'), + t.identifier('funds') + ]) ), false // not async ), From dea086543298d82d3e06ae6031172943b88ef9b6 Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Sun, 21 May 2023 16:42:30 +0300 Subject: [PATCH 115/287] Add aliasEntryPoints option --- README.md | 9 ++++--- packages/ts-codegen/README.md | 1 + packages/ts-codegen/src/generators/types.ts | 26 +++++++++++++++++-- .../wasm-ast-types/src/context/context.ts | 2 ++ .../wasm-ast-types/types/context/context.d.ts | 2 ++ yarn.lock | 12 --------- 6 files changed, 34 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index a51ac9f9..acef2606 100644 --- a/README.md +++ b/README.md @@ -136,10 +136,11 @@ Typescript types and interfaces are generated in separate files so they can be i #### Types Options - | option | description | - | ----------------------------- | --------------------------------------------------- | - | `types.enabled` | enable type generation | - | `types.aliasExecuteMsg` | generate a type alias based on the contract name | + | option | description | +-------------------------| ----------------------------- | --------------------------------------------------- | + | `types.enabled` | enable type generation | + | `types.aliasExecuteMsg` | generate a type alias based on the contract name | + | `types.aliasEntryPoints` | generate type aliases for the entry points based on the contract name | ### Client diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index 4fc0e4b6..e342fd88 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -141,6 +141,7 @@ Typescript types and interfaces are generated in separate files so they can be i | ----------------------------- | --------------------------------------------------- | | `types.enabled` | enable type generation | | `types.aliasExecuteMsg` | generate a type alias based on the contract name | + | `types.aliasEntryPoints` | generate type aliases for the entry points based on the contract name | ### Client diff --git a/packages/ts-codegen/src/generators/types.ts b/packages/ts-codegen/src/generators/types.ts index 972c9fe8..96f184fc 100644 --- a/packages/ts-codegen/src/generators/types.ts +++ b/packages/ts-codegen/src/generators/types.ts @@ -6,7 +6,7 @@ import * as t from '@babel/types'; import { writeFileSync } from 'fs'; import generate from "@babel/generator"; import { clean } from "../utils/clean"; -import { findAndParseTypes, findExecuteMsg } from '../utils'; +import { findAndParseTypes, findExecuteMsg, findQueryMsg } from '../utils'; import { ContractInfo, RenderContext, TSTypesOptions } from "wasm-ast-types"; import { BuilderFile } from "../builder"; @@ -36,7 +36,7 @@ export default async ( ) }); - // alias the ExecuteMsg + // alias the ExecuteMsg (deprecated option) if (options.aliasExecuteMsg && ExecuteMsg) { body.push( t.exportNamedDeclaration( @@ -49,6 +49,28 @@ export default async ( ); } + function addEntryPointAlias(msgName: string) { + body.push( + t.exportNamedDeclaration( + t.tsTypeAliasDeclaration( + t.identifier(`${name}${msgName}`), + null, + t.tsTypeReference(t.identifier(msgName)) + ) + ) + ); + } + + if (options.aliasEntryPoints) { + if (ExecuteMsg) { + addEntryPointAlias('ExecuteMsg'); + } + if (findQueryMsg(schemas)) { + addEntryPointAlias('QueryMsg'); + } + } + + const imports = context.getImports(); const code = header + generate( t.program([ diff --git a/packages/wasm-ast-types/src/context/context.ts b/packages/wasm-ast-types/src/context/context.ts index cde2a123..9cb27f60 100644 --- a/packages/wasm-ast-types/src/context/context.ts +++ b/packages/wasm-ast-types/src/context/context.ts @@ -30,7 +30,9 @@ export interface RecoilOptions { } export interface TSTypesOptions { enabled?: boolean; + // deprecated aliasExecuteMsg?: boolean; + aliasEntryPoints?: boolean; } /// END Plugin Types diff --git a/packages/wasm-ast-types/types/context/context.d.ts b/packages/wasm-ast-types/types/context/context.d.ts index 073ca6cd..f3b19e60 100644 --- a/packages/wasm-ast-types/types/context/context.d.ts +++ b/packages/wasm-ast-types/types/context/context.d.ts @@ -25,7 +25,9 @@ export interface RecoilOptions { } export interface TSTypesOptions { enabled?: boolean; + // deprecated aliasExecuteMsg?: boolean; + aliasEntryPoints?: boolean; } interface KeyedSchema { [key: string]: JSONSchema; diff --git a/yarn.lock b/yarn.lock index 5c41f663..220b3fe5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9218,18 +9218,6 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" -"wasm-ast-types@path:../wasm-ast-types": - version "0.17.0" - resolved "https://registry.npmjs.org/wasm-ast-types/-/wasm-ast-types-0.17.0.tgz#417280a61d60ea9964667cf2edb8f5281dc295d7" - integrity sha512-WeriXPbG67iI51Mf/5qRR0xcpEaTO/Wyjpl+vsmjZ5K6q/0W6iO03zHsESNIH/hpc5FPTpb0Y0L9xAtnnNe9Ow== - dependencies: - "@babel/runtime" "^7.18.9" - "@babel/types" "7.18.10" - "@jest/transform" "28.1.3" - ast-stringify "0.1.0" - case "1.6.3" - deepmerge "4.2.2" - wcwidth@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz" From 45ac1ece2da95df09f949d692c95c66de0205408 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 24 May 2023 10:14:01 -0700 Subject: [PATCH 116/287] chore(release): publish - @cosmwasm/ts-codegen@0.29.0 - wasm-ast-types@0.22.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 0b20b401..239ee03c 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.29.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.28.0...@cosmwasm/ts-codegen@0.29.0) (2023-05-24) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.28.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.27.0...@cosmwasm/ts-codegen@0.28.0) (2023-05-17) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 2f19d9b1..ab2c20a3 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.28.0", + "version": "0.29.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.21.0" + "wasm-ast-types": "^0.22.0" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 5068315d..8e2ec908 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.22.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.21.0...wasm-ast-types@0.22.0) (2023-05-24) + +**Note:** Version bump only for package wasm-ast-types + + + + + # [0.21.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.20.0...wasm-ast-types@0.21.0) (2023-05-17) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index 8bda2efb..5e401b3d 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.21.0", + "version": "0.22.0", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From 9979ae4b7209f920fe1b822ede2ba80ee0f2eade Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 24 May 2023 10:16:15 -0700 Subject: [PATCH 117/287] chore(release): publish - @cosmwasm/ts-codegen@0.30.0 - wasm-ast-types@0.23.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 239ee03c..e42efdeb 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.30.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.29.0...@cosmwasm/ts-codegen@0.30.0) (2023-05-24) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.29.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.28.0...@cosmwasm/ts-codegen@0.29.0) (2023-05-24) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 0ec15e00..440a2435 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.29.0", + "version": "0.30.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.22.0" + "wasm-ast-types": "^0.23.0" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 8e2ec908..9e4f66e9 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.23.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.22.0...wasm-ast-types@0.23.0) (2023-05-24) + +**Note:** Version bump only for package wasm-ast-types + + + + + # [0.22.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.21.0...wasm-ast-types@0.22.0) (2023-05-24) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index 5e401b3d..595792d8 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.22.0", + "version": "0.23.0", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From 27c675ac05a663c528a2f791e902008cdbaa5c8b Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Tue, 6 Jun 2023 22:37:27 +0800 Subject: [PATCH 118/287] fixed bug reading from long execute msg --- __fixtures__/sg721-updatable/.cargo/config | 4 + .../sg721-updatable/.circleci/config.yml | 61 ++ .../.github/workflows/Basic.yml | 75 ++ __fixtures__/sg721-updatable/.gitignore | 15 + __fixtures__/sg721-updatable/Cargo.lock | 738 ++++++++++++++++++ __fixtures__/sg721-updatable/Cargo.toml | 63 ++ __fixtures__/sg721-updatable/LICENSE | 202 +++++ __fixtures__/sg721-updatable/NOTICE | 13 + __fixtures__/sg721-updatable/README.md | 3 + .../sg721-updatable/examples/schema.rs | 51 ++ .../schema/all_nft_info_response.json | 160 ++++ .../schema/all_operators_response.json | 100 +++ .../schema/all_tokens_response.json | 18 + .../schema/approval_response.json | 97 +++ .../schema/approvals_response.json | 100 +++ .../schema/collection_info_response.json | 88 +++ .../schema/contract_info_response.json | 18 + ...e_msg_for__nullable__empty_and__empty.json | 504 ++++++++++++ .../schema/instantiate_msg.json | 112 +++ .../schema/minter_response.json | 15 + .../schema/nft_info_response.json | 32 + .../schema/num_tokens_response.json | 16 + .../schema/owner_of_response.json | 106 +++ .../sg721-updatable/schema/query_msg.json | 296 +++++++ .../schema/tokens_response.json | 18 + __fixtures__/sg721-updatable/src/contract.rs | 378 +++++++++ __fixtures__/sg721-updatable/src/error.rs | 31 + __fixtures__/sg721-updatable/src/lib.rs | 69 ++ __fixtures__/sg721-updatable/src/msg.rs | 250 ++++++ __fixtures__/sg721-updatable/src/state.rs | 4 + .../CwAdminFactory.message-composer.ts | 2 +- .../CwCodeIdRegistry.message-composer.ts | 2 +- .../contracts/CwSingle.message-composer.ts | 2 +- .../contracts/Factory.message-composer.ts | 2 +- .../contracts/Minter.message-composer.ts | 2 +- .../CwAdminFactory.message-composer.ts | 2 +- .../CwCodeIdRegistry.message-composer.ts | 2 +- .../default/CwSingle.message-composer.ts | 2 +- .../default/Factory.message-composer.ts | 2 +- .../default/Minter.message-composer.ts | 2 +- .../CwAdminFactory.message-composer.ts | 2 +- .../CwCodeIdRegistry.message-composer.ts | 2 +- .../no-extends/CwSingle.message-composer.ts | 2 +- .../no-extends/Factory.message-composer.ts | 2 +- .../no-extends/Minter.message-composer.ts | 2 +- .../CwAdminFactory.message-composer.ts | 2 +- .../CwCodeIdRegistry.message-composer.ts | 2 +- .../CwNamedGroups.message-composer.ts | 2 +- .../CwProposalSingle.message-composer.ts | 2 +- .../AccountsNft.message-composer.ts | 2 +- .../Cw3FixedMultiSig.message-composer.ts | 2 +- .../cw4-group/Cw4Group.message-composer.ts | 2 +- .../cyberpunk/CyberPunk.message-composer.ts | 2 +- .../hackatom/HackAtom.message-composer.ts | 2 +- __output__/minter/Minter.message-composer.ts | 2 +- .../out/Sg721Updatable.client.ts | 528 +++++++++++++ .../out/Sg721Updatable.message-composer.ts | 415 ++++++++++ .../out/Sg721Updatable.react-query.ts | 175 +++++ .../out/Sg721Updatable.types.ts | 216 +++++ __output__/sg721-updatable/out/bundle.ts | 17 + __output__/sg721/Sg721.message-composer.ts | 2 +- .../Factory.react-query.ts | 28 +- .../factory/Factory.message-composer.ts | 2 +- .../vectis/govec/Govec.message-composer.ts | 2 +- .../vectis/proxy/Proxy.message-composer.ts | 2 +- ...ts-codegen.issue-long-exe-msg-name.test.ts | 29 + packages/ts-codegen/src/utils/schemas.ts | 4 +- .../wasm-ast-types/types/client/client.d.ts | 4 +- .../wasm-ast-types/types/context/context.d.ts | 1 - .../types/msg-builder/msg-builder.d.ts | 6 +- .../wasm-ast-types/types/utils/babel.d.ts | 7 +- .../wasm-ast-types/types/utils/constants.d.ts | 5 + .../wasm-ast-types/types/utils/index.d.ts | 2 + .../wasm-ast-types/types/utils/types.d.ts | 9 +- 74 files changed, 5075 insertions(+), 66 deletions(-) create mode 100644 __fixtures__/sg721-updatable/.cargo/config create mode 100644 __fixtures__/sg721-updatable/.circleci/config.yml create mode 100644 __fixtures__/sg721-updatable/.github/workflows/Basic.yml create mode 100644 __fixtures__/sg721-updatable/.gitignore create mode 100644 __fixtures__/sg721-updatable/Cargo.lock create mode 100644 __fixtures__/sg721-updatable/Cargo.toml create mode 100644 __fixtures__/sg721-updatable/LICENSE create mode 100644 __fixtures__/sg721-updatable/NOTICE create mode 100644 __fixtures__/sg721-updatable/README.md create mode 100644 __fixtures__/sg721-updatable/examples/schema.rs create mode 100644 __fixtures__/sg721-updatable/schema/all_nft_info_response.json create mode 100644 __fixtures__/sg721-updatable/schema/all_operators_response.json create mode 100644 __fixtures__/sg721-updatable/schema/all_tokens_response.json create mode 100644 __fixtures__/sg721-updatable/schema/approval_response.json create mode 100644 __fixtures__/sg721-updatable/schema/approvals_response.json create mode 100644 __fixtures__/sg721-updatable/schema/collection_info_response.json create mode 100644 __fixtures__/sg721-updatable/schema/contract_info_response.json create mode 100644 __fixtures__/sg721-updatable/schema/execute_msg_for__nullable__empty_and__empty.json create mode 100644 __fixtures__/sg721-updatable/schema/instantiate_msg.json create mode 100644 __fixtures__/sg721-updatable/schema/minter_response.json create mode 100644 __fixtures__/sg721-updatable/schema/nft_info_response.json create mode 100644 __fixtures__/sg721-updatable/schema/num_tokens_response.json create mode 100644 __fixtures__/sg721-updatable/schema/owner_of_response.json create mode 100644 __fixtures__/sg721-updatable/schema/query_msg.json create mode 100644 __fixtures__/sg721-updatable/schema/tokens_response.json create mode 100644 __fixtures__/sg721-updatable/src/contract.rs create mode 100644 __fixtures__/sg721-updatable/src/error.rs create mode 100644 __fixtures__/sg721-updatable/src/lib.rs create mode 100644 __fixtures__/sg721-updatable/src/msg.rs create mode 100644 __fixtures__/sg721-updatable/src/state.rs create mode 100644 __output__/sg721-updatable/out/Sg721Updatable.client.ts create mode 100644 __output__/sg721-updatable/out/Sg721Updatable.message-composer.ts create mode 100644 __output__/sg721-updatable/out/Sg721Updatable.react-query.ts create mode 100644 __output__/sg721-updatable/out/Sg721Updatable.types.ts create mode 100644 __output__/sg721-updatable/out/bundle.ts create mode 100644 packages/ts-codegen/__tests__/ts-codegen.issue-long-exe-msg-name.test.ts create mode 100644 packages/wasm-ast-types/types/utils/constants.d.ts diff --git a/__fixtures__/sg721-updatable/.cargo/config b/__fixtures__/sg721-updatable/.cargo/config new file mode 100644 index 00000000..336b618a --- /dev/null +++ b/__fixtures__/sg721-updatable/.cargo/config @@ -0,0 +1,4 @@ +[alias] +wasm = "build --release --target wasm32-unknown-unknown" +unit-test = "test --lib" +schema = "run --example schema" diff --git a/__fixtures__/sg721-updatable/.circleci/config.yml b/__fixtures__/sg721-updatable/.circleci/config.yml new file mode 100644 index 00000000..9b076696 --- /dev/null +++ b/__fixtures__/sg721-updatable/.circleci/config.yml @@ -0,0 +1,61 @@ +version: 2.1 + +executors: + builder: + docker: + - image: buildpack-deps:trusty + +jobs: + docker-image: + executor: builder + steps: + - checkout + - setup_remote_docker + docker_layer_caching: true + - run: + name: Build Docker artifact + command: docker build --pull -t "cosmwasm/cw-gitpod-base:${CIRCLE_SHA1}" . + - run: + name: Push application Docker image to docker hub + command: | + if [ "${CIRCLE_BRANCH}" = "master" ]; then + docker tag "cosmwasm/cw-gitpod-base:${CIRCLE_SHA1}" cosmwasm/cw-gitpod-base:latest + docker login --password-stdin -u "$DOCKER_USER" \<<<"$DOCKER_PASS" + docker push cosmwasm/cw-gitpod-base:latest + docker logout + fi + + docker-tagged: + executor: builder + steps: + - checkout + - setup_remote_docker + docker_layer_caching: true + - run: + name: Push application Docker image to docker hub + command: | + docker tag "cosmwasm/cw-gitpod-base:${CIRCLE_SHA1}" "cosmwasm/cw-gitpod-base:${CIRCLE_TAG}" + docker login --password-stdin -u "$DOCKER_USER" \<<<"$DOCKER_PASS" + docker push + docker logout + +workflows: + version: 2 + test-suite: + jobs: + # this is now a slow process... let's only run on master + - docker-image: + filters: + branches: + only: + - master + - docker-tagged: + filters: + tags: + only: + - /^v.*/ + branches: + ignore: + - /.*/ + requires: + - docker-image diff --git a/__fixtures__/sg721-updatable/.github/workflows/Basic.yml b/__fixtures__/sg721-updatable/.github/workflows/Basic.yml new file mode 100644 index 00000000..0aa41931 --- /dev/null +++ b/__fixtures__/sg721-updatable/.github/workflows/Basic.yml @@ -0,0 +1,75 @@ +# Based on https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml + +on: [push, pull_request] + +name: Basic + +jobs: + + test: + name: Test Suite + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: 1.58.1 + target: wasm32-unknown-unknown + override: true + + - name: Run unit tests + uses: actions-rs/cargo@v1 + with: + command: unit-test + args: --locked + env: + RUST_BACKTRACE: 1 + + - name: Compile WASM contract + uses: actions-rs/cargo@v1 + with: + command: wasm + args: --locked + env: + RUSTFLAGS: "-C link-arg=-s" + + lints: + name: Lints + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: 1.58.1 + override: true + components: rustfmt, clippy + + - name: Run cargo fmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + - name: Run cargo clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- -D warnings + + - name: Generate Schema + uses: actions-rs/cargo@v1 + with: + command: schema + args: --locked + + - name: Schema Changes + # fails if any changes not committed + run: git diff --exit-code schema diff --git a/__fixtures__/sg721-updatable/.gitignore b/__fixtures__/sg721-updatable/.gitignore new file mode 100644 index 00000000..dfdaaa6b --- /dev/null +++ b/__fixtures__/sg721-updatable/.gitignore @@ -0,0 +1,15 @@ +# Build results +/target + +# Cargo+Git helper file (https://github.com/rust-lang/cargo/blob/0.44.1/src/cargo/sources/git/utils.rs#L320-L327) +.cargo-ok + +# Text file backups +**/*.rs.bk + +# macOS +.DS_Store + +# IDEs +*.iml +.idea diff --git a/__fixtures__/sg721-updatable/Cargo.lock b/__fixtures__/sg721-updatable/Cargo.lock new file mode 100644 index 00000000..91fb09ff --- /dev/null +++ b/__fixtures__/sg721-updatable/Cargo.lock @@ -0,0 +1,738 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "anyhow" +version = "1.0.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" + +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "base64ct" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dea908e7347a8c64e378c17e30ef880ad73e3b4498346b055c2c00ea342f3179" + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "const-oid" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" + +[[package]] +name = "cosmwasm-crypto" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eb0afef2325df81aadbf9be1233f522ed8f6e91df870c764bc44cca2b1415bd" +dependencies = [ + "digest", + "ed25519-zebra", + "k256", + "rand_core 0.6.3", + "thiserror", +] + +[[package]] +name = "cosmwasm-derive" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b36e527620a2a3e00e46b6e731ab6c9b68d11069c986f7d7be8eba79ef081a4" +dependencies = [ + "syn", +] + +[[package]] +name = "cosmwasm-schema" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772e80bbad231a47a2068812b723a1ff81dd4a0d56c9391ac748177bea3a61da" +dependencies = [ + "schemars", + "serde_json", +] + +[[package]] +name = "cosmwasm-std" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875994993c2082a6fcd406937bf0fca21c349e4a624f3810253a14fa83a3a195" +dependencies = [ + "base64", + "cosmwasm-crypto", + "cosmwasm-derive", + "forward_ref", + "schemars", + "serde", + "serde-json-wasm", + "thiserror", + "uint", +] + +[[package]] +name = "cosmwasm-storage" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d18403b07304d15d304dad11040d45bbcaf78d603b4be3fb5e2685c16f9229b5" +dependencies = [ + "cosmwasm-std", + "serde", +] + +[[package]] +name = "cpufeatures" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +dependencies = [ + "libc", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-bigint" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" +dependencies = [ + "generic-array", + "rand_core 0.6.3", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-mac" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "cw-multi-test" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbea57e5be4a682268a5eca1a57efece57a54ff216bfd87603d5e864aad40e12" +dependencies = [ + "anyhow", + "cosmwasm-std", + "cosmwasm-storage", + "cw-storage-plus", + "cw-utils", + "derivative", + "itertools", + "prost", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "cw-storage-plus" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9336ecef1e19d56cf6e3e932475fc6a3dee35eec5a386e07917a1d1ba6bb0e35" +dependencies = [ + "cosmwasm-std", + "schemars", + "serde", +] + +[[package]] +name = "cw-utils" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "babd2c090f39d07ce5bf2556962305e795daa048ce20a93709eb591476e4a29e" +dependencies = [ + "cosmwasm-std", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "cw2" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "993df11574f29574dd443eb0c189484bb91bc0638b6de3e32ab7f9319c92122d" +dependencies = [ + "cosmwasm-std", + "cw-storage-plus", + "schemars", + "serde", +] + +[[package]] +name = "der" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +dependencies = [ + "const-oid", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "dyn-clone" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21e50f3adc76d6a43f5ed73b698a87d0760ca74617f60f7c3b879003536fdd28" + +[[package]] +name = "ecdsa" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0d69ae62e0ce582d56380743515fefaf1a8c70cec685d9677636d7e30ae9dc9" +dependencies = [ + "der", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519-zebra" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "403ef3e961ab98f0ba902771d29f842058578bb1ce7e3c59dad5a6a93e784c69" +dependencies = [ + "curve25519-dalek", + "hex", + "rand_core 0.6.3", + "serde", + "sha2", + "thiserror", + "zeroize", +] + +[[package]] +name = "either" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" + +[[package]] +name = "elliptic-curve" +version = "0.11.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6" +dependencies = [ + "base16ct", + "crypto-bigint", + "der", + "ff", + "generic-array", + "group", + "rand_core 0.6.3", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "ff" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "131655483be284720a17d74ff97592b8e76576dc25563148601df2d7c9080924" +dependencies = [ + "rand_core 0.6.3", + "subtle", +] + +[[package]] +name = "forward_ref" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" + +[[package]] +name = "generic-array" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.10.2+wasi-snapshot-preview1", +] + +[[package]] +name = "group" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89" +dependencies = [ + "ff", + "rand_core 0.6.3", + "subtle", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac", + "digest", +] + +[[package]] +name = "itertools" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" + +[[package]] +name = "k256" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sec1", + "sha2", +] + +[[package]] +name = "libc" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "pkcs8" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +dependencies = [ + "der", + "spki", + "zeroize", +] + +[[package]] +name = "proc-macro2" +version = "1.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-derive" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "quote" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom 0.2.6", +] + +[[package]] +name = "rfc6979" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525" +dependencies = [ + "crypto-bigint", + "hmac", + "zeroize", +] + +[[package]] +name = "ryu" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" + +[[package]] +name = "schemars" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d21ecb263bf75fc69d5e74b0f2a60b6dd80cfd9fb0eba15c4b9d1104ceffc77" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219b924f5b39f25b7d7c9203873a2698fdac8db2b396aaea6fa099b699cc40e9" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn", +] + +[[package]] +name = "sec1" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" +dependencies = [ + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "serde" +version = "1.0.137" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-json-wasm" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479b4dbc401ca13ee8ce902851b834893251404c4f3c65370a49e047a6be09a5" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.137" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_derive_internals" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer", + "cfg-if", + "cpufeatures", + "digest", + "opaque-debug", +] + +[[package]] +name = "signature" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" +dependencies = [ + "digest", + "rand_core 0.6.3", +] + +[[package]] +name = "spki" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbaf6116ab8924f39d52792136fb74fd60a80194cf1b1c6ffa6453eef1c3f942" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "testgen-local" +version = "0.1.0" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cosmwasm-storage", + "cw-multi-test", + "cw-storage-plus", + "cw2", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "thiserror" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "uint" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicode-ident" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + +[[package]] +name = "zeroize" +version = "1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94693807d016b2f2d2e14420eb3bfcca689311ff775dcf113d74ea624b7cdf07" diff --git a/__fixtures__/sg721-updatable/Cargo.toml b/__fixtures__/sg721-updatable/Cargo.toml new file mode 100644 index 00000000..65f6af21 --- /dev/null +++ b/__fixtures__/sg721-updatable/Cargo.toml @@ -0,0 +1,63 @@ +[package] +name = "sg721-updatable" +authors = [ + "John Y ", + "Shane Vitarana ", +] +exclude = [ + # Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication. + "contract.wasm", + "hash.txt", +] +description = "Stargaze Updatable NFT collection contract" +version = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +repository = { workspace = true } +license = { workspace = true } + + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[lib] +crate-type = ["cdylib", "rlib"] + +[profile.release] +opt-level = 3 +debug = false +rpath = false +lto = true +debug-assertions = false +codegen-units = 1 +panic = 'abort' +incremental = false +overflow-checks = true + +[features] +# for more explicit tests, cargo test --features=backtraces +backtraces = ["cosmwasm-std/backtraces"] +# use library feature to disable all instantiate/execute/query exports +library = [] + + +[dependencies] +cosmwasm-schema = { workspace = true } +cosmwasm-std = { workspace = true } +cw-storage-plus = { workspace = true } +cw-utils = { workspace = true } +cw2 = { workspace = true } +cw721 = { workspace = true } +schemars = { workspace = true } +serde = { workspace = true } +thiserror = { workspace = true } +cw721-base = { workspace = true, features = ["library"] } +sg1 = { workspace = true } +sg721 = { workspace = true } +sg721-base = { workspace = true, features = ["library"] } +sg-std = { workspace = true } +semver = { workspace = true } + +[dev-dependencies] +cosmwasm-schema = { workspace = true } +cw-multi-test = { workspace = true } +cw721 = { workspace = true } diff --git a/__fixtures__/sg721-updatable/LICENSE b/__fixtures__/sg721-updatable/LICENSE new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/__fixtures__/sg721-updatable/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/__fixtures__/sg721-updatable/NOTICE b/__fixtures__/sg721-updatable/NOTICE new file mode 100644 index 00000000..ee31d709 --- /dev/null +++ b/__fixtures__/sg721-updatable/NOTICE @@ -0,0 +1,13 @@ +Copyright 2022 John Y + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/__fixtures__/sg721-updatable/README.md b/__fixtures__/sg721-updatable/README.md new file mode 100644 index 00000000..1f443fa8 --- /dev/null +++ b/__fixtures__/sg721-updatable/README.md @@ -0,0 +1,3 @@ +# Sg721 NFT collection with updatable token metadata + +Extends from `sg721-base` to allow updatable token metadata NFT collection. It's done by updating the token uri of a specified token id. diff --git a/__fixtures__/sg721-updatable/examples/schema.rs b/__fixtures__/sg721-updatable/examples/schema.rs new file mode 100644 index 00000000..44d07d85 --- /dev/null +++ b/__fixtures__/sg721-updatable/examples/schema.rs @@ -0,0 +1,51 @@ +use std::env::current_dir; +use std::fs::create_dir_all; + +use cosmwasm_schema::{export_schema, export_schema_with_title, remove_schemas, schema_for}; + +use cosmwasm_std::Empty; +pub use cw721::{ + AllNftInfoResponse, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, NftInfoResponse, + NumTokensResponse, OperatorsResponse, OwnerOfResponse, TokensResponse, +}; +use cw721_base::Extension; +pub use cw721_base::MinterResponse; +use sg721::InstantiateMsg; +pub use sg721_base::msg::CollectionInfoResponse; +use sg721_base::msg::QueryMsg; +use sg721_updatable::msg::ExecuteMsg; + +fn main() { + let mut out_dir = current_dir().unwrap(); + out_dir.push("schema"); + create_dir_all(&out_dir).unwrap(); + remove_schemas(&out_dir).unwrap(); + + export_schema(&schema_for!(InstantiateMsg), &out_dir); + export_schema(&schema_for!(ExecuteMsg), &out_dir); + export_schema(&schema_for!(QueryMsg), &out_dir); + export_schema(&schema_for!(CollectionInfoResponse), &out_dir); + export_schema_with_title( + &schema_for!(AllNftInfoResponse), + &out_dir, + "AllNftInfoResponse", + ); + export_schema_with_title(&schema_for!(TokensResponse), &out_dir, "AllTokensResponse"); + export_schema_with_title( + &schema_for!(OperatorsResponse), + &out_dir, + "AllOperatorsResponse", + ); + export_schema(&schema_for!(MinterResponse), &out_dir); + export_schema(&schema_for!(ApprovalResponse), &out_dir); + export_schema(&schema_for!(ApprovalsResponse), &out_dir); + export_schema(&schema_for!(ContractInfoResponse), &out_dir); + export_schema_with_title( + &schema_for!(NftInfoResponse), + &out_dir, + "NftInfoResponse", + ); + export_schema(&schema_for!(NumTokensResponse), &out_dir); + export_schema(&schema_for!(OwnerOfResponse), &out_dir); + export_schema(&schema_for!(TokensResponse), &out_dir); +} diff --git a/__fixtures__/sg721-updatable/schema/all_nft_info_response.json b/__fixtures__/sg721-updatable/schema/all_nft_info_response.json new file mode 100644 index 00000000..bcfe83e9 --- /dev/null +++ b/__fixtures__/sg721-updatable/schema/all_nft_info_response.json @@ -0,0 +1,160 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AllNftInfoResponse", + "type": "object", + "required": [ + "access", + "info" + ], + "properties": { + "access": { + "description": "Who can transfer the token", + "allOf": [ + { + "$ref": "#/definitions/OwnerOfResponse" + } + ] + }, + "info": { + "description": "Data on the token itself,", + "allOf": [ + { + "$ref": "#/definitions/NftInfoResponse_for_Empty" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] + }, + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + }, + "additionalProperties": false + }, + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false + }, + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "NftInfoResponse_for_Empty": { + "type": "object", + "required": [ + "extension" + ], + "properties": { + "extension": { + "description": "You can add any custom metadata here when you extend cw721-base", + "allOf": [ + { + "$ref": "#/definitions/Empty" + } + ] + }, + "token_uri": { + "description": "Universal resource identifier for this NFT Should point to a JSON file that conforms to the ERC721 Metadata JSON Schema", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + "OwnerOfResponse": { + "type": "object", + "required": [ + "approvals", + "owner" + ], + "properties": { + "approvals": { + "description": "If set this address is approved to transfer/send the token as well", + "type": "array", + "items": { + "$ref": "#/definitions/Approval" + } + }, + "owner": { + "description": "Owner of the token", + "type": "string" + } + }, + "additionalProperties": false + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } +} diff --git a/__fixtures__/sg721-updatable/schema/all_operators_response.json b/__fixtures__/sg721-updatable/schema/all_operators_response.json new file mode 100644 index 00000000..5c88cf9c --- /dev/null +++ b/__fixtures__/sg721-updatable/schema/all_operators_response.json @@ -0,0 +1,100 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AllOperatorsResponse", + "type": "object", + "required": [ + "operators" + ], + "properties": { + "operators": { + "type": "array", + "items": { + "$ref": "#/definitions/Approval" + } + } + }, + "additionalProperties": false, + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] + }, + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + }, + "additionalProperties": false + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false + }, + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } +} diff --git a/__fixtures__/sg721-updatable/schema/all_tokens_response.json b/__fixtures__/sg721-updatable/schema/all_tokens_response.json new file mode 100644 index 00000000..231dd32f --- /dev/null +++ b/__fixtures__/sg721-updatable/schema/all_tokens_response.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AllTokensResponse", + "type": "object", + "required": [ + "tokens" + ], + "properties": { + "tokens": { + "description": "Contains all token_ids in lexicographical ordering If there are more than `limit`, use `start_from` in future queries to achieve pagination.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false +} diff --git a/__fixtures__/sg721-updatable/schema/approval_response.json b/__fixtures__/sg721-updatable/schema/approval_response.json new file mode 100644 index 00000000..b29eab59 --- /dev/null +++ b/__fixtures__/sg721-updatable/schema/approval_response.json @@ -0,0 +1,97 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ApprovalResponse", + "type": "object", + "required": [ + "approval" + ], + "properties": { + "approval": { + "$ref": "#/definitions/Approval" + } + }, + "additionalProperties": false, + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] + }, + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + }, + "additionalProperties": false + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false + }, + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } +} diff --git a/__fixtures__/sg721-updatable/schema/approvals_response.json b/__fixtures__/sg721-updatable/schema/approvals_response.json new file mode 100644 index 00000000..7cdac001 --- /dev/null +++ b/__fixtures__/sg721-updatable/schema/approvals_response.json @@ -0,0 +1,100 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ApprovalsResponse", + "type": "object", + "required": [ + "approvals" + ], + "properties": { + "approvals": { + "type": "array", + "items": { + "$ref": "#/definitions/Approval" + } + } + }, + "additionalProperties": false, + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] + }, + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + }, + "additionalProperties": false + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false + }, + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } +} diff --git a/__fixtures__/sg721-updatable/schema/collection_info_response.json b/__fixtures__/sg721-updatable/schema/collection_info_response.json new file mode 100644 index 00000000..0e4e9c2d --- /dev/null +++ b/__fixtures__/sg721-updatable/schema/collection_info_response.json @@ -0,0 +1,88 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CollectionInfoResponse", + "type": "object", + "required": [ + "creator", + "description", + "image" + ], + "properties": { + "creator": { + "type": "string" + }, + "description": { + "type": "string" + }, + "explicit_content": { + "type": [ + "boolean", + "null" + ] + }, + "external_link": { + "type": [ + "string", + "null" + ] + }, + "image": { + "type": "string" + }, + "royalty_info": { + "anyOf": [ + { + "$ref": "#/definitions/RoyaltyInfoResponse" + }, + { + "type": "null" + } + ] + }, + "start_trading_time": { + "anyOf": [ + { + "$ref": "#/definitions/Timestamp" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "RoyaltyInfoResponse": { + "type": "object", + "required": [ + "payment_address", + "share" + ], + "properties": { + "payment_address": { + "type": "string" + }, + "share": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } +} diff --git a/__fixtures__/sg721-updatable/schema/contract_info_response.json b/__fixtures__/sg721-updatable/schema/contract_info_response.json new file mode 100644 index 00000000..4a805a82 --- /dev/null +++ b/__fixtures__/sg721-updatable/schema/contract_info_response.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ContractInfoResponse", + "type": "object", + "required": [ + "name", + "symbol" + ], + "properties": { + "name": { + "type": "string" + }, + "symbol": { + "type": "string" + } + }, + "additionalProperties": false +} diff --git a/__fixtures__/sg721-updatable/schema/execute_msg_for__nullable__empty_and__empty.json b/__fixtures__/sg721-updatable/schema/execute_msg_for__nullable__empty_and__empty.json new file mode 100644 index 00000000..659d5020 --- /dev/null +++ b/__fixtures__/sg721-updatable/schema/execute_msg_for__nullable__empty_and__empty.json @@ -0,0 +1,504 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg_for_Nullable_Empty_and_Empty", + "oneOf": [ + { + "description": "Freeze token metadata so creator can no longer update token uris", + "type": "object", + "required": [ + "freeze_token_metadata" + ], + "properties": { + "freeze_token_metadata": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Creator calls can update token uris", + "type": "object", + "required": [ + "update_token_metadata" + ], + "properties": { + "update_token_metadata": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "token_id": { + "type": "string" + }, + "token_uri": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Enable updatable for updating token metadata. One time migration fee for sg721-base to sg721-updatable.", + "type": "object", + "required": [ + "enable_updatable" + ], + "properties": { + "enable_updatable": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "transfer_nft" + ], + "properties": { + "transfer_nft": { + "type": "object", + "required": [ + "recipient", + "token_id" + ], + "properties": { + "recipient": { + "type": "string" + }, + "token_id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "send_nft" + ], + "properties": { + "send_nft": { + "type": "object", + "required": [ + "contract", + "msg", + "token_id" + ], + "properties": { + "contract": { + "type": "string" + }, + "msg": { + "$ref": "#/definitions/Binary" + }, + "token_id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "approve" + ], + "properties": { + "approve": { + "type": "object", + "required": [ + "spender", + "token_id" + ], + "properties": { + "expires": { + "anyOf": [ + { + "$ref": "#/definitions/Expiration" + }, + { + "type": "null" + } + ] + }, + "spender": { + "type": "string" + }, + "token_id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "revoke" + ], + "properties": { + "revoke": { + "type": "object", + "required": [ + "spender", + "token_id" + ], + "properties": { + "spender": { + "type": "string" + }, + "token_id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "approve_all" + ], + "properties": { + "approve_all": { + "type": "object", + "required": [ + "operator" + ], + "properties": { + "expires": { + "anyOf": [ + { + "$ref": "#/definitions/Expiration" + }, + { + "type": "null" + } + ] + }, + "operator": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "revoke_all" + ], + "properties": { + "revoke_all": { + "type": "object", + "required": [ + "operator" + ], + "properties": { + "operator": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "burn" + ], + "properties": { + "burn": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "token_id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "update_collection_info" + ], + "properties": { + "update_collection_info": { + "type": "object", + "required": [ + "collection_info" + ], + "properties": { + "collection_info": { + "$ref": "#/definitions/UpdateCollectionInfoMsg_for_RoyaltyInfoResponse" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "update_trading_start_time" + ], + "properties": { + "update_trading_start_time": { + "anyOf": [ + { + "$ref": "#/definitions/Timestamp" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "freeze_collection_info" + ], + "properties": { + "freeze_collection_info": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "mint" + ], + "properties": { + "mint": { + "type": "object", + "required": [ + "owner", + "token_id" + ], + "properties": { + "extension": { + "description": "Any custom extension used by this contract", + "anyOf": [ + { + "$ref": "#/definitions/Empty" + }, + { + "type": "null" + } + ] + }, + "owner": { + "description": "The owner of the newly minter NFT", + "type": "string" + }, + "token_id": { + "description": "Unique ID of the NFT", + "type": "string" + }, + "token_uri": { + "description": "Universal resource identifier for this NFT Should point to a JSON file that conforms to the ERC721 Metadata JSON Schema", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "extension" + ], + "properties": { + "extension": { + "type": "object", + "required": [ + "msg" + ], + "properties": { + "msg": { + "$ref": "#/definitions/Empty" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false + }, + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "RoyaltyInfoResponse": { + "type": "object", + "required": [ + "payment_address", + "share" + ], + "properties": { + "payment_address": { + "type": "string" + }, + "share": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + }, + "UpdateCollectionInfoMsg_for_RoyaltyInfoResponse": { + "type": "object", + "properties": { + "description": { + "type": [ + "string", + "null" + ] + }, + "explicit_content": { + "type": [ + "boolean", + "null" + ] + }, + "external_link": { + "type": [ + "string", + "null" + ] + }, + "image": { + "type": [ + "string", + "null" + ] + }, + "royalty_info": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/RoyaltyInfoResponse" + }, + { + "type": "null" + } + ] + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + } +} diff --git a/__fixtures__/sg721-updatable/schema/instantiate_msg.json b/__fixtures__/sg721-updatable/schema/instantiate_msg.json new file mode 100644 index 00000000..734b45e8 --- /dev/null +++ b/__fixtures__/sg721-updatable/schema/instantiate_msg.json @@ -0,0 +1,112 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "collection_info", + "minter", + "name", + "symbol" + ], + "properties": { + "collection_info": { + "$ref": "#/definitions/CollectionInfo_for_RoyaltyInfoResponse" + }, + "minter": { + "type": "string" + }, + "name": { + "type": "string" + }, + "symbol": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "CollectionInfo_for_RoyaltyInfoResponse": { + "type": "object", + "required": [ + "creator", + "description", + "image" + ], + "properties": { + "creator": { + "type": "string" + }, + "description": { + "type": "string" + }, + "explicit_content": { + "type": [ + "boolean", + "null" + ] + }, + "external_link": { + "type": [ + "string", + "null" + ] + }, + "image": { + "type": "string" + }, + "royalty_info": { + "anyOf": [ + { + "$ref": "#/definitions/RoyaltyInfoResponse" + }, + { + "type": "null" + } + ] + }, + "start_trading_time": { + "anyOf": [ + { + "$ref": "#/definitions/Timestamp" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "RoyaltyInfoResponse": { + "type": "object", + "required": [ + "payment_address", + "share" + ], + "properties": { + "payment_address": { + "type": "string" + }, + "share": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } +} diff --git a/__fixtures__/sg721-updatable/schema/minter_response.json b/__fixtures__/sg721-updatable/schema/minter_response.json new file mode 100644 index 00000000..c5c90029 --- /dev/null +++ b/__fixtures__/sg721-updatable/schema/minter_response.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MinterResponse", + "description": "Shows who can mint these tokens", + "type": "object", + "required": [ + "minter" + ], + "properties": { + "minter": { + "type": "string" + } + }, + "additionalProperties": false +} diff --git a/__fixtures__/sg721-updatable/schema/nft_info_response.json b/__fixtures__/sg721-updatable/schema/nft_info_response.json new file mode 100644 index 00000000..4cecceed --- /dev/null +++ b/__fixtures__/sg721-updatable/schema/nft_info_response.json @@ -0,0 +1,32 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "NftInfoResponse", + "type": "object", + "required": [ + "extension" + ], + "properties": { + "extension": { + "description": "You can add any custom metadata here when you extend cw721-base", + "allOf": [ + { + "$ref": "#/definitions/Empty" + } + ] + }, + "token_uri": { + "description": "Universal resource identifier for this NFT Should point to a JSON file that conforms to the ERC721 Metadata JSON Schema", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false, + "definitions": { + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" + } + } +} diff --git a/__fixtures__/sg721-updatable/schema/num_tokens_response.json b/__fixtures__/sg721-updatable/schema/num_tokens_response.json new file mode 100644 index 00000000..aff5850c --- /dev/null +++ b/__fixtures__/sg721-updatable/schema/num_tokens_response.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "NumTokensResponse", + "type": "object", + "required": [ + "count" + ], + "properties": { + "count": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false +} diff --git a/__fixtures__/sg721-updatable/schema/owner_of_response.json b/__fixtures__/sg721-updatable/schema/owner_of_response.json new file mode 100644 index 00000000..abb9006d --- /dev/null +++ b/__fixtures__/sg721-updatable/schema/owner_of_response.json @@ -0,0 +1,106 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OwnerOfResponse", + "type": "object", + "required": [ + "approvals", + "owner" + ], + "properties": { + "approvals": { + "description": "If set this address is approved to transfer/send the token as well", + "type": "array", + "items": { + "$ref": "#/definitions/Approval" + } + }, + "owner": { + "description": "Owner of the token", + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Approval": { + "type": "object", + "required": [ + "expires", + "spender" + ], + "properties": { + "expires": { + "description": "When the Approval expires (maybe Expiration::never)", + "allOf": [ + { + "$ref": "#/definitions/Expiration" + } + ] + }, + "spender": { + "description": "Account that can transfer/send the token", + "type": "string" + } + }, + "additionalProperties": false + }, + "Expiration": { + "description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)", + "oneOf": [ + { + "description": "AtHeight will expire when `env.block.height` >= height", + "type": "object", + "required": [ + "at_height" + ], + "properties": { + "at_height": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + { + "description": "AtTime will expire when `env.block.time` >= time", + "type": "object", + "required": [ + "at_time" + ], + "properties": { + "at_time": { + "$ref": "#/definitions/Timestamp" + } + }, + "additionalProperties": false + }, + { + "description": "Never will never expire. Used to express the empty variant", + "type": "object", + "required": [ + "never" + ], + "properties": { + "never": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + } + } +} diff --git a/__fixtures__/sg721-updatable/schema/query_msg.json b/__fixtures__/sg721-updatable/schema/query_msg.json new file mode 100644 index 00000000..e9e31a3b --- /dev/null +++ b/__fixtures__/sg721-updatable/schema/query_msg.json @@ -0,0 +1,296 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "owner_of" + ], + "properties": { + "owner_of": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "include_expired": { + "type": [ + "boolean", + "null" + ] + }, + "token_id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "approval" + ], + "properties": { + "approval": { + "type": "object", + "required": [ + "spender", + "token_id" + ], + "properties": { + "include_expired": { + "type": [ + "boolean", + "null" + ] + }, + "spender": { + "type": "string" + }, + "token_id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "approvals" + ], + "properties": { + "approvals": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "include_expired": { + "type": [ + "boolean", + "null" + ] + }, + "token_id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "all_operators" + ], + "properties": { + "all_operators": { + "type": "object", + "required": [ + "owner" + ], + "properties": { + "include_expired": { + "type": [ + "boolean", + "null" + ] + }, + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "owner": { + "type": "string" + }, + "start_after": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "num_tokens" + ], + "properties": { + "num_tokens": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "contract_info" + ], + "properties": { + "contract_info": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "nft_info" + ], + "properties": { + "nft_info": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "token_id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "all_nft_info" + ], + "properties": { + "all_nft_info": { + "type": "object", + "required": [ + "token_id" + ], + "properties": { + "include_expired": { + "type": [ + "boolean", + "null" + ] + }, + "token_id": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "tokens" + ], + "properties": { + "tokens": { + "type": "object", + "required": [ + "owner" + ], + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "owner": { + "type": "string" + }, + "start_after": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "all_tokens" + ], + "properties": { + "all_tokens": { + "type": "object", + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "start_after": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "minter" + ], + "properties": { + "minter": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "collection_info" + ], + "properties": { + "collection_info": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] +} diff --git a/__fixtures__/sg721-updatable/schema/tokens_response.json b/__fixtures__/sg721-updatable/schema/tokens_response.json new file mode 100644 index 00000000..14499395 --- /dev/null +++ b/__fixtures__/sg721-updatable/schema/tokens_response.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TokensResponse", + "type": "object", + "required": [ + "tokens" + ], + "properties": { + "tokens": { + "description": "Contains all token_ids in lexicographical ordering If there are more than `limit`, use `start_from` in future queries to achieve pagination.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false +} diff --git a/__fixtures__/sg721-updatable/src/contract.rs b/__fixtures__/sg721-updatable/src/contract.rs new file mode 100644 index 00000000..5ad3d84a --- /dev/null +++ b/__fixtures__/sg721-updatable/src/contract.rs @@ -0,0 +1,378 @@ +use crate::error::ContractError; +use crate::state::FROZEN_TOKEN_METADATA; +use cosmwasm_std::{Empty, StdError}; + +use cosmwasm_std::{Deps, StdResult}; + +#[cfg(not(feature = "library"))] +use cosmwasm_std::{DepsMut, Env, Event, MessageInfo}; +use cw2::set_contract_version; +use sg721::InstantiateMsg; +use sg721_base::msg::CollectionInfoResponse; + +use crate::msg::{EnableUpdatableResponse, FrozenTokenMetadataResponse}; +use crate::state::ENABLE_UPDATABLE; + +use cw721_base::Extension; +use cw_utils::nonpayable; +use sg1::checked_fair_burn; +use sg721_base::ContractError::Unauthorized; +use sg721_base::Sg721Contract; +pub type Sg721UpdatableContract<'a> = Sg721Contract<'a, Extension>; +use sg_std::Response; + +const CONTRACT_NAME: &str = "crates.io:sg721-updatable"; +const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); +pub const EARLIEST_VERSION: &str = "0.16.0"; +pub const TO_VERSION: &str = "3.0.0"; +const ENABLE_UPDATABLE_FEE: u128 = 500_000_000; + +pub fn _instantiate( + deps: DepsMut, + env: Env, + info: MessageInfo, + msg: InstantiateMsg, +) -> Result { + // Set frozen to false on instantiate. allows updating token metadata + FROZEN_TOKEN_METADATA.save(deps.storage, &false)?; + // Set enable_updatable to true on instantiate. allows updating token metadata + ENABLE_UPDATABLE.save(deps.storage, &true)?; + + set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?; + let res = Sg721UpdatableContract::default().instantiate(deps, env, info, msg)?; + Ok(res) +} + +pub fn execute_enable_updatable( + deps: DepsMut, + _env: Env, + info: MessageInfo, +) -> Result { + let enable_updates = ENABLE_UPDATABLE.load(deps.storage)?; + let mut res = Response::new(); + if enable_updates { + return Err(ContractError::AlreadyEnableUpdatable {}); + } + + // TODO add check if sender is contract admin + // Check if sender is creator + let collection_info: CollectionInfoResponse = + Sg721UpdatableContract::default().query_collection_info(deps.as_ref())?; + if info.sender != collection_info.creator { + return Err(ContractError::Base(Unauthorized {})); + } + + // Check fee matches enable updatable fee and add fairburn msg + checked_fair_burn(&info, ENABLE_UPDATABLE_FEE, None, &mut res)?; + + ENABLE_UPDATABLE.save(deps.storage, &true)?; + + Ok(res + .add_attribute("action", "enable_updates") + .add_attribute("enabled", "true")) +} + +pub fn execute_freeze_token_metadata( + deps: DepsMut, + _env: Env, + info: MessageInfo, +) -> Result { + nonpayable(&info)?; + // Check if sender is creator + let collection_info: CollectionInfoResponse = + Sg721UpdatableContract::default().query_collection_info(deps.as_ref())?; + if info.sender != collection_info.creator { + return Err(ContractError::Base(Unauthorized {})); + } + + FROZEN_TOKEN_METADATA.save(deps.storage, &true)?; + + Ok(Response::new() + .add_attribute("action", "freeze_token_metadata") + .add_attribute("frozen", "true")) +} + +pub fn execute_update_token_metadata( + deps: DepsMut, + _env: Env, + info: MessageInfo, + token_id: String, + token_uri: Option, +) -> Result { + nonpayable(&info)?; + // Check if sender is creator + let owner = deps.api.addr_validate(info.sender.as_ref())?; + let collection_info: CollectionInfoResponse = + Sg721UpdatableContract::default().query_collection_info(deps.as_ref())?; + if owner != collection_info.creator { + return Err(ContractError::Base(Unauthorized {})); + } + + // Check if token metadata is frozen + let frozen = FROZEN_TOKEN_METADATA.load(deps.storage)?; + if frozen { + return Err(ContractError::TokenMetadataFrozen {}); + } + + // Check if enable updatable is true + let enable_updatable = ENABLE_UPDATABLE.load(deps.storage)?; + if !enable_updatable { + return Err(ContractError::NotEnableUpdatable {}); + } + + // Update token metadata + Sg721UpdatableContract::default().tokens.update( + deps.storage, + &token_id, + |token| match token { + Some(mut token_info) => { + token_info.token_uri = token_uri.clone(); + Ok(token_info) + } + None => Err(ContractError::TokenIdNotFound {}), + }, + )?; + + let mut event = Event::new("update_update_token_metadata") + .add_attribute("sender", info.sender) + .add_attribute("token_id", token_id); + if let Some(token_uri) = token_uri { + event = event.add_attribute("token_uri", token_uri); + } + Ok(Response::new().add_event(event)) +} + +pub fn query_enable_updatable(deps: Deps) -> StdResult { + let enabled = ENABLE_UPDATABLE.load(deps.storage)?; + Ok(EnableUpdatableResponse { enabled }) +} + +pub fn query_frozen_token_metadata(deps: Deps) -> StdResult { + let frozen = FROZEN_TOKEN_METADATA.load(deps.storage)?; + Ok(FrozenTokenMetadataResponse { frozen }) +} + +pub fn _migrate(deps: DepsMut, _env: Env, _msg: Empty) -> Result { + // make sure the correct contract is being upgraded, and it's being + // upgraded from the correct version. + if CONTRACT_VERSION < EARLIEST_VERSION { + return Err(StdError::generic_err("Cannot upgrade to a previous contract version").into()); + } + if CONTRACT_VERSION > TO_VERSION { + return Err(StdError::generic_err("Cannot upgrade to a previous contract version").into()); + } + // if same version return + if CONTRACT_VERSION == TO_VERSION { + return Ok(Response::new()); + } + + // update contract version + cw2::set_contract_version(deps.storage, CONTRACT_NAME, TO_VERSION)?; + + // perform the upgrade + cw721_base::upgrades::v0_17::migrate::(deps) + .map_err(|e| sg721_base::ContractError::MigrationError(e.to_string()))?; + + let event = Event::new("migrate") + .add_attribute("from_name", CONTRACT_VERSION) + .add_attribute("from_version", CONTRACT_VERSION) + .add_attribute("to_name", CONTRACT_NAME) + .add_attribute("to_version", TO_VERSION); + Ok(Response::new().add_event(event)) +} + +#[cfg(test)] +mod tests { + use super::*; + + use crate::entry::{execute, instantiate}; + use crate::msg::ExecuteMsg; + use cosmwasm_std::testing::{mock_env, mock_info, MockApi, MockQuerier, MockStorage}; + use cosmwasm_std::{ + from_slice, to_binary, ContractInfoResponse, ContractResult, Empty, OwnedDeps, Querier, + QuerierResult, QueryRequest, SystemError, SystemResult, WasmQuery, + }; + use cw721::Cw721Query; + use sg721::{CollectionInfo, InstantiateMsg}; + use std::marker::PhantomData; + + const CREATOR: &str = "creator"; + const HACKER: &str = "hacker"; + + pub fn mock_deps() -> OwnedDeps { + OwnedDeps { + storage: MockStorage::default(), + api: MockApi::default(), + querier: CustomMockQuerier::new(MockQuerier::new(&[])), + custom_query_type: PhantomData, + } + } + + pub struct CustomMockQuerier { + base: MockQuerier, + } + + impl Querier for CustomMockQuerier { + fn raw_query(&self, bin_request: &[u8]) -> QuerierResult { + let request: QueryRequest = match from_slice(bin_request) { + Ok(v) => v, + Err(e) => { + return SystemResult::Err(SystemError::InvalidRequest { + error: format!("Parsing query request: {}", e), + request: bin_request.into(), + }) + } + }; + + self.handle_query(&request) + } + } + + impl CustomMockQuerier { + pub fn handle_query(&self, request: &QueryRequest) -> QuerierResult { + match &request { + QueryRequest::Wasm(WasmQuery::ContractInfo { contract_addr: _ }) => { + let mut response = ContractInfoResponse::default(); + response.code_id = 1; + response.creator = CREATOR.to_string(); + SystemResult::Ok(ContractResult::Ok(to_binary(&response).unwrap())) + } + _ => self.base.handle_query(request), + } + } + + pub fn new(base: MockQuerier) -> Self { + CustomMockQuerier { base } + } + } + + #[test] + fn update_token_metadata() { + let mut deps = mock_deps(); + let contract = Sg721UpdatableContract::default(); + + // Instantiate contract + let info = mock_info(CREATOR, &[]); + let init_msg = InstantiateMsg { + name: "SpaceShips".to_string(), + symbol: "SPACE".to_string(), + minter: CREATOR.to_string(), + collection_info: CollectionInfo { + creator: CREATOR.to_string(), + description: "this is a test".to_string(), + image: "https://larry.engineer".to_string(), + external_link: None, + explicit_content: None, + start_trading_time: None, + royalty_info: None, + }, + }; + instantiate(deps.as_mut(), mock_env(), info.clone(), init_msg).unwrap(); + + // Mint token + let token_id = "Enterprise"; + let exec_msg = ExecuteMsg::Mint { + token_id: token_id.to_string(), + owner: "john".to_string(), + token_uri: Some("https://starships.example.com/Starship/Enterprise.json".into()), + extension: None, + }; + execute(deps.as_mut(), mock_env(), info.clone(), exec_msg).unwrap(); + + // Update token metadata fails because token id is not found + let updated_token_uri = Some("https://badkids.example.com/collection-cid/1.json".into()); + let update_msg = ExecuteMsg::UpdateTokenMetadata { + token_id: "wrong-token-id".to_string(), + token_uri: updated_token_uri.clone(), + }; + let err = execute(deps.as_mut(), mock_env(), info.clone(), update_msg).unwrap_err(); + assert_eq!( + err.to_string(), + ContractError::TokenIdNotFound {}.to_string() + ); + + // Update token metadata fails because sent by hacker + let update_msg = ExecuteMsg::UpdateTokenMetadata { + token_id: token_id.to_string(), + token_uri: updated_token_uri.clone(), + }; + let hacker_info = mock_info(HACKER, &[]); + let err = execute(deps.as_mut(), mock_env(), hacker_info, update_msg.clone()).unwrap_err(); + assert_eq!( + err.to_string(), + ContractError::Base(Unauthorized {}).to_string() + ); + + // Update token metadata + execute(deps.as_mut(), mock_env(), info.clone(), update_msg).unwrap(); + + // Check token contains updated metadata + let res = contract + .parent + .nft_info(deps.as_ref(), token_id.into()) + .unwrap(); + assert_eq!(res.token_uri, updated_token_uri); + + // Update token metadata with None token_uri + let update_msg = ExecuteMsg::::UpdateTokenMetadata { + token_id: token_id.to_string(), + token_uri: None, + }; + execute(deps.as_mut(), mock_env(), info.clone(), update_msg).unwrap(); + let res = contract + .parent + .nft_info(deps.as_ref(), token_id.into()) + .unwrap(); + assert_eq!(res.token_uri, None); + + // Freeze token metadata + let freeze_msg = ExecuteMsg::FreezeTokenMetadata {}; + execute(deps.as_mut(), mock_env(), info.clone(), freeze_msg).unwrap(); + + // Throws error trying to update token metadata + let updated_token_uri = + Some("https://badkids.example.com/other-collection-cid/2.json".into()); + let update_msg = ExecuteMsg::UpdateTokenMetadata { + token_id: token_id.to_string(), + token_uri: updated_token_uri, + }; + let err = execute(deps.as_mut(), mock_env(), info, update_msg).unwrap_err(); + assert_eq!( + err.to_string(), + ContractError::TokenMetadataFrozen {}.to_string() + ); + } + + #[test] + fn enable_updatable() { + let mut deps = mock_deps(); + + // Instantiate contract + let info = mock_info(CREATOR, &[]); + let init_msg = InstantiateMsg { + name: "SpaceShips".to_string(), + symbol: "SPACE".to_string(), + minter: CREATOR.to_string(), + collection_info: CollectionInfo { + creator: CREATOR.to_string(), + description: "this is a test".to_string(), + image: "https://larry.engineer".to_string(), + external_link: None, + explicit_content: None, + start_trading_time: None, + royalty_info: None, + }, + }; + instantiate(deps.as_mut(), mock_env(), info.clone(), init_msg).unwrap(); + + let enable_updatable_msg = ExecuteMsg::EnableUpdatable {}; + let err = execute(deps.as_mut(), mock_env(), info, enable_updatable_msg).unwrap_err(); + assert_eq!( + err.to_string(), + ContractError::AlreadyEnableUpdatable {}.to_string() + ); + + let res = query_enable_updatable(deps.as_ref()).unwrap(); + assert!(res.enabled); + } +} diff --git a/__fixtures__/sg721-updatable/src/error.rs b/__fixtures__/sg721-updatable/src/error.rs new file mode 100644 index 00000000..29823b2b --- /dev/null +++ b/__fixtures__/sg721-updatable/src/error.rs @@ -0,0 +1,31 @@ +use cosmwasm_std::StdError; +use cw_utils::PaymentError; +use sg1::FeeError; +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum ContractError { + #[error("{0}")] + Std(#[from] StdError), + + #[error("{0}")] + Payment(#[from] PaymentError), + + #[error("{0}")] + Base(#[from] sg721_base::ContractError), + + #[error("{0}")] + Fee(#[from] FeeError), + + #[error("TokenIdNotFound")] + TokenIdNotFound {}, + + #[error("TokenMetadataFrozen")] + TokenMetadataFrozen {}, + + #[error("NotEnableUpdatable")] + NotEnableUpdatable {}, + + #[error("AlreadyEnableUpdatable")] + AlreadyEnableUpdatable {}, +} diff --git a/__fixtures__/sg721-updatable/src/lib.rs b/__fixtures__/sg721-updatable/src/lib.rs new file mode 100644 index 00000000..06a13ea3 --- /dev/null +++ b/__fixtures__/sg721-updatable/src/lib.rs @@ -0,0 +1,69 @@ +#[cfg(not(feature = "library"))] +pub mod contract; +pub mod error; +pub mod msg; +pub mod state; + +pub type InstantiateMsg = sg721::InstantiateMsg; + +pub mod entry { + use super::*; + use crate::error::ContractError; + use crate::msg::QueryMsg; + use crate::{ + contract::{ + _instantiate, _migrate, execute_enable_updatable, execute_freeze_token_metadata, + execute_update_token_metadata, query_enable_updatable, query_frozen_token_metadata, + Sg721UpdatableContract, + }, + msg::ExecuteMsg, + }; + use cosmwasm_std::{entry_point, to_binary, Empty}; + use cosmwasm_std::{Binary, Deps, DepsMut, Env, MessageInfo, StdResult}; + use cw721_base::Extension; + use sg_std::Response; + + #[entry_point] + pub fn instantiate( + deps: DepsMut, + env: Env, + info: MessageInfo, + msg: InstantiateMsg, + ) -> Result { + _instantiate(deps, env, info, msg) + } + + #[entry_point] + pub fn execute( + deps: DepsMut, + env: Env, + info: MessageInfo, + msg: ExecuteMsg, + ) -> Result { + match msg { + ExecuteMsg::FreezeTokenMetadata {} => execute_freeze_token_metadata(deps, env, info), + ExecuteMsg::EnableUpdatable {} => execute_enable_updatable(deps, env, info), + ExecuteMsg::UpdateTokenMetadata { + token_id, + token_uri, + } => execute_update_token_metadata(deps, env, info, token_id, token_uri), + _ => Sg721UpdatableContract::default() + .execute(deps, env, info, msg.into()) + .map_err(|e| e.into()), + } + } + + #[entry_point] + pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult { + match msg { + QueryMsg::EnableUpdatable {} => to_binary(&query_enable_updatable(deps)?), + QueryMsg::FreezeTokenMetadata {} => to_binary(&query_frozen_token_metadata(deps)?), + _ => Sg721UpdatableContract::default().query(deps, env, msg.into()), + } + } + + #[entry_point] + pub fn migrate(deps: DepsMut, env: Env, msg: Empty) -> Result { + _migrate(deps, env, msg) + } +} diff --git a/__fixtures__/sg721-updatable/src/msg.rs b/__fixtures__/sg721-updatable/src/msg.rs new file mode 100644 index 00000000..f05672df --- /dev/null +++ b/__fixtures__/sg721-updatable/src/msg.rs @@ -0,0 +1,250 @@ +use cosmwasm_schema::cw_serde; +use cosmwasm_std::Binary; +use cosmwasm_std::Timestamp; +use cw_utils::Expiration; +use sg721::{RoyaltyInfoResponse, UpdateCollectionInfoMsg}; +use sg721_base::msg::QueryMsg as Sg721QueryMsg; +use sg721_base::ExecuteMsg as Sg721ExecuteMsg; + +#[cw_serde] +pub enum ExecuteMsg { + /// Freeze token metadata so creator can no longer update token uris + FreezeTokenMetadata {}, + /// Creator calls can update token uris + UpdateTokenMetadata { + token_id: String, + token_uri: Option, + }, + /// Enable updatable for updating token metadata. One time migration fee for sg721-base to sg721-updatable. + EnableUpdatable {}, + // Sg721Base msgs + TransferNft { + recipient: String, + token_id: String, + }, + SendNft { + contract: String, + token_id: String, + msg: Binary, + }, + Approve { + spender: String, + token_id: String, + expires: Option, + }, + Revoke { + spender: String, + token_id: String, + }, + ApproveAll { + operator: String, + expires: Option, + }, + RevokeAll { + operator: String, + }, + Burn { + token_id: String, + }, + UpdateCollectionInfo { + collection_info: UpdateCollectionInfoMsg, + }, + UpdateTradingStartTime(Option), + FreezeCollectionInfo {}, + Mint { + /// Unique ID of the NFT + token_id: String, + /// The owner of the newly minter NFT + owner: String, + /// Universal resource identifier for this NFT + /// Should point to a JSON file that conforms to the ERC721 + /// Metadata JSON Schema + token_uri: Option, + /// Any custom extension used by this contract + extension: T, + }, + Extension { + msg: E, + }, +} + +impl From> for Sg721ExecuteMsg +where + T: Clone + PartialEq + Into>, + Option: From, +{ + fn from(msg: ExecuteMsg) -> Sg721ExecuteMsg { + match msg { + ExecuteMsg::TransferNft { + recipient, + token_id, + } => Sg721ExecuteMsg::TransferNft { + recipient, + token_id, + }, + ExecuteMsg::SendNft { + contract, + token_id, + msg, + } => Sg721ExecuteMsg::SendNft { + contract, + token_id, + msg, + }, + ExecuteMsg::Approve { + spender, + token_id, + expires, + } => Sg721ExecuteMsg::Approve { + spender, + token_id, + expires, + }, + ExecuteMsg::ApproveAll { operator, expires } => { + Sg721ExecuteMsg::ApproveAll { operator, expires } + } + ExecuteMsg::Revoke { spender, token_id } => { + Sg721ExecuteMsg::Revoke { spender, token_id } + } + ExecuteMsg::RevokeAll { operator } => Sg721ExecuteMsg::RevokeAll { operator }, + ExecuteMsg::Burn { token_id } => Sg721ExecuteMsg::Burn { token_id }, + ExecuteMsg::UpdateCollectionInfo { collection_info } => { + Sg721ExecuteMsg::UpdateCollectionInfo { collection_info } + } + ExecuteMsg::FreezeCollectionInfo {} => Sg721ExecuteMsg::FreezeCollectionInfo {}, + ExecuteMsg::Mint { + token_id, + owner, + token_uri, + extension, + } => Sg721ExecuteMsg::Mint { + token_id, + owner, + token_uri, + extension: extension.into(), + }, + _ => unreachable!("Invalid ExecuteMsg"), + } + } +} + +#[cw_serde] +pub enum QueryMsg { + EnableUpdatable {}, + FreezeTokenMetadata {}, + OwnerOf { + token_id: String, + include_expired: Option, + }, + Approval { + token_id: String, + spender: String, + include_expired: Option, + }, + Approvals { + token_id: String, + include_expired: Option, + }, + AllOperators { + owner: String, + include_expired: Option, + start_after: Option, + limit: Option, + }, + NumTokens {}, + ContractInfo {}, + NftInfo { + token_id: String, + }, + AllNftInfo { + token_id: String, + include_expired: Option, + }, + Tokens { + owner: String, + start_after: Option, + limit: Option, + }, + AllTokens { + start_after: Option, + limit: Option, + }, + Minter {}, + CollectionInfo {}, +} + +impl From for Sg721QueryMsg { + fn from(msg: QueryMsg) -> Sg721QueryMsg { + match msg { + QueryMsg::OwnerOf { + token_id, + include_expired, + } => Sg721QueryMsg::OwnerOf { + token_id, + include_expired, + }, + QueryMsg::Approval { + token_id, + spender, + include_expired, + } => Sg721QueryMsg::Approval { + token_id, + spender, + include_expired, + }, + QueryMsg::Approvals { + token_id, + include_expired, + } => Sg721QueryMsg::Approvals { + token_id, + include_expired, + }, + QueryMsg::AllOperators { + owner, + include_expired, + start_after, + limit, + } => Sg721QueryMsg::AllOperators { + owner, + include_expired, + start_after, + limit, + }, + QueryMsg::NumTokens {} => Sg721QueryMsg::NumTokens {}, + QueryMsg::ContractInfo {} => Sg721QueryMsg::ContractInfo {}, + QueryMsg::NftInfo { token_id } => Sg721QueryMsg::NftInfo { token_id }, + QueryMsg::AllNftInfo { + token_id, + include_expired, + } => Sg721QueryMsg::AllNftInfo { + token_id, + include_expired, + }, + QueryMsg::Tokens { + owner, + start_after, + limit, + } => Sg721QueryMsg::Tokens { + owner, + start_after, + limit, + }, + QueryMsg::AllTokens { start_after, limit } => { + Sg721QueryMsg::AllTokens { start_after, limit } + } + QueryMsg::Minter {} => Sg721QueryMsg::Minter {}, + QueryMsg::CollectionInfo {} => Sg721QueryMsg::CollectionInfo {}, + _ => unreachable!("cannot convert {:?} to Sg721QueryMsg", msg), + } + } +} + +#[cw_serde] +pub struct EnableUpdatableResponse { + pub enabled: bool, +} + +#[cw_serde] +pub struct FrozenTokenMetadataResponse { + pub frozen: bool, +} diff --git a/__fixtures__/sg721-updatable/src/state.rs b/__fixtures__/sg721-updatable/src/state.rs new file mode 100644 index 00000000..364608e6 --- /dev/null +++ b/__fixtures__/sg721-updatable/src/state.rs @@ -0,0 +1,4 @@ +use cw_storage_plus::Item; + +pub const FROZEN_TOKEN_METADATA: Item = Item::new("frozen_token_metadata"); +pub const ENABLE_UPDATABLE: Item = Item::new("enable_updatable"); diff --git a/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts b/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts index 6770e937..96fcfa44 100644 --- a/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts @@ -5,7 +5,7 @@ */ import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; diff --git a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts index fe110741..9c28ec26 100644 --- a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts @@ -5,7 +5,7 @@ */ import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; diff --git a/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts b/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts index 73d8b24d..465f2b1a 100644 --- a/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; diff --git a/__output__/builder/bundler_test/contracts/Factory.message-composer.ts b/__output__/builder/bundler_test/contracts/Factory.message-composer.ts index e5d6c5de..9b9ae7c4 100644 --- a/__output__/builder/bundler_test/contracts/Factory.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/Factory.message-composer.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; diff --git a/__output__/builder/bundler_test/contracts/Minter.message-composer.ts b/__output__/builder/bundler_test/contracts/Minter.message-composer.ts index 78472c03..57ecfa82 100644 --- a/__output__/builder/bundler_test/contracts/Minter.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/Minter.message-composer.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; diff --git a/__output__/builder/default/CwAdminFactory.message-composer.ts b/__output__/builder/default/CwAdminFactory.message-composer.ts index 6770e937..96fcfa44 100644 --- a/__output__/builder/default/CwAdminFactory.message-composer.ts +++ b/__output__/builder/default/CwAdminFactory.message-composer.ts @@ -5,7 +5,7 @@ */ import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; diff --git a/__output__/builder/default/CwCodeIdRegistry.message-composer.ts b/__output__/builder/default/CwCodeIdRegistry.message-composer.ts index fe110741..9c28ec26 100644 --- a/__output__/builder/default/CwCodeIdRegistry.message-composer.ts +++ b/__output__/builder/default/CwCodeIdRegistry.message-composer.ts @@ -5,7 +5,7 @@ */ import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; diff --git a/__output__/builder/default/CwSingle.message-composer.ts b/__output__/builder/default/CwSingle.message-composer.ts index 73d8b24d..465f2b1a 100644 --- a/__output__/builder/default/CwSingle.message-composer.ts +++ b/__output__/builder/default/CwSingle.message-composer.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; diff --git a/__output__/builder/default/Factory.message-composer.ts b/__output__/builder/default/Factory.message-composer.ts index e5d6c5de..9b9ae7c4 100644 --- a/__output__/builder/default/Factory.message-composer.ts +++ b/__output__/builder/default/Factory.message-composer.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; diff --git a/__output__/builder/default/Minter.message-composer.ts b/__output__/builder/default/Minter.message-composer.ts index 78472c03..57ecfa82 100644 --- a/__output__/builder/default/Minter.message-composer.ts +++ b/__output__/builder/default/Minter.message-composer.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; diff --git a/__output__/builder/no-extends/CwAdminFactory.message-composer.ts b/__output__/builder/no-extends/CwAdminFactory.message-composer.ts index 6770e937..96fcfa44 100644 --- a/__output__/builder/no-extends/CwAdminFactory.message-composer.ts +++ b/__output__/builder/no-extends/CwAdminFactory.message-composer.ts @@ -5,7 +5,7 @@ */ import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; diff --git a/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts b/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts index fe110741..9c28ec26 100644 --- a/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts +++ b/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts @@ -5,7 +5,7 @@ */ import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; diff --git a/__output__/builder/no-extends/CwSingle.message-composer.ts b/__output__/builder/no-extends/CwSingle.message-composer.ts index 73d8b24d..465f2b1a 100644 --- a/__output__/builder/no-extends/CwSingle.message-composer.ts +++ b/__output__/builder/no-extends/CwSingle.message-composer.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; diff --git a/__output__/builder/no-extends/Factory.message-composer.ts b/__output__/builder/no-extends/Factory.message-composer.ts index e5d6c5de..9b9ae7c4 100644 --- a/__output__/builder/no-extends/Factory.message-composer.ts +++ b/__output__/builder/no-extends/Factory.message-composer.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; diff --git a/__output__/builder/no-extends/Minter.message-composer.ts b/__output__/builder/no-extends/Minter.message-composer.ts index 78472c03..57ecfa82 100644 --- a/__output__/builder/no-extends/Minter.message-composer.ts +++ b/__output__/builder/no-extends/Minter.message-composer.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; diff --git a/__output__/daodao/cw-admin-factory/CwAdminFactory.message-composer.ts b/__output__/daodao/cw-admin-factory/CwAdminFactory.message-composer.ts index 6770e937..96fcfa44 100644 --- a/__output__/daodao/cw-admin-factory/CwAdminFactory.message-composer.ts +++ b/__output__/daodao/cw-admin-factory/CwAdminFactory.message-composer.ts @@ -5,7 +5,7 @@ */ import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; diff --git a/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.message-composer.ts b/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.message-composer.ts index fe110741..9c28ec26 100644 --- a/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.message-composer.ts +++ b/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.message-composer.ts @@ -5,7 +5,7 @@ */ import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; diff --git a/__output__/daodao/cw-named-groups/CwNamedGroups.message-composer.ts b/__output__/daodao/cw-named-groups/CwNamedGroups.message-composer.ts index 4836e52f..a5416273 100644 --- a/__output__/daodao/cw-named-groups/CwNamedGroups.message-composer.ts +++ b/__output__/daodao/cw-named-groups/CwNamedGroups.message-composer.ts @@ -5,7 +5,7 @@ */ import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { DumpResponse, Group, ExecuteMsg, InstantiateMsg, Addr, ListAddressesResponse, ListGroupsResponse, QueryMsg } from "./CwNamedGroups.types"; diff --git a/__output__/daodao/cw-proposal-single/CwProposalSingle.message-composer.ts b/__output__/daodao/cw-proposal-single/CwProposalSingle.message-composer.ts index 8843416c..d6b1c420 100644 --- a/__output__/daodao/cw-proposal-single/CwProposalSingle.message-composer.ts +++ b/__output__/daodao/cw-proposal-single/CwProposalSingle.message-composer.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwProposalSingle.types"; diff --git a/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts b/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts index e7f1a152..4d7ecf3b 100644 --- a/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts +++ b/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts @@ -5,7 +5,7 @@ */ import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, VaultBaseForString, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, String, TokensResponse, ArrayOfVaultBaseForString, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse } from "./AccountsNft.types"; diff --git a/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.message-composer.ts b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.message-composer.ts index f29fcb55..64013370 100644 --- a/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.message-composer.ts +++ b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.message-composer.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Duration, Threshold, Decimal, InstantiateMsg, Voter, ExecuteMsg, Expiration, Timestamp, Uint64, CosmosMsgForEmpty, BankMsg, Uint128, StakingMsg, DistributionMsg, WasmMsg, Binary, Vote, Coin, Empty, QueryMsg, Status, ThresholdResponse, ProposalListResponse, ProposalResponseForEmpty, VoterListResponse, VoterDetail, VoteListResponse, VoteInfo, VoteResponse, VoterResponse } from "./Cw3FixedMultiSig.types"; diff --git a/__output__/idl-version/cw4-group/Cw4Group.message-composer.ts b/__output__/idl-version/cw4-group/Cw4Group.message-composer.ts index e9cdd0d6..3c24b2d7 100644 --- a/__output__/idl-version/cw4-group/Cw4Group.message-composer.ts +++ b/__output__/idl-version/cw4-group/Cw4Group.message-composer.ts @@ -5,7 +5,7 @@ */ import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { InstantiateMsg, Member, ExecuteMsg, QueryMsg, AdminResponse, HooksResponse, MemberListResponse, MemberResponse, TotalWeightResponse } from "./Cw4Group.types"; diff --git a/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts b/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts index fe8d0b77..aca7c528 100644 --- a/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts +++ b/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts @@ -5,7 +5,7 @@ */ import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { InstantiateMsg, ExecuteMsg, QueryMsg, Timestamp, Uint64, Addr, Env, BlockInfo, ContractInfo, TransactionInfo } from "./CyberPunk.types"; diff --git a/__output__/idl-version/hackatom/HackAtom.message-composer.ts b/__output__/idl-version/hackatom/HackAtom.message-composer.ts index c7463089..d839559c 100644 --- a/__output__/idl-version/hackatom/HackAtom.message-composer.ts +++ b/__output__/idl-version/hackatom/HackAtom.message-composer.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, SudoMsg, Uint128, Coin, IntResponse, AllBalanceResponse, Binary, RecurseResponse, VerifierResponse } from "./HackAtom.types"; diff --git a/__output__/minter/Minter.message-composer.ts b/__output__/minter/Minter.message-composer.ts index 78472c03..57ecfa82 100644 --- a/__output__/minter/Minter.message-composer.ts +++ b/__output__/minter/Minter.message-composer.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; diff --git a/__output__/sg721-updatable/out/Sg721Updatable.client.ts b/__output__/sg721-updatable/out/Sg721Updatable.client.ts new file mode 100644 index 00000000..bdc3b8c6 --- /dev/null +++ b/__output__/sg721-updatable/out/Sg721Updatable.client.ts @@ -0,0 +1,528 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { Coin, StdFee } from "@cosmjs/amino"; +import { Expiration, Timestamp, Uint64, AllNftInfoResponse, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, AllOperatorsResponse, AllTokensResponse, ApprovalResponse, ApprovalsResponse, Decimal, CollectionInfoResponse, RoyaltyInfoResponse, ContractInfoResponse, ExecuteMsgForNullable_EmptyAndEmpty, Binary, UpdateCollectionInfoMsgForRoyaltyInfoResponse, InstantiateMsg, CollectionInfoForRoyaltyInfoResponse, MinterResponse, NftInfoResponse, NumTokensResponse, QueryMsg, TokensResponse } from "./Sg721Updatable.types"; +export interface Sg721UpdatableReadOnlyInterface { + contractAddress: string; + ownerOf: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + approval: ({ + includeExpired, + spender, + tokenId + }: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }) => Promise; + approvals: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + allOperators: ({ + includeExpired, + limit, + owner, + startAfter + }: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + numTokens: () => Promise; + contractInfo: () => Promise; + nftInfo: ({ + tokenId + }: { + tokenId: string; + }) => Promise; + allNftInfo: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + tokens: ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + allTokens: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + minter: () => Promise; + collectionInfo: () => Promise; +} +export class Sg721UpdatableQueryClient implements Sg721UpdatableReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.ownerOf = this.ownerOf.bind(this); + this.approval = this.approval.bind(this); + this.approvals = this.approvals.bind(this); + this.allOperators = this.allOperators.bind(this); + this.numTokens = this.numTokens.bind(this); + this.contractInfo = this.contractInfo.bind(this); + this.nftInfo = this.nftInfo.bind(this); + this.allNftInfo = this.allNftInfo.bind(this); + this.tokens = this.tokens.bind(this); + this.allTokens = this.allTokens.bind(this); + this.minter = this.minter.bind(this); + this.collectionInfo = this.collectionInfo.bind(this); + } + + ownerOf = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner_of: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + approval = async ({ + includeExpired, + spender, + tokenId + }: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + approval: { + include_expired: includeExpired, + spender, + token_id: tokenId + } + }); + }; + approvals = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + approvals: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + allOperators = async ({ + includeExpired, + limit, + owner, + startAfter + }: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_operators: { + include_expired: includeExpired, + limit, + owner, + start_after: startAfter + } + }); + }; + numTokens = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + num_tokens: {} + }); + }; + contractInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + contract_info: {} + }); + }; + nftInfo = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + nft_info: { + token_id: tokenId + } + }); + }; + allNftInfo = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_nft_info: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + tokens = async ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + tokens: { + limit, + owner, + start_after: startAfter + } + }); + }; + allTokens = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_tokens: { + limit, + start_after: startAfter + } + }); + }; + minter = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + minter: {} + }); + }; + collectionInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + collection_info: {} + }); + }; +} +export interface Sg721UpdatableInterface extends Sg721UpdatableReadOnlyInterface { + contractAddress: string; + sender: string; + freezeTokenMetadata: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateTokenMetadata: ({ + tokenId, + tokenUri + }: { + tokenId: string; + tokenUri?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + enableUpdatable: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + transferNft: ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + sendNft: ({ + contract, + msg, + tokenId + }: { + contract: string; + msg: Binary; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + approve: ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + revoke: ({ + spender, + tokenId + }: { + spender: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + approveAll: ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + revokeAll: ({ + operator + }: { + operator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burn: ({ + tokenId + }: { + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateCollectionInfo: ({ + collectionInfo + }: { + collectionInfo: UpdateCollectionInfoMsgForRoyaltyInfoResponse; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateTradingStartTime: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + freezeCollectionInfo: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + mint: ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension?: Empty; + owner: string; + tokenId: string; + tokenUri?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + extension: ({ + msg + }: { + msg: Empty; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Sg721UpdatableClient extends Sg721UpdatableQueryClient implements Sg721UpdatableInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + super(client, contractAddress); + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.freezeTokenMetadata = this.freezeTokenMetadata.bind(this); + this.updateTokenMetadata = this.updateTokenMetadata.bind(this); + this.enableUpdatable = this.enableUpdatable.bind(this); + this.transferNft = this.transferNft.bind(this); + this.sendNft = this.sendNft.bind(this); + this.approve = this.approve.bind(this); + this.revoke = this.revoke.bind(this); + this.approveAll = this.approveAll.bind(this); + this.revokeAll = this.revokeAll.bind(this); + this.burn = this.burn.bind(this); + this.updateCollectionInfo = this.updateCollectionInfo.bind(this); + this.updateTradingStartTime = this.updateTradingStartTime.bind(this); + this.freezeCollectionInfo = this.freezeCollectionInfo.bind(this); + this.mint = this.mint.bind(this); + this.extension = this.extension.bind(this); + } + + freezeTokenMetadata = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + freeze_token_metadata: {} + }, fee, memo, _funds); + }; + updateTokenMetadata = async ({ + tokenId, + tokenUri + }: { + tokenId: string; + tokenUri?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_token_metadata: { + token_id: tokenId, + token_uri: tokenUri + } + }, fee, memo, _funds); + }; + enableUpdatable = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + enable_updatable: {} + }, fee, memo, _funds); + }; + transferNft = async ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_nft: { + recipient, + token_id: tokenId + } + }, fee, memo, _funds); + }; + sendNft = async ({ + contract, + msg, + tokenId + }: { + contract: string; + msg: Binary; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send_nft: { + contract, + msg, + token_id: tokenId + } + }, fee, memo, _funds); + }; + approve = async ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve: { + expires, + spender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + revoke = async ({ + spender, + tokenId + }: { + spender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke: { + spender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + approveAll = async ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve_all: { + expires, + operator + } + }, fee, memo, _funds); + }; + revokeAll = async ({ + operator + }: { + operator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke_all: { + operator + } + }, fee, memo, _funds); + }; + burn = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + token_id: tokenId + } + }, fee, memo, _funds); + }; + updateCollectionInfo = async ({ + collectionInfo + }: { + collectionInfo: UpdateCollectionInfoMsgForRoyaltyInfoResponse; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_collection_info: { + collection_info: collectionInfo + } + }, fee, memo, _funds); + }; + updateTradingStartTime = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_trading_start_time: {} + }, fee, memo, _funds); + }; + freezeCollectionInfo = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + freeze_collection_info: {} + }, fee, memo, _funds); + }; + mint = async ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension?: Empty; + owner: string; + tokenId: string; + tokenUri?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: { + extension, + owner, + token_id: tokenId, + token_uri: tokenUri + } + }, fee, memo, _funds); + }; + extension = async ({ + msg + }: { + msg: Empty; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + extension: { + msg + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/__output__/sg721-updatable/out/Sg721Updatable.message-composer.ts b/__output__/sg721-updatable/out/Sg721Updatable.message-composer.ts new file mode 100644 index 00000000..d717a293 --- /dev/null +++ b/__output__/sg721-updatable/out/Sg721Updatable.message-composer.ts @@ -0,0 +1,415 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Coin } from "@cosmjs/amino"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; +import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@cosmjs/encoding"; +import { Expiration, Timestamp, Uint64, AllNftInfoResponse, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, AllOperatorsResponse, AllTokensResponse, ApprovalResponse, ApprovalsResponse, Decimal, CollectionInfoResponse, RoyaltyInfoResponse, ContractInfoResponse, ExecuteMsgForNullable_EmptyAndEmpty, Binary, UpdateCollectionInfoMsgForRoyaltyInfoResponse, InstantiateMsg, CollectionInfoForRoyaltyInfoResponse, MinterResponse, NftInfoResponse, NumTokensResponse, QueryMsg, TokensResponse } from "./Sg721Updatable.types"; +export interface Sg721UpdatableMessage { + contractAddress: string; + sender: string; + freezeTokenMetadata: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateTokenMetadata: ({ + tokenId, + tokenUri + }: { + tokenId: string; + tokenUri?: string; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + enableUpdatable: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; + transferNft: ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: string; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + sendNft: ({ + contract, + msg, + tokenId + }: { + contract: string; + msg: Binary; + tokenId: string; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + approve: ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + revoke: ({ + spender, + tokenId + }: { + spender: string; + tokenId: string; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + approveAll: ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + revokeAll: ({ + operator + }: { + operator: string; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + burn: ({ + tokenId + }: { + tokenId: string; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateCollectionInfo: ({ + collectionInfo + }: { + collectionInfo: UpdateCollectionInfoMsgForRoyaltyInfoResponse; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + updateTradingStartTime: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; + freezeCollectionInfo: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; + mint: ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension?: Empty; + owner: string; + tokenId: string; + tokenUri?: string; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; + extension: ({ + msg + }: { + msg: Empty; + }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; +} +export class Sg721UpdatableMessageComposer implements Sg721UpdatableMessage { + sender: string; + contractAddress: string; + + constructor(sender: string, contractAddress: string) { + this.sender = sender; + this.contractAddress = contractAddress; + this.freezeTokenMetadata = this.freezeTokenMetadata.bind(this); + this.updateTokenMetadata = this.updateTokenMetadata.bind(this); + this.enableUpdatable = this.enableUpdatable.bind(this); + this.transferNft = this.transferNft.bind(this); + this.sendNft = this.sendNft.bind(this); + this.approve = this.approve.bind(this); + this.revoke = this.revoke.bind(this); + this.approveAll = this.approveAll.bind(this); + this.revokeAll = this.revokeAll.bind(this); + this.burn = this.burn.bind(this); + this.updateCollectionInfo = this.updateCollectionInfo.bind(this); + this.updateTradingStartTime = this.updateTradingStartTime.bind(this); + this.freezeCollectionInfo = this.freezeCollectionInfo.bind(this); + this.mint = this.mint.bind(this); + this.extension = this.extension.bind(this); + } + + freezeTokenMetadata = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + freeze_token_metadata: {} + })), + funds: _funds + }) + }; + }; + updateTokenMetadata = ({ + tokenId, + tokenUri + }: { + tokenId: string; + tokenUri?: string; + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_token_metadata: { + token_id: tokenId, + token_uri: tokenUri + } + })), + funds: _funds + }) + }; + }; + enableUpdatable = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + enable_updatable: {} + })), + funds: _funds + }) + }; + }; + transferNft = ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: string; + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + transfer_nft: { + recipient, + token_id: tokenId + } + })), + funds: _funds + }) + }; + }; + sendNft = ({ + contract, + msg, + tokenId + }: { + contract: string; + msg: Binary; + tokenId: string; + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + send_nft: { + contract, + msg, + token_id: tokenId + } + })), + funds: _funds + }) + }; + }; + approve = ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + approve: { + expires, + spender, + token_id: tokenId + } + })), + funds: _funds + }) + }; + }; + revoke = ({ + spender, + tokenId + }: { + spender: string; + tokenId: string; + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + revoke: { + spender, + token_id: tokenId + } + })), + funds: _funds + }) + }; + }; + approveAll = ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + approve_all: { + expires, + operator + } + })), + funds: _funds + }) + }; + }; + revokeAll = ({ + operator + }: { + operator: string; + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + revoke_all: { + operator + } + })), + funds: _funds + }) + }; + }; + burn = ({ + tokenId + }: { + tokenId: string; + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + burn: { + token_id: tokenId + } + })), + funds: _funds + }) + }; + }; + updateCollectionInfo = ({ + collectionInfo + }: { + collectionInfo: UpdateCollectionInfoMsgForRoyaltyInfoResponse; + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_collection_info: { + collection_info: collectionInfo + } + })), + funds: _funds + }) + }; + }; + updateTradingStartTime = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + update_trading_start_time: {} + })), + funds: _funds + }) + }; + }; + freezeCollectionInfo = (_funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + freeze_collection_info: {} + })), + funds: _funds + }) + }; + }; + mint = ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension?: Empty; + owner: string; + tokenId: string; + tokenUri?: string; + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + mint: { + extension, + owner, + token_id: tokenId, + token_uri: tokenUri + } + })), + funds: _funds + }) + }; + }; + extension = ({ + msg + }: { + msg: Empty; + }, _funds?: Coin[]): MsgExecuteContractEncodeObject => { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial({ + sender: this.sender, + contract: this.contractAddress, + msg: toUtf8(JSON.stringify({ + extension: { + msg + } + })), + funds: _funds + }) + }; + }; +} \ No newline at end of file diff --git a/__output__/sg721-updatable/out/Sg721Updatable.react-query.ts b/__output__/sg721-updatable/out/Sg721Updatable.react-query.ts new file mode 100644 index 00000000..f0795d29 --- /dev/null +++ b/__output__/sg721-updatable/out/Sg721Updatable.react-query.ts @@ -0,0 +1,175 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { UseQueryOptions, useQuery } from "react-query"; +import { Expiration, Timestamp, Uint64, AllNftInfoResponse, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, AllOperatorsResponse, AllTokensResponse, ApprovalResponse, ApprovalsResponse, Decimal, CollectionInfoResponse, RoyaltyInfoResponse, ContractInfoResponse, ExecuteMsgForNullable_EmptyAndEmpty, Binary, UpdateCollectionInfoMsgForRoyaltyInfoResponse, InstantiateMsg, CollectionInfoForRoyaltyInfoResponse, MinterResponse, NftInfoResponse, NumTokensResponse, QueryMsg, TokensResponse } from "./Sg721Updatable.types"; +import { Sg721UpdatableQueryClient } from "./Sg721Updatable.client"; +export interface Sg721UpdatableReactQuery { + client: Sg721UpdatableQueryClient; + options?: UseQueryOptions; +} +export interface Sg721UpdatableCollectionInfoQuery extends Sg721UpdatableReactQuery {} +export function useSg721UpdatableCollectionInfoQuery({ + client, + options +}: Sg721UpdatableCollectionInfoQuery) { + return useQuery(["sg721UpdatableCollectionInfo", client.contractAddress], () => client.collectionInfo(), options); +} +export interface Sg721UpdatableMinterQuery extends Sg721UpdatableReactQuery {} +export function useSg721UpdatableMinterQuery({ + client, + options +}: Sg721UpdatableMinterQuery) { + return useQuery(["sg721UpdatableMinter", client.contractAddress], () => client.minter(), options); +} +export interface Sg721UpdatableAllTokensQuery extends Sg721UpdatableReactQuery { + args: { + limit?: number; + startAfter?: string; + }; +} +export function useSg721UpdatableAllTokensQuery({ + client, + args, + options +}: Sg721UpdatableAllTokensQuery) { + return useQuery(["sg721UpdatableAllTokens", client.contractAddress, JSON.stringify(args)], () => client.allTokens({ + limit: args.limit, + startAfter: args.startAfter + }), options); +} +export interface Sg721UpdatableTokensQuery extends Sg721UpdatableReactQuery { + args: { + limit?: number; + owner: string; + startAfter?: string; + }; +} +export function useSg721UpdatableTokensQuery({ + client, + args, + options +}: Sg721UpdatableTokensQuery) { + return useQuery(["sg721UpdatableTokens", client.contractAddress, JSON.stringify(args)], () => client.tokens({ + limit: args.limit, + owner: args.owner, + startAfter: args.startAfter + }), options); +} +export interface Sg721UpdatableAllNftInfoQuery extends Sg721UpdatableReactQuery { + args: { + includeExpired?: boolean; + tokenId: string; + }; +} +export function useSg721UpdatableAllNftInfoQuery({ + client, + args, + options +}: Sg721UpdatableAllNftInfoQuery) { + return useQuery(["sg721UpdatableAllNftInfo", client.contractAddress, JSON.stringify(args)], () => client.allNftInfo({ + includeExpired: args.includeExpired, + tokenId: args.tokenId + }), options); +} +export interface Sg721UpdatableNftInfoQuery extends Sg721UpdatableReactQuery { + args: { + tokenId: string; + }; +} +export function useSg721UpdatableNftInfoQuery({ + client, + args, + options +}: Sg721UpdatableNftInfoQuery) { + return useQuery(["sg721UpdatableNftInfo", client.contractAddress, JSON.stringify(args)], () => client.nftInfo({ + tokenId: args.tokenId + }), options); +} +export interface Sg721UpdatableContractInfoQuery extends Sg721UpdatableReactQuery {} +export function useSg721UpdatableContractInfoQuery({ + client, + options +}: Sg721UpdatableContractInfoQuery) { + return useQuery(["sg721UpdatableContractInfo", client.contractAddress], () => client.contractInfo(), options); +} +export interface Sg721UpdatableNumTokensQuery extends Sg721UpdatableReactQuery {} +export function useSg721UpdatableNumTokensQuery({ + client, + options +}: Sg721UpdatableNumTokensQuery) { + return useQuery(["sg721UpdatableNumTokens", client.contractAddress], () => client.numTokens(), options); +} +export interface Sg721UpdatableAllOperatorsQuery extends Sg721UpdatableReactQuery { + args: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }; +} +export function useSg721UpdatableAllOperatorsQuery({ + client, + args, + options +}: Sg721UpdatableAllOperatorsQuery) { + return useQuery(["sg721UpdatableAllOperators", client.contractAddress, JSON.stringify(args)], () => client.allOperators({ + includeExpired: args.includeExpired, + limit: args.limit, + owner: args.owner, + startAfter: args.startAfter + }), options); +} +export interface Sg721UpdatableApprovalsQuery extends Sg721UpdatableReactQuery { + args: { + includeExpired?: boolean; + tokenId: string; + }; +} +export function useSg721UpdatableApprovalsQuery({ + client, + args, + options +}: Sg721UpdatableApprovalsQuery) { + return useQuery(["sg721UpdatableApprovals", client.contractAddress, JSON.stringify(args)], () => client.approvals({ + includeExpired: args.includeExpired, + tokenId: args.tokenId + }), options); +} +export interface Sg721UpdatableApprovalQuery extends Sg721UpdatableReactQuery { + args: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }; +} +export function useSg721UpdatableApprovalQuery({ + client, + args, + options +}: Sg721UpdatableApprovalQuery) { + return useQuery(["sg721UpdatableApproval", client.contractAddress, JSON.stringify(args)], () => client.approval({ + includeExpired: args.includeExpired, + spender: args.spender, + tokenId: args.tokenId + }), options); +} +export interface Sg721UpdatableOwnerOfQuery extends Sg721UpdatableReactQuery { + args: { + includeExpired?: boolean; + tokenId: string; + }; +} +export function useSg721UpdatableOwnerOfQuery({ + client, + args, + options +}: Sg721UpdatableOwnerOfQuery) { + return useQuery(["sg721UpdatableOwnerOf", client.contractAddress, JSON.stringify(args)], () => client.ownerOf({ + includeExpired: args.includeExpired, + tokenId: args.tokenId + }), options); +} \ No newline at end of file diff --git a/__output__/sg721-updatable/out/Sg721Updatable.types.ts b/__output__/sg721-updatable/out/Sg721Updatable.types.ts new file mode 100644 index 00000000..bfa2c387 --- /dev/null +++ b/__output__/sg721-updatable/out/Sg721Updatable.types.ts @@ -0,0 +1,216 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export interface AllNftInfoResponse { + access: OwnerOfResponse; + info: NftInfoResponseForEmpty; +} +export interface OwnerOfResponse { + approvals: Approval[]; + owner: string; +} +export interface Approval { + expires: Expiration; + spender: string; +} +export interface NftInfoResponseForEmpty { + extension: Empty; + token_uri?: string | null; +} +export interface Empty { + [k: string]: unknown; +} +export interface AllOperatorsResponse { + operators: Approval[]; +} +export interface AllTokensResponse { + tokens: string[]; +} +export interface ApprovalResponse { + approval: Approval; +} +export interface ApprovalsResponse { + approvals: Approval[]; +} +export type Decimal = string; +export interface CollectionInfoResponse { + creator: string; + description: string; + explicit_content?: boolean | null; + external_link?: string | null; + image: string; + royalty_info?: RoyaltyInfoResponse | null; + start_trading_time?: Timestamp | null; +} +export interface RoyaltyInfoResponse { + payment_address: string; + share: Decimal; +} +export interface ContractInfoResponse { + name: string; + symbol: string; +} +export type ExecuteMsgForNullable_EmptyAndEmpty = { + freeze_token_metadata: {}; +} | { + update_token_metadata: { + token_id: string; + token_uri?: string | null; + }; +} | { + enable_updatable: {}; +} | { + transfer_nft: { + recipient: string; + token_id: string; + }; +} | { + send_nft: { + contract: string; + msg: Binary; + token_id: string; + }; +} | { + approve: { + expires?: Expiration | null; + spender: string; + token_id: string; + }; +} | { + revoke: { + spender: string; + token_id: string; + }; +} | { + approve_all: { + expires?: Expiration | null; + operator: string; + }; +} | { + revoke_all: { + operator: string; + }; +} | { + burn: { + token_id: string; + }; +} | { + update_collection_info: { + collection_info: UpdateCollectionInfoMsgForRoyaltyInfoResponse; + }; +} | { + update_trading_start_time: Timestamp | null; +} | { + freeze_collection_info: {}; +} | { + mint: { + extension?: Empty | null; + owner: string; + token_id: string; + token_uri?: string | null; + }; +} | { + extension: { + msg: Empty; + }; +}; +export type Binary = string; +export interface UpdateCollectionInfoMsgForRoyaltyInfoResponse { + description?: string | null; + explicit_content?: boolean | null; + external_link?: string | null; + image?: string | null; + royalty_info?: (RoyaltyInfoResponse | null) | null; +} +export interface InstantiateMsg { + collection_info: CollectionInfoForRoyaltyInfoResponse; + minter: string; + name: string; + symbol: string; +} +export interface CollectionInfoForRoyaltyInfoResponse { + creator: string; + description: string; + explicit_content?: boolean | null; + external_link?: string | null; + image: string; + royalty_info?: RoyaltyInfoResponse | null; + start_trading_time?: Timestamp | null; +} +export interface MinterResponse { + minter: string; +} +export interface NftInfoResponse { + extension: Empty; + token_uri?: string | null; +} +export interface NumTokensResponse { + count: number; +} +export type QueryMsg = { + owner_of: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + approval: { + include_expired?: boolean | null; + spender: string; + token_id: string; + }; +} | { + approvals: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + all_operators: { + include_expired?: boolean | null; + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + num_tokens: {}; +} | { + contract_info: {}; +} | { + nft_info: { + token_id: string; + }; +} | { + all_nft_info: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + tokens: { + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + all_tokens: { + limit?: number | null; + start_after?: string | null; + }; +} | { + minter: {}; +} | { + collection_info: {}; +}; +export interface TokensResponse { + tokens: string[]; +} \ No newline at end of file diff --git a/__output__/sg721-updatable/out/bundle.ts b/__output__/sg721-updatable/out/bundle.ts new file mode 100644 index 00000000..e36ed81d --- /dev/null +++ b/__output__/sg721-updatable/out/bundle.ts @@ -0,0 +1,17 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import * as _0 from "./Sg721Updatable.types"; +import * as _1 from "./Sg721Updatable.client"; +import * as _2 from "./Sg721Updatable.message-composer"; +import * as _3 from "./Sg721Updatable.react-query"; +export namespace contracts { + export const Sg721Updatable = { ..._0, + ..._1, + ..._2, + ..._3 + }; +} \ No newline at end of file diff --git a/__output__/sg721/Sg721.message-composer.ts b/__output__/sg721/Sg721.message-composer.ts index 84f6d2bd..b405a89f 100644 --- a/__output__/sg721/Sg721.message-composer.ts +++ b/__output__/sg721/Sg721.message-composer.ts @@ -5,7 +5,7 @@ */ import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Expiration, Timestamp, Uint64, AllNftInfoResponse, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, AllOperatorsResponse, AllTokensResponse, ApprovalResponse, ApprovalsResponse, Decimal, CollectionInfoResponse, RoyaltyInfoResponse, ContractInfoResponse, ExecuteMsgForEmpty, Binary, MintMsgForEmpty, InstantiateMsg, CollectionInfoForRoyaltyInfoResponse, MinterResponse, NftInfoResponse, NumTokensResponse, OperatorsResponse, QueryMsg, TokensResponse } from "./Sg721.types"; diff --git a/__output__/vectis/factory-w-mutations/Factory.react-query.ts b/__output__/vectis/factory-w-mutations/Factory.react-query.ts index 2945c3b6..93a6f935 100644 --- a/__output__/vectis/factory-w-mutations/Factory.react-query.ts +++ b/__output__/vectis/factory-w-mutations/Factory.react-query.ts @@ -102,9 +102,9 @@ export function useFactoryUpdateAdminMutation(options?: Omit client.updateAdmin(msg, fee, memo, _funds), options); + }) => client.updateAdmin(msg, fee, memo, funds), options); } export interface FactoryUpdateGovecAddrMutation { client: FactoryClient; @@ -124,9 +124,9 @@ export function useFactoryUpdateGovecAddrMutation(options?: Omit client.updateGovecAddr(msg, fee, memo, _funds), options); + }) => client.updateGovecAddr(msg, fee, memo, funds), options); } export interface FactoryUpdateWalletFeeMutation { client: FactoryClient; @@ -146,9 +146,9 @@ export function useFactoryUpdateWalletFeeMutation(options?: Omit client.updateWalletFee(msg, fee, memo, _funds), options); + }) => client.updateWalletFee(msg, fee, memo, funds), options); } export interface FactoryUpdateCodeIdMutation { client: FactoryClient; @@ -169,9 +169,9 @@ export function useFactoryUpdateCodeIdMutation(options?: Omit client.updateCodeId(msg, fee, memo, _funds), options); + }) => client.updateCodeId(msg, fee, memo, funds), options); } export interface FactoryMigrateWalletMutation { client: FactoryClient; @@ -192,9 +192,9 @@ export function useFactoryMigrateWalletMutation(options?: Omit client.migrateWallet(msg, fee, memo, _funds), options); + }) => client.migrateWallet(msg, fee, memo, funds), options); } export interface FactoryUpdateProxyUserMutation { client: FactoryClient; @@ -215,9 +215,9 @@ export function useFactoryUpdateProxyUserMutation(options?: Omit client.updateProxyUser(msg, fee, memo, _funds), options); + }) => client.updateProxyUser(msg, fee, memo, funds), options); } export interface FactoryCreateWalletMutation { client: FactoryClient; @@ -237,7 +237,7 @@ export function useFactoryCreateWalletMutation(options?: Omit client.createWallet(msg, fee, memo, _funds), options); + }) => client.createWallet(msg, fee, memo, funds), options); } \ No newline at end of file diff --git a/__output__/vectis/factory/Factory.message-composer.ts b/__output__/vectis/factory/Factory.message-composer.ts index e5d6c5de..9b9ae7c4 100644 --- a/__output__/vectis/factory/Factory.message-composer.ts +++ b/__output__/vectis/factory/Factory.message-composer.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; diff --git a/__output__/vectis/govec/Govec.message-composer.ts b/__output__/vectis/govec/Govec.message-composer.ts index 4c0426bc..404dda41 100644 --- a/__output__/vectis/govec/Govec.message-composer.ts +++ b/__output__/vectis/govec/Govec.message-composer.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { CanExecuteRelayResponse, CosmosMsgForEmpty, BankMsg, Uint128, StakingMsg, DistributionMsg, WasmMsg, Binary, Coin, Empty, ExecuteMsgForEmpty, Addr, RelayTransaction, Guardians, MultiSig, InfoResponse, ContractVersion, InstantiateMsg, CreateWalletMsg, QueryMsg, Uint64 } from "./Govec.types"; diff --git a/__output__/vectis/proxy/Proxy.message-composer.ts b/__output__/vectis/proxy/Proxy.message-composer.ts index 92591221..29ad852e 100644 --- a/__output__/vectis/proxy/Proxy.message-composer.ts +++ b/__output__/vectis/proxy/Proxy.message-composer.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "cosmwasm"; +import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { CanExecuteRelayResponse, CosmosMsgForEmpty, BankMsg, Uint128, StakingMsg, DistributionMsg, WasmMsg, Binary, Coin, Empty, ExecuteMsgForEmpty, Addr, RelayTransaction, Guardians, MultiSig, InfoResponse, ContractVersion, InstantiateMsg, CreateWalletMsg, QueryMsg, Uint64 } from "./Proxy.types"; diff --git a/packages/ts-codegen/__tests__/ts-codegen.issue-long-exe-msg-name.test.ts b/packages/ts-codegen/__tests__/ts-codegen.issue-long-exe-msg-name.test.ts new file mode 100644 index 00000000..ce67b501 --- /dev/null +++ b/packages/ts-codegen/__tests__/ts-codegen.issue-long-exe-msg-name.test.ts @@ -0,0 +1,29 @@ +import { TSBuilder } from '../src/builder'; + +const FIXTURE_DIR = __dirname + '/../../../__fixtures__'; +const OUTPUT_DIR = __dirname + '/../../../__output__'; + +it('issue-long-exe-msg-name', async () => { + const outPath = OUTPUT_DIR + '/sg721-updatable/out'; + const schemaDir = FIXTURE_DIR + '/sg721-updatable/'; + + const builder = new TSBuilder({ + contracts: [schemaDir], + outPath, + options: { + messageComposer: { + enabled: true + }, + types: { + enabled: true + }, + client: { + enabled: true + }, + reactQuery: { + enabled: true + } + } + }); + await builder.build(); +}); diff --git a/packages/ts-codegen/src/utils/schemas.ts b/packages/ts-codegen/src/utils/schemas.ts index a1206a65..9c4b3cb6 100644 --- a/packages/ts-codegen/src/utils/schemas.ts +++ b/packages/ts-codegen/src/utils/schemas.ts @@ -79,9 +79,7 @@ export const findQueryMsg = (schemas) => { export const findExecuteMsg = (schemas) => { const ExecuteMsg = schemas.find(schema => - schema.title === 'ExecuteMsg' || - schema.title === 'ExecuteMsg_for_Empty' || // if cleanse is used, this is never - schema.title === 'ExecuteMsgForEmpty' + schema.title.startsWith('ExecuteMsg') ); return ExecuteMsg; }; diff --git a/packages/wasm-ast-types/types/client/client.d.ts b/packages/wasm-ast-types/types/client/client.d.ts index 77f57150..bc1e484a 100644 --- a/packages/wasm-ast-types/types/client/client.d.ts +++ b/packages/wasm-ast-types/types/client/client.d.ts @@ -1,9 +1,7 @@ import * as t from '@babel/types'; -import { QueryMsg, ExecuteMsg } from '../types'; +import { ExecuteMsg, JSONSchema, QueryMsg } from '../types'; import { RenderContext } from '../context'; -import { JSONSchema } from '../types'; export declare const CONSTANT_EXEC_PARAMS: (t.AssignmentPattern | t.Identifier)[]; -export declare const FIXED_EXECUTE_PARAMS: t.Identifier[]; export declare const createWasmQueryMethod: (context: RenderContext, jsonschema: any) => t.ClassProperty; export declare const createQueryClass: (context: RenderContext, className: string, implementsClassName: string, queryMsg: QueryMsg) => t.ExportNamedDeclaration; export declare const getWasmMethodArgs: (context: RenderContext, jsonschema: JSONSchema) => t.ObjectProperty[]; diff --git a/packages/wasm-ast-types/types/context/context.d.ts b/packages/wasm-ast-types/types/context/context.d.ts index f3b19e60..acb7b342 100644 --- a/packages/wasm-ast-types/types/context/context.d.ts +++ b/packages/wasm-ast-types/types/context/context.d.ts @@ -25,7 +25,6 @@ export interface RecoilOptions { } export interface TSTypesOptions { enabled?: boolean; - // deprecated aliasExecuteMsg?: boolean; aliasEntryPoints?: boolean; } diff --git a/packages/wasm-ast-types/types/msg-builder/msg-builder.d.ts b/packages/wasm-ast-types/types/msg-builder/msg-builder.d.ts index 26f00fc8..4a3f0edb 100644 --- a/packages/wasm-ast-types/types/msg-builder/msg-builder.d.ts +++ b/packages/wasm-ast-types/types/msg-builder/msg-builder.d.ts @@ -1,4 +1,4 @@ -import * as t from "@babel/types"; -import { ExecuteMsg, QueryMsg } from "../types"; -import { RenderContext } from "../context"; +import * as t from '@babel/types'; +import { ExecuteMsg, QueryMsg } from '../types'; +import { RenderContext } from '../context'; export declare const createMsgBuilderClass: (context: RenderContext, className: string, msg: ExecuteMsg | QueryMsg) => t.ExportNamedDeclaration; diff --git a/packages/wasm-ast-types/types/utils/babel.d.ts b/packages/wasm-ast-types/types/utils/babel.d.ts index 4b9a5919..c7a4ccb4 100644 --- a/packages/wasm-ast-types/types/utils/babel.d.ts +++ b/packages/wasm-ast-types/types/utils/babel.d.ts @@ -1,12 +1,7 @@ import * as t from '@babel/types'; import { Field } from '../types'; import { TSTypeAnnotation, TSExpressionWithTypeArguments } from '@babel/types'; -export declare const propertySignature: (name: string, typeAnnotation: t.TSTypeAnnotation, optional?: boolean) => { - type: string; - key: t.Identifier; - typeAnnotation: t.TSTypeAnnotation; - optional: boolean; -}; +export declare const propertySignature: (name: string, typeAnnotation: TSTypeAnnotation, optional?: boolean) => t.TSPropertySignature; export declare const identifier: (name: string, typeAnnotation: t.TSTypeAnnotation, optional?: boolean) => t.Identifier; export declare const tsTypeOperator: (typeAnnotation: t.TSType, operator: string) => t.TSTypeOperator; export declare const getMessageProperties: (msg: any) => any[]; diff --git a/packages/wasm-ast-types/types/utils/constants.d.ts b/packages/wasm-ast-types/types/utils/constants.d.ts new file mode 100644 index 00000000..447b24dc --- /dev/null +++ b/packages/wasm-ast-types/types/utils/constants.d.ts @@ -0,0 +1,5 @@ +import * as t from '@babel/types'; +export declare const OPTIONAL_FUNDS_PARAM: t.Identifier; +export declare const OPTIONAL_FEE_PARAM: t.Identifier; +export declare const OPTIONAL_MEMO_PARAM: t.Identifier; +export declare const FIXED_EXECUTE_PARAMS: t.Identifier[]; diff --git a/packages/wasm-ast-types/types/utils/index.d.ts b/packages/wasm-ast-types/types/utils/index.d.ts index 2e232599..aa3643b7 100644 --- a/packages/wasm-ast-types/types/utils/index.d.ts +++ b/packages/wasm-ast-types/types/utils/index.d.ts @@ -1,3 +1,5 @@ export * from './babel'; export * from './types'; export * from './ref'; +export { OPTIONAL_FUNDS_PARAM } from './constants'; +export { FIXED_EXECUTE_PARAMS } from './constants'; diff --git a/packages/wasm-ast-types/types/utils/types.d.ts b/packages/wasm-ast-types/types/utils/types.d.ts index bcaeb367..297309dc 100644 --- a/packages/wasm-ast-types/types/utils/types.d.ts +++ b/packages/wasm-ast-types/types/utils/types.d.ts @@ -17,11 +17,6 @@ export declare const getPropertyType: (context: RenderContext, schema: JSONSchem type: any; optional: boolean; }; -export declare function getPropertySignatureFromProp(context: RenderContext, jsonschema: JSONSchema, prop: string, camelize: boolean): { - type: string; - key: t.Identifier; - typeAnnotation: t.TSTypeAnnotation; - optional: boolean; -}; +export declare function getPropertySignatureFromProp(context: RenderContext, jsonschema: JSONSchema, prop: string, camelize: boolean): t.TSPropertySignature; export declare const getParamsTypeAnnotation: (context: RenderContext, jsonschema: any, camelize?: boolean) => t.TSTypeAnnotation; -export declare const createTypedObjectParams: (context: RenderContext, jsonschema: JSONSchema, camelize?: boolean) => t.ObjectPattern; +export declare const createTypedObjectParams: (context: RenderContext, jsonschema: JSONSchema, camelize?: boolean) => (t.Identifier | t.Pattern | t.RestElement); From 5c08757165907e063c3e7468bc7fac9c98530923 Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Wed, 7 Jun 2023 05:54:32 +0800 Subject: [PATCH 119/287] remain schema only for sg721 updatable --- __fixtures__/sg721-updatable/.cargo/config | 4 - .../sg721-updatable/.circleci/config.yml | 61 -- .../.github/workflows/Basic.yml | 75 -- __fixtures__/sg721-updatable/.gitignore | 15 - __fixtures__/sg721-updatable/Cargo.lock | 738 ------------------ __fixtures__/sg721-updatable/Cargo.toml | 63 -- __fixtures__/sg721-updatable/LICENSE | 202 ----- __fixtures__/sg721-updatable/NOTICE | 13 - __fixtures__/sg721-updatable/README.md | 3 - .../{schema => }/all_nft_info_response.json | 0 .../{schema => }/all_operators_response.json | 0 .../{schema => }/all_tokens_response.json | 0 .../{schema => }/approval_response.json | 0 .../{schema => }/approvals_response.json | 0 .../collection_info_response.json | 0 .../{schema => }/contract_info_response.json | 0 .../sg721-updatable/examples/schema.rs | 51 -- ...e_msg_for__nullable__empty_and__empty.json | 0 .../{schema => }/instantiate_msg.json | 0 .../{schema => }/minter_response.json | 0 .../{schema => }/nft_info_response.json | 0 .../{schema => }/num_tokens_response.json | 0 .../{schema => }/owner_of_response.json | 0 .../{schema => }/query_msg.json | 0 __fixtures__/sg721-updatable/src/contract.rs | 378 --------- __fixtures__/sg721-updatable/src/error.rs | 31 - __fixtures__/sg721-updatable/src/lib.rs | 69 -- __fixtures__/sg721-updatable/src/msg.rs | 250 ------ __fixtures__/sg721-updatable/src/state.rs | 4 - .../{schema => }/tokens_response.json | 0 30 files changed, 1957 deletions(-) delete mode 100644 __fixtures__/sg721-updatable/.cargo/config delete mode 100644 __fixtures__/sg721-updatable/.circleci/config.yml delete mode 100644 __fixtures__/sg721-updatable/.github/workflows/Basic.yml delete mode 100644 __fixtures__/sg721-updatable/.gitignore delete mode 100644 __fixtures__/sg721-updatable/Cargo.lock delete mode 100644 __fixtures__/sg721-updatable/Cargo.toml delete mode 100644 __fixtures__/sg721-updatable/LICENSE delete mode 100644 __fixtures__/sg721-updatable/NOTICE delete mode 100644 __fixtures__/sg721-updatable/README.md rename __fixtures__/sg721-updatable/{schema => }/all_nft_info_response.json (100%) rename __fixtures__/sg721-updatable/{schema => }/all_operators_response.json (100%) rename __fixtures__/sg721-updatable/{schema => }/all_tokens_response.json (100%) rename __fixtures__/sg721-updatable/{schema => }/approval_response.json (100%) rename __fixtures__/sg721-updatable/{schema => }/approvals_response.json (100%) rename __fixtures__/sg721-updatable/{schema => }/collection_info_response.json (100%) rename __fixtures__/sg721-updatable/{schema => }/contract_info_response.json (100%) delete mode 100644 __fixtures__/sg721-updatable/examples/schema.rs rename __fixtures__/sg721-updatable/{schema => }/execute_msg_for__nullable__empty_and__empty.json (100%) rename __fixtures__/sg721-updatable/{schema => }/instantiate_msg.json (100%) rename __fixtures__/sg721-updatable/{schema => }/minter_response.json (100%) rename __fixtures__/sg721-updatable/{schema => }/nft_info_response.json (100%) rename __fixtures__/sg721-updatable/{schema => }/num_tokens_response.json (100%) rename __fixtures__/sg721-updatable/{schema => }/owner_of_response.json (100%) rename __fixtures__/sg721-updatable/{schema => }/query_msg.json (100%) delete mode 100644 __fixtures__/sg721-updatable/src/contract.rs delete mode 100644 __fixtures__/sg721-updatable/src/error.rs delete mode 100644 __fixtures__/sg721-updatable/src/lib.rs delete mode 100644 __fixtures__/sg721-updatable/src/msg.rs delete mode 100644 __fixtures__/sg721-updatable/src/state.rs rename __fixtures__/sg721-updatable/{schema => }/tokens_response.json (100%) diff --git a/__fixtures__/sg721-updatable/.cargo/config b/__fixtures__/sg721-updatable/.cargo/config deleted file mode 100644 index 336b618a..00000000 --- a/__fixtures__/sg721-updatable/.cargo/config +++ /dev/null @@ -1,4 +0,0 @@ -[alias] -wasm = "build --release --target wasm32-unknown-unknown" -unit-test = "test --lib" -schema = "run --example schema" diff --git a/__fixtures__/sg721-updatable/.circleci/config.yml b/__fixtures__/sg721-updatable/.circleci/config.yml deleted file mode 100644 index 9b076696..00000000 --- a/__fixtures__/sg721-updatable/.circleci/config.yml +++ /dev/null @@ -1,61 +0,0 @@ -version: 2.1 - -executors: - builder: - docker: - - image: buildpack-deps:trusty - -jobs: - docker-image: - executor: builder - steps: - - checkout - - setup_remote_docker - docker_layer_caching: true - - run: - name: Build Docker artifact - command: docker build --pull -t "cosmwasm/cw-gitpod-base:${CIRCLE_SHA1}" . - - run: - name: Push application Docker image to docker hub - command: | - if [ "${CIRCLE_BRANCH}" = "master" ]; then - docker tag "cosmwasm/cw-gitpod-base:${CIRCLE_SHA1}" cosmwasm/cw-gitpod-base:latest - docker login --password-stdin -u "$DOCKER_USER" \<<<"$DOCKER_PASS" - docker push cosmwasm/cw-gitpod-base:latest - docker logout - fi - - docker-tagged: - executor: builder - steps: - - checkout - - setup_remote_docker - docker_layer_caching: true - - run: - name: Push application Docker image to docker hub - command: | - docker tag "cosmwasm/cw-gitpod-base:${CIRCLE_SHA1}" "cosmwasm/cw-gitpod-base:${CIRCLE_TAG}" - docker login --password-stdin -u "$DOCKER_USER" \<<<"$DOCKER_PASS" - docker push - docker logout - -workflows: - version: 2 - test-suite: - jobs: - # this is now a slow process... let's only run on master - - docker-image: - filters: - branches: - only: - - master - - docker-tagged: - filters: - tags: - only: - - /^v.*/ - branches: - ignore: - - /.*/ - requires: - - docker-image diff --git a/__fixtures__/sg721-updatable/.github/workflows/Basic.yml b/__fixtures__/sg721-updatable/.github/workflows/Basic.yml deleted file mode 100644 index 0aa41931..00000000 --- a/__fixtures__/sg721-updatable/.github/workflows/Basic.yml +++ /dev/null @@ -1,75 +0,0 @@ -# Based on https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml - -on: [push, pull_request] - -name: Basic - -jobs: - - test: - name: Test Suite - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.58.1 - target: wasm32-unknown-unknown - override: true - - - name: Run unit tests - uses: actions-rs/cargo@v1 - with: - command: unit-test - args: --locked - env: - RUST_BACKTRACE: 1 - - - name: Compile WASM contract - uses: actions-rs/cargo@v1 - with: - command: wasm - args: --locked - env: - RUSTFLAGS: "-C link-arg=-s" - - lints: - name: Lints - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.58.1 - override: true - components: rustfmt, clippy - - - name: Run cargo fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - - name: Run cargo clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings - - - name: Generate Schema - uses: actions-rs/cargo@v1 - with: - command: schema - args: --locked - - - name: Schema Changes - # fails if any changes not committed - run: git diff --exit-code schema diff --git a/__fixtures__/sg721-updatable/.gitignore b/__fixtures__/sg721-updatable/.gitignore deleted file mode 100644 index dfdaaa6b..00000000 --- a/__fixtures__/sg721-updatable/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -# Build results -/target - -# Cargo+Git helper file (https://github.com/rust-lang/cargo/blob/0.44.1/src/cargo/sources/git/utils.rs#L320-L327) -.cargo-ok - -# Text file backups -**/*.rs.bk - -# macOS -.DS_Store - -# IDEs -*.iml -.idea diff --git a/__fixtures__/sg721-updatable/Cargo.lock b/__fixtures__/sg721-updatable/Cargo.lock deleted file mode 100644 index 91fb09ff..00000000 --- a/__fixtures__/sg721-updatable/Cargo.lock +++ /dev/null @@ -1,738 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "anyhow" -version = "1.0.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" - -[[package]] -name = "base16ct" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" - -[[package]] -name = "base64" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" - -[[package]] -name = "base64ct" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea908e7347a8c64e378c17e30ef880ad73e3b4498346b055c2c00ea342f3179" - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "bytes" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "const-oid" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" - -[[package]] -name = "cosmwasm-crypto" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eb0afef2325df81aadbf9be1233f522ed8f6e91df870c764bc44cca2b1415bd" -dependencies = [ - "digest", - "ed25519-zebra", - "k256", - "rand_core 0.6.3", - "thiserror", -] - -[[package]] -name = "cosmwasm-derive" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b36e527620a2a3e00e46b6e731ab6c9b68d11069c986f7d7be8eba79ef081a4" -dependencies = [ - "syn", -] - -[[package]] -name = "cosmwasm-schema" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "772e80bbad231a47a2068812b723a1ff81dd4a0d56c9391ac748177bea3a61da" -dependencies = [ - "schemars", - "serde_json", -] - -[[package]] -name = "cosmwasm-std" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "875994993c2082a6fcd406937bf0fca21c349e4a624f3810253a14fa83a3a195" -dependencies = [ - "base64", - "cosmwasm-crypto", - "cosmwasm-derive", - "forward_ref", - "schemars", - "serde", - "serde-json-wasm", - "thiserror", - "uint", -] - -[[package]] -name = "cosmwasm-storage" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d18403b07304d15d304dad11040d45bbcaf78d603b4be3fb5e2685c16f9229b5" -dependencies = [ - "cosmwasm-std", - "serde", -] - -[[package]] -name = "cpufeatures" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" -dependencies = [ - "libc", -] - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "crypto-bigint" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" -dependencies = [ - "generic-array", - "rand_core 0.6.3", - "subtle", - "zeroize", -] - -[[package]] -name = "crypto-mac" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" -dependencies = [ - "generic-array", - "subtle", -] - -[[package]] -name = "curve25519-dalek" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" -dependencies = [ - "byteorder", - "digest", - "rand_core 0.5.1", - "subtle", - "zeroize", -] - -[[package]] -name = "cw-multi-test" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbea57e5be4a682268a5eca1a57efece57a54ff216bfd87603d5e864aad40e12" -dependencies = [ - "anyhow", - "cosmwasm-std", - "cosmwasm-storage", - "cw-storage-plus", - "cw-utils", - "derivative", - "itertools", - "prost", - "schemars", - "serde", - "thiserror", -] - -[[package]] -name = "cw-storage-plus" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9336ecef1e19d56cf6e3e932475fc6a3dee35eec5a386e07917a1d1ba6bb0e35" -dependencies = [ - "cosmwasm-std", - "schemars", - "serde", -] - -[[package]] -name = "cw-utils" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "babd2c090f39d07ce5bf2556962305e795daa048ce20a93709eb591476e4a29e" -dependencies = [ - "cosmwasm-std", - "schemars", - "serde", - "thiserror", -] - -[[package]] -name = "cw2" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "993df11574f29574dd443eb0c189484bb91bc0638b6de3e32ab7f9319c92122d" -dependencies = [ - "cosmwasm-std", - "cw-storage-plus", - "schemars", - "serde", -] - -[[package]] -name = "der" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" -dependencies = [ - "const-oid", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - -[[package]] -name = "dyn-clone" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e50f3adc76d6a43f5ed73b698a87d0760ca74617f60f7c3b879003536fdd28" - -[[package]] -name = "ecdsa" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0d69ae62e0ce582d56380743515fefaf1a8c70cec685d9677636d7e30ae9dc9" -dependencies = [ - "der", - "elliptic-curve", - "rfc6979", - "signature", -] - -[[package]] -name = "ed25519-zebra" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403ef3e961ab98f0ba902771d29f842058578bb1ce7e3c59dad5a6a93e784c69" -dependencies = [ - "curve25519-dalek", - "hex", - "rand_core 0.6.3", - "serde", - "sha2", - "thiserror", - "zeroize", -] - -[[package]] -name = "either" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - -[[package]] -name = "elliptic-curve" -version = "0.11.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6" -dependencies = [ - "base16ct", - "crypto-bigint", - "der", - "ff", - "generic-array", - "group", - "rand_core 0.6.3", - "sec1", - "subtle", - "zeroize", -] - -[[package]] -name = "ff" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "131655483be284720a17d74ff97592b8e76576dc25563148601df2d7c9080924" -dependencies = [ - "rand_core 0.6.3", - "subtle", -] - -[[package]] -name = "forward_ref" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" - -[[package]] -name = "generic-array" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.10.2+wasi-snapshot-preview1", -] - -[[package]] -name = "group" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89" -dependencies = [ - "ff", - "rand_core 0.6.3", - "subtle", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hmac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" -dependencies = [ - "crypto-mac", - "digest", -] - -[[package]] -name = "itertools" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" - -[[package]] -name = "k256" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" -dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "sec1", - "sha2", -] - -[[package]] -name = "libc" -version = "0.2.126" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - -[[package]] -name = "pkcs8" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" -dependencies = [ - "der", - "spki", - "zeroize", -] - -[[package]] -name = "proc-macro2" -version = "1.0.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "prost" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-derive" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "quote" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", -] - -[[package]] -name = "rand_core" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" -dependencies = [ - "getrandom 0.2.6", -] - -[[package]] -name = "rfc6979" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525" -dependencies = [ - "crypto-bigint", - "hmac", - "zeroize", -] - -[[package]] -name = "ryu" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" - -[[package]] -name = "schemars" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d21ecb263bf75fc69d5e74b0f2a60b6dd80cfd9fb0eba15c4b9d1104ceffc77" -dependencies = [ - "dyn-clone", - "schemars_derive", - "serde", - "serde_json", -] - -[[package]] -name = "schemars_derive" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219b924f5b39f25b7d7c9203873a2698fdac8db2b396aaea6fa099b699cc40e9" -dependencies = [ - "proc-macro2", - "quote", - "serde_derive_internals", - "syn", -] - -[[package]] -name = "sec1" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" -dependencies = [ - "der", - "generic-array", - "pkcs8", - "subtle", - "zeroize", -] - -[[package]] -name = "serde" -version = "1.0.137" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde-json-wasm" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479b4dbc401ca13ee8ce902851b834893251404c4f3c65370a49e047a6be09a5" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_derive" -version = "1.0.137" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_derive_internals" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer", - "cfg-if", - "cpufeatures", - "digest", - "opaque-debug", -] - -[[package]] -name = "signature" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" -dependencies = [ - "digest", - "rand_core 0.6.3", -] - -[[package]] -name = "spki" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "subtle" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - -[[package]] -name = "syn" -version = "1.0.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbaf6116ab8924f39d52792136fb74fd60a80194cf1b1c6ffa6453eef1c3f942" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "testgen-local" -version = "0.1.0" -dependencies = [ - "cosmwasm-schema", - "cosmwasm-std", - "cosmwasm-storage", - "cw-multi-test", - "cw-storage-plus", - "cw2", - "schemars", - "serde", - "thiserror", -] - -[[package]] -name = "thiserror" -version = "1.0.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "typenum" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" - -[[package]] -name = "uint" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] - -[[package]] -name = "unicode-ident" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - -[[package]] -name = "zeroize" -version = "1.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94693807d016b2f2d2e14420eb3bfcca689311ff775dcf113d74ea624b7cdf07" diff --git a/__fixtures__/sg721-updatable/Cargo.toml b/__fixtures__/sg721-updatable/Cargo.toml deleted file mode 100644 index 65f6af21..00000000 --- a/__fixtures__/sg721-updatable/Cargo.toml +++ /dev/null @@ -1,63 +0,0 @@ -[package] -name = "sg721-updatable" -authors = [ - "John Y ", - "Shane Vitarana ", -] -exclude = [ - # Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication. - "contract.wasm", - "hash.txt", -] -description = "Stargaze Updatable NFT collection contract" -version = { workspace = true } -edition = { workspace = true } -homepage = { workspace = true } -repository = { workspace = true } -license = { workspace = true } - - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[lib] -crate-type = ["cdylib", "rlib"] - -[profile.release] -opt-level = 3 -debug = false -rpath = false -lto = true -debug-assertions = false -codegen-units = 1 -panic = 'abort' -incremental = false -overflow-checks = true - -[features] -# for more explicit tests, cargo test --features=backtraces -backtraces = ["cosmwasm-std/backtraces"] -# use library feature to disable all instantiate/execute/query exports -library = [] - - -[dependencies] -cosmwasm-schema = { workspace = true } -cosmwasm-std = { workspace = true } -cw-storage-plus = { workspace = true } -cw-utils = { workspace = true } -cw2 = { workspace = true } -cw721 = { workspace = true } -schemars = { workspace = true } -serde = { workspace = true } -thiserror = { workspace = true } -cw721-base = { workspace = true, features = ["library"] } -sg1 = { workspace = true } -sg721 = { workspace = true } -sg721-base = { workspace = true, features = ["library"] } -sg-std = { workspace = true } -semver = { workspace = true } - -[dev-dependencies] -cosmwasm-schema = { workspace = true } -cw-multi-test = { workspace = true } -cw721 = { workspace = true } diff --git a/__fixtures__/sg721-updatable/LICENSE b/__fixtures__/sg721-updatable/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/__fixtures__/sg721-updatable/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/__fixtures__/sg721-updatable/NOTICE b/__fixtures__/sg721-updatable/NOTICE deleted file mode 100644 index ee31d709..00000000 --- a/__fixtures__/sg721-updatable/NOTICE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2022 John Y - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/__fixtures__/sg721-updatable/README.md b/__fixtures__/sg721-updatable/README.md deleted file mode 100644 index 1f443fa8..00000000 --- a/__fixtures__/sg721-updatable/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Sg721 NFT collection with updatable token metadata - -Extends from `sg721-base` to allow updatable token metadata NFT collection. It's done by updating the token uri of a specified token id. diff --git a/__fixtures__/sg721-updatable/schema/all_nft_info_response.json b/__fixtures__/sg721-updatable/all_nft_info_response.json similarity index 100% rename from __fixtures__/sg721-updatable/schema/all_nft_info_response.json rename to __fixtures__/sg721-updatable/all_nft_info_response.json diff --git a/__fixtures__/sg721-updatable/schema/all_operators_response.json b/__fixtures__/sg721-updatable/all_operators_response.json similarity index 100% rename from __fixtures__/sg721-updatable/schema/all_operators_response.json rename to __fixtures__/sg721-updatable/all_operators_response.json diff --git a/__fixtures__/sg721-updatable/schema/all_tokens_response.json b/__fixtures__/sg721-updatable/all_tokens_response.json similarity index 100% rename from __fixtures__/sg721-updatable/schema/all_tokens_response.json rename to __fixtures__/sg721-updatable/all_tokens_response.json diff --git a/__fixtures__/sg721-updatable/schema/approval_response.json b/__fixtures__/sg721-updatable/approval_response.json similarity index 100% rename from __fixtures__/sg721-updatable/schema/approval_response.json rename to __fixtures__/sg721-updatable/approval_response.json diff --git a/__fixtures__/sg721-updatable/schema/approvals_response.json b/__fixtures__/sg721-updatable/approvals_response.json similarity index 100% rename from __fixtures__/sg721-updatable/schema/approvals_response.json rename to __fixtures__/sg721-updatable/approvals_response.json diff --git a/__fixtures__/sg721-updatable/schema/collection_info_response.json b/__fixtures__/sg721-updatable/collection_info_response.json similarity index 100% rename from __fixtures__/sg721-updatable/schema/collection_info_response.json rename to __fixtures__/sg721-updatable/collection_info_response.json diff --git a/__fixtures__/sg721-updatable/schema/contract_info_response.json b/__fixtures__/sg721-updatable/contract_info_response.json similarity index 100% rename from __fixtures__/sg721-updatable/schema/contract_info_response.json rename to __fixtures__/sg721-updatable/contract_info_response.json diff --git a/__fixtures__/sg721-updatable/examples/schema.rs b/__fixtures__/sg721-updatable/examples/schema.rs deleted file mode 100644 index 44d07d85..00000000 --- a/__fixtures__/sg721-updatable/examples/schema.rs +++ /dev/null @@ -1,51 +0,0 @@ -use std::env::current_dir; -use std::fs::create_dir_all; - -use cosmwasm_schema::{export_schema, export_schema_with_title, remove_schemas, schema_for}; - -use cosmwasm_std::Empty; -pub use cw721::{ - AllNftInfoResponse, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, NftInfoResponse, - NumTokensResponse, OperatorsResponse, OwnerOfResponse, TokensResponse, -}; -use cw721_base::Extension; -pub use cw721_base::MinterResponse; -use sg721::InstantiateMsg; -pub use sg721_base::msg::CollectionInfoResponse; -use sg721_base::msg::QueryMsg; -use sg721_updatable::msg::ExecuteMsg; - -fn main() { - let mut out_dir = current_dir().unwrap(); - out_dir.push("schema"); - create_dir_all(&out_dir).unwrap(); - remove_schemas(&out_dir).unwrap(); - - export_schema(&schema_for!(InstantiateMsg), &out_dir); - export_schema(&schema_for!(ExecuteMsg), &out_dir); - export_schema(&schema_for!(QueryMsg), &out_dir); - export_schema(&schema_for!(CollectionInfoResponse), &out_dir); - export_schema_with_title( - &schema_for!(AllNftInfoResponse), - &out_dir, - "AllNftInfoResponse", - ); - export_schema_with_title(&schema_for!(TokensResponse), &out_dir, "AllTokensResponse"); - export_schema_with_title( - &schema_for!(OperatorsResponse), - &out_dir, - "AllOperatorsResponse", - ); - export_schema(&schema_for!(MinterResponse), &out_dir); - export_schema(&schema_for!(ApprovalResponse), &out_dir); - export_schema(&schema_for!(ApprovalsResponse), &out_dir); - export_schema(&schema_for!(ContractInfoResponse), &out_dir); - export_schema_with_title( - &schema_for!(NftInfoResponse), - &out_dir, - "NftInfoResponse", - ); - export_schema(&schema_for!(NumTokensResponse), &out_dir); - export_schema(&schema_for!(OwnerOfResponse), &out_dir); - export_schema(&schema_for!(TokensResponse), &out_dir); -} diff --git a/__fixtures__/sg721-updatable/schema/execute_msg_for__nullable__empty_and__empty.json b/__fixtures__/sg721-updatable/execute_msg_for__nullable__empty_and__empty.json similarity index 100% rename from __fixtures__/sg721-updatable/schema/execute_msg_for__nullable__empty_and__empty.json rename to __fixtures__/sg721-updatable/execute_msg_for__nullable__empty_and__empty.json diff --git a/__fixtures__/sg721-updatable/schema/instantiate_msg.json b/__fixtures__/sg721-updatable/instantiate_msg.json similarity index 100% rename from __fixtures__/sg721-updatable/schema/instantiate_msg.json rename to __fixtures__/sg721-updatable/instantiate_msg.json diff --git a/__fixtures__/sg721-updatable/schema/minter_response.json b/__fixtures__/sg721-updatable/minter_response.json similarity index 100% rename from __fixtures__/sg721-updatable/schema/minter_response.json rename to __fixtures__/sg721-updatable/minter_response.json diff --git a/__fixtures__/sg721-updatable/schema/nft_info_response.json b/__fixtures__/sg721-updatable/nft_info_response.json similarity index 100% rename from __fixtures__/sg721-updatable/schema/nft_info_response.json rename to __fixtures__/sg721-updatable/nft_info_response.json diff --git a/__fixtures__/sg721-updatable/schema/num_tokens_response.json b/__fixtures__/sg721-updatable/num_tokens_response.json similarity index 100% rename from __fixtures__/sg721-updatable/schema/num_tokens_response.json rename to __fixtures__/sg721-updatable/num_tokens_response.json diff --git a/__fixtures__/sg721-updatable/schema/owner_of_response.json b/__fixtures__/sg721-updatable/owner_of_response.json similarity index 100% rename from __fixtures__/sg721-updatable/schema/owner_of_response.json rename to __fixtures__/sg721-updatable/owner_of_response.json diff --git a/__fixtures__/sg721-updatable/schema/query_msg.json b/__fixtures__/sg721-updatable/query_msg.json similarity index 100% rename from __fixtures__/sg721-updatable/schema/query_msg.json rename to __fixtures__/sg721-updatable/query_msg.json diff --git a/__fixtures__/sg721-updatable/src/contract.rs b/__fixtures__/sg721-updatable/src/contract.rs deleted file mode 100644 index 5ad3d84a..00000000 --- a/__fixtures__/sg721-updatable/src/contract.rs +++ /dev/null @@ -1,378 +0,0 @@ -use crate::error::ContractError; -use crate::state::FROZEN_TOKEN_METADATA; -use cosmwasm_std::{Empty, StdError}; - -use cosmwasm_std::{Deps, StdResult}; - -#[cfg(not(feature = "library"))] -use cosmwasm_std::{DepsMut, Env, Event, MessageInfo}; -use cw2::set_contract_version; -use sg721::InstantiateMsg; -use sg721_base::msg::CollectionInfoResponse; - -use crate::msg::{EnableUpdatableResponse, FrozenTokenMetadataResponse}; -use crate::state::ENABLE_UPDATABLE; - -use cw721_base::Extension; -use cw_utils::nonpayable; -use sg1::checked_fair_burn; -use sg721_base::ContractError::Unauthorized; -use sg721_base::Sg721Contract; -pub type Sg721UpdatableContract<'a> = Sg721Contract<'a, Extension>; -use sg_std::Response; - -const CONTRACT_NAME: &str = "crates.io:sg721-updatable"; -const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); -pub const EARLIEST_VERSION: &str = "0.16.0"; -pub const TO_VERSION: &str = "3.0.0"; -const ENABLE_UPDATABLE_FEE: u128 = 500_000_000; - -pub fn _instantiate( - deps: DepsMut, - env: Env, - info: MessageInfo, - msg: InstantiateMsg, -) -> Result { - // Set frozen to false on instantiate. allows updating token metadata - FROZEN_TOKEN_METADATA.save(deps.storage, &false)?; - // Set enable_updatable to true on instantiate. allows updating token metadata - ENABLE_UPDATABLE.save(deps.storage, &true)?; - - set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?; - let res = Sg721UpdatableContract::default().instantiate(deps, env, info, msg)?; - Ok(res) -} - -pub fn execute_enable_updatable( - deps: DepsMut, - _env: Env, - info: MessageInfo, -) -> Result { - let enable_updates = ENABLE_UPDATABLE.load(deps.storage)?; - let mut res = Response::new(); - if enable_updates { - return Err(ContractError::AlreadyEnableUpdatable {}); - } - - // TODO add check if sender is contract admin - // Check if sender is creator - let collection_info: CollectionInfoResponse = - Sg721UpdatableContract::default().query_collection_info(deps.as_ref())?; - if info.sender != collection_info.creator { - return Err(ContractError::Base(Unauthorized {})); - } - - // Check fee matches enable updatable fee and add fairburn msg - checked_fair_burn(&info, ENABLE_UPDATABLE_FEE, None, &mut res)?; - - ENABLE_UPDATABLE.save(deps.storage, &true)?; - - Ok(res - .add_attribute("action", "enable_updates") - .add_attribute("enabled", "true")) -} - -pub fn execute_freeze_token_metadata( - deps: DepsMut, - _env: Env, - info: MessageInfo, -) -> Result { - nonpayable(&info)?; - // Check if sender is creator - let collection_info: CollectionInfoResponse = - Sg721UpdatableContract::default().query_collection_info(deps.as_ref())?; - if info.sender != collection_info.creator { - return Err(ContractError::Base(Unauthorized {})); - } - - FROZEN_TOKEN_METADATA.save(deps.storage, &true)?; - - Ok(Response::new() - .add_attribute("action", "freeze_token_metadata") - .add_attribute("frozen", "true")) -} - -pub fn execute_update_token_metadata( - deps: DepsMut, - _env: Env, - info: MessageInfo, - token_id: String, - token_uri: Option, -) -> Result { - nonpayable(&info)?; - // Check if sender is creator - let owner = deps.api.addr_validate(info.sender.as_ref())?; - let collection_info: CollectionInfoResponse = - Sg721UpdatableContract::default().query_collection_info(deps.as_ref())?; - if owner != collection_info.creator { - return Err(ContractError::Base(Unauthorized {})); - } - - // Check if token metadata is frozen - let frozen = FROZEN_TOKEN_METADATA.load(deps.storage)?; - if frozen { - return Err(ContractError::TokenMetadataFrozen {}); - } - - // Check if enable updatable is true - let enable_updatable = ENABLE_UPDATABLE.load(deps.storage)?; - if !enable_updatable { - return Err(ContractError::NotEnableUpdatable {}); - } - - // Update token metadata - Sg721UpdatableContract::default().tokens.update( - deps.storage, - &token_id, - |token| match token { - Some(mut token_info) => { - token_info.token_uri = token_uri.clone(); - Ok(token_info) - } - None => Err(ContractError::TokenIdNotFound {}), - }, - )?; - - let mut event = Event::new("update_update_token_metadata") - .add_attribute("sender", info.sender) - .add_attribute("token_id", token_id); - if let Some(token_uri) = token_uri { - event = event.add_attribute("token_uri", token_uri); - } - Ok(Response::new().add_event(event)) -} - -pub fn query_enable_updatable(deps: Deps) -> StdResult { - let enabled = ENABLE_UPDATABLE.load(deps.storage)?; - Ok(EnableUpdatableResponse { enabled }) -} - -pub fn query_frozen_token_metadata(deps: Deps) -> StdResult { - let frozen = FROZEN_TOKEN_METADATA.load(deps.storage)?; - Ok(FrozenTokenMetadataResponse { frozen }) -} - -pub fn _migrate(deps: DepsMut, _env: Env, _msg: Empty) -> Result { - // make sure the correct contract is being upgraded, and it's being - // upgraded from the correct version. - if CONTRACT_VERSION < EARLIEST_VERSION { - return Err(StdError::generic_err("Cannot upgrade to a previous contract version").into()); - } - if CONTRACT_VERSION > TO_VERSION { - return Err(StdError::generic_err("Cannot upgrade to a previous contract version").into()); - } - // if same version return - if CONTRACT_VERSION == TO_VERSION { - return Ok(Response::new()); - } - - // update contract version - cw2::set_contract_version(deps.storage, CONTRACT_NAME, TO_VERSION)?; - - // perform the upgrade - cw721_base::upgrades::v0_17::migrate::(deps) - .map_err(|e| sg721_base::ContractError::MigrationError(e.to_string()))?; - - let event = Event::new("migrate") - .add_attribute("from_name", CONTRACT_VERSION) - .add_attribute("from_version", CONTRACT_VERSION) - .add_attribute("to_name", CONTRACT_NAME) - .add_attribute("to_version", TO_VERSION); - Ok(Response::new().add_event(event)) -} - -#[cfg(test)] -mod tests { - use super::*; - - use crate::entry::{execute, instantiate}; - use crate::msg::ExecuteMsg; - use cosmwasm_std::testing::{mock_env, mock_info, MockApi, MockQuerier, MockStorage}; - use cosmwasm_std::{ - from_slice, to_binary, ContractInfoResponse, ContractResult, Empty, OwnedDeps, Querier, - QuerierResult, QueryRequest, SystemError, SystemResult, WasmQuery, - }; - use cw721::Cw721Query; - use sg721::{CollectionInfo, InstantiateMsg}; - use std::marker::PhantomData; - - const CREATOR: &str = "creator"; - const HACKER: &str = "hacker"; - - pub fn mock_deps() -> OwnedDeps { - OwnedDeps { - storage: MockStorage::default(), - api: MockApi::default(), - querier: CustomMockQuerier::new(MockQuerier::new(&[])), - custom_query_type: PhantomData, - } - } - - pub struct CustomMockQuerier { - base: MockQuerier, - } - - impl Querier for CustomMockQuerier { - fn raw_query(&self, bin_request: &[u8]) -> QuerierResult { - let request: QueryRequest = match from_slice(bin_request) { - Ok(v) => v, - Err(e) => { - return SystemResult::Err(SystemError::InvalidRequest { - error: format!("Parsing query request: {}", e), - request: bin_request.into(), - }) - } - }; - - self.handle_query(&request) - } - } - - impl CustomMockQuerier { - pub fn handle_query(&self, request: &QueryRequest) -> QuerierResult { - match &request { - QueryRequest::Wasm(WasmQuery::ContractInfo { contract_addr: _ }) => { - let mut response = ContractInfoResponse::default(); - response.code_id = 1; - response.creator = CREATOR.to_string(); - SystemResult::Ok(ContractResult::Ok(to_binary(&response).unwrap())) - } - _ => self.base.handle_query(request), - } - } - - pub fn new(base: MockQuerier) -> Self { - CustomMockQuerier { base } - } - } - - #[test] - fn update_token_metadata() { - let mut deps = mock_deps(); - let contract = Sg721UpdatableContract::default(); - - // Instantiate contract - let info = mock_info(CREATOR, &[]); - let init_msg = InstantiateMsg { - name: "SpaceShips".to_string(), - symbol: "SPACE".to_string(), - minter: CREATOR.to_string(), - collection_info: CollectionInfo { - creator: CREATOR.to_string(), - description: "this is a test".to_string(), - image: "https://larry.engineer".to_string(), - external_link: None, - explicit_content: None, - start_trading_time: None, - royalty_info: None, - }, - }; - instantiate(deps.as_mut(), mock_env(), info.clone(), init_msg).unwrap(); - - // Mint token - let token_id = "Enterprise"; - let exec_msg = ExecuteMsg::Mint { - token_id: token_id.to_string(), - owner: "john".to_string(), - token_uri: Some("https://starships.example.com/Starship/Enterprise.json".into()), - extension: None, - }; - execute(deps.as_mut(), mock_env(), info.clone(), exec_msg).unwrap(); - - // Update token metadata fails because token id is not found - let updated_token_uri = Some("https://badkids.example.com/collection-cid/1.json".into()); - let update_msg = ExecuteMsg::UpdateTokenMetadata { - token_id: "wrong-token-id".to_string(), - token_uri: updated_token_uri.clone(), - }; - let err = execute(deps.as_mut(), mock_env(), info.clone(), update_msg).unwrap_err(); - assert_eq!( - err.to_string(), - ContractError::TokenIdNotFound {}.to_string() - ); - - // Update token metadata fails because sent by hacker - let update_msg = ExecuteMsg::UpdateTokenMetadata { - token_id: token_id.to_string(), - token_uri: updated_token_uri.clone(), - }; - let hacker_info = mock_info(HACKER, &[]); - let err = execute(deps.as_mut(), mock_env(), hacker_info, update_msg.clone()).unwrap_err(); - assert_eq!( - err.to_string(), - ContractError::Base(Unauthorized {}).to_string() - ); - - // Update token metadata - execute(deps.as_mut(), mock_env(), info.clone(), update_msg).unwrap(); - - // Check token contains updated metadata - let res = contract - .parent - .nft_info(deps.as_ref(), token_id.into()) - .unwrap(); - assert_eq!(res.token_uri, updated_token_uri); - - // Update token metadata with None token_uri - let update_msg = ExecuteMsg::::UpdateTokenMetadata { - token_id: token_id.to_string(), - token_uri: None, - }; - execute(deps.as_mut(), mock_env(), info.clone(), update_msg).unwrap(); - let res = contract - .parent - .nft_info(deps.as_ref(), token_id.into()) - .unwrap(); - assert_eq!(res.token_uri, None); - - // Freeze token metadata - let freeze_msg = ExecuteMsg::FreezeTokenMetadata {}; - execute(deps.as_mut(), mock_env(), info.clone(), freeze_msg).unwrap(); - - // Throws error trying to update token metadata - let updated_token_uri = - Some("https://badkids.example.com/other-collection-cid/2.json".into()); - let update_msg = ExecuteMsg::UpdateTokenMetadata { - token_id: token_id.to_string(), - token_uri: updated_token_uri, - }; - let err = execute(deps.as_mut(), mock_env(), info, update_msg).unwrap_err(); - assert_eq!( - err.to_string(), - ContractError::TokenMetadataFrozen {}.to_string() - ); - } - - #[test] - fn enable_updatable() { - let mut deps = mock_deps(); - - // Instantiate contract - let info = mock_info(CREATOR, &[]); - let init_msg = InstantiateMsg { - name: "SpaceShips".to_string(), - symbol: "SPACE".to_string(), - minter: CREATOR.to_string(), - collection_info: CollectionInfo { - creator: CREATOR.to_string(), - description: "this is a test".to_string(), - image: "https://larry.engineer".to_string(), - external_link: None, - explicit_content: None, - start_trading_time: None, - royalty_info: None, - }, - }; - instantiate(deps.as_mut(), mock_env(), info.clone(), init_msg).unwrap(); - - let enable_updatable_msg = ExecuteMsg::EnableUpdatable {}; - let err = execute(deps.as_mut(), mock_env(), info, enable_updatable_msg).unwrap_err(); - assert_eq!( - err.to_string(), - ContractError::AlreadyEnableUpdatable {}.to_string() - ); - - let res = query_enable_updatable(deps.as_ref()).unwrap(); - assert!(res.enabled); - } -} diff --git a/__fixtures__/sg721-updatable/src/error.rs b/__fixtures__/sg721-updatable/src/error.rs deleted file mode 100644 index 29823b2b..00000000 --- a/__fixtures__/sg721-updatable/src/error.rs +++ /dev/null @@ -1,31 +0,0 @@ -use cosmwasm_std::StdError; -use cw_utils::PaymentError; -use sg1::FeeError; -use thiserror::Error; - -#[derive(Error, Debug)] -pub enum ContractError { - #[error("{0}")] - Std(#[from] StdError), - - #[error("{0}")] - Payment(#[from] PaymentError), - - #[error("{0}")] - Base(#[from] sg721_base::ContractError), - - #[error("{0}")] - Fee(#[from] FeeError), - - #[error("TokenIdNotFound")] - TokenIdNotFound {}, - - #[error("TokenMetadataFrozen")] - TokenMetadataFrozen {}, - - #[error("NotEnableUpdatable")] - NotEnableUpdatable {}, - - #[error("AlreadyEnableUpdatable")] - AlreadyEnableUpdatable {}, -} diff --git a/__fixtures__/sg721-updatable/src/lib.rs b/__fixtures__/sg721-updatable/src/lib.rs deleted file mode 100644 index 06a13ea3..00000000 --- a/__fixtures__/sg721-updatable/src/lib.rs +++ /dev/null @@ -1,69 +0,0 @@ -#[cfg(not(feature = "library"))] -pub mod contract; -pub mod error; -pub mod msg; -pub mod state; - -pub type InstantiateMsg = sg721::InstantiateMsg; - -pub mod entry { - use super::*; - use crate::error::ContractError; - use crate::msg::QueryMsg; - use crate::{ - contract::{ - _instantiate, _migrate, execute_enable_updatable, execute_freeze_token_metadata, - execute_update_token_metadata, query_enable_updatable, query_frozen_token_metadata, - Sg721UpdatableContract, - }, - msg::ExecuteMsg, - }; - use cosmwasm_std::{entry_point, to_binary, Empty}; - use cosmwasm_std::{Binary, Deps, DepsMut, Env, MessageInfo, StdResult}; - use cw721_base::Extension; - use sg_std::Response; - - #[entry_point] - pub fn instantiate( - deps: DepsMut, - env: Env, - info: MessageInfo, - msg: InstantiateMsg, - ) -> Result { - _instantiate(deps, env, info, msg) - } - - #[entry_point] - pub fn execute( - deps: DepsMut, - env: Env, - info: MessageInfo, - msg: ExecuteMsg, - ) -> Result { - match msg { - ExecuteMsg::FreezeTokenMetadata {} => execute_freeze_token_metadata(deps, env, info), - ExecuteMsg::EnableUpdatable {} => execute_enable_updatable(deps, env, info), - ExecuteMsg::UpdateTokenMetadata { - token_id, - token_uri, - } => execute_update_token_metadata(deps, env, info, token_id, token_uri), - _ => Sg721UpdatableContract::default() - .execute(deps, env, info, msg.into()) - .map_err(|e| e.into()), - } - } - - #[entry_point] - pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult { - match msg { - QueryMsg::EnableUpdatable {} => to_binary(&query_enable_updatable(deps)?), - QueryMsg::FreezeTokenMetadata {} => to_binary(&query_frozen_token_metadata(deps)?), - _ => Sg721UpdatableContract::default().query(deps, env, msg.into()), - } - } - - #[entry_point] - pub fn migrate(deps: DepsMut, env: Env, msg: Empty) -> Result { - _migrate(deps, env, msg) - } -} diff --git a/__fixtures__/sg721-updatable/src/msg.rs b/__fixtures__/sg721-updatable/src/msg.rs deleted file mode 100644 index f05672df..00000000 --- a/__fixtures__/sg721-updatable/src/msg.rs +++ /dev/null @@ -1,250 +0,0 @@ -use cosmwasm_schema::cw_serde; -use cosmwasm_std::Binary; -use cosmwasm_std::Timestamp; -use cw_utils::Expiration; -use sg721::{RoyaltyInfoResponse, UpdateCollectionInfoMsg}; -use sg721_base::msg::QueryMsg as Sg721QueryMsg; -use sg721_base::ExecuteMsg as Sg721ExecuteMsg; - -#[cw_serde] -pub enum ExecuteMsg { - /// Freeze token metadata so creator can no longer update token uris - FreezeTokenMetadata {}, - /// Creator calls can update token uris - UpdateTokenMetadata { - token_id: String, - token_uri: Option, - }, - /// Enable updatable for updating token metadata. One time migration fee for sg721-base to sg721-updatable. - EnableUpdatable {}, - // Sg721Base msgs - TransferNft { - recipient: String, - token_id: String, - }, - SendNft { - contract: String, - token_id: String, - msg: Binary, - }, - Approve { - spender: String, - token_id: String, - expires: Option, - }, - Revoke { - spender: String, - token_id: String, - }, - ApproveAll { - operator: String, - expires: Option, - }, - RevokeAll { - operator: String, - }, - Burn { - token_id: String, - }, - UpdateCollectionInfo { - collection_info: UpdateCollectionInfoMsg, - }, - UpdateTradingStartTime(Option), - FreezeCollectionInfo {}, - Mint { - /// Unique ID of the NFT - token_id: String, - /// The owner of the newly minter NFT - owner: String, - /// Universal resource identifier for this NFT - /// Should point to a JSON file that conforms to the ERC721 - /// Metadata JSON Schema - token_uri: Option, - /// Any custom extension used by this contract - extension: T, - }, - Extension { - msg: E, - }, -} - -impl From> for Sg721ExecuteMsg -where - T: Clone + PartialEq + Into>, - Option: From, -{ - fn from(msg: ExecuteMsg) -> Sg721ExecuteMsg { - match msg { - ExecuteMsg::TransferNft { - recipient, - token_id, - } => Sg721ExecuteMsg::TransferNft { - recipient, - token_id, - }, - ExecuteMsg::SendNft { - contract, - token_id, - msg, - } => Sg721ExecuteMsg::SendNft { - contract, - token_id, - msg, - }, - ExecuteMsg::Approve { - spender, - token_id, - expires, - } => Sg721ExecuteMsg::Approve { - spender, - token_id, - expires, - }, - ExecuteMsg::ApproveAll { operator, expires } => { - Sg721ExecuteMsg::ApproveAll { operator, expires } - } - ExecuteMsg::Revoke { spender, token_id } => { - Sg721ExecuteMsg::Revoke { spender, token_id } - } - ExecuteMsg::RevokeAll { operator } => Sg721ExecuteMsg::RevokeAll { operator }, - ExecuteMsg::Burn { token_id } => Sg721ExecuteMsg::Burn { token_id }, - ExecuteMsg::UpdateCollectionInfo { collection_info } => { - Sg721ExecuteMsg::UpdateCollectionInfo { collection_info } - } - ExecuteMsg::FreezeCollectionInfo {} => Sg721ExecuteMsg::FreezeCollectionInfo {}, - ExecuteMsg::Mint { - token_id, - owner, - token_uri, - extension, - } => Sg721ExecuteMsg::Mint { - token_id, - owner, - token_uri, - extension: extension.into(), - }, - _ => unreachable!("Invalid ExecuteMsg"), - } - } -} - -#[cw_serde] -pub enum QueryMsg { - EnableUpdatable {}, - FreezeTokenMetadata {}, - OwnerOf { - token_id: String, - include_expired: Option, - }, - Approval { - token_id: String, - spender: String, - include_expired: Option, - }, - Approvals { - token_id: String, - include_expired: Option, - }, - AllOperators { - owner: String, - include_expired: Option, - start_after: Option, - limit: Option, - }, - NumTokens {}, - ContractInfo {}, - NftInfo { - token_id: String, - }, - AllNftInfo { - token_id: String, - include_expired: Option, - }, - Tokens { - owner: String, - start_after: Option, - limit: Option, - }, - AllTokens { - start_after: Option, - limit: Option, - }, - Minter {}, - CollectionInfo {}, -} - -impl From for Sg721QueryMsg { - fn from(msg: QueryMsg) -> Sg721QueryMsg { - match msg { - QueryMsg::OwnerOf { - token_id, - include_expired, - } => Sg721QueryMsg::OwnerOf { - token_id, - include_expired, - }, - QueryMsg::Approval { - token_id, - spender, - include_expired, - } => Sg721QueryMsg::Approval { - token_id, - spender, - include_expired, - }, - QueryMsg::Approvals { - token_id, - include_expired, - } => Sg721QueryMsg::Approvals { - token_id, - include_expired, - }, - QueryMsg::AllOperators { - owner, - include_expired, - start_after, - limit, - } => Sg721QueryMsg::AllOperators { - owner, - include_expired, - start_after, - limit, - }, - QueryMsg::NumTokens {} => Sg721QueryMsg::NumTokens {}, - QueryMsg::ContractInfo {} => Sg721QueryMsg::ContractInfo {}, - QueryMsg::NftInfo { token_id } => Sg721QueryMsg::NftInfo { token_id }, - QueryMsg::AllNftInfo { - token_id, - include_expired, - } => Sg721QueryMsg::AllNftInfo { - token_id, - include_expired, - }, - QueryMsg::Tokens { - owner, - start_after, - limit, - } => Sg721QueryMsg::Tokens { - owner, - start_after, - limit, - }, - QueryMsg::AllTokens { start_after, limit } => { - Sg721QueryMsg::AllTokens { start_after, limit } - } - QueryMsg::Minter {} => Sg721QueryMsg::Minter {}, - QueryMsg::CollectionInfo {} => Sg721QueryMsg::CollectionInfo {}, - _ => unreachable!("cannot convert {:?} to Sg721QueryMsg", msg), - } - } -} - -#[cw_serde] -pub struct EnableUpdatableResponse { - pub enabled: bool, -} - -#[cw_serde] -pub struct FrozenTokenMetadataResponse { - pub frozen: bool, -} diff --git a/__fixtures__/sg721-updatable/src/state.rs b/__fixtures__/sg721-updatable/src/state.rs deleted file mode 100644 index 364608e6..00000000 --- a/__fixtures__/sg721-updatable/src/state.rs +++ /dev/null @@ -1,4 +0,0 @@ -use cw_storage_plus::Item; - -pub const FROZEN_TOKEN_METADATA: Item = Item::new("frozen_token_metadata"); -pub const ENABLE_UPDATABLE: Item = Item::new("enable_updatable"); diff --git a/__fixtures__/sg721-updatable/schema/tokens_response.json b/__fixtures__/sg721-updatable/tokens_response.json similarity index 100% rename from __fixtures__/sg721-updatable/schema/tokens_response.json rename to __fixtures__/sg721-updatable/tokens_response.json From e55d3c92a75ec2f4ba450dc6e48bd550b6ba3326 Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Wed, 7 Jun 2023 05:58:20 +0800 Subject: [PATCH 120/287] move output of Sg721Updatable out of 'out' folder --- __output__/sg721-updatable/{out => }/Sg721Updatable.client.ts | 0 .../{out => }/Sg721Updatable.message-composer.ts | 0 .../sg721-updatable/{out => }/Sg721Updatable.react-query.ts | 0 __output__/sg721-updatable/{out => }/Sg721Updatable.types.ts | 0 __output__/sg721-updatable/{out => }/bundle.ts | 0 .../__tests__/ts-codegen.issue-long-exe-msg-name.test.ts | 2 +- 6 files changed, 1 insertion(+), 1 deletion(-) rename __output__/sg721-updatable/{out => }/Sg721Updatable.client.ts (100%) rename __output__/sg721-updatable/{out => }/Sg721Updatable.message-composer.ts (100%) rename __output__/sg721-updatable/{out => }/Sg721Updatable.react-query.ts (100%) rename __output__/sg721-updatable/{out => }/Sg721Updatable.types.ts (100%) rename __output__/sg721-updatable/{out => }/bundle.ts (100%) diff --git a/__output__/sg721-updatable/out/Sg721Updatable.client.ts b/__output__/sg721-updatable/Sg721Updatable.client.ts similarity index 100% rename from __output__/sg721-updatable/out/Sg721Updatable.client.ts rename to __output__/sg721-updatable/Sg721Updatable.client.ts diff --git a/__output__/sg721-updatable/out/Sg721Updatable.message-composer.ts b/__output__/sg721-updatable/Sg721Updatable.message-composer.ts similarity index 100% rename from __output__/sg721-updatable/out/Sg721Updatable.message-composer.ts rename to __output__/sg721-updatable/Sg721Updatable.message-composer.ts diff --git a/__output__/sg721-updatable/out/Sg721Updatable.react-query.ts b/__output__/sg721-updatable/Sg721Updatable.react-query.ts similarity index 100% rename from __output__/sg721-updatable/out/Sg721Updatable.react-query.ts rename to __output__/sg721-updatable/Sg721Updatable.react-query.ts diff --git a/__output__/sg721-updatable/out/Sg721Updatable.types.ts b/__output__/sg721-updatable/Sg721Updatable.types.ts similarity index 100% rename from __output__/sg721-updatable/out/Sg721Updatable.types.ts rename to __output__/sg721-updatable/Sg721Updatable.types.ts diff --git a/__output__/sg721-updatable/out/bundle.ts b/__output__/sg721-updatable/bundle.ts similarity index 100% rename from __output__/sg721-updatable/out/bundle.ts rename to __output__/sg721-updatable/bundle.ts diff --git a/packages/ts-codegen/__tests__/ts-codegen.issue-long-exe-msg-name.test.ts b/packages/ts-codegen/__tests__/ts-codegen.issue-long-exe-msg-name.test.ts index ce67b501..a4270283 100644 --- a/packages/ts-codegen/__tests__/ts-codegen.issue-long-exe-msg-name.test.ts +++ b/packages/ts-codegen/__tests__/ts-codegen.issue-long-exe-msg-name.test.ts @@ -4,7 +4,7 @@ const FIXTURE_DIR = __dirname + '/../../../__fixtures__'; const OUTPUT_DIR = __dirname + '/../../../__output__'; it('issue-long-exe-msg-name', async () => { - const outPath = OUTPUT_DIR + '/sg721-updatable/out'; + const outPath = OUTPUT_DIR + '/sg721-updatable/'; const schemaDir = FIXTURE_DIR + '/sg721-updatable/'; const builder = new TSBuilder({ From 14dc44173f67be9b0b64dd642697c62a1a3d0211 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Tue, 6 Jun 2023 19:30:32 -0700 Subject: [PATCH 121/287] chore(release): publish - @cosmwasm/ts-codegen@0.30.1 - wasm-ast-types@0.23.1 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index e42efdeb..95172642 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.30.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.30.0...@cosmwasm/ts-codegen@0.30.1) (2023-06-07) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.30.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.29.0...@cosmwasm/ts-codegen@0.30.0) (2023-05-24) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 440a2435..f9c5dcdf 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.30.0", + "version": "0.30.1", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.23.0" + "wasm-ast-types": "^0.23.1" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 9e4f66e9..a8cedad0 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.23.1](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.23.0...wasm-ast-types@0.23.1) (2023-06-07) + +**Note:** Version bump only for package wasm-ast-types + + + + + # [0.23.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.22.0...wasm-ast-types@0.23.0) (2023-05-24) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index 595792d8..8fa47c96 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.23.0", + "version": "0.23.1", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From e8a5f42c67e40a27a834cc754c17e908d8b25c1d Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Sun, 11 Jun 2023 11:49:29 -0700 Subject: [PATCH 122/287] readme --- README.md | 7 +++++-- packages/ts-codegen/README.md | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index acef2606..70a871ea 100644 --- a/README.md +++ b/README.md @@ -510,8 +510,11 @@ See the [docs](https://github.com/CosmWasm/ts-codegen/blob/main/packages/wasm-as Checkout these related projects: * [@osmonauts/telescope](https://github.com/osmosis-labs/telescope) a "babel for the Cosmos", Telescope is a TypeScript Transpiler for Cosmos Protobufs. -* [chain-registry](https://github.com/cosmology-tech/chain-registry) Cosmos chain registry and chain info. -* [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) A wallet connector for the Cosmos. +* [chain-registry](https://github.com/cosmology-tech/chain-registry) an npm module for the official Cosmos chain-registry. +* [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) A wallet connector for the Cosmos ⚛️ +* [create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) set up a modern Cosmos app by running one command. +* [starship](https://github.com/cosmology-tech/starship) a k8s-based unified development environment for Cosmos Ecosystem + ## Credits 🛠 Built by Cosmology — if you like our tools, please consider delegating to [our validator ⚛️](https://cosmology.tech/validator) diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index e342fd88..bc9fb14d 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -507,8 +507,11 @@ See the [docs](https://github.com/CosmWasm/ts-codegen/blob/main/packages/wasm-as Checkout these related projects: * [@osmonauts/telescope](https://github.com/osmosis-labs/telescope) a "babel for the Cosmos", Telescope is a TypeScript Transpiler for Cosmos Protobufs. -* [chain-registry](https://github.com/cosmology-tech/chain-registry) Cosmos chain registry and chain info. -* [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) A wallet connector for the Cosmos. +* [chain-registry](https://github.com/cosmology-tech/chain-registry) an npm module for the official Cosmos chain-registry. +* [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) A wallet connector for the Cosmos ⚛️ +* [create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) set up a modern Cosmos app by running one command. +* [starship](https://github.com/cosmology-tech/starship) a k8s-based unified development environment for Cosmos Ecosystem + ## Credits 🛠 Built by Cosmology — if you like our tools, please consider delegating to [our validator ⚛️](https://cosmology.tech/validator) From 205295bdb3d5d3e62102b24c8415f52e2cc5e85c Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Wed, 12 Jul 2023 14:41:46 +0800 Subject: [PATCH 123/287] add create helpers --- packages/ts-codegen/src/builder/builder.ts | 14 ++ .../src/generators/create-helpers.ts | 26 ++++ .../src/helpers/contractContextBase.ts | 58 ++++++++ packages/ts-codegen/src/helpers/index.ts | 1 + .../ts-codegen/src/plugins/use-contracts.ts | 79 +++++++++++ packages/ts-codegen/src/utils/files.ts | 73 ++++++++++ packages/ts-codegen/src/utils/unused.ts | 52 +++++++ .../ts-codegen/types/src/builder/builder.d.ts | 5 + .../types/src/generators/create-helpers.d.ts | 2 + .../src/helpers/contractContextBase.d.ts | 1 + .../ts-codegen/types/src/helpers/index.d.ts | 1 + .../types/src/plugins/use-contracts.d.ts | 12 ++ .../ts-codegen/types/src/utils/files.d.ts | 3 + .../ts-codegen/types/src/utils/unused.d.ts | 5 + .../wasm-ast-types/src/context/context.ts | 5 +- .../wasm-ast-types/src/context/imports.ts | 133 +++++++++++------- .../wasm-ast-types/types/context/context.d.ts | 2 +- .../wasm-ast-types/types/context/imports.d.ts | 4 +- 18 files changed, 423 insertions(+), 53 deletions(-) create mode 100644 packages/ts-codegen/src/generators/create-helpers.ts create mode 100644 packages/ts-codegen/src/helpers/contractContextBase.ts create mode 100644 packages/ts-codegen/src/helpers/index.ts create mode 100644 packages/ts-codegen/src/plugins/use-contracts.ts create mode 100644 packages/ts-codegen/src/utils/files.ts create mode 100644 packages/ts-codegen/src/utils/unused.ts create mode 100644 packages/ts-codegen/types/src/generators/create-helpers.d.ts create mode 100644 packages/ts-codegen/types/src/helpers/contractContextBase.d.ts create mode 100644 packages/ts-codegen/types/src/helpers/index.d.ts create mode 100644 packages/ts-codegen/types/src/plugins/use-contracts.d.ts create mode 100644 packages/ts-codegen/types/src/utils/files.d.ts create mode 100644 packages/ts-codegen/types/src/utils/unused.d.ts diff --git a/packages/ts-codegen/src/builder/builder.ts b/packages/ts-codegen/src/builder/builder.ts index b17ac22c..e2a3119e 100644 --- a/packages/ts-codegen/src/builder/builder.ts +++ b/packages/ts-codegen/src/builder/builder.ts @@ -21,6 +21,7 @@ import { MsgBuilderPlugin } from "../plugins/msg-builder"; import { MessageComposerPlugin } from "../plugins/message-composer"; import { ClientPlugin } from "../plugins/client"; import { TypesPlugin } from "../plugins/types"; +import { createHelpers } from "../generators/create-helpers"; const defaultOpts: TSBuilderOptions = { bundle: { @@ -44,8 +45,14 @@ export interface BundleOptions { bundlePath?: string; }; +export interface UseContractsOptions { + enabled?: boolean; + filename?: string; +}; + export type TSBuilderOptions = { bundle?: BundleOptions; + useContracts?: UseContractsOptions; } & RenderOptions; export type BuilderFileType = 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer' | 'msg-builder' | 'plugin'; @@ -147,6 +154,13 @@ export class TSBuilder { if (this.options.bundle.enabled) { this.bundle(); } + + createHelpers({ + outPath: this.outPath, + contracts: this.contracts, + options: this.options, + plugins: this.plugins, + }); } async bundle() { diff --git a/packages/ts-codegen/src/generators/create-helpers.ts b/packages/ts-codegen/src/generators/create-helpers.ts new file mode 100644 index 00000000..21633f92 --- /dev/null +++ b/packages/ts-codegen/src/generators/create-helpers.ts @@ -0,0 +1,26 @@ +import { join, dirname } from "path"; +import { sync as mkdirp } from "mkdirp"; +import pkg from "../../package.json"; +import { writeContentToFile } from "../utils/files"; +import { TSBuilderInput } from "../builder"; +import { contractContextBase } from "../helpers"; + +const version = process.env.NODE_ENV === "test" ? "latest" : pkg.version; +const header = `/** +* This file and any referenced files were automatically generated by ${pkg.name}@${version} +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or yarn proto command to regenerate this bundle. +*/ +\n`; + +const write = (outPath: string, file: string, content: string) => { + const outFile = join(outPath, file); + mkdirp(dirname(outFile)); + writeContentToFile(outPath, header + content, outFile); +}; + +export const createHelpers = (input: TSBuilderInput) => { + if (input.options?.useContracts?.enabled) { + write(input.outPath, "contractContextBase.ts", contractContextBase); + } +}; diff --git a/packages/ts-codegen/src/helpers/contractContextBase.ts b/packages/ts-codegen/src/helpers/contractContextBase.ts new file mode 100644 index 00000000..d2ef4407 --- /dev/null +++ b/packages/ts-codegen/src/helpers/contractContextBase.ts @@ -0,0 +1,58 @@ +export const contractContextBase = ` +import { + CosmWasmClient, + SigningCosmWasmClient, +} from '@cosmjs/cosmwasm-stargate'; + +export interface IContractConstructor { + address: string | undefined; + cosmWasmClient: CosmWasmClient | undefined; + signingCosmWasmClient: SigningCosmWasmClient | undefined; +} + +export const noSigningErrorMessage = 'signingCosmWasmClient not connected'; + +export const noCosmWasmClientErrorMessage = 'cosmWasmClient not connected'; + +export const noAddressErrorMessage = "address doesn't exist"; + +export class ContractBase { + constructor( + public readonly address: string | undefined, + public readonly cosmWasmClient: CosmWasmClient | undefined, + public readonly signingCosmWasmClient: SigningCosmWasmClient | undefined + ) {} +} + +export function getSigningClientDefault( + intance: ContractBase, + contractAddr: string, + T: new ( + client: SigningCosmWasmClient, + sender: string, + contractAddress: string + ) => T +): T { + if (!intance.signingCosmWasmClient) throw new Error(noSigningErrorMessage); + if (!intance.address) throw new Error(noAddressErrorMessage); + return new T(intance.signingCosmWasmClient, intance.address, contractAddr); +} + +export function getQueryClientDefault( + intance: ContractBase, + contractAddr: string, + T: new (client: CosmWasmClient, contractAddress: string) => T +): T { + if (!intance.cosmWasmClient) throw new Error(noCosmWasmClientErrorMessage); + return new T(intance.cosmWasmClient, contractAddr); +} + +export function getMessageComposerDefault( + intance: ContractBase, + contractAddr: string, + T: new (address: string, contractAddress: string) => T +): T { + if (!intance.address) throw new Error(noAddressErrorMessage); + return new T(intance.address, contractAddr); +} +` \ No newline at end of file diff --git a/packages/ts-codegen/src/helpers/index.ts b/packages/ts-codegen/src/helpers/index.ts new file mode 100644 index 00000000..11619fdc --- /dev/null +++ b/packages/ts-codegen/src/helpers/index.ts @@ -0,0 +1 @@ +export * from './contractContextBase'; \ No newline at end of file diff --git a/packages/ts-codegen/src/plugins/use-contracts.ts b/packages/ts-codegen/src/plugins/use-contracts.ts new file mode 100644 index 00000000..6f5a0bee --- /dev/null +++ b/packages/ts-codegen/src/plugins/use-contracts.ts @@ -0,0 +1,79 @@ +import { pascal } from 'case'; +import * as w from 'wasm-ast-types'; +import { findAndParseTypes, findExecuteMsg } from '../utils'; +import { + getMessageProperties, + ContractInfo, + RenderContextBase, + RenderContext, + RenderOptions +} from 'wasm-ast-types'; +import { BuilderFileType, TSBuilderOptions } from '../builder'; +import { BuilderPluginBase } from './plugin-base'; + +export class ContractsContextPlugin extends BuilderPluginBase { + initContext( + contract: ContractInfo, + options?: TSBuilderOptions + ): RenderContextBase { + return new RenderContext(contract, options); + } + + async doRender( + name: string, + context: RenderContext + ): Promise< + { + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[] + > { + const { enabled } = this.option.useContracts; + + if (!enabled) { + return; + } + + const localname = pascal(name) + '.message-composer.ts'; + + const TypesFile = pascal(name) + '.types'; + + // const ExecuteMsg = findExecuteMsg(schemas); + // const typeHash = await findAndParseTypes(schemas); + + // const body = []; + + // body.push(w.importStmt(Object.keys(typeHash), `./${TypesFile}`)); + + // // execute messages + // if (ExecuteMsg) { + // const children = getMessageProperties(ExecuteMsg); + // if (children.length > 0) { + // const TheClass = pascal(`${name}MessageComposer`); + // const Interface = pascal(`${name}Message`); + + // body.push( + // w.createMessageComposerInterface(context, Interface, ExecuteMsg) + // ); + // body.push( + // w.createMessageComposerClass(context, TheClass, Interface, ExecuteMsg) + // ); + // } + // } + + // if (typeHash.hasOwnProperty('Coin')) { + // // @ts-ignore + // delete context.utils.Coin; + // } + + return [ + { + type: 'message-composer', + localname, + body + } + ]; + } +} diff --git a/packages/ts-codegen/src/utils/files.ts b/packages/ts-codegen/src/utils/files.ts new file mode 100644 index 00000000..ba1f87c6 --- /dev/null +++ b/packages/ts-codegen/src/utils/files.ts @@ -0,0 +1,73 @@ +import * as t from "@babel/types"; +import { parse, ParserPlugin } from "@babel/parser"; +import { sync as mkdirp } from "mkdirp"; +import { writeFileSync } from "fs"; +import { dirname } from "path"; +import generate from "@babel/generator"; +import { unused } from "./unused"; +import traverse from "@babel/traverse"; + +export const writeAstToFile = ( + outPath: string, + program: t.Statement[], + filename: string, + removeUnusedImports = false, + isTsDisable = false, + isEslintDisable = false +) => { + const ast = t.program(program); + const content = generate(ast).code; + + if (removeUnusedImports) { + const plugins: ParserPlugin[] = ["typescript"]; + const newAst = parse(content, { + sourceType: "module", + plugins, + }); + traverse(newAst, unused); + const content2 = generate(newAst).code; + writeContentToFile( + outPath, + content2, + filename, + isTsDisable, + isEslintDisable + ); + } else { + writeContentToFile( + outPath, + content, + filename, + isTsDisable, + isEslintDisable + ); + } +}; + +export const writeContentToFile = ( + outPath: string, + content: string, + filename: string, + isTsDisable = false, + isEslintDisable = false +) => { + let esLintPrefix = ""; + let tsLintPrefix = ""; + + let nameWithoutPath = filename.replace(outPath, ""); + // strip off leading slash + if (nameWithoutPath.startsWith("/")) + nameWithoutPath = nameWithoutPath.replace(/^\//, ""); + + if (isTsDisable) { + tsLintPrefix = `//@ts-nocheck\n`; + } + + if (isEslintDisable) { + esLintPrefix = `/* eslint-disable */\n`; + } + + const text = tsLintPrefix + esLintPrefix + content; + mkdirp(dirname(filename)); + writeFileSync(filename, text); +}; diff --git a/packages/ts-codegen/src/utils/unused.ts b/packages/ts-codegen/src/utils/unused.ts new file mode 100644 index 00000000..4e922a0b --- /dev/null +++ b/packages/ts-codegen/src/utils/unused.ts @@ -0,0 +1,52 @@ +//@ts-nocheck + +import * as t from '@babel/types'; + +// https://github.com/chuyik/babel-plugin-danger-remove-unused-import +// https://github.com/chuyik/babel-plugin-danger-remove-unused-import/blob/c5454c21e94698a2464a12baa5590761932a71a8/License#L1 + +export const unused = { + Program: { + exit: (path) => { + const UnRefBindings = new Map() + for (const [name, binding] of Object.entries(path.scope.bindings)) { + if (!binding.path.parentPath || binding.kind !== 'module') continue + + const source = binding.path.parentPath.get('source') + const importName = source.node.value + if ( + !t.isStringLiteral(source) + ) + continue + + const key = `${importName}(${source.node.loc && + source.node.loc.start.line})` + + if (!UnRefBindings.has(key)) { + UnRefBindings.set(key, binding) + } + + if (binding.referenced) { + UnRefBindings.set(key, null) + } else { + const nodeType = binding.path.node.type + if (nodeType === 'ImportSpecifier') { + binding.path.remove() + } else if (nodeType === 'ImportDefaultSpecifier') { + binding.path.remove() + } else if (nodeType === 'ImportNamespaceSpecifier') { + binding.path.remove() + } else if (binding.path.parentPath) { + binding.path.parentPath.remove() + } + } + } + + UnRefBindings.forEach((binding, key) => { + if (binding && binding.path.parentPath) { + binding.path.parentPath.remove() + } + }) + } + } +}; \ No newline at end of file diff --git a/packages/ts-codegen/types/src/builder/builder.d.ts b/packages/ts-codegen/types/src/builder/builder.d.ts index fd4d598d..e9aeb6db 100644 --- a/packages/ts-codegen/types/src/builder/builder.d.ts +++ b/packages/ts-codegen/types/src/builder/builder.d.ts @@ -12,8 +12,13 @@ export interface BundleOptions { bundleFile?: string; bundlePath?: string; } +export interface UseContractsOptions { + enabled?: boolean; + filename?: string; +} export type TSBuilderOptions = { bundle?: BundleOptions; + useContracts?: UseContractsOptions; } & RenderOptions; export type BuilderFileType = 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer' | 'msg-builder' | 'plugin'; export interface BuilderFile { diff --git a/packages/ts-codegen/types/src/generators/create-helpers.d.ts b/packages/ts-codegen/types/src/generators/create-helpers.d.ts new file mode 100644 index 00000000..a09345d0 --- /dev/null +++ b/packages/ts-codegen/types/src/generators/create-helpers.d.ts @@ -0,0 +1,2 @@ +import { TSBuilderInput } from '../builder'; +export declare const createHelpers: (input: TSBuilderInput) => void; diff --git a/packages/ts-codegen/types/src/helpers/contractContextBase.d.ts b/packages/ts-codegen/types/src/helpers/contractContextBase.d.ts new file mode 100644 index 00000000..137be22d --- /dev/null +++ b/packages/ts-codegen/types/src/helpers/contractContextBase.d.ts @@ -0,0 +1 @@ +export declare const contractContextBase = "\nimport {\n CosmWasmClient,\n SigningCosmWasmClient,\n} from '@cosmjs/cosmwasm-stargate';\n\nexport interface IContractConstructor {\n address: string | undefined;\n cosmWasmClient: CosmWasmClient | undefined;\n signingCosmWasmClient: SigningCosmWasmClient | undefined;\n}\n\nexport const noSigningErrorMessage = 'signingCosmWasmClient not connected';\n\nexport const noCosmWasmClientErrorMessage = 'cosmWasmClient not connected';\n\nexport const noAddressErrorMessage = \"address doesn't exist\";\n\nexport class ContractBase {\n constructor(\n public readonly address: string | undefined,\n public readonly cosmWasmClient: CosmWasmClient | undefined,\n public readonly signingCosmWasmClient: SigningCosmWasmClient | undefined\n ) {}\n}\n\nexport function getSigningClientDefault(\n intance: ContractBase,\n contractAddr: string,\n T: new (\n client: SigningCosmWasmClient,\n sender: string,\n contractAddress: string\n ) => T\n): T {\n if (!intance.signingCosmWasmClient) throw new Error(noSigningErrorMessage);\n if (!intance.address) throw new Error(noAddressErrorMessage);\n return new T(intance.signingCosmWasmClient, intance.address, contractAddr);\n}\n\nexport function getQueryClientDefault(\n intance: ContractBase,\n contractAddr: string,\n T: new (client: CosmWasmClient, contractAddress: string) => T\n): T {\n if (!intance.cosmWasmClient) throw new Error(noCosmWasmClientErrorMessage);\n return new T(intance.cosmWasmClient, contractAddr);\n}\n\nexport function getMessageComposerDefault(\n intance: ContractBase,\n contractAddr: string,\n T: new (address: string, contractAddress: string) => T\n): T {\n if (!intance.address) throw new Error(noAddressErrorMessage);\n return new T(intance.address, contractAddr);\n}\n"; diff --git a/packages/ts-codegen/types/src/helpers/index.d.ts b/packages/ts-codegen/types/src/helpers/index.d.ts new file mode 100644 index 00000000..71a13410 --- /dev/null +++ b/packages/ts-codegen/types/src/helpers/index.d.ts @@ -0,0 +1 @@ +export * from './contractContextBase'; diff --git a/packages/ts-codegen/types/src/plugins/use-contracts.d.ts b/packages/ts-codegen/types/src/plugins/use-contracts.d.ts new file mode 100644 index 00000000..4b0fce32 --- /dev/null +++ b/packages/ts-codegen/types/src/plugins/use-contracts.d.ts @@ -0,0 +1,12 @@ +import { ContractInfo, RenderContextBase, RenderContext } from 'wasm-ast-types'; +import { BuilderFileType, TSBuilderOptions } from '../builder'; +import { BuilderPluginBase } from './plugin-base'; +export declare class ContractsContextPlugin extends BuilderPluginBase { + initContext(contract: ContractInfo, options?: TSBuilderOptions): RenderContextBase; + doRender(name: string, context: RenderContext): Promise<{ + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[]>; +} diff --git a/packages/ts-codegen/types/src/utils/files.d.ts b/packages/ts-codegen/types/src/utils/files.d.ts new file mode 100644 index 00000000..313b5cc1 --- /dev/null +++ b/packages/ts-codegen/types/src/utils/files.d.ts @@ -0,0 +1,3 @@ +import * as t from "@babel/types"; +export declare const writeAstToFile: (outPath: string, program: t.Statement[], filename: string, removeUnusedImports?: boolean, isTsDisable?: boolean, isEslintDisable?: boolean) => void; +export declare const writeContentToFile: (outPath: string, content: string, filename: string, isTsDisable?: boolean, isEslintDisable?: boolean) => void; diff --git a/packages/ts-codegen/types/src/utils/unused.d.ts b/packages/ts-codegen/types/src/utils/unused.d.ts new file mode 100644 index 00000000..13b921b4 --- /dev/null +++ b/packages/ts-codegen/types/src/utils/unused.d.ts @@ -0,0 +1,5 @@ +export declare const unused: { + Program: { + exit: (path: any) => void; + }; +}; diff --git a/packages/wasm-ast-types/src/context/context.ts b/packages/wasm-ast-types/src/context/context.ts index 9cb27f60..95c7831c 100644 --- a/packages/wasm-ast-types/src/context/context.ts +++ b/packages/wasm-ast-types/src/context/context.ts @@ -156,13 +156,14 @@ export abstract class RenderContextBase implements IRender addUtil(util: string) { this.utils[util] = true; } - getImports(registeredUtils?: UtilMapping) { + getImports(registeredUtils?: UtilMapping, filepath?: string) { return getImportStatements( convertUtilsToImportList( this, Object.keys(this.utils), registeredUtils, - ) + ), + filepath ); } } diff --git a/packages/wasm-ast-types/src/context/imports.ts b/packages/wasm-ast-types/src/context/imports.ts index cf10b276..444a9ddb 100644 --- a/packages/wasm-ast-types/src/context/imports.ts +++ b/packages/wasm-ast-types/src/context/imports.ts @@ -1,6 +1,7 @@ import * as t from '@babel/types'; import { importAs, importStmt } from "../utils"; import { RenderContext } from './context'; +import { relative, dirname, extname } from 'path'; export interface ImportObj { @@ -57,6 +58,10 @@ export const UTILS = { }; +export const UTIL_HELPERS = [ + '__contractContextBase__', +]; + export const convertUtilsToImportList = ( context: RenderContext, utils: string[], @@ -102,59 +107,89 @@ export const convertUtil = ( } }; -export const getImportStatements = (list: ImportObj[]) => { - const imports = list.reduce((m, obj) => { - m[obj.path] = m[obj.path] || []; - const exists = m[obj.path].find(el => el.type === obj.type && el.path === obj.path && el.name === obj.name); - // TODO some have google.protobuf.Any shows up... figure out the better way to handle this - if (/\./.test(obj.name)) { - obj.name = obj.name.split('.')[obj.name.split('.').length - 1]; - } +// __helpers__ +export const getImportStatements = ( + list: ImportObj[], + filepath?: string +) => { + + // swap helpers with helpers file... + const modifiedImports = list.map(imp => { + if (filepath && UTIL_HELPERS.includes(imp.path)) { + const name = imp.path.replace(/__/g, ''); + return { + ...imp, + path: getRelativePath(filepath, `./${name}`) + } + } + return imp; + }); - if (!exists) m[obj.path].push(obj); - return m; + const imports = modifiedImports.reduce((m, obj) => { + m[obj.path] = m[obj.path] || []; + const exists = m[obj.path].find(el => + el.type === obj.type && el.path === obj.path && el.name === obj.name); + + // MARKED AS NOT DRY [google.protobuf names] + // TODO some have google.protobuf.Any shows up... figure out the better way to handle this + if (/\./.test(obj.name)) { + obj.name = obj.name.split('.')[obj.name.split('.').length - 1]; + } + + if (!exists) { + m[obj.path].push(obj); + } + return m; }, {}) + return Object.entries(imports) - .reduce((m, [importPath, imports]: [string, ImportObj[]]) => { - const defaultImports = imports.filter(a => a.type === 'default'); - if (defaultImports.length) { - if (defaultImports.length > 1) throw new Error('more than one default name NOT allowed.') - m.push( - t.importDeclaration( - [ - t.importDefaultSpecifier( - t.identifier(defaultImports[0].name) + .reduce((m, [importPath, imports]: [string, ImportObj[]]) => { + const defaultImports = imports.filter(a => a.type === 'default'); + if (defaultImports.length) { + if (defaultImports.length > 1) throw new Error('more than one default name NOT allowed.') + m.push( + t.importDeclaration( + [ + t.importDefaultSpecifier( + t.identifier(defaultImports[0].name) + ) + ], + t.stringLiteral(defaultImports[0].path) + ) ) - ], - t.stringLiteral(defaultImports[0].path) - ) - ) - } - const namedImports = imports.filter(a => a.type === 'import' && (!a.importAs || (a.name === a.importAs))); - if (namedImports.length) { - m.push(importStmt(namedImports.map(i => i.name), namedImports[0].path)); - } - const aliasNamedImports = imports.filter(a => a.type === 'import' && (a.importAs && (a.name !== a.importAs))); - aliasNamedImports.forEach(imp => { - m.push(importAs(imp.name, imp.importAs, imp.path)); - }); - - const namespaced = imports.filter(a => a.type === 'namespace'); - if (namespaced.length) { - if (namespaced.length > 1) throw new Error('more than one namespaced name NOT allowed.') - m.push( - t.importDeclaration( - [ - t.importNamespaceSpecifier( - t.identifier(namespaced[0].name) + } + const namedImports = imports.filter(a => a.type === 'import' && (!a.importAs || (a.name === a.importAs))); + if (namedImports.length) { + m.push(importStmt(namedImports.map(i => i.name), namedImports[0].path)); + } + const aliasNamedImports = imports.filter(a => a.type === 'import' && (a.importAs && (a.name !== a.importAs))); + aliasNamedImports.forEach(imp => { + m.push(importAs(imp.name, imp.importAs, imp.path)); + }); + + const namespaced = imports.filter(a => a.type === 'namespace'); + if (namespaced.length) { + if (namespaced.length > 1) throw new Error('more than one namespaced name NOT allowed.') + m.push( + t.importDeclaration( + [ + t.importNamespaceSpecifier( + t.identifier(namespaced[0].name) + ) + ], + t.stringLiteral(namespaced[0].path) + ) ) - ], - t.stringLiteral(namespaced[0].path) - ) - ) - } - return m; - }, []) -}; \ No newline at end of file + } + return m; + }, []) +}; + +export const getRelativePath = (f1: string, f2: string) => { + const rel = relative(dirname(f1), f2); + let importPath = rel.replace(extname(rel), ''); + if (!/^\./.test(importPath)) importPath = `./${importPath}`; + return importPath; +} \ No newline at end of file diff --git a/packages/wasm-ast-types/types/context/context.d.ts b/packages/wasm-ast-types/types/context/context.d.ts index acb7b342..e6635246 100644 --- a/packages/wasm-ast-types/types/context/context.d.ts +++ b/packages/wasm-ast-types/types/context/context.d.ts @@ -85,7 +85,7 @@ export declare abstract class RenderContextBase implements abstract mergeDefaultOpt(options: TOpt): TOpt; refLookup($ref: string): JSONSchema; addUtil(util: string): void; - getImports(registeredUtils?: UtilMapping): any; + getImports(registeredUtils?: UtilMapping, filepath?: string): any; } export declare class RenderContext extends RenderContextBase { mergeDefaultOpt(options: RenderOptions): RenderOptions; diff --git a/packages/wasm-ast-types/types/context/imports.d.ts b/packages/wasm-ast-types/types/context/imports.d.ts index d88549ce..21361af1 100644 --- a/packages/wasm-ast-types/types/context/imports.d.ts +++ b/packages/wasm-ast-types/types/context/imports.d.ts @@ -40,6 +40,8 @@ export declare const UTILS: { name: any; }; }; +export declare const UTIL_HELPERS: string[]; export declare const convertUtilsToImportList: (context: RenderContext, utils: string[], registeredUtils?: UtilMapping) => ImportObj[]; export declare const convertUtil: (context: RenderContext, util: string, registeredUtils: object) => ImportObj; -export declare const getImportStatements: (list: ImportObj[]) => any[]; +export declare const getImportStatements: (list: ImportObj[], filepath?: string) => any[]; +export declare const getRelativePath: (f1: string, f2: string) => string; From 2915911686f1ed330e8b7f6cf6c06aff0f9de4a4 Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Wed, 12 Jul 2023 21:12:23 +0800 Subject: [PATCH 124/287] gen provider class body --- .../contracts/CwAdminFactory.provider.ts | 20 ++++ .../contracts/CwCodeIdRegistry.provider.ts | 20 ++++ .../contracts/CwSingle.provider.ts | 20 ++++ .../contracts/Factory.provider.ts | 20 ++++ .../bundler_test/contracts/Minter.provider.ts | 20 ++++ .../contracts/contractContextBase.ts | 63 ++++++++++ __output__/builder/bundler_test/index.ts | 82 +++++++------ .../__snapshots__/builder.test.ts.snap | 104 ++++++++++++++++ packages/ts-codegen/__tests__/builder.test.ts | 3 + packages/ts-codegen/src/builder/builder.ts | 7 +- packages/ts-codegen/src/plugins/client.ts | 11 +- .../src/plugins/message-composer.ts | 8 +- .../ts-codegen/src/plugins/msg-builder.ts | 2 +- .../ts-codegen/src/plugins/plugin-base.ts | 50 ++++---- packages/ts-codegen/src/plugins/provider.ts | 111 ++++++++++++++++++ .../ts-codegen/src/plugins/react-query.ts | 2 +- packages/ts-codegen/src/plugins/recoil.ts | 2 +- packages/ts-codegen/src/plugins/types.ts | 2 +- .../ts-codegen/src/plugins/use-contracts.ts | 2 +- .../ts-codegen/types/src/builder/builder.d.ts | 3 +- .../types/src/generators/create-helpers.d.ts | 2 +- .../ts-codegen/types/src/plugins/client.d.ts | 2 + .../types/src/plugins/message-composer.d.ts | 1 + .../types/src/plugins/plugin-base.d.ts | 10 +- .../types/src/plugins/provider.d.ts | 13 ++ .../wasm-ast-types/src/context/context.ts | 36 +++++- packages/wasm-ast-types/src/index.ts | 1 + packages/wasm-ast-types/src/provider/index.ts | 1 + .../wasm-ast-types/src/provider/provider.ts | 51 ++++++++ .../src/react-query/react-query.ts | 6 +- .../wasm-ast-types/types/context/context.d.ts | 23 +++- packages/wasm-ast-types/types/index.d.ts | 1 + .../wasm-ast-types/types/provider/index.d.ts | 1 + .../types/provider/provider.d.ts | 2 + 34 files changed, 624 insertions(+), 78 deletions(-) create mode 100644 __output__/builder/bundler_test/contracts/CwAdminFactory.provider.ts create mode 100644 __output__/builder/bundler_test/contracts/CwCodeIdRegistry.provider.ts create mode 100644 __output__/builder/bundler_test/contracts/CwSingle.provider.ts create mode 100644 __output__/builder/bundler_test/contracts/Factory.provider.ts create mode 100644 __output__/builder/bundler_test/contracts/Minter.provider.ts create mode 100644 __output__/builder/bundler_test/contracts/contractContextBase.ts create mode 100644 packages/ts-codegen/src/plugins/provider.ts create mode 100644 packages/ts-codegen/types/src/plugins/provider.d.ts create mode 100644 packages/wasm-ast-types/src/provider/index.ts create mode 100644 packages/wasm-ast-types/src/provider/provider.ts create mode 100644 packages/wasm-ast-types/types/provider/index.d.ts create mode 100644 packages/wasm-ast-types/types/provider/provider.d.ts diff --git a/__output__/builder/bundler_test/contracts/CwAdminFactory.provider.ts b/__output__/builder/bundler_test/contracts/CwAdminFactory.provider.ts new file mode 100644 index 00000000..7aac8f72 --- /dev/null +++ b/__output__/builder/bundler_test/contracts/CwAdminFactory.provider.ts @@ -0,0 +1,20 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { ContractBase, getSigningClientDefault, getQueryClientDefault, getMessageComposerDefault } from "./contractContextBase"; +import { CwAdminFactoryClient } from "./CwAdminFactory.client.ts"; +import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client.ts"; +import { CwAdminFactoryMessageComposer } from "./CwAdminFactory.message-composer.ts"; +export class CwAdminFactory extends ContractBase { + constructor({ + address, + cosmWasmClient, + signingCosmWasmClient + }) { + super(address, cosmWasmClient, signingCosmWasmClient); + } + +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.provider.ts b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.provider.ts new file mode 100644 index 00000000..5d9e6b95 --- /dev/null +++ b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.provider.ts @@ -0,0 +1,20 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { ContractBase, getSigningClientDefault, getQueryClientDefault, getMessageComposerDefault } from "./contractContextBase"; +import { CwCodeIdRegistryClient } from "./CwCodeIdRegistry.client.ts"; +import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client.ts"; +import { CwCodeIdRegistryMessageComposer } from "./CwCodeIdRegistry.message-composer.ts"; +export class CwCodeIdRegistry extends ContractBase { + constructor({ + address, + cosmWasmClient, + signingCosmWasmClient + }) { + super(address, cosmWasmClient, signingCosmWasmClient); + } + +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwSingle.provider.ts b/__output__/builder/bundler_test/contracts/CwSingle.provider.ts new file mode 100644 index 00000000..f5c349a5 --- /dev/null +++ b/__output__/builder/bundler_test/contracts/CwSingle.provider.ts @@ -0,0 +1,20 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { ContractBase, getSigningClientDefault, getQueryClientDefault, getMessageComposerDefault } from "./contractContextBase"; +import { CwSingleClient } from "./CwSingle.client.ts"; +import { CwSingleQueryClient } from "./CwSingle.client.ts"; +import { CwSingleMessageComposer } from "./CwSingle.message-composer.ts"; +export class CwSingle extends ContractBase { + constructor({ + address, + cosmWasmClient, + signingCosmWasmClient + }) { + super(address, cosmWasmClient, signingCosmWasmClient); + } + +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Factory.provider.ts b/__output__/builder/bundler_test/contracts/Factory.provider.ts new file mode 100644 index 00000000..f63a1ebb --- /dev/null +++ b/__output__/builder/bundler_test/contracts/Factory.provider.ts @@ -0,0 +1,20 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { ContractBase, getSigningClientDefault, getQueryClientDefault, getMessageComposerDefault } from "./contractContextBase"; +import { FactoryClient } from "./Factory.client.ts"; +import { FactoryQueryClient } from "./Factory.client.ts"; +import { FactoryMessageComposer } from "./Factory.message-composer.ts"; +export class Factory extends ContractBase { + constructor({ + address, + cosmWasmClient, + signingCosmWasmClient + }) { + super(address, cosmWasmClient, signingCosmWasmClient); + } + +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Minter.provider.ts b/__output__/builder/bundler_test/contracts/Minter.provider.ts new file mode 100644 index 00000000..118e73bd --- /dev/null +++ b/__output__/builder/bundler_test/contracts/Minter.provider.ts @@ -0,0 +1,20 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { ContractBase, getSigningClientDefault, getQueryClientDefault, getMessageComposerDefault } from "./contractContextBase"; +import { MinterClient } from "./Minter.client.ts"; +import { MinterQueryClient } from "./Minter.client.ts"; +import { MinterMessageComposer } from "./Minter.message-composer.ts"; +export class Minter extends ContractBase { + constructor({ + address, + cosmWasmClient, + signingCosmWasmClient + }) { + super(address, cosmWasmClient, signingCosmWasmClient); + } + +} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/contractContextBase.ts b/__output__/builder/bundler_test/contracts/contractContextBase.ts new file mode 100644 index 00000000..17d38894 --- /dev/null +++ b/__output__/builder/bundler_test/contracts/contractContextBase.ts @@ -0,0 +1,63 @@ +/** +* This file and any referenced files were automatically generated by @cosmwasm/ts-codegen@latest +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or yarn proto command to regenerate this bundle. +*/ + + +import { + CosmWasmClient, + SigningCosmWasmClient, +} from '@cosmjs/cosmwasm-stargate'; + +export interface IContractConstructor { + address: string | undefined; + cosmWasmClient: CosmWasmClient | undefined; + signingCosmWasmClient: SigningCosmWasmClient | undefined; +} + +export const noSigningErrorMessage = 'signingCosmWasmClient not connected'; + +export const noCosmWasmClientErrorMessage = 'cosmWasmClient not connected'; + +export const noAddressErrorMessage = "address doesn't exist"; + +export class ContractBase { + constructor( + public readonly address: string | undefined, + public readonly cosmWasmClient: CosmWasmClient | undefined, + public readonly signingCosmWasmClient: SigningCosmWasmClient | undefined + ) {} +} + +export function getSigningClientDefault( + intance: ContractBase, + contractAddr: string, + T: new ( + client: SigningCosmWasmClient, + sender: string, + contractAddress: string + ) => T +): T { + if (!intance.signingCosmWasmClient) throw new Error(noSigningErrorMessage); + if (!intance.address) throw new Error(noAddressErrorMessage); + return new T(intance.signingCosmWasmClient, intance.address, contractAddr); +} + +export function getQueryClientDefault( + intance: ContractBase, + contractAddr: string, + T: new (client: CosmWasmClient, contractAddress: string) => T +): T { + if (!intance.cosmWasmClient) throw new Error(noCosmWasmClientErrorMessage); + return new T(intance.cosmWasmClient, contractAddr); +} + +export function getMessageComposerDefault( + intance: ContractBase, + contractAddr: string, + T: new (address: string, contractAddress: string) => T +): T { + if (!intance.address) throw new Error(noAddressErrorMessage); + return new T(intance.address, contractAddr); +} diff --git a/__output__/builder/bundler_test/index.ts b/__output__/builder/bundler_test/index.ts index 8dedea79..39f93cb6 100644 --- a/__output__/builder/bundler_test/index.ts +++ b/__output__/builder/bundler_test/index.ts @@ -9,57 +9,67 @@ import * as _76 from "./contracts/Factory.client"; import * as _77 from "./contracts/Factory.message-composer"; import * as _78 from "./contracts/Factory.react-query"; import * as _79 from "./contracts/Factory.recoil"; -import * as _80 from "./contracts/Minter.types"; -import * as _81 from "./contracts/Minter.client"; -import * as _82 from "./contracts/Minter.message-composer"; -import * as _83 from "./contracts/Minter.react-query"; -import * as _84 from "./contracts/Minter.recoil"; -import * as _85 from "./contracts/CwAdminFactory.types"; -import * as _86 from "./contracts/CwAdminFactory.client"; -import * as _87 from "./contracts/CwAdminFactory.message-composer"; -import * as _88 from "./contracts/CwAdminFactory.react-query"; -import * as _89 from "./contracts/CwAdminFactory.recoil"; -import * as _90 from "./contracts/CwCodeIdRegistry.types"; -import * as _91 from "./contracts/CwCodeIdRegistry.client"; -import * as _92 from "./contracts/CwCodeIdRegistry.message-composer"; -import * as _93 from "./contracts/CwCodeIdRegistry.react-query"; -import * as _94 from "./contracts/CwCodeIdRegistry.recoil"; -import * as _95 from "./contracts/CwSingle.types"; -import * as _96 from "./contracts/CwSingle.client"; -import * as _97 from "./contracts/CwSingle.message-composer"; -import * as _98 from "./contracts/CwSingle.react-query"; -import * as _99 from "./contracts/CwSingle.recoil"; +import * as _80 from "./contracts/Factory.provider"; +import * as _81 from "./contracts/Minter.types"; +import * as _82 from "./contracts/Minter.client"; +import * as _83 from "./contracts/Minter.message-composer"; +import * as _84 from "./contracts/Minter.react-query"; +import * as _85 from "./contracts/Minter.recoil"; +import * as _86 from "./contracts/Minter.provider"; +import * as _87 from "./contracts/CwAdminFactory.types"; +import * as _88 from "./contracts/CwAdminFactory.client"; +import * as _89 from "./contracts/CwAdminFactory.message-composer"; +import * as _90 from "./contracts/CwAdminFactory.react-query"; +import * as _91 from "./contracts/CwAdminFactory.recoil"; +import * as _92 from "./contracts/CwAdminFactory.provider"; +import * as _93 from "./contracts/CwCodeIdRegistry.types"; +import * as _94 from "./contracts/CwCodeIdRegistry.client"; +import * as _95 from "./contracts/CwCodeIdRegistry.message-composer"; +import * as _96 from "./contracts/CwCodeIdRegistry.react-query"; +import * as _97 from "./contracts/CwCodeIdRegistry.recoil"; +import * as _98 from "./contracts/CwCodeIdRegistry.provider"; +import * as _99 from "./contracts/CwSingle.types"; +import * as _100 from "./contracts/CwSingle.client"; +import * as _101 from "./contracts/CwSingle.message-composer"; +import * as _102 from "./contracts/CwSingle.react-query"; +import * as _103 from "./contracts/CwSingle.recoil"; +import * as _104 from "./contracts/CwSingle.provider"; export namespace smart { export namespace contracts { export const Factory = { ..._75, ..._76, ..._77, ..._78, - ..._79 + ..._79, + ..._80 }; - export const Minter = { ..._80, - ..._81, + export const Minter = { ..._81, ..._82, ..._83, - ..._84 + ..._84, + ..._85, + ..._86 }; - export const CwAdminFactory = { ..._85, - ..._86, - ..._87, + export const CwAdminFactory = { ..._87, ..._88, - ..._89 - }; - export const CwCodeIdRegistry = { ..._90, + ..._89, + ..._90, ..._91, - ..._92, - ..._93, - ..._94 + ..._92 }; - export const CwSingle = { ..._95, + export const CwCodeIdRegistry = { ..._93, + ..._94, + ..._95, ..._96, ..._97, - ..._98, - ..._99 + ..._98 + }; + export const CwSingle = { ..._99, + ..._100, + ..._101, + ..._102, + ..._103, + ..._104 }; } } \ No newline at end of file diff --git a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap index 21f9e9a1..d52d4370 100644 --- a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap +++ b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap @@ -2,6 +2,9 @@ exports[`options tsClient.enabled 1`] = ` TSBuilder { + "builderContext": BuilderContext { + "providers": Object {}, + }, "files": Array [], "options": Object { "bundle": Object { @@ -39,6 +42,7 @@ TSBuilder { }, "plugins": Array [ TypesPlugin { + "builder": [Circular], "option": Object { "bundle": Object { "bundleFile": "bundle.ts", @@ -76,6 +80,7 @@ TSBuilder { "utils": undefined, }, ClientPlugin { + "builder": [Circular], "option": Object { "bundle": Object { "bundleFile": "bundle.ts", @@ -113,6 +118,7 @@ TSBuilder { "utils": undefined, }, MessageComposerPlugin { + "builder": [Circular], "option": Object { "bundle": Object { "bundleFile": "bundle.ts", @@ -150,6 +156,7 @@ TSBuilder { "utils": undefined, }, ReactQueryPlugin { + "builder": [Circular], "option": Object { "bundle": Object { "bundleFile": "bundle.ts", @@ -187,6 +194,7 @@ TSBuilder { "utils": undefined, }, RecoilPlugin { + "builder": [Circular], "option": Object { "bundle": Object { "bundleFile": "bundle.ts", @@ -226,6 +234,7 @@ TSBuilder { }, }, MsgBuilderPlugin { + "builder": [Circular], "option": Object { "bundle": Object { "bundleFile": "bundle.ts", @@ -262,12 +271,58 @@ TSBuilder { }, "utils": undefined, }, + ContractsContextProviderPlugin { + "builder": [Circular], + "option": Object { + "bundle": Object { + "bundleFile": "bundle.ts", + "enabled": true, + "scope": "contracts", + }, + "client": Object { + "enabled": true, + "execExtendsQuery": true, + "noImplicitOverride": false, + }, + "enabled": true, + "messageComposer": Object { + "enabled": false, + }, + "msgBuilder": Object { + "enabled": false, + }, + "reactQuery": Object { + "camelize": true, + "enabled": true, + "mutations": false, + "optionalClient": false, + "queryKeys": false, + "version": "v3", + }, + "recoil": Object { + "enabled": false, + }, + "types": Object { + "aliasExecuteMsg": false, + "enabled": true, + }, + }, + "utils": Object { + "ContractBase": "__contractContextBase__", + "getMessageComposerDefault": "__contractContextBase__", + "getQueryClientDefault": "__contractContextBase__", + "getSigningClientDefault": "__contractContextBase__", + }, + }, ], } `; exports[`options undefined 1`] = ` TSBuilder { + "builderContext": BuilderContext { + "providers": Object {}, + }, "files": Array [], "options": Object { "bundle": Object { @@ -305,6 +360,7 @@ TSBuilder { }, "plugins": Array [ TypesPlugin { + "builder": [Circular], "option": Object { "bundle": Object { "bundleFile": "bundle.ts", @@ -342,6 +398,7 @@ TSBuilder { "utils": undefined, }, ClientPlugin { + "builder": [Circular], "option": Object { "bundle": Object { "bundleFile": "bundle.ts", @@ -379,6 +436,7 @@ TSBuilder { "utils": undefined, }, MessageComposerPlugin { + "builder": [Circular], "option": Object { "bundle": Object { "bundleFile": "bundle.ts", @@ -416,6 +474,7 @@ TSBuilder { "utils": undefined, }, ReactQueryPlugin { + "builder": [Circular], "option": Object { "bundle": Object { "bundleFile": "bundle.ts", @@ -453,6 +512,7 @@ TSBuilder { "utils": undefined, }, RecoilPlugin { + "builder": [Circular], "option": Object { "bundle": Object { "bundleFile": "bundle.ts", @@ -492,6 +552,7 @@ TSBuilder { }, }, MsgBuilderPlugin { + "builder": [Circular], "option": Object { "bundle": Object { "bundleFile": "bundle.ts", @@ -528,6 +589,49 @@ TSBuilder { }, "utils": undefined, }, + ContractsContextProviderPlugin { + "builder": [Circular], + "option": Object { + "bundle": Object { + "bundleFile": "bundle.ts", + "enabled": true, + "scope": "contracts", + }, + "client": Object { + "enabled": true, + "execExtendsQuery": true, + "noImplicitOverride": false, + }, + "enabled": true, + "messageComposer": Object { + "enabled": false, + }, + "msgBuilder": Object { + "enabled": false, + }, + "reactQuery": Object { + "camelize": true, + "enabled": false, + "mutations": false, + "optionalClient": false, + "queryKeys": false, + "version": "v3", + }, + "recoil": Object { + "enabled": false, + }, + "types": Object { + "aliasExecuteMsg": false, + "enabled": true, + }, + }, + "utils": Object { + "ContractBase": "__contractContextBase__", + "getMessageComposerDefault": "__contractContextBase__", + "getQueryClientDefault": "__contractContextBase__", + "getSigningClientDefault": "__contractContextBase__", + }, + }, ], } `; diff --git a/packages/ts-codegen/__tests__/builder.test.ts b/packages/ts-codegen/__tests__/builder.test.ts index 29603e2b..4c6aa185 100644 --- a/packages/ts-codegen/__tests__/builder.test.ts +++ b/packages/ts-codegen/__tests__/builder.test.ts @@ -197,6 +197,9 @@ it('builder set bundler path', async () => { }, messageComposer: { enabled: true + }, + useContracts:{ + enabled: true, } } }); diff --git a/packages/ts-codegen/src/builder/builder.ts b/packages/ts-codegen/src/builder/builder.ts index e2a3119e..2950c324 100644 --- a/packages/ts-codegen/src/builder/builder.ts +++ b/packages/ts-codegen/src/builder/builder.ts @@ -1,4 +1,4 @@ -import { RenderOptions, defaultOptions, RenderContext, ContractInfo, MessageComposerOptions} from "wasm-ast-types"; +import { RenderOptions, defaultOptions, RenderContext, ContractInfo, MessageComposerOptions, BuilderContext} from "wasm-ast-types"; import { header } from '../utils/header'; import { join } from "path"; @@ -21,6 +21,7 @@ import { MsgBuilderPlugin } from "../plugins/msg-builder"; import { MessageComposerPlugin } from "../plugins/message-composer"; import { ClientPlugin } from "../plugins/client"; import { TypesPlugin } from "../plugins/types"; +import { ContractsContextProviderPlugin } from "../plugins/provider"; import { createHelpers } from "../generators/create-helpers"; const defaultOpts: TSBuilderOptions = { @@ -90,6 +91,7 @@ export class TSBuilder { outPath: string; options?: TSBuilderOptions; plugins: IBuilderPlugin[] = []; + builderContext: BuilderContext = new BuilderContext(); protected files: BuilderFile[] = []; @@ -101,6 +103,7 @@ export class TSBuilder { new ReactQueryPlugin(this.options), new RecoilPlugin(this.options), new MsgBuilderPlugin(this.options), + new ContractsContextProviderPlugin(this.options), ]); } @@ -120,6 +123,8 @@ export class TSBuilder { if (plugins && plugins.length) { [].push.apply(this.plugins, plugins); } + + this.plugins.forEach(plugin=> plugin.setBuilder(this)) } async build() { diff --git a/packages/ts-codegen/src/plugins/client.ts b/packages/ts-codegen/src/plugins/client.ts index 049e6702..3b31dfec 100644 --- a/packages/ts-codegen/src/plugins/client.ts +++ b/packages/ts-codegen/src/plugins/client.ts @@ -11,12 +11,15 @@ import { import { BuilderFileType } from '../builder'; import { BuilderPluginBase } from './plugin-base'; +export const TYPE = 'client'; +export const QUERY_CLIENT_TYPE = 'queryClient'; + export class ClientPlugin extends BuilderPluginBase { initContext( contract: ContractInfo, options?: RenderOptions ): RenderContextBase { - return new RenderContext(contract, options); + return new RenderContext(contract, options, this.builder.builderContext); } async doRender( @@ -62,6 +65,8 @@ export class ClientPlugin extends BuilderPluginBase { body.push( w.createQueryClass(context, QueryClient, ReadOnlyInstance, QueryMsg) ); + + context.addProviderInfo(QUERY_CLIENT_TYPE, QueryClient, localname) } // execute messages @@ -89,6 +94,8 @@ export class ClientPlugin extends BuilderPluginBase { ExecuteMsg ) ); + + context.addProviderInfo(TYPE, Client, localname) } } @@ -99,7 +106,7 @@ export class ClientPlugin extends BuilderPluginBase { return [ { - type: 'client', + type: TYPE, localname, body } diff --git a/packages/ts-codegen/src/plugins/message-composer.ts b/packages/ts-codegen/src/plugins/message-composer.ts index 6c6caa40..3326181a 100644 --- a/packages/ts-codegen/src/plugins/message-composer.ts +++ b/packages/ts-codegen/src/plugins/message-composer.ts @@ -12,12 +12,14 @@ import { import { BuilderFileType } from '../builder'; import { BuilderPluginBase } from './plugin-base'; +export const TYPE = 'message-composer'; + export class MessageComposerPlugin extends BuilderPluginBase { initContext( contract: ContractInfo, options?: RenderOptions ): RenderContextBase { - return new RenderContext(contract, options); + return new RenderContext(contract, options, this.builder.builderContext); } async doRender( @@ -61,6 +63,8 @@ export class MessageComposerPlugin extends BuilderPluginBase { body.push( w.createMessageComposerClass(context, TheClass, Interface, ExecuteMsg) ); + + context.addProviderInfo(TYPE, TheClass, localname) } } @@ -71,7 +75,7 @@ export class MessageComposerPlugin extends BuilderPluginBase { return [ { - type: 'message-composer', + type: TYPE, localname, body } diff --git a/packages/ts-codegen/src/plugins/msg-builder.ts b/packages/ts-codegen/src/plugins/msg-builder.ts index 918a3ad3..4222fe65 100644 --- a/packages/ts-codegen/src/plugins/msg-builder.ts +++ b/packages/ts-codegen/src/plugins/msg-builder.ts @@ -16,7 +16,7 @@ export class MsgBuilderPlugin extends BuilderPluginBase { contract: ContractInfo, options?: RenderOptions ): RenderContextBase { - return new RenderContext(contract, options); + return new RenderContext(contract, options, this.builder.builderContext); } async doRender( diff --git a/packages/ts-codegen/src/plugins/plugin-base.ts b/packages/ts-codegen/src/plugins/plugin-base.ts index c1dd4e58..21d54db3 100644 --- a/packages/ts-codegen/src/plugins/plugin-base.ts +++ b/packages/ts-codegen/src/plugins/plugin-base.ts @@ -1,15 +1,16 @@ -import { sync as mkdirp } from 'mkdirp'; -import { join } from 'path'; -import { writeFileSync } from 'fs'; -import { header } from '../utils/header'; +import { sync as mkdirp } from "mkdirp"; +import { join } from "path"; +import { writeFileSync } from "fs"; +import { header } from "../utils/header"; +import { ContractInfo, UtilMapping, IContext } from "wasm-ast-types"; +import generate from "@babel/generator"; +import * as t from "@babel/types"; import { - ContractInfo, - UtilMapping, - IContext -} from 'wasm-ast-types'; -import generate from '@babel/generator'; -import * as t from '@babel/types'; -import { BuilderFile, BuilderFileType, TSBuilderOptions } from '../builder'; + BuilderFile, + BuilderFileType, + TSBuilder, + TSBuilderOptions, +} from "../builder"; /** * IBuilderPlugin is a common plugin that render generated code. @@ -20,6 +21,10 @@ export interface IBuilderPlugin { */ utils: UtilMapping; + builder?: TSBuilder; + + setBuilder(builder: TSBuilder); + /** * render generated cdoe. * @param name the name of contract @@ -30,19 +35,27 @@ export interface IBuilderPlugin { render( name: string, contractInfo: ContractInfo, - outPath: string, + outPath: string ): Promise; } /** * BuilderPluginBase enable ts-codegen users implement their own plugins by only implement a few functions. */ -export abstract class BuilderPluginBase implements IBuilderPlugin { +export abstract class BuilderPluginBase + implements IBuilderPlugin +{ + builder?: TSBuilder; option: TOpt; utils: UtilMapping; - constructor(opt: TOpt) { + constructor(opt: TOpt, builder?: TSBuilder) { this.option = opt; + this.builder = builder; + } + + setBuilder(builder: TSBuilder) { + this.builder = builder; } async render( @@ -65,7 +78,7 @@ export abstract class BuilderPluginBase impl } return results.map((result) => { - const imports = context.getImports(this.utils); + const imports = context.getImports(this.utils, result.localname); const code = header + generate(t.program([...imports, ...result.body])).code; @@ -78,7 +91,7 @@ export abstract class BuilderPluginBase impl pluginType: result.pluginType, contract: name, localname: result.localname, - filename + filename, }; }); } @@ -88,10 +101,7 @@ export abstract class BuilderPluginBase impl * @param contract * @param options */ - abstract initContext( - contract: ContractInfo, - options?: TOpt - ): IContext; + abstract initContext(contract: ContractInfo, options?: TOpt): IContext; /** * render generated code here. diff --git a/packages/ts-codegen/src/plugins/provider.ts b/packages/ts-codegen/src/plugins/provider.ts new file mode 100644 index 00000000..076ee7cb --- /dev/null +++ b/packages/ts-codegen/src/plugins/provider.ts @@ -0,0 +1,111 @@ +import { pascal } from "case"; +import * as w from "wasm-ast-types"; +import { findAndParseTypes, findExecuteMsg } from "../utils"; +import { + getMessageProperties, + ContractInfo, + RenderContextBase, + RenderContext, + RenderOptions, +} from "wasm-ast-types"; +import { BuilderFileType, TSBuilder, TSBuilderOptions } from "../builder"; +import { BuilderPluginBase } from "./plugin-base"; +import { TYPE as SIGN_CLIENT_TYPE, QUERY_CLIENT_TYPE } from "./client"; +import { TYPE as MESSAGE_COMPOSER_TYPE } from "./message-composer"; + +export class ContractsContextProviderPlugin extends BuilderPluginBase { + constructor(opt: TSBuilderOptions) { + super(opt); + + this.utils = { + ContractBase: "__contractContextBase__", + IContractConstructor: "__contractContextBase__", + getSigningClientDefault: "__contractContextBase__", + getQueryClientDefault: "__contractContextBase__", + getMessageComposerDefault: "__contractContextBase__", + }; + } + + initContext( + contract: ContractInfo, + options?: TSBuilderOptions + ): RenderContextBase { + return new RenderContext(contract, options, this.builder.builderContext); + } + + async doRender( + name: string, + context: RenderContext + ): Promise< + { + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[] + > { + if (!this.option?.useContracts?.enabled) { + return; + } + + if (!Object.keys(context.getProviderInfos())?.length) { + return; + } + + context.addUtil("ContractBase"); + const localname = pascal(name) + ".provider.ts"; + + const body = []; + + const signClientProviderInfo = context.getProviderInfos()[SIGN_CLIENT_TYPE]; + + if (signClientProviderInfo) { + context.addUtil("getSigningClientDefault"); + + body.push( + w.importStmt( + [signClientProviderInfo.classname], + `./${signClientProviderInfo.filename}` + ) + ); + } + + const queryClientProviderInfo = + context.getProviderInfos()[QUERY_CLIENT_TYPE]; + + if (queryClientProviderInfo) { + context.addUtil("getQueryClientDefault"); + + body.push( + w.importStmt( + [queryClientProviderInfo.classname], + `./${queryClientProviderInfo.filename}` + ) + ); + } + + const messageComposerProviderInfo = + context.getProviderInfos()[MESSAGE_COMPOSER_TYPE]; + + if (messageComposerProviderInfo) { + context.addUtil("getMessageComposerDefault"); + + body.push( + w.importStmt( + [messageComposerProviderInfo.classname], + `./${messageComposerProviderInfo.filename}` + ) + ); + } + + body.push(w.createProvider(name)); + + return [ + { + type: "plugin", + localname, + body, + }, + ]; + } +} diff --git a/packages/ts-codegen/src/plugins/react-query.ts b/packages/ts-codegen/src/plugins/react-query.ts index 67585351..1e7de832 100644 --- a/packages/ts-codegen/src/plugins/react-query.ts +++ b/packages/ts-codegen/src/plugins/react-query.ts @@ -16,7 +16,7 @@ export class ReactQueryPlugin extends BuilderPluginBase { contract: ContractInfo, options?: RenderOptions ): RenderContextBase { - return new RenderContext(contract, options); + return new RenderContext(contract, options, this.builder.builderContext); } async doRender( diff --git a/packages/ts-codegen/src/plugins/recoil.ts b/packages/ts-codegen/src/plugins/recoil.ts index cb1803fa..17b29164 100644 --- a/packages/ts-codegen/src/plugins/recoil.ts +++ b/packages/ts-codegen/src/plugins/recoil.ts @@ -19,7 +19,7 @@ export class RecoilPlugin extends BuilderPluginBase { contract: ContractInfo, options?: RenderOptions ): RenderContextBase { - return new RenderContext(contract, options); + return new RenderContext(contract, options, this.builder.builderContext); } async doRender( diff --git a/packages/ts-codegen/src/plugins/types.ts b/packages/ts-codegen/src/plugins/types.ts index cfb74844..f904c70e 100644 --- a/packages/ts-codegen/src/plugins/types.ts +++ b/packages/ts-codegen/src/plugins/types.ts @@ -16,7 +16,7 @@ export class TypesPlugin extends BuilderPluginBase { contract: ContractInfo, options?: RenderOptions ): RenderContextBase { - return new RenderContext(contract, options); + return new RenderContext(contract, options, this.builder.builderContext); } async doRender( diff --git a/packages/ts-codegen/src/plugins/use-contracts.ts b/packages/ts-codegen/src/plugins/use-contracts.ts index 6f5a0bee..7310a26a 100644 --- a/packages/ts-codegen/src/plugins/use-contracts.ts +++ b/packages/ts-codegen/src/plugins/use-contracts.ts @@ -43,7 +43,7 @@ export class ContractsContextPlugin extends BuilderPluginBase // const ExecuteMsg = findExecuteMsg(schemas); // const typeHash = await findAndParseTypes(schemas); - // const body = []; + const body = []; // body.push(w.importStmt(Object.keys(typeHash), `./${TypesFile}`)); diff --git a/packages/ts-codegen/types/src/builder/builder.d.ts b/packages/ts-codegen/types/src/builder/builder.d.ts index e9aeb6db..9c7e48b8 100644 --- a/packages/ts-codegen/types/src/builder/builder.d.ts +++ b/packages/ts-codegen/types/src/builder/builder.d.ts @@ -1,4 +1,4 @@ -import { RenderOptions } from "wasm-ast-types"; +import { RenderOptions, BuilderContext } from "wasm-ast-types"; import { IBuilderPlugin } from '../plugins'; export interface TSBuilderInput { contracts: Array; @@ -37,6 +37,7 @@ export declare class TSBuilder { outPath: string; options?: TSBuilderOptions; plugins: IBuilderPlugin[]; + builderContext: BuilderContext; protected files: BuilderFile[]; loadDefaultPlugins(): void; constructor({ contracts, outPath, options, plugins }: TSBuilderInput); diff --git a/packages/ts-codegen/types/src/generators/create-helpers.d.ts b/packages/ts-codegen/types/src/generators/create-helpers.d.ts index a09345d0..f1d28914 100644 --- a/packages/ts-codegen/types/src/generators/create-helpers.d.ts +++ b/packages/ts-codegen/types/src/generators/create-helpers.d.ts @@ -1,2 +1,2 @@ -import { TSBuilderInput } from '../builder'; +import { TSBuilderInput } from "../builder"; export declare const createHelpers: (input: TSBuilderInput) => void; diff --git a/packages/ts-codegen/types/src/plugins/client.d.ts b/packages/ts-codegen/types/src/plugins/client.d.ts index 43e278b5..09eed64d 100644 --- a/packages/ts-codegen/types/src/plugins/client.d.ts +++ b/packages/ts-codegen/types/src/plugins/client.d.ts @@ -1,6 +1,8 @@ import { RenderContext, ContractInfo, RenderContextBase, RenderOptions } from 'wasm-ast-types'; import { BuilderFileType } from '../builder'; import { BuilderPluginBase } from './plugin-base'; +export declare const TYPE = "client"; +export declare const QUERY_CLIENT_TYPE = "queryClient"; export declare class ClientPlugin extends BuilderPluginBase { initContext(contract: ContractInfo, options?: RenderOptions): RenderContextBase; doRender(name: string, context: RenderContext): Promise<{ diff --git a/packages/ts-codegen/types/src/plugins/message-composer.d.ts b/packages/ts-codegen/types/src/plugins/message-composer.d.ts index 80f98965..77bdb05f 100644 --- a/packages/ts-codegen/types/src/plugins/message-composer.d.ts +++ b/packages/ts-codegen/types/src/plugins/message-composer.d.ts @@ -1,6 +1,7 @@ import { ContractInfo, RenderContextBase, RenderContext, RenderOptions } from 'wasm-ast-types'; import { BuilderFileType } from '../builder'; import { BuilderPluginBase } from './plugin-base'; +export declare const TYPE = "message-composer"; export declare class MessageComposerPlugin extends BuilderPluginBase { initContext(contract: ContractInfo, options?: RenderOptions): RenderContextBase; doRender(name: string, context: RenderContext): Promise<{ diff --git a/packages/ts-codegen/types/src/plugins/plugin-base.d.ts b/packages/ts-codegen/types/src/plugins/plugin-base.d.ts index efa14960..742356f8 100644 --- a/packages/ts-codegen/types/src/plugins/plugin-base.d.ts +++ b/packages/ts-codegen/types/src/plugins/plugin-base.d.ts @@ -1,5 +1,5 @@ -import { ContractInfo, UtilMapping, IContext } from 'wasm-ast-types'; -import { BuilderFile, BuilderFileType } from '../builder'; +import { ContractInfo, UtilMapping, IContext } from "wasm-ast-types"; +import { BuilderFile, BuilderFileType, TSBuilder } from "../builder"; /** * IBuilderPlugin is a common plugin that render generated code. */ @@ -8,6 +8,8 @@ export interface IBuilderPlugin { * a mapping of utils will be used in generated code. */ utils: UtilMapping; + builder?: TSBuilder; + setBuilder(builder: TSBuilder): any; /** * render generated cdoe. * @param name the name of contract @@ -23,9 +25,11 @@ export interface IBuilderPlugin { export declare abstract class BuilderPluginBase implements IBuilderPlugin { + builder?: TSBuilder; option: TOpt; utils: UtilMapping; - constructor(opt: TOpt); + constructor(opt: TOpt, builder?: TSBuilder); + setBuilder(builder: TSBuilder): void; render(name: string, contractInfo: ContractInfo, outPath: string): Promise; /** * init context here diff --git a/packages/ts-codegen/types/src/plugins/provider.d.ts b/packages/ts-codegen/types/src/plugins/provider.d.ts new file mode 100644 index 00000000..cecb56d0 --- /dev/null +++ b/packages/ts-codegen/types/src/plugins/provider.d.ts @@ -0,0 +1,13 @@ +import { ContractInfo, RenderContextBase, RenderContext } from "wasm-ast-types"; +import { BuilderFileType, TSBuilderOptions } from "../builder"; +import { BuilderPluginBase } from "./plugin-base"; +export declare class ContractsContextProviderPlugin extends BuilderPluginBase { + constructor(opt: TSBuilderOptions); + initContext(contract: ContractInfo, options?: TSBuilderOptions): RenderContextBase; + doRender(name: string, context: RenderContext): Promise<{ + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[]>; +} diff --git a/packages/wasm-ast-types/src/context/context.ts b/packages/wasm-ast-types/src/context/context.ts index 95c7831c..5911ca1b 100644 --- a/packages/wasm-ast-types/src/context/context.ts +++ b/packages/wasm-ast-types/src/context/context.ts @@ -67,16 +67,25 @@ export interface RenderOptions { reactQuery?: ReactQueryOptions; } +export interface ProviderInfo{ + classname: string, + filename: string, +} export interface IContext { refLookup($ref: string); addUtil(util: string); - getImports(registeredUtils?: UtilMapping); + getImports(registeredUtils?: UtilMapping, filepath?: string); } export interface IRenderContext extends IContext { contract: ContractInfo; options: TOpt; + + addProviderInfo(type: string, classname: string, filename: string): void; + getProviderInfos(): { + [key: string]: ProviderInfo; + }; } export const defaultOptions: RenderOptions = { @@ -127,23 +136,40 @@ export const getDefinitionSchema = (schemas: JSONSchema[]): JSONSchema => { return aggregateSchema; }; +export class BuilderContext{ + providers:{ + [key: string]: ProviderInfo; + } = {}; + + addProviderInfo(type: string, classname: string, filename: string): void { + this.providers[type] = { + classname, + filename + }; + } +} + /** * context object for generating code. * only mergeDefaultOpt needs to implementing for combine options and default options. * @param TOpt option type */ export abstract class RenderContextBase implements IRenderContext { + builderContext: BuilderContext; contract: ContractInfo; utils: string[] = []; schema: JSONSchema; options: TOpt; + constructor( contract: ContractInfo, - options?: TOpt + options?: TOpt, + builderContext?: BuilderContext ) { this.contract = contract; this.schema = getDefinitionSchema(contract.schemas); this.options = this.mergeDefaultOpt(options); + this.builderContext = builderContext; } /** * merge options and default options @@ -156,6 +182,12 @@ export abstract class RenderContextBase implements IRender addUtil(util: string) { this.utils[util] = true; } + addProviderInfo(type: string, classname: string, filename: string): void { + this.builderContext.addProviderInfo(type, classname, filename); + } + getProviderInfos(): { [key: string]: ProviderInfo; } { + return this.builderContext.providers; + } getImports(registeredUtils?: UtilMapping, filepath?: string) { return getImportStatements( convertUtilsToImportList( diff --git a/packages/wasm-ast-types/src/index.ts b/packages/wasm-ast-types/src/index.ts index 9c493b78..86db1e42 100644 --- a/packages/wasm-ast-types/src/index.ts +++ b/packages/wasm-ast-types/src/index.ts @@ -6,3 +6,4 @@ export * from './message-composer'; export * from './react-query'; export * from './types'; export * from './msg-builder'; +export * from './provider'; diff --git a/packages/wasm-ast-types/src/provider/index.ts b/packages/wasm-ast-types/src/provider/index.ts new file mode 100644 index 00000000..0a8c7e17 --- /dev/null +++ b/packages/wasm-ast-types/src/provider/index.ts @@ -0,0 +1 @@ +export * from './provider'; \ No newline at end of file diff --git a/packages/wasm-ast-types/src/provider/provider.ts b/packages/wasm-ast-types/src/provider/provider.ts new file mode 100644 index 00000000..4f503cdb --- /dev/null +++ b/packages/wasm-ast-types/src/provider/provider.ts @@ -0,0 +1,51 @@ +import * as t from "@babel/types"; +import { pascal } from "case"; + +export const createProvider = (name: string) => { + return t.exportNamedDeclaration( + t.classDeclaration( + t.identifier(pascal(name)), + t.identifier("ContractBase"), + t.classBody([ + t.classMethod( + "constructor", + t.identifier("constructor"), + [ + t.objectPattern([ + t.objectProperty( + t.identifier("address"), + t.identifier("address"), + false, + true + ), + t.objectProperty( + t.identifier("cosmWasmClient"), + t.identifier("cosmWasmClient"), + false, + true + ), + t.objectProperty( + t.identifier("signingCosmWasmClient"), + t.identifier("signingCosmWasmClient"), + false, + true + ), + ]), + ], + t.blockStatement( + [ + t.expressionStatement( + t.callExpression(t.super(), [ + t.identifier("address"), + t.identifier("cosmWasmClient"), + t.identifier("signingCosmWasmClient"), + ]) + ), + ], + [] + ) + ), + ]) + ) + ); +}; diff --git a/packages/wasm-ast-types/src/react-query/react-query.ts b/packages/wasm-ast-types/src/react-query/react-query.ts index 655c1349..3a0d50c1 100644 --- a/packages/wasm-ast-types/src/react-query/react-query.ts +++ b/packages/wasm-ast-types/src/react-query/react-query.ts @@ -429,9 +429,9 @@ export const createReactQueryMutationArgsInterface = ({ t.tsTypeAnnotation( // @ts-ignore:next-line t.tsTypeLiteral([ - propertySignature('fee', OPTIONAL_FEE_PARAM.typeAnnotation, true), - propertySignature('memo', OPTIONAL_MEMO_PARAM.typeAnnotation, true), - propertySignature('funds', OPTIONAL_FUNDS_PARAM.typeAnnotation, true) + propertySignature('fee', OPTIONAL_FEE_PARAM.typeAnnotation as t.TSTypeAnnotation, true), + propertySignature('memo', OPTIONAL_MEMO_PARAM.typeAnnotation as t.TSTypeAnnotation, true), + propertySignature('funds', OPTIONAL_FUNDS_PARAM.typeAnnotation as t.TSTypeAnnotation, true) ]) ) ); diff --git a/packages/wasm-ast-types/types/context/context.d.ts b/packages/wasm-ast-types/types/context/context.d.ts index e6635246..bb42a815 100644 --- a/packages/wasm-ast-types/types/context/context.d.ts +++ b/packages/wasm-ast-types/types/context/context.d.ts @@ -56,28 +56,43 @@ export interface RenderOptions { client?: TSClientOptions; reactQuery?: ReactQueryOptions; } +export interface ProviderInfo { + classname: string; + filename: string; +} export interface IContext { refLookup($ref: string): any; addUtil(util: string): any; - getImports(registeredUtils?: UtilMapping): any; + getImports(registeredUtils?: UtilMapping, filepath?: string): any; } export interface IRenderContext extends IContext { contract: ContractInfo; options: TOpt; + addProviderInfo(type: string, classname: string, filename: string): void; + getProviderInfos(): { + [key: string]: ProviderInfo; + }; } export declare const defaultOptions: RenderOptions; export declare const getDefinitionSchema: (schemas: JSONSchema[]) => JSONSchema; +export declare class BuilderContext { + providers: { + [key: string]: ProviderInfo; + }; + addProviderInfo(type: string, classname: string, filename: string): void; +} /** * context object for generating code. * only mergeDefaultOpt needs to implementing for combine options and default options. * @param TOpt option type */ export declare abstract class RenderContextBase implements IRenderContext { + builderContext: BuilderContext; contract: ContractInfo; utils: string[]; schema: JSONSchema; options: TOpt; - constructor(contract: ContractInfo, options?: TOpt); + constructor(contract: ContractInfo, options?: TOpt, builderContext?: BuilderContext); /** * merge options and default options * @param options @@ -85,6 +100,10 @@ export declare abstract class RenderContextBase implements abstract mergeDefaultOpt(options: TOpt): TOpt; refLookup($ref: string): JSONSchema; addUtil(util: string): void; + addProviderInfo(type: string, classname: string, filename: string): void; + getProviderInfos(): { + [key: string]: ProviderInfo; + }; getImports(registeredUtils?: UtilMapping, filepath?: string): any; } export declare class RenderContext extends RenderContextBase { diff --git a/packages/wasm-ast-types/types/index.d.ts b/packages/wasm-ast-types/types/index.d.ts index 9c493b78..86db1e42 100644 --- a/packages/wasm-ast-types/types/index.d.ts +++ b/packages/wasm-ast-types/types/index.d.ts @@ -6,3 +6,4 @@ export * from './message-composer'; export * from './react-query'; export * from './types'; export * from './msg-builder'; +export * from './provider'; diff --git a/packages/wasm-ast-types/types/provider/index.d.ts b/packages/wasm-ast-types/types/provider/index.d.ts new file mode 100644 index 00000000..03be03e5 --- /dev/null +++ b/packages/wasm-ast-types/types/provider/index.d.ts @@ -0,0 +1 @@ +export * from './provider'; diff --git a/packages/wasm-ast-types/types/provider/provider.d.ts b/packages/wasm-ast-types/types/provider/provider.d.ts new file mode 100644 index 00000000..07b77daa --- /dev/null +++ b/packages/wasm-ast-types/types/provider/provider.d.ts @@ -0,0 +1,2 @@ +import * as t from "@babel/types"; +export declare const createProvider: (name: string) => t.ExportNamedDeclaration; From 6fd2353cd81153b8692e9f0ee62cbe3a23f1ff08 Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Wed, 12 Jul 2023 22:12:22 +0800 Subject: [PATCH 125/287] finished provider classes --- .../contracts/CwAdminFactory.provider.ts | 22 +++-- .../contracts/CwCodeIdRegistry.provider.ts | 22 +++-- .../contracts/CwSingle.provider.ts | 22 +++-- .../contracts/Factory.provider.ts | 22 +++-- .../bundler_test/contracts/Minter.provider.ts | 22 +++-- .../__snapshots__/builder.test.ts.snap | 2 + packages/ts-codegen/src/plugins/provider.ts | 31 ++++++- .../wasm-ast-types/src/context/context.ts | 5 +- .../wasm-ast-types/src/provider/provider.ts | 86 ++++++++++++------- .../wasm-ast-types/types/context/context.d.ts | 1 + .../types/provider/provider.d.ts | 3 +- 11 files changed, 176 insertions(+), 62 deletions(-) diff --git a/__output__/builder/bundler_test/contracts/CwAdminFactory.provider.ts b/__output__/builder/bundler_test/contracts/CwAdminFactory.provider.ts index 7aac8f72..54b4773a 100644 --- a/__output__/builder/bundler_test/contracts/CwAdminFactory.provider.ts +++ b/__output__/builder/bundler_test/contracts/CwAdminFactory.provider.ts @@ -4,17 +4,29 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { ContractBase, getSigningClientDefault, getQueryClientDefault, getMessageComposerDefault } from "./contractContextBase"; -import { CwAdminFactoryClient } from "./CwAdminFactory.client.ts"; -import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client.ts"; -import { CwAdminFactoryMessageComposer } from "./CwAdminFactory.message-composer.ts"; +import { ContractBase, IContractConstructor, getSigningClientDefault, getQueryClientDefault, getMessageComposerDefault } from "./contractContextBase"; +import { CwAdminFactoryClient } from "./CwAdminFactory.client"; +import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; +import { CwAdminFactoryMessageComposer } from "./CwAdminFactory.message-composer"; export class CwAdminFactory extends ContractBase { constructor({ address, cosmWasmClient, signingCosmWasmClient - }) { + }: IContractConstructor) { super(address, cosmWasmClient, signingCosmWasmClient); } + getSigningClient(contractAddr) { + return getSigningClientDefault(this, contractAddr, CwAdminFactoryClient); + } + + getQueryClient(contractAddr) { + return getQueryClientDefault(this, contractAddr, CwAdminFactoryQueryClient); + } + + getMessageComposer(contractAddr) { + return getMessageComposerDefault(this, contractAddr, CwAdminFactoryMessageComposer); + } + } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.provider.ts b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.provider.ts index 5d9e6b95..35d2fc9c 100644 --- a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.provider.ts +++ b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.provider.ts @@ -4,17 +4,29 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { ContractBase, getSigningClientDefault, getQueryClientDefault, getMessageComposerDefault } from "./contractContextBase"; -import { CwCodeIdRegistryClient } from "./CwCodeIdRegistry.client.ts"; -import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client.ts"; -import { CwCodeIdRegistryMessageComposer } from "./CwCodeIdRegistry.message-composer.ts"; +import { ContractBase, IContractConstructor, getSigningClientDefault, getQueryClientDefault, getMessageComposerDefault } from "./contractContextBase"; +import { CwCodeIdRegistryClient } from "./CwCodeIdRegistry.client"; +import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; +import { CwCodeIdRegistryMessageComposer } from "./CwCodeIdRegistry.message-composer"; export class CwCodeIdRegistry extends ContractBase { constructor({ address, cosmWasmClient, signingCosmWasmClient - }) { + }: IContractConstructor) { super(address, cosmWasmClient, signingCosmWasmClient); } + getSigningClient(contractAddr) { + return getSigningClientDefault(this, contractAddr, CwCodeIdRegistryClient); + } + + getQueryClient(contractAddr) { + return getQueryClientDefault(this, contractAddr, CwCodeIdRegistryQueryClient); + } + + getMessageComposer(contractAddr) { + return getMessageComposerDefault(this, contractAddr, CwCodeIdRegistryMessageComposer); + } + } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwSingle.provider.ts b/__output__/builder/bundler_test/contracts/CwSingle.provider.ts index f5c349a5..fef6270d 100644 --- a/__output__/builder/bundler_test/contracts/CwSingle.provider.ts +++ b/__output__/builder/bundler_test/contracts/CwSingle.provider.ts @@ -4,17 +4,29 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { ContractBase, getSigningClientDefault, getQueryClientDefault, getMessageComposerDefault } from "./contractContextBase"; -import { CwSingleClient } from "./CwSingle.client.ts"; -import { CwSingleQueryClient } from "./CwSingle.client.ts"; -import { CwSingleMessageComposer } from "./CwSingle.message-composer.ts"; +import { ContractBase, IContractConstructor, getSigningClientDefault, getQueryClientDefault, getMessageComposerDefault } from "./contractContextBase"; +import { CwSingleClient } from "./CwSingle.client"; +import { CwSingleQueryClient } from "./CwSingle.client"; +import { CwSingleMessageComposer } from "./CwSingle.message-composer"; export class CwSingle extends ContractBase { constructor({ address, cosmWasmClient, signingCosmWasmClient - }) { + }: IContractConstructor) { super(address, cosmWasmClient, signingCosmWasmClient); } + getSigningClient(contractAddr) { + return getSigningClientDefault(this, contractAddr, CwSingleClient); + } + + getQueryClient(contractAddr) { + return getQueryClientDefault(this, contractAddr, CwSingleQueryClient); + } + + getMessageComposer(contractAddr) { + return getMessageComposerDefault(this, contractAddr, CwSingleMessageComposer); + } + } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Factory.provider.ts b/__output__/builder/bundler_test/contracts/Factory.provider.ts index f63a1ebb..c53c1d12 100644 --- a/__output__/builder/bundler_test/contracts/Factory.provider.ts +++ b/__output__/builder/bundler_test/contracts/Factory.provider.ts @@ -4,17 +4,29 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { ContractBase, getSigningClientDefault, getQueryClientDefault, getMessageComposerDefault } from "./contractContextBase"; -import { FactoryClient } from "./Factory.client.ts"; -import { FactoryQueryClient } from "./Factory.client.ts"; -import { FactoryMessageComposer } from "./Factory.message-composer.ts"; +import { ContractBase, IContractConstructor, getSigningClientDefault, getQueryClientDefault, getMessageComposerDefault } from "./contractContextBase"; +import { FactoryClient } from "./Factory.client"; +import { FactoryQueryClient } from "./Factory.client"; +import { FactoryMessageComposer } from "./Factory.message-composer"; export class Factory extends ContractBase { constructor({ address, cosmWasmClient, signingCosmWasmClient - }) { + }: IContractConstructor) { super(address, cosmWasmClient, signingCosmWasmClient); } + getSigningClient(contractAddr) { + return getSigningClientDefault(this, contractAddr, FactoryClient); + } + + getQueryClient(contractAddr) { + return getQueryClientDefault(this, contractAddr, FactoryQueryClient); + } + + getMessageComposer(contractAddr) { + return getMessageComposerDefault(this, contractAddr, FactoryMessageComposer); + } + } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Minter.provider.ts b/__output__/builder/bundler_test/contracts/Minter.provider.ts index 118e73bd..4a5ac4c5 100644 --- a/__output__/builder/bundler_test/contracts/Minter.provider.ts +++ b/__output__/builder/bundler_test/contracts/Minter.provider.ts @@ -4,17 +4,29 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { ContractBase, getSigningClientDefault, getQueryClientDefault, getMessageComposerDefault } from "./contractContextBase"; -import { MinterClient } from "./Minter.client.ts"; -import { MinterQueryClient } from "./Minter.client.ts"; -import { MinterMessageComposer } from "./Minter.message-composer.ts"; +import { ContractBase, IContractConstructor, getSigningClientDefault, getQueryClientDefault, getMessageComposerDefault } from "./contractContextBase"; +import { MinterClient } from "./Minter.client"; +import { MinterQueryClient } from "./Minter.client"; +import { MinterMessageComposer } from "./Minter.message-composer"; export class Minter extends ContractBase { constructor({ address, cosmWasmClient, signingCosmWasmClient - }) { + }: IContractConstructor) { super(address, cosmWasmClient, signingCosmWasmClient); } + getSigningClient(contractAddr) { + return getSigningClientDefault(this, contractAddr, MinterClient); + } + + getQueryClient(contractAddr) { + return getQueryClientDefault(this, contractAddr, MinterQueryClient); + } + + getMessageComposer(contractAddr) { + return getMessageComposerDefault(this, contractAddr, MinterMessageComposer); + } + } \ No newline at end of file diff --git a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap index d52d4370..7e653137 100644 --- a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap +++ b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap @@ -309,6 +309,7 @@ TSBuilder { }, "utils": Object { "ContractBase": "__contractContextBase__", + "IContractConstructor": "__contractContextBase__", "getMessageComposerDefault": "__contractContextBase__", "getQueryClientDefault": "__contractContextBase__", "getSigningClientDefault": "__contractContextBase__", @@ -627,6 +628,7 @@ TSBuilder { }, "utils": Object { "ContractBase": "__contractContextBase__", + "IContractConstructor": "__contractContextBase__", "getMessageComposerDefault": "__contractContextBase__", "getQueryClientDefault": "__contractContextBase__", "getSigningClientDefault": "__contractContextBase__", diff --git a/packages/ts-codegen/src/plugins/provider.ts b/packages/ts-codegen/src/plugins/provider.ts index 076ee7cb..540555db 100644 --- a/packages/ts-codegen/src/plugins/provider.ts +++ b/packages/ts-codegen/src/plugins/provider.ts @@ -53,9 +53,11 @@ export class ContractsContextProviderPlugin extends BuilderPluginBase { +export const createProvider = (name: string, methods: t.ClassMethod[]) => { return t.exportNamedDeclaration( t.classDeclaration( t.identifier(pascal(name)), @@ -11,41 +12,64 @@ export const createProvider = (name: string) => { "constructor", t.identifier("constructor"), [ - t.objectPattern([ - t.objectProperty( - t.identifier("address"), - t.identifier("address"), - false, - true - ), - t.objectProperty( - t.identifier("cosmWasmClient"), - t.identifier("cosmWasmClient"), - false, - true - ), - t.objectProperty( - t.identifier("signingCosmWasmClient"), - t.identifier("signingCosmWasmClient"), - false, - true - ), - ]), - ], - t.blockStatement( - [ - t.expressionStatement( - t.callExpression(t.super(), [ + tsObjectPattern( + [ + t.objectProperty( t.identifier("address"), + t.identifier("address"), + false, + true + ), + t.objectProperty( + t.identifier("cosmWasmClient"), t.identifier("cosmWasmClient"), + false, + true + ), + t.objectProperty( t.identifier("signingCosmWasmClient"), - ]) - ), - ], - [] - ) + t.identifier("signingCosmWasmClient"), + false, + true + ), + ], + t.tsTypeAnnotation( + t.tsTypeReference(t.identifier("IContractConstructor")) + ) + ), + ], + t.blockStatement([ + t.expressionStatement( + t.callExpression(t.super(), [ + t.identifier("address"), + t.identifier("cosmWasmClient"), + t.identifier("signingCosmWasmClient"), + ]) + ), + ]) ), + ...methods, ]) ) ); }; + +export const createProviderFunction = ( + functionName: string, + classname: string +) => { + return t.classMethod( + "method", + t.identifier(`get${functionName}`), + [t.identifier("contractAddr")], + t.blockStatement([ + t.returnStatement( + t.callExpression(t.identifier(`get${functionName}Default`), [ + t.thisExpression(), + t.identifier("contractAddr"), + t.identifier(classname), + ]) + ), + ]) + ); +}; diff --git a/packages/wasm-ast-types/types/context/context.d.ts b/packages/wasm-ast-types/types/context/context.d.ts index bb42a815..5251e2e8 100644 --- a/packages/wasm-ast-types/types/context/context.d.ts +++ b/packages/wasm-ast-types/types/context/context.d.ts @@ -59,6 +59,7 @@ export interface RenderOptions { export interface ProviderInfo { classname: string; filename: string; + basename: string; } export interface IContext { refLookup($ref: string): any; diff --git a/packages/wasm-ast-types/types/provider/provider.d.ts b/packages/wasm-ast-types/types/provider/provider.d.ts index 07b77daa..cef648c8 100644 --- a/packages/wasm-ast-types/types/provider/provider.d.ts +++ b/packages/wasm-ast-types/types/provider/provider.d.ts @@ -1,2 +1,3 @@ import * as t from "@babel/types"; -export declare const createProvider: (name: string) => t.ExportNamedDeclaration; +export declare const createProvider: (name: string, methods: t.ClassMethod[]) => t.ExportNamedDeclaration; +export declare const createProviderFunction: (functionName: string, classname: string) => t.ClassMethod; From b8c14ab45bb6c974fa042dd1971b042f631dbfc0 Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Thu, 13 Jul 2023 06:54:18 +0800 Subject: [PATCH 126/287] finished provider --- .../contracts/CwAdminFactory.provider.ts | 18 +-- .../contracts/CwCodeIdRegistry.provider.ts | 18 +-- .../contracts/CwSingle.provider.ts | 18 +-- .../contracts/Factory.provider.ts | 18 +-- .../bundler_test/contracts/Minter.provider.ts | 18 +-- .../contracts/contractContextBase.ts | 104 ++++++++---- .../contracts/contracts-context.tsx | 78 +++++++++ .../__snapshots__/builder.test.ts.snap | 8 +- .../src/generators/create-helpers.ts | 3 +- .../src/helpers/contractContextBase.ts | 106 +++++++----- .../src/helpers/contractsContextTSX.ts | 73 +++++++++ packages/ts-codegen/src/helpers/index.ts | 3 +- packages/ts-codegen/src/plugins/client.ts | 41 +++-- .../src/plugins/message-composer.ts | 33 ++-- packages/ts-codegen/src/plugins/provider.ts | 68 +++----- .../src/helpers/contractContextBase.d.ts | 2 +- .../src/helpers/contractsContextTSX.d.ts | 1 + .../ts-codegen/types/src/helpers/index.d.ts | 1 + .../ts-codegen/types/src/plugins/client.d.ts | 7 +- .../types/src/plugins/message-composer.d.ts | 6 +- .../wasm-ast-types/src/context/context.ts | 28 +++- .../__snapshots__/provider.spec.ts.snap | 27 ++++ .../src/provider/provider.spec.ts | 39 +++++ .../wasm-ast-types/src/provider/provider.ts | 152 ++++++++++-------- .../wasm-ast-types/src/utils/constants.ts | 6 + packages/wasm-ast-types/src/utils/index.ts | 1 + .../wasm-ast-types/types/context/context.d.ts | 18 ++- .../types/provider/provider.d.ts | 6 +- .../wasm-ast-types/types/utils/constants.d.ts | 5 + .../wasm-ast-types/types/utils/index.d.ts | 1 + 30 files changed, 590 insertions(+), 317 deletions(-) create mode 100644 __output__/builder/bundler_test/contracts/contracts-context.tsx create mode 100644 packages/ts-codegen/src/helpers/contractsContextTSX.ts create mode 100644 packages/ts-codegen/types/src/helpers/contractsContextTSX.d.ts create mode 100644 packages/wasm-ast-types/src/provider/__snapshots__/provider.spec.ts.snap create mode 100644 packages/wasm-ast-types/src/provider/provider.spec.ts diff --git a/__output__/builder/bundler_test/contracts/CwAdminFactory.provider.ts b/__output__/builder/bundler_test/contracts/CwAdminFactory.provider.ts index 54b4773a..f81eacdc 100644 --- a/__output__/builder/bundler_test/contracts/CwAdminFactory.provider.ts +++ b/__output__/builder/bundler_test/contracts/CwAdminFactory.provider.ts @@ -4,29 +4,17 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { ContractBase, IContractConstructor, getSigningClientDefault, getQueryClientDefault, getMessageComposerDefault } from "./contractContextBase"; +import { ContractBase, IContractConstructor } from "./contractContextBase"; import { CwAdminFactoryClient } from "./CwAdminFactory.client"; import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; import { CwAdminFactoryMessageComposer } from "./CwAdminFactory.message-composer"; -export class CwAdminFactory extends ContractBase { +export class CwAdminFactory extends ContractBase { constructor({ address, cosmWasmClient, signingCosmWasmClient }: IContractConstructor) { - super(address, cosmWasmClient, signingCosmWasmClient); - } - - getSigningClient(contractAddr) { - return getSigningClientDefault(this, contractAddr, CwAdminFactoryClient); - } - - getQueryClient(contractAddr) { - return getQueryClientDefault(this, contractAddr, CwAdminFactoryQueryClient); - } - - getMessageComposer(contractAddr) { - return getMessageComposerDefault(this, contractAddr, CwAdminFactoryMessageComposer); + super(address, cosmWasmClient, signingCosmWasmClient, CwAdminFactoryClient, CwAdminFactoryQueryClient, CwAdminFactoryMessageComposer); } } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.provider.ts b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.provider.ts index 35d2fc9c..8bd16da5 100644 --- a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.provider.ts +++ b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.provider.ts @@ -4,29 +4,17 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { ContractBase, IContractConstructor, getSigningClientDefault, getQueryClientDefault, getMessageComposerDefault } from "./contractContextBase"; +import { ContractBase, IContractConstructor } from "./contractContextBase"; import { CwCodeIdRegistryClient } from "./CwCodeIdRegistry.client"; import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; import { CwCodeIdRegistryMessageComposer } from "./CwCodeIdRegistry.message-composer"; -export class CwCodeIdRegistry extends ContractBase { +export class CwCodeIdRegistry extends ContractBase { constructor({ address, cosmWasmClient, signingCosmWasmClient }: IContractConstructor) { - super(address, cosmWasmClient, signingCosmWasmClient); - } - - getSigningClient(contractAddr) { - return getSigningClientDefault(this, contractAddr, CwCodeIdRegistryClient); - } - - getQueryClient(contractAddr) { - return getQueryClientDefault(this, contractAddr, CwCodeIdRegistryQueryClient); - } - - getMessageComposer(contractAddr) { - return getMessageComposerDefault(this, contractAddr, CwCodeIdRegistryMessageComposer); + super(address, cosmWasmClient, signingCosmWasmClient, CwCodeIdRegistryClient, CwCodeIdRegistryQueryClient, CwCodeIdRegistryMessageComposer); } } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwSingle.provider.ts b/__output__/builder/bundler_test/contracts/CwSingle.provider.ts index fef6270d..e1352be2 100644 --- a/__output__/builder/bundler_test/contracts/CwSingle.provider.ts +++ b/__output__/builder/bundler_test/contracts/CwSingle.provider.ts @@ -4,29 +4,17 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { ContractBase, IContractConstructor, getSigningClientDefault, getQueryClientDefault, getMessageComposerDefault } from "./contractContextBase"; +import { ContractBase, IContractConstructor } from "./contractContextBase"; import { CwSingleClient } from "./CwSingle.client"; import { CwSingleQueryClient } from "./CwSingle.client"; import { CwSingleMessageComposer } from "./CwSingle.message-composer"; -export class CwSingle extends ContractBase { +export class CwSingle extends ContractBase { constructor({ address, cosmWasmClient, signingCosmWasmClient }: IContractConstructor) { - super(address, cosmWasmClient, signingCosmWasmClient); - } - - getSigningClient(contractAddr) { - return getSigningClientDefault(this, contractAddr, CwSingleClient); - } - - getQueryClient(contractAddr) { - return getQueryClientDefault(this, contractAddr, CwSingleQueryClient); - } - - getMessageComposer(contractAddr) { - return getMessageComposerDefault(this, contractAddr, CwSingleMessageComposer); + super(address, cosmWasmClient, signingCosmWasmClient, CwSingleClient, CwSingleQueryClient, CwSingleMessageComposer); } } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Factory.provider.ts b/__output__/builder/bundler_test/contracts/Factory.provider.ts index c53c1d12..a90baccc 100644 --- a/__output__/builder/bundler_test/contracts/Factory.provider.ts +++ b/__output__/builder/bundler_test/contracts/Factory.provider.ts @@ -4,29 +4,17 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { ContractBase, IContractConstructor, getSigningClientDefault, getQueryClientDefault, getMessageComposerDefault } from "./contractContextBase"; +import { ContractBase, IContractConstructor } from "./contractContextBase"; import { FactoryClient } from "./Factory.client"; import { FactoryQueryClient } from "./Factory.client"; import { FactoryMessageComposer } from "./Factory.message-composer"; -export class Factory extends ContractBase { +export class Factory extends ContractBase { constructor({ address, cosmWasmClient, signingCosmWasmClient }: IContractConstructor) { - super(address, cosmWasmClient, signingCosmWasmClient); - } - - getSigningClient(contractAddr) { - return getSigningClientDefault(this, contractAddr, FactoryClient); - } - - getQueryClient(contractAddr) { - return getQueryClientDefault(this, contractAddr, FactoryQueryClient); - } - - getMessageComposer(contractAddr) { - return getMessageComposerDefault(this, contractAddr, FactoryMessageComposer); + super(address, cosmWasmClient, signingCosmWasmClient, FactoryClient, FactoryQueryClient, FactoryMessageComposer); } } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Minter.provider.ts b/__output__/builder/bundler_test/contracts/Minter.provider.ts index 4a5ac4c5..8814fb75 100644 --- a/__output__/builder/bundler_test/contracts/Minter.provider.ts +++ b/__output__/builder/bundler_test/contracts/Minter.provider.ts @@ -4,29 +4,17 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { ContractBase, IContractConstructor, getSigningClientDefault, getQueryClientDefault, getMessageComposerDefault } from "./contractContextBase"; +import { ContractBase, IContractConstructor } from "./contractContextBase"; import { MinterClient } from "./Minter.client"; import { MinterQueryClient } from "./Minter.client"; import { MinterMessageComposer } from "./Minter.message-composer"; -export class Minter extends ContractBase { +export class Minter extends ContractBase { constructor({ address, cosmWasmClient, signingCosmWasmClient }: IContractConstructor) { - super(address, cosmWasmClient, signingCosmWasmClient); - } - - getSigningClient(contractAddr) { - return getSigningClientDefault(this, contractAddr, MinterClient); - } - - getQueryClient(contractAddr) { - return getQueryClientDefault(this, contractAddr, MinterQueryClient); - } - - getMessageComposer(contractAddr) { - return getMessageComposerDefault(this, contractAddr, MinterMessageComposer); + super(address, cosmWasmClient, signingCosmWasmClient, MinterClient, MinterQueryClient, MinterMessageComposer); } } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/contractContextBase.ts b/__output__/builder/bundler_test/contracts/contractContextBase.ts index 17d38894..7de4022f 100644 --- a/__output__/builder/bundler_test/contracts/contractContextBase.ts +++ b/__output__/builder/bundler_test/contracts/contractContextBase.ts @@ -16,48 +16,82 @@ export interface IContractConstructor { signingCosmWasmClient: SigningCosmWasmClient | undefined; } -export const noSigningErrorMessage = 'signingCosmWasmClient not connected'; +export const NO_SINGING_ERROR_MESSAGE = 'signingCosmWasmClient not connected'; -export const noCosmWasmClientErrorMessage = 'cosmWasmClient not connected'; +export const NO_COSMWASW_CLIENT_ERROR_MESSAGE = 'cosmWasmClient not connected'; -export const noAddressErrorMessage = "address doesn't exist"; +export const NO_ADDRESS_ERROR_MESSAGE = "address doesn't exist"; -export class ContractBase { - constructor( - public readonly address: string | undefined, - public readonly cosmWasmClient: CosmWasmClient | undefined, - public readonly signingCosmWasmClient: SigningCosmWasmClient | undefined - ) {} +export const NO_SIGNING_CLIENT_ERROR_MESSAGE = + 'Signing client is not generated. Please check ts-codegen config'; + +export const NO_QUERY_CLIENT_ERROR_MESSAGE = + 'Query client is not generated. Please check ts-codegen config'; + +export const NO_MESSAGE_COMPOSER_ERROR_MESSAGE = + 'Message composer client is not generated. Please check ts-codegen config'; + +/** + * a placeholder for non-generated classes + */ +export class EmptyClient {} + +export interface SigningClientProvider { + getSigningClient(contractAddr: string): T; } -export function getSigningClientDefault( - intance: ContractBase, - contractAddr: string, - T: new ( - client: SigningCosmWasmClient, - sender: string, - contractAddress: string - ) => T -): T { - if (!intance.signingCosmWasmClient) throw new Error(noSigningErrorMessage); - if (!intance.address) throw new Error(noAddressErrorMessage); - return new T(intance.signingCosmWasmClient, intance.address, contractAddr); +export interface QueryClientProvider { + getQueryClient(contractAddr: string): T; } -export function getQueryClientDefault( - intance: ContractBase, - contractAddr: string, - T: new (client: CosmWasmClient, contractAddress: string) => T -): T { - if (!intance.cosmWasmClient) throw new Error(noCosmWasmClientErrorMessage); - return new T(intance.cosmWasmClient, contractAddr); +export interface MessageComposerProvider { + getMessageComposer(contractAddr: string): T; } -export function getMessageComposerDefault( - intance: ContractBase, - contractAddr: string, - T: new (address: string, contractAddress: string) => T -): T { - if (!intance.address) throw new Error(noAddressErrorMessage); - return new T(intance.address, contractAddr); +export class ContractBase< + TSign = EmptyClient, + TQuery = EmptyClient, + TMsgComposer = EmptyClient +> { + constructor( + protected address: string | undefined, + protected cosmWasmClient: CosmWasmClient | undefined, + protected signingCosmWasmClient: SigningCosmWasmClient | undefined, + private TSign?: new ( + client: SigningCosmWasmClient, + sender: string, + contractAddress: string + ) => TSign, + private TQuery?: new ( + client: CosmWasmClient, + contractAddress: string + ) => TQuery, + private TMsgComposer?: new ( + sender: string, + contractAddress: string + ) => TMsgComposer + ) {} + + public getSigningClient(contractAddr: string): TSign { + if (!this.signingCosmWasmClient) throw new Error(NO_SINGING_ERROR_MESSAGE); + if (!this.address) throw new Error(NO_ADDRESS_ERROR_MESSAGE); + if (!this.TSign) throw new Error(NO_SIGNING_CLIENT_ERROR_MESSAGE); + return new this.TSign( + this.signingCosmWasmClient, + this.address, + contractAddr + ); + } + + public getQueryClient(contractAddr: string): TQuery { + if (!this.cosmWasmClient) throw new Error(NO_COSMWASW_CLIENT_ERROR_MESSAGE); + if (!this.TQuery) throw new Error(NO_QUERY_CLIENT_ERROR_MESSAGE); + return new this.TQuery(this.cosmWasmClient, contractAddr); + } + + public getMessageComposer(contractAddr: string): TMsgComposer { + if (!this.address) throw new Error(NO_ADDRESS_ERROR_MESSAGE); + if (!this.TMsgComposer) throw new Error(NO_MESSAGE_COMPOSER_ERROR_MESSAGE); + return new this.TMsgComposer(this.address, contractAddr); + } } diff --git a/__output__/builder/bundler_test/contracts/contracts-context.tsx b/__output__/builder/bundler_test/contracts/contracts-context.tsx new file mode 100644 index 00000000..38d23ef7 --- /dev/null +++ b/__output__/builder/bundler_test/contracts/contracts-context.tsx @@ -0,0 +1,78 @@ +/** +* This file and any referenced files were automatically generated by @cosmwasm/ts-codegen@latest +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or yarn proto command to regenerate this bundle. +*/ + + +import React, { useEffect, useMemo, useRef, useState, useContext } from 'react'; +import { + CosmWasmClient, + SigningCosmWasmClient, +} from '@cosmjs/cosmwasm-stargate'; + +import { IContractsContext, getProviders } from './contractContextProviders'; + +interface ContractsConfig { + address: string | undefined; + getCosmWasmClient: () => Promise; + getSigningCosmWasmClient: () => Promise; +} + +const ContractsContext = React.createContext(null); + +export const ContractsProvider = ({ + children, + contractsConfig, +}: { + children: React.ReactNode; + contractsConfig: ContractsConfig; +}) => { + const [cosmWasmClient, setCosmWasmClient] = useState(); + const [signingCosmWasmClient, setSigningCosmWasmClient] = + useState(); + + const { address, getCosmWasmClient, getSigningCosmWasmClient } = + contractsConfig; + + const prevAddressRef = useRef(address); + + const contracts: IContractsContext = useMemo(() => { + return getProviders(address, cosmWasmClient, signingCosmWasmClient); + }, [address, cosmWasmClient, signingCosmWasmClient]); + + useEffect(() => { + const connectSigningCwClient = async () => { + if (address && prevAddressRef.current !== address) { + const signingCosmWasmClient = await getSigningCosmWasmClient(); + setSigningCosmWasmClient(signingCosmWasmClient); + } else if (!address) { + setSigningCosmWasmClient(undefined); + } + prevAddressRef.current = address; + }; + connectSigningCwClient(); + }, [address, getSigningCosmWasmClient]); + + useEffect(() => { + const connectCosmWasmClient = async () => { + const cosmWasmClient = await getCosmWasmClient(); + setCosmWasmClient(cosmWasmClient); + }; + connectCosmWasmClient(); + }, [getCosmWasmClient]); + + return ( + + {children} + + ); +}; + +export const useContracts = () => { + const contracts = useContext(ContractsContext); + if (contracts === null) { + throw new Error('useContracts must be used within a ContractsProvider'); + } + return contracts; +}; diff --git a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap index 7e653137..e963687f 100644 --- a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap +++ b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap @@ -309,10 +309,8 @@ TSBuilder { }, "utils": Object { "ContractBase": "__contractContextBase__", + "EmptyClient": "__contractContextBase__", "IContractConstructor": "__contractContextBase__", - "getMessageComposerDefault": "__contractContextBase__", - "getQueryClientDefault": "__contractContextBase__", - "getSigningClientDefault": "__contractContextBase__", }, }, ], @@ -628,10 +626,8 @@ TSBuilder { }, "utils": Object { "ContractBase": "__contractContextBase__", + "EmptyClient": "__contractContextBase__", "IContractConstructor": "__contractContextBase__", - "getMessageComposerDefault": "__contractContextBase__", - "getQueryClientDefault": "__contractContextBase__", - "getSigningClientDefault": "__contractContextBase__", }, }, ], diff --git a/packages/ts-codegen/src/generators/create-helpers.ts b/packages/ts-codegen/src/generators/create-helpers.ts index 21633f92..0d40c2aa 100644 --- a/packages/ts-codegen/src/generators/create-helpers.ts +++ b/packages/ts-codegen/src/generators/create-helpers.ts @@ -3,7 +3,7 @@ import { sync as mkdirp } from "mkdirp"; import pkg from "../../package.json"; import { writeContentToFile } from "../utils/files"; import { TSBuilderInput } from "../builder"; -import { contractContextBase } from "../helpers"; +import { contractContextBase, contractsContextTSX } from "../helpers"; const version = process.env.NODE_ENV === "test" ? "latest" : pkg.version; const header = `/** @@ -22,5 +22,6 @@ const write = (outPath: string, file: string, content: string) => { export const createHelpers = (input: TSBuilderInput) => { if (input.options?.useContracts?.enabled) { write(input.outPath, "contractContextBase.ts", contractContextBase); + write(input.outPath, "contracts-context.tsx", contractsContextTSX); } }; diff --git a/packages/ts-codegen/src/helpers/contractContextBase.ts b/packages/ts-codegen/src/helpers/contractContextBase.ts index d2ef4407..db2d7943 100644 --- a/packages/ts-codegen/src/helpers/contractContextBase.ts +++ b/packages/ts-codegen/src/helpers/contractContextBase.ts @@ -10,49 +10,83 @@ export interface IContractConstructor { signingCosmWasmClient: SigningCosmWasmClient | undefined; } -export const noSigningErrorMessage = 'signingCosmWasmClient not connected'; +export const NO_SINGING_ERROR_MESSAGE = 'signingCosmWasmClient not connected'; -export const noCosmWasmClientErrorMessage = 'cosmWasmClient not connected'; +export const NO_COSMWASW_CLIENT_ERROR_MESSAGE = 'cosmWasmClient not connected'; -export const noAddressErrorMessage = "address doesn't exist"; +export const NO_ADDRESS_ERROR_MESSAGE = "address doesn't exist"; -export class ContractBase { - constructor( - public readonly address: string | undefined, - public readonly cosmWasmClient: CosmWasmClient | undefined, - public readonly signingCosmWasmClient: SigningCosmWasmClient | undefined - ) {} +export const NO_SIGNING_CLIENT_ERROR_MESSAGE = + 'Signing client is not generated. Please check ts-codegen config'; + +export const NO_QUERY_CLIENT_ERROR_MESSAGE = + 'Query client is not generated. Please check ts-codegen config'; + +export const NO_MESSAGE_COMPOSER_ERROR_MESSAGE = + 'Message composer client is not generated. Please check ts-codegen config'; + +/** + * a placeholder for non-generated classes + */ +export class EmptyClient {} + +export interface SigningClientProvider { + getSigningClient(contractAddr: string): T; } -export function getSigningClientDefault( - intance: ContractBase, - contractAddr: string, - T: new ( - client: SigningCosmWasmClient, - sender: string, - contractAddress: string - ) => T -): T { - if (!intance.signingCosmWasmClient) throw new Error(noSigningErrorMessage); - if (!intance.address) throw new Error(noAddressErrorMessage); - return new T(intance.signingCosmWasmClient, intance.address, contractAddr); +export interface QueryClientProvider { + getQueryClient(contractAddr: string): T; } -export function getQueryClientDefault( - intance: ContractBase, - contractAddr: string, - T: new (client: CosmWasmClient, contractAddress: string) => T -): T { - if (!intance.cosmWasmClient) throw new Error(noCosmWasmClientErrorMessage); - return new T(intance.cosmWasmClient, contractAddr); +export interface MessageComposerProvider { + getMessageComposer(contractAddr: string): T; } -export function getMessageComposerDefault( - intance: ContractBase, - contractAddr: string, - T: new (address: string, contractAddress: string) => T -): T { - if (!intance.address) throw new Error(noAddressErrorMessage); - return new T(intance.address, contractAddr); +export class ContractBase< + TSign = EmptyClient, + TQuery = EmptyClient, + TMsgComposer = EmptyClient +> { + constructor( + protected address: string | undefined, + protected cosmWasmClient: CosmWasmClient | undefined, + protected signingCosmWasmClient: SigningCosmWasmClient | undefined, + private TSign?: new ( + client: SigningCosmWasmClient, + sender: string, + contractAddress: string + ) => TSign, + private TQuery?: new ( + client: CosmWasmClient, + contractAddress: string + ) => TQuery, + private TMsgComposer?: new ( + sender: string, + contractAddress: string + ) => TMsgComposer + ) {} + + public getSigningClient(contractAddr: string): TSign { + if (!this.signingCosmWasmClient) throw new Error(NO_SINGING_ERROR_MESSAGE); + if (!this.address) throw new Error(NO_ADDRESS_ERROR_MESSAGE); + if (!this.TSign) throw new Error(NO_SIGNING_CLIENT_ERROR_MESSAGE); + return new this.TSign( + this.signingCosmWasmClient, + this.address, + contractAddr + ); + } + + public getQueryClient(contractAddr: string): TQuery { + if (!this.cosmWasmClient) throw new Error(NO_COSMWASW_CLIENT_ERROR_MESSAGE); + if (!this.TQuery) throw new Error(NO_QUERY_CLIENT_ERROR_MESSAGE); + return new this.TQuery(this.cosmWasmClient, contractAddr); + } + + public getMessageComposer(contractAddr: string): TMsgComposer { + if (!this.address) throw new Error(NO_ADDRESS_ERROR_MESSAGE); + if (!this.TMsgComposer) throw new Error(NO_MESSAGE_COMPOSER_ERROR_MESSAGE); + return new this.TMsgComposer(this.address, contractAddr); + } } -` \ No newline at end of file +`; diff --git a/packages/ts-codegen/src/helpers/contractsContextTSX.ts b/packages/ts-codegen/src/helpers/contractsContextTSX.ts new file mode 100644 index 00000000..7fb4182d --- /dev/null +++ b/packages/ts-codegen/src/helpers/contractsContextTSX.ts @@ -0,0 +1,73 @@ +export const contractsContextTSX = ` +import React, { useEffect, useMemo, useRef, useState, useContext } from 'react'; +import { + CosmWasmClient, + SigningCosmWasmClient, +} from '@cosmjs/cosmwasm-stargate'; + +import { IContractsContext, getProviders } from './contractContextProviders'; + +interface ContractsConfig { + address: string | undefined; + getCosmWasmClient: () => Promise; + getSigningCosmWasmClient: () => Promise; +} + +const ContractsContext = React.createContext(null); + +export const ContractsProvider = ({ + children, + contractsConfig, +}: { + children: React.ReactNode; + contractsConfig: ContractsConfig; +}) => { + const [cosmWasmClient, setCosmWasmClient] = useState(); + const [signingCosmWasmClient, setSigningCosmWasmClient] = + useState(); + + const { address, getCosmWasmClient, getSigningCosmWasmClient } = + contractsConfig; + + const prevAddressRef = useRef(address); + + const contracts: IContractsContext = useMemo(() => { + return getProviders(address, cosmWasmClient, signingCosmWasmClient); + }, [address, cosmWasmClient, signingCosmWasmClient]); + + useEffect(() => { + const connectSigningCwClient = async () => { + if (address && prevAddressRef.current !== address) { + const signingCosmWasmClient = await getSigningCosmWasmClient(); + setSigningCosmWasmClient(signingCosmWasmClient); + } else if (!address) { + setSigningCosmWasmClient(undefined); + } + prevAddressRef.current = address; + }; + connectSigningCwClient(); + }, [address, getSigningCosmWasmClient]); + + useEffect(() => { + const connectCosmWasmClient = async () => { + const cosmWasmClient = await getCosmWasmClient(); + setCosmWasmClient(cosmWasmClient); + }; + connectCosmWasmClient(); + }, [getCosmWasmClient]); + + return ( + + {children} + + ); +}; + +export const useContracts = () => { + const contracts = useContext(ContractsContext); + if (contracts === null) { + throw new Error('useContracts must be used within a ContractsProvider'); + } + return contracts; +}; +`; diff --git a/packages/ts-codegen/src/helpers/index.ts b/packages/ts-codegen/src/helpers/index.ts index 11619fdc..0132275b 100644 --- a/packages/ts-codegen/src/helpers/index.ts +++ b/packages/ts-codegen/src/helpers/index.ts @@ -1 +1,2 @@ -export * from './contractContextBase'; \ No newline at end of file +export * from './contractContextBase'; +export * from './contractsContextTSX'; \ No newline at end of file diff --git a/packages/ts-codegen/src/plugins/client.ts b/packages/ts-codegen/src/plugins/client.ts index 3b31dfec..35c3db73 100644 --- a/packages/ts-codegen/src/plugins/client.ts +++ b/packages/ts-codegen/src/plugins/client.ts @@ -1,18 +1,17 @@ -import { pascal } from 'case'; -import * as w from 'wasm-ast-types'; -import { findExecuteMsg, findAndParseTypes, findQueryMsg } from '../utils'; +import { pascal } from "case"; +import * as w from "wasm-ast-types"; +import { findExecuteMsg, findAndParseTypes, findQueryMsg } from "../utils"; import { RenderContext, ContractInfo, RenderContextBase, getMessageProperties, - RenderOptions -} from 'wasm-ast-types'; -import { BuilderFileType } from '../builder'; -import { BuilderPluginBase } from './plugin-base'; + RenderOptions, +} from "wasm-ast-types"; +import { BuilderFileType } from "../builder"; +import { BuilderPluginBase } from "./plugin-base"; -export const TYPE = 'client'; -export const QUERY_CLIENT_TYPE = 'queryClient'; +export const TYPE = "client"; export class ClientPlugin extends BuilderPluginBase { initContext( @@ -41,8 +40,8 @@ export class ClientPlugin extends BuilderPluginBase { const { schemas } = context.contract; - const localname = pascal(name) + '.client.ts'; - const TypesFile = pascal(name) + '.types'; + const localname = pascal(name) + ".client.ts"; + const TypesFile = pascal(name) + ".types"; const QueryMsg = findQueryMsg(schemas); const ExecuteMsg = findExecuteMsg(schemas); const typeHash = await findAndParseTypes(schemas); @@ -66,7 +65,12 @@ export class ClientPlugin extends BuilderPluginBase { w.createQueryClass(context, QueryClient, ReadOnlyInstance, QueryMsg) ); - context.addProviderInfo(QUERY_CLIENT_TYPE, QueryClient, localname) + context.addProviderInfo( + name, + w.PROVIDER_TYPES.QUERY_CLIENT_TYPE, + QueryClient, + localname + ); } // execute messages @@ -95,11 +99,16 @@ export class ClientPlugin extends BuilderPluginBase { ) ); - context.addProviderInfo(TYPE, Client, localname) + context.addProviderInfo( + name, + w.PROVIDER_TYPES.SIGNING_CLIENT_TYPE, + Client, + localname + ); } } - if (typeHash.hasOwnProperty('Coin')) { + if (typeHash.hasOwnProperty("Coin")) { // @ts-ignore delete context.utils.Coin; } @@ -108,8 +117,8 @@ export class ClientPlugin extends BuilderPluginBase { { type: TYPE, localname, - body - } + body, + }, ]; } } diff --git a/packages/ts-codegen/src/plugins/message-composer.ts b/packages/ts-codegen/src/plugins/message-composer.ts index 3326181a..3e9ffe8c 100644 --- a/packages/ts-codegen/src/plugins/message-composer.ts +++ b/packages/ts-codegen/src/plugins/message-composer.ts @@ -1,18 +1,18 @@ -import { pascal } from 'case'; -import * as w from 'wasm-ast-types'; -import { findAndParseTypes, findExecuteMsg } from '../utils'; +import { pascal } from "case"; +import * as w from "wasm-ast-types"; +import { findAndParseTypes, findExecuteMsg } from "../utils"; import { MessageComposerOptions, getMessageProperties, ContractInfo, RenderContextBase, RenderContext, - RenderOptions -} from 'wasm-ast-types'; -import { BuilderFileType } from '../builder'; -import { BuilderPluginBase } from './plugin-base'; + RenderOptions, +} from "wasm-ast-types"; +import { BuilderFileType } from "../builder"; +import { BuilderPluginBase } from "./plugin-base"; -export const TYPE = 'message-composer'; +export const TYPE = "message-composer"; export class MessageComposerPlugin extends BuilderPluginBase { initContext( @@ -41,8 +41,8 @@ export class MessageComposerPlugin extends BuilderPluginBase { const { schemas } = context.contract; - const localname = pascal(name) + '.message-composer.ts'; - const TypesFile = pascal(name) + '.types'; + const localname = pascal(name) + ".message-composer.ts"; + const TypesFile = pascal(name) + ".types"; const ExecuteMsg = findExecuteMsg(schemas); const typeHash = await findAndParseTypes(schemas); @@ -64,11 +64,16 @@ export class MessageComposerPlugin extends BuilderPluginBase { w.createMessageComposerClass(context, TheClass, Interface, ExecuteMsg) ); - context.addProviderInfo(TYPE, TheClass, localname) + context.addProviderInfo( + name, + w.PROVIDER_TYPES.MESSAGE_COMPOSER_TYPE, + TheClass, + localname + ); } } - if (typeHash.hasOwnProperty('Coin')) { + if (typeHash.hasOwnProperty("Coin")) { // @ts-ignore delete context.utils.Coin; } @@ -77,8 +82,8 @@ export class MessageComposerPlugin extends BuilderPluginBase { { type: TYPE, localname, - body - } + body, + }, ]; } } diff --git a/packages/ts-codegen/src/plugins/provider.ts b/packages/ts-codegen/src/plugins/provider.ts index 540555db..4a74442e 100644 --- a/packages/ts-codegen/src/plugins/provider.ts +++ b/packages/ts-codegen/src/plugins/provider.ts @@ -1,17 +1,8 @@ import { pascal } from "case"; import * as w from "wasm-ast-types"; -import { findAndParseTypes, findExecuteMsg } from "../utils"; -import { - getMessageProperties, - ContractInfo, - RenderContextBase, - RenderContext, - RenderOptions, -} from "wasm-ast-types"; -import { BuilderFileType, TSBuilder, TSBuilderOptions } from "../builder"; +import { ContractInfo, RenderContextBase, RenderContext } from "wasm-ast-types"; +import { BuilderFileType, TSBuilderOptions } from "../builder"; import { BuilderPluginBase } from "./plugin-base"; -import { TYPE as SIGN_CLIENT_TYPE, QUERY_CLIENT_TYPE } from "./client"; -import { TYPE as MESSAGE_COMPOSER_TYPE } from "./message-composer"; export class ContractsContextProviderPlugin extends BuilderPluginBase { constructor(opt: TSBuilderOptions) { @@ -20,9 +11,7 @@ export class ContractsContextProviderPlugin extends BuilderPluginBase(\n intance: ContractBase,\n contractAddr: string,\n T: new (\n client: SigningCosmWasmClient,\n sender: string,\n contractAddress: string\n ) => T\n): T {\n if (!intance.signingCosmWasmClient) throw new Error(noSigningErrorMessage);\n if (!intance.address) throw new Error(noAddressErrorMessage);\n return new T(intance.signingCosmWasmClient, intance.address, contractAddr);\n}\n\nexport function getQueryClientDefault(\n intance: ContractBase,\n contractAddr: string,\n T: new (client: CosmWasmClient, contractAddress: string) => T\n): T {\n if (!intance.cosmWasmClient) throw new Error(noCosmWasmClientErrorMessage);\n return new T(intance.cosmWasmClient, contractAddr);\n}\n\nexport function getMessageComposerDefault(\n intance: ContractBase,\n contractAddr: string,\n T: new (address: string, contractAddress: string) => T\n): T {\n if (!intance.address) throw new Error(noAddressErrorMessage);\n return new T(intance.address, contractAddr);\n}\n"; +export declare const contractContextBase = "\nimport {\n CosmWasmClient,\n SigningCosmWasmClient,\n} from '@cosmjs/cosmwasm-stargate';\n\nexport interface IContractConstructor {\n address: string | undefined;\n cosmWasmClient: CosmWasmClient | undefined;\n signingCosmWasmClient: SigningCosmWasmClient | undefined;\n}\n\nexport const NO_SINGING_ERROR_MESSAGE = 'signingCosmWasmClient not connected';\n\nexport const NO_COSMWASW_CLIENT_ERROR_MESSAGE = 'cosmWasmClient not connected';\n\nexport const NO_ADDRESS_ERROR_MESSAGE = \"address doesn't exist\";\n\nexport const NO_SIGNING_CLIENT_ERROR_MESSAGE =\n 'Signing client is not generated. Please check ts-codegen config';\n\nexport const NO_QUERY_CLIENT_ERROR_MESSAGE =\n 'Query client is not generated. Please check ts-codegen config';\n\nexport const NO_MESSAGE_COMPOSER_ERROR_MESSAGE =\n 'Message composer client is not generated. Please check ts-codegen config';\n\n/**\n * a placeholder for non-generated classes\n */\nexport class EmptyClient {}\n\nexport interface SigningClientProvider {\n getSigningClient(contractAddr: string): T;\n}\n\nexport interface QueryClientProvider {\n getQueryClient(contractAddr: string): T;\n}\n\nexport interface MessageComposerProvider {\n getMessageComposer(contractAddr: string): T;\n}\n\nexport class ContractBase<\n TSign = EmptyClient,\n TQuery = EmptyClient,\n TMsgComposer = EmptyClient\n> {\n constructor(\n protected address: string | undefined,\n protected cosmWasmClient: CosmWasmClient | undefined,\n protected signingCosmWasmClient: SigningCosmWasmClient | undefined,\n private TSign?: new (\n client: SigningCosmWasmClient,\n sender: string,\n contractAddress: string\n ) => TSign,\n private TQuery?: new (\n client: CosmWasmClient,\n contractAddress: string\n ) => TQuery,\n private TMsgComposer?: new (\n sender: string,\n contractAddress: string\n ) => TMsgComposer\n ) {}\n\n public getSigningClient(contractAddr: string): TSign {\n if (!this.signingCosmWasmClient) throw new Error(NO_SINGING_ERROR_MESSAGE);\n if (!this.address) throw new Error(NO_ADDRESS_ERROR_MESSAGE);\n if (!this.TSign) throw new Error(NO_SIGNING_CLIENT_ERROR_MESSAGE);\n return new this.TSign(\n this.signingCosmWasmClient,\n this.address,\n contractAddr\n );\n }\n\n public getQueryClient(contractAddr: string): TQuery {\n if (!this.cosmWasmClient) throw new Error(NO_COSMWASW_CLIENT_ERROR_MESSAGE);\n if (!this.TQuery) throw new Error(NO_QUERY_CLIENT_ERROR_MESSAGE);\n return new this.TQuery(this.cosmWasmClient, contractAddr);\n }\n\n public getMessageComposer(contractAddr: string): TMsgComposer {\n if (!this.address) throw new Error(NO_ADDRESS_ERROR_MESSAGE);\n if (!this.TMsgComposer) throw new Error(NO_MESSAGE_COMPOSER_ERROR_MESSAGE);\n return new this.TMsgComposer(this.address, contractAddr);\n }\n}\n"; diff --git a/packages/ts-codegen/types/src/helpers/contractsContextTSX.d.ts b/packages/ts-codegen/types/src/helpers/contractsContextTSX.d.ts new file mode 100644 index 00000000..38db3def --- /dev/null +++ b/packages/ts-codegen/types/src/helpers/contractsContextTSX.d.ts @@ -0,0 +1 @@ +export declare const contractsContextTSX = "\nimport React, { useEffect, useMemo, useRef, useState, useContext } from 'react';\nimport {\n CosmWasmClient,\n SigningCosmWasmClient,\n} from '@cosmjs/cosmwasm-stargate';\n\nimport { IContractsContext, getProviders } from './contractContextProviders';\n\ninterface ContractsConfig {\n address: string | undefined;\n getCosmWasmClient: () => Promise;\n getSigningCosmWasmClient: () => Promise;\n}\n\nconst ContractsContext = React.createContext(null);\n\nexport const ContractsProvider = ({\n children,\n contractsConfig,\n}: {\n children: React.ReactNode;\n contractsConfig: ContractsConfig;\n}) => {\n const [cosmWasmClient, setCosmWasmClient] = useState();\n const [signingCosmWasmClient, setSigningCosmWasmClient] =\n useState();\n\n const { address, getCosmWasmClient, getSigningCosmWasmClient } =\n contractsConfig;\n\n const prevAddressRef = useRef(address);\n\n const contracts: IContractsContext = useMemo(() => {\n return getProviders(address, cosmWasmClient, signingCosmWasmClient);\n }, [address, cosmWasmClient, signingCosmWasmClient]);\n\n useEffect(() => {\n const connectSigningCwClient = async () => {\n if (address && prevAddressRef.current !== address) {\n const signingCosmWasmClient = await getSigningCosmWasmClient();\n setSigningCosmWasmClient(signingCosmWasmClient);\n } else if (!address) {\n setSigningCosmWasmClient(undefined);\n }\n prevAddressRef.current = address;\n };\n connectSigningCwClient();\n }, [address, getSigningCosmWasmClient]);\n\n useEffect(() => {\n const connectCosmWasmClient = async () => {\n const cosmWasmClient = await getCosmWasmClient();\n setCosmWasmClient(cosmWasmClient);\n };\n connectCosmWasmClient();\n }, [getCosmWasmClient]);\n\n return (\n \n {children}\n \n );\n};\n\nexport const useContracts = () => {\n const contracts = useContext(ContractsContext);\n if (contracts === null) {\n throw new Error('useContracts must be used within a ContractsProvider');\n }\n return contracts;\n};\n"; diff --git a/packages/ts-codegen/types/src/helpers/index.d.ts b/packages/ts-codegen/types/src/helpers/index.d.ts index 71a13410..d9837fc8 100644 --- a/packages/ts-codegen/types/src/helpers/index.d.ts +++ b/packages/ts-codegen/types/src/helpers/index.d.ts @@ -1 +1,2 @@ export * from './contractContextBase'; +export * from './contractsContextTSX'; diff --git a/packages/ts-codegen/types/src/plugins/client.d.ts b/packages/ts-codegen/types/src/plugins/client.d.ts index 09eed64d..1cb58168 100644 --- a/packages/ts-codegen/types/src/plugins/client.d.ts +++ b/packages/ts-codegen/types/src/plugins/client.d.ts @@ -1,8 +1,7 @@ -import { RenderContext, ContractInfo, RenderContextBase, RenderOptions } from 'wasm-ast-types'; -import { BuilderFileType } from '../builder'; -import { BuilderPluginBase } from './plugin-base'; +import { RenderContext, ContractInfo, RenderContextBase, RenderOptions } from "wasm-ast-types"; +import { BuilderFileType } from "../builder"; +import { BuilderPluginBase } from "./plugin-base"; export declare const TYPE = "client"; -export declare const QUERY_CLIENT_TYPE = "queryClient"; export declare class ClientPlugin extends BuilderPluginBase { initContext(contract: ContractInfo, options?: RenderOptions): RenderContextBase; doRender(name: string, context: RenderContext): Promise<{ diff --git a/packages/ts-codegen/types/src/plugins/message-composer.d.ts b/packages/ts-codegen/types/src/plugins/message-composer.d.ts index 77bdb05f..43c536b9 100644 --- a/packages/ts-codegen/types/src/plugins/message-composer.d.ts +++ b/packages/ts-codegen/types/src/plugins/message-composer.d.ts @@ -1,6 +1,6 @@ -import { ContractInfo, RenderContextBase, RenderContext, RenderOptions } from 'wasm-ast-types'; -import { BuilderFileType } from '../builder'; -import { BuilderPluginBase } from './plugin-base'; +import { ContractInfo, RenderContextBase, RenderContext, RenderOptions } from "wasm-ast-types"; +import { BuilderFileType } from "../builder"; +import { BuilderPluginBase } from "./plugin-base"; export declare const TYPE = "message-composer"; export declare class MessageComposerPlugin extends BuilderPluginBase { initContext(contract: ContractInfo, options?: RenderOptions): RenderContextBase; diff --git a/packages/wasm-ast-types/src/context/context.ts b/packages/wasm-ast-types/src/context/context.ts index 0f9bf708..174fa13a 100644 --- a/packages/wasm-ast-types/src/context/context.ts +++ b/packages/wasm-ast-types/src/context/context.ts @@ -84,9 +84,11 @@ export interface IRenderContext extends IContext { contract: ContractInfo; options: TOpt; - addProviderInfo(type: string, classname: string, filename: string): void; + addProviderInfo(contractName:string, type: string, classname: string, filename: string): void; getProviderInfos(): { - [key: string]: ProviderInfo; + [key: string]: { + [key: string]: ProviderInfo; + }; }; } @@ -140,11 +142,17 @@ export const getDefinitionSchema = (schemas: JSONSchema[]): JSONSchema => { export class BuilderContext{ providers:{ - [key: string]: ProviderInfo; + [key: string]: { + [key: string]: ProviderInfo; + }; } = {}; - addProviderInfo(type: string, classname: string, filename: string): void { - this.providers[type] = { + addProviderInfo(contractName:string, type: string, classname: string, filename: string): void { + if(!this.providers[contractName]){ + this.providers[contractName] = {} + } + + this.providers[contractName][type] = { classname, filename, basename: basename(filename, extname(filename)) @@ -185,10 +193,14 @@ export abstract class RenderContextBase implements IRender addUtil(util: string) { this.utils[util] = true; } - addProviderInfo(type: string, classname: string, filename: string): void { - this.builderContext.addProviderInfo(type, classname, filename); + addProviderInfo(contractName:string, type: string, classname: string, filename: string): void { + this.builderContext.addProviderInfo(contractName, type, classname, filename); } - getProviderInfos(): { [key: string]: ProviderInfo; } { + getProviderInfos(): { + [key: string]: { + [key: string]: ProviderInfo; + }; + } { return this.builderContext.providers; } getImports(registeredUtils?: UtilMapping, filepath?: string) { diff --git a/packages/wasm-ast-types/src/provider/__snapshots__/provider.spec.ts.snap b/packages/wasm-ast-types/src/provider/__snapshots__/provider.spec.ts.snap new file mode 100644 index 00000000..10b5a8ad --- /dev/null +++ b/packages/wasm-ast-types/src/provider/__snapshots__/provider.spec.ts.snap @@ -0,0 +1,27 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`execute class 1`] = ` +"export class Whitelist extends ContractBase { + constructor({ + address, + cosmWasmClient, + signingCosmWasmClient + }: IContractConstructor) { + super(address, cosmWasmClient, signingCosmWasmClient, WhitelistClient, WhitelistQueryClient, WhitelistMessageComposer); + } + +}" +`; + +exports[`execute class without message composer 1`] = ` +"export class Whitelist extends ContractBase { + constructor({ + address, + cosmWasmClient, + signingCosmWasmClient + }: IContractConstructor) { + super(address, cosmWasmClient, signingCosmWasmClient, WhitelistClient, WhitelistQueryClient, undefined); + } + +}" +`; diff --git a/packages/wasm-ast-types/src/provider/provider.spec.ts b/packages/wasm-ast-types/src/provider/provider.spec.ts new file mode 100644 index 00000000..b27f83cb --- /dev/null +++ b/packages/wasm-ast-types/src/provider/provider.spec.ts @@ -0,0 +1,39 @@ +import execute_msg from "../../../../__fixtures__/basic/execute_msg_for__empty.json"; +import query_msg from "../../../../__fixtures__/basic/query_msg.json"; +import ownership from "../../../../__fixtures__/basic/ownership.json"; +import { createProvider } from "./provider"; + +import { expectCode, makeContext } from "../../test-utils"; +import { PROVIDER_TYPES } from "../utils/constants"; + +it("execute class", () => { + let info = {}; + + info[PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = { + classname: "WhitelistClient" + } + + info[PROVIDER_TYPES.QUERY_CLIENT_TYPE] = { + classname: "WhitelistQueryClient" + } + + info[PROVIDER_TYPES.MESSAGE_COMPOSER_TYPE] = { + classname: "WhitelistMessageComposer" + } + + expectCode(createProvider("Whitelist", info)); +}); + +it("execute class without message composer", () => { + let info = {}; + + info[PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = { + classname: "WhitelistClient" + } + + info[PROVIDER_TYPES.QUERY_CLIENT_TYPE] = { + classname: "WhitelistQueryClient" + } + + expectCode(createProvider("Whitelist", info)); +}); diff --git a/packages/wasm-ast-types/src/provider/provider.ts b/packages/wasm-ast-types/src/provider/provider.ts index efbcf265..85f63db3 100644 --- a/packages/wasm-ast-types/src/provider/provider.ts +++ b/packages/wasm-ast-types/src/provider/provider.ts @@ -1,75 +1,101 @@ import * as t from "@babel/types"; import { pascal } from "case"; +import { ProviderInfo } from "../context"; +import { PROVIDER_TYPES } from "../utils/constants"; import { tsObjectPattern } from "../utils"; -export const createProvider = (name: string, methods: t.ClassMethod[]) => { - return t.exportNamedDeclaration( - t.classDeclaration( - t.identifier(pascal(name)), - t.identifier("ContractBase"), - t.classBody([ - t.classMethod( - "constructor", - t.identifier("constructor"), - [ - tsObjectPattern( - [ - t.objectProperty( - t.identifier("address"), - t.identifier("address"), - false, - true - ), - t.objectProperty( - t.identifier("cosmWasmClient"), - t.identifier("cosmWasmClient"), - false, - true - ), - t.objectProperty( - t.identifier("signingCosmWasmClient"), - t.identifier("signingCosmWasmClient"), - false, - true - ), - ], - t.tsTypeAnnotation( - t.tsTypeReference(t.identifier("IContractConstructor")) - ) - ), - ], - t.blockStatement([ - t.expressionStatement( - t.callExpression(t.super(), [ +export const createProvider = ( + name: string, + providerInfos: { + [key: string]: ProviderInfo; + } +) => { + const classDeclaration = t.classDeclaration( + t.identifier(name), + t.identifier("ContractBase"), + t.classBody([ + t.classMethod( + "constructor", + t.identifier("constructor"), + [ + tsObjectPattern( + [ + t.objectProperty( + t.identifier("address"), t.identifier("address"), + false, + true + ), + t.objectProperty( + t.identifier("cosmWasmClient"), t.identifier("cosmWasmClient"), + false, + true + ), + t.objectProperty( t.identifier("signingCosmWasmClient"), - ]) - ), - ]) - ), - ...methods, - ]) - ) - ); -}; - -export const createProviderFunction = ( - functionName: string, - classname: string -) => { - return t.classMethod( - "method", - t.identifier(`get${functionName}`), - [t.identifier("contractAddr")], - t.blockStatement([ - t.returnStatement( - t.callExpression(t.identifier(`get${functionName}Default`), [ - t.thisExpression(), - t.identifier("contractAddr"), - t.identifier(classname), + t.identifier("signingCosmWasmClient"), + false, + true + ), + ], + t.tsTypeAnnotation( + t.tsTypeReference(t.identifier("IContractConstructor")) + ) + ), + ], + t.blockStatement([ + t.expressionStatement( + t.callExpression(t.super(), [ + t.identifier("address"), + t.identifier("cosmWasmClient"), + t.identifier("signingCosmWasmClient"), + t.identifier( + providerInfos[PROVIDER_TYPES.SIGNING_CLIENT_TYPE] + ? providerInfos[PROVIDER_TYPES.SIGNING_CLIENT_TYPE].classname + : "undefined" + ), + t.identifier( + providerInfos[PROVIDER_TYPES.QUERY_CLIENT_TYPE] + ? providerInfos[PROVIDER_TYPES.QUERY_CLIENT_TYPE].classname + : "undefined" + ), + t.identifier( + providerInfos[PROVIDER_TYPES.MESSAGE_COMPOSER_TYPE] + ? providerInfos[PROVIDER_TYPES.MESSAGE_COMPOSER_TYPE] + .classname + : "undefined" + ), + ]) + ), ]) ), ]) ); + + classDeclaration.superTypeParameters = t.tsTypeParameterInstantiation([ + t.tsTypeReference( + t.identifier( + providerInfos[PROVIDER_TYPES.SIGNING_CLIENT_TYPE] + ? providerInfos[PROVIDER_TYPES.SIGNING_CLIENT_TYPE].classname + : "EmptyClient" + ) + ), + t.tsTypeReference( + t.identifier( + providerInfos[PROVIDER_TYPES.QUERY_CLIENT_TYPE] + ? providerInfos[PROVIDER_TYPES.QUERY_CLIENT_TYPE].classname + : "EmptyClient" + ) + ), + t.tsTypeReference( + t.identifier( + providerInfos[PROVIDER_TYPES.MESSAGE_COMPOSER_TYPE] + ? providerInfos[PROVIDER_TYPES.MESSAGE_COMPOSER_TYPE].classname + : "EmptyClient" + ) + ), + ]); + + return t.exportNamedDeclaration(classDeclaration); }; diff --git a/packages/wasm-ast-types/src/utils/constants.ts b/packages/wasm-ast-types/src/utils/constants.ts index ab2a3e23..39196997 100644 --- a/packages/wasm-ast-types/src/utils/constants.ts +++ b/packages/wasm-ast-types/src/utils/constants.ts @@ -28,3 +28,9 @@ export const FIXED_EXECUTE_PARAMS = [ OPTIONAL_MEMO_PARAM, OPTIONAL_FUNDS_PARAM ]; + +export const PROVIDER_TYPES = { + SIGNING_CLIENT_TYPE: "client", + QUERY_CLIENT_TYPE: "queryClient", + MESSAGE_COMPOSER_TYPE : 'message-composer' +}; diff --git a/packages/wasm-ast-types/src/utils/index.ts b/packages/wasm-ast-types/src/utils/index.ts index aa3643b7..29c1c58e 100644 --- a/packages/wasm-ast-types/src/utils/index.ts +++ b/packages/wasm-ast-types/src/utils/index.ts @@ -3,3 +3,4 @@ export * from './types'; export * from './ref'; export { OPTIONAL_FUNDS_PARAM } from './constants'; export { FIXED_EXECUTE_PARAMS } from './constants'; +export { PROVIDER_TYPES } from './constants'; diff --git a/packages/wasm-ast-types/types/context/context.d.ts b/packages/wasm-ast-types/types/context/context.d.ts index 5251e2e8..b40cad89 100644 --- a/packages/wasm-ast-types/types/context/context.d.ts +++ b/packages/wasm-ast-types/types/context/context.d.ts @@ -69,18 +69,22 @@ export interface IContext { export interface IRenderContext extends IContext { contract: ContractInfo; options: TOpt; - addProviderInfo(type: string, classname: string, filename: string): void; + addProviderInfo(contractName: string, type: string, classname: string, filename: string): void; getProviderInfos(): { - [key: string]: ProviderInfo; + [key: string]: { + [key: string]: ProviderInfo; + }; }; } export declare const defaultOptions: RenderOptions; export declare const getDefinitionSchema: (schemas: JSONSchema[]) => JSONSchema; export declare class BuilderContext { providers: { - [key: string]: ProviderInfo; + [key: string]: { + [key: string]: ProviderInfo; + }; }; - addProviderInfo(type: string, classname: string, filename: string): void; + addProviderInfo(contractName: string, type: string, classname: string, filename: string): void; } /** * context object for generating code. @@ -101,9 +105,11 @@ export declare abstract class RenderContextBase implements abstract mergeDefaultOpt(options: TOpt): TOpt; refLookup($ref: string): JSONSchema; addUtil(util: string): void; - addProviderInfo(type: string, classname: string, filename: string): void; + addProviderInfo(contractName: string, type: string, classname: string, filename: string): void; getProviderInfos(): { - [key: string]: ProviderInfo; + [key: string]: { + [key: string]: ProviderInfo; + }; }; getImports(registeredUtils?: UtilMapping, filepath?: string): any; } diff --git a/packages/wasm-ast-types/types/provider/provider.d.ts b/packages/wasm-ast-types/types/provider/provider.d.ts index cef648c8..08c5cd62 100644 --- a/packages/wasm-ast-types/types/provider/provider.d.ts +++ b/packages/wasm-ast-types/types/provider/provider.d.ts @@ -1,3 +1,5 @@ import * as t from "@babel/types"; -export declare const createProvider: (name: string, methods: t.ClassMethod[]) => t.ExportNamedDeclaration; -export declare const createProviderFunction: (functionName: string, classname: string) => t.ClassMethod; +import { ProviderInfo } from "../context"; +export declare const createProvider: (name: string, providerInfos: { + [key: string]: ProviderInfo; +}) => t.ExportNamedDeclaration; diff --git a/packages/wasm-ast-types/types/utils/constants.d.ts b/packages/wasm-ast-types/types/utils/constants.d.ts index 447b24dc..8c2248fa 100644 --- a/packages/wasm-ast-types/types/utils/constants.d.ts +++ b/packages/wasm-ast-types/types/utils/constants.d.ts @@ -3,3 +3,8 @@ export declare const OPTIONAL_FUNDS_PARAM: t.Identifier; export declare const OPTIONAL_FEE_PARAM: t.Identifier; export declare const OPTIONAL_MEMO_PARAM: t.Identifier; export declare const FIXED_EXECUTE_PARAMS: t.Identifier[]; +export declare const PROVIDER_TYPES: { + SIGNING_CLIENT_TYPE: string; + QUERY_CLIENT_TYPE: string; + MESSAGE_COMPOSER_TYPE: string; +}; diff --git a/packages/wasm-ast-types/types/utils/index.d.ts b/packages/wasm-ast-types/types/utils/index.d.ts index aa3643b7..29c1c58e 100644 --- a/packages/wasm-ast-types/types/utils/index.d.ts +++ b/packages/wasm-ast-types/types/utils/index.d.ts @@ -3,3 +3,4 @@ export * from './types'; export * from './ref'; export { OPTIONAL_FUNDS_PARAM } from './constants'; export { FIXED_EXECUTE_PARAMS } from './constants'; +export { PROVIDER_TYPES } from './constants'; From 2f8759044ceffd9f6a984e27ffa6be7ebca299de Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Thu, 13 Jul 2023 11:08:06 +0800 Subject: [PATCH 127/287] finished provider generating --- .../contracts/CwAdminFactory.provider.ts | 3 +- .../contracts/CwCodeIdRegistry.provider.ts | 3 +- .../contracts/CwSingle.provider.ts | 3 +- .../contracts/Factory.provider.ts | 3 +- .../bundler_test/contracts/Minter.provider.ts | 3 +- .../contracts/contractContextBase.ts | 14 +- .../contracts/contractContextProviders.ts | 62 ++++++++ .../__snapshots__/builder.test.ts.snap | 4 +- packages/ts-codegen/src/builder/builder.ts | 18 ++- .../src/generators/create-helpers.ts | 5 +- .../src/helpers/contractContextBase.ts | 14 +- .../ts-codegen/src/plugins/provider-bundle.ts | 97 ++++++++++++ packages/ts-codegen/src/plugins/provider.ts | 36 +++-- .../ts-codegen/src/plugins/use-contracts.ts | 79 ---------- .../types/src/generators/create-helpers.d.ts | 3 +- .../src/helpers/contractContextBase.d.ts | 2 +- .../types/src/plugins/provider-bundle.d.ts | 13 ++ .../types/src/plugins/provider.d.ts | 2 + .../wasm-ast-types/src/context/context.ts | 7 + .../__snapshots__/provider.spec.ts.snap | 24 ++- .../src/provider/provider.spec.ts | 64 ++++++-- .../wasm-ast-types/src/provider/provider.ts | 148 +++++++++++++++++- .../wasm-ast-types/src/utils/constants.ts | 3 +- .../wasm-ast-types/types/context/context.d.ts | 5 + .../types/provider/provider.d.ts | 13 ++ .../wasm-ast-types/types/utils/constants.d.ts | 1 + 26 files changed, 484 insertions(+), 145 deletions(-) create mode 100644 __output__/builder/bundler_test/contracts/contractContextProviders.ts create mode 100644 packages/ts-codegen/src/plugins/provider-bundle.ts delete mode 100644 packages/ts-codegen/src/plugins/use-contracts.ts create mode 100644 packages/ts-codegen/types/src/plugins/provider-bundle.d.ts diff --git a/__output__/builder/bundler_test/contracts/CwAdminFactory.provider.ts b/__output__/builder/bundler_test/contracts/CwAdminFactory.provider.ts index f81eacdc..f8d0b76d 100644 --- a/__output__/builder/bundler_test/contracts/CwAdminFactory.provider.ts +++ b/__output__/builder/bundler_test/contracts/CwAdminFactory.provider.ts @@ -5,8 +5,7 @@ */ import { ContractBase, IContractConstructor } from "./contractContextBase"; -import { CwAdminFactoryClient } from "./CwAdminFactory.client"; -import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; +import { CwAdminFactoryClient, CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; import { CwAdminFactoryMessageComposer } from "./CwAdminFactory.message-composer"; export class CwAdminFactory extends ContractBase { constructor({ diff --git a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.provider.ts b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.provider.ts index 8bd16da5..ba841f2f 100644 --- a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.provider.ts +++ b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.provider.ts @@ -5,8 +5,7 @@ */ import { ContractBase, IContractConstructor } from "./contractContextBase"; -import { CwCodeIdRegistryClient } from "./CwCodeIdRegistry.client"; -import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; +import { CwCodeIdRegistryClient, CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; import { CwCodeIdRegistryMessageComposer } from "./CwCodeIdRegistry.message-composer"; export class CwCodeIdRegistry extends ContractBase { constructor({ diff --git a/__output__/builder/bundler_test/contracts/CwSingle.provider.ts b/__output__/builder/bundler_test/contracts/CwSingle.provider.ts index e1352be2..e3b2a3b3 100644 --- a/__output__/builder/bundler_test/contracts/CwSingle.provider.ts +++ b/__output__/builder/bundler_test/contracts/CwSingle.provider.ts @@ -5,8 +5,7 @@ */ import { ContractBase, IContractConstructor } from "./contractContextBase"; -import { CwSingleClient } from "./CwSingle.client"; -import { CwSingleQueryClient } from "./CwSingle.client"; +import { CwSingleClient, CwSingleQueryClient } from "./CwSingle.client"; import { CwSingleMessageComposer } from "./CwSingle.message-composer"; export class CwSingle extends ContractBase { constructor({ diff --git a/__output__/builder/bundler_test/contracts/Factory.provider.ts b/__output__/builder/bundler_test/contracts/Factory.provider.ts index a90baccc..34273f44 100644 --- a/__output__/builder/bundler_test/contracts/Factory.provider.ts +++ b/__output__/builder/bundler_test/contracts/Factory.provider.ts @@ -5,8 +5,7 @@ */ import { ContractBase, IContractConstructor } from "./contractContextBase"; -import { FactoryClient } from "./Factory.client"; -import { FactoryQueryClient } from "./Factory.client"; +import { FactoryClient, FactoryQueryClient } from "./Factory.client"; import { FactoryMessageComposer } from "./Factory.message-composer"; export class Factory extends ContractBase { constructor({ diff --git a/__output__/builder/bundler_test/contracts/Minter.provider.ts b/__output__/builder/bundler_test/contracts/Minter.provider.ts index 8814fb75..c5e6aa5f 100644 --- a/__output__/builder/bundler_test/contracts/Minter.provider.ts +++ b/__output__/builder/bundler_test/contracts/Minter.provider.ts @@ -5,8 +5,7 @@ */ import { ContractBase, IContractConstructor } from "./contractContextBase"; -import { MinterClient } from "./Minter.client"; -import { MinterQueryClient } from "./Minter.client"; +import { MinterClient, MinterQueryClient } from "./Minter.client"; import { MinterMessageComposer } from "./Minter.message-composer"; export class Minter extends ContractBase { constructor({ diff --git a/__output__/builder/bundler_test/contracts/contractContextBase.ts b/__output__/builder/bundler_test/contracts/contractContextBase.ts index 7de4022f..45b6b20a 100644 --- a/__output__/builder/bundler_test/contracts/contractContextBase.ts +++ b/__output__/builder/bundler_test/contracts/contractContextBase.ts @@ -34,24 +34,24 @@ export const NO_MESSAGE_COMPOSER_ERROR_MESSAGE = /** * a placeholder for non-generated classes */ -export class EmptyClient {} +export interface IEmptyClient {} -export interface SigningClientProvider { +export interface ISigningClientProvider { getSigningClient(contractAddr: string): T; } -export interface QueryClientProvider { +export interface IQueryClientProvider { getQueryClient(contractAddr: string): T; } -export interface MessageComposerProvider { +export interface IMessageComposerProvider { getMessageComposer(contractAddr: string): T; } export class ContractBase< - TSign = EmptyClient, - TQuery = EmptyClient, - TMsgComposer = EmptyClient + TSign = IEmptyClient, + TQuery = IEmptyClient, + TMsgComposer = IEmptyClient > { constructor( protected address: string | undefined, diff --git a/__output__/builder/bundler_test/contracts/contractContextProviders.ts b/__output__/builder/bundler_test/contracts/contractContextProviders.ts new file mode 100644 index 00000000..bf15d71a --- /dev/null +++ b/__output__/builder/bundler_test/contracts/contractContextProviders.ts @@ -0,0 +1,62 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate"; +import { IQueryClientProvider, ISigningClientProvider, IMessageComposerProvider } from "./contractContextBase"; +import { FactoryQueryClient } from "./Factory.client"; +import { FactoryClient } from "./Factory.client"; +import { FactoryMessageComposer } from "./Factory.message-composer"; +import { Factory } from "./Factory.provider"; +import { MinterQueryClient } from "./Minter.client"; +import { MinterClient } from "./Minter.client"; +import { MinterMessageComposer } from "./Minter.message-composer"; +import { Minter } from "./Minter.provider"; +import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; +import { CwAdminFactoryClient } from "./CwAdminFactory.client"; +import { CwAdminFactoryMessageComposer } from "./CwAdminFactory.message-composer"; +import { CwAdminFactory } from "./CwAdminFactory.provider"; +import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; +import { CwCodeIdRegistryClient } from "./CwCodeIdRegistry.client"; +import { CwCodeIdRegistryMessageComposer } from "./CwCodeIdRegistry.message-composer"; +import { CwCodeIdRegistry } from "./CwCodeIdRegistry.provider"; +import { CwSingleQueryClient } from "./CwSingle.client"; +import { CwSingleClient } from "./CwSingle.client"; +import { CwSingleMessageComposer } from "./CwSingle.message-composer"; +import { CwSingle } from "./CwSingle.provider"; +export interface IContractsContext { + factory: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; + minter: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; + cwAdminFactory: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; + cwCodeIdRegistry: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; + cwSingle: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; +} +export const getProviders = (address?: string, cosmWasmClient?: CosmWasmClient, signingCosmWasmClient?: SigningCosmWasmClient) => ({ + factory: new Factory({ + address, + cosmWasmClient, + signingCosmWasmClient + }), + minter: new Minter({ + address, + cosmWasmClient, + signingCosmWasmClient + }), + cwAdminFactory: new CwAdminFactory({ + address, + cosmWasmClient, + signingCosmWasmClient + }), + cwCodeIdRegistry: new CwCodeIdRegistry({ + address, + cosmWasmClient, + signingCosmWasmClient + }), + cwSingle: new CwSingle({ + address, + cosmWasmClient, + signingCosmWasmClient + }) +}); \ No newline at end of file diff --git a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap index e963687f..21fc022a 100644 --- a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap +++ b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap @@ -309,8 +309,8 @@ TSBuilder { }, "utils": Object { "ContractBase": "__contractContextBase__", - "EmptyClient": "__contractContextBase__", "IContractConstructor": "__contractContextBase__", + "IEmptyClient": "__contractContextBase__", }, }, ], @@ -626,8 +626,8 @@ TSBuilder { }, "utils": Object { "ContractBase": "__contractContextBase__", - "EmptyClient": "__contractContextBase__", "IContractConstructor": "__contractContextBase__", + "IEmptyClient": "__contractContextBase__", }, }, ], diff --git a/packages/ts-codegen/src/builder/builder.ts b/packages/ts-codegen/src/builder/builder.ts index 2950c324..fe1b2f39 100644 --- a/packages/ts-codegen/src/builder/builder.ts +++ b/packages/ts-codegen/src/builder/builder.ts @@ -23,6 +23,7 @@ import { ClientPlugin } from "../plugins/client"; import { TypesPlugin } from "../plugins/types"; import { ContractsContextProviderPlugin } from "../plugins/provider"; import { createHelpers } from "../generators/create-helpers"; +import { ContractsProviderBundlePlugin } from "../plugins/provider-bundle"; const defaultOpts: TSBuilderOptions = { bundle: { @@ -160,12 +161,27 @@ export class TSBuilder { this.bundle(); } + //create useContracts bundle file + const contractsProviderBundlePlugin = new ContractsProviderBundlePlugin(this.options); + contractsProviderBundlePlugin.setBuilder(this); + + let files = await contractsProviderBundlePlugin.render( + "", + { + schemas: [], + }, + this.outPath + ); + if(files && files.length){ + [].push.apply(this.files, files); + } + createHelpers({ outPath: this.outPath, contracts: this.contracts, options: this.options, plugins: this.plugins, - }); + }, this.builderContext); } async bundle() { diff --git a/packages/ts-codegen/src/generators/create-helpers.ts b/packages/ts-codegen/src/generators/create-helpers.ts index 0d40c2aa..c3b83495 100644 --- a/packages/ts-codegen/src/generators/create-helpers.ts +++ b/packages/ts-codegen/src/generators/create-helpers.ts @@ -4,6 +4,7 @@ import pkg from "../../package.json"; import { writeContentToFile } from "../utils/files"; import { TSBuilderInput } from "../builder"; import { contractContextBase, contractsContextTSX } from "../helpers"; +import { BuilderContext } from "wasm-ast-types"; const version = process.env.NODE_ENV === "test" ? "latest" : pkg.version; const header = `/** @@ -19,8 +20,8 @@ const write = (outPath: string, file: string, content: string) => { writeContentToFile(outPath, header + content, outFile); }; -export const createHelpers = (input: TSBuilderInput) => { - if (input.options?.useContracts?.enabled) { +export const createHelpers = (input: TSBuilderInput, builderContext: BuilderContext) => { + if (input.options?.useContracts?.enabled && Object.keys(builderContext.providers)?.length) { write(input.outPath, "contractContextBase.ts", contractContextBase); write(input.outPath, "contracts-context.tsx", contractsContextTSX); } diff --git a/packages/ts-codegen/src/helpers/contractContextBase.ts b/packages/ts-codegen/src/helpers/contractContextBase.ts index db2d7943..0a9d38ff 100644 --- a/packages/ts-codegen/src/helpers/contractContextBase.ts +++ b/packages/ts-codegen/src/helpers/contractContextBase.ts @@ -28,24 +28,24 @@ export const NO_MESSAGE_COMPOSER_ERROR_MESSAGE = /** * a placeholder for non-generated classes */ -export class EmptyClient {} +export interface IEmptyClient {} -export interface SigningClientProvider { +export interface ISigningClientProvider { getSigningClient(contractAddr: string): T; } -export interface QueryClientProvider { +export interface IQueryClientProvider { getQueryClient(contractAddr: string): T; } -export interface MessageComposerProvider { +export interface IMessageComposerProvider { getMessageComposer(contractAddr: string): T; } export class ContractBase< - TSign = EmptyClient, - TQuery = EmptyClient, - TMsgComposer = EmptyClient + TSign = IEmptyClient, + TQuery = IEmptyClient, + TMsgComposer = IEmptyClient > { constructor( protected address: string | undefined, diff --git a/packages/ts-codegen/src/plugins/provider-bundle.ts b/packages/ts-codegen/src/plugins/provider-bundle.ts new file mode 100644 index 00000000..c3c8fa87 --- /dev/null +++ b/packages/ts-codegen/src/plugins/provider-bundle.ts @@ -0,0 +1,97 @@ +import { pascal } from "case"; +import * as w from "wasm-ast-types"; +import { ContractInfo, RenderContextBase, RenderContext } from "wasm-ast-types"; +import { BuilderFileType, TSBuilderOptions } from "../builder"; +import { BuilderPluginBase } from "./plugin-base"; +import { GetLocalBaseNameByContractName } from "./provider"; + +export class ContractsProviderBundlePlugin extends BuilderPluginBase { + constructor(opt: TSBuilderOptions) { + super(opt); + + this.utils = { + CosmWasmClient: "@cosmjs/cosmwasm-stargate", + SigningCosmWasmClient: "@cosmjs/cosmwasm-stargate", + IQueryClientProvider: "__contractContextBase__", + ISigningClientProvider: "__contractContextBase__", + IMessageComposerProvider: "__contractContextBase__", + }; + } + + initContext( + contract: ContractInfo, + options?: TSBuilderOptions + ): RenderContextBase { + return new RenderContext(contract, options, this.builder.builderContext); + } + + async doRender( + name: string, + context: RenderContext + ): Promise< + { + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[] + > { + if (!this.option?.useContracts?.enabled) { + return; + } + + const providerInfos = context.getProviderInfos(); + + if (!Object.keys(providerInfos)?.length) { + return; + } + + const localname = "contractContextProviders.ts"; + + const body = []; + + context.addUtil("CosmWasmClient"); + context.addUtil("SigningCosmWasmClient"); + + context.addUtil("IQueryClientProvider"); + context.addUtil("ISigningClientProvider"); + context.addUtil("IMessageComposerProvider"); + + for (const name in providerInfos) { + if (Object.prototype.hasOwnProperty.call(providerInfos, name)) { + const providerInfo = providerInfos[name]; + + for (const key in providerInfo) { + if (Object.prototype.hasOwnProperty.call(providerInfo, key)) { + const info = providerInfo[key]; + + body.push( + w.importStmt( + [info.classname], + `./${info.basename}` + ) + ); + } + } + + body.push( + w.importStmt( + [pascal(name)], + `./${GetLocalBaseNameByContractName(name)}` + ) + ); + } + } + + body.push(w.createIContractsContext(providerInfos)); + body.push(w.createGettingProviders(providerInfos)); + + return [ + { + type: "plugin", + localname, + body, + }, + ]; + } +} diff --git a/packages/ts-codegen/src/plugins/provider.ts b/packages/ts-codegen/src/plugins/provider.ts index 4a74442e..ae6cecf5 100644 --- a/packages/ts-codegen/src/plugins/provider.ts +++ b/packages/ts-codegen/src/plugins/provider.ts @@ -4,6 +4,12 @@ import { ContractInfo, RenderContextBase, RenderContext } from "wasm-ast-types"; import { BuilderFileType, TSBuilderOptions } from "../builder"; import { BuilderPluginBase } from "./plugin-base"; +export const GetLocalNameByContractName = (name) => + `${pascal(name)}.provider.ts`; + +export const GetLocalBaseNameByContractName = (name) => + `${pascal(name)}.provider`; + export class ContractsContextProviderPlugin extends BuilderPluginBase { constructor(opt: TSBuilderOptions) { super(opt); @@ -11,7 +17,7 @@ export class ContractsContextProviderPlugin extends BuilderPluginBase { - initContext( - contract: ContractInfo, - options?: TSBuilderOptions - ): RenderContextBase { - return new RenderContext(contract, options); - } - - async doRender( - name: string, - context: RenderContext - ): Promise< - { - type: BuilderFileType; - pluginType?: string; - localname: string; - body: any[]; - }[] - > { - const { enabled } = this.option.useContracts; - - if (!enabled) { - return; - } - - const localname = pascal(name) + '.message-composer.ts'; - - const TypesFile = pascal(name) + '.types'; - - // const ExecuteMsg = findExecuteMsg(schemas); - // const typeHash = await findAndParseTypes(schemas); - - const body = []; - - // body.push(w.importStmt(Object.keys(typeHash), `./${TypesFile}`)); - - // // execute messages - // if (ExecuteMsg) { - // const children = getMessageProperties(ExecuteMsg); - // if (children.length > 0) { - // const TheClass = pascal(`${name}MessageComposer`); - // const Interface = pascal(`${name}Message`); - - // body.push( - // w.createMessageComposerInterface(context, Interface, ExecuteMsg) - // ); - // body.push( - // w.createMessageComposerClass(context, TheClass, Interface, ExecuteMsg) - // ); - // } - // } - - // if (typeHash.hasOwnProperty('Coin')) { - // // @ts-ignore - // delete context.utils.Coin; - // } - - return [ - { - type: 'message-composer', - localname, - body - } - ]; - } -} diff --git a/packages/ts-codegen/types/src/generators/create-helpers.d.ts b/packages/ts-codegen/types/src/generators/create-helpers.d.ts index f1d28914..8ce9a180 100644 --- a/packages/ts-codegen/types/src/generators/create-helpers.d.ts +++ b/packages/ts-codegen/types/src/generators/create-helpers.d.ts @@ -1,2 +1,3 @@ import { TSBuilderInput } from "../builder"; -export declare const createHelpers: (input: TSBuilderInput) => void; +import { BuilderContext } from "wasm-ast-types"; +export declare const createHelpers: (input: TSBuilderInput, builderContext: BuilderContext) => void; diff --git a/packages/ts-codegen/types/src/helpers/contractContextBase.d.ts b/packages/ts-codegen/types/src/helpers/contractContextBase.d.ts index 75da5eec..a21bffcf 100644 --- a/packages/ts-codegen/types/src/helpers/contractContextBase.d.ts +++ b/packages/ts-codegen/types/src/helpers/contractContextBase.d.ts @@ -1 +1 @@ -export declare const contractContextBase = "\nimport {\n CosmWasmClient,\n SigningCosmWasmClient,\n} from '@cosmjs/cosmwasm-stargate';\n\nexport interface IContractConstructor {\n address: string | undefined;\n cosmWasmClient: CosmWasmClient | undefined;\n signingCosmWasmClient: SigningCosmWasmClient | undefined;\n}\n\nexport const NO_SINGING_ERROR_MESSAGE = 'signingCosmWasmClient not connected';\n\nexport const NO_COSMWASW_CLIENT_ERROR_MESSAGE = 'cosmWasmClient not connected';\n\nexport const NO_ADDRESS_ERROR_MESSAGE = \"address doesn't exist\";\n\nexport const NO_SIGNING_CLIENT_ERROR_MESSAGE =\n 'Signing client is not generated. Please check ts-codegen config';\n\nexport const NO_QUERY_CLIENT_ERROR_MESSAGE =\n 'Query client is not generated. Please check ts-codegen config';\n\nexport const NO_MESSAGE_COMPOSER_ERROR_MESSAGE =\n 'Message composer client is not generated. Please check ts-codegen config';\n\n/**\n * a placeholder for non-generated classes\n */\nexport class EmptyClient {}\n\nexport interface SigningClientProvider {\n getSigningClient(contractAddr: string): T;\n}\n\nexport interface QueryClientProvider {\n getQueryClient(contractAddr: string): T;\n}\n\nexport interface MessageComposerProvider {\n getMessageComposer(contractAddr: string): T;\n}\n\nexport class ContractBase<\n TSign = EmptyClient,\n TQuery = EmptyClient,\n TMsgComposer = EmptyClient\n> {\n constructor(\n protected address: string | undefined,\n protected cosmWasmClient: CosmWasmClient | undefined,\n protected signingCosmWasmClient: SigningCosmWasmClient | undefined,\n private TSign?: new (\n client: SigningCosmWasmClient,\n sender: string,\n contractAddress: string\n ) => TSign,\n private TQuery?: new (\n client: CosmWasmClient,\n contractAddress: string\n ) => TQuery,\n private TMsgComposer?: new (\n sender: string,\n contractAddress: string\n ) => TMsgComposer\n ) {}\n\n public getSigningClient(contractAddr: string): TSign {\n if (!this.signingCosmWasmClient) throw new Error(NO_SINGING_ERROR_MESSAGE);\n if (!this.address) throw new Error(NO_ADDRESS_ERROR_MESSAGE);\n if (!this.TSign) throw new Error(NO_SIGNING_CLIENT_ERROR_MESSAGE);\n return new this.TSign(\n this.signingCosmWasmClient,\n this.address,\n contractAddr\n );\n }\n\n public getQueryClient(contractAddr: string): TQuery {\n if (!this.cosmWasmClient) throw new Error(NO_COSMWASW_CLIENT_ERROR_MESSAGE);\n if (!this.TQuery) throw new Error(NO_QUERY_CLIENT_ERROR_MESSAGE);\n return new this.TQuery(this.cosmWasmClient, contractAddr);\n }\n\n public getMessageComposer(contractAddr: string): TMsgComposer {\n if (!this.address) throw new Error(NO_ADDRESS_ERROR_MESSAGE);\n if (!this.TMsgComposer) throw new Error(NO_MESSAGE_COMPOSER_ERROR_MESSAGE);\n return new this.TMsgComposer(this.address, contractAddr);\n }\n}\n"; +export declare const contractContextBase = "\nimport {\n CosmWasmClient,\n SigningCosmWasmClient,\n} from '@cosmjs/cosmwasm-stargate';\n\nexport interface IContractConstructor {\n address: string | undefined;\n cosmWasmClient: CosmWasmClient | undefined;\n signingCosmWasmClient: SigningCosmWasmClient | undefined;\n}\n\nexport const NO_SINGING_ERROR_MESSAGE = 'signingCosmWasmClient not connected';\n\nexport const NO_COSMWASW_CLIENT_ERROR_MESSAGE = 'cosmWasmClient not connected';\n\nexport const NO_ADDRESS_ERROR_MESSAGE = \"address doesn't exist\";\n\nexport const NO_SIGNING_CLIENT_ERROR_MESSAGE =\n 'Signing client is not generated. Please check ts-codegen config';\n\nexport const NO_QUERY_CLIENT_ERROR_MESSAGE =\n 'Query client is not generated. Please check ts-codegen config';\n\nexport const NO_MESSAGE_COMPOSER_ERROR_MESSAGE =\n 'Message composer client is not generated. Please check ts-codegen config';\n\n/**\n * a placeholder for non-generated classes\n */\nexport interface IEmptyClient {}\n\nexport interface ISigningClientProvider {\n getSigningClient(contractAddr: string): T;\n}\n\nexport interface IQueryClientProvider {\n getQueryClient(contractAddr: string): T;\n}\n\nexport interface IMessageComposerProvider {\n getMessageComposer(contractAddr: string): T;\n}\n\nexport class ContractBase<\n TSign = IEmptyClient,\n TQuery = IEmptyClient,\n TMsgComposer = IEmptyClient\n> {\n constructor(\n protected address: string | undefined,\n protected cosmWasmClient: CosmWasmClient | undefined,\n protected signingCosmWasmClient: SigningCosmWasmClient | undefined,\n private TSign?: new (\n client: SigningCosmWasmClient,\n sender: string,\n contractAddress: string\n ) => TSign,\n private TQuery?: new (\n client: CosmWasmClient,\n contractAddress: string\n ) => TQuery,\n private TMsgComposer?: new (\n sender: string,\n contractAddress: string\n ) => TMsgComposer\n ) {}\n\n public getSigningClient(contractAddr: string): TSign {\n if (!this.signingCosmWasmClient) throw new Error(NO_SINGING_ERROR_MESSAGE);\n if (!this.address) throw new Error(NO_ADDRESS_ERROR_MESSAGE);\n if (!this.TSign) throw new Error(NO_SIGNING_CLIENT_ERROR_MESSAGE);\n return new this.TSign(\n this.signingCosmWasmClient,\n this.address,\n contractAddr\n );\n }\n\n public getQueryClient(contractAddr: string): TQuery {\n if (!this.cosmWasmClient) throw new Error(NO_COSMWASW_CLIENT_ERROR_MESSAGE);\n if (!this.TQuery) throw new Error(NO_QUERY_CLIENT_ERROR_MESSAGE);\n return new this.TQuery(this.cosmWasmClient, contractAddr);\n }\n\n public getMessageComposer(contractAddr: string): TMsgComposer {\n if (!this.address) throw new Error(NO_ADDRESS_ERROR_MESSAGE);\n if (!this.TMsgComposer) throw new Error(NO_MESSAGE_COMPOSER_ERROR_MESSAGE);\n return new this.TMsgComposer(this.address, contractAddr);\n }\n}\n"; diff --git a/packages/ts-codegen/types/src/plugins/provider-bundle.d.ts b/packages/ts-codegen/types/src/plugins/provider-bundle.d.ts new file mode 100644 index 00000000..e50caa8e --- /dev/null +++ b/packages/ts-codegen/types/src/plugins/provider-bundle.d.ts @@ -0,0 +1,13 @@ +import { ContractInfo, RenderContextBase, RenderContext } from "wasm-ast-types"; +import { BuilderFileType, TSBuilderOptions } from "../builder"; +import { BuilderPluginBase } from "./plugin-base"; +export declare class ContractsProviderBundlePlugin extends BuilderPluginBase { + constructor(opt: TSBuilderOptions); + initContext(contract: ContractInfo, options?: TSBuilderOptions): RenderContextBase; + doRender(name: string, context: RenderContext): Promise<{ + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[]>; +} diff --git a/packages/ts-codegen/types/src/plugins/provider.d.ts b/packages/ts-codegen/types/src/plugins/provider.d.ts index cecb56d0..94bd36f5 100644 --- a/packages/ts-codegen/types/src/plugins/provider.d.ts +++ b/packages/ts-codegen/types/src/plugins/provider.d.ts @@ -1,6 +1,8 @@ import { ContractInfo, RenderContextBase, RenderContext } from "wasm-ast-types"; import { BuilderFileType, TSBuilderOptions } from "../builder"; import { BuilderPluginBase } from "./plugin-base"; +export declare const GetLocalNameByContractName: (name: any) => string; +export declare const GetLocalBaseNameByContractName: (name: any) => string; export declare class ContractsContextProviderPlugin extends BuilderPluginBase { constructor(opt: TSBuilderOptions); initContext(contract: ContractInfo, options?: TSBuilderOptions): RenderContextBase; diff --git a/packages/wasm-ast-types/src/context/context.ts b/packages/wasm-ast-types/src/context/context.ts index 174fa13a..6c907028 100644 --- a/packages/wasm-ast-types/src/context/context.ts +++ b/packages/wasm-ast-types/src/context/context.ts @@ -158,6 +158,13 @@ export class BuilderContext{ basename: basename(filename, extname(filename)) }; } + getProviderInfos(): { + [key: string]: { + [key: string]: ProviderInfo; + }; + }{ + return this.providers; + } } /** diff --git a/packages/wasm-ast-types/src/provider/__snapshots__/provider.spec.ts.snap b/packages/wasm-ast-types/src/provider/__snapshots__/provider.spec.ts.snap index 10b5a8ad..7520f8ff 100644 --- a/packages/wasm-ast-types/src/provider/__snapshots__/provider.spec.ts.snap +++ b/packages/wasm-ast-types/src/provider/__snapshots__/provider.spec.ts.snap @@ -1,5 +1,27 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`create IContractsContext 1`] = ` +"export interface IContractsContext { + whitelist: ISigningClientProvider & IQueryClientProvider; + marketplace: ISigningClientProvider; +}" +`; + +exports[`create getProviders 1`] = ` +"export const getProviders = (address?: string, cosmWasmClient?: CosmWasmClient, signingCosmWasmClient?: SigningCosmWasmClient) => ({ + whitelist: new Whitelist({ + address, + cosmWasmClient, + signingCosmWasmClient + }), + marketplace: new Marketplace({ + address, + cosmWasmClient, + signingCosmWasmClient + }) +});" +`; + exports[`execute class 1`] = ` "export class Whitelist extends ContractBase { constructor({ @@ -14,7 +36,7 @@ exports[`execute class 1`] = ` `; exports[`execute class without message composer 1`] = ` -"export class Whitelist extends ContractBase { +"export class Whitelist extends ContractBase { constructor({ address, cosmWasmClient, diff --git a/packages/wasm-ast-types/src/provider/provider.spec.ts b/packages/wasm-ast-types/src/provider/provider.spec.ts index b27f83cb..fb333df9 100644 --- a/packages/wasm-ast-types/src/provider/provider.spec.ts +++ b/packages/wasm-ast-types/src/provider/provider.spec.ts @@ -1,7 +1,7 @@ import execute_msg from "../../../../__fixtures__/basic/execute_msg_for__empty.json"; import query_msg from "../../../../__fixtures__/basic/query_msg.json"; import ownership from "../../../../__fixtures__/basic/ownership.json"; -import { createProvider } from "./provider"; +import { createGettingProviders, createIContractsContext, createProvider } from "./provider"; import { expectCode, makeContext } from "../../test-utils"; import { PROVIDER_TYPES } from "../utils/constants"; @@ -10,16 +10,16 @@ it("execute class", () => { let info = {}; info[PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = { - classname: "WhitelistClient" - } + classname: "WhitelistClient", + }; info[PROVIDER_TYPES.QUERY_CLIENT_TYPE] = { - classname: "WhitelistQueryClient" - } + classname: "WhitelistQueryClient", + }; info[PROVIDER_TYPES.MESSAGE_COMPOSER_TYPE] = { - classname: "WhitelistMessageComposer" - } + classname: "WhitelistMessageComposer", + }; expectCode(createProvider("Whitelist", info)); }); @@ -28,12 +28,54 @@ it("execute class without message composer", () => { let info = {}; info[PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = { - classname: "WhitelistClient" - } + classname: "WhitelistClient", + }; info[PROVIDER_TYPES.QUERY_CLIENT_TYPE] = { - classname: "WhitelistQueryClient" - } + classname: "WhitelistQueryClient", + }; expectCode(createProvider("Whitelist", info)); }); + +it("create IContractsContext", () => { + let info = { + Whitelist: {}, + Marketplace: {}, + }; + + info["Whitelist"][PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = { + classname: "WhitelistClient", + }; + + info["Whitelist"][PROVIDER_TYPES.QUERY_CLIENT_TYPE] = { + classname: "WhitelistQueryClient", + }; + + info["Marketplace"][PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = { + classname: "MarketplaceClient", + }; + + expectCode(createIContractsContext(info)); +}); + +it("create getProviders", () => { + let info = { + Whitelist: {}, + Marketplace: {}, + }; + + info["Whitelist"][PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = { + classname: "WhitelistClient", + }; + + info["Whitelist"][PROVIDER_TYPES.QUERY_CLIENT_TYPE] = { + classname: "WhitelistQueryClient", + }; + + info["Marketplace"][PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = { + classname: "MarketplaceClient", + }; + + expectCode(createGettingProviders(info)); +}); diff --git a/packages/wasm-ast-types/src/provider/provider.ts b/packages/wasm-ast-types/src/provider/provider.ts index 85f63db3..bcdaf493 100644 --- a/packages/wasm-ast-types/src/provider/provider.ts +++ b/packages/wasm-ast-types/src/provider/provider.ts @@ -1,8 +1,8 @@ import * as t from "@babel/types"; -import { pascal } from "case"; -import { ProviderInfo } from "../context"; +import { camel, pascal } from "case"; +import { ProviderInfo, RenderContext } from "../context"; import { PROVIDER_TYPES } from "../utils/constants"; -import { tsObjectPattern } from "../utils"; +import { identifier, tsObjectPattern } from "../utils"; export const createProvider = ( name: string, @@ -78,24 +78,160 @@ export const createProvider = ( t.identifier( providerInfos[PROVIDER_TYPES.SIGNING_CLIENT_TYPE] ? providerInfos[PROVIDER_TYPES.SIGNING_CLIENT_TYPE].classname - : "EmptyClient" + : "IEmptyClient" ) ), t.tsTypeReference( t.identifier( providerInfos[PROVIDER_TYPES.QUERY_CLIENT_TYPE] ? providerInfos[PROVIDER_TYPES.QUERY_CLIENT_TYPE].classname - : "EmptyClient" + : "IEmptyClient" ) ), t.tsTypeReference( t.identifier( providerInfos[PROVIDER_TYPES.MESSAGE_COMPOSER_TYPE] ? providerInfos[PROVIDER_TYPES.MESSAGE_COMPOSER_TYPE].classname - : "EmptyClient" + : "IEmptyClient" ) ), ]); return t.exportNamedDeclaration(classDeclaration); }; + +export const createIContractsContext = (providerInfos: { + [key: string]: { + [key: string]: ProviderInfo; + }; +}) => { + const properties: t.TSTypeElement[] = []; + + for (const key in providerInfos) { + if (Object.prototype.hasOwnProperty.call(providerInfos, key)) { + const contractProviderInfo = providerInfos[key]; + + properties.push(createProperty(key, contractProviderInfo)); + } + } + + return t.exportNamedDeclaration( + t.tsInterfaceDeclaration( + t.identifier("IContractsContext"), + null, + null, + t.tsInterfaceBody(properties) + ) + ); +}; + +let PROVIDER_MAPPING = {}; + +PROVIDER_MAPPING[PROVIDER_TYPES.SIGNING_CLIENT_TYPE] = "ISigningClientProvider"; +PROVIDER_MAPPING[PROVIDER_TYPES.QUERY_CLIENT_TYPE] = "IQueryClientProvider"; +PROVIDER_MAPPING[PROVIDER_TYPES.MESSAGE_COMPOSER_TYPE] = + "IMessageComposerProvider"; + +export const createProperty = ( + name: string, + providerInfos: { + [key: string]: ProviderInfo; + } +): t.TSTypeElement => { + let typeAnnotation: t.TSTypeAnnotation = null; + + const keys = Object.keys(providerInfos); + + if (keys?.length == 1) { + const key = keys[0]; + + typeAnnotation = t.tsTypeAnnotation( + t.tsTypeReference( + t.identifier(PROVIDER_MAPPING[key]), + t.tsTypeParameterInstantiation([ + t.tsTypeReference(t.identifier(providerInfos[key].classname)), + ]) + ) + ); + } else { + const typeRefs: t.TSTypeReference[] = []; + + for (const key of keys) { + typeRefs.push( + t.tsTypeReference( + t.identifier(PROVIDER_MAPPING[key]), + t.tsTypeParameterInstantiation([ + t.tsTypeReference(t.identifier(providerInfos[key].classname)), + ]) + ) + ); + } + + typeAnnotation = t.tsTypeAnnotation(t.tsIntersectionType(typeRefs)); + } + + return t.tsPropertySignature(t.identifier(camel(name)), typeAnnotation); +}; + +export const createGettingProviders = (providerInfos: { + [key: string]: { + [key: string]: ProviderInfo; + }; +}) => { + const properties = []; + + for (const key of Object.keys(providerInfos)) { + properties.push( + t.objectProperty( + t.identifier(camel(key)), + t.newExpression(t.identifier(pascal(key)), [ + t.objectExpression([ + t.objectProperty( + t.identifier("address"), + t.identifier("address"), + false, + true + ), + t.objectProperty( + t.identifier("cosmWasmClient"), + t.identifier("cosmWasmClient"), + false, + true + ), + t.objectProperty( + t.identifier("signingCosmWasmClient"), + t.identifier("signingCosmWasmClient"), + false, + true + ), + ]), + ]) + ) + ); + } + + return t.exportNamedDeclaration( + t.variableDeclaration("const", [ + t.variableDeclarator( + t.identifier("getProviders"), + t.arrowFunctionExpression( + [ + identifier( + "address?", + t.tsTypeAnnotation(t.tsTypeReference(t.identifier("string"))) + ), + identifier( + "cosmWasmClient?", + t.tsTypeAnnotation(t.tsTypeReference(t.identifier("CosmWasmClient"))) + ), + identifier( + "signingCosmWasmClient?", + t.tsTypeAnnotation(t.tsTypeReference(t.identifier("SigningCosmWasmClient"))) + ), + ], + t.objectExpression(properties) + ) + ), + ]) + ); +}; diff --git a/packages/wasm-ast-types/src/utils/constants.ts b/packages/wasm-ast-types/src/utils/constants.ts index 39196997..e4f534fe 100644 --- a/packages/wasm-ast-types/src/utils/constants.ts +++ b/packages/wasm-ast-types/src/utils/constants.ts @@ -32,5 +32,6 @@ export const FIXED_EXECUTE_PARAMS = [ export const PROVIDER_TYPES = { SIGNING_CLIENT_TYPE: "client", QUERY_CLIENT_TYPE: "queryClient", - MESSAGE_COMPOSER_TYPE : 'message-composer' + MESSAGE_COMPOSER_TYPE : 'message-composer', + PROVIDER_TYPE : 'provider' }; diff --git a/packages/wasm-ast-types/types/context/context.d.ts b/packages/wasm-ast-types/types/context/context.d.ts index b40cad89..8ab4b255 100644 --- a/packages/wasm-ast-types/types/context/context.d.ts +++ b/packages/wasm-ast-types/types/context/context.d.ts @@ -85,6 +85,11 @@ export declare class BuilderContext { }; }; addProviderInfo(contractName: string, type: string, classname: string, filename: string): void; + getProviderInfos(): { + [key: string]: { + [key: string]: ProviderInfo; + }; + }; } /** * context object for generating code. diff --git a/packages/wasm-ast-types/types/provider/provider.d.ts b/packages/wasm-ast-types/types/provider/provider.d.ts index 08c5cd62..9d89a784 100644 --- a/packages/wasm-ast-types/types/provider/provider.d.ts +++ b/packages/wasm-ast-types/types/provider/provider.d.ts @@ -3,3 +3,16 @@ import { ProviderInfo } from "../context"; export declare const createProvider: (name: string, providerInfos: { [key: string]: ProviderInfo; }) => t.ExportNamedDeclaration; +export declare const createIContractsContext: (providerInfos: { + [key: string]: { + [key: string]: ProviderInfo; + }; +}) => t.ExportNamedDeclaration; +export declare const createProperty: (name: string, providerInfos: { + [key: string]: ProviderInfo; +}) => t.TSTypeElement; +export declare const createGettingProviders: (providerInfos: { + [key: string]: { + [key: string]: ProviderInfo; + }; +}) => t.ExportNamedDeclaration; diff --git a/packages/wasm-ast-types/types/utils/constants.d.ts b/packages/wasm-ast-types/types/utils/constants.d.ts index 8c2248fa..5910254f 100644 --- a/packages/wasm-ast-types/types/utils/constants.d.ts +++ b/packages/wasm-ast-types/types/utils/constants.d.ts @@ -7,4 +7,5 @@ export declare const PROVIDER_TYPES: { SIGNING_CLIENT_TYPE: string; QUERY_CLIENT_TYPE: string; MESSAGE_COMPOSER_TYPE: string; + PROVIDER_TYPE: string; }; From 9c38e7319a3148c39de1be5819d2f2e3face4474 Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Fri, 14 Jul 2023 07:24:59 +0800 Subject: [PATCH 128/287] update gitignore --- .gitignore | 1 + packages/ts-codegen/.gitignore | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index be08fab7..031b0da3 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ coverage packages/**/build packages/**/main packages/**/module +testgen diff --git a/packages/ts-codegen/.gitignore b/packages/ts-codegen/.gitignore index d93985ec..88dd9e52 100644 --- a/packages/ts-codegen/.gitignore +++ b/packages/ts-codegen/.gitignore @@ -45,4 +45,5 @@ package-lock.json yarn.lock # others -.DS_Store \ No newline at end of file +.DS_Store +testgen \ No newline at end of file From 4553eb80cd89969583df6164d1c764ab5b289c63 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 14 Jul 2023 04:25:26 +0200 Subject: [PATCH 129/287] chore(release): publish - @cosmwasm/ts-codegen@0.31.0 - wasm-ast-types@0.24.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 95172642..d975d487 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.31.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.30.1...@cosmwasm/ts-codegen@0.31.0) (2023-07-14) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.30.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.30.0...@cosmwasm/ts-codegen@0.30.1) (2023-06-07) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index f9c5dcdf..2d361fdc 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.30.1", + "version": "0.31.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.23.1" + "wasm-ast-types": "^0.24.0" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index a8cedad0..daafd629 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.24.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.23.1...wasm-ast-types@0.24.0) (2023-07-14) + +**Note:** Version bump only for package wasm-ast-types + + + + + ## [0.23.1](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.23.0...wasm-ast-types@0.23.1) (2023-06-07) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index 8fa47c96..a4d4ce0d 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.23.1", + "version": "0.24.0", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From fbb9468f60ecbeb31b33a5183945aa1d2bed400c Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 14 Jul 2023 04:35:12 +0200 Subject: [PATCH 130/287] readme --- README.md | 52 +++++++++++++++--------------- packages/ts-codegen/README.md | 59 ++++++++++++++++++----------------- 2 files changed, 57 insertions(+), 54 deletions(-) diff --git a/README.md b/README.md index 70a871ea..018ccc30 100644 --- a/README.md +++ b/README.md @@ -136,11 +136,11 @@ Typescript types and interfaces are generated in separate files so they can be i #### Types Options - | option | description | --------------------------| ----------------------------- | --------------------------------------------------- | - | `types.enabled` | enable type generation | - | `types.aliasExecuteMsg` | generate a type alias based on the contract name | - | `types.aliasEntryPoints` | generate type aliases for the entry points based on the contract name | + | option | description | + | ------------------------ | ---------------------------------------------------- | + | `types.enabled` | enable type generation | + | `types.aliasExecuteMsg` | generate a type alias based on the contract name | + | `types.aliasEntryPoints` | generate type aliases for the entry points based on the contract name | ### Client @@ -173,15 +173,15 @@ Generate [react-query v3](https://react-query-v3.tanstack.com/) or [react-query #### React Query Options - | option | description | - | ---------------------------- | ---------------------------------------------------------------------------- | - | `reactQuery.enabled` | enable the react-query plugin | - | `reactQuery.optionalClient` | allows contract client to be undefined as the component renders | - | `reactQuery.queryKeys` | generates a const queryKeys object for use with invalidations and set values | - | `reactQuery.queryFactory` | generates a const queryFactory object for useQueries and prefetchQueries use | - | `reactQuery.version` | `v4` uses `@tanstack/react-query` and `v3` uses `react-query` | - | `reactQuery.mutations` | also generate mutations | - | `reactQuery.camelize` | use camelCase style for property names | +| option | description | +| --------------------------- | --------------------------------------------------------------------------- | +| `reactQuery.enabled` | enable the react-query plugin | +| `reactQuery.optionalClient` | allows contract client to be undefined as the component renders | +| `reactQuery.queryKeys` | generates a const queryKeys object for use with invalidations and set values | +| `reactQuery.queryFactory` | generates a const queryFactory object for useQueries and prefetchQueries use | +| `reactQuery.version` | `v4` uses `@tanstack/react-query` and `v3` uses `react-query` | +| `reactQuery.mutations` | also generate mutations | +| `reactQuery.camelize` | use camelCase style for property names | #### React Query via CLI @@ -231,9 +231,9 @@ cosmwasm-ts-codegen generate \ #### Recoil Options - | option | description | - | ------------------------------ | ------------------------------------------------------------------- | - | `recoil.enabled` | enable the recoil plugin | +| option | description | +| ------------------------------ | ------------------------------------------------------------------- | +| `recoil.enabled` | enable the recoil plugin | ### Message Composer @@ -252,9 +252,9 @@ cosmwasm-ts-codegen generate \ ``` #### Message Composer Options - | option | description | - | ------------------------------ | ------------------------------------------------------------------- | - | `messageComposer.enabled` | enable the messageComposer plugin | +| option | description | +| ------------------------------ | ------------------------------------------------------------------- | +| `messageComposer.enabled` | enable the messageComposer plugin | ### Msg Builder @@ -274,7 +274,7 @@ cosmwasm-ts-codegen generate \ #### Message Composer Options | option | description | --------------| ------------------------------ | ------------------------------------------------------------------- | +|------------ | ------------------------------ | ------------------------------------------------------------------- | | `msgBuilder.enabled` | enable the msgBilder plugin | @@ -292,11 +292,11 @@ const { CwAdminFactoryClient } = contracts.CwAdminFactory; ``` #### Bundler Options - | option | description | - | --------------------- | -------------------------------------------------------------------------------- | - | `bundle.enabled` | enable the bundler plugin | - | `bundle.scope` | name of the scope, defaults to `contracts` (you can use `.` to make more scopes) | - | `bundle.bundleFile` | name of the bundle file | +| option | description | +| --------------------- | -------------------------------------------------------------------------------- | +| `bundle.enabled` | enable the bundler plugin | +| `bundle.scope` | name of the scope, defaults to `contracts` (you can use `.` to make more scopes) | +| `bundle.bundleFile` | name of the bundle file | ### CLI Usage and Examples diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index bc9fb14d..018ccc30 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -36,7 +36,6 @@ The quickest and easiest way to interact with CosmWasm Contracts. `@cosmwasm/ts- - [React Query](#react-query) - [Recoil](#recoil) - [Message Composer](#message-composer) - - [Msg Builder](#msg-builder) - [Bundles](#bundles) - [CLI Usage and Examples](#cli-usage-and-examples) - [Advanced Usage](#advanced-usage) @@ -121,7 +120,7 @@ codegen({ messageComposer: { enabled: false }, - msgBuilder: { + msgBuilder: { enabled: false } } @@ -137,11 +136,11 @@ Typescript types and interfaces are generated in separate files so they can be i #### Types Options - | option | description | - | ----------------------------- | --------------------------------------------------- | - | `types.enabled` | enable type generation | - | `types.aliasExecuteMsg` | generate a type alias based on the contract name | - | `types.aliasEntryPoints` | generate type aliases for the entry points based on the contract name | + | option | description | + | ------------------------ | ---------------------------------------------------- | + | `types.enabled` | enable type generation | + | `types.aliasExecuteMsg` | generate a type alias based on the contract name | + | `types.aliasEntryPoints` | generate type aliases for the entry points based on the contract name | ### Client @@ -174,15 +173,15 @@ Generate [react-query v3](https://react-query-v3.tanstack.com/) or [react-query #### React Query Options - | option | description | - | ---------------------------- | ---------------------------------------------------------------------------- | - | `reactQuery.enabled` | enable the react-query plugin | - | `reactQuery.optionalClient` | allows contract client to be undefined as the component renders | - | `reactQuery.queryKeys` | generates a const queryKeys object for use with invalidations and set values | - | `reactQuery.queryFactory` | generates a const queryFactory object for useQueries and prefetchQueries use | - | `reactQuery.version` | `v4` uses `@tanstack/react-query` and `v3` uses `react-query` | - | `reactQuery.mutations` | also generate mutations | - | `reactQuery.camelize` | use camelCase style for property names | +| option | description | +| --------------------------- | --------------------------------------------------------------------------- | +| `reactQuery.enabled` | enable the react-query plugin | +| `reactQuery.optionalClient` | allows contract client to be undefined as the component renders | +| `reactQuery.queryKeys` | generates a const queryKeys object for use with invalidations and set values | +| `reactQuery.queryFactory` | generates a const queryFactory object for useQueries and prefetchQueries use | +| `reactQuery.version` | `v4` uses `@tanstack/react-query` and `v3` uses `react-query` | +| `reactQuery.mutations` | also generate mutations | +| `reactQuery.camelize` | use camelCase style for property names | #### React Query via CLI @@ -232,9 +231,9 @@ cosmwasm-ts-codegen generate \ #### Recoil Options - | option | description | - | ------------------------------ | ------------------------------------------------------------------- | - | `recoil.enabled` | enable the recoil plugin | +| option | description | +| ------------------------------ | ------------------------------------------------------------------- | +| `recoil.enabled` | enable the recoil plugin | ### Message Composer @@ -253,9 +252,9 @@ cosmwasm-ts-codegen generate \ ``` #### Message Composer Options - | option | description | - | ------------------------------ | ------------------------------------------------------------------- | - | `messageComposer.enabled` | enable the messageComposer plugin | +| option | description | +| ------------------------------ | ------------------------------------------------------------------- | +| `messageComposer.enabled` | enable the messageComposer plugin | ### Msg Builder @@ -275,7 +274,7 @@ cosmwasm-ts-codegen generate \ #### Message Composer Options | option | description | --------------| ------------------------------ | ------------------------------------------------------------------- | +|------------ | ------------------------------ | ------------------------------------------------------------------- | | `msgBuilder.enabled` | enable the msgBilder plugin | @@ -293,11 +292,11 @@ const { CwAdminFactoryClient } = contracts.CwAdminFactory; ``` #### Bundler Options - | option | description | - | --------------------- | -------------------------------------------------------------------------------- | - | `bundle.enabled` | enable the bundler plugin | - | `bundle.scope` | name of the scope, defaults to `contracts` (you can use `.` to make more scopes) | - | `bundle.bundleFile` | name of the bundle file | +| option | description | +| --------------------- | -------------------------------------------------------------------------------- | +| `bundle.enabled` | enable the bundler plugin | +| `bundle.scope` | name of the scope, defaults to `contracts` (you can use `.` to make more scopes) | +| `bundle.bundleFile` | name of the bundle file | ### CLI Usage and Examples @@ -416,6 +415,10 @@ https://gist.github.com/pyramation/a9520ccf131177b1841e02a97d7d3731 https://gist.github.com/pyramation/43320e8b952751a0bd5a77dbc5b601f4 +- `cosmwasm-ts-codegen generate --plugin msg-builder` + +https://gist.github.com/adairrr/b394e62beb9856b0351883f776650f26 + ### JSON Schema From da2692beb683c20c5f8804eba44d6d4db002bdb2 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 14 Jul 2023 04:35:50 +0200 Subject: [PATCH 131/287] chore(release): publish - @cosmwasm/ts-codegen@0.31.1 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index d975d487..865f9691 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.31.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.31.0...@cosmwasm/ts-codegen@0.31.1) (2023-07-14) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.31.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.30.1...@cosmwasm/ts-codegen@0.31.0) (2023-07-14) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 2d361fdc..8c4ce33e 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.31.0", + "version": "0.31.1", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From e853444a34b52d2f9e601ca44cb01c21835e0bfd Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 14 Jul 2023 04:36:35 +0200 Subject: [PATCH 132/287] readme --- README.md | 20 ++++++++++---------- packages/ts-codegen/README.md | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 018ccc30..0785ac8c 100644 --- a/README.md +++ b/README.md @@ -136,11 +136,11 @@ Typescript types and interfaces are generated in separate files so they can be i #### Types Options - | option | description | - | ------------------------ | ---------------------------------------------------- | - | `types.enabled` | enable type generation | - | `types.aliasExecuteMsg` | generate a type alias based on the contract name | - | `types.aliasEntryPoints` | generate type aliases for the entry points based on the contract name | +| option | description | +| ------------------------ | ---------------------------------------------------- | +| `types.enabled` | enable type generation | +| `types.aliasExecuteMsg` | generate a type alias based on the contract name | +| `types.aliasEntryPoints` | generate type aliases for the entry points based on the contract name | ### Client @@ -150,11 +150,11 @@ The `client` plugin will generate TS client classes for your contracts. This opt #### Client Options - | option | description | - | --------------------------------------- | --------------------------------------------------- | - | `client.enabled` | generate TS client classes for your contracts | - | `client.execExtendsQuery` | execute should extend query message clients | - | `client.noImplicitOverride` | should match your tsconfig noImplicitOverride option | +| option | description | +| --------------------------------------- | --------------------------------------------------- | +| `client.enabled` | generate TS client classes for your contracts | +| `client.execExtendsQuery` | execute should extend query message clients | +| `client.noImplicitOverride` | should match your tsconfig noImplicitOverride option | #### Client via CLI diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index 018ccc30..0785ac8c 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -136,11 +136,11 @@ Typescript types and interfaces are generated in separate files so they can be i #### Types Options - | option | description | - | ------------------------ | ---------------------------------------------------- | - | `types.enabled` | enable type generation | - | `types.aliasExecuteMsg` | generate a type alias based on the contract name | - | `types.aliasEntryPoints` | generate type aliases for the entry points based on the contract name | +| option | description | +| ------------------------ | ---------------------------------------------------- | +| `types.enabled` | enable type generation | +| `types.aliasExecuteMsg` | generate a type alias based on the contract name | +| `types.aliasEntryPoints` | generate type aliases for the entry points based on the contract name | ### Client @@ -150,11 +150,11 @@ The `client` plugin will generate TS client classes for your contracts. This opt #### Client Options - | option | description | - | --------------------------------------- | --------------------------------------------------- | - | `client.enabled` | generate TS client classes for your contracts | - | `client.execExtendsQuery` | execute should extend query message clients | - | `client.noImplicitOverride` | should match your tsconfig noImplicitOverride option | +| option | description | +| --------------------------------------- | --------------------------------------------------- | +| `client.enabled` | generate TS client classes for your contracts | +| `client.execExtendsQuery` | execute should extend query message clients | +| `client.noImplicitOverride` | should match your tsconfig noImplicitOverride option | #### Client via CLI From ac5ac9a874b56929f76b052a6a719f5c1015ccab Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 14 Jul 2023 04:36:39 +0200 Subject: [PATCH 133/287] chore(release): publish - @cosmwasm/ts-codegen@0.31.2 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 865f9691..794528ed 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.31.2](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.31.1...@cosmwasm/ts-codegen@0.31.2) (2023-07-14) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.31.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.31.0...@cosmwasm/ts-codegen@0.31.1) (2023-07-14) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 8c4ce33e..5fed295e 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.31.1", + "version": "0.31.2", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From f0f6efb8a6b5b3a8b72e216bdbf05625b234f3fa Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 14 Jul 2023 05:06:09 +0200 Subject: [PATCH 134/287] options --- README.md | 16 ++++-- packages/ts-codegen/README.md | 16 ++++-- packages/ts-codegen/__tests__/builder.test.ts | 42 +++++++------- packages/ts-codegen/src/builder/builder.ts | 56 +++++++++---------- .../src/generators/create-helpers.ts | 2 +- .../ts-codegen/src/plugins/provider-bundle.ts | 2 +- packages/ts-codegen/src/plugins/provider.ts | 2 +- .../ts-codegen/types/src/builder/builder.d.ts | 2 +- 8 files changed, 77 insertions(+), 61 deletions(-) diff --git a/README.md b/README.md index 0785ac8c..cf6152d8 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ The quickest and easiest way to interact with CosmWasm Contracts. `@cosmwasm/ts- - [React Query](#react-query) - [Recoil](#recoil) - [Message Composer](#message-composer) + - [Message Builder](#message-builder) + - [Use Contracts Hooks](#use-contracts-hooks) - [Bundles](#bundles) - [CLI Usage and Examples](#cli-usage-and-examples) - [Advanced Usage](#advanced-usage) @@ -256,13 +258,13 @@ cosmwasm-ts-codegen generate \ | ------------------------------ | ------------------------------------------------------------------- | | `messageComposer.enabled` | enable the messageComposer plugin | -### Msg Builder +### Message Builder Generate raw message jsons for use in your application with the `msg-builder` command. [see example output code](https://gist.github.com/adairrr/b394e62beb9856b0351883f776650f26) -#### Msg Builder via CLI +#### Message Builder via CLI ```sh cosmwasm-ts-codegen generate \ @@ -271,12 +273,18 @@ cosmwasm-ts-codegen generate \ --out ./ts \ --name MyContractName ``` -#### Message Composer Options +#### Message Builder Options | option | description | |------------ | ------------------------------ | ------------------------------------------------------------------- | -| `msgBuilder.enabled` | enable the msgBilder plugin | +| `msgBuilder.enabled` | enable the msgBuilder plugin | + + +### Use Contracts Hooks +| option | description | +| -------------------------------- | --------------------------------------- | +| `useContractsHooks.enabled` | enable the `useContracts` plugin | ### Bundles diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index 0785ac8c..cf6152d8 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -36,6 +36,8 @@ The quickest and easiest way to interact with CosmWasm Contracts. `@cosmwasm/ts- - [React Query](#react-query) - [Recoil](#recoil) - [Message Composer](#message-composer) + - [Message Builder](#message-builder) + - [Use Contracts Hooks](#use-contracts-hooks) - [Bundles](#bundles) - [CLI Usage and Examples](#cli-usage-and-examples) - [Advanced Usage](#advanced-usage) @@ -256,13 +258,13 @@ cosmwasm-ts-codegen generate \ | ------------------------------ | ------------------------------------------------------------------- | | `messageComposer.enabled` | enable the messageComposer plugin | -### Msg Builder +### Message Builder Generate raw message jsons for use in your application with the `msg-builder` command. [see example output code](https://gist.github.com/adairrr/b394e62beb9856b0351883f776650f26) -#### Msg Builder via CLI +#### Message Builder via CLI ```sh cosmwasm-ts-codegen generate \ @@ -271,12 +273,18 @@ cosmwasm-ts-codegen generate \ --out ./ts \ --name MyContractName ``` -#### Message Composer Options +#### Message Builder Options | option | description | |------------ | ------------------------------ | ------------------------------------------------------------------- | -| `msgBuilder.enabled` | enable the msgBilder plugin | +| `msgBuilder.enabled` | enable the msgBuilder plugin | + + +### Use Contracts Hooks +| option | description | +| -------------------------------- | --------------------------------------- | +| `useContractsHooks.enabled` | enable the `useContracts` plugin | ### Bundles diff --git a/packages/ts-codegen/__tests__/builder.test.ts b/packages/ts-codegen/__tests__/builder.test.ts index 4c6aa185..400c112d 100644 --- a/packages/ts-codegen/__tests__/builder.test.ts +++ b/packages/ts-codegen/__tests__/builder.test.ts @@ -111,7 +111,7 @@ it('builder default', async () => { enabled: true }, msgBuilder: { - enabled: true + enabled: true } } }); @@ -154,7 +154,7 @@ it('builder no extends', async () => { enabled: true }, msgBuilder: { - enabled: true + enabled: true } } }); @@ -166,40 +166,40 @@ it('builder set bundler path', async () => { const s = (str) => FIXTURE_DIR + str; await codegen({ contracts: [ - s('/vectis/factory'), - s('/minter'), - s('/daodao/cw-admin-factory'), - s('/daodao/cw-code-id-registry'), - { - name: 'CwSingle', - dir: s('/daodao/cw-proposal-single') - } + s('/vectis/factory'), + s('/minter'), + s('/daodao/cw-admin-factory'), + s('/daodao/cw-code-id-registry'), + { + name: 'CwSingle', + dir: s('/daodao/cw-proposal-single') + } ], outPath, options: { bundle: { - bundlePath: bundlerPath, - bundleFile: 'index.ts', - scope: 'smart.contracts' + bundlePath: bundlerPath, + bundleFile: 'index.ts', + scope: 'smart.contracts' }, types: { - enabled: true + enabled: true }, client: { - enabled: true, - execExtendsQuery: false + enabled: true, + execExtendsQuery: false }, reactQuery: { - enabled: true + enabled: true }, recoil: { - enabled: true + enabled: true }, messageComposer: { - enabled: true + enabled: true }, - useContracts:{ - enabled: true, + useContractsHooks: { + enabled: true, } } }); diff --git a/packages/ts-codegen/src/builder/builder.ts b/packages/ts-codegen/src/builder/builder.ts index fe1b2f39..339e7ee5 100644 --- a/packages/ts-codegen/src/builder/builder.ts +++ b/packages/ts-codegen/src/builder/builder.ts @@ -1,4 +1,4 @@ -import { RenderOptions, defaultOptions, RenderContext, ContractInfo, MessageComposerOptions, BuilderContext} from "wasm-ast-types"; +import { RenderOptions, defaultOptions, RenderContext, ContractInfo, MessageComposerOptions, BuilderContext } from "wasm-ast-types"; import { header } from '../utils/header'; import { join } from "path"; @@ -48,13 +48,13 @@ export interface BundleOptions { }; export interface UseContractsOptions { - enabled?: boolean; - filename?: string; + enabled?: boolean; + filename?: string; }; export type TSBuilderOptions = { bundle?: BundleOptions; - useContracts?: UseContractsOptions; + useContractsHooks?: UseContractsOptions; } & RenderOptions; export type BuilderFileType = 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer' | 'msg-builder' | 'plugin'; @@ -125,7 +125,7 @@ export class TSBuilder { [].push.apply(this.plugins, plugins); } - this.plugins.forEach(plugin=> plugin.setBuilder(this)) + this.plugins.forEach(plugin => plugin.setBuilder(this)) } async build() { @@ -134,7 +134,7 @@ export class TSBuilder { } // lifecycle functions - private async process(){ + private async process() { for (const contractOpt of this.contracts) { const contract = getContract(contractOpt); //resolve contract schema. @@ -147,16 +147,16 @@ export class TSBuilder { } } - private async render(name: string, contractInfo: ContractInfo){ - for (const plugin of this.plugins) { - let files = await plugin.render(name, contractInfo, this.outPath); - if(files && files.length){ - [].push.apply(this.files, files); - } - } + private async render(name: string, contractInfo: ContractInfo) { + for (const plugin of this.plugins) { + let files = await plugin.render(name, contractInfo, this.outPath); + if (files && files.length) { + [].push.apply(this.files, files); + } + } } - private async after(){ + private async after() { if (this.options.bundle.enabled) { this.bundle(); } @@ -166,21 +166,21 @@ export class TSBuilder { contractsProviderBundlePlugin.setBuilder(this); let files = await contractsProviderBundlePlugin.render( - "", - { - schemas: [], - }, - this.outPath + "", + { + schemas: [], + }, + this.outPath ); - if(files && files.length){ - [].push.apply(this.files, files); + if (files && files.length) { + [].push.apply(this.files, files); } createHelpers({ - outPath: this.outPath, - contracts: this.contracts, - options: this.options, - plugins: this.plugins, + outPath: this.outPath, + contracts: this.contracts, + options: this.options, + plugins: this.plugins, }, this.builderContext); } @@ -190,8 +190,8 @@ export class TSBuilder { const bundleFile = this.options.bundle.bundleFile; const bundlePath = join( - this.options?.bundle?.bundlePath ?? this.outPath, - bundleFile + this.options?.bundle?.bundlePath ?? this.outPath, + bundleFile ); const bundleVariables = {}; const importPaths = []; @@ -215,7 +215,7 @@ export class TSBuilder { ] )).code; - if(this.options?.bundle?.bundlePath){ + if (this.options?.bundle?.bundlePath) { mkdirp(this.options?.bundle?.bundlePath); } diff --git a/packages/ts-codegen/src/generators/create-helpers.ts b/packages/ts-codegen/src/generators/create-helpers.ts index c3b83495..3d035fef 100644 --- a/packages/ts-codegen/src/generators/create-helpers.ts +++ b/packages/ts-codegen/src/generators/create-helpers.ts @@ -21,7 +21,7 @@ const write = (outPath: string, file: string, content: string) => { }; export const createHelpers = (input: TSBuilderInput, builderContext: BuilderContext) => { - if (input.options?.useContracts?.enabled && Object.keys(builderContext.providers)?.length) { + if (input.options?.useContractsHooks?.enabled && Object.keys(builderContext.providers)?.length) { write(input.outPath, "contractContextBase.ts", contractContextBase); write(input.outPath, "contracts-context.tsx", contractsContextTSX); } diff --git a/packages/ts-codegen/src/plugins/provider-bundle.ts b/packages/ts-codegen/src/plugins/provider-bundle.ts index c3c8fa87..a986650d 100644 --- a/packages/ts-codegen/src/plugins/provider-bundle.ts +++ b/packages/ts-codegen/src/plugins/provider-bundle.ts @@ -36,7 +36,7 @@ export class ContractsProviderBundlePlugin extends BuilderPluginBase { - if (!this.option?.useContracts?.enabled) { + if (!this.option?.useContractsHooks?.enabled) { return; } diff --git a/packages/ts-codegen/src/plugins/provider.ts b/packages/ts-codegen/src/plugins/provider.ts index ae6cecf5..b6e053d8 100644 --- a/packages/ts-codegen/src/plugins/provider.ts +++ b/packages/ts-codegen/src/plugins/provider.ts @@ -39,7 +39,7 @@ export class ContractsContextProviderPlugin extends BuilderPluginBase { - if (!this.option?.useContracts?.enabled) { + if (!this.option?.useContractsHooks?.enabled) { return; } diff --git a/packages/ts-codegen/types/src/builder/builder.d.ts b/packages/ts-codegen/types/src/builder/builder.d.ts index 9c7e48b8..0eca5b63 100644 --- a/packages/ts-codegen/types/src/builder/builder.d.ts +++ b/packages/ts-codegen/types/src/builder/builder.d.ts @@ -18,7 +18,7 @@ export interface UseContractsOptions { } export type TSBuilderOptions = { bundle?: BundleOptions; - useContracts?: UseContractsOptions; + useContractsHooks?: UseContractsOptions; } & RenderOptions; export type BuilderFileType = 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer' | 'msg-builder' | 'plugin'; export interface BuilderFile { From 7605b218d5823ab79fd61a529790f88b82d367c5 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 14 Jul 2023 05:09:54 +0200 Subject: [PATCH 135/287] chore(release): publish - @cosmwasm/ts-codegen@0.31.3 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 794528ed..02e42903 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.31.3](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.31.2...@cosmwasm/ts-codegen@0.31.3) (2023-07-14) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.31.2](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.31.1...@cosmwasm/ts-codegen@0.31.2) (2023-07-14) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 5fed295e..1262333f 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.31.2", + "version": "0.31.3", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From d0e7dbfc37550290c8e6dbff390ba1c18636805f Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 14 Jul 2023 05:26:08 +0200 Subject: [PATCH 136/287] readme --- README.md | 48 +++++++++++++++++++++++++++++++++++ packages/ts-codegen/README.md | 48 +++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) diff --git a/README.md b/README.md index cf6152d8..d70df93c 100644 --- a/README.md +++ b/README.md @@ -286,6 +286,54 @@ cosmwasm-ts-codegen generate \ | -------------------------------- | --------------------------------------- | | `useContractsHooks.enabled` | enable the `useContracts` plugin | +#### Use Contracts Provider Usage + +```tsx +import { useChain } from '@cosmos-kit/react'; +import { ContractsProvider } from '../path/to/codegen/contracts-context'; + +export default function YourComponent() { + + const { + address, + getCosmWasmClient, + getSigningCosmWasmClient + } = useChain(chainName); + + return ( + + + + ) +}; +``` + +#### Use Contracts Hooks Usage + +Once enabled, you can get contracts very simply: + +```ts +const { marketplace } = useContracts(); +``` + +```ts +const marketplaceClient = marketplace.signingClient(marketplaceContract); +await marketplaceClient.updateAskPrice({ + collection: token.collectionAddr, + price: { + amount, + denom, + }, + tokenId, +}); +``` + ### Bundles The bundler will make a nice package of all your contracts. For example: diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index cf6152d8..d70df93c 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -286,6 +286,54 @@ cosmwasm-ts-codegen generate \ | -------------------------------- | --------------------------------------- | | `useContractsHooks.enabled` | enable the `useContracts` plugin | +#### Use Contracts Provider Usage + +```tsx +import { useChain } from '@cosmos-kit/react'; +import { ContractsProvider } from '../path/to/codegen/contracts-context'; + +export default function YourComponent() { + + const { + address, + getCosmWasmClient, + getSigningCosmWasmClient + } = useChain(chainName); + + return ( + + + + ) +}; +``` + +#### Use Contracts Hooks Usage + +Once enabled, you can get contracts very simply: + +```ts +const { marketplace } = useContracts(); +``` + +```ts +const marketplaceClient = marketplace.signingClient(marketplaceContract); +await marketplaceClient.updateAskPrice({ + collection: token.collectionAddr, + price: { + amount, + denom, + }, + tokenId, +}); +``` + ### Bundles The bundler will make a nice package of all your contracts. For example: From 4c207bade9c6e542e9fc4d29b60866f4d7ff1627 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 14 Jul 2023 05:26:13 +0200 Subject: [PATCH 137/287] chore(release): publish - @cosmwasm/ts-codegen@0.31.4 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 02e42903..01e7d241 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.31.4](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.31.3...@cosmwasm/ts-codegen@0.31.4) (2023-07-14) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.31.3](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.31.2...@cosmwasm/ts-codegen@0.31.3) (2023-07-14) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 1262333f..b5025f8d 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.31.3", + "version": "0.31.4", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From 9f77f20c6cf80413d69d420149097418e06da53b Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 14 Jul 2023 05:27:37 +0200 Subject: [PATCH 138/287] readme --- README.md | 6 +++--- packages/ts-codegen/README.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d70df93c..f5d886f8 100644 --- a/README.md +++ b/README.md @@ -275,9 +275,9 @@ cosmwasm-ts-codegen generate \ ``` #### Message Builder Options -| option | description | -|------------ | ------------------------------ | ------------------------------------------------------------------- | -| `msgBuilder.enabled` | enable the msgBuilder plugin | +| option | description | +|--------------------- | ------------------------------ | +| `msgBuilder.enabled` | enable the msgBuilder plugin | ### Use Contracts Hooks diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index d70df93c..f5d886f8 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -275,9 +275,9 @@ cosmwasm-ts-codegen generate \ ``` #### Message Builder Options -| option | description | -|------------ | ------------------------------ | ------------------------------------------------------------------- | -| `msgBuilder.enabled` | enable the msgBuilder plugin | +| option | description | +|--------------------- | ------------------------------ | +| `msgBuilder.enabled` | enable the msgBuilder plugin | ### Use Contracts Hooks From f678de3cce2ad0dc29f5ad9d6154831bd74ed2a6 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 14 Jul 2023 05:27:46 +0200 Subject: [PATCH 139/287] chore(release): publish - @cosmwasm/ts-codegen@0.31.5 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 01e7d241..ff599d23 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.31.5](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.31.4...@cosmwasm/ts-codegen@0.31.5) (2023-07-14) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.31.4](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.31.3...@cosmwasm/ts-codegen@0.31.4) (2023-07-14) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index b5025f8d..e2643656 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.31.4", + "version": "0.31.5", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From 5559e8249eeb24973d723dc829def0449144cef3 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 14 Jul 2023 05:28:42 +0200 Subject: [PATCH 140/287] readme --- README.md | 3 +++ packages/ts-codegen/README.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index f5d886f8..34874f69 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,9 @@ codegen({ }, msgBuilder: { enabled: false + }, + useContractsHooks: { + enabled: false } } }).then(() => { diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index f5d886f8..34874f69 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -124,6 +124,9 @@ codegen({ }, msgBuilder: { enabled: false + }, + useContractsHooks: { + enabled: false } } }).then(() => { From e7a88af7c939524d91065da318f262884afb8dee Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 14 Jul 2023 05:28:59 +0200 Subject: [PATCH 141/287] chore(release): publish - @cosmwasm/ts-codegen@0.31.6 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index ff599d23..dfb67ce8 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.31.6](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.31.5...@cosmwasm/ts-codegen@0.31.6) (2023-07-14) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.31.5](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.31.4...@cosmwasm/ts-codegen@0.31.5) (2023-07-14) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index e2643656..7b31cd9f 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.31.5", + "version": "0.31.6", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From e35615ec30cabf265f13e38e7f749337d264253c Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Sun, 16 Jul 2023 15:44:04 +0200 Subject: [PATCH 142/287] boilerplate --- packages/ts-codegen/src/commands/create-boilerplate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ts-codegen/src/commands/create-boilerplate.ts b/packages/ts-codegen/src/commands/create-boilerplate.ts index db36a30d..35f0edbb 100644 --- a/packages/ts-codegen/src/commands/create-boilerplate.ts +++ b/packages/ts-codegen/src/commands/create-boilerplate.ts @@ -5,7 +5,7 @@ const glob = require('glob').sync; const fs = require('fs'); const path = require('path'); -const repo = 'https://github.com/pyramation/tmpl-cosmwasm-module.git'; +const repo = 'https://github.com/cosmology-tech/ts-codegen-module-boilerplate'; export default async argv => { if (!shell.which('git')) { shell.echo('Sorry, this script requires git'); From 0a4c5d82cb75d82e01e662aec40f613529173da9 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Sun, 16 Jul 2023 15:44:12 +0200 Subject: [PATCH 143/287] chore(release): publish - @cosmwasm/ts-codegen@0.32.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index dfb67ce8..42e1868d 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.32.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.31.6...@cosmwasm/ts-codegen@0.32.0) (2023-07-16) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.31.6](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.31.5...@cosmwasm/ts-codegen@0.31.6) (2023-07-14) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 7b31cd9f..adb97658 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.31.6", + "version": "0.32.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From dfe716512ea97636b206ff59cd3217ebc770240c Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Sun, 16 Jul 2023 15:48:34 +0200 Subject: [PATCH 144/287] cli --- packages/ts-codegen/src/commands/create-boilerplate.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/ts-codegen/src/commands/create-boilerplate.ts b/packages/ts-codegen/src/commands/create-boilerplate.ts index 35f0edbb..54cde020 100644 --- a/packages/ts-codegen/src/commands/create-boilerplate.ts +++ b/packages/ts-codegen/src/commands/create-boilerplate.ts @@ -88,7 +88,7 @@ export default async argv => { path.basename(templateFile) === 'LICENSE' && license.__LICENSE__ === 'closed' ) { - content = `Copyright (c) 2022 __USERFULLNAME__ <__USEREMAIL__> - All Rights Reserved + content = `Copyright (c) 2023 __USERFULLNAME__ <__USEREMAIL__> - All Rights Reserved Unauthorized copying via any medium is strictly prohibited Proprietary and confidential`; } @@ -118,9 +118,9 @@ Proprietary and confidential`; ); } - if (path.basename(templateFile) === 'README.md') { - content = `# ${results.__MODULENAME__}`; - } + // if (path.basename(templateFile) === 'README.md') { + // content = `# ${results.__MODULENAME__}`; + // } fs.writeFileSync(templateFile, content); } From 9d4f9eca0ee378e0f53c5b95343842d76d446534 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Sun, 16 Jul 2023 15:48:53 +0200 Subject: [PATCH 145/287] chore(release): publish - @cosmwasm/ts-codegen@0.33.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 42e1868d..3f4be7d2 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.33.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.32.0...@cosmwasm/ts-codegen@0.33.0) (2023-07-16) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.32.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.31.6...@cosmwasm/ts-codegen@0.32.0) (2023-07-16) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index adb97658..0ff3f217 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.32.0", + "version": "0.33.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From 502cf44de144c8c9b1a9373033c562bcb2265a50 Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Wed, 19 Jul 2023 19:02:37 +0800 Subject: [PATCH 146/287] fix helper files fix exporting helper files and provider bundle file --- .../contracts/contractContextBase.ts | 39 +++++- .../contracts/contracts-context.tsx | 2 +- __output__/builder/bundler_test/index.ts | 115 +++++++++-------- .../default/CwAdminFactory.provider.ts | 19 +++ .../default/CwCodeIdRegistry.provider.ts | 19 +++ .../builder/default/CwSingle.provider.ts | 19 +++ .../builder/default/Factory.provider.ts | 19 +++ __output__/builder/default/Minter.provider.ts | 19 +++ .../builder/default/contractContextBase.ts | 122 ++++++++++++++++++ .../default/contractContextProviders.ts | 62 +++++++++ .../builder/default/contracts-context.tsx | 78 +++++++++++ __output__/builder/default/index.ts | 103 +++++++++------ __output__/builder/no-extends/index.ts | 106 +++++++-------- packages/ts-codegen/__tests__/builder.test.ts | 3 + packages/ts-codegen/src/builder/builder.ts | 22 +++- .../src/generators/create-helpers.ts | 36 +++++- .../src/helpers/contractContextBase.ts | 39 +++++- .../src/helpers/contractsContextTSX.ts | 2 +- .../ts-codegen/src/plugins/provider-bundle.ts | 1 + packages/ts-codegen/src/plugins/provider.ts | 1 + .../types/src/generators/create-helpers.d.ts | 4 +- .../src/helpers/contractContextBase.d.ts | 2 +- .../src/helpers/contractsContextTSX.d.ts | 2 +- 23 files changed, 652 insertions(+), 182 deletions(-) create mode 100644 __output__/builder/default/CwAdminFactory.provider.ts create mode 100644 __output__/builder/default/CwCodeIdRegistry.provider.ts create mode 100644 __output__/builder/default/CwSingle.provider.ts create mode 100644 __output__/builder/default/Factory.provider.ts create mode 100644 __output__/builder/default/Minter.provider.ts create mode 100644 __output__/builder/default/contractContextBase.ts create mode 100644 __output__/builder/default/contractContextProviders.ts create mode 100644 __output__/builder/default/contracts-context.tsx diff --git a/__output__/builder/bundler_test/contracts/contractContextBase.ts b/__output__/builder/bundler_test/contracts/contractContextBase.ts index 45b6b20a..a2f5e7af 100644 --- a/__output__/builder/bundler_test/contracts/contractContextBase.ts +++ b/__output__/builder/bundler_test/contracts/contractContextBase.ts @@ -53,24 +53,49 @@ export class ContractBase< TQuery = IEmptyClient, TMsgComposer = IEmptyClient > { + + address: string | undefined; + cosmWasmClient: CosmWasmClient | undefined; + signingCosmWasmClient: SigningCosmWasmClient | undefined; + TSign?: new ( + client: SigningCosmWasmClient, + sender: string, + contractAddress: string + ) => TSign; + TQuery?: new ( + client: CosmWasmClient, + contractAddress: string + ) => TQuery; + TMsgComposer?: new ( + sender: string, + contractAddress: string + ) => TMsgComposer; + constructor( - protected address: string | undefined, - protected cosmWasmClient: CosmWasmClient | undefined, - protected signingCosmWasmClient: SigningCosmWasmClient | undefined, - private TSign?: new ( + address: string | undefined, + cosmWasmClient: CosmWasmClient | undefined, + signingCosmWasmClient: SigningCosmWasmClient | undefined, + TSign?: new ( client: SigningCosmWasmClient, sender: string, contractAddress: string ) => TSign, - private TQuery?: new ( + TQuery?: new ( client: CosmWasmClient, contractAddress: string ) => TQuery, - private TMsgComposer?: new ( + TMsgComposer?: new ( sender: string, contractAddress: string ) => TMsgComposer - ) {} + ) { + this.address = address; + this.cosmWasmClient = cosmWasmClient; + this.signingCosmWasmClient = signingCosmWasmClient; + this.TSign = TSign; + this.TQuery = TQuery; + this.TMsgComposer = TMsgComposer; + } public getSigningClient(contractAddr: string): TSign { if (!this.signingCosmWasmClient) throw new Error(NO_SINGING_ERROR_MESSAGE); diff --git a/__output__/builder/bundler_test/contracts/contracts-context.tsx b/__output__/builder/bundler_test/contracts/contracts-context.tsx index 38d23ef7..d972e515 100644 --- a/__output__/builder/bundler_test/contracts/contracts-context.tsx +++ b/__output__/builder/bundler_test/contracts/contracts-context.tsx @@ -70,7 +70,7 @@ export const ContractsProvider = ({ }; export const useContracts = () => { - const contracts = useContext(ContractsContext); + const contracts: IContractsContext = useContext(ContractsContext); if (contracts === null) { throw new Error('useContracts must be used within a ContractsProvider'); } diff --git a/__output__/builder/bundler_test/index.ts b/__output__/builder/bundler_test/index.ts index 39f93cb6..a0b6bbbd 100644 --- a/__output__/builder/bundler_test/index.ts +++ b/__output__/builder/bundler_test/index.ts @@ -4,72 +4,81 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import * as _75 from "./contracts/Factory.types"; -import * as _76 from "./contracts/Factory.client"; -import * as _77 from "./contracts/Factory.message-composer"; -import * as _78 from "./contracts/Factory.react-query"; -import * as _79 from "./contracts/Factory.recoil"; -import * as _80 from "./contracts/Factory.provider"; -import * as _81 from "./contracts/Minter.types"; -import * as _82 from "./contracts/Minter.client"; -import * as _83 from "./contracts/Minter.message-composer"; -import * as _84 from "./contracts/Minter.react-query"; -import * as _85 from "./contracts/Minter.recoil"; -import * as _86 from "./contracts/Minter.provider"; -import * as _87 from "./contracts/CwAdminFactory.types"; -import * as _88 from "./contracts/CwAdminFactory.client"; -import * as _89 from "./contracts/CwAdminFactory.message-composer"; -import * as _90 from "./contracts/CwAdminFactory.react-query"; -import * as _91 from "./contracts/CwAdminFactory.recoil"; -import * as _92 from "./contracts/CwAdminFactory.provider"; -import * as _93 from "./contracts/CwCodeIdRegistry.types"; -import * as _94 from "./contracts/CwCodeIdRegistry.client"; -import * as _95 from "./contracts/CwCodeIdRegistry.message-composer"; -import * as _96 from "./contracts/CwCodeIdRegistry.react-query"; -import * as _97 from "./contracts/CwCodeIdRegistry.recoil"; -import * as _98 from "./contracts/CwCodeIdRegistry.provider"; -import * as _99 from "./contracts/CwSingle.types"; -import * as _100 from "./contracts/CwSingle.client"; -import * as _101 from "./contracts/CwSingle.message-composer"; -import * as _102 from "./contracts/CwSingle.react-query"; -import * as _103 from "./contracts/CwSingle.recoil"; -import * as _104 from "./contracts/CwSingle.provider"; +import * as _83 from "./contracts/Factory.types"; +import * as _84 from "./contracts/Factory.client"; +import * as _85 from "./contracts/Factory.message-composer"; +import * as _86 from "./contracts/Factory.react-query"; +import * as _87 from "./contracts/Factory.recoil"; +import * as _88 from "./contracts/Factory.provider"; +import * as _89 from "./contracts/Minter.types"; +import * as _90 from "./contracts/Minter.client"; +import * as _91 from "./contracts/Minter.message-composer"; +import * as _92 from "./contracts/Minter.react-query"; +import * as _93 from "./contracts/Minter.recoil"; +import * as _94 from "./contracts/Minter.provider"; +import * as _95 from "./contracts/CwAdminFactory.types"; +import * as _96 from "./contracts/CwAdminFactory.client"; +import * as _97 from "./contracts/CwAdminFactory.message-composer"; +import * as _98 from "./contracts/CwAdminFactory.react-query"; +import * as _99 from "./contracts/CwAdminFactory.recoil"; +import * as _100 from "./contracts/CwAdminFactory.provider"; +import * as _101 from "./contracts/CwCodeIdRegistry.types"; +import * as _102 from "./contracts/CwCodeIdRegistry.client"; +import * as _103 from "./contracts/CwCodeIdRegistry.message-composer"; +import * as _104 from "./contracts/CwCodeIdRegistry.react-query"; +import * as _105 from "./contracts/CwCodeIdRegistry.recoil"; +import * as _106 from "./contracts/CwCodeIdRegistry.provider"; +import * as _107 from "./contracts/CwSingle.types"; +import * as _108 from "./contracts/CwSingle.client"; +import * as _109 from "./contracts/CwSingle.message-composer"; +import * as _110 from "./contracts/CwSingle.react-query"; +import * as _111 from "./contracts/CwSingle.recoil"; +import * as _112 from "./contracts/CwSingle.provider"; +import * as _113 from "./contracts/contractContextProviders"; +import * as _114 from "./contracts/contractContextBase"; +import * as _115 from "./contracts/contracts-context"; export namespace smart { export namespace contracts { - export const Factory = { ..._75, - ..._76, - ..._77, - ..._78, - ..._79, - ..._80 - }; - export const Minter = { ..._81, - ..._82, - ..._83, + export const Factory = { ..._83, ..._84, ..._85, - ..._86 + ..._86, + ..._87, + ..._88 }; - export const CwAdminFactory = { ..._87, - ..._88, - ..._89, + export const Minter = { ..._89, ..._90, ..._91, - ..._92 + ..._92, + ..._93, + ..._94 }; - export const CwCodeIdRegistry = { ..._93, - ..._94, - ..._95, + export const CwAdminFactory = { ..._95, ..._96, ..._97, - ..._98 + ..._98, + ..._99, + ..._100 }; - export const CwSingle = { ..._99, - ..._100, - ..._101, + export const CwCodeIdRegistry = { ..._101, ..._102, ..._103, - ..._104 + ..._104, + ..._105, + ..._106 + }; + export const CwSingle = { ..._107, + ..._108, + ..._109, + ..._110, + ..._111, + ..._112 + }; + export const contractContextProviders = { ..._113 + }; + export const contractContextBase = { ..._114 + }; + export const contractsContext = { ..._115 }; } } \ No newline at end of file diff --git a/__output__/builder/default/CwAdminFactory.provider.ts b/__output__/builder/default/CwAdminFactory.provider.ts new file mode 100644 index 00000000..f8d0b76d --- /dev/null +++ b/__output__/builder/default/CwAdminFactory.provider.ts @@ -0,0 +1,19 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { ContractBase, IContractConstructor } from "./contractContextBase"; +import { CwAdminFactoryClient, CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; +import { CwAdminFactoryMessageComposer } from "./CwAdminFactory.message-composer"; +export class CwAdminFactory extends ContractBase { + constructor({ + address, + cosmWasmClient, + signingCosmWasmClient + }: IContractConstructor) { + super(address, cosmWasmClient, signingCosmWasmClient, CwAdminFactoryClient, CwAdminFactoryQueryClient, CwAdminFactoryMessageComposer); + } + +} \ No newline at end of file diff --git a/__output__/builder/default/CwCodeIdRegistry.provider.ts b/__output__/builder/default/CwCodeIdRegistry.provider.ts new file mode 100644 index 00000000..ba841f2f --- /dev/null +++ b/__output__/builder/default/CwCodeIdRegistry.provider.ts @@ -0,0 +1,19 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { ContractBase, IContractConstructor } from "./contractContextBase"; +import { CwCodeIdRegistryClient, CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; +import { CwCodeIdRegistryMessageComposer } from "./CwCodeIdRegistry.message-composer"; +export class CwCodeIdRegistry extends ContractBase { + constructor({ + address, + cosmWasmClient, + signingCosmWasmClient + }: IContractConstructor) { + super(address, cosmWasmClient, signingCosmWasmClient, CwCodeIdRegistryClient, CwCodeIdRegistryQueryClient, CwCodeIdRegistryMessageComposer); + } + +} \ No newline at end of file diff --git a/__output__/builder/default/CwSingle.provider.ts b/__output__/builder/default/CwSingle.provider.ts new file mode 100644 index 00000000..e3b2a3b3 --- /dev/null +++ b/__output__/builder/default/CwSingle.provider.ts @@ -0,0 +1,19 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { ContractBase, IContractConstructor } from "./contractContextBase"; +import { CwSingleClient, CwSingleQueryClient } from "./CwSingle.client"; +import { CwSingleMessageComposer } from "./CwSingle.message-composer"; +export class CwSingle extends ContractBase { + constructor({ + address, + cosmWasmClient, + signingCosmWasmClient + }: IContractConstructor) { + super(address, cosmWasmClient, signingCosmWasmClient, CwSingleClient, CwSingleQueryClient, CwSingleMessageComposer); + } + +} \ No newline at end of file diff --git a/__output__/builder/default/Factory.provider.ts b/__output__/builder/default/Factory.provider.ts new file mode 100644 index 00000000..34273f44 --- /dev/null +++ b/__output__/builder/default/Factory.provider.ts @@ -0,0 +1,19 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { ContractBase, IContractConstructor } from "./contractContextBase"; +import { FactoryClient, FactoryQueryClient } from "./Factory.client"; +import { FactoryMessageComposer } from "./Factory.message-composer"; +export class Factory extends ContractBase { + constructor({ + address, + cosmWasmClient, + signingCosmWasmClient + }: IContractConstructor) { + super(address, cosmWasmClient, signingCosmWasmClient, FactoryClient, FactoryQueryClient, FactoryMessageComposer); + } + +} \ No newline at end of file diff --git a/__output__/builder/default/Minter.provider.ts b/__output__/builder/default/Minter.provider.ts new file mode 100644 index 00000000..c5e6aa5f --- /dev/null +++ b/__output__/builder/default/Minter.provider.ts @@ -0,0 +1,19 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { ContractBase, IContractConstructor } from "./contractContextBase"; +import { MinterClient, MinterQueryClient } from "./Minter.client"; +import { MinterMessageComposer } from "./Minter.message-composer"; +export class Minter extends ContractBase { + constructor({ + address, + cosmWasmClient, + signingCosmWasmClient + }: IContractConstructor) { + super(address, cosmWasmClient, signingCosmWasmClient, MinterClient, MinterQueryClient, MinterMessageComposer); + } + +} \ No newline at end of file diff --git a/__output__/builder/default/contractContextBase.ts b/__output__/builder/default/contractContextBase.ts new file mode 100644 index 00000000..a2f5e7af --- /dev/null +++ b/__output__/builder/default/contractContextBase.ts @@ -0,0 +1,122 @@ +/** +* This file and any referenced files were automatically generated by @cosmwasm/ts-codegen@latest +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or yarn proto command to regenerate this bundle. +*/ + + +import { + CosmWasmClient, + SigningCosmWasmClient, +} from '@cosmjs/cosmwasm-stargate'; + +export interface IContractConstructor { + address: string | undefined; + cosmWasmClient: CosmWasmClient | undefined; + signingCosmWasmClient: SigningCosmWasmClient | undefined; +} + +export const NO_SINGING_ERROR_MESSAGE = 'signingCosmWasmClient not connected'; + +export const NO_COSMWASW_CLIENT_ERROR_MESSAGE = 'cosmWasmClient not connected'; + +export const NO_ADDRESS_ERROR_MESSAGE = "address doesn't exist"; + +export const NO_SIGNING_CLIENT_ERROR_MESSAGE = + 'Signing client is not generated. Please check ts-codegen config'; + +export const NO_QUERY_CLIENT_ERROR_MESSAGE = + 'Query client is not generated. Please check ts-codegen config'; + +export const NO_MESSAGE_COMPOSER_ERROR_MESSAGE = + 'Message composer client is not generated. Please check ts-codegen config'; + +/** + * a placeholder for non-generated classes + */ +export interface IEmptyClient {} + +export interface ISigningClientProvider { + getSigningClient(contractAddr: string): T; +} + +export interface IQueryClientProvider { + getQueryClient(contractAddr: string): T; +} + +export interface IMessageComposerProvider { + getMessageComposer(contractAddr: string): T; +} + +export class ContractBase< + TSign = IEmptyClient, + TQuery = IEmptyClient, + TMsgComposer = IEmptyClient +> { + + address: string | undefined; + cosmWasmClient: CosmWasmClient | undefined; + signingCosmWasmClient: SigningCosmWasmClient | undefined; + TSign?: new ( + client: SigningCosmWasmClient, + sender: string, + contractAddress: string + ) => TSign; + TQuery?: new ( + client: CosmWasmClient, + contractAddress: string + ) => TQuery; + TMsgComposer?: new ( + sender: string, + contractAddress: string + ) => TMsgComposer; + + constructor( + address: string | undefined, + cosmWasmClient: CosmWasmClient | undefined, + signingCosmWasmClient: SigningCosmWasmClient | undefined, + TSign?: new ( + client: SigningCosmWasmClient, + sender: string, + contractAddress: string + ) => TSign, + TQuery?: new ( + client: CosmWasmClient, + contractAddress: string + ) => TQuery, + TMsgComposer?: new ( + sender: string, + contractAddress: string + ) => TMsgComposer + ) { + this.address = address; + this.cosmWasmClient = cosmWasmClient; + this.signingCosmWasmClient = signingCosmWasmClient; + this.TSign = TSign; + this.TQuery = TQuery; + this.TMsgComposer = TMsgComposer; + } + + public getSigningClient(contractAddr: string): TSign { + if (!this.signingCosmWasmClient) throw new Error(NO_SINGING_ERROR_MESSAGE); + if (!this.address) throw new Error(NO_ADDRESS_ERROR_MESSAGE); + if (!this.TSign) throw new Error(NO_SIGNING_CLIENT_ERROR_MESSAGE); + return new this.TSign( + this.signingCosmWasmClient, + this.address, + contractAddr + ); + } + + public getQueryClient(contractAddr: string): TQuery { + if (!this.cosmWasmClient) throw new Error(NO_COSMWASW_CLIENT_ERROR_MESSAGE); + if (!this.TQuery) throw new Error(NO_QUERY_CLIENT_ERROR_MESSAGE); + return new this.TQuery(this.cosmWasmClient, contractAddr); + } + + public getMessageComposer(contractAddr: string): TMsgComposer { + if (!this.address) throw new Error(NO_ADDRESS_ERROR_MESSAGE); + if (!this.TMsgComposer) throw new Error(NO_MESSAGE_COMPOSER_ERROR_MESSAGE); + return new this.TMsgComposer(this.address, contractAddr); + } +} diff --git a/__output__/builder/default/contractContextProviders.ts b/__output__/builder/default/contractContextProviders.ts new file mode 100644 index 00000000..bf15d71a --- /dev/null +++ b/__output__/builder/default/contractContextProviders.ts @@ -0,0 +1,62 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate"; +import { IQueryClientProvider, ISigningClientProvider, IMessageComposerProvider } from "./contractContextBase"; +import { FactoryQueryClient } from "./Factory.client"; +import { FactoryClient } from "./Factory.client"; +import { FactoryMessageComposer } from "./Factory.message-composer"; +import { Factory } from "./Factory.provider"; +import { MinterQueryClient } from "./Minter.client"; +import { MinterClient } from "./Minter.client"; +import { MinterMessageComposer } from "./Minter.message-composer"; +import { Minter } from "./Minter.provider"; +import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; +import { CwAdminFactoryClient } from "./CwAdminFactory.client"; +import { CwAdminFactoryMessageComposer } from "./CwAdminFactory.message-composer"; +import { CwAdminFactory } from "./CwAdminFactory.provider"; +import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; +import { CwCodeIdRegistryClient } from "./CwCodeIdRegistry.client"; +import { CwCodeIdRegistryMessageComposer } from "./CwCodeIdRegistry.message-composer"; +import { CwCodeIdRegistry } from "./CwCodeIdRegistry.provider"; +import { CwSingleQueryClient } from "./CwSingle.client"; +import { CwSingleClient } from "./CwSingle.client"; +import { CwSingleMessageComposer } from "./CwSingle.message-composer"; +import { CwSingle } from "./CwSingle.provider"; +export interface IContractsContext { + factory: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; + minter: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; + cwAdminFactory: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; + cwCodeIdRegistry: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; + cwSingle: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; +} +export const getProviders = (address?: string, cosmWasmClient?: CosmWasmClient, signingCosmWasmClient?: SigningCosmWasmClient) => ({ + factory: new Factory({ + address, + cosmWasmClient, + signingCosmWasmClient + }), + minter: new Minter({ + address, + cosmWasmClient, + signingCosmWasmClient + }), + cwAdminFactory: new CwAdminFactory({ + address, + cosmWasmClient, + signingCosmWasmClient + }), + cwCodeIdRegistry: new CwCodeIdRegistry({ + address, + cosmWasmClient, + signingCosmWasmClient + }), + cwSingle: new CwSingle({ + address, + cosmWasmClient, + signingCosmWasmClient + }) +}); \ No newline at end of file diff --git a/__output__/builder/default/contracts-context.tsx b/__output__/builder/default/contracts-context.tsx new file mode 100644 index 00000000..d972e515 --- /dev/null +++ b/__output__/builder/default/contracts-context.tsx @@ -0,0 +1,78 @@ +/** +* This file and any referenced files were automatically generated by @cosmwasm/ts-codegen@latest +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or yarn proto command to regenerate this bundle. +*/ + + +import React, { useEffect, useMemo, useRef, useState, useContext } from 'react'; +import { + CosmWasmClient, + SigningCosmWasmClient, +} from '@cosmjs/cosmwasm-stargate'; + +import { IContractsContext, getProviders } from './contractContextProviders'; + +interface ContractsConfig { + address: string | undefined; + getCosmWasmClient: () => Promise; + getSigningCosmWasmClient: () => Promise; +} + +const ContractsContext = React.createContext(null); + +export const ContractsProvider = ({ + children, + contractsConfig, +}: { + children: React.ReactNode; + contractsConfig: ContractsConfig; +}) => { + const [cosmWasmClient, setCosmWasmClient] = useState(); + const [signingCosmWasmClient, setSigningCosmWasmClient] = + useState(); + + const { address, getCosmWasmClient, getSigningCosmWasmClient } = + contractsConfig; + + const prevAddressRef = useRef(address); + + const contracts: IContractsContext = useMemo(() => { + return getProviders(address, cosmWasmClient, signingCosmWasmClient); + }, [address, cosmWasmClient, signingCosmWasmClient]); + + useEffect(() => { + const connectSigningCwClient = async () => { + if (address && prevAddressRef.current !== address) { + const signingCosmWasmClient = await getSigningCosmWasmClient(); + setSigningCosmWasmClient(signingCosmWasmClient); + } else if (!address) { + setSigningCosmWasmClient(undefined); + } + prevAddressRef.current = address; + }; + connectSigningCwClient(); + }, [address, getSigningCosmWasmClient]); + + useEffect(() => { + const connectCosmWasmClient = async () => { + const cosmWasmClient = await getCosmWasmClient(); + setCosmWasmClient(cosmWasmClient); + }; + connectCosmWasmClient(); + }, [getCosmWasmClient]); + + return ( + + {children} + + ); +}; + +export const useContracts = () => { + const contracts: IContractsContext = useContext(ContractsContext); + if (contracts === null) { + throw new Error('useContracts must be used within a ContractsProvider'); + } + return contracts; +}; diff --git a/__output__/builder/default/index.ts b/__output__/builder/default/index.ts index d991e94c..ae44c8eb 100644 --- a/__output__/builder/default/index.ts +++ b/__output__/builder/default/index.ts @@ -10,30 +10,38 @@ import * as _17 from "./Factory.message-composer"; import * as _18 from "./Factory.react-query"; import * as _19 from "./Factory.recoil"; import * as _20 from "./Factory.msg-builder"; -import * as _21 from "./Minter.types"; -import * as _22 from "./Minter.client"; -import * as _23 from "./Minter.message-composer"; -import * as _24 from "./Minter.react-query"; -import * as _25 from "./Minter.recoil"; -import * as _26 from "./Minter.msg-builder"; -import * as _27 from "./CwAdminFactory.types"; -import * as _28 from "./CwAdminFactory.client"; -import * as _29 from "./CwAdminFactory.message-composer"; -import * as _30 from "./CwAdminFactory.react-query"; -import * as _31 from "./CwAdminFactory.recoil"; -import * as _32 from "./CwAdminFactory.msg-builder"; -import * as _33 from "./CwCodeIdRegistry.types"; -import * as _34 from "./CwCodeIdRegistry.client"; -import * as _35 from "./CwCodeIdRegistry.message-composer"; -import * as _36 from "./CwCodeIdRegistry.react-query"; -import * as _37 from "./CwCodeIdRegistry.recoil"; -import * as _38 from "./CwCodeIdRegistry.msg-builder"; -import * as _39 from "./CwSingle.types"; -import * as _40 from "./CwSingle.client"; -import * as _41 from "./CwSingle.message-composer"; -import * as _42 from "./CwSingle.react-query"; -import * as _43 from "./CwSingle.recoil"; -import * as _44 from "./CwSingle.msg-builder"; +import * as _21 from "./Factory.provider"; +import * as _22 from "./Minter.types"; +import * as _23 from "./Minter.client"; +import * as _24 from "./Minter.message-composer"; +import * as _25 from "./Minter.react-query"; +import * as _26 from "./Minter.recoil"; +import * as _27 from "./Minter.msg-builder"; +import * as _28 from "./Minter.provider"; +import * as _29 from "./CwAdminFactory.types"; +import * as _30 from "./CwAdminFactory.client"; +import * as _31 from "./CwAdminFactory.message-composer"; +import * as _32 from "./CwAdminFactory.react-query"; +import * as _33 from "./CwAdminFactory.recoil"; +import * as _34 from "./CwAdminFactory.msg-builder"; +import * as _35 from "./CwAdminFactory.provider"; +import * as _36 from "./CwCodeIdRegistry.types"; +import * as _37 from "./CwCodeIdRegistry.client"; +import * as _38 from "./CwCodeIdRegistry.message-composer"; +import * as _39 from "./CwCodeIdRegistry.react-query"; +import * as _40 from "./CwCodeIdRegistry.recoil"; +import * as _41 from "./CwCodeIdRegistry.msg-builder"; +import * as _42 from "./CwCodeIdRegistry.provider"; +import * as _43 from "./CwSingle.types"; +import * as _44 from "./CwSingle.client"; +import * as _45 from "./CwSingle.message-composer"; +import * as _46 from "./CwSingle.react-query"; +import * as _47 from "./CwSingle.recoil"; +import * as _48 from "./CwSingle.msg-builder"; +import * as _49 from "./CwSingle.provider"; +import * as _50 from "./contractContextProviders"; +import * as _51 from "./contractContextBase"; +import * as _52 from "./contracts-context"; export namespace smart { export namespace contracts { export const Factory = { ..._15, @@ -41,35 +49,46 @@ export namespace smart { ..._17, ..._18, ..._19, - ..._20 + ..._20, + ..._21 }; - export const Minter = { ..._21, - ..._22, + export const Minter = { ..._22, ..._23, ..._24, ..._25, - ..._26 + ..._26, + ..._27, + ..._28 }; - export const CwAdminFactory = { ..._27, - ..._28, - ..._29, + export const CwAdminFactory = { ..._29, ..._30, ..._31, - ..._32 - }; - export const CwCodeIdRegistry = { ..._33, + ..._32, + ..._33, ..._34, - ..._35, - ..._36, - ..._37, - ..._38 + ..._35 }; - export const CwSingle = { ..._39, + export const CwCodeIdRegistry = { ..._36, + ..._37, + ..._38, + ..._39, ..._40, ..._41, - ..._42, - ..._43, - ..._44 + ..._42 + }; + export const CwSingle = { ..._43, + ..._44, + ..._45, + ..._46, + ..._47, + ..._48, + ..._49 + }; + export const contractContextProviders = { ..._50 + }; + export const contractContextBase = { ..._51 + }; + export const contractsContext = { ..._52 }; } } \ No newline at end of file diff --git a/__output__/builder/no-extends/index.ts b/__output__/builder/no-extends/index.ts index 2c07b1e3..26f0e94c 100644 --- a/__output__/builder/no-extends/index.ts +++ b/__output__/builder/no-extends/index.ts @@ -4,72 +4,72 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import * as _45 from "./Factory.types"; -import * as _46 from "./Factory.client"; -import * as _47 from "./Factory.message-composer"; -import * as _48 from "./Factory.react-query"; -import * as _49 from "./Factory.recoil"; -import * as _50 from "./Factory.msg-builder"; -import * as _51 from "./Minter.types"; -import * as _52 from "./Minter.client"; -import * as _53 from "./Minter.message-composer"; -import * as _54 from "./Minter.react-query"; -import * as _55 from "./Minter.recoil"; -import * as _56 from "./Minter.msg-builder"; -import * as _57 from "./CwAdminFactory.types"; -import * as _58 from "./CwAdminFactory.client"; -import * as _59 from "./CwAdminFactory.message-composer"; -import * as _60 from "./CwAdminFactory.react-query"; -import * as _61 from "./CwAdminFactory.recoil"; -import * as _62 from "./CwAdminFactory.msg-builder"; -import * as _63 from "./CwCodeIdRegistry.types"; -import * as _64 from "./CwCodeIdRegistry.client"; -import * as _65 from "./CwCodeIdRegistry.message-composer"; -import * as _66 from "./CwCodeIdRegistry.react-query"; -import * as _67 from "./CwCodeIdRegistry.recoil"; -import * as _68 from "./CwCodeIdRegistry.msg-builder"; -import * as _69 from "./CwSingle.types"; -import * as _70 from "./CwSingle.client"; -import * as _71 from "./CwSingle.message-composer"; -import * as _72 from "./CwSingle.react-query"; -import * as _73 from "./CwSingle.recoil"; -import * as _74 from "./CwSingle.msg-builder"; +import * as _53 from "./Factory.types"; +import * as _54 from "./Factory.client"; +import * as _55 from "./Factory.message-composer"; +import * as _56 from "./Factory.react-query"; +import * as _57 from "./Factory.recoil"; +import * as _58 from "./Factory.msg-builder"; +import * as _59 from "./Minter.types"; +import * as _60 from "./Minter.client"; +import * as _61 from "./Minter.message-composer"; +import * as _62 from "./Minter.react-query"; +import * as _63 from "./Minter.recoil"; +import * as _64 from "./Minter.msg-builder"; +import * as _65 from "./CwAdminFactory.types"; +import * as _66 from "./CwAdminFactory.client"; +import * as _67 from "./CwAdminFactory.message-composer"; +import * as _68 from "./CwAdminFactory.react-query"; +import * as _69 from "./CwAdminFactory.recoil"; +import * as _70 from "./CwAdminFactory.msg-builder"; +import * as _71 from "./CwCodeIdRegistry.types"; +import * as _72 from "./CwCodeIdRegistry.client"; +import * as _73 from "./CwCodeIdRegistry.message-composer"; +import * as _74 from "./CwCodeIdRegistry.react-query"; +import * as _75 from "./CwCodeIdRegistry.recoil"; +import * as _76 from "./CwCodeIdRegistry.msg-builder"; +import * as _77 from "./CwSingle.types"; +import * as _78 from "./CwSingle.client"; +import * as _79 from "./CwSingle.message-composer"; +import * as _80 from "./CwSingle.react-query"; +import * as _81 from "./CwSingle.recoil"; +import * as _82 from "./CwSingle.msg-builder"; export namespace smart { export namespace contracts { - export const Factory = { ..._45, - ..._46, - ..._47, - ..._48, - ..._49, - ..._50 - }; - export const Minter = { ..._51, - ..._52, - ..._53, + export const Factory = { ..._53, ..._54, ..._55, - ..._56 + ..._56, + ..._57, + ..._58 }; - export const CwAdminFactory = { ..._57, - ..._58, - ..._59, + export const Minter = { ..._59, ..._60, ..._61, - ..._62 + ..._62, + ..._63, + ..._64 }; - export const CwCodeIdRegistry = { ..._63, - ..._64, - ..._65, + export const CwAdminFactory = { ..._65, ..._66, ..._67, - ..._68 + ..._68, + ..._69, + ..._70 }; - export const CwSingle = { ..._69, - ..._70, - ..._71, + export const CwCodeIdRegistry = { ..._71, ..._72, ..._73, - ..._74 + ..._74, + ..._75, + ..._76 + }; + export const CwSingle = { ..._77, + ..._78, + ..._79, + ..._80, + ..._81, + ..._82 }; } } \ No newline at end of file diff --git a/packages/ts-codegen/__tests__/builder.test.ts b/packages/ts-codegen/__tests__/builder.test.ts index 400c112d..db79d700 100644 --- a/packages/ts-codegen/__tests__/builder.test.ts +++ b/packages/ts-codegen/__tests__/builder.test.ts @@ -112,6 +112,9 @@ it('builder default', async () => { }, msgBuilder: { enabled: true + }, + useContractsHooks: { + enabled: true, } } }); diff --git a/packages/ts-codegen/src/builder/builder.ts b/packages/ts-codegen/src/builder/builder.ts index 339e7ee5..08df59ad 100644 --- a/packages/ts-codegen/src/builder/builder.ts +++ b/packages/ts-codegen/src/builder/builder.ts @@ -63,7 +63,9 @@ export interface BuilderFile { type: BuilderFileType; pluginType?: string; contract: string; + //filename only: Factory.client.ts localname: string; + //full path: contracts/Factory.client.ts filename: string; }; @@ -157,35 +159,41 @@ export class TSBuilder { } private async after() { - if (this.options.bundle.enabled) { - this.bundle(); - } //create useContracts bundle file const contractsProviderBundlePlugin = new ContractsProviderBundlePlugin(this.options); contractsProviderBundlePlugin.setBuilder(this); - let files = await contractsProviderBundlePlugin.render( - "", + //contractContextProviders.ts + const files = await contractsProviderBundlePlugin.render( + "contractContextProviders", { schemas: [], }, this.outPath ); + if (files && files.length) { [].push.apply(this.files, files); } - createHelpers({ + const helpers = createHelpers({ outPath: this.outPath, contracts: this.contracts, options: this.options, plugins: this.plugins, }, this.builderContext); + + if (helpers && helpers.length) { + [].push.apply(this.files, helpers); + } + + if (this.options.bundle.enabled) { + this.bundle(); + } } async bundle() { - const allFiles = this.files; const bundleFile = this.options.bundle.bundleFile; diff --git a/packages/ts-codegen/src/generators/create-helpers.ts b/packages/ts-codegen/src/generators/create-helpers.ts index 3d035fef..13d1a4ab 100644 --- a/packages/ts-codegen/src/generators/create-helpers.ts +++ b/packages/ts-codegen/src/generators/create-helpers.ts @@ -1,8 +1,8 @@ -import { join, dirname } from "path"; +import { join, dirname, basename, extname } from "path"; import { sync as mkdirp } from "mkdirp"; import pkg from "../../package.json"; import { writeContentToFile } from "../utils/files"; -import { TSBuilderInput } from "../builder"; +import { BuilderFile, TSBuilderInput } from "../builder"; import { contractContextBase, contractsContextTSX } from "../helpers"; import { BuilderContext } from "wasm-ast-types"; @@ -14,15 +14,37 @@ const header = `/** */ \n`; -const write = (outPath: string, file: string, content: string) => { +const write = (outPath: string, file: string, content: string, varname?: string): BuilderFile => { const outFile = join(outPath, file); mkdirp(dirname(outFile)); writeContentToFile(outPath, header + content, outFile); + + return { + type: "plugin", + pluginType: "helper", + contract: varname ?? basename(file, extname(file)), + localname: file, + filename: outFile, + }; }; -export const createHelpers = (input: TSBuilderInput, builderContext: BuilderContext) => { - if (input.options?.useContractsHooks?.enabled && Object.keys(builderContext.providers)?.length) { - write(input.outPath, "contractContextBase.ts", contractContextBase); - write(input.outPath, "contracts-context.tsx", contractsContextTSX); +export const createHelpers = ( + input: TSBuilderInput, + builderContext: BuilderContext +): BuilderFile[] => { + const files: BuilderFile[] = []; + + if ( + input.options?.useContractsHooks?.enabled && + Object.keys(builderContext.providers)?.length + ) { + files.push( + write(input.outPath, "contractContextBase.ts", contractContextBase) + ); + files.push( + write(input.outPath, "contracts-context.tsx", contractsContextTSX, "contractsContext") + ); } + + return files; }; diff --git a/packages/ts-codegen/src/helpers/contractContextBase.ts b/packages/ts-codegen/src/helpers/contractContextBase.ts index 0a9d38ff..8a575845 100644 --- a/packages/ts-codegen/src/helpers/contractContextBase.ts +++ b/packages/ts-codegen/src/helpers/contractContextBase.ts @@ -47,24 +47,49 @@ export class ContractBase< TQuery = IEmptyClient, TMsgComposer = IEmptyClient > { + + address: string | undefined; + cosmWasmClient: CosmWasmClient | undefined; + signingCosmWasmClient: SigningCosmWasmClient | undefined; + TSign?: new ( + client: SigningCosmWasmClient, + sender: string, + contractAddress: string + ) => TSign; + TQuery?: new ( + client: CosmWasmClient, + contractAddress: string + ) => TQuery; + TMsgComposer?: new ( + sender: string, + contractAddress: string + ) => TMsgComposer; + constructor( - protected address: string | undefined, - protected cosmWasmClient: CosmWasmClient | undefined, - protected signingCosmWasmClient: SigningCosmWasmClient | undefined, - private TSign?: new ( + address: string | undefined, + cosmWasmClient: CosmWasmClient | undefined, + signingCosmWasmClient: SigningCosmWasmClient | undefined, + TSign?: new ( client: SigningCosmWasmClient, sender: string, contractAddress: string ) => TSign, - private TQuery?: new ( + TQuery?: new ( client: CosmWasmClient, contractAddress: string ) => TQuery, - private TMsgComposer?: new ( + TMsgComposer?: new ( sender: string, contractAddress: string ) => TMsgComposer - ) {} + ) { + this.address = address; + this.cosmWasmClient = cosmWasmClient; + this.signingCosmWasmClient = signingCosmWasmClient; + this.TSign = TSign; + this.TQuery = TQuery; + this.TMsgComposer = TMsgComposer; + } public getSigningClient(contractAddr: string): TSign { if (!this.signingCosmWasmClient) throw new Error(NO_SINGING_ERROR_MESSAGE); diff --git a/packages/ts-codegen/src/helpers/contractsContextTSX.ts b/packages/ts-codegen/src/helpers/contractsContextTSX.ts index 7fb4182d..03a439b6 100644 --- a/packages/ts-codegen/src/helpers/contractsContextTSX.ts +++ b/packages/ts-codegen/src/helpers/contractsContextTSX.ts @@ -64,7 +64,7 @@ export const ContractsProvider = ({ }; export const useContracts = () => { - const contracts = useContext(ContractsContext); + const contracts: IContractsContext = useContext(ContractsContext); if (contracts === null) { throw new Error('useContracts must be used within a ContractsProvider'); } diff --git a/packages/ts-codegen/src/plugins/provider-bundle.ts b/packages/ts-codegen/src/plugins/provider-bundle.ts index a986650d..7be51f1f 100644 --- a/packages/ts-codegen/src/plugins/provider-bundle.ts +++ b/packages/ts-codegen/src/plugins/provider-bundle.ts @@ -89,6 +89,7 @@ export class ContractsProviderBundlePlugin extends BuilderPluginBase void; +export declare const createHelpers: (input: TSBuilderInput, builderContext: BuilderContext) => BuilderFile[]; diff --git a/packages/ts-codegen/types/src/helpers/contractContextBase.d.ts b/packages/ts-codegen/types/src/helpers/contractContextBase.d.ts index a21bffcf..cd8c6596 100644 --- a/packages/ts-codegen/types/src/helpers/contractContextBase.d.ts +++ b/packages/ts-codegen/types/src/helpers/contractContextBase.d.ts @@ -1 +1 @@ -export declare const contractContextBase = "\nimport {\n CosmWasmClient,\n SigningCosmWasmClient,\n} from '@cosmjs/cosmwasm-stargate';\n\nexport interface IContractConstructor {\n address: string | undefined;\n cosmWasmClient: CosmWasmClient | undefined;\n signingCosmWasmClient: SigningCosmWasmClient | undefined;\n}\n\nexport const NO_SINGING_ERROR_MESSAGE = 'signingCosmWasmClient not connected';\n\nexport const NO_COSMWASW_CLIENT_ERROR_MESSAGE = 'cosmWasmClient not connected';\n\nexport const NO_ADDRESS_ERROR_MESSAGE = \"address doesn't exist\";\n\nexport const NO_SIGNING_CLIENT_ERROR_MESSAGE =\n 'Signing client is not generated. Please check ts-codegen config';\n\nexport const NO_QUERY_CLIENT_ERROR_MESSAGE =\n 'Query client is not generated. Please check ts-codegen config';\n\nexport const NO_MESSAGE_COMPOSER_ERROR_MESSAGE =\n 'Message composer client is not generated. Please check ts-codegen config';\n\n/**\n * a placeholder for non-generated classes\n */\nexport interface IEmptyClient {}\n\nexport interface ISigningClientProvider {\n getSigningClient(contractAddr: string): T;\n}\n\nexport interface IQueryClientProvider {\n getQueryClient(contractAddr: string): T;\n}\n\nexport interface IMessageComposerProvider {\n getMessageComposer(contractAddr: string): T;\n}\n\nexport class ContractBase<\n TSign = IEmptyClient,\n TQuery = IEmptyClient,\n TMsgComposer = IEmptyClient\n> {\n constructor(\n protected address: string | undefined,\n protected cosmWasmClient: CosmWasmClient | undefined,\n protected signingCosmWasmClient: SigningCosmWasmClient | undefined,\n private TSign?: new (\n client: SigningCosmWasmClient,\n sender: string,\n contractAddress: string\n ) => TSign,\n private TQuery?: new (\n client: CosmWasmClient,\n contractAddress: string\n ) => TQuery,\n private TMsgComposer?: new (\n sender: string,\n contractAddress: string\n ) => TMsgComposer\n ) {}\n\n public getSigningClient(contractAddr: string): TSign {\n if (!this.signingCosmWasmClient) throw new Error(NO_SINGING_ERROR_MESSAGE);\n if (!this.address) throw new Error(NO_ADDRESS_ERROR_MESSAGE);\n if (!this.TSign) throw new Error(NO_SIGNING_CLIENT_ERROR_MESSAGE);\n return new this.TSign(\n this.signingCosmWasmClient,\n this.address,\n contractAddr\n );\n }\n\n public getQueryClient(contractAddr: string): TQuery {\n if (!this.cosmWasmClient) throw new Error(NO_COSMWASW_CLIENT_ERROR_MESSAGE);\n if (!this.TQuery) throw new Error(NO_QUERY_CLIENT_ERROR_MESSAGE);\n return new this.TQuery(this.cosmWasmClient, contractAddr);\n }\n\n public getMessageComposer(contractAddr: string): TMsgComposer {\n if (!this.address) throw new Error(NO_ADDRESS_ERROR_MESSAGE);\n if (!this.TMsgComposer) throw new Error(NO_MESSAGE_COMPOSER_ERROR_MESSAGE);\n return new this.TMsgComposer(this.address, contractAddr);\n }\n}\n"; +export declare const contractContextBase = "\nimport {\n CosmWasmClient,\n SigningCosmWasmClient,\n} from '@cosmjs/cosmwasm-stargate';\n\nexport interface IContractConstructor {\n address: string | undefined;\n cosmWasmClient: CosmWasmClient | undefined;\n signingCosmWasmClient: SigningCosmWasmClient | undefined;\n}\n\nexport const NO_SINGING_ERROR_MESSAGE = 'signingCosmWasmClient not connected';\n\nexport const NO_COSMWASW_CLIENT_ERROR_MESSAGE = 'cosmWasmClient not connected';\n\nexport const NO_ADDRESS_ERROR_MESSAGE = \"address doesn't exist\";\n\nexport const NO_SIGNING_CLIENT_ERROR_MESSAGE =\n 'Signing client is not generated. Please check ts-codegen config';\n\nexport const NO_QUERY_CLIENT_ERROR_MESSAGE =\n 'Query client is not generated. Please check ts-codegen config';\n\nexport const NO_MESSAGE_COMPOSER_ERROR_MESSAGE =\n 'Message composer client is not generated. Please check ts-codegen config';\n\n/**\n * a placeholder for non-generated classes\n */\nexport interface IEmptyClient {}\n\nexport interface ISigningClientProvider {\n getSigningClient(contractAddr: string): T;\n}\n\nexport interface IQueryClientProvider {\n getQueryClient(contractAddr: string): T;\n}\n\nexport interface IMessageComposerProvider {\n getMessageComposer(contractAddr: string): T;\n}\n\nexport class ContractBase<\n TSign = IEmptyClient,\n TQuery = IEmptyClient,\n TMsgComposer = IEmptyClient\n> {\n\n address: string | undefined;\n cosmWasmClient: CosmWasmClient | undefined;\n signingCosmWasmClient: SigningCosmWasmClient | undefined;\n TSign?: new (\n client: SigningCosmWasmClient,\n sender: string,\n contractAddress: string\n ) => TSign;\n TQuery?: new (\n client: CosmWasmClient,\n contractAddress: string\n ) => TQuery;\n TMsgComposer?: new (\n sender: string,\n contractAddress: string\n ) => TMsgComposer;\n\n constructor(\n address: string | undefined,\n cosmWasmClient: CosmWasmClient | undefined,\n signingCosmWasmClient: SigningCosmWasmClient | undefined,\n TSign?: new (\n client: SigningCosmWasmClient,\n sender: string,\n contractAddress: string\n ) => TSign,\n TQuery?: new (\n client: CosmWasmClient,\n contractAddress: string\n ) => TQuery,\n TMsgComposer?: new (\n sender: string,\n contractAddress: string\n ) => TMsgComposer\n ) {\n this.address = address;\n this.cosmWasmClient = cosmWasmClient;\n this.signingCosmWasmClient = signingCosmWasmClient;\n this.TSign = TSign;\n this.TQuery = TQuery;\n this.TMsgComposer = TMsgComposer;\n }\n\n public getSigningClient(contractAddr: string): TSign {\n if (!this.signingCosmWasmClient) throw new Error(NO_SINGING_ERROR_MESSAGE);\n if (!this.address) throw new Error(NO_ADDRESS_ERROR_MESSAGE);\n if (!this.TSign) throw new Error(NO_SIGNING_CLIENT_ERROR_MESSAGE);\n return new this.TSign(\n this.signingCosmWasmClient,\n this.address,\n contractAddr\n );\n }\n\n public getQueryClient(contractAddr: string): TQuery {\n if (!this.cosmWasmClient) throw new Error(NO_COSMWASW_CLIENT_ERROR_MESSAGE);\n if (!this.TQuery) throw new Error(NO_QUERY_CLIENT_ERROR_MESSAGE);\n return new this.TQuery(this.cosmWasmClient, contractAddr);\n }\n\n public getMessageComposer(contractAddr: string): TMsgComposer {\n if (!this.address) throw new Error(NO_ADDRESS_ERROR_MESSAGE);\n if (!this.TMsgComposer) throw new Error(NO_MESSAGE_COMPOSER_ERROR_MESSAGE);\n return new this.TMsgComposer(this.address, contractAddr);\n }\n}\n"; diff --git a/packages/ts-codegen/types/src/helpers/contractsContextTSX.d.ts b/packages/ts-codegen/types/src/helpers/contractsContextTSX.d.ts index 38db3def..43829a27 100644 --- a/packages/ts-codegen/types/src/helpers/contractsContextTSX.d.ts +++ b/packages/ts-codegen/types/src/helpers/contractsContextTSX.d.ts @@ -1 +1 @@ -export declare const contractsContextTSX = "\nimport React, { useEffect, useMemo, useRef, useState, useContext } from 'react';\nimport {\n CosmWasmClient,\n SigningCosmWasmClient,\n} from '@cosmjs/cosmwasm-stargate';\n\nimport { IContractsContext, getProviders } from './contractContextProviders';\n\ninterface ContractsConfig {\n address: string | undefined;\n getCosmWasmClient: () => Promise;\n getSigningCosmWasmClient: () => Promise;\n}\n\nconst ContractsContext = React.createContext(null);\n\nexport const ContractsProvider = ({\n children,\n contractsConfig,\n}: {\n children: React.ReactNode;\n contractsConfig: ContractsConfig;\n}) => {\n const [cosmWasmClient, setCosmWasmClient] = useState();\n const [signingCosmWasmClient, setSigningCosmWasmClient] =\n useState();\n\n const { address, getCosmWasmClient, getSigningCosmWasmClient } =\n contractsConfig;\n\n const prevAddressRef = useRef(address);\n\n const contracts: IContractsContext = useMemo(() => {\n return getProviders(address, cosmWasmClient, signingCosmWasmClient);\n }, [address, cosmWasmClient, signingCosmWasmClient]);\n\n useEffect(() => {\n const connectSigningCwClient = async () => {\n if (address && prevAddressRef.current !== address) {\n const signingCosmWasmClient = await getSigningCosmWasmClient();\n setSigningCosmWasmClient(signingCosmWasmClient);\n } else if (!address) {\n setSigningCosmWasmClient(undefined);\n }\n prevAddressRef.current = address;\n };\n connectSigningCwClient();\n }, [address, getSigningCosmWasmClient]);\n\n useEffect(() => {\n const connectCosmWasmClient = async () => {\n const cosmWasmClient = await getCosmWasmClient();\n setCosmWasmClient(cosmWasmClient);\n };\n connectCosmWasmClient();\n }, [getCosmWasmClient]);\n\n return (\n \n {children}\n \n );\n};\n\nexport const useContracts = () => {\n const contracts = useContext(ContractsContext);\n if (contracts === null) {\n throw new Error('useContracts must be used within a ContractsProvider');\n }\n return contracts;\n};\n"; +export declare const contractsContextTSX = "\nimport React, { useEffect, useMemo, useRef, useState, useContext } from 'react';\nimport {\n CosmWasmClient,\n SigningCosmWasmClient,\n} from '@cosmjs/cosmwasm-stargate';\n\nimport { IContractsContext, getProviders } from './contractContextProviders';\n\ninterface ContractsConfig {\n address: string | undefined;\n getCosmWasmClient: () => Promise;\n getSigningCosmWasmClient: () => Promise;\n}\n\nconst ContractsContext = React.createContext(null);\n\nexport const ContractsProvider = ({\n children,\n contractsConfig,\n}: {\n children: React.ReactNode;\n contractsConfig: ContractsConfig;\n}) => {\n const [cosmWasmClient, setCosmWasmClient] = useState();\n const [signingCosmWasmClient, setSigningCosmWasmClient] =\n useState();\n\n const { address, getCosmWasmClient, getSigningCosmWasmClient } =\n contractsConfig;\n\n const prevAddressRef = useRef(address);\n\n const contracts: IContractsContext = useMemo(() => {\n return getProviders(address, cosmWasmClient, signingCosmWasmClient);\n }, [address, cosmWasmClient, signingCosmWasmClient]);\n\n useEffect(() => {\n const connectSigningCwClient = async () => {\n if (address && prevAddressRef.current !== address) {\n const signingCosmWasmClient = await getSigningCosmWasmClient();\n setSigningCosmWasmClient(signingCosmWasmClient);\n } else if (!address) {\n setSigningCosmWasmClient(undefined);\n }\n prevAddressRef.current = address;\n };\n connectSigningCwClient();\n }, [address, getSigningCosmWasmClient]);\n\n useEffect(() => {\n const connectCosmWasmClient = async () => {\n const cosmWasmClient = await getCosmWasmClient();\n setCosmWasmClient(cosmWasmClient);\n };\n connectCosmWasmClient();\n }, [getCosmWasmClient]);\n\n return (\n \n {children}\n \n );\n};\n\nexport const useContracts = () => {\n const contracts: IContractsContext = useContext(ContractsContext);\n if (contracts === null) {\n throw new Error('useContracts must be used within a ContractsProvider');\n }\n return contracts;\n};\n"; From b83eb57ce1d4d462670427155daaee8fffaec6af Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Wed, 26 Jul 2023 10:18:12 +0800 Subject: [PATCH 147/287] add an option of use shorthand ctor --- README.md | 77 +++++++++++++--- .../builder/default/contractContextBase.ts | 39 ++------ packages/ts-codegen/__tests__/builder.test.ts | 1 + packages/ts-codegen/src/builder/builder.ts | 6 +- .../src/generators/create-helpers.ts | 29 +++++- .../contractContextBaseShortHandCtor.ts | 92 +++++++++++++++++++ packages/ts-codegen/src/helpers/index.ts | 1 + .../ts-codegen/types/src/builder/builder.d.ts | 9 +- .../contractContextBaseShortHandCtor.d.ts | 1 + .../ts-codegen/types/src/helpers/index.d.ts | 1 + .../wasm-ast-types/types/context/imports.d.ts | 4 +- 11 files changed, 206 insertions(+), 54 deletions(-) create mode 100644 packages/ts-codegen/src/helpers/contractContextBaseShortHandCtor.ts create mode 100644 packages/ts-codegen/types/src/helpers/contractContextBaseShortHandCtor.d.ts diff --git a/README.md b/README.md index 34874f69..3d2c03a5 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ The quickest and easiest way to interact with CosmWasm Contracts. `@cosmwasm/ts- - [Exporting Schemas](#exporting-schemas) - [Developing](#developing) - [Related](#related) -## Quickstart +## Quickstart Clone your project and `cd` into your contracts folder @@ -133,7 +133,7 @@ codegen({ console.log('✨ all done!'); }); ``` -#### Types +#### Types Typescript types and interfaces are generated in separate files so they can be imported into various generated plugins. @@ -149,7 +149,7 @@ Typescript types and interfaces are generated in separate files so they can be i ### Client -The `client` plugin will generate TS client classes for your contracts. This option generates a `QueryClient` for queries as well as a `Client` for queries and mutations. +The `client` plugin will generate TS client classes for your contracts. This option generates a `QueryClient` for queries as well as a `Client` for queries and mutations. [see example output code](https://gist.github.com/pyramation/30508678b7563e286f06ccc5ac384817) @@ -189,7 +189,7 @@ Generate [react-query v3](https://react-query-v3.tanstack.com/) or [react-query | `reactQuery.camelize` | use camelCase style for property names | -#### React Query via CLI +#### React Query via CLI Here is an example without optional client, using v3 for `react-query`, without mutations: @@ -231,7 +231,7 @@ cosmwasm-ts-codegen generate \ --plugin recoil \ --schema ./schema \ --out ./ts \ - --name MyContractName + --name MyContractName ``` #### Recoil Options @@ -253,7 +253,7 @@ cosmwasm-ts-codegen generate \ --plugin message-composer \ --schema ./schema \ --out ./ts \ - --name MyContractName + --name MyContractName ``` #### Message Composer Options @@ -274,7 +274,7 @@ cosmwasm-ts-codegen generate \ --plugin msg-builder \ --schema ./schema \ --out ./ts \ - --name MyContractName + --name MyContractName ``` #### Message Builder Options @@ -296,8 +296,8 @@ import { useChain } from '@cosmos-kit/react'; import { ContractsProvider } from '../path/to/codegen/contracts-context'; export default function YourComponent() { - - const { + + const { address, getCosmWasmClient, getSigningCosmWasmClient @@ -357,11 +357,64 @@ const { CwAdminFactoryClient } = contracts.CwAdminFactory; | `bundle.scope` | name of the scope, defaults to `contracts` (you can use `.` to make more scopes) | | `bundle.bundleFile` | name of the bundle file | +#### Coding Style + +| option | description | +| --------------------- | -------------------------------------------------------------------------------- | +| `useShorthandCtor` | Enable using shorthand constructor. Default: false | + +Using shorthand constructor(Might not be transpiled correctly with babel): + +```ts + constructor( + protected address: string | undefined, + protected cosmWasmClient: CosmWasmClient | undefined, + protected signingCosmWasmClient: SigningCosmWasmClient | undefined, + private TSign?: new ( + client: SigningCosmWasmClient, + sender: string, + contractAddress: string + ) => TSign, + private TQuery?: new ( + client: CosmWasmClient, + contractAddress: string + ) => TQuery, + private TMsgComposer?: new ( + sender: string, + contractAddress: string + ) => TMsgComposer + ) {} +``` + +Without using shorthand constructor: + +```ts + address: string | undefined; + ... + TMsgComposer?: new ( + sender: string, + contractAddress: string + ) => TMsgComposer; + + constructor( + address: string | undefined, + ... + TMsgComposer?: new ( + sender: string, + contractAddress: string + ) => TMsgComposer + ) { + this.address = address; + ... + this.TMsgComposer = TMsgComposer; + } +``` + ### CLI Usage and Examples #### Interactive prompt -The CLI is interactive, and if you don't specify an option, it will interactively prompt you. +The CLI is interactive, and if you don't specify an option, it will interactively prompt you. ```sh cosmwasm-ts-codegen generate @@ -444,7 +497,7 @@ cosmwasm-ts-codegen generate \ for lower-level access, you can import the various plugins directly: ```ts -import { +import { generateTypes, generateClient, generateReactQuery, @@ -541,7 +594,7 @@ export_schema_with_title( ### Initial setup ``` -yarn +yarn yarn bootstrap ``` diff --git a/__output__/builder/default/contractContextBase.ts b/__output__/builder/default/contractContextBase.ts index a2f5e7af..45b6b20a 100644 --- a/__output__/builder/default/contractContextBase.ts +++ b/__output__/builder/default/contractContextBase.ts @@ -53,49 +53,24 @@ export class ContractBase< TQuery = IEmptyClient, TMsgComposer = IEmptyClient > { - - address: string | undefined; - cosmWasmClient: CosmWasmClient | undefined; - signingCosmWasmClient: SigningCosmWasmClient | undefined; - TSign?: new ( - client: SigningCosmWasmClient, - sender: string, - contractAddress: string - ) => TSign; - TQuery?: new ( - client: CosmWasmClient, - contractAddress: string - ) => TQuery; - TMsgComposer?: new ( - sender: string, - contractAddress: string - ) => TMsgComposer; - constructor( - address: string | undefined, - cosmWasmClient: CosmWasmClient | undefined, - signingCosmWasmClient: SigningCosmWasmClient | undefined, - TSign?: new ( + protected address: string | undefined, + protected cosmWasmClient: CosmWasmClient | undefined, + protected signingCosmWasmClient: SigningCosmWasmClient | undefined, + private TSign?: new ( client: SigningCosmWasmClient, sender: string, contractAddress: string ) => TSign, - TQuery?: new ( + private TQuery?: new ( client: CosmWasmClient, contractAddress: string ) => TQuery, - TMsgComposer?: new ( + private TMsgComposer?: new ( sender: string, contractAddress: string ) => TMsgComposer - ) { - this.address = address; - this.cosmWasmClient = cosmWasmClient; - this.signingCosmWasmClient = signingCosmWasmClient; - this.TSign = TSign; - this.TQuery = TQuery; - this.TMsgComposer = TMsgComposer; - } + ) {} public getSigningClient(contractAddr: string): TSign { if (!this.signingCosmWasmClient) throw new Error(NO_SINGING_ERROR_MESSAGE); diff --git a/packages/ts-codegen/__tests__/builder.test.ts b/packages/ts-codegen/__tests__/builder.test.ts index db79d700..e50af978 100644 --- a/packages/ts-codegen/__tests__/builder.test.ts +++ b/packages/ts-codegen/__tests__/builder.test.ts @@ -94,6 +94,7 @@ it('builder default', async () => { bundleFile: 'index.ts', scope: 'smart.contracts' }, + useShorthandCtor: true, types: { enabled: true }, diff --git a/packages/ts-codegen/src/builder/builder.ts b/packages/ts-codegen/src/builder/builder.ts index 08df59ad..a9af35b5 100644 --- a/packages/ts-codegen/src/builder/builder.ts +++ b/packages/ts-codegen/src/builder/builder.ts @@ -49,11 +49,15 @@ export interface BundleOptions { export interface UseContractsOptions { enabled?: boolean; - filename?: string; }; export type TSBuilderOptions = { bundle?: BundleOptions; + /** + * Enable using shorthand constructor. + * Default: false + */ + useShorthandCtor?: boolean; useContractsHooks?: UseContractsOptions; } & RenderOptions; diff --git a/packages/ts-codegen/src/generators/create-helpers.ts b/packages/ts-codegen/src/generators/create-helpers.ts index 13d1a4ab..e0209926 100644 --- a/packages/ts-codegen/src/generators/create-helpers.ts +++ b/packages/ts-codegen/src/generators/create-helpers.ts @@ -3,7 +3,11 @@ import { sync as mkdirp } from "mkdirp"; import pkg from "../../package.json"; import { writeContentToFile } from "../utils/files"; import { BuilderFile, TSBuilderInput } from "../builder"; -import { contractContextBase, contractsContextTSX } from "../helpers"; +import { + contractContextBase, + contractContextBaseShortHandCtor, + contractsContextTSX, +} from "../helpers"; import { BuilderContext } from "wasm-ast-types"; const version = process.env.NODE_ENV === "test" ? "latest" : pkg.version; @@ -14,7 +18,12 @@ const header = `/** */ \n`; -const write = (outPath: string, file: string, content: string, varname?: string): BuilderFile => { +const write = ( + outPath: string, + file: string, + content: string, + varname?: string +): BuilderFile => { const outFile = join(outPath, file); mkdirp(dirname(outFile)); writeContentToFile(outPath, header + content, outFile); @@ -38,11 +47,23 @@ export const createHelpers = ( input.options?.useContractsHooks?.enabled && Object.keys(builderContext.providers)?.length ) { + const useShorthandCtor = input.options?.useShorthandCtor; files.push( - write(input.outPath, "contractContextBase.ts", contractContextBase) + write( + input.outPath, + "contractContextBase.ts", + useShorthandCtor + ? contractContextBaseShortHandCtor + : contractContextBase + ) ); files.push( - write(input.outPath, "contracts-context.tsx", contractsContextTSX, "contractsContext") + write( + input.outPath, + "contracts-context.tsx", + contractsContextTSX, + "contractsContext" + ) ); } diff --git a/packages/ts-codegen/src/helpers/contractContextBaseShortHandCtor.ts b/packages/ts-codegen/src/helpers/contractContextBaseShortHandCtor.ts new file mode 100644 index 00000000..844aeadc --- /dev/null +++ b/packages/ts-codegen/src/helpers/contractContextBaseShortHandCtor.ts @@ -0,0 +1,92 @@ +export const contractContextBaseShortHandCtor = ` +import { + CosmWasmClient, + SigningCosmWasmClient, +} from '@cosmjs/cosmwasm-stargate'; + +export interface IContractConstructor { + address: string | undefined; + cosmWasmClient: CosmWasmClient | undefined; + signingCosmWasmClient: SigningCosmWasmClient | undefined; +} + +export const NO_SINGING_ERROR_MESSAGE = 'signingCosmWasmClient not connected'; + +export const NO_COSMWASW_CLIENT_ERROR_MESSAGE = 'cosmWasmClient not connected'; + +export const NO_ADDRESS_ERROR_MESSAGE = "address doesn't exist"; + +export const NO_SIGNING_CLIENT_ERROR_MESSAGE = + 'Signing client is not generated. Please check ts-codegen config'; + +export const NO_QUERY_CLIENT_ERROR_MESSAGE = + 'Query client is not generated. Please check ts-codegen config'; + +export const NO_MESSAGE_COMPOSER_ERROR_MESSAGE = + 'Message composer client is not generated. Please check ts-codegen config'; + +/** + * a placeholder for non-generated classes + */ +export interface IEmptyClient {} + +export interface ISigningClientProvider { + getSigningClient(contractAddr: string): T; +} + +export interface IQueryClientProvider { + getQueryClient(contractAddr: string): T; +} + +export interface IMessageComposerProvider { + getMessageComposer(contractAddr: string): T; +} + +export class ContractBase< + TSign = IEmptyClient, + TQuery = IEmptyClient, + TMsgComposer = IEmptyClient +> { + constructor( + protected address: string | undefined, + protected cosmWasmClient: CosmWasmClient | undefined, + protected signingCosmWasmClient: SigningCosmWasmClient | undefined, + private TSign?: new ( + client: SigningCosmWasmClient, + sender: string, + contractAddress: string + ) => TSign, + private TQuery?: new ( + client: CosmWasmClient, + contractAddress: string + ) => TQuery, + private TMsgComposer?: new ( + sender: string, + contractAddress: string + ) => TMsgComposer + ) {} + + public getSigningClient(contractAddr: string): TSign { + if (!this.signingCosmWasmClient) throw new Error(NO_SINGING_ERROR_MESSAGE); + if (!this.address) throw new Error(NO_ADDRESS_ERROR_MESSAGE); + if (!this.TSign) throw new Error(NO_SIGNING_CLIENT_ERROR_MESSAGE); + return new this.TSign( + this.signingCosmWasmClient, + this.address, + contractAddr + ); + } + + public getQueryClient(contractAddr: string): TQuery { + if (!this.cosmWasmClient) throw new Error(NO_COSMWASW_CLIENT_ERROR_MESSAGE); + if (!this.TQuery) throw new Error(NO_QUERY_CLIENT_ERROR_MESSAGE); + return new this.TQuery(this.cosmWasmClient, contractAddr); + } + + public getMessageComposer(contractAddr: string): TMsgComposer { + if (!this.address) throw new Error(NO_ADDRESS_ERROR_MESSAGE); + if (!this.TMsgComposer) throw new Error(NO_MESSAGE_COMPOSER_ERROR_MESSAGE); + return new this.TMsgComposer(this.address, contractAddr); + } +} +`; diff --git a/packages/ts-codegen/src/helpers/index.ts b/packages/ts-codegen/src/helpers/index.ts index 0132275b..ab8e74c9 100644 --- a/packages/ts-codegen/src/helpers/index.ts +++ b/packages/ts-codegen/src/helpers/index.ts @@ -1,2 +1,3 @@ export * from './contractContextBase'; +export * from './contractContextBaseShortHandCtor'; export * from './contractsContextTSX'; \ No newline at end of file diff --git a/packages/ts-codegen/types/src/builder/builder.d.ts b/packages/ts-codegen/types/src/builder/builder.d.ts index 0eca5b63..73637368 100644 --- a/packages/ts-codegen/types/src/builder/builder.d.ts +++ b/packages/ts-codegen/types/src/builder/builder.d.ts @@ -14,13 +14,16 @@ export interface BundleOptions { } export interface UseContractsOptions { enabled?: boolean; - filename?: string; } -export type TSBuilderOptions = { +export declare type TSBuilderOptions = { bundle?: BundleOptions; + /** + * Enable using shorthand constructor. + */ + useShorthandCtor?: boolean; useContractsHooks?: UseContractsOptions; } & RenderOptions; -export type BuilderFileType = 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer' | 'msg-builder' | 'plugin'; +export declare type BuilderFileType = 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer' | 'msg-builder' | 'plugin'; export interface BuilderFile { type: BuilderFileType; pluginType?: string; diff --git a/packages/ts-codegen/types/src/helpers/contractContextBaseShortHandCtor.d.ts b/packages/ts-codegen/types/src/helpers/contractContextBaseShortHandCtor.d.ts new file mode 100644 index 00000000..d582a1e9 --- /dev/null +++ b/packages/ts-codegen/types/src/helpers/contractContextBaseShortHandCtor.d.ts @@ -0,0 +1 @@ +export declare const contractContextBaseShortHandCtor = "\nimport {\n CosmWasmClient,\n SigningCosmWasmClient,\n} from '@cosmjs/cosmwasm-stargate';\n\nexport interface IContractConstructor {\n address: string | undefined;\n cosmWasmClient: CosmWasmClient | undefined;\n signingCosmWasmClient: SigningCosmWasmClient | undefined;\n}\n\nexport const NO_SINGING_ERROR_MESSAGE = 'signingCosmWasmClient not connected';\n\nexport const NO_COSMWASW_CLIENT_ERROR_MESSAGE = 'cosmWasmClient not connected';\n\nexport const NO_ADDRESS_ERROR_MESSAGE = \"address doesn't exist\";\n\nexport const NO_SIGNING_CLIENT_ERROR_MESSAGE =\n 'Signing client is not generated. Please check ts-codegen config';\n\nexport const NO_QUERY_CLIENT_ERROR_MESSAGE =\n 'Query client is not generated. Please check ts-codegen config';\n\nexport const NO_MESSAGE_COMPOSER_ERROR_MESSAGE =\n 'Message composer client is not generated. Please check ts-codegen config';\n\n/**\n * a placeholder for non-generated classes\n */\nexport interface IEmptyClient {}\n\nexport interface ISigningClientProvider {\n getSigningClient(contractAddr: string): T;\n}\n\nexport interface IQueryClientProvider {\n getQueryClient(contractAddr: string): T;\n}\n\nexport interface IMessageComposerProvider {\n getMessageComposer(contractAddr: string): T;\n}\n\nexport class ContractBase<\n TSign = IEmptyClient,\n TQuery = IEmptyClient,\n TMsgComposer = IEmptyClient\n> {\n constructor(\n protected address: string | undefined,\n protected cosmWasmClient: CosmWasmClient | undefined,\n protected signingCosmWasmClient: SigningCosmWasmClient | undefined,\n private TSign?: new (\n client: SigningCosmWasmClient,\n sender: string,\n contractAddress: string\n ) => TSign,\n private TQuery?: new (\n client: CosmWasmClient,\n contractAddress: string\n ) => TQuery,\n private TMsgComposer?: new (\n sender: string,\n contractAddress: string\n ) => TMsgComposer\n ) {}\n\n public getSigningClient(contractAddr: string): TSign {\n if (!this.signingCosmWasmClient) throw new Error(NO_SINGING_ERROR_MESSAGE);\n if (!this.address) throw new Error(NO_ADDRESS_ERROR_MESSAGE);\n if (!this.TSign) throw new Error(NO_SIGNING_CLIENT_ERROR_MESSAGE);\n return new this.TSign(\n this.signingCosmWasmClient,\n this.address,\n contractAddr\n );\n }\n\n public getQueryClient(contractAddr: string): TQuery {\n if (!this.cosmWasmClient) throw new Error(NO_COSMWASW_CLIENT_ERROR_MESSAGE);\n if (!this.TQuery) throw new Error(NO_QUERY_CLIENT_ERROR_MESSAGE);\n return new this.TQuery(this.cosmWasmClient, contractAddr);\n }\n\n public getMessageComposer(contractAddr: string): TMsgComposer {\n if (!this.address) throw new Error(NO_ADDRESS_ERROR_MESSAGE);\n if (!this.TMsgComposer) throw new Error(NO_MESSAGE_COMPOSER_ERROR_MESSAGE);\n return new this.TMsgComposer(this.address, contractAddr);\n }\n}\n"; diff --git a/packages/ts-codegen/types/src/helpers/index.d.ts b/packages/ts-codegen/types/src/helpers/index.d.ts index d9837fc8..de7142d8 100644 --- a/packages/ts-codegen/types/src/helpers/index.d.ts +++ b/packages/ts-codegen/types/src/helpers/index.d.ts @@ -1,2 +1,3 @@ export * from './contractContextBase'; +export * from './contractContextBaseShortHandCtor'; export * from './contractsContextTSX'; diff --git a/packages/wasm-ast-types/types/context/imports.d.ts b/packages/wasm-ast-types/types/context/imports.d.ts index 21361af1..55ca6708 100644 --- a/packages/wasm-ast-types/types/context/imports.d.ts +++ b/packages/wasm-ast-types/types/context/imports.d.ts @@ -5,8 +5,8 @@ export interface ImportObj { path: string; importAs?: string; } -export type GetUtilFn = ((...args: any[]) => (context: TContext) => ImportObj); -export type UtilMapping = { +export declare type GetUtilFn = ((...args: any[]) => (context: TContext) => ImportObj); +export declare type UtilMapping = { [key: string]: ImportObj | string | GetUtilFn; }; export declare const UTILS: { From 676f2d7bf1f7317e75660f8c19a71619064857d2 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Fri, 28 Jul 2023 20:01:37 +0200 Subject: [PATCH 148/287] chore(release): publish - @cosmwasm/ts-codegen@0.34.0 - wasm-ast-types@0.25.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 3f4be7d2..aed1636a 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.34.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.33.0...@cosmwasm/ts-codegen@0.34.0) (2023-07-28) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.33.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.32.0...@cosmwasm/ts-codegen@0.33.0) (2023-07-16) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 0ff3f217..32b3a1a9 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.33.0", + "version": "0.34.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.24.0" + "wasm-ast-types": "^0.25.0" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index daafd629..ef1b272a 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.25.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.24.0...wasm-ast-types@0.25.0) (2023-07-28) + +**Note:** Version bump only for package wasm-ast-types + + + + + # [0.24.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.23.1...wasm-ast-types@0.24.0) (2023-07-14) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index a4d4ce0d..d6c024ae 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.24.0", + "version": "0.25.0", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From 8baf63fa304dc622095d35cde8de44159b0f9091 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Sun, 30 Jul 2023 14:37:53 +0200 Subject: [PATCH 149/287] readme --- README.md | 2 +- packages/ts-codegen/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3d2c03a5..47a7df84 100644 --- a/README.md +++ b/README.md @@ -621,7 +621,7 @@ See the [docs](https://github.com/CosmWasm/ts-codegen/blob/main/packages/wasm-as Checkout these related projects: -* [@osmonauts/telescope](https://github.com/osmosis-labs/telescope) a "babel for the Cosmos", Telescope is a TypeScript Transpiler for Cosmos Protobufs. +* [@cosmology/telescope](https://github.com/osmosis-labs/telescope) a "babel for the Cosmos", Telescope is a TypeScript Transpiler for Cosmos Protobufs. * [chain-registry](https://github.com/cosmology-tech/chain-registry) an npm module for the official Cosmos chain-registry. * [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) A wallet connector for the Cosmos ⚛️ * [create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) set up a modern Cosmos app by running one command. diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index 34874f69..f66fecb6 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -568,7 +568,7 @@ See the [docs](https://github.com/CosmWasm/ts-codegen/blob/main/packages/wasm-as Checkout these related projects: -* [@osmonauts/telescope](https://github.com/osmosis-labs/telescope) a "babel for the Cosmos", Telescope is a TypeScript Transpiler for Cosmos Protobufs. +* [@cosmology/telescope](https://github.com/osmosis-labs/telescope) a "babel for the Cosmos", Telescope is a TypeScript Transpiler for Cosmos Protobufs. * [chain-registry](https://github.com/cosmology-tech/chain-registry) an npm module for the official Cosmos chain-registry. * [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) A wallet connector for the Cosmos ⚛️ * [create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) set up a modern Cosmos app by running one command. From b9f3488ecc9beec73a6d39b7fb18e8fe980ba725 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Sun, 30 Jul 2023 14:38:01 +0200 Subject: [PATCH 150/287] chore(release): publish - @cosmwasm/ts-codegen@0.34.1 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index aed1636a..2147bca8 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.34.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.34.0...@cosmwasm/ts-codegen@0.34.1) (2023-07-30) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.34.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.33.0...@cosmwasm/ts-codegen@0.34.0) (2023-07-28) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 32b3a1a9..e22d4af7 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.34.0", + "version": "0.34.1", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From 685e8399461448d282688cdd6f2f16506cbbff3d Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Sun, 30 Jul 2023 14:41:20 +0200 Subject: [PATCH 151/287] readme --- README.md | 2 +- packages/ts-codegen/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 47a7df84..89aa3f96 100644 --- a/README.md +++ b/README.md @@ -621,7 +621,7 @@ See the [docs](https://github.com/CosmWasm/ts-codegen/blob/main/packages/wasm-as Checkout these related projects: -* [@cosmology/telescope](https://github.com/osmosis-labs/telescope) a "babel for the Cosmos", Telescope is a TypeScript Transpiler for Cosmos Protobufs. +* [@cosmology/telescope](https://github.com/cosmology-tech/telescope) a "babel for the Cosmos", Telescope is a TypeScript Transpiler for Cosmos Protobufs. * [chain-registry](https://github.com/cosmology-tech/chain-registry) an npm module for the official Cosmos chain-registry. * [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) A wallet connector for the Cosmos ⚛️ * [create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) set up a modern Cosmos app by running one command. diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index f66fecb6..bd95d4ef 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -568,7 +568,7 @@ See the [docs](https://github.com/CosmWasm/ts-codegen/blob/main/packages/wasm-as Checkout these related projects: -* [@cosmology/telescope](https://github.com/osmosis-labs/telescope) a "babel for the Cosmos", Telescope is a TypeScript Transpiler for Cosmos Protobufs. +* [@cosmology/telescope](https://github.com/cosmology-tech/telescope) a "babel for the Cosmos", Telescope is a TypeScript Transpiler for Cosmos Protobufs. * [chain-registry](https://github.com/cosmology-tech/chain-registry) an npm module for the official Cosmos chain-registry. * [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) A wallet connector for the Cosmos ⚛️ * [create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) set up a modern Cosmos app by running one command. From 0c404a0d94627610256c63f79dc2ffc3b741a845 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Sun, 30 Jul 2023 14:41:25 +0200 Subject: [PATCH 152/287] chore(release): publish - @cosmwasm/ts-codegen@0.34.2 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 2147bca8..fb82be09 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.34.2](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.34.1...@cosmwasm/ts-codegen@0.34.2) (2023-07-30) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.34.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.34.0...@cosmwasm/ts-codegen@0.34.1) (2023-07-30) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index e22d4af7..ce28a9a7 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.34.1", + "version": "0.34.2", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From 058c8854efaa0aa6486ca6b46c36a77862666314 Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Mon, 31 Jul 2023 12:45:07 +0800 Subject: [PATCH 153/287] change default useShorthandCtor to true --- .../contracts/contractContextBase.ts | 39 ++++--------------- .../builder/default/contractContextBase.ts | 39 +++++++++++++++---- .../__snapshots__/builder.test.ts.snap | 16 ++++++++ packages/ts-codegen/__tests__/builder.test.ts | 2 +- packages/ts-codegen/src/builder/builder.ts | 3 +- .../ts-codegen/types/src/builder/builder.d.ts | 1 + 6 files changed, 59 insertions(+), 41 deletions(-) diff --git a/__output__/builder/bundler_test/contracts/contractContextBase.ts b/__output__/builder/bundler_test/contracts/contractContextBase.ts index a2f5e7af..45b6b20a 100644 --- a/__output__/builder/bundler_test/contracts/contractContextBase.ts +++ b/__output__/builder/bundler_test/contracts/contractContextBase.ts @@ -53,49 +53,24 @@ export class ContractBase< TQuery = IEmptyClient, TMsgComposer = IEmptyClient > { - - address: string | undefined; - cosmWasmClient: CosmWasmClient | undefined; - signingCosmWasmClient: SigningCosmWasmClient | undefined; - TSign?: new ( - client: SigningCosmWasmClient, - sender: string, - contractAddress: string - ) => TSign; - TQuery?: new ( - client: CosmWasmClient, - contractAddress: string - ) => TQuery; - TMsgComposer?: new ( - sender: string, - contractAddress: string - ) => TMsgComposer; - constructor( - address: string | undefined, - cosmWasmClient: CosmWasmClient | undefined, - signingCosmWasmClient: SigningCosmWasmClient | undefined, - TSign?: new ( + protected address: string | undefined, + protected cosmWasmClient: CosmWasmClient | undefined, + protected signingCosmWasmClient: SigningCosmWasmClient | undefined, + private TSign?: new ( client: SigningCosmWasmClient, sender: string, contractAddress: string ) => TSign, - TQuery?: new ( + private TQuery?: new ( client: CosmWasmClient, contractAddress: string ) => TQuery, - TMsgComposer?: new ( + private TMsgComposer?: new ( sender: string, contractAddress: string ) => TMsgComposer - ) { - this.address = address; - this.cosmWasmClient = cosmWasmClient; - this.signingCosmWasmClient = signingCosmWasmClient; - this.TSign = TSign; - this.TQuery = TQuery; - this.TMsgComposer = TMsgComposer; - } + ) {} public getSigningClient(contractAddr: string): TSign { if (!this.signingCosmWasmClient) throw new Error(NO_SINGING_ERROR_MESSAGE); diff --git a/__output__/builder/default/contractContextBase.ts b/__output__/builder/default/contractContextBase.ts index 45b6b20a..a2f5e7af 100644 --- a/__output__/builder/default/contractContextBase.ts +++ b/__output__/builder/default/contractContextBase.ts @@ -53,24 +53,49 @@ export class ContractBase< TQuery = IEmptyClient, TMsgComposer = IEmptyClient > { + + address: string | undefined; + cosmWasmClient: CosmWasmClient | undefined; + signingCosmWasmClient: SigningCosmWasmClient | undefined; + TSign?: new ( + client: SigningCosmWasmClient, + sender: string, + contractAddress: string + ) => TSign; + TQuery?: new ( + client: CosmWasmClient, + contractAddress: string + ) => TQuery; + TMsgComposer?: new ( + sender: string, + contractAddress: string + ) => TMsgComposer; + constructor( - protected address: string | undefined, - protected cosmWasmClient: CosmWasmClient | undefined, - protected signingCosmWasmClient: SigningCosmWasmClient | undefined, - private TSign?: new ( + address: string | undefined, + cosmWasmClient: CosmWasmClient | undefined, + signingCosmWasmClient: SigningCosmWasmClient | undefined, + TSign?: new ( client: SigningCosmWasmClient, sender: string, contractAddress: string ) => TSign, - private TQuery?: new ( + TQuery?: new ( client: CosmWasmClient, contractAddress: string ) => TQuery, - private TMsgComposer?: new ( + TMsgComposer?: new ( sender: string, contractAddress: string ) => TMsgComposer - ) {} + ) { + this.address = address; + this.cosmWasmClient = cosmWasmClient; + this.signingCosmWasmClient = signingCosmWasmClient; + this.TSign = TSign; + this.TQuery = TQuery; + this.TMsgComposer = TMsgComposer; + } public getSigningClient(contractAddr: string): TSign { if (!this.signingCosmWasmClient) throw new Error(NO_SINGING_ERROR_MESSAGE); diff --git a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap index 21fc022a..4c71d5fe 100644 --- a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap +++ b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap @@ -39,6 +39,7 @@ TSBuilder { "aliasExecuteMsg": false, "enabled": true, }, + "useShorthandCtor": true, }, "plugins": Array [ TypesPlugin { @@ -76,6 +77,7 @@ TSBuilder { "aliasExecuteMsg": false, "enabled": true, }, + "useShorthandCtor": true, }, "utils": undefined, }, @@ -114,6 +116,7 @@ TSBuilder { "aliasExecuteMsg": false, "enabled": true, }, + "useShorthandCtor": true, }, "utils": undefined, }, @@ -152,6 +155,7 @@ TSBuilder { "aliasExecuteMsg": false, "enabled": true, }, + "useShorthandCtor": true, }, "utils": undefined, }, @@ -190,6 +194,7 @@ TSBuilder { "aliasExecuteMsg": false, "enabled": true, }, + "useShorthandCtor": true, }, "utils": undefined, }, @@ -228,6 +233,7 @@ TSBuilder { "aliasExecuteMsg": false, "enabled": true, }, + "useShorthandCtor": true, }, "utils": Object { "selectorFamily": "recoil", @@ -268,6 +274,7 @@ TSBuilder { "aliasExecuteMsg": false, "enabled": true, }, + "useShorthandCtor": true, }, "utils": undefined, }, @@ -306,6 +313,7 @@ TSBuilder { "aliasExecuteMsg": false, "enabled": true, }, + "useShorthandCtor": true, }, "utils": Object { "ContractBase": "__contractContextBase__", @@ -356,6 +364,7 @@ TSBuilder { "aliasExecuteMsg": false, "enabled": true, }, + "useShorthandCtor": true, }, "plugins": Array [ TypesPlugin { @@ -393,6 +402,7 @@ TSBuilder { "aliasExecuteMsg": false, "enabled": true, }, + "useShorthandCtor": true, }, "utils": undefined, }, @@ -431,6 +441,7 @@ TSBuilder { "aliasExecuteMsg": false, "enabled": true, }, + "useShorthandCtor": true, }, "utils": undefined, }, @@ -469,6 +480,7 @@ TSBuilder { "aliasExecuteMsg": false, "enabled": true, }, + "useShorthandCtor": true, }, "utils": undefined, }, @@ -507,6 +519,7 @@ TSBuilder { "aliasExecuteMsg": false, "enabled": true, }, + "useShorthandCtor": true, }, "utils": undefined, }, @@ -545,6 +558,7 @@ TSBuilder { "aliasExecuteMsg": false, "enabled": true, }, + "useShorthandCtor": true, }, "utils": Object { "selectorFamily": "recoil", @@ -585,6 +599,7 @@ TSBuilder { "aliasExecuteMsg": false, "enabled": true, }, + "useShorthandCtor": true, }, "utils": undefined, }, @@ -623,6 +638,7 @@ TSBuilder { "aliasExecuteMsg": false, "enabled": true, }, + "useShorthandCtor": true, }, "utils": Object { "ContractBase": "__contractContextBase__", diff --git a/packages/ts-codegen/__tests__/builder.test.ts b/packages/ts-codegen/__tests__/builder.test.ts index e50af978..e6ed64d9 100644 --- a/packages/ts-codegen/__tests__/builder.test.ts +++ b/packages/ts-codegen/__tests__/builder.test.ts @@ -94,7 +94,7 @@ it('builder default', async () => { bundleFile: 'index.ts', scope: 'smart.contracts' }, - useShorthandCtor: true, + useShorthandCtor: false, types: { enabled: true }, diff --git a/packages/ts-codegen/src/builder/builder.ts b/packages/ts-codegen/src/builder/builder.ts index a9af35b5..7f335472 100644 --- a/packages/ts-codegen/src/builder/builder.ts +++ b/packages/ts-codegen/src/builder/builder.ts @@ -30,7 +30,8 @@ const defaultOpts: TSBuilderOptions = { enabled: true, scope: 'contracts', bundleFile: 'bundle.ts' - } + }, + useShorthandCtor: true } export interface TSBuilderInput { diff --git a/packages/ts-codegen/types/src/builder/builder.d.ts b/packages/ts-codegen/types/src/builder/builder.d.ts index 73637368..b7b51fa7 100644 --- a/packages/ts-codegen/types/src/builder/builder.d.ts +++ b/packages/ts-codegen/types/src/builder/builder.d.ts @@ -19,6 +19,7 @@ export declare type TSBuilderOptions = { bundle?: BundleOptions; /** * Enable using shorthand constructor. + * Default: false */ useShorthandCtor?: boolean; useContractsHooks?: UseContractsOptions; From 7089f56092de6f85df5984314c56f2255d858faf Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Mon, 31 Jul 2023 13:02:02 +0800 Subject: [PATCH 154/287] Change readme for react query in .babelrc.js --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 89aa3f96..0ebb0d43 100644 --- a/README.md +++ b/README.md @@ -317,6 +317,16 @@ export default function YourComponent() { }; ``` +If you're using Babel, please make sure include '@babel/preset-react' in devDeps and presets in .babelrc.js: + +```js + presets: [ + '@babel/typescript', + '@babel/env', + '@babel/preset-react', + ] +``` + #### Use Contracts Hooks Usage Once enabled, you can get contracts very simply: From 04afcb8c57e5c4e60f5003941cf0aa3244894f50 Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Mon, 31 Jul 2023 13:04:26 +0800 Subject: [PATCH 155/287] Change default of short hand ctor in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ebb0d43..e675d91b 100644 --- a/README.md +++ b/README.md @@ -371,7 +371,7 @@ const { CwAdminFactoryClient } = contracts.CwAdminFactory; | option | description | | --------------------- | -------------------------------------------------------------------------------- | -| `useShorthandCtor` | Enable using shorthand constructor. Default: false | +| `useShorthandCtor` | Enable using shorthand constructor. Default: true | Using shorthand constructor(Might not be transpiled correctly with babel): From 96c6e017dc5f65f7a484022b6b4543b7494b99d8 Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Sat, 5 Aug 2023 19:15:05 +0800 Subject: [PATCH 156/287] fix comment of useShortHandCtor --- packages/ts-codegen/src/builder/builder.ts | 2 +- packages/ts-codegen/types/src/builder/builder.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ts-codegen/src/builder/builder.ts b/packages/ts-codegen/src/builder/builder.ts index 7f335472..440c0888 100644 --- a/packages/ts-codegen/src/builder/builder.ts +++ b/packages/ts-codegen/src/builder/builder.ts @@ -56,7 +56,7 @@ export type TSBuilderOptions = { bundle?: BundleOptions; /** * Enable using shorthand constructor. - * Default: false + * Default: true */ useShorthandCtor?: boolean; useContractsHooks?: UseContractsOptions; diff --git a/packages/ts-codegen/types/src/builder/builder.d.ts b/packages/ts-codegen/types/src/builder/builder.d.ts index b7b51fa7..20e1722c 100644 --- a/packages/ts-codegen/types/src/builder/builder.d.ts +++ b/packages/ts-codegen/types/src/builder/builder.d.ts @@ -19,7 +19,7 @@ export declare type TSBuilderOptions = { bundle?: BundleOptions; /** * Enable using shorthand constructor. - * Default: false + * Default: true */ useShorthandCtor?: boolean; useContractsHooks?: UseContractsOptions; From 5d2a54ef9b1e5c7430662fa35e161008a08f5f9a Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 9 Aug 2023 14:12:01 -0700 Subject: [PATCH 157/287] naming cleanup --- README.md | 8 +- .../contracts/CwAdminFactory.msg-builder.ts | 2 +- .../contracts/CwCodeIdRegistry.msg-builder.ts | 4 +- .../contracts/CwSingle.msg-builder.ts | 4 +- .../contracts/Factory.msg-builder.ts | 4 +- .../contracts/Minter.msg-builder.ts | 4 +- .../default/CwAdminFactory.msg-builder.ts | 2 +- .../default/CwCodeIdRegistry.msg-builder.ts | 4 +- .../builder/default/CwSingle.msg-builder.ts | 4 +- .../builder/default/Factory.msg-builder.ts | 4 +- .../builder/default/Minter.msg-builder.ts | 4 +- .../no-extends/CwAdminFactory.msg-builder.ts | 2 +- .../CwCodeIdRegistry.msg-builder.ts | 4 +- .../no-extends/CwSingle.msg-builder.ts | 4 +- .../builder/no-extends/Factory.msg-builder.ts | 4 +- .../builder/no-extends/Minter.msg-builder.ts | 4 +- packages/ts-codegen/README.md | 8 +- .../__snapshots__/builder.test.ts.snap | 68 +- packages/ts-codegen/__tests__/builder.test.ts | 6 +- packages/ts-codegen/src/builder/builder.ts | 6 +- packages/ts-codegen/src/commands/generate.ts | 24 +- .../ts-codegen/src/generators/msg-builder.ts | 14 +- .../{msg-builder.ts => message-builder.ts} | 12 +- .../types/src/generators/msg-builder.d.ts | 4 +- .../types/src/generators/msg-builder.ts | 4 +- .../types/src/plugins/msg-builder.d.ts | 2 +- .../wasm-ast-types/src/context/context.ts | 316 +- .../__snapshots__/msg-builder.spec.ts.snap | 4 +- .../src/msg-builder/msg-builder.spec.ts | 10 +- .../src/msg-builder/msg-builder.ts | 8 +- .../src/react-query/react-query.spec.ts | 2 +- .../wasm-ast-types/types/context/context.d.ts | 6 +- .../types/msg-builder/msg-builder.d.ts | 2 +- yarn.lock | 4106 ++++++++--------- 34 files changed, 2135 insertions(+), 2529 deletions(-) rename packages/ts-codegen/src/plugins/{msg-builder.ts => message-builder.ts} (80%) diff --git a/README.md b/README.md index 89aa3f96..417ed7c9 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ codegen({ messageComposer: { enabled: false }, - msgBuilder: { + messageBuilder: { enabled: false }, useContractsHooks: { @@ -278,9 +278,9 @@ cosmwasm-ts-codegen generate \ ``` #### Message Builder Options -| option | description | -|--------------------- | ------------------------------ | -| `msgBuilder.enabled` | enable the msgBuilder plugin | +| option | description | +|------------------------- | ------------------------------ | +| `messageBuilder.enabled` | enable the messageBuilder plugin | ### Use Contracts Hooks diff --git a/__output__/builder/bundler_test/contracts/CwAdminFactory.msg-builder.ts b/__output__/builder/bundler_test/contracts/CwAdminFactory.msg-builder.ts index 1e03ab7b..2a04624c 100644 --- a/__output__/builder/bundler_test/contracts/CwAdminFactory.msg-builder.ts +++ b/__output__/builder/bundler_test/contracts/CwAdminFactory.msg-builder.ts @@ -6,7 +6,7 @@ import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; import { CamelCasedProperties } from "type-fest"; -export abstract class CwAdminFactoryExecuteMsgBuilder { +export abstract class CwAdminFactoryExecuteMessageBuilder { static instantiateContractWithSelfAdmin = ({ codeId, instantiateMsg, diff --git a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.msg-builder.ts b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.msg-builder.ts index 3e15defb..5727cd91 100644 --- a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.msg-builder.ts +++ b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.msg-builder.ts @@ -6,7 +6,7 @@ import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; import { CamelCasedProperties } from "type-fest"; -export abstract class CwCodeIdRegistryExecuteMsgBuilder { +export abstract class CwCodeIdRegistryExecuteMessageBuilder { static receive = ({ amount, msg, @@ -83,7 +83,7 @@ export abstract class CwCodeIdRegistryExecuteMsgBuilder { }; }; } -export abstract class CwCodeIdRegistryQueryMsgBuilder { +export abstract class CwCodeIdRegistryQueryMessageBuilder { static config = (): QueryMsg => { return { config: ({} as const) diff --git a/__output__/builder/bundler_test/contracts/CwSingle.msg-builder.ts b/__output__/builder/bundler_test/contracts/CwSingle.msg-builder.ts index 1859f108..bdc753da 100644 --- a/__output__/builder/bundler_test/contracts/CwSingle.msg-builder.ts +++ b/__output__/builder/bundler_test/contracts/CwSingle.msg-builder.ts @@ -6,7 +6,7 @@ import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; import { CamelCasedProperties } from "type-fest"; -export abstract class CwSingleExecuteMsgBuilder { +export abstract class CwSingleExecuteMessageBuilder { static propose = ({ description, msgs, @@ -125,7 +125,7 @@ export abstract class CwSingleExecuteMsgBuilder { }; }; } -export abstract class CwSingleQueryMsgBuilder { +export abstract class CwSingleQueryMessageBuilder { static config = (): QueryMsg => { return { config: ({} as const) diff --git a/__output__/builder/bundler_test/contracts/Factory.msg-builder.ts b/__output__/builder/bundler_test/contracts/Factory.msg-builder.ts index 0c662c0a..2bbace3f 100644 --- a/__output__/builder/bundler_test/contracts/Factory.msg-builder.ts +++ b/__output__/builder/bundler_test/contracts/Factory.msg-builder.ts @@ -6,7 +6,7 @@ import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { CamelCasedProperties } from "type-fest"; -export abstract class FactoryExecuteMsgBuilder { +export abstract class FactoryExecuteMessageBuilder { static createWallet = ({ createWalletMsg }: CamelCasedProperties { return { mint: ({} as const) @@ -69,7 +69,7 @@ export abstract class MinterExecuteMsgBuilder { }; }; } -export abstract class MinterQueryMsgBuilder { +export abstract class MinterQueryMessageBuilder { static config = (): QueryMsg => { return { config: ({} as const) diff --git a/__output__/builder/default/CwAdminFactory.msg-builder.ts b/__output__/builder/default/CwAdminFactory.msg-builder.ts index 1e03ab7b..2a04624c 100644 --- a/__output__/builder/default/CwAdminFactory.msg-builder.ts +++ b/__output__/builder/default/CwAdminFactory.msg-builder.ts @@ -6,7 +6,7 @@ import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; import { CamelCasedProperties } from "type-fest"; -export abstract class CwAdminFactoryExecuteMsgBuilder { +export abstract class CwAdminFactoryExecuteMessageBuilder { static instantiateContractWithSelfAdmin = ({ codeId, instantiateMsg, diff --git a/__output__/builder/default/CwCodeIdRegistry.msg-builder.ts b/__output__/builder/default/CwCodeIdRegistry.msg-builder.ts index 3e15defb..5727cd91 100644 --- a/__output__/builder/default/CwCodeIdRegistry.msg-builder.ts +++ b/__output__/builder/default/CwCodeIdRegistry.msg-builder.ts @@ -6,7 +6,7 @@ import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; import { CamelCasedProperties } from "type-fest"; -export abstract class CwCodeIdRegistryExecuteMsgBuilder { +export abstract class CwCodeIdRegistryExecuteMessageBuilder { static receive = ({ amount, msg, @@ -83,7 +83,7 @@ export abstract class CwCodeIdRegistryExecuteMsgBuilder { }; }; } -export abstract class CwCodeIdRegistryQueryMsgBuilder { +export abstract class CwCodeIdRegistryQueryMessageBuilder { static config = (): QueryMsg => { return { config: ({} as const) diff --git a/__output__/builder/default/CwSingle.msg-builder.ts b/__output__/builder/default/CwSingle.msg-builder.ts index 1859f108..bdc753da 100644 --- a/__output__/builder/default/CwSingle.msg-builder.ts +++ b/__output__/builder/default/CwSingle.msg-builder.ts @@ -6,7 +6,7 @@ import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; import { CamelCasedProperties } from "type-fest"; -export abstract class CwSingleExecuteMsgBuilder { +export abstract class CwSingleExecuteMessageBuilder { static propose = ({ description, msgs, @@ -125,7 +125,7 @@ export abstract class CwSingleExecuteMsgBuilder { }; }; } -export abstract class CwSingleQueryMsgBuilder { +export abstract class CwSingleQueryMessageBuilder { static config = (): QueryMsg => { return { config: ({} as const) diff --git a/__output__/builder/default/Factory.msg-builder.ts b/__output__/builder/default/Factory.msg-builder.ts index 0c662c0a..2bbace3f 100644 --- a/__output__/builder/default/Factory.msg-builder.ts +++ b/__output__/builder/default/Factory.msg-builder.ts @@ -6,7 +6,7 @@ import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { CamelCasedProperties } from "type-fest"; -export abstract class FactoryExecuteMsgBuilder { +export abstract class FactoryExecuteMessageBuilder { static createWallet = ({ createWalletMsg }: CamelCasedProperties { return { mint: ({} as const) @@ -69,7 +69,7 @@ export abstract class MinterExecuteMsgBuilder { }; }; } -export abstract class MinterQueryMsgBuilder { +export abstract class MinterQueryMessageBuilder { static config = (): QueryMsg => { return { config: ({} as const) diff --git a/__output__/builder/no-extends/CwAdminFactory.msg-builder.ts b/__output__/builder/no-extends/CwAdminFactory.msg-builder.ts index 1e03ab7b..2a04624c 100644 --- a/__output__/builder/no-extends/CwAdminFactory.msg-builder.ts +++ b/__output__/builder/no-extends/CwAdminFactory.msg-builder.ts @@ -6,7 +6,7 @@ import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; import { CamelCasedProperties } from "type-fest"; -export abstract class CwAdminFactoryExecuteMsgBuilder { +export abstract class CwAdminFactoryExecuteMessageBuilder { static instantiateContractWithSelfAdmin = ({ codeId, instantiateMsg, diff --git a/__output__/builder/no-extends/CwCodeIdRegistry.msg-builder.ts b/__output__/builder/no-extends/CwCodeIdRegistry.msg-builder.ts index 3e15defb..5727cd91 100644 --- a/__output__/builder/no-extends/CwCodeIdRegistry.msg-builder.ts +++ b/__output__/builder/no-extends/CwCodeIdRegistry.msg-builder.ts @@ -6,7 +6,7 @@ import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; import { CamelCasedProperties } from "type-fest"; -export abstract class CwCodeIdRegistryExecuteMsgBuilder { +export abstract class CwCodeIdRegistryExecuteMessageBuilder { static receive = ({ amount, msg, @@ -83,7 +83,7 @@ export abstract class CwCodeIdRegistryExecuteMsgBuilder { }; }; } -export abstract class CwCodeIdRegistryQueryMsgBuilder { +export abstract class CwCodeIdRegistryQueryMessageBuilder { static config = (): QueryMsg => { return { config: ({} as const) diff --git a/__output__/builder/no-extends/CwSingle.msg-builder.ts b/__output__/builder/no-extends/CwSingle.msg-builder.ts index 1859f108..bdc753da 100644 --- a/__output__/builder/no-extends/CwSingle.msg-builder.ts +++ b/__output__/builder/no-extends/CwSingle.msg-builder.ts @@ -6,7 +6,7 @@ import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; import { CamelCasedProperties } from "type-fest"; -export abstract class CwSingleExecuteMsgBuilder { +export abstract class CwSingleExecuteMessageBuilder { static propose = ({ description, msgs, @@ -125,7 +125,7 @@ export abstract class CwSingleExecuteMsgBuilder { }; }; } -export abstract class CwSingleQueryMsgBuilder { +export abstract class CwSingleQueryMessageBuilder { static config = (): QueryMsg => { return { config: ({} as const) diff --git a/__output__/builder/no-extends/Factory.msg-builder.ts b/__output__/builder/no-extends/Factory.msg-builder.ts index 0c662c0a..2bbace3f 100644 --- a/__output__/builder/no-extends/Factory.msg-builder.ts +++ b/__output__/builder/no-extends/Factory.msg-builder.ts @@ -6,7 +6,7 @@ import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { CamelCasedProperties } from "type-fest"; -export abstract class FactoryExecuteMsgBuilder { +export abstract class FactoryExecuteMessageBuilder { static createWallet = ({ createWalletMsg }: CamelCasedProperties { return { mint: ({} as const) @@ -69,7 +69,7 @@ export abstract class MinterExecuteMsgBuilder { }; }; } -export abstract class MinterQueryMsgBuilder { +export abstract class MinterQueryMessageBuilder { static config = (): QueryMsg => { return { config: ({} as const) diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index bd95d4ef..4c47430e 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -122,7 +122,7 @@ codegen({ messageComposer: { enabled: false }, - msgBuilder: { + messageBuilder: { enabled: false }, useContractsHooks: { @@ -278,9 +278,9 @@ cosmwasm-ts-codegen generate \ ``` #### Message Builder Options -| option | description | -|--------------------- | ------------------------------ | -| `msgBuilder.enabled` | enable the msgBuilder plugin | +| option | description | +|------------------------- | ------------------------------ | +| `messageBuilder.enabled` | enable the messageBuilder plugin | ### Use Contracts Hooks diff --git a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap index 21fc022a..a5407e9e 100644 --- a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap +++ b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap @@ -18,10 +18,10 @@ TSBuilder { "noImplicitOverride": false, }, "enabled": true, - "messageComposer": Object { + "messageBuilder": Object { "enabled": false, }, - "msgBuilder": Object { + "messageComposer": Object { "enabled": false, }, "reactQuery": Object { @@ -55,10 +55,10 @@ TSBuilder { "noImplicitOverride": false, }, "enabled": true, - "messageComposer": Object { + "messageBuilder": Object { "enabled": false, }, - "msgBuilder": Object { + "messageComposer": Object { "enabled": false, }, "reactQuery": Object { @@ -93,10 +93,10 @@ TSBuilder { "noImplicitOverride": false, }, "enabled": true, - "messageComposer": Object { + "messageBuilder": Object { "enabled": false, }, - "msgBuilder": Object { + "messageComposer": Object { "enabled": false, }, "reactQuery": Object { @@ -131,10 +131,10 @@ TSBuilder { "noImplicitOverride": false, }, "enabled": true, - "messageComposer": Object { + "messageBuilder": Object { "enabled": false, }, - "msgBuilder": Object { + "messageComposer": Object { "enabled": false, }, "reactQuery": Object { @@ -169,10 +169,10 @@ TSBuilder { "noImplicitOverride": false, }, "enabled": true, - "messageComposer": Object { + "messageBuilder": Object { "enabled": false, }, - "msgBuilder": Object { + "messageComposer": Object { "enabled": false, }, "reactQuery": Object { @@ -207,10 +207,10 @@ TSBuilder { "noImplicitOverride": false, }, "enabled": true, - "messageComposer": Object { + "messageBuilder": Object { "enabled": false, }, - "msgBuilder": Object { + "messageComposer": Object { "enabled": false, }, "reactQuery": Object { @@ -233,7 +233,7 @@ TSBuilder { "selectorFamily": "recoil", }, }, - MsgBuilderPlugin { + MessageBuilderPlugin { "builder": [Circular], "option": Object { "bundle": Object { @@ -247,10 +247,10 @@ TSBuilder { "noImplicitOverride": false, }, "enabled": true, - "messageComposer": Object { + "messageBuilder": Object { "enabled": false, }, - "msgBuilder": Object { + "messageComposer": Object { "enabled": false, }, "reactQuery": Object { @@ -285,10 +285,10 @@ TSBuilder { "noImplicitOverride": false, }, "enabled": true, - "messageComposer": Object { + "messageBuilder": Object { "enabled": false, }, - "msgBuilder": Object { + "messageComposer": Object { "enabled": false, }, "reactQuery": Object { @@ -335,10 +335,10 @@ TSBuilder { "noImplicitOverride": false, }, "enabled": true, - "messageComposer": Object { + "messageBuilder": Object { "enabled": false, }, - "msgBuilder": Object { + "messageComposer": Object { "enabled": false, }, "reactQuery": Object { @@ -372,10 +372,10 @@ TSBuilder { "noImplicitOverride": false, }, "enabled": true, - "messageComposer": Object { + "messageBuilder": Object { "enabled": false, }, - "msgBuilder": Object { + "messageComposer": Object { "enabled": false, }, "reactQuery": Object { @@ -410,10 +410,10 @@ TSBuilder { "noImplicitOverride": false, }, "enabled": true, - "messageComposer": Object { + "messageBuilder": Object { "enabled": false, }, - "msgBuilder": Object { + "messageComposer": Object { "enabled": false, }, "reactQuery": Object { @@ -448,10 +448,10 @@ TSBuilder { "noImplicitOverride": false, }, "enabled": true, - "messageComposer": Object { + "messageBuilder": Object { "enabled": false, }, - "msgBuilder": Object { + "messageComposer": Object { "enabled": false, }, "reactQuery": Object { @@ -486,10 +486,10 @@ TSBuilder { "noImplicitOverride": false, }, "enabled": true, - "messageComposer": Object { + "messageBuilder": Object { "enabled": false, }, - "msgBuilder": Object { + "messageComposer": Object { "enabled": false, }, "reactQuery": Object { @@ -524,10 +524,10 @@ TSBuilder { "noImplicitOverride": false, }, "enabled": true, - "messageComposer": Object { + "messageBuilder": Object { "enabled": false, }, - "msgBuilder": Object { + "messageComposer": Object { "enabled": false, }, "reactQuery": Object { @@ -550,7 +550,7 @@ TSBuilder { "selectorFamily": "recoil", }, }, - MsgBuilderPlugin { + MessageBuilderPlugin { "builder": [Circular], "option": Object { "bundle": Object { @@ -564,10 +564,10 @@ TSBuilder { "noImplicitOverride": false, }, "enabled": true, - "messageComposer": Object { + "messageBuilder": Object { "enabled": false, }, - "msgBuilder": Object { + "messageComposer": Object { "enabled": false, }, "reactQuery": Object { @@ -602,10 +602,10 @@ TSBuilder { "noImplicitOverride": false, }, "enabled": true, - "messageComposer": Object { + "messageBuilder": Object { "enabled": false, }, - "msgBuilder": Object { + "messageComposer": Object { "enabled": false, }, "reactQuery": Object { diff --git a/packages/ts-codegen/__tests__/builder.test.ts b/packages/ts-codegen/__tests__/builder.test.ts index e50af978..7f9cd973 100644 --- a/packages/ts-codegen/__tests__/builder.test.ts +++ b/packages/ts-codegen/__tests__/builder.test.ts @@ -111,11 +111,11 @@ it('builder default', async () => { messageComposer: { enabled: true }, - msgBuilder: { + messageBuilder: { enabled: true }, useContractsHooks: { - enabled: true, + enabled: true, } } }); @@ -157,7 +157,7 @@ it('builder no extends', async () => { messageComposer: { enabled: true }, - msgBuilder: { + messageBuilder: { enabled: true } } diff --git a/packages/ts-codegen/src/builder/builder.ts b/packages/ts-codegen/src/builder/builder.ts index a9af35b5..691ca6ff 100644 --- a/packages/ts-codegen/src/builder/builder.ts +++ b/packages/ts-codegen/src/builder/builder.ts @@ -17,7 +17,7 @@ import generate from '@babel/generator'; import * as t from '@babel/types'; import { ReactQueryPlugin } from "../plugins/react-query"; import { RecoilPlugin } from "../plugins/recoil"; -import { MsgBuilderPlugin } from "../plugins/msg-builder"; +import { MessageBuilderPlugin } from "../plugins/message-builder"; import { MessageComposerPlugin } from "../plugins/message-composer"; import { ClientPlugin } from "../plugins/client"; import { TypesPlugin } from "../plugins/types"; @@ -109,7 +109,7 @@ export class TSBuilder { new MessageComposerPlugin(this.options), new ReactQueryPlugin(this.options), new RecoilPlugin(this.options), - new MsgBuilderPlugin(this.options), + new MessageBuilderPlugin(this.options), new ContractsContextProviderPlugin(this.options), ]); } @@ -189,7 +189,7 @@ export class TSBuilder { }, this.builderContext); if (helpers && helpers.length) { - [].push.apply(this.files, helpers); + [].push.apply(this.files, helpers); } if (this.options.bundle.enabled) { diff --git a/packages/ts-codegen/src/commands/generate.ts b/packages/ts-codegen/src/commands/generate.ts index 2adee769..b7d6c1c8 100644 --- a/packages/ts-codegen/src/commands/generate.ts +++ b/packages/ts-codegen/src/commands/generate.ts @@ -91,17 +91,17 @@ export default async (argv) => { }; const { mutations } = await prompt(questions3, argv); - const queryFactoryQuestions = []; + const queryFactoryQuestions = []; if (queryKeys) { - [].push.apply(queryFactoryQuestions, [ - // Only can use queryFactory if queryKeys is enabled - { - type: 'confirm', - name: 'queryFactory', - message: 'queryFactory? ', - default: false - } - ]) + [].push.apply(queryFactoryQuestions, [ + // Only can use queryFactory if queryKeys is enabled + { + type: 'confirm', + name: 'queryFactory', + message: 'queryFactory? ', + default: false + } + ]) }; const { queryFactory } = await prompt(queryFactoryQuestions, argv); ///////// END REACT QUERY @@ -151,8 +151,8 @@ export default async (argv) => { messageComposer: { enabled: plugin.includes('message-composer') }, - msgBuilder: { - enabled: plugin.includes('msg-builder') + messageBuilder: { + enabled: plugin.includes('msg-builder') }, bundle: { enabled: bundle, diff --git a/packages/ts-codegen/src/generators/msg-builder.ts b/packages/ts-codegen/src/generators/msg-builder.ts index 5f6643b7..195cce23 100644 --- a/packages/ts-codegen/src/generators/msg-builder.ts +++ b/packages/ts-codegen/src/generators/msg-builder.ts @@ -8,7 +8,7 @@ import { writeFileSync } from "fs"; import generate from "@babel/generator"; import { ContractInfo, getMessageProperties } from "wasm-ast-types"; import { findAndParseTypes, findExecuteMsg, findQueryMsg } from '../utils'; -import { RenderContext, MsgBuilderOptions } from 'wasm-ast-types'; +import { RenderContext, MessageBuilderOptions } from 'wasm-ast-types'; import { BuilderFile } from "../builder"; import babelTraverse from '@babel/traverse'; import { parse as babelParse } from '@babel/parser' @@ -17,11 +17,11 @@ export default async ( name: string, contractInfo: ContractInfo, outPath: string, - msgBuilderOptions?: MsgBuilderOptions + messageBuilderOptions?: MessageBuilderOptions ): Promise => { const { schemas } = contractInfo; const context = new RenderContext(contractInfo, { - msgBuilder: msgBuilderOptions ?? {}, + messageBuilder: messageBuilderOptions ?? {}, }); const localname = pascal(name) + ".msg-builder.ts"; @@ -38,10 +38,10 @@ export default async ( if (ExecuteMsg) { const children = getMessageProperties(ExecuteMsg); if (children.length > 0) { - const className = pascal(`${name}ExecuteMsgBuilder`); + const className = pascal(`${name}ExecuteMessageBuilder`); body.push( - w.createMsgBuilderClass(context, className, ExecuteMsg) + w.createMessageBuilderClass(context, className, ExecuteMsg) ); } } @@ -51,10 +51,10 @@ export default async ( if (QueryMsg) { const children = getMessageProperties(QueryMsg); if (children.length > 0) { - const className = pascal(`${name}QueryMsgBuilder`); + const className = pascal(`${name}QueryMessageBuilder`); body.push( - w.createMsgBuilderClass(context, className, QueryMsg) + w.createMessageBuilderClass(context, className, QueryMsg) ); } } diff --git a/packages/ts-codegen/src/plugins/msg-builder.ts b/packages/ts-codegen/src/plugins/message-builder.ts similarity index 80% rename from packages/ts-codegen/src/plugins/msg-builder.ts rename to packages/ts-codegen/src/plugins/message-builder.ts index 4222fe65..7e74d854 100644 --- a/packages/ts-codegen/src/plugins/msg-builder.ts +++ b/packages/ts-codegen/src/plugins/message-builder.ts @@ -11,7 +11,7 @@ import { import { BuilderFileType } from '../builder'; import { BuilderPluginBase } from './plugin-base'; -export class MsgBuilderPlugin extends BuilderPluginBase { +export class MessageBuilderPlugin extends BuilderPluginBase { initContext( contract: ContractInfo, options?: RenderOptions @@ -30,7 +30,7 @@ export class MsgBuilderPlugin extends BuilderPluginBase { body: any[]; }[] > { - const { enabled } = this.option.msgBuilder; + const { enabled } = this.option.messageBuilder; if (!enabled) { return; @@ -52,9 +52,9 @@ export class MsgBuilderPlugin extends BuilderPluginBase { if (ExecuteMsg) { const children = getMessageProperties(ExecuteMsg); if (children.length > 0) { - const className = pascal(`${name}ExecuteMsgBuilder`); + const className = pascal(`${name}ExecuteMessageBuilder`); - body.push(w.createMsgBuilderClass(context, className, ExecuteMsg)); + body.push(w.createMessageBuilderClass(context, className, ExecuteMsg)); } } @@ -63,9 +63,9 @@ export class MsgBuilderPlugin extends BuilderPluginBase { if (QueryMsg) { const children = getMessageProperties(QueryMsg); if (children.length > 0) { - const className = pascal(`${name}QueryMsgBuilder`); + const className = pascal(`${name}QueryMessageBuilder`); - body.push(w.createMsgBuilderClass(context, className, QueryMsg)); + body.push(w.createMessageBuilderClass(context, className, QueryMsg)); } } diff --git a/packages/ts-codegen/types/src/generators/msg-builder.d.ts b/packages/ts-codegen/types/src/generators/msg-builder.d.ts index 26b45bbe..80f07209 100644 --- a/packages/ts-codegen/types/src/generators/msg-builder.d.ts +++ b/packages/ts-codegen/types/src/generators/msg-builder.d.ts @@ -1,5 +1,5 @@ import { ContractInfo } from "wasm-ast-types"; -import { MsgBuilderOptions } from 'wasm-ast-types'; +import { MessageBuilderOptions } from 'wasm-ast-types'; import { BuilderFile } from "../builder"; -declare const _default: (name: string, contractInfo: ContractInfo, outPath: string, msgBuilderOptions?: MsgBuilderOptions) => Promise; +declare const _default: (name: string, contractInfo: ContractInfo, outPath: string, messageBuilderOptions?: MessageBuilderOptions) => Promise; export default _default; diff --git a/packages/ts-codegen/types/src/generators/msg-builder.ts b/packages/ts-codegen/types/src/generators/msg-builder.ts index 4db98a6b..ac8b6b7b 100644 --- a/packages/ts-codegen/types/src/generators/msg-builder.ts +++ b/packages/ts-codegen/types/src/generators/msg-builder.ts @@ -1,5 +1,5 @@ import { ContractInfo } from "wasm-ast-types"; -import { MsgBuilderOptions } from "wasm-ast-types"; +import { MessageBuilderOptions } from "wasm-ast-types"; import { BuilderFile } from "../builder"; -declare const _default: (name: string, contractInfo: ContractInfo, outPath: string, msgBuilderOptions?: MsgBuilderOptions) => Promise; +declare const _default: (name: string, contractInfo: ContractInfo, outPath: string, messageBuilderOptions?: MessageBuilderOptions) => Promise; export default _default; diff --git a/packages/ts-codegen/types/src/plugins/msg-builder.d.ts b/packages/ts-codegen/types/src/plugins/msg-builder.d.ts index bd5e0467..8c0aeb4a 100644 --- a/packages/ts-codegen/types/src/plugins/msg-builder.d.ts +++ b/packages/ts-codegen/types/src/plugins/msg-builder.d.ts @@ -1,7 +1,7 @@ import { RenderContext, RenderContextBase, ContractInfo, RenderOptions } from 'wasm-ast-types'; import { BuilderFileType } from '../builder'; import { BuilderPluginBase } from './plugin-base'; -export declare class MsgBuilderPlugin extends BuilderPluginBase { +export declare class MessageBuilderPlugin extends BuilderPluginBase { initContext(contract: ContractInfo, options?: RenderOptions): RenderContextBase; doRender(name: string, context: RenderContext): Promise<{ type: BuilderFileType; diff --git a/packages/wasm-ast-types/src/context/context.ts b/packages/wasm-ast-types/src/context/context.ts index 6c907028..3db892d2 100644 --- a/packages/wasm-ast-types/src/context/context.ts +++ b/packages/wasm-ast-types/src/context/context.ts @@ -6,69 +6,69 @@ import { basename, extname } from 'path' /// Plugin Types export interface ReactQueryOptions { - enabled?: boolean; - optionalClient?: boolean; - version?: 'v3' | 'v4'; - mutations?: boolean; - camelize?: boolean; - queryKeys?: boolean - queryFactory?: boolean + enabled?: boolean; + optionalClient?: boolean; + version?: 'v3' | 'v4'; + mutations?: boolean; + camelize?: boolean; + queryKeys?: boolean + queryFactory?: boolean } export interface TSClientOptions { - enabled?: boolean; - execExtendsQuery?: boolean; - noImplicitOverride?: boolean; + enabled?: boolean; + execExtendsQuery?: boolean; + noImplicitOverride?: boolean; } export interface MessageComposerOptions { - enabled?: boolean; + enabled?: boolean; } -export interface MsgBuilderOptions { - enabled?: boolean; +export interface MessageBuilderOptions { + enabled?: boolean; } export interface RecoilOptions { - enabled?: boolean; + enabled?: boolean; } export interface TSTypesOptions { - enabled?: boolean; - // deprecated - aliasExecuteMsg?: boolean; - aliasEntryPoints?: boolean; + enabled?: boolean; + // deprecated + aliasExecuteMsg?: boolean; + aliasEntryPoints?: boolean; } /// END Plugin Types interface KeyedSchema { - [key: string]: JSONSchema; + [key: string]: JSONSchema; } export interface IDLObject { - contract_name: string; - contract_version: string; - idl_version: string; - instantiate: JSONSchema; - execute: JSONSchema; - query: JSONSchema; - migrate: JSONSchema; - sudo: JSONSchema; - responses: KeyedSchema; + contract_name: string; + contract_version: string; + idl_version: string; + instantiate: JSONSchema; + execute: JSONSchema; + query: JSONSchema; + migrate: JSONSchema; + sudo: JSONSchema; + responses: KeyedSchema; } export interface ContractInfo { - schemas: JSONSchema[]; - responses?: Record; - idlObject?: IDLObject; + schemas: JSONSchema[]; + responses?: Record; + idlObject?: IDLObject; }; export interface RenderOptions { - enabled?: boolean; - types?: TSTypesOptions; - recoil?: RecoilOptions; - messageComposer?: MessageComposerOptions; - msgBuilder?: MsgBuilderOptions; - client?: TSClientOptions; - reactQuery?: ReactQueryOptions; + enabled?: boolean; + types?: TSTypesOptions; + recoil?: RecoilOptions; + messageComposer?: MessageComposerOptions; + messageBuilder?: MessageBuilderOptions; + client?: TSClientOptions; + reactQuery?: ReactQueryOptions; } -export interface ProviderInfo{ +export interface ProviderInfo { classname: string, filename: string, basename: string, @@ -81,90 +81,90 @@ export interface IContext { } export interface IRenderContext extends IContext { - contract: ContractInfo; - options: TOpt; - - addProviderInfo(contractName:string, type: string, classname: string, filename: string): void; - getProviderInfos(): { - [key: string]: { - [key: string]: ProviderInfo; - }; + contract: ContractInfo; + options: TOpt; + + addProviderInfo(contractName: string, type: string, classname: string, filename: string): void; + getProviderInfos(): { + [key: string]: { + [key: string]: ProviderInfo; }; + }; } export const defaultOptions: RenderOptions = { + enabled: true, + types: { enabled: true, - types: { - enabled: true, - aliasExecuteMsg: false - }, - client: { - enabled: true, - execExtendsQuery: true, - noImplicitOverride: false, - }, - recoil: { - enabled: false - }, - messageComposer: { - enabled: false - }, - msgBuilder: { - enabled: false, - }, - reactQuery: { - enabled: false, - optionalClient: false, - version: 'v3', - mutations: false, - camelize: true, - queryKeys: false - } + aliasExecuteMsg: false + }, + client: { + enabled: true, + execExtendsQuery: true, + noImplicitOverride: false, + }, + recoil: { + enabled: false + }, + messageComposer: { + enabled: false + }, + messageBuilder: { + enabled: false, + }, + reactQuery: { + enabled: false, + optionalClient: false, + version: 'v3', + mutations: false, + camelize: true, + queryKeys: false + } }; export const getDefinitionSchema = (schemas: JSONSchema[]): JSONSchema => { - const aggregateSchema = { - definitions: { - // - } - }; + const aggregateSchema = { + definitions: { + // + } + }; - schemas.forEach(schema => { - schema.definitions = schema.definitions || {}; - aggregateSchema.definitions = { - ...aggregateSchema.definitions, - ...schema.definitions - }; - }); + schemas.forEach(schema => { + schema.definitions = schema.definitions || {}; + aggregateSchema.definitions = { + ...aggregateSchema.definitions, + ...schema.definitions + }; + }); - return aggregateSchema; + return aggregateSchema; }; -export class BuilderContext{ - providers:{ - [key: string]: { - [key: string]: ProviderInfo; - }; - } = {}; - - addProviderInfo(contractName:string, type: string, classname: string, filename: string): void { - if(!this.providers[contractName]){ - this.providers[contractName] = {} - } - - this.providers[contractName][type] = { - classname, - filename, - basename: basename(filename, extname(filename)) - }; - } - getProviderInfos(): { - [key: string]: { - [key: string]: ProviderInfo; - }; - }{ - return this.providers; +export class BuilderContext { + providers: { + [key: string]: { + [key: string]: ProviderInfo; + }; + } = {}; + + addProviderInfo(contractName: string, type: string, classname: string, filename: string): void { + if (!this.providers[contractName]) { + this.providers[contractName] = {} } + + this.providers[contractName][type] = { + classname, + filename, + basename: basename(filename, extname(filename)) + }; + } + getProviderInfos(): { + [key: string]: { + [key: string]: ProviderInfo; + }; + } { + return this.providers; + } } /** @@ -173,56 +173,56 @@ export class BuilderContext{ * @param TOpt option type */ export abstract class RenderContextBase implements IRenderContext { - builderContext: BuilderContext; - contract: ContractInfo; - utils: string[] = []; - schema: JSONSchema; - options: TOpt; - - constructor( - contract: ContractInfo, - options?: TOpt, - builderContext?: BuilderContext - ) { - this.contract = contract; - this.schema = getDefinitionSchema(contract.schemas); - this.options = this.mergeDefaultOpt(options); - this.builderContext = builderContext; - } - /** - * merge options and default options - * @param options - */ - abstract mergeDefaultOpt(options: TOpt): TOpt; - refLookup($ref: string) { - return refLookup($ref, this.schema) - } - addUtil(util: string) { - this.utils[util] = true; - } - addProviderInfo(contractName:string, type: string, classname: string, filename: string): void { - this.builderContext.addProviderInfo(contractName, type, classname, filename); - } - getProviderInfos(): { - [key: string]: { - [key: string]: ProviderInfo; - }; - } { - return this.builderContext.providers; - } - getImports(registeredUtils?: UtilMapping, filepath?: string) { - return getImportStatements( - convertUtilsToImportList( - this, - Object.keys(this.utils), - registeredUtils, - ), - filepath - ); - } + builderContext: BuilderContext; + contract: ContractInfo; + utils: string[] = []; + schema: JSONSchema; + options: TOpt; + + constructor( + contract: ContractInfo, + options?: TOpt, + builderContext?: BuilderContext + ) { + this.contract = contract; + this.schema = getDefinitionSchema(contract.schemas); + this.options = this.mergeDefaultOpt(options); + this.builderContext = builderContext; + } + /** + * merge options and default options + * @param options + */ + abstract mergeDefaultOpt(options: TOpt): TOpt; + refLookup($ref: string) { + return refLookup($ref, this.schema) + } + addUtil(util: string) { + this.utils[util] = true; + } + addProviderInfo(contractName: string, type: string, classname: string, filename: string): void { + this.builderContext.addProviderInfo(contractName, type, classname, filename); + } + getProviderInfos(): { + [key: string]: { + [key: string]: ProviderInfo; + }; + } { + return this.builderContext.providers; + } + getImports(registeredUtils?: UtilMapping, filepath?: string) { + return getImportStatements( + convertUtilsToImportList( + this, + Object.keys(this.utils), + registeredUtils, + ), + filepath + ); + } } -export class RenderContext extends RenderContextBase{ +export class RenderContext extends RenderContextBase { mergeDefaultOpt(options: RenderOptions): RenderOptions { return deepmerge(defaultOptions, options ?? {}); } diff --git a/packages/wasm-ast-types/src/msg-builder/__snapshots__/msg-builder.spec.ts.snap b/packages/wasm-ast-types/src/msg-builder/__snapshots__/msg-builder.spec.ts.snap index 4f1c022e..7cd08cb3 100644 --- a/packages/wasm-ast-types/src/msg-builder/__snapshots__/msg-builder.spec.ts.snap +++ b/packages/wasm-ast-types/src/msg-builder/__snapshots__/msg-builder.spec.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`execute class 1`] = ` -"export abstract class SG721MsgBuilder { +"export abstract class SG721MessageBuilder { static transferNft = ({ recipient, tokenId @@ -135,7 +135,7 @@ exports[`ownership 1`] = ` `; exports[`query class 1`] = ` -"export abstract class SG721MsgBuilder { +"export abstract class SG721MessageBuilder { static ownerOf = ({ includeExpired, tokenId diff --git a/packages/wasm-ast-types/src/msg-builder/msg-builder.spec.ts b/packages/wasm-ast-types/src/msg-builder/msg-builder.spec.ts index 54dcee2d..c328646e 100644 --- a/packages/wasm-ast-types/src/msg-builder/msg-builder.spec.ts +++ b/packages/wasm-ast-types/src/msg-builder/msg-builder.spec.ts @@ -3,23 +3,23 @@ import query_msg from '../../../../__fixtures__/basic/query_msg.json'; import ownership from '../../../../__fixtures__/basic/ownership.json'; import { - createMsgBuilderClass, + createMessageBuilderClass, } from './msg-builder' import { expectCode, makeContext } from '../../test-utils'; import { findExecuteMsg } from '@cosmwasm/ts-codegen/src'; it('execute class', () => { - const ctx = makeContext(execute_msg); - expectCode(createMsgBuilderClass(ctx, 'SG721MsgBuilder', execute_msg)) + const ctx = makeContext(execute_msg); + expectCode(createMessageBuilderClass(ctx, 'SG721MessageBuilder', execute_msg)) }); it('query class', () => { const ctx = makeContext(query_msg); - expectCode(createMsgBuilderClass(ctx, 'SG721MsgBuilder', query_msg)) + expectCode(createMessageBuilderClass(ctx, 'SG721MessageBuilder', query_msg)) }); it('ownership', () => { const ctx = makeContext(ownership); - expectCode(createMsgBuilderClass(ctx, 'Ownership', ownership)) + expectCode(createMessageBuilderClass(ctx, 'Ownership', ownership)) }); diff --git a/packages/wasm-ast-types/src/msg-builder/msg-builder.ts b/packages/wasm-ast-types/src/msg-builder/msg-builder.ts index df7fa8a4..5abc1acf 100644 --- a/packages/wasm-ast-types/src/msg-builder/msg-builder.ts +++ b/packages/wasm-ast-types/src/msg-builder/msg-builder.ts @@ -7,13 +7,13 @@ import { RenderContext } from '../context'; import { getWasmMethodArgs } from '../client/client'; import { Expression, Identifier, PatternLike, TSAsExpression } from '@babel/types'; -export const createMsgBuilderClass = ( +export const createMessageBuilderClass = ( context: RenderContext, className: string, msg: ExecuteMsg | QueryMsg ): t.ExportNamedDeclaration => { const staticMethods = getMessageProperties(msg).map((schema) => { - return createStaticExecMethodMsgBuilder(context, schema, msg.title); + return createStaticExecMethodMessageBuilder(context, schema, msg.title); }); // const blockStmt = bindings; @@ -50,7 +50,7 @@ function createExtractTypeAnnotation(underscoreName: string, msgTitle: string) { ); } -const createStaticExecMethodMsgBuilder = ( +const createStaticExecMethodMessageBuilder = ( context: RenderContext, jsonschema: any, msgTitle: string @@ -82,7 +82,7 @@ const createStaticExecMethodMsgBuilder = ( param.typeAnnotation.type === 'TSTypeAnnotation' && param.typeAnnotation.typeAnnotation.type === 'TSTypeLiteral' ) { - param.typeAnnotation = createExtractTypeAnnotation(underscoreName, msgTitle); + param.typeAnnotation = createExtractTypeAnnotation(underscoreName, msgTitle); } return t.classProperty( diff --git a/packages/wasm-ast-types/src/react-query/react-query.spec.ts b/packages/wasm-ast-types/src/react-query/react-query.spec.ts index c959bd73..a390f437 100644 --- a/packages/wasm-ast-types/src/react-query/react-query.spec.ts +++ b/packages/wasm-ast-types/src/react-query/react-query.spec.ts @@ -9,7 +9,7 @@ import { createReactQueryMutationHooks, } from './react-query' import { expectCode, makeContext } from '../../test-utils'; -import { createMsgBuilderClass } from '../msg-builder'; +import { createMessageBuilderClass } from '../msg-builder'; const execCtx = makeContext(execute_msg); const queryCtx = makeContext(query_msg); diff --git a/packages/wasm-ast-types/types/context/context.d.ts b/packages/wasm-ast-types/types/context/context.d.ts index 8ab4b255..9c4c198a 100644 --- a/packages/wasm-ast-types/types/context/context.d.ts +++ b/packages/wasm-ast-types/types/context/context.d.ts @@ -17,7 +17,7 @@ export interface TSClientOptions { export interface MessageComposerOptions { enabled?: boolean; } -export interface MsgBuilderOptions { +export interface MessageBuilderOptions { enabled?: boolean; } export interface RecoilOptions { @@ -52,7 +52,7 @@ export interface RenderOptions { types?: TSTypesOptions; recoil?: RecoilOptions; messageComposer?: MessageComposerOptions; - msgBuilder?: MsgBuilderOptions; + messageBuilder?: MessageBuilderOptions; client?: TSClientOptions; reactQuery?: ReactQueryOptions; } @@ -121,4 +121,4 @@ export declare abstract class RenderContextBase implements export declare class RenderContext extends RenderContextBase { mergeDefaultOpt(options: RenderOptions): RenderOptions; } -export {}; +export { }; diff --git a/packages/wasm-ast-types/types/msg-builder/msg-builder.d.ts b/packages/wasm-ast-types/types/msg-builder/msg-builder.d.ts index 4a3f0edb..79ac38d1 100644 --- a/packages/wasm-ast-types/types/msg-builder/msg-builder.d.ts +++ b/packages/wasm-ast-types/types/msg-builder/msg-builder.d.ts @@ -1,4 +1,4 @@ import * as t from '@babel/types'; import { ExecuteMsg, QueryMsg } from '../types'; import { RenderContext } from '../context'; -export declare const createMsgBuilderClass: (context: RenderContext, className: string, msg: ExecuteMsg | QueryMsg) => t.ExportNamedDeclaration; +export declare const createMessageBuilderClass: (context: RenderContext, className: string, msg: ExecuteMsg | QueryMsg) => t.ExportNamedDeclaration; diff --git a/yarn.lock b/yarn.lock index a7fa340b..d9b1e18d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,12 +2,17 @@ # yarn lockfile v1 -"@ampproject/remapping@^2.1.0": - version "2.2.0" - resolved "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d" - integrity sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w== +"@aashutoshrathi/word-wrap@^1.2.3": + version "1.2.6" + resolved "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" + integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== + +"@ampproject/remapping@^2.1.0", "@ampproject/remapping@^2.2.0": + version "2.2.1" + resolved "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" + integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== dependencies: - "@jridgewell/gen-mapping" "^0.1.0" + "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" "@babel/cli@7.18.10": @@ -26,31 +31,20 @@ "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.3" chokidar "^3.4.0" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" - integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.22.10", "@babel/code-frame@^7.22.5", "@babel/code-frame@^7.8.3": + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.10.tgz#1c20e612b768fefa75f6e90d6ecb86329247f0a3" + integrity sha512-/KKIMG4UEL35WmI9OlvMhurwtytjvXoFcGNrOvyG9zIzA8YmPjVtIZUf7b05+TPO7G7/GEmLHDaoCgACHl9hhA== dependencies: - "@babel/highlight" "^7.18.6" - -"@babel/code-frame@^7.8.3": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz" - integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== - dependencies: - "@babel/highlight" "^7.16.7" - -"@babel/compat-data@^7.17.10", "@babel/compat-data@^7.17.7", "@babel/compat-data@^7.18.8": - version "7.18.8" - resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.18.8.tgz#2483f565faca607b8535590e84e7de323f27764d" - integrity sha512-HSmX4WZPPK3FUxYp7g2T6EyO8j96HlZJlxmKPSh6KAcqwyDrfx7hKjXpAW/0FhFfTJsR0Yt4lAjLI2coMptIHQ== + "@babel/highlight" "^7.22.10" + chalk "^2.4.2" -"@babel/compat-data@^7.9.6": - version "7.18.5" - resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.18.5.tgz" - integrity sha512-BxhE40PVCBxVEJsSBhB6UWyAuqJRxGsAw8BdHMJ3AKGydcwuWW4kOO3HmqBQAdcq/OP+/DlTVxLvsCzRTnZuGg== +"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.18.8", "@babel/compat-data@^7.20.5", "@babel/compat-data@^7.22.9", "@babel/compat-data@^7.9.6": + version "7.22.9" + resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.9.tgz#71cdb00a1ce3a329ce4cbec3a44f9fef35669730" + integrity sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ== -"@babel/core@7.18.10", "@babel/core@^7.11.6", "@babel/core@^7.12.3": +"@babel/core@7.18.10": version "7.18.10" resolved "https://registry.npmjs.org/@babel/core/-/core-7.18.10.tgz#39ad504991d77f1f3da91be0b8b949a5bc466fb8" integrity sha512-JQM6k6ENcBFKVtWvLavlvi/mPcpYZ3+R+2EySDEMSMbp7Mn4FexlbbJVrx2R7Ijhr01T8gyqrOaABWIOgxeUyw== @@ -73,7 +67,7 @@ "@babel/core@7.9.6": version "7.9.6" - resolved "https://registry.npmjs.org/@babel/core/-/core-7.9.6.tgz" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.9.6.tgz#d9aa1f580abf3b2286ef40b6904d390904c63376" integrity sha512-nD3deLvbsApbHAHttzIssYqgb883yU/d9roe4RZymBCDaZryMJDbptVpEpeQuRh4BJ+SYI8le9YGxKvFEvl1Wg== dependencies: "@babel/code-frame" "^7.8.3" @@ -93,16 +87,37 @@ semver "^5.4.1" source-map "^0.5.0" +"@babel/core@^7.11.6", "@babel/core@^7.12.3": + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.22.10.tgz#aad442c7bcd1582252cb4576747ace35bc122f35" + integrity sha512-fTmqbbUBAwCcre6zPzNngvsI0aNrPZe77AeqvDxWM9Nm+04RrJ3CAmGHA9f7lJQY6ZMhRztNemy4uslDxTX4Qw== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.22.10" + "@babel/generator" "^7.22.10" + "@babel/helper-compilation-targets" "^7.22.10" + "@babel/helper-module-transforms" "^7.22.9" + "@babel/helpers" "^7.22.10" + "@babel/parser" "^7.22.10" + "@babel/template" "^7.22.5" + "@babel/traverse" "^7.22.10" + "@babel/types" "^7.22.10" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.2" + semver "^6.3.1" + "@babel/eslint-parser@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.18.9.tgz#255a63796819a97b7578751bb08ab9f2a375a031" - integrity sha512-KzSGpMBggz4fKbRbWLNyPVTuQr6cmCcBhOyXTw/fieOVaw5oYAwcAj4a7UKcDYCPxQq+CG1NCDZH9e2JTXquiQ== + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.22.10.tgz#bfdf3d1b32ad573fe7c1c3447e0b485e3a41fd09" + integrity sha512-0J8DNPRXQRLeR9rPaUMM3fA+RbixjnVLe/MRMYCkp3hzgsSuxCHQ8NN8xQG1wIHKJ4a1DTROTvFJdW+B5/eOsg== dependencies: - eslint-scope "^5.1.1" + "@nicolo-ribaudo/eslint-scope-5-internals" "5.1.1-v1" eslint-visitor-keys "^2.1.0" - semver "^6.3.0" + semver "^6.3.1" -"@babel/generator@7.18.12", "@babel/generator@^7.18.10", "@babel/generator@^7.18.2", "@babel/generator@^7.7.2": +"@babel/generator@7.18.12": version "7.18.12" resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.18.12.tgz#fa58daa303757bd6f5e4bbca91b342040463d9f4" integrity sha512-dfQ8ebCN98SvyL7IxNMCUtZQSq5R7kxgN+r8qYTGDmmSion1hX2C0zq2yo1bsCDhXixokv1SAWTZUMYbO/V5zg== @@ -111,111 +126,69 @@ "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" -"@babel/generator@^7.9.6": - version "7.18.2" - resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.18.2.tgz" - integrity sha512-W1lG5vUwFvfMd8HVXqdfbuG7RuaSrTCCD8cl8fP8wOivdbtbIg2Db3IWUcgvfxKbbn6ZBGYRW/Zk1MIwK49mgw== +"@babel/generator@^7.18.10", "@babel/generator@^7.22.10", "@babel/generator@^7.7.2", "@babel/generator@^7.9.6": + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.22.10.tgz#c92254361f398e160645ac58831069707382b722" + integrity sha512-79KIf7YiWjjdZ81JnLujDRApWtl7BxTqWD88+FFdQEIOG8LJ0etDOM7CXuIgGJa55sGOwZVwuEsaLEm0PJ5/+A== dependencies: - "@babel/types" "^7.18.2" - "@jridgewell/gen-mapping" "^0.3.0" + "@babel/types" "^7.22.10" + "@jridgewell/gen-mapping" "^0.3.2" + "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" -"@babel/helper-annotate-as-pure@^7.16.7": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz" - integrity sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-annotate-as-pure@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb" - integrity sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-builder-binary-assignment-operator-visitor@^7.16.7": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.7.tgz" - integrity sha512-C6FdbRaxYjwVu/geKW4ZeQ0Q31AftgRcdSnZ5/jsH6BzCJbtvXvhpfkbkThYSuutZA7nCXpPR6AD9zd1dprMkA== - dependencies: - "@babel/helper-explode-assignable-expression" "^7.16.7" - "@babel/types" "^7.16.7" - -"@babel/helper-builder-binary-assignment-operator-visitor@^7.18.6": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.18.9.tgz#acd4edfd7a566d1d51ea975dff38fd52906981bb" - integrity sha512-yFQ0YCHoIqarl8BCRwBL8ulYUaZpz3bNsA7oFepAzee+8/+ImtADXNOmO5vJvsPff3qi+hvpkY/NYBTrBQgdNw== - dependencies: - "@babel/helper-explode-assignable-expression" "^7.18.6" - "@babel/types" "^7.18.9" - -"@babel/helper-compilation-targets@^7.16.7", "@babel/helper-compilation-targets@^7.17.10", "@babel/helper-compilation-targets@^7.9.6": - version "7.18.2" - resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.2.tgz" - integrity sha512-s1jnPotJS9uQnzFtiZVBUxe67CuBa679oWFHpxYYnTpRL/1ffhyX44R9uYiXoa/pLXcY9H2moJta0iaanlk/rQ== - dependencies: - "@babel/compat-data" "^7.17.10" - "@babel/helper-validator-option" "^7.16.7" - browserslist "^4.20.2" - semver "^6.3.0" - -"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.9.tgz#69e64f57b524cde3e5ff6cc5a9f4a387ee5563bf" - integrity sha512-tzLCyVmqUiFlcFoAPLA/gL9TeYrF61VLNtb+hvkuVaB5SUjW7jcfrglBIX1vUIoT7CLP3bBlIMeyEsIl2eFQNg== - dependencies: - "@babel/compat-data" "^7.18.8" - "@babel/helper-validator-option" "^7.18.6" - browserslist "^4.20.2" - semver "^6.3.0" - -"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.18.9.tgz#d802ee16a64a9e824fcbf0a2ffc92f19d58550ce" - integrity sha512-WvypNAYaVh23QcjpMR24CwZY2Nz6hqdOcFdPbNpV56hL5H6KiFheO7Xm1aPdlLQ7d5emYZX7VZwPp9x3z+2opw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.18.9" - "@babel/helper-member-expression-to-functions" "^7.18.9" - "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/helper-replace-supers" "^7.18.9" - "@babel/helper-split-export-declaration" "^7.18.6" - -"@babel/helper-create-class-features-plugin@^7.8.3": - version "7.18.0" - resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.18.0.tgz" - integrity sha512-Kh8zTGR9de3J63e5nS0rQUdRs/kbtwoeQQ0sriS0lItjC96u8XXZN6lKpuyWd2coKSU13py/y+LTmThLuVX0Pg== - dependencies: - "@babel/helper-annotate-as-pure" "^7.16.7" - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-function-name" "^7.17.9" - "@babel/helper-member-expression-to-functions" "^7.17.7" - "@babel/helper-optimise-call-expression" "^7.16.7" - "@babel/helper-replace-supers" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" - -"@babel/helper-create-regexp-features-plugin@^7.16.7", "@babel/helper-create-regexp-features-plugin@^7.17.12": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.17.12.tgz" - integrity sha512-b2aZrV4zvutr9AIa6/gA3wsZKRwTKYoDxYiFKcESS3Ug2GTXzwBEvMuuFLhCQpEnRXs1zng4ISAXSUxxKBIcxw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.16.7" - regexpu-core "^5.0.1" - -"@babel/helper-create-regexp-features-plugin@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.18.6.tgz#3e35f4e04acbbf25f1b3534a657610a000543d3c" - integrity sha512-7LcpH1wnQLGrI+4v+nPp+zUvIkF9x0ddv1Hkdue10tg3gmRnLy97DXh4STiOf1qeIInyD69Qv5kKSZzKD8B/7A== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - regexpu-core "^5.1.0" - -"@babel/helper-define-polyfill-provider@^0.3.2": - version "0.3.2" - resolved "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.2.tgz#bd10d0aca18e8ce012755395b05a79f45eca5073" - integrity sha512-r9QJJ+uDWrd+94BSPcP6/de67ygLtvVy6cK4luE6MOuDsZIdoaPBnfSpbO/+LTifjPckbKXRuI9BB/Z2/y3iTg== +"@babel/helper-annotate-as-pure@^7.18.6", "@babel/helper-annotate-as-pure@^7.22.5": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" + integrity sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-builder-binary-assignment-operator-visitor@^7.22.5": + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.10.tgz#573e735937e99ea75ea30788b57eb52fab7468c9" + integrity sha512-Av0qubwDQxC56DoUReVDeLfMEjYYSN1nZrTUrWkXd7hpU73ymRANkbuDm3yni9npkn+RXy9nNbEJZEzXr7xrfQ== + dependencies: + "@babel/types" "^7.22.10" + +"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.20.7", "@babel/helper-compilation-targets@^7.22.10", "@babel/helper-compilation-targets@^7.22.5", "@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.9.6": + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.10.tgz#01d648bbc25dd88f513d862ee0df27b7d4e67024" + integrity sha512-JMSwHD4J7SLod0idLq5PKgI+6g/hLD/iuWBq08ZX49xE14VpVEojJ5rHWptpirV2j020MvypRLAXAO50igCJ5Q== + dependencies: + "@babel/compat-data" "^7.22.9" + "@babel/helper-validator-option" "^7.22.5" + browserslist "^4.21.9" + lru-cache "^5.1.1" + semver "^6.3.1" + +"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.21.0", "@babel/helper-create-class-features-plugin@^7.22.10", "@babel/helper-create-class-features-plugin@^7.8.3": + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.10.tgz#dd2612d59eac45588021ac3d6fa976d08f4e95a3" + integrity sha512-5IBb77txKYQPpOEdUdIhBx8VrZyDCQ+H82H0+5dX1TmuscP5vJKEE3cKurjtIw/vFwzbVH48VweE78kVDBrqjA== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-function-name" "^7.22.5" + "@babel/helper-member-expression-to-functions" "^7.22.5" + "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + semver "^6.3.1" + +"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.22.5": + version "7.22.9" + resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.9.tgz#9d8e61a8d9366fe66198f57c40565663de0825f6" + integrity sha512-+svjVa/tFwsNSG4NEy1h85+HQ5imbT92Q5/bgtS7P0GTQlP8WuFdqsiABmQouhiFGyV66oGxZFpeYHza1rNsKw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + regexpu-core "^5.3.1" + semver "^6.3.1" + +"@babel/helper-define-polyfill-provider@^0.3.2", "@babel/helper-define-polyfill-provider@^0.3.3": + version "0.3.3" + resolved "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.3.tgz#8612e55be5d51f0cd1f36b4a5a83924e89884b7a" + integrity sha512-z5aQKU4IzbqCC1XH0nAqfsFLMVSo22SBKUc0BxGrLkolTdPTructy0ToNnlO2zA4j9Q/7pjMZf0DSY+DSTYzww== dependencies: "@babel/helper-compilation-targets" "^7.17.7" "@babel/helper-plugin-utils" "^7.16.7" @@ -224,323 +197,192 @@ resolve "^1.14.2" semver "^6.1.2" -"@babel/helper-environment-visitor@^7.16.7", "@babel/helper-environment-visitor@^7.18.2", "@babel/helper-environment-visitor@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" - integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== - -"@babel/helper-explode-assignable-expression@^7.16.7": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.7.tgz" - integrity sha512-KyUenhWMC8VrxzkGP0Jizjo4/Zx+1nNZhgocs+gLzyZyB8SHidhoq9KK/8Ato4anhwsivfkBLftky7gvzbZMtQ== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-explode-assignable-expression@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.18.6.tgz#41f8228ef0a6f1a036b8dfdfec7ce94f9a6bc096" - integrity sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-function-name@^7.16.7": - version "7.17.9" - resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz" - integrity sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg== - dependencies: - "@babel/template" "^7.16.7" - "@babel/types" "^7.17.0" - -"@babel/helper-function-name@^7.17.9", "@babel/helper-function-name@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.18.9.tgz#940e6084a55dee867d33b4e487da2676365e86b0" - integrity sha512-fJgWlZt7nxGksJS9a0XdSaI4XvpExnNIgRP+rVefWh5U7BL8pPuir6SJUmFKRfjWQ51OtWSzwOxhaH/EBWWc0A== - dependencies: - "@babel/template" "^7.18.6" - "@babel/types" "^7.18.9" - -"@babel/helper-hoist-variables@^7.16.7", "@babel/helper-hoist-variables@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" - integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-member-expression-to-functions@^7.17.7": - version "7.17.7" - resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.17.7.tgz" - integrity sha512-thxXgnQ8qQ11W2wVUObIqDL4p148VMxkt5T/qpN5k2fboRyzFGFmKsTGViquyM5QHKUy48OZoca8kw4ajaDPyw== - dependencies: - "@babel/types" "^7.17.0" - -"@babel/helper-member-expression-to-functions@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.18.9.tgz#1531661e8375af843ad37ac692c132841e2fd815" - integrity sha512-RxifAh2ZoVU67PyKIO4AMi1wTenGfMR/O/ae0CCRqwgBAt5v7xjdtRw7UoSbsreKrQn5t7r89eruK/9JjYHuDg== - dependencies: - "@babel/types" "^7.18.9" - -"@babel/helper-module-imports@^7.16.7", "@babel/helper-module-imports@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e" - integrity sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-module-imports@^7.8.3": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz" - integrity sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-module-transforms@^7.18.0", "@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.18.9.tgz#5a1079c005135ed627442df31a42887e80fcb712" - integrity sha512-KYNqY0ICwfv19b31XzvmI/mfcylOzbLtowkw+mfvGPAQ3kfCnMLYbED3YecL5tPd8nAYFQFAd6JHp2LxZk/J1g== - dependencies: - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-simple-access" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/helper-validator-identifier" "^7.18.6" - "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.9" - "@babel/types" "^7.18.9" - -"@babel/helper-module-transforms@^7.9.0": - version "7.18.0" - resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.18.0.tgz" - integrity sha512-kclUYSUBIjlvnzN2++K9f2qzYKFgjmnmjwL4zlmU5f8ZtzgWe8s0rUPSTGy2HmK4P8T52MQsS+HTQAgZd3dMEA== - dependencies: - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-module-imports" "^7.16.7" - "@babel/helper-simple-access" "^7.17.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/helper-validator-identifier" "^7.16.7" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.18.0" - "@babel/types" "^7.18.0" - -"@babel/helper-optimise-call-expression@^7.16.7": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz" - integrity sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-optimise-call-expression@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz#9369aa943ee7da47edab2cb4e838acf09d290ffe" - integrity sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.17.12", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.8.0": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.18.9.tgz#4b8aea3b069d8cb8a72cdfe28ddf5ceca695ef2f" - integrity sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w== - -"@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.8.3": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.17.12.tgz" - integrity sha512-JDkf04mqtN3y4iAbO1hv9U2ARpPyPL1zqyWs/2WG1pgSq9llHFjStX5jdxb84himgJm+8Ng+x0oiWF/nw/XQKA== - -"@babel/helper-remap-async-to-generator@^7.16.8": - version "7.16.8" - resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.8.tgz" - integrity sha512-fm0gH7Flb8H51LqJHy3HJ3wnE1+qtYR2A99K06ahwrawLdOFsCEWjZOrYricXJHoPSudNKxrMBUPEIPxiIIvBw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.16.7" - "@babel/helper-wrap-function" "^7.16.8" - "@babel/types" "^7.16.8" - -"@babel/helper-remap-async-to-generator@^7.18.6", "@babel/helper-remap-async-to-generator@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz#997458a0e3357080e54e1d79ec347f8a8cd28519" - integrity sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-wrap-function" "^7.18.9" - "@babel/types" "^7.18.9" - -"@babel/helper-replace-supers@^7.16.7", "@babel/helper-replace-supers@^7.18.2": - version "7.18.2" - resolved "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.18.2.tgz" - integrity sha512-XzAIyxx+vFnrOxiQrToSUOzUOn0e1J2Li40ntddek1Y69AXUTXoDJ40/D5RdjFu7s7qHiaeoTiempZcbuVXh2Q== - dependencies: - "@babel/helper-environment-visitor" "^7.18.2" - "@babel/helper-member-expression-to-functions" "^7.17.7" - "@babel/helper-optimise-call-expression" "^7.16.7" - "@babel/traverse" "^7.18.2" - "@babel/types" "^7.18.2" - -"@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.18.9.tgz#1092e002feca980fbbb0bd4d51b74a65c6a500e6" - integrity sha512-dNsWibVI4lNT6HiuOIBr1oyxo40HvIVmbwPUm3XZ7wMh4k2WxrxTqZwSqw/eEmXDS9np0ey5M2bz9tBmO9c+YQ== - dependencies: - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-member-expression-to-functions" "^7.18.9" - "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/traverse" "^7.18.9" - "@babel/types" "^7.18.9" +"@babel/helper-environment-visitor@^7.18.9", "@babel/helper-environment-visitor@^7.22.5": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz#f06dd41b7c1f44e1f8da6c4055b41ab3a09a7e98" + integrity sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q== -"@babel/helper-simple-access@^7.17.7", "@babel/helper-simple-access@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz#d6d8f51f4ac2978068df934b569f08f29788c7ea" - integrity sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g== +"@babel/helper-function-name@^7.18.9", "@babel/helper-function-name@^7.22.5": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz#ede300828905bb15e582c037162f99d5183af1be" + integrity sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ== dependencies: - "@babel/types" "^7.18.6" + "@babel/template" "^7.22.5" + "@babel/types" "^7.22.5" -"@babel/helper-simple-access@^7.18.2": - version "7.18.2" - resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.18.2.tgz" - integrity sha512-7LIrjYzndorDY88MycupkpQLKS1AFfsVRm2k/9PtKScSy5tZq0McZTj+DiMRynboZfIqOKvo03pmhTaUgiD6fQ== +"@babel/helper-hoist-variables@^7.18.6", "@babel/helper-hoist-variables@^7.22.5": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" + integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== dependencies: - "@babel/types" "^7.18.2" + "@babel/types" "^7.22.5" -"@babel/helper-skip-transparent-expression-wrappers@^7.16.0": - version "7.16.0" - resolved "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz" - integrity sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw== +"@babel/helper-member-expression-to-functions@^7.22.5": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.5.tgz#0a7c56117cad3372fbf8d2fb4bf8f8d64a1e76b2" + integrity sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ== dependencies: - "@babel/types" "^7.16.0" + "@babel/types" "^7.22.5" + +"@babel/helper-module-imports@^7.18.6", "@babel/helper-module-imports@^7.22.5", "@babel/helper-module-imports@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz#1a8f4c9f4027d23f520bd76b364d44434a72660c" + integrity sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg== + dependencies: + "@babel/types" "^7.22.5" -"@babel/helper-skip-transparent-expression-wrappers@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.18.9.tgz#778d87b3a758d90b471e7b9918f34a9a02eb5818" - integrity sha512-imytd2gHi3cJPsybLRbmFrF7u5BIEuI2cNheyKi3/iOBC63kNn3q8Crn2xVuESli0aM4KYsyEqKyS7lFL8YVtw== +"@babel/helper-module-transforms@^7.18.9", "@babel/helper-module-transforms@^7.22.5", "@babel/helper-module-transforms@^7.22.9", "@babel/helper-module-transforms@^7.9.0": + version "7.22.9" + resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.9.tgz#92dfcb1fbbb2bc62529024f72d942a8c97142129" + integrity sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ== + dependencies: + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-module-imports" "^7.22.5" + "@babel/helper-simple-access" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/helper-validator-identifier" "^7.22.5" + +"@babel/helper-optimise-call-expression@^7.22.5": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e" + integrity sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295" + integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== + +"@babel/helper-remap-async-to-generator@^7.18.9", "@babel/helper-remap-async-to-generator@^7.22.5": + version "7.22.9" + resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.9.tgz#53a25b7484e722d7efb9c350c75c032d4628de82" + integrity sha512-8WWC4oR4Px+tr+Fp0X3RHDVfINGpF3ad1HIbrc8A77epiR6eMMc6jsgozkzT2uDiOOdoS9cLIQ+XD2XvI2WSmQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-wrap-function" "^7.22.9" + +"@babel/helper-replace-supers@^7.22.5", "@babel/helper-replace-supers@^7.22.9": + version "7.22.9" + resolved "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.22.9.tgz#cbdc27d6d8d18cd22c81ae4293765a5d9afd0779" + integrity sha512-LJIKvvpgPOPUThdYqcX6IXRuIcTkcAub0IaDRGCZH0p5GPUp7PhRU9QVgFcDDd51BaPkk77ZjqFwh6DZTAEmGg== + dependencies: + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-member-expression-to-functions" "^7.22.5" + "@babel/helper-optimise-call-expression" "^7.22.5" + +"@babel/helper-simple-access@^7.22.5": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz#4938357dc7d782b80ed6dbb03a0fba3d22b1d5de" + integrity sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-skip-transparent-expression-wrappers@^7.20.0", "@babel/helper-skip-transparent-expression-wrappers@^7.22.5": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz#007f15240b5751c537c40e77abb4e89eeaaa8847" + integrity sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-split-export-declaration@^7.18.6", "@babel/helper-split-export-declaration@^7.22.6": + version "7.22.6" + resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" + integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-string-parser@^7.18.10", "@babel/helper-string-parser@^7.22.5": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" + integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== + +"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.22.5": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193" + integrity sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ== + +"@babel/helper-validator-option@^7.18.6", "@babel/helper-validator-option@^7.22.5": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz#de52000a15a177413c8234fa3a8af4ee8102d0ac" + integrity sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw== + +"@babel/helper-wrap-function@^7.22.9": + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.22.10.tgz#d845e043880ed0b8c18bd194a12005cb16d2f614" + integrity sha512-OnMhjWjuGYtdoO3FmsEFWvBStBAe2QOgwOLsLNDjN+aaiMD8InJk1/O3HSD8lkqTjCgg5YI34Tz15KNNA3p+nQ== + dependencies: + "@babel/helper-function-name" "^7.22.5" + "@babel/template" "^7.22.5" + "@babel/types" "^7.22.10" + +"@babel/helpers@^7.18.9", "@babel/helpers@^7.22.10", "@babel/helpers@^7.9.6": + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.10.tgz#ae6005c539dfbcb5cd71fb51bfc8a52ba63bc37a" + integrity sha512-a41J4NW8HyZa1I1vAndrraTlPZ/eZoga2ZgS7fEr0tZJGVU4xqdE80CEm0CcNjha5EZ8fTBYLKHF0kqDUuAwQw== dependencies: - "@babel/types" "^7.18.9" - -"@babel/helper-split-export-declaration@^7.16.7", "@babel/helper-split-export-declaration@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" - integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-string-parser@^7.18.10": - version "7.18.10" - resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.18.10.tgz#181f22d28ebe1b3857fa575f5c290b1aaf659b56" - integrity sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw== - -"@babel/helper-validator-identifier@^7.16.7", "@babel/helper-validator-identifier@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz#9c97e30d31b2b8c72a1d08984f2ca9b574d7a076" - integrity sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g== - -"@babel/helper-validator-option@^7.16.7", "@babel/helper-validator-option@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" - integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== - -"@babel/helper-wrap-function@^7.16.8": - version "7.16.8" - resolved "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.16.8.tgz" - integrity sha512-8RpyRVIAW1RcDDGTA+GpPAwV22wXCfKOoM9bet6TLkGIFTkRQSkH1nMQ5Yet4MpoXe1ZwHPVtNasc2w0uZMqnw== - dependencies: - "@babel/helper-function-name" "^7.16.7" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.16.8" - "@babel/types" "^7.16.8" - -"@babel/helper-wrap-function@^7.18.9": - version "7.18.11" - resolved "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.18.11.tgz#bff23ace436e3f6aefb61f85ffae2291c80ed1fb" - integrity sha512-oBUlbv+rjZLh2Ks9SKi4aL7eKaAXBWleHzU89mP0G6BMUlRxSckk9tSIkgDGydhgFxHuGSlBQZfnaD47oBEB7w== - dependencies: - "@babel/helper-function-name" "^7.18.9" - "@babel/template" "^7.18.10" - "@babel/traverse" "^7.18.11" - "@babel/types" "^7.18.10" - -"@babel/helpers@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.18.9.tgz#4bef3b893f253a1eced04516824ede94dcfe7ff9" - integrity sha512-Jf5a+rbrLoR4eNdUmnFu8cN5eNJT6qdTdOg5IHIzq87WwyRw9PwguLFOWYgktN/60IP4fgDUawJvs7PjQIzELQ== - dependencies: - "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.9" - "@babel/types" "^7.18.9" - -"@babel/helpers@^7.9.6": - version "7.18.2" - resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.18.2.tgz" - integrity sha512-j+d+u5xT5utcQSzrh9p+PaJX94h++KN+ng9b9WEJq7pkUPAd61FGqhjuUEdfknb3E/uDBb7ruwEeKkIxNJPIrg== - dependencies: - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.18.2" - "@babel/types" "^7.18.2" - -"@babel/highlight@^7.16.7", "@babel/highlight@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" - integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== - dependencies: - "@babel/helper-validator-identifier" "^7.18.6" - chalk "^2.0.0" + "@babel/template" "^7.22.5" + "@babel/traverse" "^7.22.10" + "@babel/types" "^7.22.10" + +"@babel/highlight@^7.22.10": + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.10.tgz#02a3f6d8c1cb4521b2fd0ab0da8f4739936137d7" + integrity sha512-78aUtVcT7MUscr0K5mIEnkwxPE0MaxkR5RxRwuHaQ+JuU5AmTPhY+do2mdzVTnIJJpyBglql2pehuBIWHug+WQ== + dependencies: + "@babel/helper-validator-identifier" "^7.22.5" + chalk "^2.4.2" js-tokens "^4.0.0" "@babel/node@^7.18.10": - version "7.18.10" - resolved "https://registry.npmjs.org/@babel/node/-/node-7.18.10.tgz#ab2be57785346b5bf0721c3d17572402419d9d8a" - integrity sha512-VbqzK6QXfQVi4Bpk6J7XqHXKFNbG2j3rdIdx68+/14GDU7jXDOSyUU/cwqCM1fDwCdxp37pNV/ToSCXsNChcyA== + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/node/-/node-7.22.10.tgz#865ef915633790b1e11c091896bb44ab36cd14b6" + integrity sha512-FpSgdjIPabpEetDxtKYAcXCs0qRh12S2D40rhpRoo0w5h7/7Tu2ZroaX99cbKFNDODiSs484sZ1q0kutJbZ2iQ== dependencies: - "@babel/register" "^7.18.9" + "@babel/register" "^7.22.5" commander "^4.0.1" - core-js "^3.22.1" + core-js "^3.30.2" node-environment-flags "^1.0.5" - regenerator-runtime "^0.13.4" + regenerator-runtime "^0.14.0" v8flags "^3.1.1" -"@babel/parser@7.18.11", "@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.18.10", "@babel/parser@^7.18.11", "@babel/parser@^7.18.5": +"@babel/parser@7.18.11": version "7.18.11" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.18.11.tgz#68bb07ab3d380affa9a3f96728df07969645d2d9" integrity sha512-9JKn5vN+hDt0Hdqn1PiJ2guflwP+B6Ga8qbDuoF0PzzVhrzsKIJo8yGqVk6CmMHiMei9w1C1Bp9IMJSIK+HPIQ== -"@babel/parser@^7.9.6": - version "7.18.5" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.18.5.tgz" - integrity sha512-YZWVaglMiplo7v8f1oMQ5ZPQr0vn7HPeZXxXWsxXJRjGVrzUFn9OxFQl1sb5wzfootjA/yChhW84BV+383FSOw== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.18.11", "@babel/parser@^7.20.7", "@babel/parser@^7.22.10", "@babel/parser@^7.22.5", "@babel/parser@^7.9.6": + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.22.10.tgz#e37634f9a12a1716136c44624ef54283cabd3f55" + integrity sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ== "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz#da5b8f9a580acdfbe53494dba45ea389fb09a4d2" - integrity sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ== + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.5.tgz#87245a21cd69a73b0b81bcda98d443d6df08f05e" + integrity sha512-NP1M5Rf+u2Gw9qfSO4ihjcTGW5zXTi36ITLd4/EoAcEhIZ0yjMqmftDNl3QC19CX7olhrjpyU454g/2W7X0jvQ== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.18.9.tgz#a11af19aa373d68d561f08e0a57242350ed0ec50" - integrity sha512-AHrP9jadvH7qlOj6PINbgSuphjQUAK7AOT7DPjBo9EHoLhQTnnK5u45e1Hd4DbSQEO9nqPWtQ89r+XEOWFScKg== + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.5.tgz#fef09f9499b1f1c930da8a0c419db42167d792ca" + integrity sha512-31Bb65aZaUwqCbWMnZPduIZxCBngHFlzyN6Dq6KAJjtx+lx6ohKHubc61OomYi7XwVD4Ol0XCVz4h+pYFR048g== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" - "@babel/helper-skip-transparent-expression-wrappers" "^7.18.9" - "@babel/plugin-proposal-optional-chaining" "^7.18.9" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/plugin-transform-optional-chaining" "^7.22.5" -"@babel/plugin-proposal-async-generator-functions@^7.18.10": - version "7.18.10" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.18.10.tgz#85ea478c98b0095c3e4102bff3b67d306ed24952" - integrity sha512-1mFuY2TOsR1hxbjCo4QL+qlIjV07p4H4EUYw2J/WCqsvFV6V9X9z9YhXbWndc/4fw+hYGlDT7egYxliMp5O6Ew== +"@babel/plugin-proposal-async-generator-functions@^7.18.10", "@babel/plugin-proposal-async-generator-functions@^7.8.3": + version "7.20.7" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz#bfb7276d2d573cb67ba379984a2334e262ba5326" + integrity sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA== dependencies: "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.20.2" "@babel/helper-remap-async-to-generator" "^7.18.9" "@babel/plugin-syntax-async-generators" "^7.8.4" -"@babel/plugin-proposal-async-generator-functions@^7.8.3": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.17.12.tgz" - integrity sha512-RWVvqD1ooLKP6IqWTA5GyFVX2isGEgC5iFxKzfYOIy/QEFdxYyCybBDtIGjipHpb9bDWHzcqGqFakf+mVmBTdQ== - dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/helper-remap-async-to-generator" "^7.16.8" - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-proposal-class-properties@7.18.6", "@babel/plugin-proposal-class-properties@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz#b110f59741895f7ec21a6fff696ec46265c446a3" @@ -551,22 +393,22 @@ "@babel/plugin-proposal-class-properties@7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.8.3.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.8.3.tgz#5e06654af5cd04b608915aada9b2a6788004464e" integrity sha512-EqFhbo7IosdgPgZggHaNObkmO1kNUe3slaKu54d5OWvy+p9QIKOzK1GAEpAIsZtWVtPXUHSMcT4smvDrCfY4AA== dependencies: "@babel/helper-create-class-features-plugin" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-proposal-class-static-block@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.18.6.tgz#8aa81d403ab72d3962fc06c26e222dacfc9b9020" - integrity sha512-+I3oIiNxrCpup3Gi8n5IGMwj0gOCAjcJUSQEcotNnCCPMEnixawOQ+KeJPlgfjzx+FKQ1QSyZOWe7wmoJp7vhw== + version "7.21.0" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.21.0.tgz#77bdd66fb7b605f3a61302d224bdfacf5547977d" + integrity sha512-XP5G9MWNUskFuP30IfFSEFB0Z6HzLIUcjYM4bYOPHXl7eiJ9HFv8tWj6TXTN5QODiEhDZAeI4hLok2iHFFV4hw== dependencies: - "@babel/helper-create-class-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-create-class-features-plugin" "^7.21.0" + "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-syntax-class-static-block" "^7.14.5" -"@babel/plugin-proposal-dynamic-import@^7.18.6": +"@babel/plugin-proposal-dynamic-import@^7.18.6", "@babel/plugin-proposal-dynamic-import@^7.8.3": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.18.6.tgz#72bcf8d408799f547d759298c3c27c7e7faa4d94" integrity sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw== @@ -574,14 +416,6 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-dynamic-import" "^7.8.3" -"@babel/plugin-proposal-dynamic-import@^7.8.3": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.7.tgz" - integrity sha512-I8SW9Ho3/8DRSdmDdH3gORdyUuYnk1m4cMxUAdu5oy4n3OfN8flDEH+d60iG7dUfi0KkYwSvoalHzzdRzpWHTg== - dependencies: - "@babel/helper-plugin-utils" "^7.16.7" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@babel/plugin-proposal-export-default-from@7.18.10": version "7.18.10" resolved "https://registry.npmjs.org/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.18.10.tgz#091f4794dbce4027c03cf4ebc64d3fb96b75c206" @@ -592,7 +426,7 @@ "@babel/plugin-proposal-export-default-from@7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.8.3.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.8.3.tgz#4cb7c2fdeaed490b60d9bfd3dc8a20f81f9c2e7c" integrity sha512-PYtv2S2OdCdp7GSPDg5ndGZFm9DmWFvuLoS5nBxZCgOBggluLnhTScspJxng96alHQzPyrrHxvC9/w4bFuspeA== dependencies: "@babel/helper-plugin-utils" "^7.8.3" @@ -606,7 +440,7 @@ "@babel/helper-plugin-utils" "^7.18.9" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" -"@babel/plugin-proposal-json-strings@^7.18.6": +"@babel/plugin-proposal-json-strings@^7.18.6", "@babel/plugin-proposal-json-strings@^7.8.3": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.18.6.tgz#7e8788c1811c393aff762817e7dbf1ebd0c05f0b" integrity sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ== @@ -614,23 +448,15 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-json-strings" "^7.8.3" -"@babel/plugin-proposal-json-strings@^7.8.3": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.17.12.tgz" - integrity sha512-rKJ+rKBoXwLnIn7n6o6fulViHMrOThz99ybH+hKHcOZbnN14VuMnH9fo2eHE69C8pO4uX1Q7t2HYYIDmv8VYkg== - dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-proposal-logical-assignment-operators@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.18.9.tgz#8148cbb350483bf6220af06fa6db3690e14b2e23" - integrity sha512-128YbMpjCrP35IOExw2Fq+x55LMP42DzhOhX2aNNIdI9avSWl2PI0yuBWarr3RYpZBSPtabfadkH2yeRiMD61Q== + version "7.20.7" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.20.7.tgz#dfbcaa8f7b4d37b51e8bfb46d94a5aea2bb89d83" + integrity sha512-y7C7cZgpMIjWlKE5T7eJwp+tnRYM89HmRvWM5EQuB5BoHEONjmQ8lSNmBUwOyy/GFRsohJED51YBF79hE1djug== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" -"@babel/plugin-proposal-nullish-coalescing-operator@^7.18.6": +"@babel/plugin-proposal-nullish-coalescing-operator@^7.18.6", "@babel/plugin-proposal-nullish-coalescing-operator@^7.8.3": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz#fdd940a99a740e577d6c753ab6fbb43fdb9467e1" integrity sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA== @@ -638,15 +464,7 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" -"@babel/plugin-proposal-nullish-coalescing-operator@^7.8.3": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.17.12.tgz" - integrity sha512-ws/g3FSGVzv+VH86+QvgtuJL/kR67xaEIF2x0iPqdDfYW6ra6JF3lKVBkWynRLcNtIC1oCTfDRVxmm2mKzy+ag== - dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - -"@babel/plugin-proposal-numeric-separator@^7.18.6": +"@babel/plugin-proposal-numeric-separator@^7.18.6", "@babel/plugin-proposal-numeric-separator@^7.8.3": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz#899b14fbafe87f053d2c5ff05b36029c62e13c75" integrity sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q== @@ -654,15 +472,7 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-numeric-separator@^7.8.3": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.16.7.tgz" - integrity sha512-vQgPMknOIgiuVqbokToyXbkY/OmmjAzr/0lhSIbG/KmnzXPGwW/AdhdKpi+O4X/VkWiWjnkKOBiqJrTaC98VKw== - dependencies: - "@babel/helper-plugin-utils" "^7.16.7" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - -"@babel/plugin-proposal-object-rest-spread@7.18.9", "@babel/plugin-proposal-object-rest-spread@^7.18.9": +"@babel/plugin-proposal-object-rest-spread@7.18.9": version "7.18.9" resolved "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.18.9.tgz#f9434f6beb2c8cae9dfcf97d2a5941bbbf9ad4e7" integrity sha512-kDDHQ5rflIeY5xl69CEqGEZ0KY369ehsCIEbTGb4siHG5BE9sga/T0r0OUwyZNLMmZE79E1kbsqAjwFCW4ds6Q== @@ -675,25 +485,25 @@ "@babel/plugin-proposal-object-rest-spread@7.9.6": version "7.9.6" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.9.6.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.9.6.tgz#7a093586fcb18b08266eb1a7177da671ac575b63" integrity sha512-Ga6/fhGqA9Hj+y6whNpPv8psyaK5xzrQwSPsGPloVkvmH+PqW1ixdnfJ9uIO06OjQNYol3PMnfmJ8vfZtkzF+A== dependencies: "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-object-rest-spread" "^7.8.0" "@babel/plugin-transform-parameters" "^7.9.5" -"@babel/plugin-proposal-object-rest-spread@^7.9.6": - version "7.18.0" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.18.0.tgz" - integrity sha512-nbTv371eTrFabDfHLElkn9oyf9VG+VKK6WMzhY2o4eHKaG19BToD9947zzGMO6I/Irstx9d8CwX6njPNIAR/yw== +"@babel/plugin-proposal-object-rest-spread@^7.18.9", "@babel/plugin-proposal-object-rest-spread@^7.9.6": + version "7.20.7" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz#aa662940ef425779c75534a5c41e9d936edc390a" + integrity sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg== dependencies: - "@babel/compat-data" "^7.17.10" - "@babel/helper-compilation-targets" "^7.17.10" - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/compat-data" "^7.20.5" + "@babel/helper-compilation-targets" "^7.20.7" + "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.17.12" + "@babel/plugin-transform-parameters" "^7.20.7" -"@babel/plugin-proposal-optional-catch-binding@^7.18.6": +"@babel/plugin-proposal-optional-catch-binding@^7.18.6", "@babel/plugin-proposal-optional-catch-binding@^7.8.3": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz#f9400d0e6a3ea93ba9ef70b09e72dd6da638a2cb" integrity sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw== @@ -701,30 +511,13 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" -"@babel/plugin-proposal-optional-catch-binding@^7.8.3": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.7.tgz" - integrity sha512-eMOH/L4OvWSZAE1VkHbr1vckLG1WUcHGJSLqqQwl2GaUqG6QjddvrOaTUMNYiv77H5IKPMZ9U9P7EaHwvAShfA== - dependencies: - "@babel/helper-plugin-utils" "^7.16.7" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - -"@babel/plugin-proposal-optional-chaining@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.18.9.tgz#e8e8fe0723f2563960e4bf5e9690933691915993" - integrity sha512-v5nwt4IqBXihxGsW2QmCWMDS3B3bzGIk/EQVZz2ei7f3NJl8NzAJVvUmpDW5q1CRNY+Beb/k58UAH1Km1N411w== - dependencies: - "@babel/helper-plugin-utils" "^7.18.9" - "@babel/helper-skip-transparent-expression-wrappers" "^7.18.9" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - -"@babel/plugin-proposal-optional-chaining@^7.9.0": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.17.12.tgz" - integrity sha512-7wigcOs/Z4YWlK7xxjkvaIw84vGhDv/P1dFGQap0nHkc8gFKY/r+hXc8Qzf5k1gY7CvGIcHqAnOagVKJJ1wVOQ== +"@babel/plugin-proposal-optional-chaining@^7.18.9", "@babel/plugin-proposal-optional-chaining@^7.9.0": + version "7.21.0" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.21.0.tgz#886f5c8978deb7d30f678b2e24346b287234d3ea" + integrity sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-proposal-private-methods@^7.18.6": @@ -736,16 +529,16 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-proposal-private-property-in-object@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.18.6.tgz#a64137b232f0aca3733a67eb1a144c192389c503" - integrity sha512-9Rysx7FOctvT5ouj5JODjAFAkgGoudQuLPamZb0v1TGLpapdNaftzifU8NTWQm0IRjqoYypdrSmyWgkocDQ8Dw== + version "7.21.11" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.11.tgz#69d597086b6760c4126525cfa154f34631ff272c" + integrity sha512-0QZ8qP/3RLDVBwBFoWAwCtgcDZJVwA5LUJRZU8x2YFfKNuFq161wK3cuGrALu5yiPu+vzwTAg/sMWVNeWeNyaw== dependencies: "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-create-class-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-create-class-features-plugin" "^7.21.0" + "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-syntax-private-property-in-object" "^7.14.5" -"@babel/plugin-proposal-unicode-property-regex@^7.18.6": +"@babel/plugin-proposal-unicode-property-regex@^7.18.6", "@babel/plugin-proposal-unicode-property-regex@^7.4.4", "@babel/plugin-proposal-unicode-property-regex@^7.8.3": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz#af613d2cd5e643643b65cded64207b15c85cb78e" integrity sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w== @@ -753,17 +546,9 @@ "@babel/helper-create-regexp-features-plugin" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-proposal-unicode-property-regex@^7.4.4", "@babel/plugin-proposal-unicode-property-regex@^7.8.3": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.17.12.tgz" - integrity sha512-Wb9qLjXf3ZazqXA7IvI7ozqRIXIGPtSo+L5coFmEkhTQK18ao4UDDD0zdTGAarmbLj2urpRwrc6893cu5Bfh0A== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.17.12" - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/plugin-syntax-async-generators@^7.8.0", "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== dependencies: "@babel/helper-plugin-utils" "^7.8.0" @@ -777,52 +562,45 @@ "@babel/plugin-syntax-class-properties@^7.12.13", "@babel/plugin-syntax-class-properties@^7.8.3": version "7.12.13" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== dependencies: "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-class-static-block@^7.14.5": version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-dynamic-import@^7.8.0", "@babel/plugin-syntax-dynamic-import@^7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-export-default-from@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.18.6.tgz#8df076711a4818c4ce4f23e61d622b0ba2ff84bc" - integrity sha512-Kr//z3ujSVNx6E9z9ih5xXXMqK07VVTuqPmqGe6Mss/zW5XPeLZeSDZoP9ab/hT4wPKqAgjl2PnhPrcpk8Seew== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-syntax-export-default-from@^7.8.3": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.16.7.tgz" - integrity sha512-4C3E4NsrLOgftKaTYTULhHsuQrGv3FHrBzOMDiS7UYKIpgGBkAdawg4h+EI8zPeK9M0fiIIh72hIwsI24K7MbA== +"@babel/plugin-syntax-export-default-from@^7.18.6", "@babel/plugin-syntax-export-default-from@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.22.5.tgz#ac3a24b362a04415a017ab96b9b4483d0e2a6e44" + integrity sha512-ODAqWWXB/yReh/jVQDag/3/tl6lgBueQkk/TcfW/59Oykm4c8a55XloX0CTk2k2VJiFWMgHby9xNX29IbCv9dQ== dependencies: - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-export-namespace-from@^7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz#028964a9ba80dbc094c915c487ad7c4e7a66465a" integrity sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q== dependencies: "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-import-assertions@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.18.6.tgz#cd6190500a4fa2fe31990a963ffab4b63e4505e4" - integrity sha512-/DU3RXad9+bZwrgWJQKbr39gYbJpLJHezqEzRzi/BHRlJ9zsQb4CK2CA/5apllXNomwA1qHwzvHl+AdEmC5krQ== + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.22.5.tgz#07d252e2aa0bc6125567f742cd58619cb14dce98" + integrity sha512-rdV97N7KqsRzeNGoWUOK6yUsWarLjE5Su/Snk9IYPU9CwkWHs4t+rTGOvffTR8XGkJMTAdLfO0xVnXm8wugIJg== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-import-meta@^7.8.3": version "7.10.4" @@ -833,63 +611,63 @@ "@babel/plugin-syntax-json-strings@^7.8.0", "@babel/plugin-syntax-json-strings@^7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-jsx@^7.17.12": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.17.12.tgz" - integrity sha512-spyY3E3AURfxh/RHtjx5j6hs8am5NbUBGfcZ2vB3uShSpZdQyXSf5rR5Mk76vbtlAZOelyVQ71Fg0x9SG4fsog== +"@babel/plugin-syntax-jsx@^7.22.5": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz#a6b68e84fb76e759fc3b93e901876ffabbe1d918" + integrity sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-logical-assignment-operators@^7.10.4", "@babel/plugin-syntax-logical-assignment-operators@^7.8.3": version "7.10.4" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator@^7.8.0", "@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-numeric-separator@^7.10.4", "@babel/plugin-syntax-numeric-separator@^7.8.0", "@babel/plugin-syntax-numeric-separator@^7.8.3": version "7.10.4" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-object-rest-spread@^7.8.0", "@babel/plugin-syntax-object-rest-spread@^7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-optional-catch-binding@^7.8.0", "@babel/plugin-syntax-optional-catch-binding@^7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-optional-chaining@^7.8.0", "@babel/plugin-syntax-optional-chaining@^7.8.3": version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-private-property-in-object@^7.14.5": version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" @@ -901,453 +679,260 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-typescript@^7.18.6", "@babel/plugin-syntax-typescript@^7.7.2": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.18.6.tgz#1c09cd25795c7c2b8a4ba9ae49394576d4133285" - integrity sha512-mAWAuq4rvOepWCBid55JuRNvpTNf2UGVgoz4JV0fXEKolsVZDzsa4NqCef758WZJj/GDu0gVGItjKFiClTAmZA== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-arrow-functions@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.18.6.tgz#19063fcf8771ec7b31d742339dac62433d0611fe" - integrity sha512-9S9X9RUefzrsHZmKMbDXxweEH+YlE8JJEuat9FdvW9Qh1cw7W64jELCtWNkPBPX5En45uy28KGvA/AySqUh8CQ== +"@babel/plugin-syntax-typescript@^7.22.5", "@babel/plugin-syntax-typescript@^7.7.2": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz#aac8d383b062c5072c647a31ef990c1d0af90272" + integrity sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-arrow-functions@^7.8.3": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.17.12.tgz" - integrity sha512-PHln3CNi/49V+mza4xMwrg+WGYevSF1oaiXaC2EQfdp4HWlSjRsrDXWJiQBKpP7749u6vQ9mcry2uuFOv5CXvA== +"@babel/plugin-transform-arrow-functions@^7.18.6", "@babel/plugin-transform-arrow-functions@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.22.5.tgz#e5ba566d0c58a5b2ba2a8b795450641950b71958" + integrity sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-async-to-generator@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.18.6.tgz#ccda3d1ab9d5ced5265fdb13f1882d5476c71615" - integrity sha512-ARE5wZLKnTgPW7/1ftQmSi1CmkqqHo2DNmtztFhvgtOWSDfq0Cq9/9L+KnZNYSNrydBekhW3rwShduf59RoXag== +"@babel/plugin-transform-async-to-generator@^7.18.6", "@babel/plugin-transform-async-to-generator@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.22.5.tgz#c7a85f44e46f8952f6d27fe57c2ed3cc084c3775" + integrity sha512-b1A8D8ZzE/VhNDoV1MSJTnpKkCG5bJo+19R4o4oy03zM7ws8yEMK755j61Dc3EyvdysbqH5BOOTquJ7ZX9C6vQ== dependencies: - "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-remap-async-to-generator" "^7.18.6" + "@babel/helper-module-imports" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-remap-async-to-generator" "^7.22.5" -"@babel/plugin-transform-async-to-generator@^7.8.3": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.17.12.tgz" - integrity sha512-J8dbrWIOO3orDzir57NRsjg4uxucvhby0L/KZuGsWDj0g7twWK3g7JhJhOrXtuXiw8MeiSdJ3E0OW9H8LYEzLQ== +"@babel/plugin-transform-block-scoped-functions@^7.18.6", "@babel/plugin-transform-block-scoped-functions@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.22.5.tgz#27978075bfaeb9fa586d3cb63a3d30c1de580024" + integrity sha512-tdXZ2UdknEKQWKJP1KMNmuF5Lx3MymtMN/pvA+p/VEkhK8jVcQ1fzSy8KM9qRYhAf2/lV33hoMPKI/xaI9sADA== dependencies: - "@babel/helper-module-imports" "^7.16.7" - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/helper-remap-async-to-generator" "^7.16.8" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-block-scoped-functions@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.18.6.tgz#9187bf4ba302635b9d70d986ad70f038726216a8" - integrity sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ== +"@babel/plugin-transform-block-scoping@^7.18.9", "@babel/plugin-transform-block-scoping@^7.8.3": + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.22.10.tgz#88a1dccc3383899eb5e660534a76a22ecee64faa" + integrity sha512-1+kVpGAOOI1Albt6Vse7c8pHzcZQdQKW+wJH+g8mCaszOdDVwRXa/slHPqIw+oJAJANTKDMuM2cBdV0Dg618Vg== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-block-scoped-functions@^7.8.3": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.7.tgz" - integrity sha512-JUuzlzmF40Z9cXyytcbZEZKckgrQzChbQJw/5PuEHYeqzCsvebDx0K0jWnIIVcmmDOAVctCgnYs0pMcrYj2zJg== +"@babel/plugin-transform-classes@^7.18.9", "@babel/plugin-transform-classes@^7.9.5": + version "7.22.6" + resolved "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.22.6.tgz#e04d7d804ed5b8501311293d1a0e6d43e94c3363" + integrity sha512-58EgM6nuPNG6Py4Z3zSuu0xWu2VfodiMi72Jt5Kj2FECmaYk1RrTXA45z6KBFsu9tRgwQDwIiY4FXTt+YsSFAQ== dependencies: - "@babel/helper-plugin-utils" "^7.16.7" - -"@babel/plugin-transform-block-scoping@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.18.9.tgz#f9b7e018ac3f373c81452d6ada8bd5a18928926d" - integrity sha512-5sDIJRV1KtQVEbt/EIBwGy4T01uYIo4KRB3VUqzkhrAIOGx7AoctL9+Ux88btY0zXdDyPJ9mW+bg+v+XEkGmtw== - dependencies: - "@babel/helper-plugin-utils" "^7.18.9" - -"@babel/plugin-transform-block-scoping@^7.8.3": - version "7.18.4" - resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.18.4.tgz" - integrity sha512-+Hq10ye+jlvLEogSOtq4mKvtk7qwcUQ1f0Mrueai866C82f844Yom2cttfJdMdqRLTxWpsbfbkIkOIfovyUQXw== - dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - -"@babel/plugin-transform-classes@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.18.9.tgz#90818efc5b9746879b869d5ce83eb2aa48bbc3da" - integrity sha512-EkRQxsxoytpTlKJmSPYrsOMjCILacAjtSVkd4gChEe2kXjFCun3yohhW5I7plXJhCemM0gKsaGMcO8tinvCA5g== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.18.9" - "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.9" - "@babel/helper-replace-supers" "^7.18.9" - "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-compilation-targets" "^7.22.6" + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-function-name" "^7.22.5" + "@babel/helper-optimise-call-expression" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" globals "^11.1.0" -"@babel/plugin-transform-classes@^7.9.5": - version "7.18.4" - resolved "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.18.4.tgz" - integrity sha512-e42NSG2mlKWgxKUAD9EJJSkZxR67+wZqzNxLSpc51T8tRU5SLFHsPmgYR5yr7sdgX4u+iHA1C5VafJ6AyImV3A== - dependencies: - "@babel/helper-annotate-as-pure" "^7.16.7" - "@babel/helper-environment-visitor" "^7.18.2" - "@babel/helper-function-name" "^7.17.9" - "@babel/helper-optimise-call-expression" "^7.16.7" - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/helper-replace-supers" "^7.18.2" - "@babel/helper-split-export-declaration" "^7.16.7" - globals "^11.1.0" - -"@babel/plugin-transform-computed-properties@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.18.9.tgz#2357a8224d402dad623caf6259b611e56aec746e" - integrity sha512-+i0ZU1bCDymKakLxn5srGHrsAPRELC2WIbzwjLhHW9SIE1cPYkLCL0NlnXMZaM1vhfgA2+M7hySk42VBvrkBRw== - dependencies: - "@babel/helper-plugin-utils" "^7.18.9" - -"@babel/plugin-transform-computed-properties@^7.8.3": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.17.12.tgz" - integrity sha512-a7XINeplB5cQUWMg1E/GI1tFz3LfK021IjV1rj1ypE+R7jHm+pIHmHl25VNkZxtx9uuYp7ThGk8fur1HHG7PgQ== - dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - -"@babel/plugin-transform-destructuring@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.18.9.tgz#68906549c021cb231bee1db21d3b5b095f8ee292" - integrity sha512-p5VCYNddPLkZTq4XymQIaIfZNJwT9YsjkPOhkVEqt6QIpQFZVM9IltqqYpOEkJoN1DPznmxUDyZ5CTZs/ZCuHA== - dependencies: - "@babel/helper-plugin-utils" "^7.18.9" - -"@babel/plugin-transform-destructuring@^7.9.5": - version "7.18.0" - resolved "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.18.0.tgz" - integrity sha512-Mo69klS79z6KEfrLg/1WkmVnB8javh75HX4pi2btjvlIoasuxilEyjtsQW6XPrubNd7AQy0MMaNIaQE4e7+PQw== - dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - -"@babel/plugin-transform-dotall-regex@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.18.6.tgz#b286b3e7aae6c7b861e45bed0a2fafd6b1a4fef8" - integrity sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-dotall-regex@^7.4.4", "@babel/plugin-transform-dotall-regex@^7.8.3": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.7.tgz" - integrity sha512-Lyttaao2SjZF6Pf4vk1dVKv8YypMpomAbygW+mU5cYP3S5cWTfCJjG8xV6CFdzGFlfWK81IjL9viiTvpb6G7gQ== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.16.7" - "@babel/helper-plugin-utils" "^7.16.7" - -"@babel/plugin-transform-duplicate-keys@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.18.9.tgz#687f15ee3cdad6d85191eb2a372c4528eaa0ae0e" - integrity sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw== - dependencies: - "@babel/helper-plugin-utils" "^7.18.9" - -"@babel/plugin-transform-duplicate-keys@^7.8.3": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.17.12.tgz" - integrity sha512-EA5eYFUG6xeerdabina/xIoB95jJ17mAkR8ivx6ZSu9frKShBjpOGZPn511MTDTkiCO+zXnzNczvUM69YSf3Zw== - dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - -"@babel/plugin-transform-exponentiation-operator@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.18.6.tgz#421c705f4521888c65e91fdd1af951bfefd4dacd" - integrity sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw== - dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-exponentiation-operator@^7.8.3": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.7.tgz" - integrity sha512-8UYLSlyLgRixQvlYH3J2ekXFHDFLQutdy7FfFAMm3CPZ6q9wHCwnUyiXpQCe3gVVnQlHc5nsuiEVziteRNTXEA== - dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.16.7" - "@babel/helper-plugin-utils" "^7.16.7" - -"@babel/plugin-transform-for-of@^7.18.8": - version "7.18.8" - resolved "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.18.8.tgz#6ef8a50b244eb6a0bdbad0c7c61877e4e30097c1" - integrity sha512-yEfTRnjuskWYo0k1mHUqrVWaZwrdq8AYbfrpqULOJOaucGSp4mNMVps+YtA8byoevxS/urwU75vyhQIxcCgiBQ== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-for-of@^7.9.0": - version "7.18.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.18.1.tgz" - integrity sha512-+TTB5XwvJ5hZbO8xvl2H4XaMDOAK57zF4miuC9qQJgysPNEAZZ9Z69rdF5LJkozGdZrjBIUAIyKUWRMmebI7vg== +"@babel/plugin-transform-computed-properties@^7.18.9", "@babel/plugin-transform-computed-properties@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.22.5.tgz#cd1e994bf9f316bd1c2dafcd02063ec261bb3869" + integrity sha512-4GHWBgRf0krxPX+AaPtgBAlTgTeZmqDynokHOX7aqqAB4tHs3U2Y02zH6ETFdLZGcg9UQSD1WCmkVrE9ErHeOg== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/template" "^7.22.5" -"@babel/plugin-transform-function-name@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.18.9.tgz#cc354f8234e62968946c61a46d6365440fc764e0" - integrity sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ== +"@babel/plugin-transform-destructuring@^7.18.9", "@babel/plugin-transform-destructuring@^7.9.5": + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.22.10.tgz#38e2273814a58c810b6c34ea293be4973c4eb5e2" + integrity sha512-dPJrL0VOyxqLM9sritNbMSGx/teueHF/htMKrPT7DNxccXxRDPYqlgPFFdr8u+F+qUZOkZoXue/6rL5O5GduEw== dependencies: - "@babel/helper-compilation-targets" "^7.18.9" - "@babel/helper-function-name" "^7.18.9" - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-function-name@^7.8.3": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.7.tgz" - integrity sha512-SU/C68YVwTRxqWj5kgsbKINakGag0KTgq9f2iZEXdStoAbOzLHEBRYzImmA6yFo8YZhJVflvXmIHUO7GWHmxxA== +"@babel/plugin-transform-dotall-regex@^7.18.6", "@babel/plugin-transform-dotall-regex@^7.4.4", "@babel/plugin-transform-dotall-regex@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.22.5.tgz#dbb4f0e45766eb544e193fb00e65a1dd3b2a4165" + integrity sha512-5/Yk9QxCQCl+sOIB1WelKnVRxTJDSAIxtJLL2/pqL14ZVlbH0fUQUZa/T5/UnQtBNgghR7mfB8ERBKyKPCi7Vw== dependencies: - "@babel/helper-compilation-targets" "^7.16.7" - "@babel/helper-function-name" "^7.16.7" - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-create-regexp-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-literals@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.18.9.tgz#72796fdbef80e56fba3c6a699d54f0de557444bc" - integrity sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg== +"@babel/plugin-transform-duplicate-keys@^7.18.9", "@babel/plugin-transform-duplicate-keys@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.22.5.tgz#b6e6428d9416f5f0bba19c70d1e6e7e0b88ab285" + integrity sha512-dEnYD+9BBgld5VBXHnF/DbYGp3fqGMsyxKbtD1mDyIA7AkTSpKXFhCVuj/oQVOoALfBs77DudA0BE4d5mcpmqw== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-literals@^7.8.3": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.17.12.tgz" - integrity sha512-8iRkvaTjJciWycPIZ9k9duu663FT7VrBdNqNgxnVXEFwOIp55JWcZd23VBRySYbnS3PwQ3rGiabJBBBGj5APmQ== +"@babel/plugin-transform-exponentiation-operator@^7.18.6", "@babel/plugin-transform-exponentiation-operator@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.22.5.tgz#402432ad544a1f9a480da865fda26be653e48f6a" + integrity sha512-vIpJFNM/FjZ4rh1myqIya9jXwrwwgFRHPjT3DkUA9ZLHuzox8jiXkOLvwm1H+PQIP3CqfC++WPKeuDi0Sjdj1g== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-member-expression-literals@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.18.6.tgz#ac9fdc1a118620ac49b7e7a5d2dc177a1bfee88e" - integrity sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA== +"@babel/plugin-transform-for-of@^7.18.8", "@babel/plugin-transform-for-of@^7.9.0": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.22.5.tgz#ab1b8a200a8f990137aff9a084f8de4099ab173f" + integrity sha512-3kxQjX1dU9uudwSshyLeEipvrLjBCVthCgeTp6CzE/9JYrlAIaeekVxRpCWsDDfYTfRZRoCeZatCQvwo+wvK8A== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-member-expression-literals@^7.8.3": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.7.tgz" - integrity sha512-mBruRMbktKQwbxaJof32LT9KLy2f3gH+27a5XSuXo6h7R3vqltl0PgZ80C8ZMKw98Bf8bqt6BEVi3svOh2PzMw== +"@babel/plugin-transform-function-name@^7.18.9", "@babel/plugin-transform-function-name@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.22.5.tgz#935189af68b01898e0d6d99658db6b164205c143" + integrity sha512-UIzQNMS0p0HHiQm3oelztj+ECwFnj+ZRV4KnguvlsD2of1whUeM6o7wGNj6oLwcDoAXQ8gEqfgC24D+VdIcevg== dependencies: - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-compilation-targets" "^7.22.5" + "@babel/helper-function-name" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-modules-amd@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.18.6.tgz#8c91f8c5115d2202f277549848874027d7172d21" - integrity sha512-Pra5aXsmTsOnjM3IajS8rTaLCy++nGM4v3YR4esk5PCsyg9z8NA5oQLwxzMUtDBd8F+UmVza3VxoAaWCbzH1rg== +"@babel/plugin-transform-literals@^7.18.9", "@babel/plugin-transform-literals@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.22.5.tgz#e9341f4b5a167952576e23db8d435849b1dd7920" + integrity sha512-fTLj4D79M+mepcw3dgFBTIDYpbcB9Sm0bpm4ppXPaO+U+PKFFyV9MGRvS0gvGw62sd10kT5lRMKXAADb9pWy8g== dependencies: - "@babel/helper-module-transforms" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - babel-plugin-dynamic-import-node "^2.3.3" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-modules-amd@^7.9.6": - version "7.18.0" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.18.0.tgz" - integrity sha512-h8FjOlYmdZwl7Xm2Ug4iX2j7Qy63NANI+NQVWQzv6r25fqgg7k2dZl03p95kvqNclglHs4FZ+isv4p1uXMA+QA== +"@babel/plugin-transform-member-expression-literals@^7.18.6", "@babel/plugin-transform-member-expression-literals@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.22.5.tgz#4fcc9050eded981a468347dd374539ed3e058def" + integrity sha512-RZEdkNtzzYCFl9SE9ATaUMTj2hqMb4StarOJLrZRbqqU4HSBE7UlBw9WBWQiDzrJZJdUWiMTVDI6Gv/8DPvfew== dependencies: - "@babel/helper-module-transforms" "^7.18.0" - "@babel/helper-plugin-utils" "^7.17.12" - babel-plugin-dynamic-import-node "^2.3.3" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-modules-commonjs@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.18.6.tgz#afd243afba166cca69892e24a8fd8c9f2ca87883" - integrity sha512-Qfv2ZOWikpvmedXQJDSbxNqy7Xr/j2Y8/KfijM0iJyKkBTmWuvCA1yeH1yDM7NJhBW/2aXxeucLj6i80/LAJ/Q== +"@babel/plugin-transform-modules-amd@^7.18.6", "@babel/plugin-transform-modules-amd@^7.9.6": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.22.5.tgz#4e045f55dcf98afd00f85691a68fc0780704f526" + integrity sha512-R+PTfLTcYEmb1+kK7FNkhQ1gP4KgjpSO6HfH9+f8/yfp2Nt3ggBjiVpRwmwTlfqZLafYKJACy36yDXlEmI9HjQ== dependencies: - "@babel/helper-module-transforms" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-simple-access" "^7.18.6" - babel-plugin-dynamic-import-node "^2.3.3" + "@babel/helper-module-transforms" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-modules-commonjs@^7.9.6": - version "7.18.2" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.18.2.tgz" - integrity sha512-f5A865gFPAJAEE0K7F/+nm5CmAE3y8AWlMBG9unu5j9+tk50UQVK0QS8RNxSp7MJf0wh97uYyLWt3Zvu71zyOQ== +"@babel/plugin-transform-modules-commonjs@^7.18.6", "@babel/plugin-transform-modules-commonjs@^7.22.5", "@babel/plugin-transform-modules-commonjs@^7.9.6": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.22.5.tgz#7d9875908d19b8c0536085af7b053fd5bd651bfa" + integrity sha512-B4pzOXj+ONRmuaQTg05b3y/4DuFz3WcCNAXPLb2Q0GT0TrGKGxNKV4jwsXts+StaM0LQczZbOpj8o1DLPDJIiA== dependencies: - "@babel/helper-module-transforms" "^7.18.0" - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/helper-simple-access" "^7.18.2" - babel-plugin-dynamic-import-node "^2.3.3" + "@babel/helper-module-transforms" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-simple-access" "^7.22.5" -"@babel/plugin-transform-modules-systemjs@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.18.9.tgz#545df284a7ac6a05125e3e405e536c5853099a06" - integrity sha512-zY/VSIbbqtoRoJKo2cDTewL364jSlZGvn0LKOf9ntbfxOvjfmyrdtEEOAdswOswhZEb8UH3jDkCKHd1sPgsS0A== +"@babel/plugin-transform-modules-systemjs@^7.18.9", "@babel/plugin-transform-modules-systemjs@^7.9.6": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.22.5.tgz#18c31410b5e579a0092638f95c896c2a98a5d496" + integrity sha512-emtEpoaTMsOs6Tzz+nbmcePl6AKVtS1yC4YNAeMun9U8YCsgadPNxnOPQ8GhHFB2qdx+LZu9LgoC0Lthuu05DQ== dependencies: - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-module-transforms" "^7.18.9" - "@babel/helper-plugin-utils" "^7.18.9" - "@babel/helper-validator-identifier" "^7.18.6" - babel-plugin-dynamic-import-node "^2.3.3" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-module-transforms" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.5" -"@babel/plugin-transform-modules-systemjs@^7.9.6": - version "7.18.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.18.5.tgz" - integrity sha512-SEewrhPpcqMF1V7DhnEbhVJLrC+nnYfe1E0piZMZXBpxi9WvZqWGwpsk7JYP7wPWeqaBh4gyKlBhHJu3uz5g4Q== +"@babel/plugin-transform-modules-umd@^7.18.6", "@babel/plugin-transform-modules-umd@^7.9.0": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.22.5.tgz#4694ae40a87b1745e3775b6a7fe96400315d4f98" + integrity sha512-+S6kzefN/E1vkSsKx8kmQuqeQsvCKCd1fraCM7zXm4SFoggI099Tr4G8U81+5gtMdUeMQ4ipdQffbKLX0/7dBQ== dependencies: - "@babel/helper-hoist-variables" "^7.16.7" - "@babel/helper-module-transforms" "^7.18.0" - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/helper-validator-identifier" "^7.16.7" - babel-plugin-dynamic-import-node "^2.3.3" + "@babel/helper-module-transforms" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-modules-umd@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.6.tgz#81d3832d6034b75b54e62821ba58f28ed0aab4b9" - integrity sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ== +"@babel/plugin-transform-named-capturing-groups-regex@^7.18.6", "@babel/plugin-transform-named-capturing-groups-regex@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz#67fe18ee8ce02d57c855185e27e3dc959b2e991f" + integrity sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ== dependencies: - "@babel/helper-module-transforms" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-create-regexp-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-modules-umd@^7.9.0": - version "7.18.0" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.0.tgz" - integrity sha512-d/zZ8I3BWli1tmROLxXLc9A6YXvGK8egMxHp+E/rRwMh1Kip0AP77VwZae3snEJ33iiWwvNv2+UIIhfalqhzZA== +"@babel/plugin-transform-new-target@^7.18.6", "@babel/plugin-transform-new-target@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.22.5.tgz#1b248acea54ce44ea06dfd37247ba089fcf9758d" + integrity sha512-AsF7K0Fx/cNKVyk3a+DW0JLo+Ua598/NxMRvxDnkpCIGFh43+h/v2xyhRUYf6oD8gE4QtL83C7zZVghMjHd+iw== dependencies: - "@babel/helper-module-transforms" "^7.18.0" - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-named-capturing-groups-regex@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.18.6.tgz#c89bfbc7cc6805d692f3a49bc5fc1b630007246d" - integrity sha512-UmEOGF8XgaIqD74bC8g7iV3RYj8lMf0Bw7NJzvnS9qQhM4mg+1WHKotUIdjxgD2RGrgFLZZPCFPFj3P/kVDYhg== +"@babel/plugin-transform-object-super@^7.18.6", "@babel/plugin-transform-object-super@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.22.5.tgz#794a8d2fcb5d0835af722173c1a9d704f44e218c" + integrity sha512-klXqyaT9trSjIUrcsYIfETAzmOEZL3cBYqOYLJxBHfMFFggmXOv+NYSX/Jbs9mzMVESw/WycLFPRx8ba/b2Ipw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.5" -"@babel/plugin-transform-named-capturing-groups-regex@^7.8.3": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.17.12.tgz" - integrity sha512-vWoWFM5CKaTeHrdUJ/3SIOTRV+MBVGybOC9mhJkaprGNt5demMymDW24yC74avb915/mIRe3TgNb/d8idvnCRA== +"@babel/plugin-transform-optional-chaining@^7.22.5": + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.10.tgz#076d28a7e074392e840d4ae587d83445bac0372a" + integrity sha512-MMkQqZAZ+MGj+jGTG3OTuhKeBpNcO+0oCEbrGNEaOmiEn+1MzRyQlYsruGiU8RTK3zV6XwrVJTmwiDOyYK6J9g== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.17.12" - "@babel/helper-plugin-utils" "^7.17.12" - -"@babel/plugin-transform-new-target@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.18.6.tgz#d128f376ae200477f37c4ddfcc722a8a1b3246a8" - integrity sha512-DjwFA/9Iu3Z+vrAn+8pBUGcjhxKguSMlsFqeCKbhb9BAV756v0krzVK04CRDi/4aqmk8BsHb4a/gFcaA5joXRw== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-new-target@^7.8.3": - version "7.18.5" - resolved "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.18.5.tgz" - integrity sha512-TuRL5uGW4KXU6OsRj+mLp9BM7pO8e7SGNTEokQRRxHFkXYMFiy2jlKSZPFtI/mKORDzciH+hneskcSOp0gU8hg== - dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - -"@babel/plugin-transform-object-super@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.18.6.tgz#fb3c6ccdd15939b6ff7939944b51971ddc35912c" - integrity sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-replace-supers" "^7.18.6" - -"@babel/plugin-transform-object-super@^7.8.3": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.7.tgz" - integrity sha512-14J1feiQVWaGvRxj2WjyMuXS2jsBkgB3MdSN5HuC2G5nRspa5RK9COcs82Pwy5BuGcjb+fYaUj94mYcOj7rCvw== - dependencies: - "@babel/helper-plugin-utils" "^7.16.7" - "@babel/helper-replace-supers" "^7.16.7" - -"@babel/plugin-transform-parameters@^7.17.12", "@babel/plugin-transform-parameters@^7.9.5": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.17.12.tgz" - integrity sha512-6qW4rWo1cyCdq1FkYri7AHpauchbGLXpdwnYsfxFb+KtddHENfsY5JZb35xUwkK5opOLcJ3BNd2l7PhRYGlwIA== - dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - -"@babel/plugin-transform-parameters@^7.18.8": - version "7.18.8" - resolved "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.18.8.tgz#ee9f1a0ce6d78af58d0956a9378ea3427cccb48a" - integrity sha512-ivfbE3X2Ss+Fj8nnXvKJS6sjRG4gzwPMsP+taZC+ZzEGjAYlvENixmt1sZ5Ca6tWls+BlKSGKPJ6OOXvXCbkFg== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" -"@babel/plugin-transform-property-literals@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.18.6.tgz#e22498903a483448e94e032e9bbb9c5ccbfc93a3" - integrity sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg== +"@babel/plugin-transform-parameters@^7.18.8", "@babel/plugin-transform-parameters@^7.20.7", "@babel/plugin-transform-parameters@^7.9.5": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.5.tgz#c3542dd3c39b42c8069936e48717a8d179d63a18" + integrity sha512-AVkFUBurORBREOmHRKo06FjHYgjrabpdqRSwq6+C7R5iTCZOsM4QbcB27St0a4U6fffyAOqh3s/qEfybAhfivg== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-property-literals@^7.8.3": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.7.tgz" - integrity sha512-z4FGr9NMGdoIl1RqavCqGG+ZuYjfZ/hkCIeuH6Do7tXmSm0ls11nYVSJqFEUOSJbDab5wC6lRE/w6YjVcr6Hqw== +"@babel/plugin-transform-property-literals@^7.18.6", "@babel/plugin-transform-property-literals@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.22.5.tgz#b5ddabd73a4f7f26cd0e20f5db48290b88732766" + integrity sha512-TiOArgddK3mK/x1Qwf5hay2pxI6wCZnvQqrFSqbtg1GLl2JcNMitVH/YnqjP+M31pLUeTfzY1HAXFDnUBV30rQ== dependencies: - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-transform-react-display-name@^7.8.3": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.16.7.tgz" - integrity sha512-qgIg8BcZgd0G/Cz916D5+9kqX0c7nPZyXaP8R2tLNN5tkyIZdG5fEwBrxwplzSnjC1jvQmyMNVwUCZPcbGY7Pg== + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.22.5.tgz#3c4326f9fce31c7968d6cb9debcaf32d9e279a2b" + integrity sha512-PVk3WPYudRF5z4GKMEYUrLjPl38fJSKNaEOkFuoprioowGuWN6w2RKznuFNSlJx7pzzXXStPUnNSOEO0jL5EVw== dependencies: - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-transform-react-jsx-development@^7.9.0": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.16.7.tgz" - integrity sha512-RMvQWvpla+xy6MlBpPlrKZCMRs2AGiHOGHY3xRwl0pEeim348dDyxeH4xBsMPbIMhujeq7ihE702eM2Ew0Wo+A== + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.22.5.tgz#e716b6edbef972a92165cd69d92f1255f7e73e87" + integrity sha512-bDhuzwWMuInwCYeDeMzyi7TaBgRQei6DqxhbyniL7/VG4RSS7HtSL2QbY4eESy1KJqlWt8g3xeEBGPuo+XqC8A== dependencies: - "@babel/plugin-transform-react-jsx" "^7.16.7" + "@babel/plugin-transform-react-jsx" "^7.22.5" "@babel/plugin-transform-react-jsx-self@^7.9.0": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.17.12.tgz" - integrity sha512-7S9G2B44EnYOx74mue02t1uD8ckWZ/ee6Uz/qfdzc35uWHX5NgRy9i+iJSb2LFRgMd+QV9zNcStQaazzzZ3n3Q== + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.22.5.tgz#ca2fdc11bc20d4d46de01137318b13d04e481d8e" + integrity sha512-nTh2ogNUtxbiSbxaT4Ds6aXnXEipHweN9YRgOX/oNXdf0cCrGn/+2LozFa3lnPV5D90MkjhgckCPBrsoSc1a7g== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-transform-react-jsx-source@^7.9.0": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.16.7.tgz" - integrity sha512-rONFiQz9vgbsnaMtQlZCjIRwhJvlrPET8TabIUK2hzlXw9B9s2Ieaxte1SCOOXMbWRHodbKixNf3BLcWVOQ8Bw== + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.22.5.tgz#49af1615bfdf6ed9d3e9e43e425e0b2b65d15b6c" + integrity sha512-yIiRO6yobeEIaI0RTbIr8iAK9FcBHLtZq0S89ZPjDLQXBA4xvghaKqI0etp/tF3htTM0sazJKKLz9oEiGRtu7w== dependencies: - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-react-jsx@^7.16.7", "@babel/plugin-transform-react-jsx@^7.9.4": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.17.12.tgz" - integrity sha512-Lcaw8bxd1DKht3thfD4A12dqo1X16he1Lm8rIv8sTwjAYNInRS1qHa9aJoqvzpscItXvftKDCfaEQzwoVyXpEQ== +"@babel/plugin-transform-react-jsx@^7.22.5", "@babel/plugin-transform-react-jsx@^7.9.4": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.22.5.tgz#932c291eb6dd1153359e2a90cb5e557dcf068416" + integrity sha512-rog5gZaVbUip5iWDMTYbVM15XQq+RkUKhET/IHR6oizR+JEoN6CAfTTuHcK4vwUyzca30qqHqEpzBOnaRMWYMA== dependencies: - "@babel/helper-annotate-as-pure" "^7.16.7" - "@babel/helper-module-imports" "^7.16.7" - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/plugin-syntax-jsx" "^7.17.12" - "@babel/types" "^7.17.12" + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-module-imports" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-jsx" "^7.22.5" + "@babel/types" "^7.22.5" -"@babel/plugin-transform-regenerator@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.18.6.tgz#585c66cb84d4b4bf72519a34cfce761b8676ca73" - integrity sha512-poqRI2+qiSdeldcz4wTSTXBRryoq3Gc70ye7m7UD5Ww0nE29IXqMl6r7Nd15WBgRd74vloEMlShtH6CKxVzfmQ== +"@babel/plugin-transform-regenerator@^7.18.6", "@babel/plugin-transform-regenerator@^7.8.7": + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.22.10.tgz#8ceef3bd7375c4db7652878b0241b2be5d0c3cca" + integrity sha512-F28b1mDt8KcT5bUyJc/U9nwzw6cV+UmTeRlXYIl2TNqMMJif0Jeey9/RQ3C4NOd2zp0/TRsDns9ttj2L523rsw== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - regenerator-transform "^0.15.0" + "@babel/helper-plugin-utils" "^7.22.5" + regenerator-transform "^0.15.2" -"@babel/plugin-transform-regenerator@^7.8.7": - version "7.18.0" - resolved "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.18.0.tgz" - integrity sha512-C8YdRw9uzx25HSIzwA7EM7YP0FhCe5wNvJbZzjVNHHPGVcDJ3Aie+qGYYdS1oVQgn+B3eAIJbWFLrJ4Jipv7nw== +"@babel/plugin-transform-reserved-words@^7.18.6", "@babel/plugin-transform-reserved-words@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.22.5.tgz#832cd35b81c287c4bcd09ce03e22199641f964fb" + integrity sha512-DTtGKFRQUDm8svigJzZHzb/2xatPc6TzNvAIJ5GqOKDsGFYgAskjRulbR/vGsPKq3OPqtexnz327qYpP57RFyA== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - regenerator-transform "^0.15.0" - -"@babel/plugin-transform-reserved-words@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.18.6.tgz#b1abd8ebf8edaa5f7fe6bbb8d2133d23b6a6f76a" - integrity sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-reserved-words@^7.8.3": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.17.12.tgz" - integrity sha512-1KYqwbJV3Co03NIi14uEHW8P50Md6KqFgt0FfpHdK6oyAHQVTosgPuPSiWud1HX0oYJ1hGRRlk0fP87jFpqXZA== - dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-transform-runtime@7.18.10": version "7.18.10" @@ -1363,7 +948,7 @@ "@babel/plugin-transform-runtime@7.9.6": version "7.9.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.9.6.tgz" + resolved "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.9.6.tgz#3ba804438ad0d880a17bca5eaa0cdf1edeedb2fd" integrity sha512-qcmiECD0mYOjOIt8YHNsAP1SxPooC/rDmfmiSK9BNY72EitdSc7l44WTEklaWuFtbOEBjNhWWyph/kOImbNJ4w== dependencies: "@babel/helper-module-imports" "^7.8.3" @@ -1371,109 +956,66 @@ resolve "^1.8.1" semver "^5.5.1" -"@babel/plugin-transform-shorthand-properties@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.18.6.tgz#6d6df7983d67b195289be24909e3f12a8f664dc9" - integrity sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw== +"@babel/plugin-transform-shorthand-properties@^7.18.6", "@babel/plugin-transform-shorthand-properties@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.22.5.tgz#6e277654be82b5559fc4b9f58088507c24f0c624" + integrity sha512-vM4fq9IXHscXVKzDv5itkO1X52SmdFBFcMIBZ2FRn2nqVYqw6dBexUgMvAjHW+KXpPPViD/Yo3GrDEBaRC0QYA== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-shorthand-properties@^7.8.3": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.7.tgz" - integrity sha512-hah2+FEnoRoATdIb05IOXf+4GzXYTq75TVhIn1PewihbpyrNWUt2JbudKQOETWw6QpLe+AIUpJ5MVLYTQbeeUg== +"@babel/plugin-transform-spread@^7.18.9", "@babel/plugin-transform-spread@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.22.5.tgz#6487fd29f229c95e284ba6c98d65eafb893fea6b" + integrity sha512-5ZzDQIGyvN4w8+dMmpohL6MBo+l2G7tfC/O2Dg7/hjpgeWvUx8FzfeOKxGog9IimPa4YekaQ9PlDqTLOljkcxg== dependencies: - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" -"@babel/plugin-transform-spread@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.18.9.tgz#6ea7a6297740f381c540ac56caf75b05b74fb664" - integrity sha512-39Q814wyoOPtIB/qGopNIL9xDChOE1pNU0ZY5dO0owhiVt/5kFm4li+/bBtwc7QotG0u5EPzqhZdjMtmqBqyQA== +"@babel/plugin-transform-sticky-regex@^7.18.6", "@babel/plugin-transform-sticky-regex@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.22.5.tgz#295aba1595bfc8197abd02eae5fc288c0deb26aa" + integrity sha512-zf7LuNpHG0iEeiyCNwX4j3gDg1jgt1k3ZdXBKbZSoA3BbGQGvMiSvfbZRR3Dr3aeJe3ooWFZxOOG3IRStYp2Bw== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" - "@babel/helper-skip-transparent-expression-wrappers" "^7.18.9" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-spread@^7.8.3": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.17.12.tgz" - integrity sha512-9pgmuQAtFi3lpNUstvG9nGfk9DkrdmWNp9KeKPFmuZCpEnxRzYlS8JgwPjYj+1AWDOSvoGN0H30p1cBOmT/Svg== +"@babel/plugin-transform-template-literals@^7.18.9", "@babel/plugin-transform-template-literals@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.22.5.tgz#8f38cf291e5f7a8e60e9f733193f0bcc10909bff" + integrity sha512-5ciOehRNf+EyUeewo8NkbQiUs4d6ZxiHo6BcBcnFlgiJfu16q0bQUw9Jvo0b0gBKFG1SMhDSjeKXSYuJLeFSMA== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-sticky-regex@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.18.6.tgz#c6706eb2b1524028e317720339583ad0f444adcc" - integrity sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-sticky-regex@^7.8.3": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.7.tgz" - integrity sha512-NJa0Bd/87QV5NZZzTuZG5BPJjLYadeSZ9fO6oOUoL4iQx+9EEuw/eEM92SrsT19Yc2jgB1u1hsjqDtH02c3Drw== - dependencies: - "@babel/helper-plugin-utils" "^7.16.7" - -"@babel/plugin-transform-template-literals@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.9.tgz#04ec6f10acdaa81846689d63fae117dd9c243a5e" - integrity sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA== +"@babel/plugin-transform-typeof-symbol@^7.18.9", "@babel/plugin-transform-typeof-symbol@^7.8.4": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.22.5.tgz#5e2ba478da4b603af8673ff7c54f75a97b716b34" + integrity sha512-bYkI5lMzL4kPii4HHEEChkD0rkc+nvnlR6+o/qdqR6zrm0Sv/nodmyLhlq2DO0YKLUNd2VePmPRjJXSBh9OIdA== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-template-literals@^7.8.3": - version "7.18.2" - resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.2.tgz" - integrity sha512-/cmuBVw9sZBGZVOMkpAEaVLwm4JmK2GZ1dFKOGGpMzEHWFmyZZ59lUU0PdRr8YNYeQdNzTDwuxP2X2gzydTc9g== +"@babel/plugin-transform-typescript@^7.22.5": + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.22.10.tgz#aadd98fab871f0bb5717bcc24c31aaaa455af923" + integrity sha512-7++c8I/ymsDo4QQBAgbraXLzIM6jmfao11KgIBEYZRReWzNWH9NtNgJcyrZiXsOPh523FQm6LfpLyy/U5fn46A== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - -"@babel/plugin-transform-typeof-symbol@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.18.9.tgz#c8cea68263e45addcd6afc9091429f80925762c0" - integrity sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw== - dependencies: - "@babel/helper-plugin-utils" "^7.18.9" - -"@babel/plugin-transform-typeof-symbol@^7.8.4": - version "7.17.12" - resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.17.12.tgz" - integrity sha512-Q8y+Jp7ZdtSPXCThB6zjQ74N3lj0f6TDh1Hnf5B+sYlzQ8i5Pjp8gW0My79iekSpT4WnI06blqP6DT0OmaXXmw== - dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - -"@babel/plugin-transform-typescript@^7.18.6": - version "7.18.12" - resolved "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.18.12.tgz#712e9a71b9e00fde9f8c0238e0cceee86ab2f8fd" - integrity sha512-2vjjam0cum0miPkenUbQswKowuxs/NjMwIKEq0zwegRxXk12C9YOF9STXnaUptITOtOJHKHpzvvWYOjbm6tc0w== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.18.9" - "@babel/helper-plugin-utils" "^7.18.9" - "@babel/plugin-syntax-typescript" "^7.18.6" + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-create-class-features-plugin" "^7.22.10" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-typescript" "^7.22.5" "@babel/plugin-transform-unicode-escapes@^7.18.10": - version "7.18.10" - resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.10.tgz#1ecfb0eda83d09bbcb77c09970c2dd55832aa246" - integrity sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ== - dependencies: - "@babel/helper-plugin-utils" "^7.18.9" - -"@babel/plugin-transform-unicode-regex@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.18.6.tgz#194317225d8c201bbae103364ffe9e2cea36cdca" - integrity sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA== + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.22.10.tgz#c723f380f40a2b2f57a62df24c9005834c8616d9" + integrity sha512-lRfaRKGZCBqDlRU3UIFovdp9c9mEvlylmpod0/OatICsSfuQ9YFthRo1tpTkGsklEefZdqlEFdY4A2dwTb6ohg== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-unicode-regex@^7.8.3": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.7.tgz" - integrity sha512-oC5tYYKw56HO75KZVLQ+R/Nl3Hro9kf8iG0hXoaHP7tjAyCpvqBiSNe6vGrZni1Z6MggmUOC6A7VP7AVmw225Q== +"@babel/plugin-transform-unicode-regex@^7.18.6", "@babel/plugin-transform-unicode-regex@^7.8.3": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.22.5.tgz#ce7e7bb3ef208c4ff67e02a22816656256d7a183" + integrity sha512-028laaOKptN5vHJf9/Arr/HiJekMd41hOEZYvNsrsXqJ7YPYuX2bQxh31fkZzGmq3YqHRJzYFFAVYvKfMPKqyg== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.16.7" - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-create-regexp-features-plugin" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" "@babel/preset-env@7.18.10": version "7.18.10" @@ -1558,7 +1100,7 @@ "@babel/preset-env@7.9.6": version "7.9.6" - resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.9.6.tgz" + resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.9.6.tgz#df063b276c6455ec6fcfc6e53aacc38da9b0aea6" integrity sha512-0gQJ9RTzO0heXOhzftog+a/WyOuqMrAIugVYxMYf83gh1CQaQDjMtsOpqOwXyDL/5JcWsrCm8l4ju8QC97O7EQ== dependencies: "@babel/compat-data" "^7.9.6" @@ -1623,9 +1165,9 @@ semver "^5.5.0" "@babel/preset-modules@^0.1.3", "@babel/preset-modules@^0.1.5": - version "0.1.5" - resolved "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz" - integrity sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA== + version "0.1.6" + resolved "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6.tgz#31bcdd8f19538437339d17af00d177d854d9d458" + integrity sha512-ID2yj6K/4lKfhuU3+EX4UvNbIt7eACFbHmNUjzA+ep+B5971CknnA/9DEWKbRokfbbtblxxxXFJJrH47UEAMVg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" @@ -1635,7 +1177,7 @@ "@babel/preset-react@7.9.4": version "7.9.4" - resolved "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.9.4.tgz" + resolved "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.9.4.tgz#c6c97693ac65b6b9c0b4f25b948a8f665463014d" integrity sha512-AxylVB3FXeOTQXNXyiuAQJSvss62FEotbX2Pzx3K/7c+MKJMdSg6Ose6QYllkdCFA8EInCJVw7M/o5QbLuA4ZQ== dependencies: "@babel/helper-plugin-utils" "^7.8.3" @@ -1646,18 +1188,20 @@ "@babel/plugin-transform-react-jsx-source" "^7.9.0" "@babel/preset-typescript@^7.18.6": - version "7.18.6" - resolved "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.18.6.tgz#ce64be3e63eddc44240c6358daefac17b3186399" - integrity sha512-s9ik86kXBAnD760aybBucdpnLsAt0jK1xqJn2juOn9lkOvSHV60os5hxoVJsPzMQxvnUJFAlkont2DvvaYEBtQ== + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.22.5.tgz#16367d8b01d640e9a507577ed4ee54e0101e51c8" + integrity sha512-YbPaal9LxztSGhmndR46FmAbkJ/1fAsw293tSU+I5E5h+cnJ3d4GTwyUgGYmOXJYdGA+uNePle4qbaRzj2NISQ== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-validator-option" "^7.18.6" - "@babel/plugin-transform-typescript" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-validator-option" "^7.22.5" + "@babel/plugin-syntax-jsx" "^7.22.5" + "@babel/plugin-transform-modules-commonjs" "^7.22.5" + "@babel/plugin-transform-typescript" "^7.22.5" -"@babel/register@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/register/-/register-7.18.9.tgz#1888b24bc28d5cc41c412feb015e9ff6b96e439c" - integrity sha512-ZlbnXDcNYHMR25ITwwNKT88JiaukkdVj/nG7r3wnuXkOTHc60Uy05PwMCPre0hSkY68E6zK3xz+vUJSP2jWmcw== +"@babel/register@^7.22.5": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/register/-/register-7.22.5.tgz#e4d8d0f615ea3233a27b5c6ada6750ee59559939" + integrity sha512-vV6pm/4CijSQ8Y47RH5SopXzursN35RQINfGJkmOlcpAtGuf94miFvIPhCKGQN7WGIcsgG1BHEX2KVdTYwTwUQ== dependencies: clone-deep "^4.0.1" find-cache-dir "^2.0.0" @@ -1665,39 +1209,28 @@ pirates "^4.0.5" source-map-support "^0.5.16" -"@babel/runtime@^7.11.2", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4": - version "7.18.3" - resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.3.tgz" - integrity sha512-38Y8f7YUhce/K7RMwTp7m0uCumpv9hZkitCbBClqQIow1qSbCvGkcegKOXpEWCQLfWmevgRiWokZ1GkpfhbZug== - dependencies: - regenerator-runtime "^0.13.4" +"@babel/regjsgen@^0.8.0": + version "0.8.0" + resolved "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" + integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== -"@babel/runtime@^7.18.9": - version "7.18.9" - resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a" - integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw== +"@babel/runtime@^7.11.2", "@babel/runtime@^7.18.9", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4": + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.10.tgz#ae3e9631fd947cb7e3610d3e9d8fef5f76696682" + integrity sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ== dependencies: - regenerator-runtime "^0.13.4" + regenerator-runtime "^0.14.0" -"@babel/template@^7.16.7", "@babel/template@^7.18.10", "@babel/template@^7.18.6", "@babel/template@^7.3.3": - version "7.18.10" - resolved "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz#6f9134835970d1dbf0835c0d100c9f38de0c5e71" - integrity sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA== +"@babel/template@^7.18.10", "@babel/template@^7.22.5", "@babel/template@^7.3.3", "@babel/template@^7.8.6": + version "7.22.5" + resolved "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz#0c8c4d944509875849bd0344ff0050756eefc6ec" + integrity sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw== dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/parser" "^7.18.10" - "@babel/types" "^7.18.10" - -"@babel/template@^7.8.6": - version "7.16.7" - resolved "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz" - integrity sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/parser" "^7.16.7" - "@babel/types" "^7.16.7" + "@babel/code-frame" "^7.22.5" + "@babel/parser" "^7.22.5" + "@babel/types" "^7.22.5" -"@babel/traverse@7.18.11", "@babel/traverse@^7.18.0", "@babel/traverse@^7.18.10", "@babel/traverse@^7.18.11", "@babel/traverse@^7.18.2", "@babel/traverse@^7.18.9", "@babel/traverse@^7.7.2": +"@babel/traverse@7.18.11": version "7.18.11" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.11.tgz#3d51f2afbd83ecf9912bcbb5c4d94e3d2ddaa16f" integrity sha512-TG9PiM2R/cWCAy6BPJKeHzNbu4lPzOSZpeMfeNErskGpTJx6trEvFaVCbDvpcxwy49BKWmEPwiW8mrysNiDvIQ== @@ -1713,23 +1246,23 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/traverse@^7.16.8", "@babel/traverse@^7.9.6": - version "7.18.5" - resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.5.tgz" - integrity sha512-aKXj1KT66sBj0vVzk6rEeAO6Z9aiiQ68wfDgge3nHhA/my6xMM/7HGQUNumKZaoa2qUPQ5whJG9aAifsxUKfLA== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.18.2" - "@babel/helper-environment-visitor" "^7.18.2" - "@babel/helper-function-name" "^7.17.9" - "@babel/helper-hoist-variables" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/parser" "^7.18.5" - "@babel/types" "^7.18.4" +"@babel/traverse@^7.18.10", "@babel/traverse@^7.22.10", "@babel/traverse@^7.7.2", "@babel/traverse@^7.9.6": + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.10.tgz#20252acb240e746d27c2e82b4484f199cf8141aa" + integrity sha512-Q/urqV4pRByiNNpb/f5OSv28ZlGJiFiiTh+GAHktbIrkPhPbl90+uW6SmpoLyZqutrg9AEaEf3Q/ZBRHBXgxig== + dependencies: + "@babel/code-frame" "^7.22.10" + "@babel/generator" "^7.22.10" + "@babel/helper-environment-visitor" "^7.22.5" + "@babel/helper-function-name" "^7.22.5" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/parser" "^7.22.10" + "@babel/types" "^7.22.10" debug "^4.1.0" globals "^11.1.0" -"@babel/types@7.18.10", "@babel/types@^7.0.0", "@babel/types@^7.16.7", "@babel/types@^7.17.0", "@babel/types@^7.18.0", "@babel/types@^7.18.10", "@babel/types@^7.18.2", "@babel/types@^7.18.4", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.3.0", "@babel/types@^7.3.3": +"@babel/types@7.18.10": version "7.18.10" resolved "https://registry.npmjs.org/@babel/types/-/types-7.18.10.tgz#4908e81b6b339ca7c6b7a555a5fc29446f26dde6" integrity sha512-MJvnbEiiNkpjo+LknnmRrqbY1GPUUggjv+wQVjetM/AONoupqRALB7I6jGqNUAZsKcRIEu2J6FRFvsczljjsaQ== @@ -1738,12 +1271,13 @@ "@babel/helper-validator-identifier" "^7.18.6" to-fast-properties "^2.0.0" -"@babel/types@^7.16.0", "@babel/types@^7.16.8", "@babel/types@^7.17.12", "@babel/types@^7.4.4", "@babel/types@^7.9.6": - version "7.18.4" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.18.4.tgz" - integrity sha512-ThN1mBcMq5pG/Vm2IcBmPPfyPXbd8S02rS+OBIDENdufvqC7Z/jHPCv9IcP01277aKtDI8g/2XysBN4hA8niiw== +"@babel/types@^7.0.0", "@babel/types@^7.18.10", "@babel/types@^7.20.7", "@babel/types@^7.22.10", "@babel/types@^7.22.5", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.9.6": + version "7.22.10" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.22.10.tgz#4a9e76446048f2c66982d1a989dd12b8a2d2dc03" + integrity sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg== dependencies: - "@babel/helper-validator-identifier" "^7.16.7" + "@babel/helper-string-parser" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.5" to-fast-properties "^2.0.0" "@bcoe/v8-coverage@^0.2.3": @@ -1893,14 +1427,14 @@ integrity sha512-KvvX58MGMWh7xA+N+deCfunkA/ZNDvFLw4YbOmX3f/XBIkqrVY7qlotfy2aNb1kgp6h4B6Yc8YawJPDTfvWX7g== "@eslint/eslintrc@^1.3.0": - version "1.3.0" - resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz#29f92c30bb3e771e4a2048c95fa6855392dfac4f" - integrity sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw== + version "1.4.1" + resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz#af58772019a2d271b7e2d4c23ff4ddcba3ccfb3e" + integrity sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.3.2" - globals "^13.15.0" + espree "^9.4.0" + globals "^13.19.0" ignore "^5.2.0" import-fresh "^3.2.1" js-yaml "^4.1.0" @@ -1909,13 +1443,13 @@ "@gar/promisify@^1.0.1": version "1.1.3" - resolved "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz" + resolved "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== "@humanwhocodes/config-array@^0.10.4": - version "0.10.4" - resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.4.tgz#01e7366e57d2ad104feea63e72248f22015c520c" - integrity sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw== + version "0.10.7" + resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.7.tgz#6d53769fd0c222767e6452e8ebda825c22e9f0dc" + integrity sha512-MDl6D6sBsaV452/QSdX+4CXIjZhIcI0PELsxUjk4U828yd58vk3bTIvk/6w5FY+4hIy9sLW0sfrV7K7Kc++j/w== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" @@ -1933,7 +1467,7 @@ "@hutson/parse-repository-url@^3.0.0": version "3.0.2" - resolved "https://registry.npmjs.org/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz" + resolved "https://registry.npmjs.org/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz#98c23c950a3d9b6c8f0daed06da6c3af06981340" integrity sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q== "@istanbuljs/load-nyc-config@^1.0.0": @@ -2076,13 +1610,6 @@ terminal-link "^2.0.0" v8-to-istanbul "^9.0.1" -"@jest/schemas@^28.0.2": - version "28.0.2" - resolved "https://registry.npmjs.org/@jest/schemas/-/schemas-28.0.2.tgz" - integrity sha512-YVDJZjd4izeTDkij00vHHAymNXQ6WWsdChFRK86qck6Jpr3DCL5W3Is3vslviRlP+bLuMYRLbdp98amMvqudhA== - dependencies: - "@sinclair/typebox" "^0.23.3" - "@jest/schemas@^28.1.3": version "28.1.3" resolved "https://registry.npmjs.org/@jest/schemas/-/schemas-28.1.3.tgz#ad8b86a66f11f33619e3d7e1dcddd7f2d40ff905" @@ -2140,18 +1667,6 @@ slash "^3.0.0" write-file-atomic "^4.0.1" -"@jest/types@^28.1.1": - version "28.1.1" - resolved "https://registry.npmjs.org/@jest/types/-/types-28.1.1.tgz" - integrity sha512-vRXVqSg1VhDnB8bWcmvLzmg0Bt9CRKVgHPXqYwvWMX3TvAjeO+nRuK6+VdTKCtWOvYlmkF/HqNAL/z+N3B53Kw== - dependencies: - "@jest/schemas" "^28.0.2" - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^17.0.8" - chalk "^4.0.0" - "@jest/types@^28.1.3": version "28.1.3" resolved "https://registry.npmjs.org/@jest/types/-/types-28.1.3.tgz#b05de80996ff12512bc5ceb1d208285a7d11748b" @@ -2164,54 +1679,46 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" -"@jridgewell/gen-mapping@^0.1.0": - version "0.1.1" - resolved "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" - integrity sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w== - dependencies: - "@jridgewell/set-array" "^1.0.0" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": - version "0.3.2" - resolved "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" - integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== + version "0.3.3" + resolved "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" + integrity sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ== dependencies: "@jridgewell/set-array" "^1.0.1" "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/resolve-uri@^3.0.3": - version "3.1.0" - resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" - integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.1" + resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== -"@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": +"@jridgewell/set-array@^1.0.1": version "1.1.2" resolved "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== -"@jridgewell/sourcemap-codec@^1.4.10": - version "1.4.14" - resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" - integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": + version "1.4.15" + resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.13", "@jridgewell/trace-mapping@^0.3.8", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.14" - resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz#b231a081d8f66796e475ad588a1ef473112701ed" - integrity sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ== +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.13", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.8", "@jridgewell/trace-mapping@^0.3.9": + version "0.3.19" + resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz#f8a3249862f91be48d3127c3cfe992f79b4b8811" + integrity sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw== dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" "@jsdevtools/ono@^7.1.3": version "7.1.3" - resolved "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz" + resolved "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== "@lerna/add@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/add/-/add-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/add/-/add-4.0.0.tgz#c36f57d132502a57b9e7058d1548b7a565ef183f" integrity sha512-cpmAH1iS3k8JBxNvnMqrGTTjbY/ZAiKa1ChJzFevMYY3eeqbvhsBKnBcxjRXtdrJ6bd3dCQM+ZtK+0i682Fhng== dependencies: "@lerna/bootstrap" "4.0.0" @@ -2227,7 +1734,7 @@ "@lerna/bootstrap@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/bootstrap/-/bootstrap-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/bootstrap/-/bootstrap-4.0.0.tgz#5f5c5e2c6cfc8fcec50cb2fbe569a8c607101891" integrity sha512-RkS7UbeM2vu+kJnHzxNRCLvoOP9yGNgkzRdy4UV2hNalD7EP41bLvRVOwRYQ7fhc2QcbhnKNdOBihYRL0LcKtw== dependencies: "@lerna/command" "4.0.0" @@ -2255,7 +1762,7 @@ "@lerna/changed@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/changed/-/changed-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/changed/-/changed-4.0.0.tgz#b9fc76cea39b9292a6cd263f03eb57af85c9270b" integrity sha512-cD+KuPRp6qiPOD+BO6S6SN5cARspIaWSOqGBpGnYzLb4uWT8Vk4JzKyYtc8ym1DIwyoFXHosXt8+GDAgR8QrgQ== dependencies: "@lerna/collect-updates" "4.0.0" @@ -2265,7 +1772,7 @@ "@lerna/check-working-tree@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/check-working-tree/-/check-working-tree-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/check-working-tree/-/check-working-tree-4.0.0.tgz#257e36a602c00142e76082a19358e3e1ae8dbd58" integrity sha512-/++bxM43jYJCshBiKP5cRlCTwSJdRSxVmcDAXM+1oUewlZJVSVlnks5eO0uLxokVFvLhHlC5kHMc7gbVFPHv6Q== dependencies: "@lerna/collect-uncommitted" "4.0.0" @@ -2274,7 +1781,7 @@ "@lerna/child-process@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/child-process/-/child-process-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/child-process/-/child-process-4.0.0.tgz#341b96a57dffbd9705646d316e231df6fa4df6e1" integrity sha512-XtCnmCT9eyVsUUHx6y/CTBYdV9g2Cr/VxyseTWBgfIur92/YKClfEtJTbOh94jRT62hlKLqSvux/UhxXVh613Q== dependencies: chalk "^4.1.0" @@ -2283,7 +1790,7 @@ "@lerna/clean@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/clean/-/clean-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/clean/-/clean-4.0.0.tgz#8f778b6f2617aa2a936a6b5e085ae62498e57dc5" integrity sha512-uugG2iN9k45ITx2jtd8nEOoAtca8hNlDCUM0N3lFgU/b1mEQYAPRkqr1qs4FLRl/Y50ZJ41wUz1eazS+d/0osA== dependencies: "@lerna/command" "4.0.0" @@ -2297,7 +1804,7 @@ "@lerna/cli@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/cli/-/cli-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/cli/-/cli-4.0.0.tgz#8eabd334558836c1664df23f19acb95e98b5bbf3" integrity sha512-Neaw3GzFrwZiRZv2g7g6NwFjs3er1vhraIniEs0jjVLPMNC4eata0na3GfE5yibkM/9d3gZdmihhZdZ3EBdvYA== dependencies: "@lerna/global-options" "4.0.0" @@ -2307,7 +1814,7 @@ "@lerna/collect-uncommitted@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/collect-uncommitted/-/collect-uncommitted-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/collect-uncommitted/-/collect-uncommitted-4.0.0.tgz#855cd64612969371cfc2453b90593053ff1ba779" integrity sha512-ufSTfHZzbx69YNj7KXQ3o66V4RC76ffOjwLX0q/ab//61bObJ41n03SiQEhSlmpP+gmFbTJ3/7pTe04AHX9m/g== dependencies: "@lerna/child-process" "4.0.0" @@ -2316,7 +1823,7 @@ "@lerna/collect-updates@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/collect-updates/-/collect-updates-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/collect-updates/-/collect-updates-4.0.0.tgz#8e208b1bafd98a372ff1177f7a5e288f6bea8041" integrity sha512-bnNGpaj4zuxsEkyaCZLka9s7nMs58uZoxrRIPJ+nrmrZYp1V5rrd+7/NYTuunOhY2ug1sTBvTAxj3NZQ+JKnOw== dependencies: "@lerna/child-process" "4.0.0" @@ -2327,7 +1834,7 @@ "@lerna/command@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/command/-/command-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/command/-/command-4.0.0.tgz#991c7971df8f5bf6ae6e42c808869a55361c1b98" integrity sha512-LM9g3rt5FsPNFqIHUeRwWXLNHJ5NKzOwmVKZ8anSp4e1SPrv2HNc1V02/9QyDDZK/w+5POXH5lxZUI1CHaOK/A== dependencies: "@lerna/child-process" "4.0.0" @@ -2343,7 +1850,7 @@ "@lerna/conventional-commits@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/conventional-commits/-/conventional-commits-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/conventional-commits/-/conventional-commits-4.0.0.tgz#660fb2c7b718cb942ead70110df61f18c6f99750" integrity sha512-CSUQRjJHFrH8eBn7+wegZLV3OrNc0Y1FehYfYGhjLE2SIfpCL4bmfu/ViYuHh9YjwHaA+4SX6d3hR+xkeseKmw== dependencies: "@lerna/validation-error" "4.0.0" @@ -2360,7 +1867,7 @@ "@lerna/create-symlink@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/create-symlink/-/create-symlink-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/create-symlink/-/create-symlink-4.0.0.tgz#8c5317ce5ae89f67825443bd7651bf4121786228" integrity sha512-I0phtKJJdafUiDwm7BBlEUOtogmu8+taxq6PtIrxZbllV9hWg59qkpuIsiFp+no7nfRVuaasNYHwNUhDAVQBig== dependencies: cmd-shim "^4.1.0" @@ -2369,7 +1876,7 @@ "@lerna/create@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/create/-/create-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/create/-/create-4.0.0.tgz#b6947e9b5dfb6530321952998948c3e63d64d730" integrity sha512-mVOB1niKByEUfxlbKTM1UNECWAjwUdiioIbRQZEeEabtjCL69r9rscIsjlGyhGWCfsdAG5wfq4t47nlDXdLLag== dependencies: "@lerna/child-process" "4.0.0" @@ -2393,7 +1900,7 @@ "@lerna/describe-ref@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/describe-ref/-/describe-ref-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/describe-ref/-/describe-ref-4.0.0.tgz#53c53b4ea65fdceffa072a62bfebe6772c45d9ec" integrity sha512-eTU5+xC4C5Gcgz+Ey4Qiw9nV2B4JJbMulsYJMW8QjGcGh8zudib7Sduj6urgZXUYNyhYpRs+teci9M2J8u+UvQ== dependencies: "@lerna/child-process" "4.0.0" @@ -2401,7 +1908,7 @@ "@lerna/diff@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/diff/-/diff-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/diff/-/diff-4.0.0.tgz#6d3071817aaa4205a07bf77cfc6e932796d48b92" integrity sha512-jYPKprQVg41+MUMxx6cwtqsNm0Yxx9GDEwdiPLwcUTFx+/qKCEwifKNJ1oGIPBxyEHX2PFCOjkK39lHoj2qiag== dependencies: "@lerna/child-process" "4.0.0" @@ -2411,7 +1918,7 @@ "@lerna/exec@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/exec/-/exec-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/exec/-/exec-4.0.0.tgz#eb6cb95cb92d42590e9e2d628fcaf4719d4a8be6" integrity sha512-VGXtL/b/JfY84NB98VWZpIExfhLOzy0ozm/0XaS4a2SmkAJc5CeUfrhvHxxkxiTBLkU+iVQUyYEoAT0ulQ8PCw== dependencies: "@lerna/child-process" "4.0.0" @@ -2424,7 +1931,7 @@ "@lerna/filter-options@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/filter-options/-/filter-options-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/filter-options/-/filter-options-4.0.0.tgz#ac94cc515d7fa3b47e2f7d74deddeabb1de5e9e6" integrity sha512-vV2ANOeZhOqM0rzXnYcFFCJ/kBWy/3OA58irXih9AMTAlQLymWAK0akWybl++sUJ4HB9Hx12TOqaXbYS2NM5uw== dependencies: "@lerna/collect-updates" "4.0.0" @@ -2434,7 +1941,7 @@ "@lerna/filter-packages@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/filter-packages/-/filter-packages-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/filter-packages/-/filter-packages-4.0.0.tgz#b1f70d70e1de9cdd36a4e50caa0ac501f8d012f2" integrity sha512-+4AJIkK7iIiOaqCiVTYJxh/I9qikk4XjNQLhE3kixaqgMuHl1NQ99qXRR0OZqAWB9mh8Z1HA9bM5K1HZLBTOqA== dependencies: "@lerna/validation-error" "4.0.0" @@ -2443,14 +1950,14 @@ "@lerna/get-npm-exec-opts@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-4.0.0.tgz#dc955be94a4ae75c374ef9bce91320887d34608f" integrity sha512-yvmkerU31CTWS2c7DvmAWmZVeclPBqI7gPVr5VATUKNWJ/zmVcU4PqbYoLu92I9Qc4gY1TuUplMNdNuZTSL7IQ== dependencies: npmlog "^4.1.2" "@lerna/get-packed@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/get-packed/-/get-packed-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/get-packed/-/get-packed-4.0.0.tgz#0989d61624ac1f97e393bdad2137c49cd7a37823" integrity sha512-rfWONRsEIGyPJTxFzC8ECb3ZbsDXJbfqWYyeeQQDrJRPnEJErlltRLPLgC2QWbxFgFPsoDLeQmFHJnf0iDfd8w== dependencies: fs-extra "^9.1.0" @@ -2459,7 +1966,7 @@ "@lerna/github-client@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/github-client/-/github-client-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/github-client/-/github-client-4.0.0.tgz#2ced67721363ef70f8e12ffafce4410918f4a8a4" integrity sha512-2jhsldZtTKXYUBnOm23Lb0Fx8G4qfSXF9y7UpyUgWUj+YZYd+cFxSuorwQIgk5P4XXrtVhsUesIsli+BYSThiw== dependencies: "@lerna/child-process" "4.0.0" @@ -2470,7 +1977,7 @@ "@lerna/gitlab-client@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/gitlab-client/-/gitlab-client-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/gitlab-client/-/gitlab-client-4.0.0.tgz#00dad73379c7b38951d4b4ded043504c14e2b67d" integrity sha512-OMUpGSkeDWFf7BxGHlkbb35T7YHqVFCwBPSIR6wRsszY8PAzCYahtH3IaJzEJyUg6vmZsNl0FSr3pdA2skhxqA== dependencies: node-fetch "^2.6.1" @@ -2479,12 +1986,12 @@ "@lerna/global-options@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/global-options/-/global-options-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/global-options/-/global-options-4.0.0.tgz#c7d8b0de6a01d8a845e2621ea89e7f60f18c6a5f" integrity sha512-TRMR8afAHxuYBHK7F++Ogop2a82xQjoGna1dvPOY6ltj/pEx59pdgcJfYcynYqMkFIk8bhLJJN9/ndIfX29FTQ== "@lerna/has-npm-version@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/has-npm-version/-/has-npm-version-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/has-npm-version/-/has-npm-version-4.0.0.tgz#d3fc3292c545eb28bd493b36e6237cf0279f631c" integrity sha512-LQ3U6XFH8ZmLCsvsgq1zNDqka0Xzjq5ibVN+igAI5ccRWNaUsE/OcmsyMr50xAtNQMYMzmpw5GVLAivT2/YzCg== dependencies: "@lerna/child-process" "4.0.0" @@ -2492,7 +1999,7 @@ "@lerna/import@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/import/-/import-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/import/-/import-4.0.0.tgz#bde656c4a451fa87ae41733ff8a8da60547c5465" integrity sha512-FaIhd+4aiBousKNqC7TX1Uhe97eNKf5/SC7c5WZANVWtC7aBWdmswwDt3usrzCNpj6/Wwr9EtEbYROzxKH8ffg== dependencies: "@lerna/child-process" "4.0.0" @@ -2506,7 +2013,7 @@ "@lerna/info@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/info/-/info-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/info/-/info-4.0.0.tgz#b9fb0e479d60efe1623603958a831a88b1d7f1fc" integrity sha512-8Uboa12kaCSZEn4XRfPz5KU9XXoexSPS4oeYGj76s2UQb1O1GdnEyfjyNWoUl1KlJ2i/8nxUskpXIftoFYH0/Q== dependencies: "@lerna/command" "4.0.0" @@ -2515,7 +2022,7 @@ "@lerna/init@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/init/-/init-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/init/-/init-4.0.0.tgz#dadff67e6dfb981e8ccbe0e6a310e837962f6c7a" integrity sha512-wY6kygop0BCXupzWj5eLvTUqdR7vIAm0OgyV9WHpMYQGfs1V22jhztt8mtjCloD/O0nEe4tJhdG62XU5aYmPNQ== dependencies: "@lerna/child-process" "4.0.0" @@ -2526,7 +2033,7 @@ "@lerna/link@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/link/-/link-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/link/-/link-4.0.0.tgz#c3a38aabd44279d714e90f2451e31b63f0fb65ba" integrity sha512-KlvPi7XTAcVOByfaLlOeYOfkkDcd+bejpHMCd1KcArcFTwijOwXOVi24DYomIeHvy6HsX/IUquJ4PPUJIeB4+w== dependencies: "@lerna/command" "4.0.0" @@ -2537,7 +2044,7 @@ "@lerna/list@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/list/-/list-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/list/-/list-4.0.0.tgz#24b4e6995bd73f81c556793fe502b847efd9d1d7" integrity sha512-L2B5m3P+U4Bif5PultR4TI+KtW+SArwq1i75QZ78mRYxPc0U/piau1DbLOmwrdqr99wzM49t0Dlvl6twd7GHFg== dependencies: "@lerna/command" "4.0.0" @@ -2547,7 +2054,7 @@ "@lerna/listable@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/listable/-/listable-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/listable/-/listable-4.0.0.tgz#d00d6cb4809b403f2b0374fc521a78e318b01214" integrity sha512-/rPOSDKsOHs5/PBLINZOkRIX1joOXUXEtyUs5DHLM8q6/RP668x/1lFhw6Dx7/U+L0+tbkpGtZ1Yt0LewCLgeQ== dependencies: "@lerna/query-graph" "4.0.0" @@ -2556,7 +2063,7 @@ "@lerna/log-packed@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/log-packed/-/log-packed-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/log-packed/-/log-packed-4.0.0.tgz#95168fe2e26ac6a71e42f4be857519b77e57a09f" integrity sha512-+dpCiWbdzgMAtpajLToy9PO713IHoE6GV/aizXycAyA07QlqnkpaBNZ8DW84gHdM1j79TWockGJo9PybVhrrZQ== dependencies: byte-size "^7.0.0" @@ -2566,7 +2073,7 @@ "@lerna/npm-conf@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/npm-conf/-/npm-conf-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/npm-conf/-/npm-conf-4.0.0.tgz#b259fd1e1cee2bf5402b236e770140ff9ade7fd2" integrity sha512-uS7H02yQNq3oejgjxAxqq/jhwGEE0W0ntr8vM3EfpCW1F/wZruwQw+7bleJQ9vUBjmdXST//tk8mXzr5+JXCfw== dependencies: config-chain "^1.1.12" @@ -2574,7 +2081,7 @@ "@lerna/npm-dist-tag@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/npm-dist-tag/-/npm-dist-tag-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/npm-dist-tag/-/npm-dist-tag-4.0.0.tgz#d1e99b4eccd3414142f0548ad331bf2d53f3257a" integrity sha512-F20sg28FMYTgXqEQihgoqSfwmq+Id3zT23CnOwD+XQMPSy9IzyLf1fFVH319vXIw6NF6Pgs4JZN2Qty6/CQXGw== dependencies: "@lerna/otplease" "4.0.0" @@ -2584,7 +2091,7 @@ "@lerna/npm-install@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/npm-install/-/npm-install-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/npm-install/-/npm-install-4.0.0.tgz#31180be3ab3b7d1818a1a0c206aec156b7094c78" integrity sha512-aKNxq2j3bCH3eXl3Fmu4D54s/YLL9WSwV8W7X2O25r98wzrO38AUN6AB9EtmAx+LV/SP15et7Yueg9vSaanRWg== dependencies: "@lerna/child-process" "4.0.0" @@ -2597,7 +2104,7 @@ "@lerna/npm-publish@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/npm-publish/-/npm-publish-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/npm-publish/-/npm-publish-4.0.0.tgz#84eb62e876fe949ae1fd62c60804423dbc2c4472" integrity sha512-vQb7yAPRo5G5r77DRjHITc9piR9gvEKWrmfCH7wkfBnGWEqu7n8/4bFQ7lhnkujvc8RXOsYpvbMQkNfkYibD/w== dependencies: "@lerna/otplease" "4.0.0" @@ -2611,7 +2118,7 @@ "@lerna/npm-run-script@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/npm-run-script/-/npm-run-script-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/npm-run-script/-/npm-run-script-4.0.0.tgz#dfebf4f4601442e7c0b5214f9fb0d96c9350743b" integrity sha512-Jmyh9/IwXJjOXqKfIgtxi0bxi1pUeKe5bD3S81tkcy+kyng/GNj9WSqD5ZggoNP2NP//s4CLDAtUYLdP7CU9rA== dependencies: "@lerna/child-process" "4.0.0" @@ -2620,21 +2127,21 @@ "@lerna/otplease@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/otplease/-/otplease-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/otplease/-/otplease-4.0.0.tgz#84972eb43448f8a1077435ba1c5e59233b725850" integrity sha512-Sgzbqdk1GH4psNiT6hk+BhjOfIr/5KhGBk86CEfHNJTk9BK4aZYyJD4lpDbDdMjIV4g03G7pYoqHzH765T4fxw== dependencies: "@lerna/prompt" "4.0.0" "@lerna/output@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/output/-/output-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/output/-/output-4.0.0.tgz#b1d72215c0e35483e4f3e9994debc82c621851f2" integrity sha512-Un1sHtO1AD7buDQrpnaYTi2EG6sLF+KOPEAMxeUYG5qG3khTs2Zgzq5WE3dt2N/bKh7naESt20JjIW6tBELP0w== dependencies: npmlog "^4.1.2" "@lerna/pack-directory@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/pack-directory/-/pack-directory-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/pack-directory/-/pack-directory-4.0.0.tgz#8b617db95d20792f043aaaa13a9ccc0e04cb4c74" integrity sha512-NJrmZNmBHS+5aM+T8N6FVbaKFScVqKlQFJNY2k7nsJ/uklNKsLLl6VhTQBPwMTbf6Tf7l6bcKzpy7aePuq9UiQ== dependencies: "@lerna/get-packed" "4.0.0" @@ -2647,7 +2154,7 @@ "@lerna/package-graph@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/package-graph/-/package-graph-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/package-graph/-/package-graph-4.0.0.tgz#16a00253a8ac810f72041481cb46bcee8d8123dd" integrity sha512-QED2ZCTkfXMKFoTGoccwUzjHtZMSf3UKX14A4/kYyBms9xfFsesCZ6SLI5YeySEgcul8iuIWfQFZqRw+Qrjraw== dependencies: "@lerna/prerelease-id-from-version" "4.0.0" @@ -2658,7 +2165,7 @@ "@lerna/package@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/package/-/package-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/package/-/package-4.0.0.tgz#1b4c259c4bcff45c876ee1d591a043aacbc0d6b7" integrity sha512-l0M/izok6FlyyitxiQKr+gZLVFnvxRQdNhzmQ6nRnN9dvBJWn+IxxpM+cLqGACatTnyo9LDzNTOj2Db3+s0s8Q== dependencies: load-json-file "^6.2.0" @@ -2667,14 +2174,14 @@ "@lerna/prerelease-id-from-version@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-4.0.0.tgz#c7e0676fcee1950d85630e108eddecdd5b48c916" integrity sha512-GQqguzETdsYRxOSmdFZ6zDBXDErIETWOqomLERRY54f4p+tk4aJjoVdd9xKwehC9TBfIFvlRbL1V9uQGHh1opg== dependencies: semver "^7.3.4" "@lerna/profiler@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/profiler/-/profiler-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/profiler/-/profiler-4.0.0.tgz#8a53ab874522eae15d178402bff90a14071908e9" integrity sha512-/BaEbqnVh1LgW/+qz8wCuI+obzi5/vRE8nlhjPzdEzdmWmZXuCKyWSEzAyHOJWw1ntwMiww5dZHhFQABuoFz9Q== dependencies: fs-extra "^9.1.0" @@ -2683,7 +2190,7 @@ "@lerna/project@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/project/-/project-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/project/-/project-4.0.0.tgz#ff84893935833533a74deff30c0e64ddb7f0ba6b" integrity sha512-o0MlVbDkD5qRPkFKlBZsXZjoNTWPyuL58564nSfZJ6JYNmgAptnWPB2dQlAc7HWRZkmnC2fCkEdoU+jioPavbg== dependencies: "@lerna/package" "4.0.0" @@ -2701,7 +2208,7 @@ "@lerna/prompt@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/prompt/-/prompt-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/prompt/-/prompt-4.0.0.tgz#5ec69a803f3f0db0ad9f221dad64664d3daca41b" integrity sha512-4Ig46oCH1TH5M7YyTt53fT6TuaKMgqUUaqdgxvp6HP6jtdak6+amcsqB8YGz2eQnw/sdxunx84DfI9XpoLj4bQ== dependencies: inquirer "^7.3.3" @@ -2709,7 +2216,7 @@ "@lerna/publish@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/publish/-/publish-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/publish/-/publish-4.0.0.tgz#f67011305adeba120066a3b6d984a5bb5fceef65" integrity sha512-K8jpqjHrChH22qtkytA5GRKIVFEtqBF6JWj1I8dWZtHs4Jywn8yB1jQ3BAMLhqmDJjWJtRck0KXhQQKzDK2UPg== dependencies: "@lerna/check-working-tree" "4.0.0" @@ -2743,21 +2250,21 @@ "@lerna/pulse-till-done@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/pulse-till-done/-/pulse-till-done-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/pulse-till-done/-/pulse-till-done-4.0.0.tgz#04bace7d483a8205c187b806bcd8be23d7bb80a3" integrity sha512-Frb4F7QGckaybRhbF7aosLsJ5e9WuH7h0KUkjlzSByVycxY91UZgaEIVjS2oN9wQLrheLMHl6SiFY0/Pvo0Cxg== dependencies: npmlog "^4.1.2" "@lerna/query-graph@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/query-graph/-/query-graph-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/query-graph/-/query-graph-4.0.0.tgz#09dd1c819ac5ee3f38db23931143701f8a6eef63" integrity sha512-YlP6yI3tM4WbBmL9GCmNDoeQyzcyg1e4W96y/PKMZa5GbyUvkS2+Jc2kwPD+5KcXou3wQZxSPzR3Te5OenaDdg== dependencies: "@lerna/package-graph" "4.0.0" "@lerna/resolve-symlink@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/resolve-symlink/-/resolve-symlink-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/resolve-symlink/-/resolve-symlink-4.0.0.tgz#6d006628a210c9b821964657a9e20a8c9a115e14" integrity sha512-RtX8VEUzqT+uLSCohx8zgmjc6zjyRlh6i/helxtZTMmc4+6O4FS9q5LJas2uGO2wKvBlhcD6siibGt7dIC3xZA== dependencies: fs-extra "^9.1.0" @@ -2766,7 +2273,7 @@ "@lerna/rimraf-dir@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/rimraf-dir/-/rimraf-dir-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/rimraf-dir/-/rimraf-dir-4.0.0.tgz#2edf3b62d4eb0ef4e44e430f5844667d551ec25a" integrity sha512-QNH9ABWk9mcMJh2/muD9iYWBk1oQd40y6oH+f3wwmVGKYU5YJD//+zMiBI13jxZRtwBx0vmBZzkBkK1dR11cBg== dependencies: "@lerna/child-process" "4.0.0" @@ -2776,7 +2283,7 @@ "@lerna/run-lifecycle@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/run-lifecycle/-/run-lifecycle-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/run-lifecycle/-/run-lifecycle-4.0.0.tgz#e648a46f9210a9bcd7c391df6844498cb5079334" integrity sha512-IwxxsajjCQQEJAeAaxF8QdEixfI7eLKNm4GHhXHrgBu185JcwScFZrj9Bs+PFKxwb+gNLR4iI5rpUdY8Y0UdGQ== dependencies: "@lerna/npm-conf" "4.0.0" @@ -2785,7 +2292,7 @@ "@lerna/run-topologically@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/run-topologically/-/run-topologically-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/run-topologically/-/run-topologically-4.0.0.tgz#af846eeee1a09b0c2be0d1bfb5ef0f7b04bb1827" integrity sha512-EVZw9hGwo+5yp+VL94+NXRYisqgAlj0jWKWtAIynDCpghRxCE5GMO3xrQLmQgqkpUl9ZxQFpICgYv5DW4DksQA== dependencies: "@lerna/query-graph" "4.0.0" @@ -2793,7 +2300,7 @@ "@lerna/run@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/run/-/run-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/run/-/run-4.0.0.tgz#4bc7fda055a729487897c23579694f6183c91262" integrity sha512-9giulCOzlMPzcZS/6Eov6pxE9gNTyaXk0Man+iCIdGJNMrCnW7Dme0Z229WWP/UoxDKg71F2tMsVVGDiRd8fFQ== dependencies: "@lerna/command" "4.0.0" @@ -2808,7 +2315,7 @@ "@lerna/symlink-binary@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/symlink-binary/-/symlink-binary-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/symlink-binary/-/symlink-binary-4.0.0.tgz#21009f62d53a425f136cb4c1a32c6b2a0cc02d47" integrity sha512-zualodWC4q1QQc1pkz969hcFeWXOsVYZC5AWVtAPTDfLl+TwM7eG/O6oP+Rr3fFowspxo6b1TQ6sYfDV6HXNWA== dependencies: "@lerna/create-symlink" "4.0.0" @@ -2818,7 +2325,7 @@ "@lerna/symlink-dependencies@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/symlink-dependencies/-/symlink-dependencies-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/symlink-dependencies/-/symlink-dependencies-4.0.0.tgz#8910eca084ae062642d0490d8972cf2d98e9ebbd" integrity sha512-BABo0MjeUHNAe2FNGty1eantWp8u83BHSeIMPDxNq0MuW2K3CiQRaeWT3EGPAzXpGt0+hVzBrA6+OT0GPn7Yuw== dependencies: "@lerna/create-symlink" "4.0.0" @@ -2830,19 +2337,19 @@ "@lerna/timer@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/timer/-/timer-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/timer/-/timer-4.0.0.tgz#a52e51bfcd39bfd768988049ace7b15c1fd7a6da" integrity sha512-WFsnlaE7SdOvjuyd05oKt8Leg3ENHICnvX3uYKKdByA+S3g+TCz38JsNs7OUZVt+ba63nC2nbXDlUnuT2Xbsfg== "@lerna/validation-error@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/validation-error/-/validation-error-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/validation-error/-/validation-error-4.0.0.tgz#af9d62fe8304eaa2eb9a6ba1394f9aa807026d35" integrity sha512-1rBOM5/koiVWlRi3V6dB863E1YzJS8v41UtsHgMr6gB2ncJ2LsQtMKlJpi3voqcgh41H8UsPXR58RrrpPpufyw== dependencies: npmlog "^4.1.2" "@lerna/version@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/version/-/version-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/version/-/version-4.0.0.tgz#532659ec6154d8a8789c5ab53878663e244e3228" integrity sha512-otUgiqs5W9zGWJZSCCMRV/2Zm2A9q9JwSDS7s/tlKq4mWCYriWo7+wsHEA/nPTMDyYyBO5oyZDj+3X50KDUzeA== dependencies: "@lerna/check-working-tree" "4.0.0" @@ -2874,7 +2381,7 @@ "@lerna/write-log-file@4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@lerna/write-log-file/-/write-log-file-4.0.0.tgz" + resolved "https://registry.npmjs.org/@lerna/write-log-file/-/write-log-file-4.0.0.tgz#18221a38a6a307d6b0a5844dd592ad53fa27091e" integrity sha512-XRG5BloiArpXRakcnPHmEHJp+4AtnhRtpDIHSghmXD5EichI1uD73J7FgPp30mm2pDRq3FdqB0NbwSEsJ9xFQg== dependencies: npmlog "^4.1.2" @@ -2885,10 +2392,17 @@ resolved "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz#323d72dd25103d0c4fbdce89dadf574a787b1f9b" integrity sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ== +"@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1": + version "5.1.1-v1" + resolved "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz#dbf733a965ca47b1973177dc0bb6c889edcfb129" + integrity sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg== + dependencies: + eslint-scope "5.1.1" + "@noble/hashes@^1", "@noble/hashes@^1.0.0": - version "1.3.0" - resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.0.tgz#085fd70f6d7d9d109671090ccae1d3bec62554a1" - integrity sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg== + version "1.3.1" + resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz#8831ef002114670c603c458ab8b11328406953a9" + integrity sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -2913,12 +2427,12 @@ "@npmcli/ci-detect@^1.0.0": version "1.4.0" - resolved "https://registry.npmjs.org/@npmcli/ci-detect/-/ci-detect-1.4.0.tgz" + resolved "https://registry.npmjs.org/@npmcli/ci-detect/-/ci-detect-1.4.0.tgz#18478bbaa900c37bfbd8a2006a6262c62e8b0fe1" integrity sha512-3BGrt6FLjqM6br5AhWRKTr3u5GIVkjRYeAFrMp3HjnfICrg4xOrVRwFavKT6tsp++bq5dluL5t8ME/Nha/6c1Q== "@npmcli/fs@^1.0.0": version "1.1.1" - resolved "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz" + resolved "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz#72f719fe935e687c56a4faecf3c03d06ba593257" integrity sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ== dependencies: "@gar/promisify" "^1.0.1" @@ -2926,7 +2440,7 @@ "@npmcli/git@^2.1.0": version "2.1.0" - resolved "https://registry.npmjs.org/@npmcli/git/-/git-2.1.0.tgz" + resolved "https://registry.npmjs.org/@npmcli/git/-/git-2.1.0.tgz#2fbd77e147530247d37f325930d457b3ebe894f6" integrity sha512-/hBFX/QG1b+N7PZBFs0bi+evgRZcK9nWBxQKZkGoXUT5hJSwl5c4d7y8/hm+NQZRPhQ67RzFaj5UM9YeyKoryw== dependencies: "@npmcli/promise-spawn" "^1.3.2" @@ -2940,7 +2454,7 @@ "@npmcli/installed-package-contents@^1.0.6": version "1.0.7" - resolved "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-1.0.7.tgz" + resolved "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-1.0.7.tgz#ab7408c6147911b970a8abe261ce512232a3f4fa" integrity sha512-9rufe0wnJusCQoLpV9ZPKIVP55itrM5BxOXs10DmdbRfgWtHy1LDyskbwRnBghuB0PrF7pNPOqREVtpz4HqzKw== dependencies: npm-bundled "^1.1.1" @@ -2948,7 +2462,7 @@ "@npmcli/move-file@^1.0.1": version "1.1.2" - resolved "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz" + resolved "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz#1a82c3e372f7cae9253eb66d72543d6b8685c674" integrity sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg== dependencies: mkdirp "^1.0.4" @@ -2956,19 +2470,19 @@ "@npmcli/node-gyp@^1.0.2": version "1.0.3" - resolved "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-1.0.3.tgz" + resolved "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-1.0.3.tgz#a912e637418ffc5f2db375e93b85837691a43a33" integrity sha512-fnkhw+fmX65kiLqk6E3BFLXNC26rUhK90zVwe2yncPliVT/Qos3xjhTLE59Df8KnPlcwIERXKVlU1bXoUQ+liA== "@npmcli/promise-spawn@^1.2.0", "@npmcli/promise-spawn@^1.3.2": version "1.3.2" - resolved "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-1.3.2.tgz" + resolved "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-1.3.2.tgz#42d4e56a8e9274fba180dabc0aea6e38f29274f5" integrity sha512-QyAGYo/Fbj4MXeGdJcFzZ+FkDkomfRBrPM+9QYJSg+PxgAUL+LU3FneQk37rKR2/zjqkCV1BLHccX98wRXG3Sg== dependencies: infer-owner "^1.0.4" "@npmcli/run-script@^1.8.2": version "1.8.6" - resolved "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.8.6.tgz" + resolved "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.8.6.tgz#18314802a6660b0d4baa4c3afe7f1ad39d8c28b7" integrity sha512-e42bVZnC6VluBZBAFEr3YrdqSspG3bgilyg4nSLBJ7TRGNCzxHa92XAHxQBLYg0BmgwO4b2mf3h/l5EkEWRn3g== dependencies: "@npmcli/node-gyp" "^1.0.2" @@ -2978,14 +2492,14 @@ "@octokit/auth-token@^2.4.4": version "2.5.0" - resolved "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz" + resolved "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz#27c37ea26c205f28443402477ffd261311f21e36" integrity sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g== dependencies: "@octokit/types" "^6.0.3" "@octokit/core@^3.5.1": version "3.6.0" - resolved "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz" + resolved "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz#3376cb9f3008d9b3d110370d90e0a1fcd5fe6085" integrity sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q== dependencies: "@octokit/auth-token" "^2.4.4" @@ -2998,7 +2512,7 @@ "@octokit/endpoint@^6.0.1": version "6.0.12" - resolved "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz" + resolved "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz#3b4d47a4b0e79b1027fb8d75d4221928b2d05658" integrity sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA== dependencies: "@octokit/types" "^6.0.3" @@ -3007,46 +2521,46 @@ "@octokit/graphql@^4.5.8": version "4.8.0" - resolved "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz" + resolved "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz#664d9b11c0e12112cbf78e10f49a05959aa22cc3" integrity sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg== dependencies: "@octokit/request" "^5.6.0" "@octokit/types" "^6.0.3" universal-user-agent "^6.0.0" -"@octokit/openapi-types@^12.1.0": - version "12.1.0" - resolved "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.1.0.tgz" - integrity sha512-kQzJh3ZUv3lDpi6M+uekMRHULvf9DlWoI1XgKN6nPeGDzkSgtkhVq1MMz3bFKQ6H6GbdC3ZqG/a6VzKhIx0VeA== +"@octokit/openapi-types@^12.11.0": + version "12.11.0" + resolved "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz#da5638d64f2b919bca89ce6602d059f1b52d3ef0" + integrity sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ== "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" - resolved "https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz" + resolved "https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz#e07896739618dab8da7d4077c658003775f95437" integrity sha512-93uGjlhUD+iNg1iWhUENAtJata6w5nE+V4urXOAlIXdco6xNZtUSfYY8dzp3Udy74aqO/B5UZL80x/YMa5PKRw== "@octokit/plugin-paginate-rest@^2.16.8": - version "2.18.0" - resolved "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.18.0.tgz" - integrity sha512-n5/AzIoy5Wzp85gqzSbR+dWQDHlyHZrGijnDfLh452547Ynu0hCvszH7EfRE0eqM5ZjfkplO0k+q+P8AAIIJEA== + version "2.21.3" + resolved "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.21.3.tgz#7f12532797775640dbb8224da577da7dc210c87e" + integrity sha512-aCZTEf0y2h3OLbrgKkrfFdjRL6eSOo8komneVQJnYecAxIej7Bafor2xhuDJOIFau4pk0i/P28/XgtbyPF0ZHw== dependencies: - "@octokit/types" "^6.35.0" + "@octokit/types" "^6.40.0" "@octokit/plugin-request-log@^1.0.4": version "1.0.4" - resolved "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz" + resolved "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85" integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== "@octokit/plugin-rest-endpoint-methods@^5.12.0": - version "5.14.0" - resolved "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.14.0.tgz" - integrity sha512-MRnMs4Dcm1OSaz/g/RLr4YY9otgysS7vN5SUkHGd7t+R8323cHsHFoEWHYPSmgUC0BieHRhvnCRWb4i3Pl+Lgg== + version "5.16.2" + resolved "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.16.2.tgz#7ee8bf586df97dd6868cf68f641354e908c25342" + integrity sha512-8QFz29Fg5jDuTPXVtey05BLm7OB+M8fnvE64RNegzX7U+5NUXcOcnpTIK0YfSHBg8gYd0oxIq3IZTe9SfPZiRw== dependencies: - "@octokit/types" "^6.35.0" + "@octokit/types" "^6.39.0" deprecation "^2.3.1" "@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0": version "2.1.0" - resolved "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz" + resolved "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz#9e150357831bfc788d13a4fd4b1913d60c74d677" integrity sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg== dependencies: "@octokit/types" "^6.0.3" @@ -3055,7 +2569,7 @@ "@octokit/request@^5.6.0", "@octokit/request@^5.6.3": version "5.6.3" - resolved "https://registry.npmjs.org/@octokit/request/-/request-5.6.3.tgz" + resolved "https://registry.npmjs.org/@octokit/request/-/request-5.6.3.tgz#19a022515a5bba965ac06c9d1334514eb50c48b0" integrity sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A== dependencies: "@octokit/endpoint" "^6.0.1" @@ -3067,7 +2581,7 @@ "@octokit/rest@^18.1.0": version "18.12.0" - resolved "https://registry.npmjs.org/@octokit/rest/-/rest-18.12.0.tgz" + resolved "https://registry.npmjs.org/@octokit/rest/-/rest-18.12.0.tgz#f06bc4952fc87130308d810ca9d00e79f6988881" integrity sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q== dependencies: "@octokit/core" "^3.5.1" @@ -3075,12 +2589,12 @@ "@octokit/plugin-request-log" "^1.0.4" "@octokit/plugin-rest-endpoint-methods" "^5.12.0" -"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.35.0": - version "6.35.0" - resolved "https://registry.npmjs.org/@octokit/types/-/types-6.35.0.tgz" - integrity sha512-DhLfdUuv3H37u6jBDfkwamypx3HflHg29b26nbA6iVFYkAlZ5cMEtu/9pQoihGnQE5M7jJFnNo25Rr1UwQNF8Q== +"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.39.0", "@octokit/types@^6.40.0": + version "6.41.0" + resolved "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz#e58ef78d78596d2fb7df9c6259802464b5f84a04" + integrity sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg== dependencies: - "@octokit/openapi-types" "^12.1.0" + "@octokit/openapi-types" "^12.11.0" "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": version "1.1.2" @@ -3137,7 +2651,7 @@ "@pyramation/babel-preset-env@0.1.0": version "0.1.0" - resolved "https://registry.npmjs.org/@pyramation/babel-preset-env/-/babel-preset-env-0.1.0.tgz" + resolved "https://registry.npmjs.org/@pyramation/babel-preset-env/-/babel-preset-env-0.1.0.tgz#cb9bf3a507d79b9ceb8b7e83815ed1a672209952" integrity sha512-NgyUnQv5gDe4mTe0SbS3thOyV/XPdVKFx1KYtWARKTPCH4430nMyCrguAR9BJ1q1FLilGQdnr3JbGS1pPTRtrA== dependencies: "@babel/core" "7.9.6" @@ -3178,20 +2692,15 @@ mz "^2.7.0" prettier "^2.6.2" -"@sinclair/typebox@^0.23.3": - version "0.23.5" - resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.23.5.tgz" - integrity sha512-AFBVi/iT4g20DHoujvMH1aEDn8fGJh4xsRGCP6d8RpLPMqsNPvW01Jcn0QysXTsg++/xj25NmJsGyH9xug/wKg== - "@sinclair/typebox@^0.24.1": - version "0.24.27" - resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.27.tgz#d55643516a1546174e10da681a8aaa81e757452d" - integrity sha512-K7C7IlQ3zLePEZleUN21ceBA2aLcMnLHTLph8QWk1JK37L90obdpY+QGY8bXMKxf1ht1Z0MNewvXxWv0oGDYFg== + version "0.24.51" + resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.51.tgz#645f33fe4e02defe26f2f5c0410e1c094eac7f5f" + integrity sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA== "@sinonjs/commons@^1.7.0": - version "1.8.3" - resolved "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" - integrity sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ== + version "1.8.6" + resolved "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz#80c516a4dc264c2a69115e7578d62581ff455ed9" + integrity sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ== dependencies: type-detect "4.0.8" @@ -3204,16 +2713,16 @@ "@tootallnate/once@1": version "1.1.2" - resolved "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz" + resolved "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== "@types/babel__core@^7.1.14": - version "7.1.19" - resolved "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460" - integrity sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw== + version "7.20.1" + resolved "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.1.tgz#916ecea274b0c776fec721e333e55762d3a9614b" + integrity sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw== dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" "@types/babel__generator" "*" "@types/babel__template" "*" "@types/babel__traverse" "*" @@ -3234,11 +2743,11 @@ "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.18.0" - resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.0.tgz#8134fd78cb39567465be65b9fdc16d378095f41f" - integrity sha512-v4Vwdko+pgymgS+A2UIaJru93zQd85vIGWObM5ekZNdXCKtDYqATlEYnWgfo86Q6I1Lh0oXnksDnMU1cwmlPDw== + version "7.20.1" + resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.1.tgz#dd6f1d2411ae677dcb2db008c962598be31d6acf" + integrity sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg== dependencies: - "@babel/types" "^7.3.0" + "@babel/types" "^7.20.7" "@types/glob@^7.1.3": version "7.2.0" @@ -3249,9 +2758,9 @@ "@types/node" "*" "@types/graceful-fs@^4.1.3": - version "4.1.5" - resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" - integrity sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw== + version "4.1.6" + resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz#e14b2576a1c25026b7f02ede1de3b84c3a1efeae" + integrity sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw== dependencies: "@types/node" "*" @@ -3275,62 +2784,62 @@ "@types/istanbul-lib-report" "*" "@types/jest@^28.1.6": - version "28.1.6" - resolved "https://registry.npmjs.org/@types/jest/-/jest-28.1.6.tgz#d6a9cdd38967d2d746861fb5be6b120e38284dd4" - integrity sha512-0RbGAFMfcBJKOmqRazM8L98uokwuwD5F8rHrv/ZMbrZBwVOWZUyPG6VFNscjYr/vjM3Vu4fRrCPbOs42AfemaQ== + version "28.1.8" + resolved "https://registry.npmjs.org/@types/jest/-/jest-28.1.8.tgz#6936409f3c9724ea431efd412ea0238a0f03b09b" + integrity sha512-8TJkV++s7B6XqnDrzR1m/TT0A0h948Pnl/097veySPN67VRAgQ4gZ7n2KfJo2rVq6njQjdxU3GCCyDvAeuHoiw== dependencies: - jest-matcher-utils "^28.0.0" + expect "^28.0.0" pretty-format "^28.0.0" "@types/json-schema@^7.0.11": - version "7.0.11" - resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" - integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== + version "7.0.12" + resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz#d70faba7039d5fca54c83c7dbab41051d2b6f6cb" + integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA== "@types/lodash@^4.14.182": - version "4.14.182" - resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.182.tgz#05301a4d5e62963227eaafe0ce04dd77c54ea5c2" - integrity sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q== + version "4.14.197" + resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.197.tgz#e95c5ddcc814ec3e84c891910a01e0c8a378c54b" + integrity sha512-BMVOiWs0uNxHVlHBgzTIqJYmj+PgCo4euloGF+5m4okL3rEYzM2EEv78mw8zWSMM57dM7kVIgJ2QDvwHSoCI5g== "@types/long@^4.0.1": version "4.0.2" resolved "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== -"@types/minimatch@*", "@types/minimatch@^3.0.3": +"@types/minimatch@*": + version "5.1.2" + resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" + integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== + +"@types/minimatch@^3.0.3": version "3.0.5" - resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz" + resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/minimist@^1.2.0": version "1.2.2" - resolved "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz" + resolved "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== -"@types/node@*": - version "18.6.5" - resolved "https://registry.npmjs.org/@types/node/-/node-18.6.5.tgz#06caea822caf9e59d5034b695186ee74154d2802" - integrity sha512-Xjt5ZGUa5WusGZJ4WJPbOT8QOqp6nDynVFRKcUt32bOgvXEoc6o085WNkYTMO7ifAj2isEfQQ2cseE+wT6jsRw== - -"@types/node@>=13.7.0": - version "20.2.1" - resolved "https://registry.npmjs.org/@types/node/-/node-20.2.1.tgz#de559d4b33be9a808fd43372ccee822c70f39704" - integrity sha512-DqJociPbZP1lbZ5SQPk4oag6W7AyaGMO6gSfRwq3PWl4PXTwJpRQJhDq4W0kzrg3w6tJ1SwlvGZ5uKFHY13LIg== +"@types/node@*", "@types/node@>=13.7.0": + version "20.4.9" + resolved "https://registry.npmjs.org/@types/node/-/node-20.4.9.tgz#c7164e0f8d3f12dfae336af0b1f7fdec8c6b204f" + integrity sha512-8e2HYcg7ohnTUbHk8focoklEQYvemQmu9M/f43DZVx43kHn0tE3BY/6gSDxS7k0SprtS0NHvj+L80cGLnoOUcQ== "@types/normalize-package-data@^2.4.0": version "2.4.1" - resolved "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz" + resolved "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== "@types/parse-json@^4.0.0": version "4.0.0" - resolved "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz" + resolved "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== "@types/prettier@^2.1.5", "@types/prettier@^2.6.1": - version "2.7.0" - resolved "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.0.tgz#ea03e9f0376a4446f44797ca19d9c46c36e352dc" - integrity sha512-RI1L7N4JnW5gQw2spvL7Sllfuf1SaHdrZpCHiBlCXjIlufi1SMNnbu2teze3/QE67Fg2tBlH7W+mi4hVNk4p0A== + version "2.7.3" + resolved "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz#3e51a17e291d01d17d3fc61422015a933af7a08f" + integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA== "@types/stack-utils@^2.0.0": version "2.0.1" @@ -3343,15 +2852,15 @@ integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== "@types/yargs@^17.0.8": - version "17.0.11" - resolved "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.11.tgz#5e10ca33e219807c0eee0f08b5efcba9b6a42c06" - integrity sha512-aB4y9UDUXTSMxmM4MH+YnuR0g5Cph3FLQBoWoMB21DSvFVAxRVEHEMx3TLh+zUZYMCQtKiqazz0Q4Rre31f/OA== + version "17.0.24" + resolved "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz#b3ef8d50ad4aa6aecf6ddc97c580a00f5aa11902" + integrity sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw== dependencies: "@types/yargs-parser" "*" JSONStream@^1.0.4: version "1.3.5" - resolved "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz" + resolved "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== dependencies: jsonparse "^1.2.0" @@ -3359,7 +2868,7 @@ JSONStream@^1.0.4: abbrev@1: version "1.1.1" - resolved "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz" + resolved "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== acorn-jsx@^5.3.2: @@ -3367,35 +2876,33 @@ acorn-jsx@^5.3.2: resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn@^8.8.0: - version "8.8.0" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" - integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== +acorn@^8.9.0: + version "8.10.0" + resolved "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" + integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== add-stream@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/add-stream/-/add-stream-1.0.0.tgz" + resolved "https://registry.npmjs.org/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" integrity sha512-qQLMr+8o0WC4FZGQTcJiKBVC59JylcPSrTtk6usvmIDFUOCKegapy1VHQwRbFMOFyb/inzUVqHs+eMYKDM1YeQ== agent-base@6, agent-base@^6.0.2: version "6.0.2" - resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz" + resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== dependencies: debug "4" agentkeepalive@^4.1.3: - version "4.2.1" - resolved "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.1.tgz" - integrity sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA== + version "4.5.0" + resolved "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz#2673ad1389b3c418c5a20c5d7364f93ca04be923" + integrity sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew== dependencies: - debug "^4.1.0" - depd "^1.1.2" humanize-ms "^1.2.1" aggregate-error@^3.0.0: version "3.1.0" - resolved "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz" + resolved "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== dependencies: clean-stack "^2.0.0" @@ -3403,7 +2910,7 @@ aggregate-error@^3.0.0: ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: version "6.12.6" - resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" + resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== dependencies: fast-deep-equal "^3.1.1" @@ -3413,12 +2920,12 @@ ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: ansi-escapes@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-2.0.0.tgz" + resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-2.0.0.tgz#5bae52be424878dd9783e8910e3fc2922e83c81b" integrity sha512-tH/fSoQp4DrEodDK3QpdiWiZTSe7sBJ9eOqcQBZ0o9HTM+5M/viSEn+sPMoTuPjQQ8n++w3QJoPEjt8LVPcrCg== ansi-escapes@^3.2.0: version "3.2.0" - resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz" + resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== ansi-escapes@^4.2.1: @@ -3430,17 +2937,17 @@ ansi-escapes@^4.2.1: ansi-regex@^2.0.0: version "2.1.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" integrity sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA== ansi-regex@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz#123d6479e92ad45ad897d4054e3c7ca7db4944e1" integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw== ansi-regex@^4.1.0: version "4.1.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed" integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g== ansi-regex@^5.0.1: @@ -3450,7 +2957,7 @@ ansi-regex@^5.0.1: ansi-styles@^2.2.1: version "2.2.1" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" integrity sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA== ansi-styles@^3.2.1: @@ -3474,30 +2981,30 @@ ansi-styles@^5.0.0: any-promise@^1.0.0: version "1.3.0" - resolved "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz" + resolved "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" integrity sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A== anymatch@^3.0.3, anymatch@~3.1.2: - version "3.1.2" - resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + version "3.1.3" + resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== dependencies: normalize-path "^3.0.0" picomatch "^2.0.4" aproba@^1.0.3: version "1.2.0" - resolved "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz" + resolved "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== aproba@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz" + resolved "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== are-we-there-yet@~1.1.2: version "1.1.7" - resolved "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz" + resolved "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz#b15474a932adab4ff8a50d9adfa7e4e926f21146" integrity sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g== dependencies: delegates "^1.0.0" @@ -3515,14 +3022,22 @@ argparse@^2.0.1: resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== +array-buffer-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz#fabe8bc193fea865f317fe7807085ee0dee5aead" + integrity sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A== + dependencies: + call-bind "^1.0.2" + is-array-buffer "^3.0.1" + array-differ@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz" + resolved "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz#3cbb3d0f316810eafcc47624734237d6aee4ae6b" integrity sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg== array-ify@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz" + resolved "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" integrity sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng== array-union@^2.1.0: @@ -3530,70 +3045,87 @@ array-union@^2.1.0: resolved "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== -array.prototype.reduce@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/array.prototype.reduce/-/array.prototype.reduce-1.0.4.tgz" - integrity sha512-WnM+AjG/DvLRLo4DDl+r+SvCzYtD2Jd9oeBYMcEaI7t3fFrHY9M53/wdLcTvmZNQ70IU6Htj0emFkZ5TS+lrdw== +array.prototype.reduce@^1.0.5: + version "1.0.5" + resolved "https://registry.npmjs.org/array.prototype.reduce/-/array.prototype.reduce-1.0.5.tgz#6b20b0daa9d9734dd6bc7ea66b5bbce395471eac" + integrity sha512-kDdugMl7id9COE8R7MHF5jWk7Dqt/fs4Pv+JXoICnYwqpjjjbUurz6w5fT5IG6brLdJhv6/VoHB0H7oyIBXd+Q== dependencies: call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" es-array-method-boxes-properly "^1.0.0" is-string "^1.0.7" +arraybuffer.prototype.slice@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz#9b5ea3868a6eebc30273da577eb888381c0044bb" + integrity sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw== + dependencies: + array-buffer-byte-length "^1.0.0" + call-bind "^1.0.2" + define-properties "^1.2.0" + get-intrinsic "^1.2.1" + is-array-buffer "^3.0.2" + is-shared-array-buffer "^1.0.2" + arrify@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz" + resolved "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" integrity sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA== arrify@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz" + resolved "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== asap@^2.0.0: version "2.0.6" - resolved "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz" + resolved "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" integrity sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA== asn1@~0.2.3: version "0.2.6" - resolved "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz" + resolved "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== dependencies: safer-buffer "~2.1.0" assert-plus@1.0.0, assert-plus@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" + resolved "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== ast-stringify@0.1.0: version "0.1.0" - resolved "https://registry.npmjs.org/ast-stringify/-/ast-stringify-0.1.0.tgz" + resolved "https://registry.npmjs.org/ast-stringify/-/ast-stringify-0.1.0.tgz#5c6439fbfb4513dcc26c7d34464ccd084ed91cb7" integrity sha512-J1PgFYV3RG6r37+M6ySZJH406hR82okwGvFM9hLXpOvdx4WC4GEW8/qiw6pi1hKTrqcRvoHP8a7mp87egYr6iA== dependencies: "@babel/runtime" "^7.11.2" asynckit@^0.4.0: version "0.4.0" - resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" + resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== at-least-node@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz" + resolved "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== +available-typed-arrays@^1.0.5: + version "1.0.5" + resolved "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" + integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== + aws-sign2@~0.7.0: version "0.7.0" - resolved "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz" + resolved "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" integrity sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA== aws4@^1.8.0: - version "1.11.0" - resolved "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz" - integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== + version "1.12.0" + resolved "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" + integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== axios@^0.21.2: version "0.21.4" @@ -3604,7 +3136,7 @@ axios@^0.21.2: babel-core@7.0.0-bridge.0: version "7.0.0-bridge.0" - resolved "https://registry.npmjs.org/babel-core/-/babel-core-7.0.0-bridge.0.tgz" + resolved "https://registry.npmjs.org/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece" integrity sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg== babel-jest@28.1.3, babel-jest@^28.1.3: @@ -3620,13 +3152,6 @@ babel-jest@28.1.3, babel-jest@^28.1.3: graceful-fs "^4.2.9" slash "^3.0.0" -babel-plugin-dynamic-import-node@^2.3.3: - version "2.3.3" - resolved "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz" - integrity sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ== - dependencies: - object.assign "^4.1.0" - babel-plugin-istanbul@^6.1.1: version "6.1.1" resolved "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" @@ -3650,7 +3175,7 @@ babel-plugin-jest-hoist@^28.1.3: babel-plugin-macros@2.8.0: version "2.8.0" - resolved "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-2.8.0.tgz" + resolved "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-2.8.0.tgz#0f958a7cc6556b1e65344465d99111a1e5e10138" integrity sha512-SEP5kJpfGYqYKpBrj5XU3ahw5p5GOHJ0U5ssOSQ/WBVdwkD2Dzlce95exQTs3jOVWPPKLBN2rlEWkCK7dSmLvg== dependencies: "@babel/runtime" "^7.7.2" @@ -3658,12 +3183,12 @@ babel-plugin-macros@2.8.0: resolve "^1.12.0" babel-plugin-polyfill-corejs2@^0.3.2: - version "0.3.2" - resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.2.tgz#e4c31d4c89b56f3cf85b92558954c66b54bd972d" - integrity sha512-LPnodUl3lS0/4wN3Rb+m+UK8s7lj2jcLRrjho4gLw+OJs+I4bvGXshINesY5xx/apM+biTnQ9reDI8yj+0M5+Q== + version "0.3.3" + resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.3.tgz#5d1bd3836d0a19e1b84bbf2d9640ccb6f951c122" + integrity sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q== dependencies: "@babel/compat-data" "^7.17.7" - "@babel/helper-define-polyfill-provider" "^0.3.2" + "@babel/helper-define-polyfill-provider" "^0.3.3" semver "^6.1.1" babel-plugin-polyfill-corejs3@^0.5.3: @@ -3675,11 +3200,11 @@ babel-plugin-polyfill-corejs3@^0.5.3: core-js-compat "^3.21.0" babel-plugin-polyfill-regenerator@^0.4.0: - version "0.4.0" - resolved "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.0.tgz#8f51809b6d5883e07e71548d75966ff7635527fe" - integrity sha512-RW1cnryiADFeHmfLS+WW/G431p1PsW5qdRdz0SDRi7TKcUgc7Oh/uXkT7MZ/+tGsT1BkczEAmD5XjUyJ5SWDTw== + version "0.4.1" + resolved "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz#390f91c38d90473592ed43351e801a9d3e0fd747" + integrity sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw== dependencies: - "@babel/helper-define-polyfill-provider" "^0.3.2" + "@babel/helper-define-polyfill-provider" "^0.3.3" babel-preset-current-node-syntax@^1.0.0: version "1.0.1" @@ -3708,9 +3233,9 @@ babel-preset-jest@^28.1.3: babel-preset-current-node-syntax "^1.0.0" babel-watch@^7.0.0: - version "7.7.0" - resolved "https://registry.npmjs.org/babel-watch/-/babel-watch-7.7.0.tgz" - integrity sha512-PKytGmhgXWcNmNK+Y0fEQ/0+re8jDVAAppL1JGqdPKihab2siG5dzbM1dnKXvn0VWOW1ybJjiW+dDb6nV0S1KA== + version "7.8.1" + resolved "https://registry.npmjs.org/babel-watch/-/babel-watch-7.8.1.tgz#3be4016d61bfefae9522c116ef9ba209088e6498" + integrity sha512-TnAlLAaorqMruh3BaTiXbbuv/b8iHqqvlljaWkCCJQLRsVFn7nUKO+38+DGxEaFvlj/IgIlQlx+DMirxSHiC4g== dependencies: chalk "^4.1.0" chokidar "^3.4.3" @@ -3719,8 +3244,9 @@ babel-watch@^7.0.0: lodash.debounce "^4.0.8" lodash.isregexp "^4.0.1" lodash.isstring "^4.0.1" + signal-exit "^4.0.2" source-map-support "^0.5.19" - string-argv "^0.3.1" + string-argv "^0.3.2" balanced-match@^1.0.0: version "1.0.2" @@ -3734,7 +3260,7 @@ base64-js@^1.3.0: bcrypt-pbkdf@^1.0.0: version "1.0.2" - resolved "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz" + resolved "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== dependencies: tweetnacl "^0.14.3" @@ -3745,9 +3271,9 @@ bech32@^1.1.4: integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== before-after-hook@^2.2.0: - version "2.2.2" - resolved "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz" - integrity sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ== + version "2.2.3" + resolved "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz#c51e809c81a4e354084422b9b26bad88249c517c" + integrity sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ== binary-extensions@^2.0.0: version "2.2.0" @@ -3774,7 +3300,7 @@ brace-expansion@^1.1.7: brace-expansion@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz" + resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== dependencies: balanced-match "^1.0.0" @@ -3791,30 +3317,19 @@ brorand@^1.1.0: resolved "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== -browserslist@^4.11.1, browserslist@^4.20.4: - version "4.20.4" - resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.20.4.tgz" - integrity sha512-ok1d+1WpnU24XYN7oC3QWgTyMhY/avPJ/r9T00xxvUOIparA/gc+UPUMaod3i+G6s+nI2nUb9xZ5k794uIwShw== - dependencies: - caniuse-lite "^1.0.30001349" - electron-to-chromium "^1.4.147" - escalade "^3.1.1" - node-releases "^2.0.5" - picocolors "^1.0.0" - -browserslist@^4.20.2: - version "4.21.3" - resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.21.3.tgz#5df277694eb3c48bc5c4b05af3e8b7e09c5a6d1a" - integrity sha512-898rgRXLAyRkM1GryrrBHGkqA5hlpkV5MhtZwg9QXeiyLUYs2k00Un05aX5l2/yJIOObYKOpS2JNo8nJDE7fWQ== +browserslist@^4.11.1, browserslist@^4.21.9: + version "4.21.10" + resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz#dbbac576628c13d3b2231332cb2ec5a46e015bb0" + integrity sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ== dependencies: - caniuse-lite "^1.0.30001370" - electron-to-chromium "^1.4.202" - node-releases "^2.0.6" - update-browserslist-db "^1.0.5" + caniuse-lite "^1.0.30001517" + electron-to-chromium "^1.4.477" + node-releases "^2.0.13" + update-browserslist-db "^1.0.11" bs-logger@0.x: version "0.2.6" - resolved "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz" + resolved "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== dependencies: fast-json-stable-stringify "2.x" @@ -3833,22 +3348,22 @@ buffer-from@^1.0.0: builtins@^1.0.3: version "1.0.3" - resolved "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz" + resolved "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" integrity sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ== byline@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz" + resolved "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1" integrity sha512-s6webAy+R4SR8XVuJWt2V2rGvhnrhxN+9S15GNuTK3wKPOXFF6RNc+8ug2XhH+2s4f+uudG4kUVYmYOQWL2g0Q== byte-size@^7.0.0: version "7.0.1" - resolved "https://registry.npmjs.org/byte-size/-/byte-size-7.0.1.tgz" + resolved "https://registry.npmjs.org/byte-size/-/byte-size-7.0.1.tgz#b1daf3386de7ab9d706b941a748dbfc71130dee3" integrity sha512-crQdqyCwhokxwV1UyDzLZanhkugAgft7vt0qbbdt60C6Zf3CAiGmtUCylbtYwrU6loOUw3euGrNtW1J651ot1A== cacache@^15.0.5, cacache@^15.2.0: version "15.3.0" - resolved "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz" + resolved "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz#dc85380fb2f556fe3dda4c719bfa0ec875a7f1eb" integrity sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ== dependencies: "@npmcli/fs" "^1.0.0" @@ -3872,16 +3387,16 @@ cacache@^15.0.5, cacache@^15.2.0: call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz" + resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== dependencies: function-bind "^1.1.1" get-intrinsic "^1.0.2" call-me-maybe@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz" - integrity sha512-wCyFsDQkKPwwF8BDwOiWNx/9K45L/hvggQiDbve+viMNMQnWhrlYIuBk09offfwCRtCO9P6XwUttufzU11WCVw== + version "1.0.2" + resolved "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz#03f964f19522ba643b1b0693acb9152fe2074baa" + integrity sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ== callsites@^3.0.0: version "3.1.0" @@ -3890,7 +3405,7 @@ callsites@^3.0.0: camelcase-keys@^6.2.2: version "6.2.2" - resolved "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz" + resolved "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz#5e755d6ba51aa223ec7d3d52f25778210f9dc3c0" integrity sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg== dependencies: camelcase "^5.3.1" @@ -3907,24 +3422,24 @@ camelcase@^6.2.0: resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001349, caniuse-lite@^1.0.30001370: - version "1.0.30001374" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001374.tgz#3dab138e3f5485ba2e74bd13eca7fe1037ce6f57" - integrity sha512-mWvzatRx3w+j5wx/mpFN5v5twlPrabG8NqX2c6e45LCpymdoGqNvRkRutFUqpRTXKFQFNQJasvK0YT7suW6/Hw== +caniuse-lite@^1.0.30001517: + version "1.0.30001519" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001519.tgz#3e7b8b8a7077e78b0eb054d69e6edf5c7df35601" + integrity sha512-0QHgqR+Jv4bxHMp8kZ1Kn8CH55OikjKJ6JmKkZYP1F3D7w+lnFXF70nG5eNfsZS89jadi5Ywy5UCSKLAglIRkg== case@1.6.3: version "1.6.3" - resolved "https://registry.npmjs.org/case/-/case-1.6.3.tgz" + resolved "https://registry.npmjs.org/case/-/case-1.6.3.tgz#0a4386e3e9825351ca2e6216c60467ff5f1ea1c9" integrity sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ== caseless@~0.12.0: version "0.12.0" - resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz" + resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== chalk@^1.0.0, chalk@^1.1.3: version "1.1.3" - resolved "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz" + resolved "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" integrity sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A== dependencies: ansi-styles "^2.2.1" @@ -3933,7 +3448,7 @@ chalk@^1.0.0, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.4.2: +chalk@^2.4.2: version "2.4.2" resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -3957,17 +3472,17 @@ char-regex@^1.0.2: chardet@^0.4.0: version "0.4.2" - resolved "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz" + resolved "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" integrity sha512-j/Toj7f1z98Hh2cYo2BVr85EpIRWqUi7rtRSGxh/cqUjqrnJe9l9UE7IUGd2vQ2p+kSHLkSzObQPZPLUC6TQwg== chardet@^0.7.0: version "0.7.0" - resolved "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz" + resolved "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== chokidar@^3.4.0, chokidar@^3.4.3: version "3.5.3" - resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== dependencies: anymatch "~3.1.2" @@ -3982,32 +3497,32 @@ chokidar@^3.4.0, chokidar@^3.4.3: chownr@^1.1.4: version "1.1.4" - resolved "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz" + resolved "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== chownr@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz" + resolved "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== ci-info@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz" + resolved "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== ci-info@^3.2.0: - version "3.3.2" - resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz#6d2967ffa407466481c6c90b6e16b3098f080128" - integrity sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg== + version "3.8.0" + resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91" + integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw== cjs-module-lexer@^1.0.0: - version "1.2.2" - resolved "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40" - integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== + version "1.2.3" + resolved "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz#6c370ab19f8a3394e318fe682686ec0ac684d107" + integrity sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ== clean-stack@^2.0.0: version "2.2.0" - resolved "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz" + resolved "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== cli-color@^2.0.2: @@ -4023,26 +3538,26 @@ cli-color@^2.0.2: cli-cursor@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz" + resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" integrity sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw== dependencies: restore-cursor "^2.0.0" cli-cursor@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz" + resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== dependencies: restore-cursor "^3.1.0" cli-width@^2.0.0: version "2.2.1" - resolved "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz" + resolved "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw== cli-width@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz" + resolved "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== cliui@^7.0.2: @@ -4054,9 +3569,18 @@ cliui@^7.0.2: strip-ansi "^6.0.0" wrap-ansi "^7.0.0" +cliui@^8.0.1: + version "8.0.1" + resolved "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" + integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.1" + wrap-ansi "^7.0.0" + clone-deep@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz" + resolved "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== dependencies: is-plain-object "^2.0.4" @@ -4065,12 +3589,12 @@ clone-deep@^4.0.1: clone@^1.0.2: version "1.0.4" - resolved "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz" + resolved "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== cmd-shim@^4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/cmd-shim/-/cmd-shim-4.1.0.tgz" + resolved "https://registry.npmjs.org/cmd-shim/-/cmd-shim-4.1.0.tgz#b3a904a6743e9fede4148c6f3800bf2a08135bdd" integrity sha512-lb9L7EM4I/ZRVuljLPEtUJOP+xiQVknZ4ZMpMgEp4JzNldPb27HU03hi6K1/6CoIuit/Zm/LQXySErFeXxDprw== dependencies: mkdirp-infer-owner "^2.0.0" @@ -4082,13 +3606,13 @@ co@^4.6.0: code-point-at@^1.0.0: version "1.1.0" - resolved "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz" + resolved "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" integrity sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA== collect-v8-coverage@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" - integrity sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg== + version "1.0.2" + resolved "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" + integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q== color-convert@^1.9.0: version "1.9.3" @@ -4116,12 +3640,12 @@ color-name@~1.1.4: colors@^1.1.2: version "1.4.0" - resolved "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz" + resolved "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== columnify@^1.5.4: version "1.6.0" - resolved "https://registry.npmjs.org/columnify/-/columnify-1.6.0.tgz" + resolved "https://registry.npmjs.org/columnify/-/columnify-1.6.0.tgz#6989531713c9008bb29735e61e37acf5bd553cf3" integrity sha512-lomjuFZKfM6MSAnV9aCZC9sc0qGbmZdfygNv+nCpqVkSKdCxCklLtd16O0EILGkImHw9ZpHkAnHaB+8Zxq5W6Q== dependencies: strip-ansi "^6.0.1" @@ -4129,7 +3653,7 @@ columnify@^1.5.4: combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.8" - resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz" + resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== dependencies: delayed-stream "~1.0.0" @@ -4141,17 +3665,17 @@ commander@^4.0.1: commander@^6.2.0: version "6.2.1" - resolved "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz" + resolved "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== commondir@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz" + resolved "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== compare-func@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz" + resolved "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz#fb65e75edbddfd2e568554e8b5b05fff7a51fcb3" integrity sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA== dependencies: array-ify "^1.0.0" @@ -4164,7 +3688,7 @@ concat-map@0.0.1: concat-stream@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz" + resolved "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz#414cf5af790a48c60ab9be4527d56d5e41133cb1" integrity sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A== dependencies: buffer-from "^1.0.0" @@ -4174,7 +3698,7 @@ concat-stream@^2.0.0: config-chain@^1.1.12: version "1.1.13" - resolved "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz" + resolved "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz#fad0795aa6a6cdaff9ed1b68e9dff94372c232f4" integrity sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ== dependencies: ini "^1.3.4" @@ -4182,12 +3706,12 @@ config-chain@^1.1.12: console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz" + resolved "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== conventional-changelog-angular@^5.0.12: version "5.0.13" - resolved "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.13.tgz" + resolved "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.13.tgz#896885d63b914a70d4934b59d2fe7bde1832b28c" integrity sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA== dependencies: compare-func "^2.0.0" @@ -4195,7 +3719,7 @@ conventional-changelog-angular@^5.0.12: conventional-changelog-core@^4.2.2: version "4.2.4" - resolved "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.2.4.tgz" + resolved "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.2.4.tgz#e50d047e8ebacf63fac3dc67bf918177001e1e9f" integrity sha512-gDVS+zVJHE2v4SLc6B0sLsPiloR0ygU7HaDW14aNJE1v4SlqJPILPl/aJC7YdtRE4CybBf8gDwObBvKha8Xlyg== dependencies: add-stream "^1.0.0" @@ -4215,12 +3739,12 @@ conventional-changelog-core@^4.2.2: conventional-changelog-preset-loader@^2.3.4: version "2.3.4" - resolved "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz" + resolved "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz#14a855abbffd59027fd602581f1f34d9862ea44c" integrity sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g== conventional-changelog-writer@^5.0.0: version "5.0.1" - resolved "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-5.0.1.tgz" + resolved "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-5.0.1.tgz#e0757072f045fe03d91da6343c843029e702f359" integrity sha512-5WsuKUfxW7suLblAbFnxAcrvf6r+0b7GvNaWUwUIk0bXMnENP/PEieGKVUQrjPqwPT4o3EPAASBXiY6iHooLOQ== dependencies: conventional-commits-filter "^2.0.7" @@ -4235,7 +3759,7 @@ conventional-changelog-writer@^5.0.0: conventional-commits-filter@^2.0.7: version "2.0.7" - resolved "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz" + resolved "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz#f8d9b4f182fce00c9af7139da49365b136c8a0b3" integrity sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA== dependencies: lodash.ismatch "^4.4.0" @@ -4243,7 +3767,7 @@ conventional-commits-filter@^2.0.7: conventional-commits-parser@^3.2.0: version "3.2.4" - resolved "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.4.tgz" + resolved "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.4.tgz#a7d3b77758a202a9b2293d2112a8d8052c740972" integrity sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q== dependencies: JSONStream "^1.0.4" @@ -4255,7 +3779,7 @@ conventional-commits-parser@^3.2.0: conventional-recommended-bump@^6.1.0: version "6.1.0" - resolved "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-6.1.0.tgz" + resolved "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-6.1.0.tgz#cfa623285d1de554012f2ffde70d9c8a22231f55" integrity sha512-uiApbSiNGM/kkdL9GTOLAqC4hbptObFo4wW2QRyHsKciGAfQuLU1ShZ1BIVI/+K2BE/W1AWYQMCXAsv4dyKPaw== dependencies: concat-stream "^2.0.0" @@ -4268,38 +3792,35 @@ conventional-recommended-bump@^6.1.0: q "^1.5.1" convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: - version "1.8.0" - resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" - integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== - dependencies: - safe-buffer "~5.1.1" + version "1.9.0" + resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" + integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== core-js-compat@^3.21.0, core-js-compat@^3.22.1, core-js-compat@^3.6.2: - version "3.23.1" - resolved "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.23.1.tgz" - integrity sha512-KeYrEc8t6FJsKYB2qnDwRHWaC0cJNaqlHfCpMe5q3j/W1nje3moib/txNklddLPCtGb+etcBIyJ8zuMa/LN5/A== + version "3.32.0" + resolved "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.32.0.tgz#f41574b6893ab15ddb0ac1693681bd56c8550a90" + integrity sha512-7a9a3D1k4UCVKnLhrgALyFcP7YCsLOQIxPd0dKjf/6GuPcgyiGP70ewWdCGrSK7evyhymi0qO4EqCmSJofDeYw== dependencies: - browserslist "^4.20.4" - semver "7.0.0" + browserslist "^4.21.9" -core-js@^3.22.1: - version "3.23.1" - resolved "https://registry.npmjs.org/core-js/-/core-js-3.23.1.tgz" - integrity sha512-wfMYHWi1WQjpgZNC9kAlN4ut04TM9fUTdi7CqIoTVM7yaiOUQTklOzfb+oWH3r9edQcT3F887swuVmxrV+CC8w== +core-js@^3.30.2: + version "3.32.0" + resolved "https://registry.npmjs.org/core-js/-/core-js-3.32.0.tgz#7643d353d899747ab1f8b03d2803b0312a0fb3b6" + integrity sha512-rd4rYZNlF3WuoYuRIDEmbR/ga9CeuWX9U05umAvgrrZoHY4Z++cp/xwPQMvUpBB4Ag6J8KfD80G0zwCyaSxDww== core-util-is@1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" + resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ== core-util-is@~1.0.0: version "1.0.3" - resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz" + resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== cosmiconfig@^6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz" + resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz#da4fee853c52f6b1e6935f41c1a2fc50bd4a9982" integrity sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg== dependencies: "@types/parse-json" "^4.0.0" @@ -4309,9 +3830,9 @@ cosmiconfig@^6.0.0: yaml "^1.7.2" cosmiconfig@^7.0.0: - version "7.0.1" - resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz" - integrity sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ== + version "7.1.0" + resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz#1443b9afa596b670082ea46cbd8f6a62b84635f6" + integrity sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA== dependencies: "@types/parse-json" "^4.0.0" import-fresh "^3.2.1" @@ -4329,7 +3850,7 @@ cosmjs-types@^0.7.1: cross-env@^7.0.2: version "7.0.3" - resolved "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz" + resolved "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf" integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw== dependencies: cross-spawn "^7.0.1" @@ -4345,7 +3866,7 @@ cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: d@1, d@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/d/-/d-1.0.1.tgz" + resolved "https://registry.npmjs.org/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== dependencies: es5-ext "^0.10.50" @@ -4353,19 +3874,19 @@ d@1, d@^1.0.1: dargs@7.0.0, dargs@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz" + resolved "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc" integrity sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg== dashdash@^1.12.0: version "1.14.1" - resolved "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz" + resolved "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" integrity sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g== dependencies: assert-plus "^1.0.0" dateformat@^3.0.0: version "3.0.3" - resolved "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz" + resolved "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3: @@ -4377,26 +3898,26 @@ debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3: debuglog@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz" + resolved "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" integrity sha512-syBZ+rnAK3EgMsH2aYEOLUW7mZSY9Gb+0wUMCFsZvcmiz+HigA0LOcq/HoQqVuGG+EKykunc7QG2bzrponfaSw== decamelize-keys@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz" - integrity sha512-ocLWuYzRPoS9bfiSdDd3cxvrzovVMZnRDVEzAs+hWIVXGDbHxWMECij2OBuyB/An0FFW/nLuq6Kv1i/YC5Qfzg== + version "1.1.1" + resolved "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz#04a2d523b2f18d80d0158a43b895d56dff8d19d8" + integrity sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg== dependencies: decamelize "^1.1.0" map-obj "^1.0.0" decamelize@^1.1.0: version "1.2.0" - resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz" + resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz" - integrity sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og== + version "0.2.2" + resolved "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" + integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== dedent@^0.7.0: version "0.7.0" @@ -4408,54 +3929,54 @@ deep-is@^0.1.3: resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== -deepmerge@4.2.2, deepmerge@^4.2.2: +deepmerge@4.2.2: version "4.2.2" resolved "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== +deepmerge@^4.2.2: + version "4.3.1" + resolved "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" + integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== + defaults@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz" - integrity sha512-s82itHOnYrN0Ib8r+z7laQz3sdE+4FP3d9Q7VLO7U+KRT+CR0GsWuyHxzdAY82I7cXv0G/twrqomTJLOssO5HA== + version "1.0.4" + resolved "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz#b0b02062c1e2aa62ff5d9528f0f98baa90978d7a" + integrity sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A== dependencies: clone "^1.0.2" -define-properties@^1.1.3, define-properties@^1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz" - integrity sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA== +define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" + integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== dependencies: has-property-descriptors "^1.0.0" object-keys "^1.1.1" delayed-stream@~1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" + resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== delegates@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz" + resolved "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ== -depd@^1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz" - integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== - deprecation@^2.0.0, deprecation@^2.3.1: version "2.3.1" - resolved "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz" + resolved "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== detect-indent@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz" + resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" integrity sha512-rlpvsxUtM0PQvy9iZe640/IWwWYyBsTApREbA1pHOpmOUIl9MkP/U4z7vTtg4Oaojvqhxt7sdufnT0EzGaR31g== detect-indent@^6.0.0: version "6.1.0" - resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz" + resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6" integrity sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA== detect-newline@^3.0.0: @@ -4465,7 +3986,7 @@ detect-newline@^3.0.0: dezalgo@^1.0.0: version "1.0.4" - resolved "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz" + resolved "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz#751235260469084c132157dfa857f386d4c33d81" integrity sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig== dependencies: asap "^2.0.0" @@ -4492,14 +4013,14 @@ doctrine@^3.0.0: dot-prop@^5.1.0: version "5.3.0" - resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz" + resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q== dependencies: is-obj "^2.0.0" dot-prop@^6.0.1: version "6.0.1" - resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz" + resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz#fc26b3cf142b9e59b74dbd39ed66ce620c681083" integrity sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA== dependencies: is-obj "^2.0.0" @@ -4511,26 +4032,21 @@ dotty@0.1.2: duplexer@^0.1.1: version "0.1.2" - resolved "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz" + resolved "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== ecc-jsbn@~0.1.1: version "0.1.2" - resolved "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz" + resolved "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" integrity sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw== dependencies: jsbn "~0.1.0" safer-buffer "^2.1.0" -electron-to-chromium@^1.4.147: - version "1.4.211" - resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.211.tgz#afaa8b58313807501312d598d99b953568d60f91" - integrity sha512-BZSbMpyFQU0KBJ1JG26XGeFI3i4op+qOYGxftmZXFZoHkhLgsSv4DHDJfl8ogII3hIuzGt51PaZ195OVu0yJ9A== - -electron-to-chromium@^1.4.202: - version "1.4.212" - resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.212.tgz#20cd48e88288fd2428138c108804edb1961bf559" - integrity sha512-LjQUg1SpLj2GfyaPDVBUHdhmlDU1vDB4f0mJWSGkISoXQrn5/lH3ECPCuo2Bkvf6Y30wO+b69te+rZK/llZmjg== +electron-to-chromium@^1.4.477: + version "1.4.488" + resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.488.tgz#442b1855f8c84fb1ed79f518985c65db94f64cc9" + integrity sha512-Dv4sTjiW7t/UWGL+H8ZkgIjtUAVZDgb/PwGWvMsCT7jipzUV/u5skbLXPFKb6iV0tiddVi/bcS2/kUrczeWgIQ== elliptic@^6.5.4: version "6.5.4" @@ -4557,24 +4073,24 @@ emoji-regex@^8.0.0: encoding@^0.1.12: version "0.1.13" - resolved "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz" + resolved "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== dependencies: iconv-lite "^0.6.2" env-paths@^2.2.0: version "2.2.1" - resolved "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz" + resolved "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== envinfo@^7.7.4: - version "7.8.1" - resolved "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz" - integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== + version "7.10.0" + resolved "https://registry.npmjs.org/envinfo/-/envinfo-7.10.0.tgz#55146e3909cc5fe63c22da63fb15b05aeac35b13" + integrity sha512-ZtUjZO6l5mwTHvc1L9+1q5p/R3wTopcfqMW8r5t8SJSKqeVI/LtajORwRFEKpEFuekjD0VBjwu1HMxL4UalIRw== err-code@^2.0.2: version "2.0.3" - resolved "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz" + resolved "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz#23c2f3b756ffdfc608d30e27c9a941024807e7f9" integrity sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA== error-ex@^1.3.1: @@ -4584,59 +4100,75 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.19.0, es-abstract@^1.19.2, es-abstract@^1.19.5, es-abstract@^1.20.1: - version "1.20.1" - resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.1.tgz" - integrity sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA== +es-abstract@^1.19.0, es-abstract@^1.20.4, es-abstract@^1.21.2: + version "1.22.1" + resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.1.tgz#8b4e5fc5cefd7f1660f0f8e1a52900dfbc9d9ccc" + integrity sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw== dependencies: + array-buffer-byte-length "^1.0.0" + arraybuffer.prototype.slice "^1.0.1" + available-typed-arrays "^1.0.5" call-bind "^1.0.2" + es-set-tostringtag "^2.0.1" es-to-primitive "^1.2.1" - function-bind "^1.1.1" function.prototype.name "^1.1.5" - get-intrinsic "^1.1.1" + get-intrinsic "^1.2.1" get-symbol-description "^1.0.0" + globalthis "^1.0.3" + gopd "^1.0.1" has "^1.0.3" has-property-descriptors "^1.0.0" + has-proto "^1.0.1" has-symbols "^1.0.3" - internal-slot "^1.0.3" - is-callable "^1.2.4" + internal-slot "^1.0.5" + is-array-buffer "^3.0.2" + is-callable "^1.2.7" is-negative-zero "^2.0.2" is-regex "^1.1.4" is-shared-array-buffer "^1.0.2" is-string "^1.0.7" + is-typed-array "^1.1.10" is-weakref "^1.0.2" - object-inspect "^1.12.0" + object-inspect "^1.12.3" object-keys "^1.1.1" - object.assign "^4.1.2" - regexp.prototype.flags "^1.4.3" - string.prototype.trimend "^1.0.5" - string.prototype.trimstart "^1.0.5" + object.assign "^4.1.4" + regexp.prototype.flags "^1.5.0" + safe-array-concat "^1.0.0" + safe-regex-test "^1.0.0" + string.prototype.trim "^1.2.7" + string.prototype.trimend "^1.0.6" + string.prototype.trimstart "^1.0.6" + typed-array-buffer "^1.0.0" + typed-array-byte-length "^1.0.0" + typed-array-byte-offset "^1.0.0" + typed-array-length "^1.0.4" unbox-primitive "^1.0.2" + which-typed-array "^1.1.10" es-array-method-boxes-properly@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz" + resolved "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== +es-set-tostringtag@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz#338d502f6f674301d710b80c8592de8a15f09cd8" + integrity sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg== + dependencies: + get-intrinsic "^1.1.3" + has "^1.0.3" + has-tostringtag "^1.0.0" + es-to-primitive@^1.2.1: version "1.2.1" - resolved "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz" + resolved "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== dependencies: is-callable "^1.1.4" is-date-object "^1.0.1" is-symbol "^1.0.2" -es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@^0.10.53, es5-ext@~0.10.14, es5-ext@~0.10.2, es5-ext@~0.10.46: - version "0.10.61" - resolved "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.61.tgz" - integrity sha512-yFhIqQAzu2Ca2I4SE2Au3rxVfmohU9Y7wqGR+s7+H7krk26NXhIRAZDgqd6xqjCEFUomDEA3/Bo/7fKmIkW1kA== - dependencies: - es6-iterator "^2.0.3" - es6-symbol "^3.1.3" - next-tick "^1.1.0" - -es5-ext@^0.10.61: +es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@^0.10.53, es5-ext@^0.10.61, es5-ext@~0.10.14, es5-ext@~0.10.2, es5-ext@~0.10.46: version "0.10.62" resolved "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz#5e6adc19a6da524bf3d1e02bbc8960e5eb49a9a5" integrity sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA== @@ -4647,7 +4179,7 @@ es5-ext@^0.10.61: es6-iterator@^2.0.3: version "2.0.3" - resolved "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz" + resolved "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" integrity sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g== dependencies: d "1" @@ -4656,7 +4188,7 @@ es6-iterator@^2.0.3: es6-symbol@^3.1.1, es6-symbol@^3.1.3: version "3.1.3" - resolved "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz" + resolved "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== dependencies: d "^1.0.1" @@ -4664,7 +4196,7 @@ es6-symbol@^3.1.1, es6-symbol@^3.1.3: es6-weak-map@^2.0.3: version "2.0.3" - resolved "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz" + resolved "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz#b6da1f16cc2cc0d9be43e6bdbfc5e7dfcdf31d53" integrity sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA== dependencies: d "1" @@ -4693,9 +4225,9 @@ escape-string-regexp@^4.0.0: integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== eslint-config-prettier@^8.5.0: - version "8.5.0" - resolved "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz" - integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q== + version "8.10.0" + resolved "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz#3a06a662130807e2502fc3ff8b4143d8a0658e11" + integrity sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg== eslint-plugin-prettier@^4.2.1: version "4.2.1" @@ -4704,7 +4236,7 @@ eslint-plugin-prettier@^4.2.1: dependencies: prettier-linter-helpers "^1.0.0" -eslint-scope@^5.1.1: +eslint-scope@5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== @@ -4713,9 +4245,9 @@ eslint-scope@^5.1.1: estraverse "^4.1.1" eslint-scope@^7.1.1: - version "7.1.1" - resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz#fff34894c2f65e5226d3041ac480b4513a163642" - integrity sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw== + version "7.2.2" + resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" + integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" @@ -4732,10 +4264,10 @@ eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0: resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.3.0: - version "3.3.0" - resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" - integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: + version "3.4.2" + resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz#8c2095440eca8c933bedcadf16fefa44dbe9ba5f" + integrity sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw== eslint@8.21.0: version "8.21.0" @@ -4782,14 +4314,14 @@ eslint@8.21.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^9.3.2, espree@^9.3.3: - version "9.3.3" - resolved "https://registry.npmjs.org/espree/-/espree-9.3.3.tgz#2dd37c4162bb05f433ad3c1a52ddf8a49dc08e9d" - integrity sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng== +espree@^9.3.3, espree@^9.4.0: + version "9.6.1" + resolved "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" + integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== dependencies: - acorn "^8.8.0" + acorn "^8.9.0" acorn-jsx "^5.3.2" - eslint-visitor-keys "^3.3.0" + eslint-visitor-keys "^3.4.1" esprima@^4.0.0: version "4.0.1" @@ -4797,9 +4329,9 @@ esprima@^4.0.0: integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== esquery@^1.4.0: - version "1.4.0" - resolved "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" - integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== + version "1.5.0" + resolved "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" + integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== dependencies: estraverse "^5.1.0" @@ -4827,7 +4359,7 @@ esutils@^2.0.2: event-emitter@^0.3.5: version "0.3.5" - resolved "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz" + resolved "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" integrity sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA== dependencies: d "1" @@ -4835,7 +4367,7 @@ event-emitter@^0.3.5: eventemitter3@^4.0.4: version "4.0.7" - resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz" + resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== execa@^5.0.0: @@ -4858,7 +4390,7 @@ exit@^0.1.2: resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expect@^28.1.3: +expect@^28.0.0, expect@^28.1.3: version "28.1.3" resolved "https://registry.npmjs.org/expect/-/expect-28.1.3.tgz#90a7c1a124f1824133dd4533cce2d2bdcb6603ec" integrity sha512-eEh0xn8HlsuOBxFgIss+2mX85VAS4Qy3OSkjV7rlBWljtA4oWH37glVGyOZSZvErDT/yBywZdPGwCXuTvSG85g== @@ -4870,20 +4402,20 @@ expect@^28.1.3: jest-util "^28.1.3" ext@^1.1.2: - version "1.6.0" - resolved "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz" - integrity sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg== + version "1.7.0" + resolved "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz#0ea4383c0103d60e70be99e9a7f11027a33c4f5f" + integrity sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw== dependencies: - type "^2.5.0" + type "^2.7.2" extend@~3.0.2: version "3.0.2" - resolved "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz" + resolved "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== external-editor@^2.0.4: version "2.2.0" - resolved "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz" + resolved "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz#045511cfd8d133f3846673d1047c154e214ad3d5" integrity sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A== dependencies: chardet "^0.4.0" @@ -4892,7 +4424,7 @@ external-editor@^2.0.4: external-editor@^3.0.3: version "3.1.0" - resolved "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz" + resolved "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== dependencies: chardet "^0.7.0" @@ -4901,12 +4433,12 @@ external-editor@^3.0.3: extsprintf@1.3.0: version "1.3.0" - resolved "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz" + resolved "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g== extsprintf@^1.2.0: version "1.4.1" - resolved "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.1.tgz" + resolved "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: @@ -4915,14 +4447,14 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== fast-diff@^1.1.2: - version "1.2.0" - resolved "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" - integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + version "1.3.0" + resolved "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0" + integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== fast-glob@^3.2.9: - version "3.2.11" - resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" - integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== + version "3.3.1" + resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4" + integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" @@ -4941,29 +4473,29 @@ fast-levenshtein@^2.0.6: integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== fastq@^1.6.0: - version "1.13.0" - resolved "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" - integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== + version "1.15.0" + resolved "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a" + integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== dependencies: reusify "^1.0.4" fb-watchman@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" - integrity sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg== + version "2.0.2" + resolved "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" + integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA== dependencies: bser "2.1.1" figures@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz" + resolved "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" integrity sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA== dependencies: escape-string-regexp "^1.0.5" figures@^3.0.0: version "3.2.0" - resolved "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz" + resolved "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== dependencies: escape-string-regexp "^1.0.5" @@ -4984,12 +4516,12 @@ fill-range@^7.0.1: filter-obj@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz" + resolved "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz#9b311112bc6c6127a16e016c6c5d7f19e0805c5b" integrity sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ== find-cache-dir@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz" + resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" integrity sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ== dependencies: commondir "^1.0.1" @@ -4998,14 +4530,14 @@ find-cache-dir@^2.0.0: find-up@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz" + resolved "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" integrity sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ== dependencies: locate-path "^2.0.0" find-up@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz" + resolved "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== dependencies: locate-path "^3.0.0" @@ -5035,23 +4567,30 @@ flat-cache@^3.0.4: rimraf "^3.0.2" flatted@^3.1.0: - version "3.2.6" - resolved "https://registry.npmjs.org/flatted/-/flatted-3.2.6.tgz#022e9218c637f9f3fc9c35ab9c9193f05add60b2" - integrity sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ== + version "3.2.7" + resolved "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" + integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== follow-redirects@^1.14.0: version "1.15.2" resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== +for-each@^0.3.3: + version "0.3.3" + resolved "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== + dependencies: + is-callable "^1.1.3" + forever-agent@~0.6.1: version "0.6.1" - resolved "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz" + resolved "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== form-data@~2.3.2: version "2.3.3" - resolved "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz" + resolved "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== dependencies: asynckit "^0.4.0" @@ -5060,7 +4599,7 @@ form-data@~2.3.2: fs-extra@^9.1.0: version "9.1.0" - resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== dependencies: at-least-node "^1.0.0" @@ -5070,14 +4609,14 @@ fs-extra@^9.1.0: fs-minipass@^1.2.7: version "1.2.7" - resolved "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz" + resolved "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== dependencies: minipass "^2.6.0" fs-minipass@^2.0.0, fs-minipass@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz" + resolved "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg== dependencies: minipass "^3.0.0" @@ -5104,7 +4643,7 @@ function-bind@^1.1.1: function.prototype.name@^1.1.5: version "1.1.5" - resolved "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz" + resolved "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz#cce0505fe1ffb80503e6f9e46cc64e46a12a9621" integrity sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA== dependencies: call-bind "^1.0.2" @@ -5117,19 +4656,19 @@ functional-red-black-tree@^1.0.1: resolved "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== -functions-have-names@^1.2.2: +functions-have-names@^1.2.2, functions-have-names@^1.2.3: version "1.2.3" - resolved "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz" + resolved "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== fuzzy@0.1.3: version "0.1.3" - resolved "https://registry.npmjs.org/fuzzy/-/fuzzy-0.1.3.tgz" + resolved "https://registry.npmjs.org/fuzzy/-/fuzzy-0.1.3.tgz#4c76ec2ff0ac1a36a9dccf9a00df8623078d4ed8" integrity sha512-/gZffu4ykarLrCiP3Ygsa86UAo1E5vEVlvTrpkKywXSbP9Xhln3oSp9QSV57gEq3JFFpGJ4GZ+5zdEp3FcUh4w== gauge@~2.7.3: version "2.7.4" - resolved "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz" + resolved "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" integrity sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg== dependencies: aproba "^1.0.3" @@ -5151,13 +4690,14 @@ get-caller-file@^2.0.5: resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: - version "1.1.2" - resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz" - integrity sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA== +get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0, get-intrinsic@^1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" + integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== dependencies: function-bind "^1.1.1" has "^1.0.3" + has-proto "^1.0.1" has-symbols "^1.0.3" get-package-type@^0.1.0: @@ -5167,7 +4707,7 @@ get-package-type@^0.1.0: get-pkg-repo@^4.0.0: version "4.2.1" - resolved "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-4.2.1.tgz" + resolved "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-4.2.1.tgz#75973e1c8050c73f48190c52047c4cee3acbf385" integrity sha512-2+QbHjFRfGB74v/pYWjd5OhU3TDIC2Gv/YKUTk/tCvAz0pkn/Mz6P3uByuBimLOcPvN2jYdScl3xGFSrx0jEcA== dependencies: "@hutson/parse-repository-url" "^3.0.0" @@ -5177,12 +4717,12 @@ get-pkg-repo@^4.0.0: get-port@^5.1.1: version "5.1.1" - resolved "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz" + resolved "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz#0469ed07563479de6efb986baf053dcd7d4e3193" integrity sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ== get-stdin@^8.0.0: version "8.0.0" - resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz" + resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53" integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg== get-stream@^6.0.0: @@ -5192,7 +4732,7 @@ get-stream@^6.0.0: get-symbol-description@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz" + resolved "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== dependencies: call-bind "^1.0.2" @@ -5200,14 +4740,14 @@ get-symbol-description@^1.0.0: getpass@^0.1.1: version "0.1.7" - resolved "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz" + resolved "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" integrity sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng== dependencies: assert-plus "^1.0.0" git-raw-commits@^2.0.8: version "2.0.11" - resolved "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.11.tgz" + resolved "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.11.tgz#bc3576638071d18655e1cc60d7f524920008d723" integrity sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A== dependencies: dargs "^7.0.0" @@ -5218,7 +4758,7 @@ git-raw-commits@^2.0.8: git-remote-origin-url@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz" + resolved "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz#5282659dae2107145a11126112ad3216ec5fa65f" integrity sha512-eU+GGrZgccNJcsDH5LkXR3PB9M958hxc7sbA8DFJjrv9j4L2P/eZfKhM+QD6wyzpiv+b1BpK0XrYCxkovtjSLw== dependencies: gitconfiglocal "^1.0.0" @@ -5226,7 +4766,7 @@ git-remote-origin-url@^2.0.0: git-semver-tags@^4.1.1: version "4.1.1" - resolved "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.1.1.tgz" + resolved "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.1.1.tgz#63191bcd809b0ec3e151ba4751c16c444e5b5780" integrity sha512-OWyMt5zBe7xFs8vglMmhM9lRQzCWL3WjHtxNNfJTMngGym7pC1kh8sP6jevfydJ6LP3ZvGxfb6ABYgPUM0mtsA== dependencies: meow "^8.0.0" @@ -5234,7 +4774,7 @@ git-semver-tags@^4.1.1: git-up@^4.0.0: version "4.0.5" - resolved "https://registry.npmjs.org/git-up/-/git-up-4.0.5.tgz" + resolved "https://registry.npmjs.org/git-up/-/git-up-4.0.5.tgz#e7bb70981a37ea2fb8fe049669800a1f9a01d759" integrity sha512-YUvVDg/vX3d0syBsk/CKUTib0srcQME0JyHkL5BaYdwLsiCslPWmDSi8PUMo9pXYjrryMcmsCoCgsTpSCJEQaA== dependencies: is-ssh "^1.3.0" @@ -5242,21 +4782,21 @@ git-up@^4.0.0: git-url-parse@^11.4.4: version "11.6.0" - resolved "https://registry.npmjs.org/git-url-parse/-/git-url-parse-11.6.0.tgz" + resolved "https://registry.npmjs.org/git-url-parse/-/git-url-parse-11.6.0.tgz#c634b8de7faa66498a2b88932df31702c67df605" integrity sha512-WWUxvJs5HsyHL6L08wOusa/IXYtMuCAhrMmnTjQPpBU0TTHyDhnOATNH3xNQz7YOQUsqIIPTGr4xiVti1Hsk5g== dependencies: git-up "^4.0.0" gitconfiglocal@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz" + resolved "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz#41d045f3851a5ea88f03f24ca1c6178114464b9b" integrity sha512-spLUXeTAVHxDtKsJc8FkFVgFtMdEN9qPGpL23VfSHx4fP4+Ds097IXLvymbnDH8FnmxX5Nr9bPw3A+AQ6mWEaQ== dependencies: ini "^1.3.2" glob-parent@^5.1.1, glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" - resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" @@ -5277,7 +4817,7 @@ glob-promise@^4.2.2: glob@8.0.3: version "8.0.3" - resolved "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz" + resolved "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz#415c6eb2deed9e502c68fa44a272e6da6eeca42e" integrity sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ== dependencies: fs.realpath "^1.0.0" @@ -5303,14 +4843,14 @@ globals@^11.1.0: resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globals@^13.15.0: - version "13.17.0" - resolved "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz#902eb1e680a41da93945adbdcb5a9f361ba69bd4" - integrity sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw== +globals@^13.15.0, globals@^13.19.0: + version "13.20.0" + resolved "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82" + integrity sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ== dependencies: type-fest "^0.20.2" -globalthis@^1.0.1: +globalthis@^1.0.1, globalthis@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== @@ -5319,7 +4859,7 @@ globalthis@^1.0.1: globby@^11.0.2, globby@^11.1.0: version "11.1.0" - resolved "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz" + resolved "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== dependencies: array-union "^2.1.0" @@ -5329,10 +4869,17 @@ globby@^11.0.2, globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" + graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.3, graceful-fs@^4.2.9: - version "4.2.10" - resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" - integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== + version "4.2.11" + resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== grapheme-splitter@^1.0.4: version "1.0.4" @@ -5340,12 +4887,12 @@ grapheme-splitter@^1.0.4: integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== handlebars@^4.7.7: - version "4.7.7" - resolved "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz" - integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== + version "4.7.8" + resolved "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz#41c42c18b1be2365439188c77c6afae71c0cd9e9" + integrity sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ== dependencies: minimist "^1.2.5" - neo-async "^2.6.0" + neo-async "^2.6.2" source-map "^0.6.1" wordwrap "^1.0.0" optionalDependencies: @@ -5353,12 +4900,12 @@ handlebars@^4.7.7: har-schema@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz" + resolved "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" integrity sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q== har-validator@~5.1.3: version "5.1.5" - resolved "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz" + resolved "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== dependencies: ajv "^6.12.3" @@ -5366,19 +4913,19 @@ har-validator@~5.1.3: hard-rejection@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz" + resolved "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== has-ansi@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz" + resolved "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" integrity sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg== dependencies: ansi-regex "^2.0.0" has-bigints@^1.0.1, has-bigints@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz" + resolved "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== has-flag@^3.0.0: @@ -5393,26 +4940,31 @@ has-flag@^4.0.0: has-property-descriptors@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz" + resolved "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== dependencies: get-intrinsic "^1.1.1" -has-symbols@^1.0.1, has-symbols@^1.0.2, has-symbols@^1.0.3: +has-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" + integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== + +has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" - resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz" + resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== has-tostringtag@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz" + resolved "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== dependencies: has-symbols "^1.0.2" has-unicode@^2.0.0, has-unicode@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz" + resolved "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ== has@^1.0.3: @@ -5441,19 +4993,19 @@ hmac-drbg@^1.0.1: homedir-polyfill@^1.0.1: version "1.0.3" - resolved "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz" + resolved "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8" integrity sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA== dependencies: parse-passwd "^1.0.0" hosted-git-info@^2.1.4: version "2.8.9" - resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz" + resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== hosted-git-info@^4.0.0, hosted-git-info@^4.0.1: version "4.1.0" - resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz" + resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz#827b82867e9ff1c8d0c4d9d53880397d2c86d224" integrity sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA== dependencies: lru-cache "^6.0.0" @@ -5464,13 +5016,13 @@ html-escaper@^2.0.0: integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== http-cache-semantics@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz" - integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== + version "4.1.1" + resolved "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" + integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== http-proxy-agent@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz" + resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== dependencies: "@tootallnate/once" "1" @@ -5479,7 +5031,7 @@ http-proxy-agent@^4.0.1: http-signature@~1.2.0: version "1.2.0" - resolved "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz" + resolved "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" integrity sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ== dependencies: assert-plus "^1.0.0" @@ -5488,7 +5040,7 @@ http-signature@~1.2.0: https-proxy-agent@^5.0.0: version "5.0.1" - resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz" + resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== dependencies: agent-base "6" @@ -5501,40 +5053,40 @@ human-signals@^2.1.0: humanize-ms@^1.2.1: version "1.2.1" - resolved "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz" + resolved "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" integrity sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ== dependencies: ms "^2.0.0" iconv-lite@^0.4.17, iconv-lite@^0.4.24: version "0.4.24" - resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz" + resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== dependencies: safer-buffer ">= 2.1.2 < 3" iconv-lite@^0.6.2: version "0.6.3" - resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz" + resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== dependencies: safer-buffer ">= 2.1.2 < 3.0.0" ignore-walk@^3.0.3: version "3.0.4" - resolved "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.4.tgz" + resolved "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.4.tgz#c9a09f69b7c7b479a5d74ac1a3c0d4236d2a6335" integrity sha512-PY6Ii8o1jMRA1z4F2hRkH/xN59ox43DavKvD3oDpfurRlOJyAHpifIwpbdv1n4jt4ov0jSpw3kQ4GhJnpBL6WQ== dependencies: minimatch "^3.0.4" ignore@^5.2.0: - version "5.2.0" - resolved "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" - integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== + version "5.2.4" + resolved "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" + integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== import-fresh@^3.0.0, import-fresh@^3.1.0, import-fresh@^3.2.1: version "3.3.0" - resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz" + resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== dependencies: parent-module "^1.0.0" @@ -5555,12 +5107,12 @@ imurmurhash@^0.1.4: indent-string@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz" + resolved "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== infer-owner@^1.0.4: version "1.0.4" - resolved "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz" + resolved "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" integrity sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A== inflight@^1.0.4: @@ -5578,17 +5130,17 @@ inherits@2, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: inherits@2.0.3: version "2.0.3" - resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw== ini@^1.3.2, ini@^1.3.4: version "1.3.8" - resolved "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz" + resolved "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== init-package-json@^2.0.2: version "2.0.5" - resolved "https://registry.npmjs.org/init-package-json/-/init-package-json-2.0.5.tgz" + resolved "https://registry.npmjs.org/init-package-json/-/init-package-json-2.0.5.tgz#78b85f3c36014db42d8f32117252504f68022646" integrity sha512-u1uGAtEFu3VA6HNl/yUWw57jmKEMx8SKOxHhxjGnOFUiIlFnohKDFg4ZrPpv9wWqk44nDxGJAtqjdQFm+9XXQA== dependencies: npm-package-arg "^8.1.5" @@ -5601,7 +5153,7 @@ init-package-json@^2.0.2: inquirer-autocomplete-prompt@^0.11.1: version "0.11.1" - resolved "https://registry.npmjs.org/inquirer-autocomplete-prompt/-/inquirer-autocomplete-prompt-0.11.1.tgz" + resolved "https://registry.npmjs.org/inquirer-autocomplete-prompt/-/inquirer-autocomplete-prompt-0.11.1.tgz#f90ca9510a4c489882e9be294934bd8c2e575e09" integrity sha512-VM4eNiyRD4CeUc2cyKni+F8qgHwL9WC4LdOr+mEC85qP/QNsDV+ysVqUrJYhw1TmDQu1QVhc8hbaL7wfk8SJxw== dependencies: ansi-escapes "^2.0.0" @@ -5614,7 +5166,7 @@ inquirer-autocomplete-prompt@^0.11.1: inquirer@3.1.1: version "3.1.1" - resolved "https://registry.npmjs.org/inquirer/-/inquirer-3.1.1.tgz" + resolved "https://registry.npmjs.org/inquirer/-/inquirer-3.1.1.tgz#87621c4fba4072f48a8dd71c9f9df6f100b2d534" integrity sha512-H50sHQwgvvaTBd3HpKMVtL/u6LoHDvYym51gd7bGQe/+9HkCE+J0/3N5FJLfd6O6oz44hHewC2Pc2LodzWVafQ== dependencies: ansi-escapes "^2.0.0" @@ -5634,7 +5186,7 @@ inquirer@3.1.1: inquirer@^6.0.0: version "6.5.2" - resolved "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz" + resolved "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== dependencies: ansi-escapes "^3.2.0" @@ -5653,7 +5205,7 @@ inquirer@^6.0.0: inquirer@^7.3.3: version "7.3.3" - resolved "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz" + resolved "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz#04d176b2af04afc157a83fd7c100e98ee0aad003" integrity sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA== dependencies: ansi-escapes "^4.2.1" @@ -5672,38 +5224,47 @@ inquirer@^7.3.3: inquirerer@0.1.3: version "0.1.3" - resolved "https://registry.npmjs.org/inquirerer/-/inquirerer-0.1.3.tgz" + resolved "https://registry.npmjs.org/inquirerer/-/inquirerer-0.1.3.tgz#ecf91dc672b3bf45211d7f64bf5e8d5e171fd2ad" integrity sha512-yGgLUOqPxTsINBjZNZeLi3cv2zgxXtw9feaAOSJf2j6AqIT5Uxs5ZOqOrfAf+xP65Sicla1FD3iDxa3D6TsCAQ== dependencies: colors "^1.1.2" inquirer "^6.0.0" inquirer-autocomplete-prompt "^0.11.1" -internal-slot@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz" - integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== +internal-slot@^1.0.5: + version "1.0.5" + resolved "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz#f2a2ee21f668f8627a4667f309dc0f4fb6674986" + integrity sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ== dependencies: - get-intrinsic "^1.1.0" + get-intrinsic "^1.2.0" has "^1.0.3" side-channel "^1.0.4" interpret@^1.0.0: version "1.4.0" - resolved "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz" + resolved "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== invariant@^2.2.2: version "2.2.4" - resolved "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz" + resolved "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== dependencies: loose-envify "^1.0.0" -ip@^1.1.5: - version "1.1.8" - resolved "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz" - integrity sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg== +ip@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz#4cf4ab182fee2314c75ede1276f8c80b479936da" + integrity sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ== + +is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz#f2653ced8412081638ecb0ebbd0c41c6e0aecbbe" + integrity sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.0" + is-typed-array "^1.1.10" is-arrayish@^0.2.1: version "0.2.1" @@ -5712,7 +5273,7 @@ is-arrayish@^0.2.1: is-bigint@^1.0.1: version "1.0.4" - resolved "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz" + resolved "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== dependencies: has-bigints "^1.0.1" @@ -5726,41 +5287,34 @@ is-binary-path@~2.1.0: is-boolean-object@^1.1.0: version "1.1.2" - resolved "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz" + resolved "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== dependencies: call-bind "^1.0.2" has-tostringtag "^1.0.0" -is-callable@^1.1.4, is-callable@^1.2.4: - version "1.2.4" - resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz" - integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== +is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: + version "1.2.7" + resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" + integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== is-ci@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz" + resolved "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== dependencies: ci-info "^2.0.0" -is-core-module@^2.5.0: - version "2.9.0" - resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz" - integrity sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A== - dependencies: - has "^1.0.3" - -is-core-module@^2.8.1, is-core-module@^2.9.0: - version "2.10.0" - resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz#9012ede0a91c69587e647514e1d5277019e728ed" - integrity sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg== +is-core-module@^2.13.0, is-core-module@^2.5.0: + version "2.13.0" + resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz#bb52aa6e2cbd49a30c2ba68c42bf3435ba6072db" + integrity sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ== dependencies: has "^1.0.3" is-date-object@^1.0.1: version "1.0.5" - resolved "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz" + resolved "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== dependencies: has-tostringtag "^1.0.0" @@ -5772,14 +5326,14 @@ is-extglob@^2.1.1: is-fullwidth-code-point@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz" + resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" integrity sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw== dependencies: number-is-nan "^1.0.0" is-fullwidth-code-point@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz" + resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w== is-fullwidth-code-point@^3.0.0: @@ -5801,17 +5355,17 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: is-lambda@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz" + resolved "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5" integrity sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ== is-negative-zero@^2.0.2: version "2.0.2" - resolved "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz" + resolved "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== is-number-object@^1.0.4: version "1.0.7" - resolved "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz" + resolved "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== dependencies: has-tostringtag "^1.0.0" @@ -5823,39 +5377,39 @@ is-number@^7.0.0: is-obj@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz" + resolved "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz" + resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" integrity sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg== is-plain-obj@^2.0.0: version "2.1.0" - resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz" + resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== is-plain-object@^2.0.4: version "2.0.4" - resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz" + resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== dependencies: isobject "^3.0.1" is-plain-object@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz" + resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== is-promise@^2.2.2: version "2.2.2" - resolved "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz" + resolved "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== is-regex@^1.1.4: version "1.1.4" - resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz" + resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== dependencies: call-bind "^1.0.2" @@ -5863,17 +5417,17 @@ is-regex@^1.1.4: is-shared-array-buffer@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz" + resolved "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== dependencies: call-bind "^1.0.2" is-ssh@^1.3.0: - version "1.3.3" - resolved "https://registry.npmjs.org/is-ssh/-/is-ssh-1.3.3.tgz" - integrity sha512-NKzJmQzJfEEma3w5cJNcUMxoXfDjz0Zj0eyCalHn2E6VOwlzjZo0yuO2fcBSf8zhFuVCL/82/r5gRcoi6aEPVQ== + version "1.4.0" + resolved "https://registry.npmjs.org/is-ssh/-/is-ssh-1.4.0.tgz#4f8220601d2839d8fa624b3106f8e8884f01b8b2" + integrity sha512-x7+VxdxOdlV3CYpjvRLBv5Lo9OJerlYanjwFrPR9fuGPjCiNiCzFgAWpiLAohSbsnH4ZAys3SBh+hq5rJosxUQ== dependencies: - protocols "^1.1.0" + protocols "^2.0.1" is-stream@^2.0.0: version "2.0.1" @@ -5882,40 +5436,52 @@ is-stream@^2.0.0: is-string@^1.0.5, is-string@^1.0.7: version "1.0.7" - resolved "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz" + resolved "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== dependencies: has-tostringtag "^1.0.0" is-symbol@^1.0.2, is-symbol@^1.0.3: version "1.0.4" - resolved "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz" + resolved "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== dependencies: has-symbols "^1.0.2" is-text-path@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz" + resolved "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz#4e1aa0fb51bfbcb3e92688001397202c1775b66e" integrity sha512-xFuJpne9oFz5qDaodwmmG08e3CawH/2ZV8Qqza1Ko7Sk8POWbkRdwIoAWVhqvq0XeUzANEhKo2n0IXUGBm7A/w== dependencies: text-extensions "^1.0.0" +is-typed-array@^1.1.10, is-typed-array@^1.1.9: + version "1.1.12" + resolved "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz#d0bab5686ef4a76f7a73097b95470ab199c57d4a" + integrity sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg== + dependencies: + which-typed-array "^1.1.11" + is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz" + resolved "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== is-weakref@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz" + resolved "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== dependencies: call-bind "^1.0.2" +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== + isarray@~1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== isexe@^2.0.0: @@ -5925,7 +5491,7 @@ isexe@^2.0.0: isobject@^3.0.1: version "3.0.1" - resolved "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz" + resolved "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== isomorphic-ws@^4.0.1: @@ -5935,7 +5501,7 @@ isomorphic-ws@^4.0.1: isstream@~0.1.2: version "0.1.2" - resolved "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz" + resolved "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: @@ -5944,9 +5510,9 @@ istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: - version "5.2.0" - resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.0.tgz#31d18bdd127f825dd02ea7bfdfd906f8ab840e9f" - integrity sha512-6Lthe1hqXHBNsqvgDzGO6l03XNeu3CrG4RqQ1KM9+l5+jNGpEJfIELx1NS3SEHmJQA8np/u+E4EPRKRiu6m19A== + version "5.2.1" + resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d" + integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== dependencies: "@babel/core" "^7.12.3" "@babel/parser" "^7.14.7" @@ -5955,12 +5521,12 @@ istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: semver "^6.3.0" istanbul-lib-report@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" - integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== + version "3.0.1" + resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d" + integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== dependencies: istanbul-lib-coverage "^3.0.0" - make-dir "^3.0.0" + make-dir "^4.0.0" supports-color "^7.1.0" istanbul-lib-source-maps@^4.0.0: @@ -5973,9 +5539,9 @@ istanbul-lib-source-maps@^4.0.0: source-map "^0.6.1" istanbul-reports@^3.1.3: - version "3.1.5" - resolved "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz#cc9a6ab25cb25659810e4785ed9d9fb742578bae" - integrity sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w== + version "3.1.6" + resolved "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz#2544bcab4768154281a2f0870471902704ccaa1a" + integrity sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" @@ -6059,16 +5625,6 @@ jest-config@^28.1.3: slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^28.1.1: - version "28.1.1" - resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-28.1.1.tgz" - integrity sha512-/MUUxeR2fHbqHoMMiffe/Afm+U8U4olFRJ0hiVG2lZatPJcnGxx292ustVu7bULhjV65IYMxRdploAKLbcrsyg== - dependencies: - chalk "^4.0.0" - diff-sequences "^28.1.1" - jest-get-type "^28.0.2" - pretty-format "^28.1.1" - jest-diff@^28.1.3: version "28.1.3" resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-28.1.3.tgz#948a192d86f4e7a64c5264ad4da4877133d8792f" @@ -6135,7 +5691,7 @@ jest-haste-map@^28.1.3: jest-in-case@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/jest-in-case/-/jest-in-case-1.0.2.tgz" + resolved "https://registry.npmjs.org/jest-in-case/-/jest-in-case-1.0.2.tgz#56744b5af33222bd0abab70cf919f1d170ab75cc" integrity sha512-2DE6Gdwnh5jkCYTePWoQinF+zne3lCADibXoYJEt8PS84JaRug0CyAOrEgzMxbzln3YcSY2PBeru7ct4tbflYA== jest-leak-detector@^28.1.3: @@ -6146,16 +5702,6 @@ jest-leak-detector@^28.1.3: jest-get-type "^28.0.2" pretty-format "^28.1.3" -jest-matcher-utils@^28.0.0: - version "28.1.1" - resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-28.1.1.tgz" - integrity sha512-NPJPRWrbmR2nAJ+1nmnfcKKzSwgfaciCCrYZzVnNoxVoyusYWIjkBMNvu0RHJe7dNj4hH3uZOPZsQA+xAYWqsw== - dependencies: - chalk "^4.0.0" - jest-diff "^28.1.1" - jest-get-type "^28.0.2" - pretty-format "^28.1.1" - jest-matcher-utils@^28.1.3: version "28.1.3" resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-28.1.3.tgz#5a77f1c129dd5ba3b4d7fc20728806c78893146e" @@ -6190,9 +5736,9 @@ jest-mock@^28.1.3: "@types/node" "*" jest-pnp-resolver@^1.2.2: - version "1.2.2" - resolved "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" - integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== + version "1.2.3" + resolved "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" + integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== jest-regex-util@^28.0.2: version "28.0.2" @@ -6306,19 +5852,7 @@ jest-snapshot@^28.1.3: pretty-format "^28.1.3" semver "^7.3.5" -jest-util@^28.0.0: - version "28.1.1" - resolved "https://registry.npmjs.org/jest-util/-/jest-util-28.1.1.tgz" - integrity sha512-FktOu7ca1DZSyhPAxgxB6hfh2+9zMoJ7aEQA759Z6p45NuO8mWcqujH+UdHlCm/V6JTWwDztM2ITCzU1ijJAfw== - dependencies: - "@jest/types" "^28.1.1" - "@types/node" "*" - chalk "^4.0.0" - ci-info "^3.2.0" - graceful-fs "^4.2.9" - picomatch "^2.2.3" - -jest-util@^28.1.3: +jest-util@^28.0.0, jest-util@^28.1.3: version "28.1.3" resolved "https://registry.npmjs.org/jest-util/-/jest-util-28.1.3.tgz#f4f932aa0074f0679943220ff9cbba7e497028b0" integrity sha512-XdqfpHwpcSRko/C35uLYFM2emRAltIIKZiJ9eAmhjsj0CqZMa0p1ib0R5fWIqGhn1a103DebTbpqIaP1qCQ6tQ== @@ -6397,7 +5931,7 @@ js-yaml@^4.1.0: jsbn@~0.1.0: version "0.1.1" - resolved "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz" + resolved "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== jsesc@^2.5.1: @@ -6407,12 +5941,12 @@ jsesc@^2.5.1: jsesc@~0.5.0: version "0.5.0" - resolved "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz" + resolved "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== json-parse-better-errors@^1.0.1: version "1.0.2" - resolved "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz" + resolved "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== json-parse-even-better-errors@^2.3.0: @@ -6437,17 +5971,17 @@ json-stable-stringify-without-jsonify@^1.0.1: json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" - resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" + resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== -json5@^2.1.2, json5@^2.2.1: - version "2.2.1" - resolved "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" - integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== +json5@^2.1.2, json5@^2.2.1, json5@^2.2.2: + version "2.2.3" + resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== jsonfile@^6.0.1: version "6.1.0" - resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz" + resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== dependencies: universalify "^2.0.0" @@ -6456,12 +5990,12 @@ jsonfile@^6.0.1: jsonparse@^1.2.0, jsonparse@^1.3.1: version "1.3.1" - resolved "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz" + resolved "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== jsprim@^1.2.2: version "1.4.2" - resolved "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz" + resolved "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== dependencies: assert-plus "1.0.0" @@ -6471,7 +6005,7 @@ jsprim@^1.2.2: kind-of@^6.0.2, kind-of@^6.0.3: version "6.0.3" - resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz" + resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== kleur@^3.0.3: @@ -6481,7 +6015,7 @@ kleur@^3.0.3: lerna@4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/lerna/-/lerna-4.0.0.tgz" + resolved "https://registry.npmjs.org/lerna/-/lerna-4.0.0.tgz#b139d685d50ea0ca1be87713a7c2f44a5b678e9e" integrity sha512-DD/i1znurfOmNJb0OBw66NmNqiM8kF6uIrzrJ0wGE3VNdzeOhz9ziWLYiRaZDGGwgbcjOo6eIfcx9O5Qynz+kg== dependencies: "@lerna/add" "4.0.0" @@ -6510,7 +6044,7 @@ leven@^3.1.0: levenary@^1.1.1: version "1.1.1" - resolved "https://registry.npmjs.org/levenary/-/levenary-1.1.1.tgz" + resolved "https://registry.npmjs.org/levenary/-/levenary-1.1.1.tgz#842a9ee98d2075aa7faeedbe32679e9205f46f77" integrity sha512-mkAdOIt79FD6irqjYSs4rdbnlT5vRonMEvBVPVb3XmevfS8kgRXwfes0dhPdEtzTWD/1eNE/Bm/G1iRt6DcnQQ== dependencies: leven "^3.1.0" @@ -6525,7 +6059,7 @@ levn@^0.4.1: libnpmaccess@^4.0.1: version "4.0.3" - resolved "https://registry.npmjs.org/libnpmaccess/-/libnpmaccess-4.0.3.tgz" + resolved "https://registry.npmjs.org/libnpmaccess/-/libnpmaccess-4.0.3.tgz#dfb0e5b0a53c315a2610d300e46b4ddeb66e7eec" integrity sha512-sPeTSNImksm8O2b6/pf3ikv4N567ERYEpeKRPSmqlNt1dTZbvgpJIzg5vAhXHpw2ISBsELFRelk0jEahj1c6nQ== dependencies: aproba "^2.0.0" @@ -6535,7 +6069,7 @@ libnpmaccess@^4.0.1: libnpmpublish@^4.0.0: version "4.0.2" - resolved "https://registry.npmjs.org/libnpmpublish/-/libnpmpublish-4.0.2.tgz" + resolved "https://registry.npmjs.org/libnpmpublish/-/libnpmpublish-4.0.2.tgz#be77e8bf5956131bcb45e3caa6b96a842dec0794" integrity sha512-+AD7A2zbVeGRCFI2aO//oUmapCwy7GHqPXFJh3qpToSRNU+tXKJ2YFUgjt04LPPAf2dlEH95s6EhIHM1J7bmOw== dependencies: normalize-package-data "^3.0.2" @@ -6563,7 +6097,7 @@ lines-and-columns@^1.1.6: load-json-file@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz" + resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" integrity sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw== dependencies: graceful-fs "^4.1.2" @@ -6573,7 +6107,7 @@ load-json-file@^4.0.0: load-json-file@^6.2.0: version "6.2.0" - resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-6.2.0.tgz" + resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-6.2.0.tgz#5c7770b42cafa97074ca2848707c61662f4251a1" integrity sha512-gUD/epcRms75Cw8RT1pUdHugZYM5ce64ucs2GEISABwkRsOQr0q2wm/MV2TKThycIe5e0ytRweW2RZxclogCdQ== dependencies: graceful-fs "^4.1.15" @@ -6583,7 +6117,7 @@ load-json-file@^6.2.0: locate-path@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" integrity sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA== dependencies: p-locate "^2.0.0" @@ -6591,7 +6125,7 @@ locate-path@^2.0.0: locate-path@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== dependencies: p-locate "^3.0.0" @@ -6613,32 +6147,32 @@ locate-path@^6.0.0: lodash._reinterpolate@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz" + resolved "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" integrity sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA== lodash.debounce@^4.0.8: version "4.0.8" - resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz" + resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== lodash.ismatch@^4.4.0: version "4.4.0" - resolved "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz" + resolved "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" integrity sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g== lodash.isregexp@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/lodash.isregexp/-/lodash.isregexp-4.0.1.tgz" + resolved "https://registry.npmjs.org/lodash.isregexp/-/lodash.isregexp-4.0.1.tgz#e13e647b30cd559752a04cd912086faf7da1c30b" integrity sha512-rw9+95tYcUa9nQ1FgdtKvO+hReLGNqnNMHfLq8SwK5Mo6D0R0tIsnRHGHaTHSKeYBaLCJ1JvXWdz4UmpPZ2bag== lodash.isstring@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz" + resolved "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" integrity sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw== lodash.memoize@4.x: version "4.1.2" - resolved "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz" + resolved "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== lodash.merge@^4.6.2: @@ -6648,7 +6182,7 @@ lodash.merge@^4.6.2: lodash.template@^4.5.0: version "4.5.0" - resolved "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz" + resolved "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab" integrity sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A== dependencies: lodash._reinterpolate "^3.0.0" @@ -6656,14 +6190,14 @@ lodash.template@^4.5.0: lodash.templatesettings@^4.0.0: version "4.2.0" - resolved "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz" + resolved "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz#e481310f049d3cf6d47e912ad09313b154f0fb33" integrity sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ== dependencies: lodash._reinterpolate "^3.0.0" lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.3.0, lodash@^4.7.0: version "4.17.21" - resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" + resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== long@^4.0.0: @@ -6672,17 +6206,24 @@ long@^4.0.0: integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== long@^5.2.0: - version "5.2.0" - resolved "https://registry.npmjs.org/long/-/long-5.2.0.tgz" - integrity sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w== + version "5.2.3" + resolved "https://registry.npmjs.org/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1" + integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q== loose-envify@^1.0.0: version "1.4.0" - resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz" + resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== dependencies: js-tokens "^3.0.0 || ^4.0.0" +lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + dependencies: + yallist "^3.0.2" + lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -6692,7 +6233,7 @@ lru-cache@^6.0.0: lru-queue@^0.1.0: version "0.1.0" - resolved "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz" + resolved "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3" integrity sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ== dependencies: es5-ext "~0.10.2" @@ -6712,14 +6253,21 @@ make-dir@^3.0.0: dependencies: semver "^6.0.0" +make-dir@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" + integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== + dependencies: + semver "^7.5.3" + make-error@1.x: version "1.3.6" - resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz" + resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== make-fetch-happen@^8.0.9: version "8.0.14" - resolved "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-8.0.14.tgz" + resolved "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-8.0.14.tgz#aaba73ae0ab5586ad8eaa68bd83332669393e222" integrity sha512-EsS89h6l4vbfJEtBZnENTOFk8mCRpY5ru36Xe5bcX1KYIli2mkSHqoFsp5O1wMDvTJJzxe/4THpCTtygjeeGWQ== dependencies: agentkeepalive "^4.1.3" @@ -6740,7 +6288,7 @@ make-fetch-happen@^8.0.9: make-fetch-happen@^9.0.1: version "9.1.0" - resolved "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz" + resolved "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz#53085a09e7971433e6765f7971bf63f4e05cb968" integrity sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg== dependencies: agentkeepalive "^4.1.3" @@ -6769,17 +6317,17 @@ makeerror@1.0.12: map-obj@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz" + resolved "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" integrity sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg== map-obj@^4.0.0: version "4.3.0" - resolved "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz" + resolved "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== memoizee@^0.4.15: version "0.4.15" - resolved "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz" + resolved "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz#e6f3d2da863f318d02225391829a6c5956555b72" integrity sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ== dependencies: d "^1.0.1" @@ -6793,7 +6341,7 @@ memoizee@^0.4.15: meow@^8.0.0: version "8.1.2" - resolved "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz" + resolved "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz#bcbe45bda0ee1729d350c03cffc8395a36c4e897" integrity sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q== dependencies: "@types/minimist" "^1.2.0" @@ -6828,19 +6376,19 @@ micromatch@^4.0.4: mime-db@1.52.0: version "1.52.0" - resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz" + resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== mime-types@^2.1.12, mime-types@~2.1.19: version "2.1.35" - resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz" + resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: mime-db "1.52.0" mimic-fn@^1.0.0: version "1.2.0" - resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz" + resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== mimic-fn@^2.1.0: @@ -6850,7 +6398,7 @@ mimic-fn@^2.1.0: min-indent@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz" + resolved "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: @@ -6871,36 +6419,41 @@ minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: brace-expansion "^1.1.7" minimatch@^5.0.1: - version "5.1.0" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz" - integrity sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg== + version "5.1.6" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" + integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== dependencies: brace-expansion "^2.0.1" minimist-options@4.1.0: version "4.1.0" - resolved "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz" + resolved "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" integrity sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A== dependencies: arrify "^1.0.1" is-plain-obj "^1.1.0" kind-of "^6.0.3" -minimist@1.2.6, minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: +minimist@1.2.6: version "1.2.6" - resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz" + resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== +minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: + version "1.2.8" + resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + minipass-collect@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz" + resolved "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz#22b813bf745dc6edba2576b940022ad6edc8c617" integrity sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA== dependencies: minipass "^3.0.0" minipass-fetch@^1.3.0, minipass-fetch@^1.3.2: version "1.4.1" - resolved "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz" + resolved "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz#d75e0091daac1b0ffd7e9d41629faff7d0c1f1b6" integrity sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw== dependencies: minipass "^3.1.0" @@ -6911,14 +6464,14 @@ minipass-fetch@^1.3.0, minipass-fetch@^1.3.2: minipass-flush@^1.0.5: version "1.0.5" - resolved "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz" + resolved "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz#82e7135d7e89a50ffe64610a787953c4c4cbb373" integrity sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw== dependencies: minipass "^3.0.0" minipass-json-stream@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/minipass-json-stream/-/minipass-json-stream-1.0.1.tgz" + resolved "https://registry.npmjs.org/minipass-json-stream/-/minipass-json-stream-1.0.1.tgz#7edbb92588fbfc2ff1db2fc10397acb7b6b44aa7" integrity sha512-ODqY18UZt/I8k+b7rl2AENgbWE8IDYam+undIJONvigAz8KR5GWblsFTEfQs0WODsjbSXWlm+JHEv8Gr6Tfdbg== dependencies: jsonparse "^1.3.1" @@ -6926,43 +6479,48 @@ minipass-json-stream@^1.0.1: minipass-pipeline@^1.2.2, minipass-pipeline@^1.2.4: version "1.2.4" - resolved "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz" + resolved "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz#68472f79711c084657c067c5c6ad93cddea8214c" integrity sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A== dependencies: minipass "^3.0.0" minipass-sized@^1.0.3: version "1.0.3" - resolved "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz" + resolved "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz#70ee5a7c5052070afacfbc22977ea79def353b70" integrity sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g== dependencies: minipass "^3.0.0" minipass@^2.6.0, minipass@^2.9.0: version "2.9.0" - resolved "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz" + resolved "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== dependencies: safe-buffer "^5.1.2" yallist "^3.0.0" minipass@^3.0.0, minipass@^3.1.0, minipass@^3.1.1, minipass@^3.1.3: - version "3.1.6" - resolved "https://registry.npmjs.org/minipass/-/minipass-3.1.6.tgz" - integrity sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ== + version "3.3.6" + resolved "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz#7bba384db3a1520d18c9c0e5251c3444e95dd94a" + integrity sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw== dependencies: yallist "^4.0.0" +minipass@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" + integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== + minizlib@^1.3.3: version "1.3.3" - resolved "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz" + resolved "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== dependencies: minipass "^2.9.0" minizlib@^2.0.0, minizlib@^2.1.1: version "2.1.2" - resolved "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz" + resolved "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== dependencies: minipass "^3.0.0" @@ -6970,7 +6528,7 @@ minizlib@^2.0.0, minizlib@^2.1.1: mkdirp-infer-owner@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/mkdirp-infer-owner/-/mkdirp-infer-owner-2.0.0.tgz" + resolved "https://registry.npmjs.org/mkdirp-infer-owner/-/mkdirp-infer-owner-2.0.0.tgz#55d3b368e7d89065c38f32fd38e638f0ab61d316" integrity sha512-sdqtiFt3lkOaYvTXSRIUjkIdPTcxgv5+fgqYE/5qgwdw12cOrAuzzgzvVExIkH/ul1oeHN3bCLOWSG3XOqbKKw== dependencies: chownr "^2.0.0" @@ -6979,19 +6537,19 @@ mkdirp-infer-owner@^2.0.0: mkdirp@1.0.4, mkdirp@^1.0.3, mkdirp@^1.0.4: version "1.0.4" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz" + resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== mkdirp@^0.5.1, mkdirp@^0.5.5: version "0.5.6" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz" + resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== dependencies: minimist "^1.2.6" modify-values@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz" + resolved "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== ms@2.1.2: @@ -7001,12 +6559,12 @@ ms@2.1.2: ms@^2.0.0: version "2.1.3" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== multimatch@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/multimatch/-/multimatch-5.0.0.tgz" + resolved "https://registry.npmjs.org/multimatch/-/multimatch-5.0.0.tgz#932b800963cea7a31a033328fa1e0c3a1874dbe6" integrity sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA== dependencies: "@types/minimatch" "^3.0.3" @@ -7017,17 +6575,17 @@ multimatch@^5.0.0: mute-stream@0.0.7: version "0.0.7" - resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz" + resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" integrity sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ== mute-stream@0.0.8, mute-stream@~0.0.4: version "0.0.8" - resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz" + resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== mz@^2.7.0: version "2.7.0" - resolved "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz" + resolved "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== dependencies: any-promise "^1.0.0" @@ -7041,37 +6599,37 @@ natural-compare@^1.4.0: negotiator@^0.6.2: version "0.6.3" - resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz" + resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== -neo-async@^2.6.0: +neo-async@^2.6.2: version "2.6.2" - resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz" + resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== next-tick@1, next-tick@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz" + resolved "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== node-environment-flags@^1.0.5: version "1.0.6" - resolved "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz" + resolved "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz#a30ac13621f6f7d674260a54dede048c3982c088" integrity sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw== dependencies: object.getownpropertydescriptors "^2.0.3" semver "^5.7.0" node-fetch@^2.6.1, node-fetch@^2.6.7: - version "2.6.7" - resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== + version "2.6.12" + resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" + integrity sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g== dependencies: whatwg-url "^5.0.0" node-gyp@^5.0.2: version "5.1.1" - resolved "https://registry.npmjs.org/node-gyp/-/node-gyp-5.1.1.tgz" + resolved "https://registry.npmjs.org/node-gyp/-/node-gyp-5.1.1.tgz#eb915f7b631c937d282e33aed44cb7a025f62a3e" integrity sha512-WH0WKGi+a4i4DUt2mHnvocex/xPLp9pYt5R6M2JdFB7pJ7Z34hveZ4nDTGTiLXCkitA9T8HFZjhinBCiVHYcWw== dependencies: env-paths "^2.2.0" @@ -7088,7 +6646,7 @@ node-gyp@^5.0.2: node-gyp@^7.1.0: version "7.1.2" - resolved "https://registry.npmjs.org/node-gyp/-/node-gyp-7.1.2.tgz" + resolved "https://registry.npmjs.org/node-gyp/-/node-gyp-7.1.2.tgz#21a810aebb187120251c3bcec979af1587b188ae" integrity sha512-CbpcIo7C3eMu3dL1c3d0xw449fHIGALIJsRP4DDPHpyiW8vcriNY7ubh9TE4zEKfSxscY7PjeFnshE7h75ynjQ== dependencies: env-paths "^2.2.0" @@ -7107,14 +6665,14 @@ node-int64@^0.4.0: resolved "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-releases@^2.0.5, node-releases@^2.0.6: - version "2.0.6" - resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" - integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg== +node-releases@^2.0.13: + version "2.0.13" + resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d" + integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ== nopt@^4.0.1: version "4.0.3" - resolved "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz" + resolved "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz#a375cad9d02fd921278d954c2254d5aa57e15e48" integrity sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg== dependencies: abbrev "1" @@ -7122,14 +6680,14 @@ nopt@^4.0.1: nopt@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz" + resolved "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz#530942bb58a512fccafe53fe210f13a25355dc88" integrity sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ== dependencies: abbrev "1" normalize-package-data@^2.0.0, normalize-package-data@^2.3.2, normalize-package-data@^2.5.0: version "2.5.0" - resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz" + resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== dependencies: hosted-git-info "^2.1.4" @@ -7139,7 +6697,7 @@ normalize-package-data@^2.0.0, normalize-package-data@^2.3.2, normalize-package- normalize-package-data@^3.0.0, normalize-package-data@^3.0.2: version "3.0.3" - resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz" + resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz#dbcc3e2da59509a0983422884cd172eefdfa525e" integrity sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA== dependencies: hosted-git-info "^4.0.1" @@ -7154,26 +6712,26 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: normalize-url@^6.1.0: version "6.1.0" - resolved "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz" + resolved "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== npm-bundled@^1.1.1: version "1.1.2" - resolved "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz" + resolved "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz#944c78789bd739035b70baa2ca5cc32b8d860bc1" integrity sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ== dependencies: npm-normalize-package-bin "^1.0.1" npm-install-checks@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-4.0.0.tgz" + resolved "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-4.0.0.tgz#a37facc763a2fde0497ef2c6d0ac7c3fbe00d7b4" integrity sha512-09OmyDkNLYwqKPOnbI8exiOZU2GVVmQp7tgez2BPi5OZC8M82elDAps7sxC4l//uSUtotWqoEIDwjRvWH4qz8w== dependencies: semver "^7.1.1" npm-lifecycle@^3.1.5: version "3.1.5" - resolved "https://registry.npmjs.org/npm-lifecycle/-/npm-lifecycle-3.1.5.tgz" + resolved "https://registry.npmjs.org/npm-lifecycle/-/npm-lifecycle-3.1.5.tgz#9882d3642b8c82c815782a12e6a1bfeed0026309" integrity sha512-lDLVkjfZmvmfvpvBzA4vzee9cn+Me4orq0QF8glbswJVEbIcSNWib7qGOffolysc3teCqbbPZZkzbr3GQZTL1g== dependencies: byline "^5.0.0" @@ -7187,12 +6745,12 @@ npm-lifecycle@^3.1.5: npm-normalize-package-bin@^1.0.0, npm-normalize-package-bin@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz" + resolved "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz#6e79a41f23fd235c0623218228da7d9c23b8f6e2" integrity sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA== npm-package-arg@^8.0.0, npm-package-arg@^8.0.1, npm-package-arg@^8.1.0, npm-package-arg@^8.1.2, npm-package-arg@^8.1.5: version "8.1.5" - resolved "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.5.tgz" + resolved "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.5.tgz#3369b2d5fe8fdc674baa7f1786514ddc15466e44" integrity sha512-LhgZrg0n0VgvzVdSm1oiZworPbTxYHUJCgtsJW8mGvlDpxTM1vSJc3m5QZeUkhAHIzbz3VCHd/R4osi1L1Tg/Q== dependencies: hosted-git-info "^4.0.1" @@ -7201,7 +6759,7 @@ npm-package-arg@^8.0.0, npm-package-arg@^8.0.1, npm-package-arg@^8.1.0, npm-pack npm-packlist@^2.1.4: version "2.2.2" - resolved "https://registry.npmjs.org/npm-packlist/-/npm-packlist-2.2.2.tgz" + resolved "https://registry.npmjs.org/npm-packlist/-/npm-packlist-2.2.2.tgz#076b97293fa620f632833186a7a8f65aaa6148c8" integrity sha512-Jt01acDvJRhJGthnUJVF/w6gumWOZxO7IkpY/lsX9//zqQgnF7OJaxgQXcerd4uQOLu7W5bkb4mChL9mdfm+Zg== dependencies: glob "^7.1.6" @@ -7211,7 +6769,7 @@ npm-packlist@^2.1.4: npm-pick-manifest@^6.0.0, npm-pick-manifest@^6.1.1: version "6.1.1" - resolved "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-6.1.1.tgz" + resolved "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-6.1.1.tgz#7b5484ca2c908565f43b7f27644f36bb816f5148" integrity sha512-dBsdBtORT84S8V8UTad1WlUyKIY9iMsAmqxHbLdeEeBNMLQDlDWWra3wYUx9EBEIiG/YwAy0XyNHDd2goAsfuA== dependencies: npm-install-checks "^4.0.0" @@ -7221,7 +6779,7 @@ npm-pick-manifest@^6.0.0, npm-pick-manifest@^6.1.1: npm-registry-fetch@^11.0.0: version "11.0.0" - resolved "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-11.0.0.tgz" + resolved "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-11.0.0.tgz#68c1bb810c46542760d62a6a965f85a702d43a76" integrity sha512-jmlgSxoDNuhAtxUIG6pVwwtz840i994dL14FoNVZisrmZW5kWd63IUTNv1m/hyRSGSqWjCUp/YZlS1BJyNp9XA== dependencies: make-fetch-happen "^9.0.1" @@ -7233,7 +6791,7 @@ npm-registry-fetch@^11.0.0: npm-registry-fetch@^9.0.0: version "9.0.0" - resolved "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-9.0.0.tgz" + resolved "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-9.0.0.tgz#86f3feb4ce00313bc0b8f1f8f69daae6face1661" integrity sha512-PuFYYtnQ8IyVl6ib9d3PepeehcUeHN9IO5N/iCRhyg9tStQcqGQBRVHmfmMWPDERU3KwZoHFvbJ4FPXPspvzbA== dependencies: "@npmcli/ci-detect" "^1.0.0" @@ -7254,7 +6812,7 @@ npm-run-path@^4.0.1: npmlog@^4.1.2: version "4.1.2" - resolved "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz" + resolved "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== dependencies: are-we-there-yet "~1.1.2" @@ -7264,48 +6822,49 @@ npmlog@^4.1.2: number-is-nan@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" + resolved "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" integrity sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ== oauth-sign@~0.9.0: version "0.9.0" - resolved "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz" + resolved "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" - resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" + resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== -object-inspect@^1.12.0, object-inspect@^1.9.0: - version "1.12.2" - resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz" - integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== +object-inspect@^1.12.3, object-inspect@^1.9.0: + version "1.12.3" + resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" + integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== object-keys@^1.1.1: version "1.1.1" - resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz" + resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== -object.assign@^4.1.0, object.assign@^4.1.2: - version "4.1.2" - resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz" - integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== +object.assign@^4.1.4: + version "4.1.4" + resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" + integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - has-symbols "^1.0.1" + call-bind "^1.0.2" + define-properties "^1.1.4" + has-symbols "^1.0.3" object-keys "^1.1.1" object.getownpropertydescriptors@^2.0.3: - version "2.1.4" - resolved "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.4.tgz" - integrity sha512-sccv3L/pMModT6dJAYF3fzGMVcb38ysQ0tEE6ixv2yXJDtEIPph268OlAdJj5/qZMZDq2g/jqvwppt36uS/uQQ== + version "2.1.6" + resolved "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.6.tgz#5e5c384dd209fa4efffead39e3a0512770ccc312" + integrity sha512-lq+61g26E/BgHv0ZTFgRvi7NMEPuAxLkFU7rukXjc/AlwH4Am5xXVnIXy3un1bg/JPbXHrixRkK1itUzzPiIjQ== dependencies: - array.prototype.reduce "^1.0.4" + array.prototype.reduce "^1.0.5" call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.1" + define-properties "^1.2.0" + es-abstract "^1.21.2" + safe-array-concat "^1.0.0" once@^1.3.0, once@^1.4.0: version "1.4.0" @@ -7316,43 +6875,43 @@ once@^1.3.0, once@^1.4.0: onetime@^2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz" + resolved "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" integrity sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ== dependencies: mimic-fn "^1.0.0" onetime@^5.1.0, onetime@^5.1.2: version "5.1.2" - resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz" + resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== dependencies: mimic-fn "^2.1.0" optionator@^0.9.1: - version "0.9.1" - resolved "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" - integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== + version "0.9.3" + resolved "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" + integrity sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg== dependencies: + "@aashutoshrathi/word-wrap" "^1.2.3" deep-is "^0.1.3" fast-levenshtein "^2.0.6" levn "^0.4.1" prelude-ls "^1.2.1" type-check "^0.4.0" - word-wrap "^1.2.3" os-homedir@^1.0.0: version "1.0.2" - resolved "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz" + resolved "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" integrity sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ== os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" + resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== osenv@^0.1.4: version "0.1.5" - resolved "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz" + resolved "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== dependencies: os-homedir "^1.0.0" @@ -7360,12 +6919,12 @@ osenv@^0.1.4: p-finally@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz" + resolved "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== p-limit@^1.1.0: version "1.3.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== dependencies: p-try "^1.0.0" @@ -7386,14 +6945,14 @@ p-limit@^3.0.2, p-limit@^3.1.0: p-locate@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" integrity sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg== dependencies: p-limit "^1.1.0" p-locate@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== dependencies: p-limit "^2.0.0" @@ -7414,24 +6973,24 @@ p-locate@^5.0.0: p-map-series@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/p-map-series/-/p-map-series-2.1.0.tgz" + resolved "https://registry.npmjs.org/p-map-series/-/p-map-series-2.1.0.tgz#7560d4c452d9da0c07e692fdbfe6e2c81a2a91f2" integrity sha512-RpYIIK1zXSNEOdwxcfe7FdvGcs7+y5n8rifMhMNWvaxRNMPINJHF5GDeuVxWqnfrcHPSCnp7Oo5yNXHId9Av2Q== p-map@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz" + resolved "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== dependencies: aggregate-error "^3.0.0" p-pipe@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/p-pipe/-/p-pipe-3.1.0.tgz" + resolved "https://registry.npmjs.org/p-pipe/-/p-pipe-3.1.0.tgz#48b57c922aa2e1af6a6404cb7c6bf0eb9cc8e60e" integrity sha512-08pj8ATpzMR0Y80x50yJHn37NF6vjrqHutASaX5LiH5npS9XPvrUmscd9MF5R4fuYRHOxQR1FfMIlF7AzwoPqw== p-queue@^6.6.2: version "6.6.2" - resolved "https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz" + resolved "https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz#2068a9dcf8e67dd0ec3e7a2bcb76810faa85e426" integrity sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ== dependencies: eventemitter3 "^4.0.4" @@ -7439,19 +6998,19 @@ p-queue@^6.6.2: p-reduce@^2.0.0, p-reduce@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz" + resolved "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz#09408da49507c6c274faa31f28df334bc712b64a" integrity sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw== p-timeout@^3.2.0: version "3.2.0" - resolved "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz" + resolved "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz#c7e17abc971d2a7962ef83626b35d635acf23dfe" integrity sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg== dependencies: p-finally "^1.0.0" p-try@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz" + resolved "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" integrity sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww== p-try@^2.0.0: @@ -7461,14 +7020,14 @@ p-try@^2.0.0: p-waterfall@^2.1.1: version "2.1.1" - resolved "https://registry.npmjs.org/p-waterfall/-/p-waterfall-2.1.1.tgz" + resolved "https://registry.npmjs.org/p-waterfall/-/p-waterfall-2.1.1.tgz#63153a774f472ccdc4eb281cdb2967fcf158b2ee" integrity sha512-RRTnDb2TBG/epPRI2yYXsimO0v3BXC8Yd3ogr1545IaqKK17VGhbWVeGGN+XfCm/08OK8635nH31c8bATkHuSw== dependencies: p-reduce "^2.0.0" pacote@^11.2.6: version "11.3.5" - resolved "https://registry.npmjs.org/pacote/-/pacote-11.3.5.tgz" + resolved "https://registry.npmjs.org/pacote/-/pacote-11.3.5.tgz#73cf1fc3772b533f575e39efa96c50be8c3dc9d2" integrity sha512-fT375Yczn4zi+6Hkk2TBe1x1sP8FgFsEIZ2/iWaXY2r/NkhDJfxbcn5paz1+RTFCyNf+dPnaoBDJoAxXSU8Bkg== dependencies: "@npmcli/git" "^2.1.0" @@ -7505,7 +7064,7 @@ parent-module@^1.0.0: parse-json@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz" + resolved "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" integrity sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw== dependencies: error-ex "^1.3.1" @@ -7513,7 +7072,7 @@ parse-json@^4.0.0: parse-json@^5.0.0, parse-json@^5.2.0: version "5.2.0" - resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz" + resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== dependencies: "@babel/code-frame" "^7.0.0" @@ -7528,12 +7087,12 @@ parse-package-name@1.0.0: parse-passwd@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz" + resolved "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" integrity sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q== parse-path@^4.0.0: version "4.0.4" - resolved "https://registry.npmjs.org/parse-path/-/parse-path-4.0.4.tgz" + resolved "https://registry.npmjs.org/parse-path/-/parse-path-4.0.4.tgz#4bf424e6b743fb080831f03b536af9fc43f0ffea" integrity sha512-Z2lWUis7jlmXC1jeOG9giRO2+FsuyNipeQ43HAjqAZjwSe3SEf+q/84FGPHoso3kyntbxa4c4i77t3m6fGf8cw== dependencies: is-ssh "^1.3.0" @@ -7542,9 +7101,9 @@ parse-path@^4.0.0: query-string "^6.13.8" parse-url@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/parse-url/-/parse-url-6.0.0.tgz" - integrity sha512-cYyojeX7yIIwuJzledIHeLUBVJ6COVLeT4eF+2P6aKVzwvgKQPndCBv3+yQ7pcWjqToYwaligxzSYNNmGoMAvw== + version "6.0.5" + resolved "https://registry.npmjs.org/parse-url/-/parse-url-6.0.5.tgz#4acab8982cef1846a0f8675fa686cef24b2f6f9b" + integrity sha512-e35AeLTSIlkw/5GFq70IN7po8fmDUjpDPY1rIK+VubRfsUvBonjQ+PBZG+vWMACnQSmNlvl524IucoDmcioMxA== dependencies: is-ssh "^1.3.0" normalize-url "^6.1.0" @@ -7553,7 +7112,7 @@ parse-url@^6.0.0: path-exists@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz" + resolved "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" integrity sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== path-exists@^4.0.0: @@ -7578,7 +7137,7 @@ path-parse@^1.0.7: path-type@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz" + resolved "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== dependencies: pify "^3.0.0" @@ -7590,7 +7149,7 @@ path-type@^4.0.0: performance-now@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz" + resolved "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow== picocolors@^1.0.0: @@ -7605,12 +7164,12 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: pify@^2.3.0: version "2.3.0" - resolved "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz" + resolved "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog== pify@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz" + resolved "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" integrity sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg== pify@^4.0.1: @@ -7620,17 +7179,17 @@ pify@^4.0.1: pify@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/pify/-/pify-5.0.0.tgz" + resolved "https://registry.npmjs.org/pify/-/pify-5.0.0.tgz#1f5eca3f5e87ebec28cc6d54a0e4aaf00acc127f" integrity sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA== pirates@^4.0.4, pirates@^4.0.5: - version "4.0.5" - resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" - integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== + version "4.0.6" + resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" + integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== pkg-dir@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz" + resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw== dependencies: find-up "^3.0.0" @@ -7654,22 +7213,17 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@2.7.1, prettier@^2.6.2, prettier@^2.7.1: +prettier@2.7.1: version "2.7.1" - resolved "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz" + resolved "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== -pretty-format@^28.0.0, pretty-format@^28.1.1: - version "28.1.1" - resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-28.1.1.tgz" - integrity sha512-wwJbVTGFHeucr5Jw2bQ9P+VYHyLdAqedFLEkdQUVaBF/eiidDwH5OpilINq4mEfhbCjLnirt6HTTDhv1HaTIQw== - dependencies: - "@jest/schemas" "^28.0.2" - ansi-regex "^5.0.1" - ansi-styles "^5.0.0" - react-is "^18.0.0" +prettier@^2.6.2, prettier@^2.7.1: + version "2.8.8" + resolved "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" + integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== -pretty-format@^28.1.3: +pretty-format@^28.0.0, pretty-format@^28.1.3: version "28.1.3" resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-28.1.3.tgz#c9fba8cedf99ce50963a11b27d982a9ae90970d5" integrity sha512-8gFb/To0OmxHR9+ZTb14Df2vNxdGCX8g1xWGUTqUw5TiZvcQf5sHKObd5UcPyLLyowNwDAMTF3XWOG1B6mxl1Q== @@ -7681,17 +7235,17 @@ pretty-format@^28.1.3: process-nextick-args@~2.0.0: version "2.0.1" - resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz" + resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== promise-inflight@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz" + resolved "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" integrity sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g== promise-retry@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz" + resolved "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz#ff747a13620ab57ba688f5fc67855410c370da22" integrity sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g== dependencies: err-code "^2.0.2" @@ -7707,14 +7261,14 @@ prompts@^2.0.1: promzard@^0.3.0: version "0.3.0" - resolved "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz" + resolved "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz#26a5d6ee8c7dee4cb12208305acfb93ba382a9ee" integrity sha512-JZeYqd7UAcHCwI+sTOeUDYkvEU+1bQ7iE0UT1MgB/tERkAPkesW46MrpIySzODi+owTjZtiF8Ay5j9m60KmMBw== dependencies: read "1" proto-list@~1.2.1: version "1.2.4" - resolved "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz" + resolved "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" integrity sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA== protobufjs@^6.8.8, protobufjs@~6.11.2, protobufjs@~6.11.3: @@ -7736,41 +7290,46 @@ protobufjs@^6.8.8, protobufjs@~6.11.2, protobufjs@~6.11.3: "@types/node" ">=13.7.0" long "^4.0.0" -protocols@^1.1.0, protocols@^1.4.0: +protocols@^1.4.0: version "1.4.8" - resolved "https://registry.npmjs.org/protocols/-/protocols-1.4.8.tgz" + resolved "https://registry.npmjs.org/protocols/-/protocols-1.4.8.tgz#48eea2d8f58d9644a4a32caae5d5db290a075ce8" integrity sha512-IgjKyaUSjsROSO8/D49Ab7hP8mJgTYcqApOqdPhLoPxAplXmkp+zRvsrSQjFn5by0rhm4VH0GAUELIPpx7B1yg== +protocols@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/protocols/-/protocols-2.0.1.tgz#8f155da3fc0f32644e83c5782c8e8212ccf70a86" + integrity sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q== + psl@^1.1.28: - version "1.8.0" - resolved "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz" - integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== + version "1.9.0" + resolved "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" + integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== punycode@^2.1.0, punycode@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + version "2.3.0" + resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" + integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== q@^1.5.1: version "1.5.1" - resolved "https://registry.npmjs.org/q/-/q-1.5.1.tgz" + resolved "https://registry.npmjs.org/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw== qs@^6.9.4: - version "6.10.5" - resolved "https://registry.npmjs.org/qs/-/qs-6.10.5.tgz" - integrity sha512-O5RlPh0VFtR78y79rgcgKK4wbAI0C5zGVLztOIdpWX6ep368q5Hv6XRxDvXuZ9q3C6v+e3n8UfZZJw7IIG27eQ== + version "6.11.2" + resolved "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz#64bea51f12c1f5da1bc01496f48ffcff7c69d7d9" + integrity sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA== dependencies: side-channel "^1.0.4" qs@~6.5.2: version "6.5.3" - resolved "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz" + resolved "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== query-string@^6.13.8: version "6.14.1" - resolved "https://registry.npmjs.org/query-string/-/query-string-6.14.1.tgz" + resolved "https://registry.npmjs.org/query-string/-/query-string-6.14.1.tgz#7ac2dca46da7f309449ba0f86b1fd28255b0c86a" integrity sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw== dependencies: decode-uri-component "^0.2.0" @@ -7785,7 +7344,7 @@ queue-microtask@^1.2.2: quick-lru@^4.0.1: version "4.0.1" - resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz" + resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f" integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== react-is@^18.0.0: @@ -7795,12 +7354,12 @@ react-is@^18.0.0: read-cmd-shim@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-2.0.0.tgz" + resolved "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-2.0.0.tgz#4a50a71d6f0965364938e9038476f7eede3928d9" integrity sha512-HJpV9bQpkl6KwjxlJcBoqu9Ba0PQg8TqSNIOrulGt54a0uup0HtevreFHzYzkm0lpnleRdNBzXznKrgxglEHQw== read-package-json-fast@^2.0.1: version "2.0.3" - resolved "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz" + resolved "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz#323ca529630da82cb34b36cc0b996693c98c2b83" integrity sha512-W/BKtbL+dUjTuRL2vziuYhp76s5HZ9qQhd/dKfWIZveD0O40453QNyZhC0e63lqZrAQ4jiOapVoeJ7JrszenQQ== dependencies: json-parse-even-better-errors "^2.3.0" @@ -7808,7 +7367,7 @@ read-package-json-fast@^2.0.1: read-package-json@^2.0.0: version "2.1.2" - resolved "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.2.tgz" + resolved "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.2.tgz#6992b2b66c7177259feb8eaac73c3acd28b9222a" integrity sha512-D1KmuLQr6ZSJS0tW8hf3WGpRlwszJOXZ3E8Yd/DNRaM5d+1wVRZdHlpGBLAuovjr28LbWvjpWkBHMxpRGGjzNA== dependencies: glob "^7.1.1" @@ -7818,7 +7377,7 @@ read-package-json@^2.0.0: read-package-json@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/read-package-json/-/read-package-json-3.0.1.tgz" + resolved "https://registry.npmjs.org/read-package-json/-/read-package-json-3.0.1.tgz#c7108f0b9390257b08c21e3004d2404c806744b9" integrity sha512-aLcPqxovhJTVJcsnROuuzQvv6oziQx4zd3JvG0vGCL5MjTONUc4uJ90zCBC6R7W7oUKBNoR/F8pkyfVwlbxqng== dependencies: glob "^7.1.1" @@ -7828,7 +7387,7 @@ read-package-json@^3.0.0: read-package-json@^4.1.1: version "4.1.2" - resolved "https://registry.npmjs.org/read-package-json/-/read-package-json-4.1.2.tgz" + resolved "https://registry.npmjs.org/read-package-json/-/read-package-json-4.1.2.tgz#b444d047de7c75d4a160cb056d00c0693c1df703" integrity sha512-Dqer4pqzamDE2O4M55xp1qZMuLPqi4ldk2ya648FOMHRjwMzFhuxVrG04wd0c38IsvkVdr3vgHI6z+QTPdAjrQ== dependencies: glob "^7.1.1" @@ -7838,7 +7397,7 @@ read-package-json@^4.1.1: read-package-tree@^5.3.1: version "5.3.1" - resolved "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.3.1.tgz" + resolved "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.3.1.tgz#a32cb64c7f31eb8a6f31ef06f9cedf74068fe636" integrity sha512-mLUDsD5JVtlZxjSlPPx1RETkNjjvQYuweKwNVt1Sn8kP5Jh44pvYuUHCp6xSVDZWbNxVxG5lyZJ921aJH61sTw== dependencies: read-package-json "^2.0.0" @@ -7847,7 +7406,7 @@ read-package-tree@^5.3.1: read-pkg-up@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz" + resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" integrity sha512-YFzFrVvpC6frF1sz8psoHDBGF7fLPc+llq/8NB43oagqWkx8ar5zYtsTORtOjw9W2RHLpWP+zTWwBvf1bCmcSw== dependencies: find-up "^2.0.0" @@ -7855,7 +7414,7 @@ read-pkg-up@^3.0.0: read-pkg-up@^7.0.1: version "7.0.1" - resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz" + resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== dependencies: find-up "^4.1.0" @@ -7864,7 +7423,7 @@ read-pkg-up@^7.0.1: read-pkg@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz" + resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" integrity sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA== dependencies: load-json-file "^4.0.0" @@ -7873,7 +7432,7 @@ read-pkg@^3.0.0: read-pkg@^5.2.0: version "5.2.0" - resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz" + resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== dependencies: "@types/normalize-package-data" "^2.4.0" @@ -7883,24 +7442,24 @@ read-pkg@^5.2.0: read@1, read@~1.0.1: version "1.0.7" - resolved "https://registry.npmjs.org/read/-/read-1.0.7.tgz" + resolved "https://registry.npmjs.org/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" integrity sha512-rSOKNYUmaxy0om1BNjMN4ezNT6VKK+2xF4GBhc81mkH7L60i6dp8qPYrkndNLT3QPphoII3maL9PVC9XmhHwVQ== dependencies: mute-stream "~0.0.4" readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2: - version "3.6.0" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + version "3.6.2" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== dependencies: inherits "^2.0.3" string_decoder "^1.1.1" util-deprecate "^1.0.1" readable-stream@^2.0.6, readable-stream@~2.3.6: - version "2.3.7" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== + version "2.3.8" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" + integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== dependencies: core-util-is "~1.0.0" inherits "~2.0.3" @@ -7912,7 +7471,7 @@ readable-stream@^2.0.6, readable-stream@~2.3.6: readdir-scoped-modules@^1.0.0: version "1.1.0" - resolved "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz" + resolved "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz#8d45407b4f870a0dcaebc0e28670d18e74514309" integrity sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw== dependencies: debuglog "^1.0.1" @@ -7934,96 +7493,84 @@ readonly-date@^1.0.0: rechoir@^0.6.2: version "0.6.2" - resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz" + resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" integrity sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw== dependencies: resolve "^1.1.6" redent@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz" + resolved "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz#e557b7998316bb53c9f1f56fa626352c6963059f" integrity sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg== dependencies: indent-string "^4.0.0" strip-indent "^3.0.0" -regenerate-unicode-properties@^10.0.1: - version "10.0.1" - resolved "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.0.1.tgz" - integrity sha512-vn5DU6yg6h8hP/2OkQo3K7uVILvY4iu0oI4t3HFa81UPkhGJwkRwM10JEc3upjdhHjs/k8GJY1sRBhk5sr69Bw== +regenerate-unicode-properties@^10.1.0: + version "10.1.0" + resolved "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz#7c3192cab6dd24e21cb4461e5ddd7dd24fa8374c" + integrity sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ== dependencies: regenerate "^1.4.2" regenerate@^1.4.2: version "1.4.2" - resolved "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz" + resolved "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== -regenerator-runtime@^0.13.4, regenerator-runtime@^0.13.7: - version "0.13.9" - resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz" - integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== +regenerator-runtime@^0.13.7: + version "0.13.11" + resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" + integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== -regenerator-transform@^0.15.0: - version "0.15.0" - resolved "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.0.tgz" - integrity sha512-LsrGtPmbYg19bcPHwdtmXwbW+TqNvtY4riE3P83foeHRroMbH6/2ddFBfab3t7kbzc7v7p4wbkIecHImqt0QNg== +regenerator-runtime@^0.14.0: + version "0.14.0" + resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45" + integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA== + +regenerator-transform@^0.15.2: + version "0.15.2" + resolved "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz#5bbae58b522098ebdf09bca2f83838929001c7a4" + integrity sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg== dependencies: "@babel/runtime" "^7.8.4" -regexp.prototype.flags@^1.4.3: - version "1.4.3" - resolved "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz" - integrity sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA== +regexp.prototype.flags@^1.5.0: + version "1.5.0" + resolved "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz#fe7ce25e7e4cca8db37b6634c8a2c7009199b9cb" + integrity sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA== dependencies: call-bind "^1.0.2" - define-properties "^1.1.3" - functions-have-names "^1.2.2" + define-properties "^1.2.0" + functions-have-names "^1.2.3" regexpp@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== -regexpu-core@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.0.1.tgz" - integrity sha512-CriEZlrKK9VJw/xQGJpQM5rY88BtuL8DM+AEwvcThHilbxiTAy8vq4iJnd2tqq8wLmjbGZzP7ZcKFjbGkmEFrw== - dependencies: - regenerate "^1.4.2" - regenerate-unicode-properties "^10.0.1" - regjsgen "^0.6.0" - regjsparser "^0.8.2" - unicode-match-property-ecmascript "^2.0.0" - unicode-match-property-value-ecmascript "^2.0.0" - -regexpu-core@^5.1.0: - version "5.1.0" - resolved "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.1.0.tgz#2f8504c3fd0ebe11215783a41541e21c79942c6d" - integrity sha512-bb6hk+xWd2PEOkj5It46A16zFMs2mv86Iwpdu94la4S3sJ7C973h2dHpYKwIBGaWSO7cIRJ+UX0IeMaWcO4qwA== +regexpu-core@^5.3.1: + version "5.3.2" + resolved "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz#11a2b06884f3527aec3e93dbbf4a3b958a95546b" + integrity sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ== dependencies: + "@babel/regjsgen" "^0.8.0" regenerate "^1.4.2" - regenerate-unicode-properties "^10.0.1" - regjsgen "^0.6.0" - regjsparser "^0.8.2" + regenerate-unicode-properties "^10.1.0" + regjsparser "^0.9.1" unicode-match-property-ecmascript "^2.0.0" - unicode-match-property-value-ecmascript "^2.0.0" - -regjsgen@^0.6.0: - version "0.6.0" - resolved "https://registry.npmjs.org/regjsgen/-/regjsgen-0.6.0.tgz" - integrity sha512-ozE883Uigtqj3bx7OhL1KNbCzGyW2NQZPl6Hs09WTvCuZD5sTI4JY58bkbQWa/Y9hxIsvJ3M8Nbf7j54IqeZbA== + unicode-match-property-value-ecmascript "^2.1.0" -regjsparser@^0.8.2: - version "0.8.4" - resolved "https://registry.npmjs.org/regjsparser/-/regjsparser-0.8.4.tgz" - integrity sha512-J3LABycON/VNEu3abOviqGHuB/LOtOQj8SKmfP9anY5GfAVw/SPjwzSjxGjbZXIxbGfqTHtJw58C2Li/WkStmA== +regjsparser@^0.9.1: + version "0.9.1" + resolved "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz#272d05aa10c7c1f67095b1ff0addae8442fc5709" + integrity sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ== dependencies: jsesc "~0.5.0" request@^2.88.0, request@^2.88.2: version "2.88.2" - resolved "https://registry.npmjs.org/request/-/request-2.88.2.tgz" + resolved "https://registry.npmjs.org/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== dependencies: aws-sign2 "~0.7.0" @@ -8070,31 +7617,22 @@ resolve-from@^5.0.0: integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== resolve.exports@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" - integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== - -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.3.2, resolve@^1.8.1: - version "1.22.0" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz" - integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== - dependencies: - is-core-module "^2.8.1" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" + version "1.1.1" + resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.1.tgz#05cfd5b3edf641571fd46fa608b610dda9ead999" + integrity sha512-/NtpHNDN7jWhAaQ9BvBUYZ6YTXsRBgfqWFWP7BZBaoMJO/I3G5OFzvTuWNlZC3aPjins1F+TNrLKsGbH4rfsRQ== -resolve@^1.20.0: - version "1.22.1" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" - integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.3.2, resolve@^1.8.1: + version "1.22.4" + resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz#1dc40df46554cdaf8948a486a10f6ba1e2026c34" + integrity sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg== dependencies: - is-core-module "^2.9.0" + is-core-module "^2.13.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" restore-cursor@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz" + resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" integrity sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q== dependencies: onetime "^2.0.0" @@ -8102,7 +7640,7 @@ restore-cursor@^2.0.0: restore-cursor@^3.1.0: version "3.1.0" - resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz" + resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== dependencies: onetime "^5.1.0" @@ -8110,7 +7648,7 @@ restore-cursor@^3.1.0: retry@^0.12.0: version "0.12.0" - resolved "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz" + resolved "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" integrity sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow== reusify@^1.0.4: @@ -8127,14 +7665,14 @@ rimraf@3.0.2, rimraf@^3.0.0, rimraf@^3.0.2: rimraf@^2.6.3: version "2.7.1" - resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz" + resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== dependencies: glob "^7.1.3" run-async@^2.2.0, run-async@^2.3.0, run-async@^2.4.0: version "2.4.1" - resolved "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz" + resolved "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== run-parallel@^1.1.9: @@ -8146,26 +7684,36 @@ run-parallel@^1.1.9: rx-lite-aggregates@^4.0.8: version "4.0.8" - resolved "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz" + resolved "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" integrity sha512-3xPNZGW93oCjiO7PtKxRK6iOVYBWBvtf9QHDfU23Oc+dLIQmAV//UnyXV/yihv81VS/UqoQPk4NegS8EFi55Hg== dependencies: rx-lite "*" rx-lite@*, rx-lite@^4.0.8: version "4.0.8" - resolved "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz" + resolved "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" integrity sha512-Cun9QucwK6MIrp3mry/Y7hqD1oFqTYLQ4pGxaHTjIdaFDWRGGLikqp6u8LcWJnzpoALg9hap+JGk8sFIUuEGNA== rxjs@^6.4.0, rxjs@^6.6.0: version "6.6.7" - resolved "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz" + resolved "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== dependencies: tslib "^1.9.0" +safe-array-concat@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.0.tgz#2064223cba3c08d2ee05148eedbc563cd6d84060" + integrity sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.0" + has-symbols "^1.0.3" + isarray "^2.0.5" + safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== safe-buffer@~5.1.0, safe-buffer@~5.1.1: @@ -8173,41 +7721,45 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== +safe-regex-test@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" + integrity sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.3" + is-regex "^1.1.4" + "safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" - resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" + resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== "semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0, semver@^5.7.1: - version "5.7.1" - resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - -semver@7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz" - integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== + version "5.7.2" + resolved "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== -semver@7.x, semver@^7.1.1, semver@^7.1.3, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: - version "7.3.7" - resolved "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz" - integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== +semver@7.x, semver@^7.1.1, semver@^7.1.3, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.5.3: + version "7.5.4" + resolved "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== dependencies: lru-cache "^6.0.0" -semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0, semver@^6.3.1: + version "6.3.1" + resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== set-blocking@~2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" + resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== shallow-clone@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz" + resolved "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== dependencies: kind-of "^6.0.2" @@ -8226,7 +7778,7 @@ shebang-regex@^3.0.0: shelljs@0.8.5: version "0.8.5" - resolved "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz" + resolved "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c" integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow== dependencies: glob "^7.0.0" @@ -8235,7 +7787,7 @@ shelljs@0.8.5: side-channel@^1.0.4: version "1.0.4" - resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz" + resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== dependencies: call-bind "^1.0.0" @@ -8247,6 +7799,11 @@ signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== +signal-exit@^4.0.2: + version "4.1.0" + resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + sisteransi@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" @@ -8264,17 +7821,17 @@ slash@^3.0.0: slide@^1.1.6: version "1.1.6" - resolved "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz" + resolved "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" integrity sha512-NwrtjCg+lZoqhFU8fOwl4ay2ei8PaqCBOUV3/ektPY9trO1yQ1oXEfmHAhKArUVUr/hOHvy5f6AdP17dCM0zMw== smart-buffer@^4.2.0: version "4.2.0" - resolved "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz" + resolved "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== socks-proxy-agent@^5.0.0: version "5.0.1" - resolved "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-5.0.1.tgz" + resolved "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-5.0.1.tgz#032fb583048a29ebffec2e6a73fca0761f48177e" integrity sha512-vZdmnjb9a2Tz6WEQVIurybSwElwPxMZaIc7PzqbJTrezcKNznv6giT7J7tZDZ1BojVaa1jvO/UiUdhDVB0ACoQ== dependencies: agent-base "^6.0.2" @@ -8283,7 +7840,7 @@ socks-proxy-agent@^5.0.0: socks-proxy-agent@^6.0.0: version "6.2.1" - resolved "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz" + resolved "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz#2687a31f9d7185e38d530bef1944fe1f1496d6ce" integrity sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ== dependencies: agent-base "^6.0.2" @@ -8291,23 +7848,23 @@ socks-proxy-agent@^6.0.0: socks "^2.6.2" socks@^2.3.3, socks@^2.6.2: - version "2.6.2" - resolved "https://registry.npmjs.org/socks/-/socks-2.6.2.tgz" - integrity sha512-zDZhHhZRY9PxRruRMR7kMhnf3I8hDs4S3f9RecfnGxvcBHQcKcIH/oUcEWffsfl1XxdYlA7nnlGbbTvPz9D8gA== + version "2.7.1" + resolved "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz#d8e651247178fde79c0663043e07240196857d55" + integrity sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ== dependencies: - ip "^1.1.5" + ip "^2.0.0" smart-buffer "^4.2.0" sort-keys@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz" + resolved "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" integrity sha512-/dPCrG1s3ePpWm6yBbxZq5Be1dXGLyLn9Z791chDC3NFrpkVbWGzkBwPN1knaciexFXgRJ7hzdnwZ4stHSDmjg== dependencies: is-plain-obj "^1.0.0" sort-keys@^4.0.0: version "4.2.0" - resolved "https://registry.npmjs.org/sort-keys/-/sort-keys-4.2.0.tgz" + resolved "https://registry.npmjs.org/sort-keys/-/sort-keys-4.2.0.tgz#6b7638cee42c506fff8c1cecde7376d21315be18" integrity sha512-aUYIEU/UviqPgc8mHR6IW1EGxkAXpeRETYcrzg8cLAvUPZcpAlleSXHV2mY7G12GphSH6Gzv+4MMVSSkbdteHg== dependencies: is-plain-obj "^2.0.0" @@ -8322,7 +7879,7 @@ source-map-support@0.5.13: source-map-support@^0.5.16, source-map-support@^0.5.19: version "0.5.21" - resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== dependencies: buffer-from "^1.0.0" @@ -8330,7 +7887,7 @@ source-map-support@^0.5.16, source-map-support@^0.5.19: source-map@^0.5.0: version "0.5.7" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== source-map@^0.6.0, source-map@^0.6.1: @@ -8339,46 +7896,46 @@ source-map@^0.6.0, source-map@^0.6.1: integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== spdx-correct@^3.0.0: - version "3.1.1" - resolved "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz" - integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== + version "3.2.0" + resolved "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz#4f5ab0668f0059e34f9c00dce331784a12de4e9c" + integrity sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA== dependencies: spdx-expression-parse "^3.0.0" spdx-license-ids "^3.0.0" spdx-exceptions@^2.1.0: version "2.3.0" - resolved "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz" + resolved "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== spdx-expression-parse@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz" + resolved "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== dependencies: spdx-exceptions "^2.1.0" spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.11" - resolved "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz" - integrity sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g== + version "3.0.13" + resolved "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz#7189a474c46f8d47c7b0da4b987bb45e908bd2d5" + integrity sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w== split-on-first@^1.0.0: version "1.1.0" - resolved "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz" + resolved "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz#f610afeee3b12bce1d0c30425e76398b78249a5f" integrity sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw== split2@^3.0.0: version "3.2.2" - resolved "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz" + resolved "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz#bf2cf2a37d838312c249c89206fd7a17dd12365f" integrity sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg== dependencies: readable-stream "^3.0.0" split@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/split/-/split-1.0.1.tgz" + resolved "https://registry.npmjs.org/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" integrity sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg== dependencies: through "2" @@ -8390,7 +7947,7 @@ sprintf-js@~1.0.2: sshpk@^1.7.0: version "1.17.0" - resolved "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz" + resolved "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ== dependencies: asn1 "~0.2.3" @@ -8405,27 +7962,27 @@ sshpk@^1.7.0: ssri@^8.0.0, ssri@^8.0.1: version "8.0.1" - resolved "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz" + resolved "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz#638e4e439e2ffbd2cd289776d5ca457c4f51a2af" integrity sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ== dependencies: minipass "^3.1.1" stack-utils@^2.0.3: - version "2.0.5" - resolved "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5" - integrity sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA== + version "2.0.6" + resolved "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f" + integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== dependencies: escape-string-regexp "^2.0.0" strict-uri-encode@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz" + resolved "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ== -string-argv@^0.3.1: - version "0.3.1" - resolved "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz" - integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== +string-argv@^0.3.2: + version "0.3.2" + resolved "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6" + integrity sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q== string-length@^4.0.1: version "4.0.2" @@ -8437,7 +7994,7 @@ string-length@^4.0.1: string-width@^1.0.1: version "1.0.2" - resolved "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz" + resolved "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" integrity sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw== dependencies: code-point-at "^1.0.0" @@ -8446,7 +8003,7 @@ string-width@^1.0.1: "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== dependencies: emoji-regex "^8.0.0" @@ -8455,61 +8012,70 @@ string-width@^1.0.1: string-width@^2.0.0, string-width@^2.1.0: version "2.1.1" - resolved "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz" + resolved "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== dependencies: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -string.prototype.trimend@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz" - integrity sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog== +string.prototype.trim@^1.2.7: + version "1.2.7" + resolved "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz#a68352740859f6893f14ce3ef1bb3037f7a90533" + integrity sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" - es-abstract "^1.19.5" + es-abstract "^1.20.4" -string.prototype.trimstart@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz" - integrity sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg== +string.prototype.trimend@^1.0.6: + version "1.0.6" + resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" + integrity sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +string.prototype.trimstart@^1.0.6: + version "1.0.6" + resolved "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz#e90ab66aa8e4007d92ef591bbf3cd422c56bdcf4" + integrity sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" - es-abstract "^1.19.5" + es-abstract "^1.20.4" string_decoder@^1.1.1: version "1.3.0" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== dependencies: safe-buffer "~5.2.0" string_decoder@~1.1.1: version "1.1.1" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== dependencies: safe-buffer "~5.1.0" strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" integrity sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg== dependencies: ansi-regex "^2.0.0" strip-ansi@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" integrity sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow== dependencies: ansi-regex "^3.0.0" strip-ansi@^5.1.0: version "5.2.0" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== dependencies: ansi-regex "^4.1.0" @@ -8523,7 +8089,7 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: strip-bom@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz" + resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== strip-bom@^4.0.0: @@ -8538,7 +8104,7 @@ strip-final-newline@^2.0.0: strip-indent@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz" + resolved "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz#c32e1cee940b6b3432c771bc2c54bcce73cd3001" integrity sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ== dependencies: min-indent "^1.0.0" @@ -8550,7 +8116,7 @@ strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: strong-log-transformer@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz" + resolved "https://registry.npmjs.org/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz#0f5ed78d325e0421ac6f90f7f10e691d6ae3ae10" integrity sha512-B3Hgul+z0L9a236FAUC9iZsL+nVHgoCJnqCbN588DjYxvGXaXaaFbfmQ/JhvKjZwsOukuR72XbHv71Qkug0HxA== dependencies: duplexer "^0.1.1" @@ -8559,7 +8125,7 @@ strong-log-transformer@^2.1.0: supports-color@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" integrity sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g== supports-color@^5.3.0: @@ -8584,9 +8150,9 @@ supports-color@^8.0.0: has-flag "^4.0.0" supports-hyperlinks@^2.0.0: - version "2.2.0" - resolved "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz#4f77b42488765891774b70c79babd87f9bd594bb" - integrity sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ== + version "2.3.0" + resolved "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz#3943544347c1ff90b15effb03fc14ae45ec10624" + integrity sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA== dependencies: has-flag "^4.0.0" supports-color "^7.0.0" @@ -8603,7 +8169,7 @@ symbol-observable@^2.0.3: tar@^4.4.12: version "4.4.19" - resolved "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz" + resolved "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz#2e4d7263df26f2b914dee10c825ab132123742f3" integrity sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA== dependencies: chownr "^1.1.4" @@ -8615,25 +8181,25 @@ tar@^4.4.12: yallist "^3.1.1" tar@^6.0.2, tar@^6.1.0: - version "6.1.11" - resolved "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz" - integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== + version "6.1.15" + resolved "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz#c9738b0b98845a3b344d334b8fa3041aaba53a69" + integrity sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A== dependencies: chownr "^2.0.0" fs-minipass "^2.0.0" - minipass "^3.0.0" + minipass "^5.0.0" minizlib "^2.1.1" mkdirp "^1.0.3" yallist "^4.0.0" temp-dir@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz" + resolved "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz#0a7c0ea26d3a39afa7e0ebea9c1fc0bc4daa011d" integrity sha512-xZFXEGbG7SNC3itwBzI3RYjq/cEhBkx2hJuKGIUOcEULmkQExXiHat2z/qkISYsuR+IKumhEfKKbV5qXmhICFQ== temp-write@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/temp-write/-/temp-write-4.0.0.tgz" + resolved "https://registry.npmjs.org/temp-write/-/temp-write-4.0.0.tgz#cd2e0825fc826ae72d201dc26eef3bf7e6fc9320" integrity sha512-HIeWmj77uOOHb0QX7siN3OtwV3CTntquin6TNVg6SHOqCP3hYKmox90eeFOGaY1MqJ9WYDDjkyZrW6qS5AWpbw== dependencies: graceful-fs "^4.1.15" @@ -8661,7 +8227,7 @@ test-exclude@^6.0.0: text-extensions@^1.0.0: version "1.9.0" - resolved "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz" + resolved "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz#1853e45fee39c945ce6f6c36b2d659b5aabc2a26" integrity sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ== text-table@^0.2.0: @@ -8671,21 +8237,21 @@ text-table@^0.2.0: thenify-all@^1.0.0: version "1.6.0" - resolved "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz" + resolved "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" integrity sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA== dependencies: thenify ">= 3.1.0 < 4" "thenify@>= 3.1.0 < 4": version "3.3.1" - resolved "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz" + resolved "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f" integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw== dependencies: any-promise "^1.0.0" through2@^2.0.0: version "2.0.5" - resolved "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz" + resolved "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== dependencies: readable-stream "~2.3.6" @@ -8693,19 +8259,19 @@ through2@^2.0.0: through2@^4.0.0: version "4.0.2" - resolved "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz" + resolved "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz#a7ce3ac2a7a8b0b966c80e7c49f0484c3b239764" integrity sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw== dependencies: readable-stream "3" through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6: version "2.3.8" - resolved "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + resolved "https://registry.npmjs.org/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== timers-ext@^0.1.7: version "0.1.7" - resolved "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz" + resolved "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz#6f57ad8578e07a3fb9f91d9387d65647555e25c6" integrity sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ== dependencies: es5-ext "~0.10.46" @@ -8713,7 +8279,7 @@ timers-ext@^0.1.7: tmp@^0.0.33: version "0.0.33" - resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz" + resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== dependencies: os-tmpdir "~1.0.2" @@ -8737,7 +8303,7 @@ to-regex-range@^5.0.1: tough-cookie@~2.5.0: version "2.5.0" - resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz" + resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== dependencies: psl "^1.1.28" @@ -8745,25 +8311,25 @@ tough-cookie@~2.5.0: tr46@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz" + resolved "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" integrity sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw== dependencies: punycode "^2.1.1" tr46@~0.0.3: version "0.0.3" - resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" + resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== trim-newlines@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz" + resolved "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== ts-jest@^28.0.7: - version "28.0.7" - resolved "https://registry.npmjs.org/ts-jest/-/ts-jest-28.0.7.tgz#e18757a9e44693da9980a79127e5df5a98b37ac6" - integrity sha512-wWXCSmTwBVmdvWrOpYhal79bDpioDy4rTT+0vyUnE3ZzM7LOAAGG9NXwzkEL/a516rQEgnMmS/WKP9jBPCVJyA== + version "28.0.8" + resolved "https://registry.npmjs.org/ts-jest/-/ts-jest-28.0.8.tgz#cd204b8e7a2f78da32cf6c95c9a6165c5b99cc73" + integrity sha512-5FaG0lXmRPzApix8oFG8RKjAz4ehtm8yMKOTy5HX3fY6W8kmvOrmcY0hKDElW52FJov+clhUbrKAqofnj4mXTg== dependencies: bs-logger "0.x" fast-json-stable-stringify "2.x" @@ -8776,19 +8342,19 @@ ts-jest@^28.0.7: tslib@^1.9.0: version "1.14.1" - resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" + resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== tunnel-agent@^0.6.0: version "0.6.0" - resolved "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz" + resolved "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== dependencies: safe-buffer "^5.0.1" tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" - resolved "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz" + resolved "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== type-check@^0.4.0, type-check@~0.4.0: @@ -8805,7 +8371,7 @@ type-detect@4.0.8: type-fest@^0.18.0: version "0.18.1" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz#db4bc151a4a2cf4eebf9add5db75508db6cc841f" integrity sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw== type-fest@^0.20.2: @@ -8820,64 +8386,103 @@ type-fest@^0.21.3: type-fest@^0.4.1: version "0.4.1" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.4.1.tgz" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.4.1.tgz#8bdf77743385d8a4f13ba95f610f5ccd68c728f8" integrity sha512-IwzA/LSfD2vC1/YDYMv/zHP4rDF1usCwllsDpbolT3D4fUepIO7f9K70jjmUewU/LmGUKJcwcVtDCpnKk4BPMw== type-fest@^0.6.0: version "0.6.0" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== type-fest@^0.8.1: version "0.8.1" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== type@^1.0.1: version "1.2.0" - resolved "https://registry.npmjs.org/type/-/type-1.2.0.tgz" + resolved "https://registry.npmjs.org/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== -type@^2.5.0: - version "2.6.0" - resolved "https://registry.npmjs.org/type/-/type-2.6.0.tgz" - integrity sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ== +type@^2.7.2: + version "2.7.2" + resolved "https://registry.npmjs.org/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" + integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== + +typed-array-buffer@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz#18de3e7ed7974b0a729d3feecb94338d1472cd60" + integrity sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.1" + is-typed-array "^1.1.10" + +typed-array-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz#d787a24a995711611fb2b87a4052799517b230d0" + integrity sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + +typed-array-byte-offset@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz#cbbe89b51fdef9cd6aaf07ad4707340abbc4ea0b" + integrity sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + +typed-array-length@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz#89d83785e5c4098bec72e08b319651f0eac9c1bb" + integrity sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + is-typed-array "^1.1.9" typedarray-to-buffer@^3.1.5: version "3.1.5" - resolved "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz" + resolved "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== dependencies: is-typedarray "^1.0.0" typedarray@^0.0.6: version "0.0.6" - resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" + resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== typescript@^4.7.4: - version "4.7.4" - resolved "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz" - integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== + version "4.9.5" + resolved "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== uglify-js@^3.1.4: - version "3.16.1" - resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.16.1.tgz" - integrity sha512-X5BGTIDH8U6IQ1TIRP62YC36k+ULAa1d59BxlWvPUJ1NkW5L3FwcGfEzuVvGmhJFBu0YJ5Ge25tmRISqCmLiRQ== + version "3.17.4" + resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c" + integrity sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g== uid-number@0.0.6: version "0.0.6" - resolved "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz" + resolved "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" integrity sha512-c461FXIljswCuscZn67xq9PpszkPT6RjheWFQTgCyabJrTUozElanb0YEqv2UGgk247YpcJkFBuSGNvBlpXM9w== umask@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/umask/-/umask-1.1.0.tgz" + resolved "https://registry.npmjs.org/umask/-/umask-1.1.0.tgz#f29cebf01df517912bb58ff9c4e50fde8e33320d" integrity sha512-lE/rxOhmiScJu9L6RTNVgB/zZbF+vGC0/p6D3xnkAePI2o0sMyFG966iR5Ki50OI/0mNi2yaRnxfLsPmEZF/JA== unbox-primitive@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz" + resolved "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" integrity sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== dependencies: call-bind "^1.0.2" @@ -8887,60 +8492,60 @@ unbox-primitive@^1.0.2: unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz" + resolved "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc" integrity sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ== unicode-match-property-ecmascript@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz" + resolved "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz#54fd16e0ecb167cf04cf1f756bdcc92eba7976c3" integrity sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q== dependencies: unicode-canonical-property-names-ecmascript "^2.0.0" unicode-property-aliases-ecmascript "^2.0.0" -unicode-match-property-value-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz" - integrity sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw== +unicode-match-property-value-ecmascript@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz#cb5fffdcd16a05124f5a4b0bf7c3770208acbbe0" + integrity sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA== unicode-property-aliases-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz" - integrity sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ== + version "2.1.0" + resolved "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" + integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== unique-filename@^1.1.1: version "1.1.1" - resolved "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz" + resolved "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" integrity sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ== dependencies: unique-slug "^2.0.0" unique-slug@^2.0.0: version "2.0.2" - resolved "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz" + resolved "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz#baabce91083fc64e945b0f3ad613e264f7cd4e6c" integrity sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w== dependencies: imurmurhash "^0.1.4" universal-user-agent@^6.0.0: version "6.0.0" - resolved "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz" + resolved "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz#3381f8503b251c0d9cd21bc1de939ec9df5480ee" integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w== universalify@^2.0.0: version "2.0.0" - resolved "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz" + resolved "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== upath@^2.0.1: version "2.0.1" - resolved "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz" + resolved "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz#50c73dea68d6f6b990f51d279ce6081665d61a8b" integrity sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w== -update-browserslist-db@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.5.tgz#be06a5eedd62f107b7c19eb5bcefb194411abf38" - integrity sha512-dteFFpCyvuDdr9S/ff1ISkKt/9YZxKjI9WlRR99c180GaztJtRa/fn18FdxGVKVsnPY7/a/FDN68mcvUmP4U7Q== +update-browserslist-db@^1.0.11: + version "1.0.11" + resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940" + integrity sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA== dependencies: escalade "^3.1.1" picocolors "^1.0.0" @@ -8954,26 +8559,26 @@ uri-js@^4.2.2: util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" - resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== util-promisify@^2.1.0: version "2.1.0" - resolved "https://registry.npmjs.org/util-promisify/-/util-promisify-2.1.0.tgz" + resolved "https://registry.npmjs.org/util-promisify/-/util-promisify-2.1.0.tgz#3c2236476c4d32c5ff3c47002add7c13b9a82a53" integrity sha512-K+5eQPYs14b3+E+hmE2J6gCZ4JmMl9DbYS6BeP2CHq6WMuNxErxf5B/n0fz85L8zUuoO6rIzNNmIQDu/j+1OcA== dependencies: object.getownpropertydescriptors "^2.0.3" util@^0.10.3: version "0.10.4" - resolved "https://registry.npmjs.org/util/-/util-0.10.4.tgz" + resolved "https://registry.npmjs.org/util/-/util-0.10.4.tgz#3aa0125bfe668a4672de58857d3ace27ecb76901" integrity sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A== dependencies: inherits "2.0.3" uuid@^3.3.2: version "3.4.0" - resolved "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz" + resolved "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== v8-compile-cache@^2.0.3: @@ -8982,9 +8587,9 @@ v8-compile-cache@^2.0.3: integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== v8-to-istanbul@^9.0.1: - version "9.0.1" - resolved "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz#b6f994b0b5d4ef255e17a0d17dc444a9f5132fa4" - integrity sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w== + version "9.1.0" + resolved "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz#1b83ed4e397f58c85c266a570fc2558b5feb9265" + integrity sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA== dependencies: "@jridgewell/trace-mapping" "^0.3.12" "@types/istanbul-lib-coverage" "^2.0.1" @@ -8992,14 +8597,14 @@ v8-to-istanbul@^9.0.1: v8flags@^3.1.1: version "3.2.0" - resolved "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz" + resolved "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz#b243e3b4dfd731fa774e7492128109a0fe66d656" integrity sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg== dependencies: homedir-polyfill "^1.0.1" validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4: version "3.0.4" - resolved "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz" + resolved "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== dependencies: spdx-correct "^3.0.0" @@ -9007,14 +8612,14 @@ validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4: validate-npm-package-name@^3.0.0: version "3.0.0" - resolved "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz" + resolved "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz#5fa912d81eb7d0c74afc140de7317f0ca7df437e" integrity sha512-M6w37eVCMMouJ9V/sdPGnC5H4uDr73/+xdq0FBLO3TFFX1+7wiUY6Es328NN+y43tmY+doUdN9g9J21vqB7iLw== dependencies: builtins "^1.0.3" verror@1.10.0: version "1.10.0" - resolved "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz" + resolved "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw== dependencies: assert-plus "^1.0.0" @@ -9030,24 +8635,24 @@ walker@^1.0.8: wcwidth@^1.0.0: version "1.0.1" - resolved "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz" + resolved "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" integrity sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg== dependencies: defaults "^1.0.3" webidl-conversions@^3.0.0: version "3.0.1" - resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz" + resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== webidl-conversions@^6.1.0: version "6.1.0" - resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz" + resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== whatwg-url@^5.0.0: version "5.0.0" - resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz" + resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== dependencies: tr46 "~0.0.3" @@ -9055,7 +8660,7 @@ whatwg-url@^5.0.0: whatwg-url@^8.4.0: version "8.7.0" - resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz" + resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" integrity sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg== dependencies: lodash "^4.7.0" @@ -9064,7 +8669,7 @@ whatwg-url@^8.4.0: which-boxed-primitive@^1.0.2: version "1.0.2" - resolved "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz" + resolved "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== dependencies: is-bigint "^1.0.1" @@ -9073,35 +8678,41 @@ which-boxed-primitive@^1.0.2: is-string "^1.0.5" is-symbol "^1.0.3" +which-typed-array@^1.1.10, which-typed-array@^1.1.11: + version "1.1.11" + resolved "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz#99d691f23c72aab6768680805a271b69761ed61a" + integrity sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.0" + which@^1.3.1: version "1.3.1" - resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz" + resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== dependencies: isexe "^2.0.0" which@^2.0.1, which@^2.0.2: version "2.0.2" - resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" + resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== dependencies: isexe "^2.0.0" wide-align@^1.1.0: version "1.1.5" - resolved "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz" + resolved "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3" integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg== dependencies: string-width "^1.0.2 || 2 || 3 || 4" -word-wrap@^1.2.3: - version "1.2.3" - resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== - wordwrap@^1.0.0: version "1.0.0" - resolved "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz" + resolved "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== wrap-ansi@^7.0.0: @@ -9120,7 +8731,7 @@ wrappy@1: write-file-atomic@^2.4.2: version "2.4.3" - resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz" + resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz#1fd2e9ae1df3e75b8d8c367443c692d4ca81f481" integrity sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ== dependencies: graceful-fs "^4.1.11" @@ -9129,7 +8740,7 @@ write-file-atomic@^2.4.2: write-file-atomic@^3.0.0, write-file-atomic@^3.0.3: version "3.0.3" - resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz" + resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== dependencies: imurmurhash "^0.1.4" @@ -9138,16 +8749,16 @@ write-file-atomic@^3.0.0, write-file-atomic@^3.0.3: typedarray-to-buffer "^3.1.5" write-file-atomic@^4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.1.tgz#9faa33a964c1c85ff6f849b80b42a88c2c537c8f" - integrity sha512-nSKUxgAbyioruk6hU87QzVbY279oYT6uiwgDoujth2ju4mJ+TZau7SQBhtbTmUyuNYTuXnSyRn66FV0+eCgcrQ== + version "4.0.2" + resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" + integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== dependencies: imurmurhash "^0.1.4" signal-exit "^3.0.7" write-json-file@^3.2.0: version "3.2.0" - resolved "https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz" + resolved "https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz#65bbdc9ecd8a1458e15952770ccbadfcff5fe62a" integrity sha512-3xZqT7Byc2uORAatYiP3DHUUAVEkNOswEWNs9H5KXiicRTvzYzYqKjYc4G7p+8pltvAw641lVByKVtMpf+4sYQ== dependencies: detect-indent "^5.0.0" @@ -9159,7 +8770,7 @@ write-json-file@^3.2.0: write-json-file@^4.3.0: version "4.3.0" - resolved "https://registry.npmjs.org/write-json-file/-/write-json-file-4.3.0.tgz" + resolved "https://registry.npmjs.org/write-json-file/-/write-json-file-4.3.0.tgz#908493d6fd23225344af324016e4ca8f702dd12d" integrity sha512-PxiShnxf0IlnQuMYOPPhPkhExoCQuTUNPOa/2JWCYTmBquU9njyyDuwRKN26IZBlp4yn1nt+Agh2HOOBl+55HQ== dependencies: detect-indent "^6.0.0" @@ -9171,7 +8782,7 @@ write-json-file@^4.3.0: write-pkg@^4.0.0: version "4.0.0" - resolved "https://registry.npmjs.org/write-pkg/-/write-pkg-4.0.0.tgz" + resolved "https://registry.npmjs.org/write-pkg/-/write-pkg-4.0.0.tgz#675cc04ef6c11faacbbc7771b24c0abbf2a20039" integrity sha512-v2UQ+50TNf2rNHJ8NyWttfm/EJUBWMJcx6ZTYZr6Qp52uuegWw/lBkCtCbnYZEmPRNL61m+u67dAmGxo+HTULA== dependencies: sort-keys "^2.0.0" @@ -9193,7 +8804,7 @@ xstream@^11.14.0: xtend@~4.0.1: version "4.0.2" - resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" + resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== y18n@^5.0.5: @@ -9201,9 +8812,9 @@ y18n@^5.0.5: resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== -yallist@^3.0.0, yallist@^3.1.1: +yallist@^3.0.0, yallist@^3.0.2, yallist@^3.1.1: version "3.1.1" - resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz" + resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== yallist@^4.0.0: @@ -9213,32 +8824,27 @@ yallist@^4.0.0: yaml@^1.10.0, yaml@^1.7.2: version "1.10.2" - resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz" + resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== yargs-parser@20.2.4: version "20.2.4" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== yargs-parser@^20.2.2, yargs-parser@^20.2.3: version "20.2.9" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs-parser@^21.0.0: +yargs-parser@^21.0.1, yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== -yargs-parser@^21.0.1: - version "21.0.1" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz" - integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg== - yargs@^16.2.0: version "16.2.0" - resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz" + resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== dependencies: cliui "^7.0.2" @@ -9250,17 +8856,17 @@ yargs@^16.2.0: yargs-parser "^20.2.2" yargs@^17.3.1: - version "17.5.1" - resolved "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz#e109900cab6fcb7fd44b1d8249166feb0b36e58e" - integrity sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA== + version "17.7.2" + resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" + integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== dependencies: - cliui "^7.0.2" + cliui "^8.0.1" escalade "^3.1.1" get-caller-file "^2.0.5" require-directory "^2.1.1" string-width "^4.2.3" y18n "^5.0.5" - yargs-parser "^21.0.0" + yargs-parser "^21.1.1" yocto-queue@^0.1.0: version "0.1.0" From 2fdb1537b7679f6f61e4b9bc5792125f36ac8039 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 9 Aug 2023 14:26:34 -0700 Subject: [PATCH 158/287] cleanup --- README.md | 6 +- .../default/CwAdminFactory.message-builder.ts | 25 ++ .../CwCodeIdRegistry.message-builder.ts | 133 +++++++++++ .../default/CwSingle.message-builder.ts | 219 ++++++++++++++++++ .../default/Factory.message-builder.ts | 149 ++++++++++++ .../builder/default/Minter.message-builder.ts | 104 +++++++++ __output__/builder/default/index.ts | 10 +- .../CwAdminFactory.message-builder.ts | 25 ++ .../CwCodeIdRegistry.message-builder.ts | 133 +++++++++++ .../no-extends/CwSingle.message-builder.ts | 219 ++++++++++++++++++ .../no-extends/Factory.message-builder.ts | 149 ++++++++++++ .../no-extends/Minter.message-builder.ts | 104 +++++++++ __output__/builder/no-extends/index.ts | 10 +- packages/ts-codegen/README.md | 6 +- packages/ts-codegen/src/builder/builder.ts | 2 +- packages/ts-codegen/src/commands/generate.ts | 3 +- .../ts-codegen/src/generators/msg-builder.ts | 10 +- .../ts-codegen/src/plugins/message-builder.ts | 4 +- .../ts-codegen/types/src/builder/builder.d.ts | 5 +- .../types/src/plugins/message-builder.d.ts | 12 + packages/wasm-ast-types/src/index.ts | 2 +- .../message-builder.spec.ts.snap} | 0 .../src/message-builder/index.ts | 1 + .../message-builder.spec.ts} | 3 +- .../message-builder.ts} | 2 +- .../wasm-ast-types/src/msg-builder/index.ts | 1 - .../src/react-query/react-query.spec.ts | 2 +- .../wasm-ast-types/types/context/context.d.ts | 2 +- .../wasm-ast-types/types/context/imports.d.ts | 4 +- packages/wasm-ast-types/types/index.d.ts | 2 +- .../types/message-builder/index.d.ts | 1 + .../message-builder.d.ts} | 0 .../types/msg-builder/index.d.ts | 1 - 33 files changed, 1310 insertions(+), 39 deletions(-) create mode 100644 __output__/builder/default/CwAdminFactory.message-builder.ts create mode 100644 __output__/builder/default/CwCodeIdRegistry.message-builder.ts create mode 100644 __output__/builder/default/CwSingle.message-builder.ts create mode 100644 __output__/builder/default/Factory.message-builder.ts create mode 100644 __output__/builder/default/Minter.message-builder.ts create mode 100644 __output__/builder/no-extends/CwAdminFactory.message-builder.ts create mode 100644 __output__/builder/no-extends/CwCodeIdRegistry.message-builder.ts create mode 100644 __output__/builder/no-extends/CwSingle.message-builder.ts create mode 100644 __output__/builder/no-extends/Factory.message-builder.ts create mode 100644 __output__/builder/no-extends/Minter.message-builder.ts create mode 100644 packages/ts-codegen/types/src/plugins/message-builder.d.ts rename packages/wasm-ast-types/src/{msg-builder/__snapshots__/msg-builder.spec.ts.snap => message-builder/__snapshots__/message-builder.spec.ts.snap} (100%) create mode 100644 packages/wasm-ast-types/src/message-builder/index.ts rename packages/wasm-ast-types/src/{msg-builder/msg-builder.spec.ts => message-builder/message-builder.spec.ts} (90%) rename packages/wasm-ast-types/src/{msg-builder/msg-builder.ts => message-builder/message-builder.ts} (97%) delete mode 100644 packages/wasm-ast-types/src/msg-builder/index.ts create mode 100644 packages/wasm-ast-types/types/message-builder/index.d.ts rename packages/wasm-ast-types/types/{msg-builder/msg-builder.d.ts => message-builder/message-builder.d.ts} (100%) delete mode 100644 packages/wasm-ast-types/types/msg-builder/index.d.ts diff --git a/README.md b/README.md index 417ed7c9..7b8d5b46 100644 --- a/README.md +++ b/README.md @@ -263,7 +263,7 @@ cosmwasm-ts-codegen generate \ ### Message Builder -Generate raw message jsons for use in your application with the `msg-builder` command. +Generate raw message jsons for use in your application with the `message-builder` command. [see example output code](https://gist.github.com/adairrr/b394e62beb9856b0351883f776650f26) @@ -271,7 +271,7 @@ Generate raw message jsons for use in your application with the `msg-builder` co ```sh cosmwasm-ts-codegen generate \ - --plugin msg-builder \ + --plugin message-builder \ --schema ./schema \ --out ./ts \ --name MyContractName @@ -527,7 +527,7 @@ https://gist.github.com/pyramation/a9520ccf131177b1841e02a97d7d3731 https://gist.github.com/pyramation/43320e8b952751a0bd5a77dbc5b601f4 -- `cosmwasm-ts-codegen generate --plugin msg-builder` +- `cosmwasm-ts-codegen generate --plugin message-builder` https://gist.github.com/adairrr/b394e62beb9856b0351883f776650f26 diff --git a/__output__/builder/default/CwAdminFactory.message-builder.ts b/__output__/builder/default/CwAdminFactory.message-builder.ts new file mode 100644 index 00000000..2a04624c --- /dev/null +++ b/__output__/builder/default/CwAdminFactory.message-builder.ts @@ -0,0 +1,25 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class CwAdminFactoryExecuteMessageBuilder { + static instantiateContractWithSelfAdmin = ({ + codeId, + instantiateMsg, + label + }: CamelCasedProperties["instantiate_contract_with_self_admin"]>): ExecuteMsg => { + return { + instantiate_contract_with_self_admin: ({ + code_id: codeId, + instantiate_msg: instantiateMsg, + label + } as const) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/default/CwCodeIdRegistry.message-builder.ts b/__output__/builder/default/CwCodeIdRegistry.message-builder.ts new file mode 100644 index 00000000..5727cd91 --- /dev/null +++ b/__output__/builder/default/CwCodeIdRegistry.message-builder.ts @@ -0,0 +1,133 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class CwCodeIdRegistryExecuteMessageBuilder { + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static register = ({ + chainId, + checksum, + codeId, + name, + version + }: CamelCasedProperties["register"]>): ExecuteMsg => { + return { + register: ({ + chain_id: chainId, + checksum, + code_id: codeId, + name, + version + } as const) + }; + }; + static setOwner = ({ + chainId, + name, + owner + }: CamelCasedProperties["set_owner"]>): ExecuteMsg => { + return { + set_owner: ({ + chain_id: chainId, + name, + owner + } as const) + }; + }; + static unregister = ({ + chainId, + codeId + }: CamelCasedProperties["unregister"]>): ExecuteMsg => { + return { + unregister: ({ + chain_id: chainId, + code_id: codeId + } as const) + }; + }; + static updateConfig = ({ + admin, + paymentInfo + }: CamelCasedProperties["update_config"]>): ExecuteMsg => { + return { + update_config: ({ + admin, + payment_info: paymentInfo + } as const) + }; + }; +} +export abstract class CwCodeIdRegistryQueryMessageBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static getRegistration = ({ + chainId, + name, + version + }: CamelCasedProperties["get_registration"]>): QueryMsg => { + return { + get_registration: ({ + chain_id: chainId, + name, + version + } as const) + }; + }; + static infoForCodeId = ({ + chainId, + codeId + }: CamelCasedProperties["info_for_code_id"]>): QueryMsg => { + return { + info_for_code_id: ({ + chain_id: chainId, + code_id: codeId + } as const) + }; + }; + static listRegistrations = ({ + chainId, + name + }: CamelCasedProperties["list_registrations"]>): QueryMsg => { + return { + list_registrations: ({ + chain_id: chainId, + name + } as const) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/default/CwSingle.message-builder.ts b/__output__/builder/default/CwSingle.message-builder.ts new file mode 100644 index 00000000..bdc753da --- /dev/null +++ b/__output__/builder/default/CwSingle.message-builder.ts @@ -0,0 +1,219 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class CwSingleExecuteMessageBuilder { + static propose = ({ + description, + msgs, + title + }: CamelCasedProperties["propose"]>): ExecuteMsg => { + return { + propose: ({ + description, + msgs, + title + } as const) + }; + }; + static vote = ({ + proposalId, + vote + }: CamelCasedProperties["vote"]>): ExecuteMsg => { + return { + vote: ({ + proposal_id: proposalId, + vote + } as const) + }; + }; + static execute = ({ + proposalId + }: CamelCasedProperties["execute"]>): ExecuteMsg => { + return { + execute: ({ + proposal_id: proposalId + } as const) + }; + }; + static close = ({ + proposalId + }: CamelCasedProperties["close"]>): ExecuteMsg => { + return { + close: ({ + proposal_id: proposalId + } as const) + }; + }; + static updateConfig = ({ + allowRevoting, + dao, + depositInfo, + maxVotingPeriod, + minVotingPeriod, + onlyMembersExecute, + threshold + }: CamelCasedProperties["update_config"]>): ExecuteMsg => { + return { + update_config: ({ + allow_revoting: allowRevoting, + dao, + deposit_info: depositInfo, + max_voting_period: maxVotingPeriod, + min_voting_period: minVotingPeriod, + only_members_execute: onlyMembersExecute, + threshold + } as const) + }; + }; + static addProposalHook = ({ + address + }: CamelCasedProperties["add_proposal_hook"]>): ExecuteMsg => { + return { + add_proposal_hook: ({ + address + } as const) + }; + }; + static removeProposalHook = ({ + address + }: CamelCasedProperties["remove_proposal_hook"]>): ExecuteMsg => { + return { + remove_proposal_hook: ({ + address + } as const) + }; + }; + static addVoteHook = ({ + address + }: CamelCasedProperties["add_vote_hook"]>): ExecuteMsg => { + return { + add_vote_hook: ({ + address + } as const) + }; + }; + static removeVoteHook = ({ + address + }: CamelCasedProperties["remove_vote_hook"]>): ExecuteMsg => { + return { + remove_vote_hook: ({ + address + } as const) + }; + }; +} +export abstract class CwSingleQueryMessageBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static proposal = ({ + proposalId + }: CamelCasedProperties["proposal"]>): QueryMsg => { + return { + proposal: ({ + proposal_id: proposalId + } as const) + }; + }; + static listProposals = ({ + limit, + startAfter + }: CamelCasedProperties["list_proposals"]>): QueryMsg => { + return { + list_proposals: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static reverseProposals = ({ + limit, + startBefore + }: CamelCasedProperties["reverse_proposals"]>): QueryMsg => { + return { + reverse_proposals: ({ + limit, + start_before: startBefore + } as const) + }; + }; + static proposalCount = (): QueryMsg => { + return { + proposal_count: ({} as const) + }; + }; + static vote = ({ + proposalId, + voter + }: CamelCasedProperties["vote"]>): QueryMsg => { + return { + vote: ({ + proposal_id: proposalId, + voter + } as const) + }; + }; + static listVotes = ({ + limit, + proposalId, + startAfter + }: CamelCasedProperties["list_votes"]>): QueryMsg => { + return { + list_votes: ({ + limit, + proposal_id: proposalId, + start_after: startAfter + } as const) + }; + }; + static proposalHooks = (): QueryMsg => { + return { + proposal_hooks: ({} as const) + }; + }; + static voteHooks = (): QueryMsg => { + return { + vote_hooks: ({} as const) + }; + }; + static info = (): QueryMsg => { + return { + info: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/default/Factory.message-builder.ts b/__output__/builder/default/Factory.message-builder.ts new file mode 100644 index 00000000..2bbace3f --- /dev/null +++ b/__output__/builder/default/Factory.message-builder.ts @@ -0,0 +1,149 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class FactoryExecuteMessageBuilder { + static createWallet = ({ + createWalletMsg + }: CamelCasedProperties["create_wallet"]>): ExecuteMsg => { + return { + create_wallet: ({ + create_wallet_msg: createWalletMsg + } as const) + }; + }; + static updateProxyUser = ({ + newUser, + oldUser + }: CamelCasedProperties["update_proxy_user"]>): ExecuteMsg => { + return { + update_proxy_user: ({ + new_user: newUser, + old_user: oldUser + } as const) + }; + }; + static migrateWallet = ({ + migrationMsg, + walletAddress + }: CamelCasedProperties["migrate_wallet"]>): ExecuteMsg => { + return { + migrate_wallet: ({ + migration_msg: migrationMsg, + wallet_address: walletAddress + } as const) + }; + }; + static updateCodeId = ({ + newCodeId, + ty + }: CamelCasedProperties["update_code_id"]>): ExecuteMsg => { + return { + update_code_id: ({ + new_code_id: newCodeId, + ty + } as const) + }; + }; + static updateWalletFee = ({ + newFee + }: CamelCasedProperties["update_wallet_fee"]>): ExecuteMsg => { + return { + update_wallet_fee: ({ + new_fee: newFee + } as const) + }; + }; + static updateGovecAddr = ({ + addr + }: CamelCasedProperties["update_govec_addr"]>): ExecuteMsg => { + return { + update_govec_addr: ({ + addr + } as const) + }; + }; + static updateAdmin = ({ + addr + }: CamelCasedProperties["update_admin"]>): ExecuteMsg => { + return { + update_admin: ({ + addr + } as const) + }; + }; +} +export abstract class FactoryQueryMessageBuilder { + static wallets = ({ + limit, + startAfter + }: CamelCasedProperties["wallets"]>): QueryMsg => { + return { + wallets: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static walletsOf = ({ + limit, + startAfter, + user + }: CamelCasedProperties["wallets_of"]>): QueryMsg => { + return { + wallets_of: ({ + limit, + start_after: startAfter, + user + } as const) + }; + }; + static codeId = ({ + ty + }: CamelCasedProperties["code_id"]>): QueryMsg => { + return { + code_id: ({ + ty + } as const) + }; + }; + static fee = (): QueryMsg => { + return { + fee: ({} as const) + }; + }; + static govecAddr = (): QueryMsg => { + return { + govec_addr: ({} as const) + }; + }; + static adminAddr = (): QueryMsg => { + return { + admin_addr: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/default/Minter.message-builder.ts b/__output__/builder/default/Minter.message-builder.ts new file mode 100644 index 00000000..e139b2ad --- /dev/null +++ b/__output__/builder/default/Minter.message-builder.ts @@ -0,0 +1,104 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class MinterExecuteMessageBuilder { + static mint = (): ExecuteMsg => { + return { + mint: ({} as const) + }; + }; + static setWhitelist = ({ + whitelist + }: CamelCasedProperties["set_whitelist"]>): ExecuteMsg => { + return { + set_whitelist: ({ + whitelist + } as const) + }; + }; + static updateStartTime = (): ExecuteMsg => { + return { + update_start_time: ({} as const) + }; + }; + static updatePerAddressLimit = ({ + perAddressLimit + }: CamelCasedProperties["update_per_address_limit"]>): ExecuteMsg => { + return { + update_per_address_limit: ({ + per_address_limit: perAddressLimit + } as const) + }; + }; + static mintTo = ({ + recipient + }: CamelCasedProperties["mint_to"]>): ExecuteMsg => { + return { + mint_to: ({ + recipient + } as const) + }; + }; + static mintFor = ({ + recipient, + tokenId + }: CamelCasedProperties["mint_for"]>): ExecuteMsg => { + return { + mint_for: ({ + recipient, + token_id: tokenId + } as const) + }; + }; + static withdraw = (): ExecuteMsg => { + return { + withdraw: ({} as const) + }; + }; +} +export abstract class MinterQueryMessageBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static mintableNumTokens = (): QueryMsg => { + return { + mintable_num_tokens: ({} as const) + }; + }; + static startTime = (): QueryMsg => { + return { + start_time: ({} as const) + }; + }; + static mintPrice = (): QueryMsg => { + return { + mint_price: ({} as const) + }; + }; + static mintCount = ({ + address + }: CamelCasedProperties["mint_count"]>): QueryMsg => { + return { + mint_count: ({ + address + } as const) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/default/index.ts b/__output__/builder/default/index.ts index ae44c8eb..64ec085e 100644 --- a/__output__/builder/default/index.ts +++ b/__output__/builder/default/index.ts @@ -9,35 +9,35 @@ import * as _16 from "./Factory.client"; import * as _17 from "./Factory.message-composer"; import * as _18 from "./Factory.react-query"; import * as _19 from "./Factory.recoil"; -import * as _20 from "./Factory.msg-builder"; +import * as _20 from "./Factory.message-builder"; import * as _21 from "./Factory.provider"; import * as _22 from "./Minter.types"; import * as _23 from "./Minter.client"; import * as _24 from "./Minter.message-composer"; import * as _25 from "./Minter.react-query"; import * as _26 from "./Minter.recoil"; -import * as _27 from "./Minter.msg-builder"; +import * as _27 from "./Minter.message-builder"; import * as _28 from "./Minter.provider"; import * as _29 from "./CwAdminFactory.types"; import * as _30 from "./CwAdminFactory.client"; import * as _31 from "./CwAdminFactory.message-composer"; import * as _32 from "./CwAdminFactory.react-query"; import * as _33 from "./CwAdminFactory.recoil"; -import * as _34 from "./CwAdminFactory.msg-builder"; +import * as _34 from "./CwAdminFactory.message-builder"; import * as _35 from "./CwAdminFactory.provider"; import * as _36 from "./CwCodeIdRegistry.types"; import * as _37 from "./CwCodeIdRegistry.client"; import * as _38 from "./CwCodeIdRegistry.message-composer"; import * as _39 from "./CwCodeIdRegistry.react-query"; import * as _40 from "./CwCodeIdRegistry.recoil"; -import * as _41 from "./CwCodeIdRegistry.msg-builder"; +import * as _41 from "./CwCodeIdRegistry.message-builder"; import * as _42 from "./CwCodeIdRegistry.provider"; import * as _43 from "./CwSingle.types"; import * as _44 from "./CwSingle.client"; import * as _45 from "./CwSingle.message-composer"; import * as _46 from "./CwSingle.react-query"; import * as _47 from "./CwSingle.recoil"; -import * as _48 from "./CwSingle.msg-builder"; +import * as _48 from "./CwSingle.message-builder"; import * as _49 from "./CwSingle.provider"; import * as _50 from "./contractContextProviders"; import * as _51 from "./contractContextBase"; diff --git a/__output__/builder/no-extends/CwAdminFactory.message-builder.ts b/__output__/builder/no-extends/CwAdminFactory.message-builder.ts new file mode 100644 index 00000000..2a04624c --- /dev/null +++ b/__output__/builder/no-extends/CwAdminFactory.message-builder.ts @@ -0,0 +1,25 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class CwAdminFactoryExecuteMessageBuilder { + static instantiateContractWithSelfAdmin = ({ + codeId, + instantiateMsg, + label + }: CamelCasedProperties["instantiate_contract_with_self_admin"]>): ExecuteMsg => { + return { + instantiate_contract_with_self_admin: ({ + code_id: codeId, + instantiate_msg: instantiateMsg, + label + } as const) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/CwCodeIdRegistry.message-builder.ts b/__output__/builder/no-extends/CwCodeIdRegistry.message-builder.ts new file mode 100644 index 00000000..5727cd91 --- /dev/null +++ b/__output__/builder/no-extends/CwCodeIdRegistry.message-builder.ts @@ -0,0 +1,133 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class CwCodeIdRegistryExecuteMessageBuilder { + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static register = ({ + chainId, + checksum, + codeId, + name, + version + }: CamelCasedProperties["register"]>): ExecuteMsg => { + return { + register: ({ + chain_id: chainId, + checksum, + code_id: codeId, + name, + version + } as const) + }; + }; + static setOwner = ({ + chainId, + name, + owner + }: CamelCasedProperties["set_owner"]>): ExecuteMsg => { + return { + set_owner: ({ + chain_id: chainId, + name, + owner + } as const) + }; + }; + static unregister = ({ + chainId, + codeId + }: CamelCasedProperties["unregister"]>): ExecuteMsg => { + return { + unregister: ({ + chain_id: chainId, + code_id: codeId + } as const) + }; + }; + static updateConfig = ({ + admin, + paymentInfo + }: CamelCasedProperties["update_config"]>): ExecuteMsg => { + return { + update_config: ({ + admin, + payment_info: paymentInfo + } as const) + }; + }; +} +export abstract class CwCodeIdRegistryQueryMessageBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static getRegistration = ({ + chainId, + name, + version + }: CamelCasedProperties["get_registration"]>): QueryMsg => { + return { + get_registration: ({ + chain_id: chainId, + name, + version + } as const) + }; + }; + static infoForCodeId = ({ + chainId, + codeId + }: CamelCasedProperties["info_for_code_id"]>): QueryMsg => { + return { + info_for_code_id: ({ + chain_id: chainId, + code_id: codeId + } as const) + }; + }; + static listRegistrations = ({ + chainId, + name + }: CamelCasedProperties["list_registrations"]>): QueryMsg => { + return { + list_registrations: ({ + chain_id: chainId, + name + } as const) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/CwSingle.message-builder.ts b/__output__/builder/no-extends/CwSingle.message-builder.ts new file mode 100644 index 00000000..bdc753da --- /dev/null +++ b/__output__/builder/no-extends/CwSingle.message-builder.ts @@ -0,0 +1,219 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class CwSingleExecuteMessageBuilder { + static propose = ({ + description, + msgs, + title + }: CamelCasedProperties["propose"]>): ExecuteMsg => { + return { + propose: ({ + description, + msgs, + title + } as const) + }; + }; + static vote = ({ + proposalId, + vote + }: CamelCasedProperties["vote"]>): ExecuteMsg => { + return { + vote: ({ + proposal_id: proposalId, + vote + } as const) + }; + }; + static execute = ({ + proposalId + }: CamelCasedProperties["execute"]>): ExecuteMsg => { + return { + execute: ({ + proposal_id: proposalId + } as const) + }; + }; + static close = ({ + proposalId + }: CamelCasedProperties["close"]>): ExecuteMsg => { + return { + close: ({ + proposal_id: proposalId + } as const) + }; + }; + static updateConfig = ({ + allowRevoting, + dao, + depositInfo, + maxVotingPeriod, + minVotingPeriod, + onlyMembersExecute, + threshold + }: CamelCasedProperties["update_config"]>): ExecuteMsg => { + return { + update_config: ({ + allow_revoting: allowRevoting, + dao, + deposit_info: depositInfo, + max_voting_period: maxVotingPeriod, + min_voting_period: minVotingPeriod, + only_members_execute: onlyMembersExecute, + threshold + } as const) + }; + }; + static addProposalHook = ({ + address + }: CamelCasedProperties["add_proposal_hook"]>): ExecuteMsg => { + return { + add_proposal_hook: ({ + address + } as const) + }; + }; + static removeProposalHook = ({ + address + }: CamelCasedProperties["remove_proposal_hook"]>): ExecuteMsg => { + return { + remove_proposal_hook: ({ + address + } as const) + }; + }; + static addVoteHook = ({ + address + }: CamelCasedProperties["add_vote_hook"]>): ExecuteMsg => { + return { + add_vote_hook: ({ + address + } as const) + }; + }; + static removeVoteHook = ({ + address + }: CamelCasedProperties["remove_vote_hook"]>): ExecuteMsg => { + return { + remove_vote_hook: ({ + address + } as const) + }; + }; +} +export abstract class CwSingleQueryMessageBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static proposal = ({ + proposalId + }: CamelCasedProperties["proposal"]>): QueryMsg => { + return { + proposal: ({ + proposal_id: proposalId + } as const) + }; + }; + static listProposals = ({ + limit, + startAfter + }: CamelCasedProperties["list_proposals"]>): QueryMsg => { + return { + list_proposals: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static reverseProposals = ({ + limit, + startBefore + }: CamelCasedProperties["reverse_proposals"]>): QueryMsg => { + return { + reverse_proposals: ({ + limit, + start_before: startBefore + } as const) + }; + }; + static proposalCount = (): QueryMsg => { + return { + proposal_count: ({} as const) + }; + }; + static vote = ({ + proposalId, + voter + }: CamelCasedProperties["vote"]>): QueryMsg => { + return { + vote: ({ + proposal_id: proposalId, + voter + } as const) + }; + }; + static listVotes = ({ + limit, + proposalId, + startAfter + }: CamelCasedProperties["list_votes"]>): QueryMsg => { + return { + list_votes: ({ + limit, + proposal_id: proposalId, + start_after: startAfter + } as const) + }; + }; + static proposalHooks = (): QueryMsg => { + return { + proposal_hooks: ({} as const) + }; + }; + static voteHooks = (): QueryMsg => { + return { + vote_hooks: ({} as const) + }; + }; + static info = (): QueryMsg => { + return { + info: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/Factory.message-builder.ts b/__output__/builder/no-extends/Factory.message-builder.ts new file mode 100644 index 00000000..2bbace3f --- /dev/null +++ b/__output__/builder/no-extends/Factory.message-builder.ts @@ -0,0 +1,149 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class FactoryExecuteMessageBuilder { + static createWallet = ({ + createWalletMsg + }: CamelCasedProperties["create_wallet"]>): ExecuteMsg => { + return { + create_wallet: ({ + create_wallet_msg: createWalletMsg + } as const) + }; + }; + static updateProxyUser = ({ + newUser, + oldUser + }: CamelCasedProperties["update_proxy_user"]>): ExecuteMsg => { + return { + update_proxy_user: ({ + new_user: newUser, + old_user: oldUser + } as const) + }; + }; + static migrateWallet = ({ + migrationMsg, + walletAddress + }: CamelCasedProperties["migrate_wallet"]>): ExecuteMsg => { + return { + migrate_wallet: ({ + migration_msg: migrationMsg, + wallet_address: walletAddress + } as const) + }; + }; + static updateCodeId = ({ + newCodeId, + ty + }: CamelCasedProperties["update_code_id"]>): ExecuteMsg => { + return { + update_code_id: ({ + new_code_id: newCodeId, + ty + } as const) + }; + }; + static updateWalletFee = ({ + newFee + }: CamelCasedProperties["update_wallet_fee"]>): ExecuteMsg => { + return { + update_wallet_fee: ({ + new_fee: newFee + } as const) + }; + }; + static updateGovecAddr = ({ + addr + }: CamelCasedProperties["update_govec_addr"]>): ExecuteMsg => { + return { + update_govec_addr: ({ + addr + } as const) + }; + }; + static updateAdmin = ({ + addr + }: CamelCasedProperties["update_admin"]>): ExecuteMsg => { + return { + update_admin: ({ + addr + } as const) + }; + }; +} +export abstract class FactoryQueryMessageBuilder { + static wallets = ({ + limit, + startAfter + }: CamelCasedProperties["wallets"]>): QueryMsg => { + return { + wallets: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static walletsOf = ({ + limit, + startAfter, + user + }: CamelCasedProperties["wallets_of"]>): QueryMsg => { + return { + wallets_of: ({ + limit, + start_after: startAfter, + user + } as const) + }; + }; + static codeId = ({ + ty + }: CamelCasedProperties["code_id"]>): QueryMsg => { + return { + code_id: ({ + ty + } as const) + }; + }; + static fee = (): QueryMsg => { + return { + fee: ({} as const) + }; + }; + static govecAddr = (): QueryMsg => { + return { + govec_addr: ({} as const) + }; + }; + static adminAddr = (): QueryMsg => { + return { + admin_addr: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/Minter.message-builder.ts b/__output__/builder/no-extends/Minter.message-builder.ts new file mode 100644 index 00000000..e139b2ad --- /dev/null +++ b/__output__/builder/no-extends/Minter.message-builder.ts @@ -0,0 +1,104 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class MinterExecuteMessageBuilder { + static mint = (): ExecuteMsg => { + return { + mint: ({} as const) + }; + }; + static setWhitelist = ({ + whitelist + }: CamelCasedProperties["set_whitelist"]>): ExecuteMsg => { + return { + set_whitelist: ({ + whitelist + } as const) + }; + }; + static updateStartTime = (): ExecuteMsg => { + return { + update_start_time: ({} as const) + }; + }; + static updatePerAddressLimit = ({ + perAddressLimit + }: CamelCasedProperties["update_per_address_limit"]>): ExecuteMsg => { + return { + update_per_address_limit: ({ + per_address_limit: perAddressLimit + } as const) + }; + }; + static mintTo = ({ + recipient + }: CamelCasedProperties["mint_to"]>): ExecuteMsg => { + return { + mint_to: ({ + recipient + } as const) + }; + }; + static mintFor = ({ + recipient, + tokenId + }: CamelCasedProperties["mint_for"]>): ExecuteMsg => { + return { + mint_for: ({ + recipient, + token_id: tokenId + } as const) + }; + }; + static withdraw = (): ExecuteMsg => { + return { + withdraw: ({} as const) + }; + }; +} +export abstract class MinterQueryMessageBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static mintableNumTokens = (): QueryMsg => { + return { + mintable_num_tokens: ({} as const) + }; + }; + static startTime = (): QueryMsg => { + return { + start_time: ({} as const) + }; + }; + static mintPrice = (): QueryMsg => { + return { + mint_price: ({} as const) + }; + }; + static mintCount = ({ + address + }: CamelCasedProperties["mint_count"]>): QueryMsg => { + return { + mint_count: ({ + address + } as const) + }; + }; +} \ No newline at end of file diff --git a/__output__/builder/no-extends/index.ts b/__output__/builder/no-extends/index.ts index 26f0e94c..b6cee78c 100644 --- a/__output__/builder/no-extends/index.ts +++ b/__output__/builder/no-extends/index.ts @@ -9,31 +9,31 @@ import * as _54 from "./Factory.client"; import * as _55 from "./Factory.message-composer"; import * as _56 from "./Factory.react-query"; import * as _57 from "./Factory.recoil"; -import * as _58 from "./Factory.msg-builder"; +import * as _58 from "./Factory.message-builder"; import * as _59 from "./Minter.types"; import * as _60 from "./Minter.client"; import * as _61 from "./Minter.message-composer"; import * as _62 from "./Minter.react-query"; import * as _63 from "./Minter.recoil"; -import * as _64 from "./Minter.msg-builder"; +import * as _64 from "./Minter.message-builder"; import * as _65 from "./CwAdminFactory.types"; import * as _66 from "./CwAdminFactory.client"; import * as _67 from "./CwAdminFactory.message-composer"; import * as _68 from "./CwAdminFactory.react-query"; import * as _69 from "./CwAdminFactory.recoil"; -import * as _70 from "./CwAdminFactory.msg-builder"; +import * as _70 from "./CwAdminFactory.message-builder"; import * as _71 from "./CwCodeIdRegistry.types"; import * as _72 from "./CwCodeIdRegistry.client"; import * as _73 from "./CwCodeIdRegistry.message-composer"; import * as _74 from "./CwCodeIdRegistry.react-query"; import * as _75 from "./CwCodeIdRegistry.recoil"; -import * as _76 from "./CwCodeIdRegistry.msg-builder"; +import * as _76 from "./CwCodeIdRegistry.message-builder"; import * as _77 from "./CwSingle.types"; import * as _78 from "./CwSingle.client"; import * as _79 from "./CwSingle.message-composer"; import * as _80 from "./CwSingle.react-query"; import * as _81 from "./CwSingle.recoil"; -import * as _82 from "./CwSingle.msg-builder"; +import * as _82 from "./CwSingle.message-builder"; export namespace smart { export namespace contracts { export const Factory = { ..._53, diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index 4c47430e..efbaf3bc 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -263,7 +263,7 @@ cosmwasm-ts-codegen generate \ ### Message Builder -Generate raw message jsons for use in your application with the `msg-builder` command. +Generate raw message jsons for use in your application with the `message-builder` command. [see example output code](https://gist.github.com/adairrr/b394e62beb9856b0351883f776650f26) @@ -271,7 +271,7 @@ Generate raw message jsons for use in your application with the `msg-builder` co ```sh cosmwasm-ts-codegen generate \ - --plugin msg-builder \ + --plugin message-builder \ --schema ./schema \ --out ./ts \ --name MyContractName @@ -474,7 +474,7 @@ https://gist.github.com/pyramation/a9520ccf131177b1841e02a97d7d3731 https://gist.github.com/pyramation/43320e8b952751a0bd5a77dbc5b601f4 -- `cosmwasm-ts-codegen generate --plugin msg-builder` +- `cosmwasm-ts-codegen generate --plugin message-builder` https://gist.github.com/adairrr/b394e62beb9856b0351883f776650f26 diff --git a/packages/ts-codegen/src/builder/builder.ts b/packages/ts-codegen/src/builder/builder.ts index 691ca6ff..222792a7 100644 --- a/packages/ts-codegen/src/builder/builder.ts +++ b/packages/ts-codegen/src/builder/builder.ts @@ -61,7 +61,7 @@ export type TSBuilderOptions = { useContractsHooks?: UseContractsOptions; } & RenderOptions; -export type BuilderFileType = 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer' | 'msg-builder' | 'plugin'; +export type BuilderFileType = 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer' | 'message-builder' | 'plugin'; export interface BuilderFile { type: BuilderFileType; diff --git a/packages/ts-codegen/src/commands/generate.ts b/packages/ts-codegen/src/commands/generate.ts index b7d6c1c8..da45c51e 100644 --- a/packages/ts-codegen/src/commands/generate.ts +++ b/packages/ts-codegen/src/commands/generate.ts @@ -152,7 +152,8 @@ export default async (argv) => { enabled: plugin.includes('message-composer') }, messageBuilder: { - enabled: plugin.includes('msg-builder') + + enabled: plugin.includes('message-builder') }, bundle: { enabled: bundle, diff --git a/packages/ts-codegen/src/generators/msg-builder.ts b/packages/ts-codegen/src/generators/msg-builder.ts index 195cce23..af5d7779 100644 --- a/packages/ts-codegen/src/generators/msg-builder.ts +++ b/packages/ts-codegen/src/generators/msg-builder.ts @@ -10,8 +10,6 @@ import { ContractInfo, getMessageProperties } from "wasm-ast-types"; import { findAndParseTypes, findExecuteMsg, findQueryMsg } from '../utils'; import { RenderContext, MessageBuilderOptions } from 'wasm-ast-types'; import { BuilderFile } from "../builder"; -import babelTraverse from '@babel/traverse'; -import { parse as babelParse } from '@babel/parser' export default async ( name: string, @@ -24,7 +22,7 @@ export default async ( messageBuilder: messageBuilderOptions ?? {}, }); - const localname = pascal(name) + ".msg-builder.ts"; + const localname = pascal(name) + ".message-builder.ts"; const TypesFile = pascal(name) + ".types"; const ExecuteMsg = findExecuteMsg(schemas); const typeHash = await findAndParseTypes(schemas); @@ -38,7 +36,7 @@ export default async ( if (ExecuteMsg) { const children = getMessageProperties(ExecuteMsg); if (children.length > 0) { - const className = pascal(`${name}ExecuteMessageBuilder`); + const className = pascal(`${name}ExecuteMsgBuilder`); body.push( w.createMessageBuilderClass(context, className, ExecuteMsg) @@ -51,7 +49,7 @@ export default async ( if (QueryMsg) { const children = getMessageProperties(QueryMsg); if (children.length > 0) { - const className = pascal(`${name}QueryMessageBuilder`); + const className = pascal(`${name}QueryMsgBuilder`); body.push( w.createMessageBuilderClass(context, className, QueryMsg) @@ -71,7 +69,7 @@ export default async ( return [ { - type: "msg-builder", + type: "message-builder", contract: name, localname, filename: join(outPath, localname), diff --git a/packages/ts-codegen/src/plugins/message-builder.ts b/packages/ts-codegen/src/plugins/message-builder.ts index 7e74d854..3a5c9450 100644 --- a/packages/ts-codegen/src/plugins/message-builder.ts +++ b/packages/ts-codegen/src/plugins/message-builder.ts @@ -38,7 +38,7 @@ export class MessageBuilderPlugin extends BuilderPluginBase { const { schemas } = context.contract; - const localname = pascal(name) + '.msg-builder.ts'; + const localname = pascal(name) + '.message-builder.ts'; const TypesFile = pascal(name) + '.types'; const ExecuteMsg = findExecuteMsg(schemas); const typeHash = await findAndParseTypes(schemas); @@ -76,7 +76,7 @@ export class MessageBuilderPlugin extends BuilderPluginBase { return [ { - type: 'msg-builder', + type: 'message-builder', localname, body } diff --git a/packages/ts-codegen/types/src/builder/builder.d.ts b/packages/ts-codegen/types/src/builder/builder.d.ts index 73637368..6b3c76f6 100644 --- a/packages/ts-codegen/types/src/builder/builder.d.ts +++ b/packages/ts-codegen/types/src/builder/builder.d.ts @@ -15,15 +15,16 @@ export interface BundleOptions { export interface UseContractsOptions { enabled?: boolean; } -export declare type TSBuilderOptions = { +export type TSBuilderOptions = { bundle?: BundleOptions; /** * Enable using shorthand constructor. + * Default: false */ useShorthandCtor?: boolean; useContractsHooks?: UseContractsOptions; } & RenderOptions; -export declare type BuilderFileType = 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer' | 'msg-builder' | 'plugin'; +export type BuilderFileType = 'type' | 'client' | 'recoil' | 'react-query' | 'message-composer' | 'message-builder' | 'plugin'; export interface BuilderFile { type: BuilderFileType; pluginType?: string; diff --git a/packages/ts-codegen/types/src/plugins/message-builder.d.ts b/packages/ts-codegen/types/src/plugins/message-builder.d.ts new file mode 100644 index 00000000..8c0aeb4a --- /dev/null +++ b/packages/ts-codegen/types/src/plugins/message-builder.d.ts @@ -0,0 +1,12 @@ +import { RenderContext, RenderContextBase, ContractInfo, RenderOptions } from 'wasm-ast-types'; +import { BuilderFileType } from '../builder'; +import { BuilderPluginBase } from './plugin-base'; +export declare class MessageBuilderPlugin extends BuilderPluginBase { + initContext(contract: ContractInfo, options?: RenderOptions): RenderContextBase; + doRender(name: string, context: RenderContext): Promise<{ + type: BuilderFileType; + pluginType?: string; + localname: string; + body: any[]; + }[]>; +} diff --git a/packages/wasm-ast-types/src/index.ts b/packages/wasm-ast-types/src/index.ts index 86db1e42..0c135b31 100644 --- a/packages/wasm-ast-types/src/index.ts +++ b/packages/wasm-ast-types/src/index.ts @@ -5,5 +5,5 @@ export * from './recoil'; export * from './message-composer'; export * from './react-query'; export * from './types'; -export * from './msg-builder'; +export * from './message-builder'; export * from './provider'; diff --git a/packages/wasm-ast-types/src/msg-builder/__snapshots__/msg-builder.spec.ts.snap b/packages/wasm-ast-types/src/message-builder/__snapshots__/message-builder.spec.ts.snap similarity index 100% rename from packages/wasm-ast-types/src/msg-builder/__snapshots__/msg-builder.spec.ts.snap rename to packages/wasm-ast-types/src/message-builder/__snapshots__/message-builder.spec.ts.snap diff --git a/packages/wasm-ast-types/src/message-builder/index.ts b/packages/wasm-ast-types/src/message-builder/index.ts new file mode 100644 index 00000000..e054b30f --- /dev/null +++ b/packages/wasm-ast-types/src/message-builder/index.ts @@ -0,0 +1 @@ +export * from './message-builder'; diff --git a/packages/wasm-ast-types/src/msg-builder/msg-builder.spec.ts b/packages/wasm-ast-types/src/message-builder/message-builder.spec.ts similarity index 90% rename from packages/wasm-ast-types/src/msg-builder/msg-builder.spec.ts rename to packages/wasm-ast-types/src/message-builder/message-builder.spec.ts index c328646e..ef0b4a0c 100644 --- a/packages/wasm-ast-types/src/msg-builder/msg-builder.spec.ts +++ b/packages/wasm-ast-types/src/message-builder/message-builder.spec.ts @@ -4,9 +4,8 @@ import ownership from '../../../../__fixtures__/basic/ownership.json'; import { createMessageBuilderClass, -} from './msg-builder' +} from './message-builder' import { expectCode, makeContext } from '../../test-utils'; -import { findExecuteMsg } from '@cosmwasm/ts-codegen/src'; it('execute class', () => { const ctx = makeContext(execute_msg); diff --git a/packages/wasm-ast-types/src/msg-builder/msg-builder.ts b/packages/wasm-ast-types/src/message-builder/message-builder.ts similarity index 97% rename from packages/wasm-ast-types/src/msg-builder/msg-builder.ts rename to packages/wasm-ast-types/src/message-builder/message-builder.ts index 5abc1acf..16171c08 100644 --- a/packages/wasm-ast-types/src/msg-builder/msg-builder.ts +++ b/packages/wasm-ast-types/src/message-builder/message-builder.ts @@ -5,7 +5,7 @@ import { ExecuteMsg, QueryMsg } from '../types'; import { createTypedObjectParams } from '../utils/types'; import { RenderContext } from '../context'; import { getWasmMethodArgs } from '../client/client'; -import { Expression, Identifier, PatternLike, TSAsExpression } from '@babel/types'; +import { Expression } from '@babel/types'; export const createMessageBuilderClass = ( context: RenderContext, diff --git a/packages/wasm-ast-types/src/msg-builder/index.ts b/packages/wasm-ast-types/src/msg-builder/index.ts deleted file mode 100644 index 8b5b3650..00000000 --- a/packages/wasm-ast-types/src/msg-builder/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './msg-builder'; diff --git a/packages/wasm-ast-types/src/react-query/react-query.spec.ts b/packages/wasm-ast-types/src/react-query/react-query.spec.ts index a390f437..19921053 100644 --- a/packages/wasm-ast-types/src/react-query/react-query.spec.ts +++ b/packages/wasm-ast-types/src/react-query/react-query.spec.ts @@ -9,7 +9,7 @@ import { createReactQueryMutationHooks, } from './react-query' import { expectCode, makeContext } from '../../test-utils'; -import { createMessageBuilderClass } from '../msg-builder'; +import { createMessageBuilderClass } from '../message-builder'; const execCtx = makeContext(execute_msg); const queryCtx = makeContext(query_msg); diff --git a/packages/wasm-ast-types/types/context/context.d.ts b/packages/wasm-ast-types/types/context/context.d.ts index 9c4c198a..654e43d8 100644 --- a/packages/wasm-ast-types/types/context/context.d.ts +++ b/packages/wasm-ast-types/types/context/context.d.ts @@ -121,4 +121,4 @@ export declare abstract class RenderContextBase implements export declare class RenderContext extends RenderContextBase { mergeDefaultOpt(options: RenderOptions): RenderOptions; } -export { }; +export {}; diff --git a/packages/wasm-ast-types/types/context/imports.d.ts b/packages/wasm-ast-types/types/context/imports.d.ts index 55ca6708..21361af1 100644 --- a/packages/wasm-ast-types/types/context/imports.d.ts +++ b/packages/wasm-ast-types/types/context/imports.d.ts @@ -5,8 +5,8 @@ export interface ImportObj { path: string; importAs?: string; } -export declare type GetUtilFn = ((...args: any[]) => (context: TContext) => ImportObj); -export declare type UtilMapping = { +export type GetUtilFn = ((...args: any[]) => (context: TContext) => ImportObj); +export type UtilMapping = { [key: string]: ImportObj | string | GetUtilFn; }; export declare const UTILS: { diff --git a/packages/wasm-ast-types/types/index.d.ts b/packages/wasm-ast-types/types/index.d.ts index 86db1e42..0c135b31 100644 --- a/packages/wasm-ast-types/types/index.d.ts +++ b/packages/wasm-ast-types/types/index.d.ts @@ -5,5 +5,5 @@ export * from './recoil'; export * from './message-composer'; export * from './react-query'; export * from './types'; -export * from './msg-builder'; +export * from './message-builder'; export * from './provider'; diff --git a/packages/wasm-ast-types/types/message-builder/index.d.ts b/packages/wasm-ast-types/types/message-builder/index.d.ts new file mode 100644 index 00000000..e054b30f --- /dev/null +++ b/packages/wasm-ast-types/types/message-builder/index.d.ts @@ -0,0 +1 @@ +export * from './message-builder'; diff --git a/packages/wasm-ast-types/types/msg-builder/msg-builder.d.ts b/packages/wasm-ast-types/types/message-builder/message-builder.d.ts similarity index 100% rename from packages/wasm-ast-types/types/msg-builder/msg-builder.d.ts rename to packages/wasm-ast-types/types/message-builder/message-builder.d.ts diff --git a/packages/wasm-ast-types/types/msg-builder/index.d.ts b/packages/wasm-ast-types/types/msg-builder/index.d.ts deleted file mode 100644 index 8b5b3650..00000000 --- a/packages/wasm-ast-types/types/msg-builder/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './msg-builder'; From 58be5a564d5d2d65f5e8ce574f5f0ccdb80e58ce Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 9 Aug 2023 14:44:12 -0700 Subject: [PATCH 159/287] cleanup --- README.md | 2 +- __output__/builder/default/CwAdminFactory.message-builder.ts | 2 +- .../builder/default/CwCodeIdRegistry.message-builder.ts | 4 ++-- __output__/builder/default/CwSingle.message-builder.ts | 4 ++-- __output__/builder/default/Factory.message-builder.ts | 4 ++-- __output__/builder/default/Minter.message-builder.ts | 4 ++-- .../builder/no-extends/CwAdminFactory.message-builder.ts | 2 +- .../builder/no-extends/CwCodeIdRegistry.message-builder.ts | 4 ++-- __output__/builder/no-extends/CwSingle.message-builder.ts | 4 ++-- __output__/builder/no-extends/Factory.message-builder.ts | 4 ++-- __output__/builder/no-extends/Minter.message-builder.ts | 4 ++-- packages/ts-codegen/src/plugins/message-builder.ts | 4 ++-- 12 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 7b8d5b46..bc062836 100644 --- a/README.md +++ b/README.md @@ -502,7 +502,7 @@ import { generateClient, generateReactQuery, generateRecoil, - generateMessageComposer, + generateMessageComposer } from '@cosmwasm/ts-codegen'; ``` ### Example Output diff --git a/__output__/builder/default/CwAdminFactory.message-builder.ts b/__output__/builder/default/CwAdminFactory.message-builder.ts index 2a04624c..1e03ab7b 100644 --- a/__output__/builder/default/CwAdminFactory.message-builder.ts +++ b/__output__/builder/default/CwAdminFactory.message-builder.ts @@ -6,7 +6,7 @@ import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; import { CamelCasedProperties } from "type-fest"; -export abstract class CwAdminFactoryExecuteMessageBuilder { +export abstract class CwAdminFactoryExecuteMsgBuilder { static instantiateContractWithSelfAdmin = ({ codeId, instantiateMsg, diff --git a/__output__/builder/default/CwCodeIdRegistry.message-builder.ts b/__output__/builder/default/CwCodeIdRegistry.message-builder.ts index 5727cd91..3e15defb 100644 --- a/__output__/builder/default/CwCodeIdRegistry.message-builder.ts +++ b/__output__/builder/default/CwCodeIdRegistry.message-builder.ts @@ -6,7 +6,7 @@ import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; import { CamelCasedProperties } from "type-fest"; -export abstract class CwCodeIdRegistryExecuteMessageBuilder { +export abstract class CwCodeIdRegistryExecuteMsgBuilder { static receive = ({ amount, msg, @@ -83,7 +83,7 @@ export abstract class CwCodeIdRegistryExecuteMessageBuilder { }; }; } -export abstract class CwCodeIdRegistryQueryMessageBuilder { +export abstract class CwCodeIdRegistryQueryMsgBuilder { static config = (): QueryMsg => { return { config: ({} as const) diff --git a/__output__/builder/default/CwSingle.message-builder.ts b/__output__/builder/default/CwSingle.message-builder.ts index bdc753da..1859f108 100644 --- a/__output__/builder/default/CwSingle.message-builder.ts +++ b/__output__/builder/default/CwSingle.message-builder.ts @@ -6,7 +6,7 @@ import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; import { CamelCasedProperties } from "type-fest"; -export abstract class CwSingleExecuteMessageBuilder { +export abstract class CwSingleExecuteMsgBuilder { static propose = ({ description, msgs, @@ -125,7 +125,7 @@ export abstract class CwSingleExecuteMessageBuilder { }; }; } -export abstract class CwSingleQueryMessageBuilder { +export abstract class CwSingleQueryMsgBuilder { static config = (): QueryMsg => { return { config: ({} as const) diff --git a/__output__/builder/default/Factory.message-builder.ts b/__output__/builder/default/Factory.message-builder.ts index 2bbace3f..0c662c0a 100644 --- a/__output__/builder/default/Factory.message-builder.ts +++ b/__output__/builder/default/Factory.message-builder.ts @@ -6,7 +6,7 @@ import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { CamelCasedProperties } from "type-fest"; -export abstract class FactoryExecuteMessageBuilder { +export abstract class FactoryExecuteMsgBuilder { static createWallet = ({ createWalletMsg }: CamelCasedProperties { return { mint: ({} as const) @@ -69,7 +69,7 @@ export abstract class MinterExecuteMessageBuilder { }; }; } -export abstract class MinterQueryMessageBuilder { +export abstract class MinterQueryMsgBuilder { static config = (): QueryMsg => { return { config: ({} as const) diff --git a/__output__/builder/no-extends/CwAdminFactory.message-builder.ts b/__output__/builder/no-extends/CwAdminFactory.message-builder.ts index 2a04624c..1e03ab7b 100644 --- a/__output__/builder/no-extends/CwAdminFactory.message-builder.ts +++ b/__output__/builder/no-extends/CwAdminFactory.message-builder.ts @@ -6,7 +6,7 @@ import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; import { CamelCasedProperties } from "type-fest"; -export abstract class CwAdminFactoryExecuteMessageBuilder { +export abstract class CwAdminFactoryExecuteMsgBuilder { static instantiateContractWithSelfAdmin = ({ codeId, instantiateMsg, diff --git a/__output__/builder/no-extends/CwCodeIdRegistry.message-builder.ts b/__output__/builder/no-extends/CwCodeIdRegistry.message-builder.ts index 5727cd91..3e15defb 100644 --- a/__output__/builder/no-extends/CwCodeIdRegistry.message-builder.ts +++ b/__output__/builder/no-extends/CwCodeIdRegistry.message-builder.ts @@ -6,7 +6,7 @@ import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; import { CamelCasedProperties } from "type-fest"; -export abstract class CwCodeIdRegistryExecuteMessageBuilder { +export abstract class CwCodeIdRegistryExecuteMsgBuilder { static receive = ({ amount, msg, @@ -83,7 +83,7 @@ export abstract class CwCodeIdRegistryExecuteMessageBuilder { }; }; } -export abstract class CwCodeIdRegistryQueryMessageBuilder { +export abstract class CwCodeIdRegistryQueryMsgBuilder { static config = (): QueryMsg => { return { config: ({} as const) diff --git a/__output__/builder/no-extends/CwSingle.message-builder.ts b/__output__/builder/no-extends/CwSingle.message-builder.ts index bdc753da..1859f108 100644 --- a/__output__/builder/no-extends/CwSingle.message-builder.ts +++ b/__output__/builder/no-extends/CwSingle.message-builder.ts @@ -6,7 +6,7 @@ import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; import { CamelCasedProperties } from "type-fest"; -export abstract class CwSingleExecuteMessageBuilder { +export abstract class CwSingleExecuteMsgBuilder { static propose = ({ description, msgs, @@ -125,7 +125,7 @@ export abstract class CwSingleExecuteMessageBuilder { }; }; } -export abstract class CwSingleQueryMessageBuilder { +export abstract class CwSingleQueryMsgBuilder { static config = (): QueryMsg => { return { config: ({} as const) diff --git a/__output__/builder/no-extends/Factory.message-builder.ts b/__output__/builder/no-extends/Factory.message-builder.ts index 2bbace3f..0c662c0a 100644 --- a/__output__/builder/no-extends/Factory.message-builder.ts +++ b/__output__/builder/no-extends/Factory.message-builder.ts @@ -6,7 +6,7 @@ import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { CamelCasedProperties } from "type-fest"; -export abstract class FactoryExecuteMessageBuilder { +export abstract class FactoryExecuteMsgBuilder { static createWallet = ({ createWalletMsg }: CamelCasedProperties { return { mint: ({} as const) @@ -69,7 +69,7 @@ export abstract class MinterExecuteMessageBuilder { }; }; } -export abstract class MinterQueryMessageBuilder { +export abstract class MinterQueryMsgBuilder { static config = (): QueryMsg => { return { config: ({} as const) diff --git a/packages/ts-codegen/src/plugins/message-builder.ts b/packages/ts-codegen/src/plugins/message-builder.ts index 3a5c9450..a043d921 100644 --- a/packages/ts-codegen/src/plugins/message-builder.ts +++ b/packages/ts-codegen/src/plugins/message-builder.ts @@ -52,7 +52,7 @@ export class MessageBuilderPlugin extends BuilderPluginBase { if (ExecuteMsg) { const children = getMessageProperties(ExecuteMsg); if (children.length > 0) { - const className = pascal(`${name}ExecuteMessageBuilder`); + const className = pascal(`${name}ExecuteMsgBuilder`); body.push(w.createMessageBuilderClass(context, className, ExecuteMsg)); } @@ -63,7 +63,7 @@ export class MessageBuilderPlugin extends BuilderPluginBase { if (QueryMsg) { const children = getMessageProperties(QueryMsg); if (children.length > 0) { - const className = pascal(`${name}QueryMessageBuilder`); + const className = pascal(`${name}QueryMsgBuilder`); body.push(w.createMessageBuilderClass(context, className, QueryMsg)); } From 37c47d4af0795883b5694f93233ae00a77ad0025 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 9 Aug 2023 14:45:16 -0700 Subject: [PATCH 160/287] delete old files --- .../contracts/CwAdminFactory.msg-builder.ts | 25 -- .../contracts/CwCodeIdRegistry.msg-builder.ts | 133 ----------- .../contracts/CwSingle.msg-builder.ts | 219 ------------------ .../contracts/Factory.msg-builder.ts | 149 ------------ .../contracts/Minter.msg-builder.ts | 104 --------- .../default/CwAdminFactory.msg-builder.ts | 25 -- .../default/CwCodeIdRegistry.msg-builder.ts | 133 ----------- .../builder/default/CwSingle.msg-builder.ts | 219 ------------------ .../builder/default/Factory.msg-builder.ts | 149 ------------ .../builder/default/Minter.msg-builder.ts | 104 --------- .../no-extends/CwAdminFactory.msg-builder.ts | 25 -- .../CwCodeIdRegistry.msg-builder.ts | 133 ----------- .../no-extends/CwSingle.msg-builder.ts | 219 ------------------ .../builder/no-extends/Factory.msg-builder.ts | 149 ------------ .../builder/no-extends/Minter.msg-builder.ts | 104 --------- __output__/cosmwasm/CW4Group.client.ts | 177 -------------- .../cosmwasm/CW4Group.message-composer.ts | 130 ----------- __output__/cosmwasm/CW4Group.react-query.ts | 66 ------ __output__/cosmwasm/CW4Group.recoil.ts | 94 -------- __output__/cosmwasm/CW4Group.types.ts | 75 ------ .../vectis/factory-opt/Factory.react-query.ts | 105 --------- .../Factory.react-query.ts | 114 --------- 22 files changed, 2651 deletions(-) delete mode 100644 __output__/builder/bundler_test/contracts/CwAdminFactory.msg-builder.ts delete mode 100644 __output__/builder/bundler_test/contracts/CwCodeIdRegistry.msg-builder.ts delete mode 100644 __output__/builder/bundler_test/contracts/CwSingle.msg-builder.ts delete mode 100644 __output__/builder/bundler_test/contracts/Factory.msg-builder.ts delete mode 100644 __output__/builder/bundler_test/contracts/Minter.msg-builder.ts delete mode 100644 __output__/builder/default/CwAdminFactory.msg-builder.ts delete mode 100644 __output__/builder/default/CwCodeIdRegistry.msg-builder.ts delete mode 100644 __output__/builder/default/CwSingle.msg-builder.ts delete mode 100644 __output__/builder/default/Factory.msg-builder.ts delete mode 100644 __output__/builder/default/Minter.msg-builder.ts delete mode 100644 __output__/builder/no-extends/CwAdminFactory.msg-builder.ts delete mode 100644 __output__/builder/no-extends/CwCodeIdRegistry.msg-builder.ts delete mode 100644 __output__/builder/no-extends/CwSingle.msg-builder.ts delete mode 100644 __output__/builder/no-extends/Factory.msg-builder.ts delete mode 100644 __output__/builder/no-extends/Minter.msg-builder.ts delete mode 100644 __output__/cosmwasm/CW4Group.client.ts delete mode 100644 __output__/cosmwasm/CW4Group.message-composer.ts delete mode 100644 __output__/cosmwasm/CW4Group.react-query.ts delete mode 100644 __output__/cosmwasm/CW4Group.recoil.ts delete mode 100644 __output__/cosmwasm/CW4Group.types.ts delete mode 100644 __output__/vectis/factory-opt/Factory.react-query.ts delete mode 100644 __output__/vectis/factory-query-factory/Factory.react-query.ts diff --git a/__output__/builder/bundler_test/contracts/CwAdminFactory.msg-builder.ts b/__output__/builder/bundler_test/contracts/CwAdminFactory.msg-builder.ts deleted file mode 100644 index 2a04624c..00000000 --- a/__output__/builder/bundler_test/contracts/CwAdminFactory.msg-builder.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; -import { CamelCasedProperties } from "type-fest"; -export abstract class CwAdminFactoryExecuteMessageBuilder { - static instantiateContractWithSelfAdmin = ({ - codeId, - instantiateMsg, - label - }: CamelCasedProperties["instantiate_contract_with_self_admin"]>): ExecuteMsg => { - return { - instantiate_contract_with_self_admin: ({ - code_id: codeId, - instantiate_msg: instantiateMsg, - label - } as const) - }; - }; -} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.msg-builder.ts b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.msg-builder.ts deleted file mode 100644 index 5727cd91..00000000 --- a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.msg-builder.ts +++ /dev/null @@ -1,133 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; -import { CamelCasedProperties } from "type-fest"; -export abstract class CwCodeIdRegistryExecuteMessageBuilder { - static receive = ({ - amount, - msg, - sender - }: CamelCasedProperties["receive"]>): ExecuteMsg => { - return { - receive: ({ - amount, - msg, - sender - } as const) - }; - }; - static register = ({ - chainId, - checksum, - codeId, - name, - version - }: CamelCasedProperties["register"]>): ExecuteMsg => { - return { - register: ({ - chain_id: chainId, - checksum, - code_id: codeId, - name, - version - } as const) - }; - }; - static setOwner = ({ - chainId, - name, - owner - }: CamelCasedProperties["set_owner"]>): ExecuteMsg => { - return { - set_owner: ({ - chain_id: chainId, - name, - owner - } as const) - }; - }; - static unregister = ({ - chainId, - codeId - }: CamelCasedProperties["unregister"]>): ExecuteMsg => { - return { - unregister: ({ - chain_id: chainId, - code_id: codeId - } as const) - }; - }; - static updateConfig = ({ - admin, - paymentInfo - }: CamelCasedProperties["update_config"]>): ExecuteMsg => { - return { - update_config: ({ - admin, - payment_info: paymentInfo - } as const) - }; - }; -} -export abstract class CwCodeIdRegistryQueryMessageBuilder { - static config = (): QueryMsg => { - return { - config: ({} as const) - }; - }; - static getRegistration = ({ - chainId, - name, - version - }: CamelCasedProperties["get_registration"]>): QueryMsg => { - return { - get_registration: ({ - chain_id: chainId, - name, - version - } as const) - }; - }; - static infoForCodeId = ({ - chainId, - codeId - }: CamelCasedProperties["info_for_code_id"]>): QueryMsg => { - return { - info_for_code_id: ({ - chain_id: chainId, - code_id: codeId - } as const) - }; - }; - static listRegistrations = ({ - chainId, - name - }: CamelCasedProperties["list_registrations"]>): QueryMsg => { - return { - list_registrations: ({ - chain_id: chainId, - name - } as const) - }; - }; -} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwSingle.msg-builder.ts b/__output__/builder/bundler_test/contracts/CwSingle.msg-builder.ts deleted file mode 100644 index bdc753da..00000000 --- a/__output__/builder/bundler_test/contracts/CwSingle.msg-builder.ts +++ /dev/null @@ -1,219 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; -import { CamelCasedProperties } from "type-fest"; -export abstract class CwSingleExecuteMessageBuilder { - static propose = ({ - description, - msgs, - title - }: CamelCasedProperties["propose"]>): ExecuteMsg => { - return { - propose: ({ - description, - msgs, - title - } as const) - }; - }; - static vote = ({ - proposalId, - vote - }: CamelCasedProperties["vote"]>): ExecuteMsg => { - return { - vote: ({ - proposal_id: proposalId, - vote - } as const) - }; - }; - static execute = ({ - proposalId - }: CamelCasedProperties["execute"]>): ExecuteMsg => { - return { - execute: ({ - proposal_id: proposalId - } as const) - }; - }; - static close = ({ - proposalId - }: CamelCasedProperties["close"]>): ExecuteMsg => { - return { - close: ({ - proposal_id: proposalId - } as const) - }; - }; - static updateConfig = ({ - allowRevoting, - dao, - depositInfo, - maxVotingPeriod, - minVotingPeriod, - onlyMembersExecute, - threshold - }: CamelCasedProperties["update_config"]>): ExecuteMsg => { - return { - update_config: ({ - allow_revoting: allowRevoting, - dao, - deposit_info: depositInfo, - max_voting_period: maxVotingPeriod, - min_voting_period: minVotingPeriod, - only_members_execute: onlyMembersExecute, - threshold - } as const) - }; - }; - static addProposalHook = ({ - address - }: CamelCasedProperties["add_proposal_hook"]>): ExecuteMsg => { - return { - add_proposal_hook: ({ - address - } as const) - }; - }; - static removeProposalHook = ({ - address - }: CamelCasedProperties["remove_proposal_hook"]>): ExecuteMsg => { - return { - remove_proposal_hook: ({ - address - } as const) - }; - }; - static addVoteHook = ({ - address - }: CamelCasedProperties["add_vote_hook"]>): ExecuteMsg => { - return { - add_vote_hook: ({ - address - } as const) - }; - }; - static removeVoteHook = ({ - address - }: CamelCasedProperties["remove_vote_hook"]>): ExecuteMsg => { - return { - remove_vote_hook: ({ - address - } as const) - }; - }; -} -export abstract class CwSingleQueryMessageBuilder { - static config = (): QueryMsg => { - return { - config: ({} as const) - }; - }; - static proposal = ({ - proposalId - }: CamelCasedProperties["proposal"]>): QueryMsg => { - return { - proposal: ({ - proposal_id: proposalId - } as const) - }; - }; - static listProposals = ({ - limit, - startAfter - }: CamelCasedProperties["list_proposals"]>): QueryMsg => { - return { - list_proposals: ({ - limit, - start_after: startAfter - } as const) - }; - }; - static reverseProposals = ({ - limit, - startBefore - }: CamelCasedProperties["reverse_proposals"]>): QueryMsg => { - return { - reverse_proposals: ({ - limit, - start_before: startBefore - } as const) - }; - }; - static proposalCount = (): QueryMsg => { - return { - proposal_count: ({} as const) - }; - }; - static vote = ({ - proposalId, - voter - }: CamelCasedProperties["vote"]>): QueryMsg => { - return { - vote: ({ - proposal_id: proposalId, - voter - } as const) - }; - }; - static listVotes = ({ - limit, - proposalId, - startAfter - }: CamelCasedProperties["list_votes"]>): QueryMsg => { - return { - list_votes: ({ - limit, - proposal_id: proposalId, - start_after: startAfter - } as const) - }; - }; - static proposalHooks = (): QueryMsg => { - return { - proposal_hooks: ({} as const) - }; - }; - static voteHooks = (): QueryMsg => { - return { - vote_hooks: ({} as const) - }; - }; - static info = (): QueryMsg => { - return { - info: ({} as const) - }; - }; -} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Factory.msg-builder.ts b/__output__/builder/bundler_test/contracts/Factory.msg-builder.ts deleted file mode 100644 index 2bbace3f..00000000 --- a/__output__/builder/bundler_test/contracts/Factory.msg-builder.ts +++ /dev/null @@ -1,149 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; -import { CamelCasedProperties } from "type-fest"; -export abstract class FactoryExecuteMessageBuilder { - static createWallet = ({ - createWalletMsg - }: CamelCasedProperties["create_wallet"]>): ExecuteMsg => { - return { - create_wallet: ({ - create_wallet_msg: createWalletMsg - } as const) - }; - }; - static updateProxyUser = ({ - newUser, - oldUser - }: CamelCasedProperties["update_proxy_user"]>): ExecuteMsg => { - return { - update_proxy_user: ({ - new_user: newUser, - old_user: oldUser - } as const) - }; - }; - static migrateWallet = ({ - migrationMsg, - walletAddress - }: CamelCasedProperties["migrate_wallet"]>): ExecuteMsg => { - return { - migrate_wallet: ({ - migration_msg: migrationMsg, - wallet_address: walletAddress - } as const) - }; - }; - static updateCodeId = ({ - newCodeId, - ty - }: CamelCasedProperties["update_code_id"]>): ExecuteMsg => { - return { - update_code_id: ({ - new_code_id: newCodeId, - ty - } as const) - }; - }; - static updateWalletFee = ({ - newFee - }: CamelCasedProperties["update_wallet_fee"]>): ExecuteMsg => { - return { - update_wallet_fee: ({ - new_fee: newFee - } as const) - }; - }; - static updateGovecAddr = ({ - addr - }: CamelCasedProperties["update_govec_addr"]>): ExecuteMsg => { - return { - update_govec_addr: ({ - addr - } as const) - }; - }; - static updateAdmin = ({ - addr - }: CamelCasedProperties["update_admin"]>): ExecuteMsg => { - return { - update_admin: ({ - addr - } as const) - }; - }; -} -export abstract class FactoryQueryMessageBuilder { - static wallets = ({ - limit, - startAfter - }: CamelCasedProperties["wallets"]>): QueryMsg => { - return { - wallets: ({ - limit, - start_after: startAfter - } as const) - }; - }; - static walletsOf = ({ - limit, - startAfter, - user - }: CamelCasedProperties["wallets_of"]>): QueryMsg => { - return { - wallets_of: ({ - limit, - start_after: startAfter, - user - } as const) - }; - }; - static codeId = ({ - ty - }: CamelCasedProperties["code_id"]>): QueryMsg => { - return { - code_id: ({ - ty - } as const) - }; - }; - static fee = (): QueryMsg => { - return { - fee: ({} as const) - }; - }; - static govecAddr = (): QueryMsg => { - return { - govec_addr: ({} as const) - }; - }; - static adminAddr = (): QueryMsg => { - return { - admin_addr: ({} as const) - }; - }; -} \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Minter.msg-builder.ts b/__output__/builder/bundler_test/contracts/Minter.msg-builder.ts deleted file mode 100644 index e139b2ad..00000000 --- a/__output__/builder/bundler_test/contracts/Minter.msg-builder.ts +++ /dev/null @@ -1,104 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; -import { CamelCasedProperties } from "type-fest"; -export abstract class MinterExecuteMessageBuilder { - static mint = (): ExecuteMsg => { - return { - mint: ({} as const) - }; - }; - static setWhitelist = ({ - whitelist - }: CamelCasedProperties["set_whitelist"]>): ExecuteMsg => { - return { - set_whitelist: ({ - whitelist - } as const) - }; - }; - static updateStartTime = (): ExecuteMsg => { - return { - update_start_time: ({} as const) - }; - }; - static updatePerAddressLimit = ({ - perAddressLimit - }: CamelCasedProperties["update_per_address_limit"]>): ExecuteMsg => { - return { - update_per_address_limit: ({ - per_address_limit: perAddressLimit - } as const) - }; - }; - static mintTo = ({ - recipient - }: CamelCasedProperties["mint_to"]>): ExecuteMsg => { - return { - mint_to: ({ - recipient - } as const) - }; - }; - static mintFor = ({ - recipient, - tokenId - }: CamelCasedProperties["mint_for"]>): ExecuteMsg => { - return { - mint_for: ({ - recipient, - token_id: tokenId - } as const) - }; - }; - static withdraw = (): ExecuteMsg => { - return { - withdraw: ({} as const) - }; - }; -} -export abstract class MinterQueryMessageBuilder { - static config = (): QueryMsg => { - return { - config: ({} as const) - }; - }; - static mintableNumTokens = (): QueryMsg => { - return { - mintable_num_tokens: ({} as const) - }; - }; - static startTime = (): QueryMsg => { - return { - start_time: ({} as const) - }; - }; - static mintPrice = (): QueryMsg => { - return { - mint_price: ({} as const) - }; - }; - static mintCount = ({ - address - }: CamelCasedProperties["mint_count"]>): QueryMsg => { - return { - mint_count: ({ - address - } as const) - }; - }; -} \ No newline at end of file diff --git a/__output__/builder/default/CwAdminFactory.msg-builder.ts b/__output__/builder/default/CwAdminFactory.msg-builder.ts deleted file mode 100644 index 2a04624c..00000000 --- a/__output__/builder/default/CwAdminFactory.msg-builder.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; -import { CamelCasedProperties } from "type-fest"; -export abstract class CwAdminFactoryExecuteMessageBuilder { - static instantiateContractWithSelfAdmin = ({ - codeId, - instantiateMsg, - label - }: CamelCasedProperties["instantiate_contract_with_self_admin"]>): ExecuteMsg => { - return { - instantiate_contract_with_self_admin: ({ - code_id: codeId, - instantiate_msg: instantiateMsg, - label - } as const) - }; - }; -} \ No newline at end of file diff --git a/__output__/builder/default/CwCodeIdRegistry.msg-builder.ts b/__output__/builder/default/CwCodeIdRegistry.msg-builder.ts deleted file mode 100644 index 5727cd91..00000000 --- a/__output__/builder/default/CwCodeIdRegistry.msg-builder.ts +++ /dev/null @@ -1,133 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; -import { CamelCasedProperties } from "type-fest"; -export abstract class CwCodeIdRegistryExecuteMessageBuilder { - static receive = ({ - amount, - msg, - sender - }: CamelCasedProperties["receive"]>): ExecuteMsg => { - return { - receive: ({ - amount, - msg, - sender - } as const) - }; - }; - static register = ({ - chainId, - checksum, - codeId, - name, - version - }: CamelCasedProperties["register"]>): ExecuteMsg => { - return { - register: ({ - chain_id: chainId, - checksum, - code_id: codeId, - name, - version - } as const) - }; - }; - static setOwner = ({ - chainId, - name, - owner - }: CamelCasedProperties["set_owner"]>): ExecuteMsg => { - return { - set_owner: ({ - chain_id: chainId, - name, - owner - } as const) - }; - }; - static unregister = ({ - chainId, - codeId - }: CamelCasedProperties["unregister"]>): ExecuteMsg => { - return { - unregister: ({ - chain_id: chainId, - code_id: codeId - } as const) - }; - }; - static updateConfig = ({ - admin, - paymentInfo - }: CamelCasedProperties["update_config"]>): ExecuteMsg => { - return { - update_config: ({ - admin, - payment_info: paymentInfo - } as const) - }; - }; -} -export abstract class CwCodeIdRegistryQueryMessageBuilder { - static config = (): QueryMsg => { - return { - config: ({} as const) - }; - }; - static getRegistration = ({ - chainId, - name, - version - }: CamelCasedProperties["get_registration"]>): QueryMsg => { - return { - get_registration: ({ - chain_id: chainId, - name, - version - } as const) - }; - }; - static infoForCodeId = ({ - chainId, - codeId - }: CamelCasedProperties["info_for_code_id"]>): QueryMsg => { - return { - info_for_code_id: ({ - chain_id: chainId, - code_id: codeId - } as const) - }; - }; - static listRegistrations = ({ - chainId, - name - }: CamelCasedProperties["list_registrations"]>): QueryMsg => { - return { - list_registrations: ({ - chain_id: chainId, - name - } as const) - }; - }; -} \ No newline at end of file diff --git a/__output__/builder/default/CwSingle.msg-builder.ts b/__output__/builder/default/CwSingle.msg-builder.ts deleted file mode 100644 index bdc753da..00000000 --- a/__output__/builder/default/CwSingle.msg-builder.ts +++ /dev/null @@ -1,219 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; -import { CamelCasedProperties } from "type-fest"; -export abstract class CwSingleExecuteMessageBuilder { - static propose = ({ - description, - msgs, - title - }: CamelCasedProperties["propose"]>): ExecuteMsg => { - return { - propose: ({ - description, - msgs, - title - } as const) - }; - }; - static vote = ({ - proposalId, - vote - }: CamelCasedProperties["vote"]>): ExecuteMsg => { - return { - vote: ({ - proposal_id: proposalId, - vote - } as const) - }; - }; - static execute = ({ - proposalId - }: CamelCasedProperties["execute"]>): ExecuteMsg => { - return { - execute: ({ - proposal_id: proposalId - } as const) - }; - }; - static close = ({ - proposalId - }: CamelCasedProperties["close"]>): ExecuteMsg => { - return { - close: ({ - proposal_id: proposalId - } as const) - }; - }; - static updateConfig = ({ - allowRevoting, - dao, - depositInfo, - maxVotingPeriod, - minVotingPeriod, - onlyMembersExecute, - threshold - }: CamelCasedProperties["update_config"]>): ExecuteMsg => { - return { - update_config: ({ - allow_revoting: allowRevoting, - dao, - deposit_info: depositInfo, - max_voting_period: maxVotingPeriod, - min_voting_period: minVotingPeriod, - only_members_execute: onlyMembersExecute, - threshold - } as const) - }; - }; - static addProposalHook = ({ - address - }: CamelCasedProperties["add_proposal_hook"]>): ExecuteMsg => { - return { - add_proposal_hook: ({ - address - } as const) - }; - }; - static removeProposalHook = ({ - address - }: CamelCasedProperties["remove_proposal_hook"]>): ExecuteMsg => { - return { - remove_proposal_hook: ({ - address - } as const) - }; - }; - static addVoteHook = ({ - address - }: CamelCasedProperties["add_vote_hook"]>): ExecuteMsg => { - return { - add_vote_hook: ({ - address - } as const) - }; - }; - static removeVoteHook = ({ - address - }: CamelCasedProperties["remove_vote_hook"]>): ExecuteMsg => { - return { - remove_vote_hook: ({ - address - } as const) - }; - }; -} -export abstract class CwSingleQueryMessageBuilder { - static config = (): QueryMsg => { - return { - config: ({} as const) - }; - }; - static proposal = ({ - proposalId - }: CamelCasedProperties["proposal"]>): QueryMsg => { - return { - proposal: ({ - proposal_id: proposalId - } as const) - }; - }; - static listProposals = ({ - limit, - startAfter - }: CamelCasedProperties["list_proposals"]>): QueryMsg => { - return { - list_proposals: ({ - limit, - start_after: startAfter - } as const) - }; - }; - static reverseProposals = ({ - limit, - startBefore - }: CamelCasedProperties["reverse_proposals"]>): QueryMsg => { - return { - reverse_proposals: ({ - limit, - start_before: startBefore - } as const) - }; - }; - static proposalCount = (): QueryMsg => { - return { - proposal_count: ({} as const) - }; - }; - static vote = ({ - proposalId, - voter - }: CamelCasedProperties["vote"]>): QueryMsg => { - return { - vote: ({ - proposal_id: proposalId, - voter - } as const) - }; - }; - static listVotes = ({ - limit, - proposalId, - startAfter - }: CamelCasedProperties["list_votes"]>): QueryMsg => { - return { - list_votes: ({ - limit, - proposal_id: proposalId, - start_after: startAfter - } as const) - }; - }; - static proposalHooks = (): QueryMsg => { - return { - proposal_hooks: ({} as const) - }; - }; - static voteHooks = (): QueryMsg => { - return { - vote_hooks: ({} as const) - }; - }; - static info = (): QueryMsg => { - return { - info: ({} as const) - }; - }; -} \ No newline at end of file diff --git a/__output__/builder/default/Factory.msg-builder.ts b/__output__/builder/default/Factory.msg-builder.ts deleted file mode 100644 index 2bbace3f..00000000 --- a/__output__/builder/default/Factory.msg-builder.ts +++ /dev/null @@ -1,149 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; -import { CamelCasedProperties } from "type-fest"; -export abstract class FactoryExecuteMessageBuilder { - static createWallet = ({ - createWalletMsg - }: CamelCasedProperties["create_wallet"]>): ExecuteMsg => { - return { - create_wallet: ({ - create_wallet_msg: createWalletMsg - } as const) - }; - }; - static updateProxyUser = ({ - newUser, - oldUser - }: CamelCasedProperties["update_proxy_user"]>): ExecuteMsg => { - return { - update_proxy_user: ({ - new_user: newUser, - old_user: oldUser - } as const) - }; - }; - static migrateWallet = ({ - migrationMsg, - walletAddress - }: CamelCasedProperties["migrate_wallet"]>): ExecuteMsg => { - return { - migrate_wallet: ({ - migration_msg: migrationMsg, - wallet_address: walletAddress - } as const) - }; - }; - static updateCodeId = ({ - newCodeId, - ty - }: CamelCasedProperties["update_code_id"]>): ExecuteMsg => { - return { - update_code_id: ({ - new_code_id: newCodeId, - ty - } as const) - }; - }; - static updateWalletFee = ({ - newFee - }: CamelCasedProperties["update_wallet_fee"]>): ExecuteMsg => { - return { - update_wallet_fee: ({ - new_fee: newFee - } as const) - }; - }; - static updateGovecAddr = ({ - addr - }: CamelCasedProperties["update_govec_addr"]>): ExecuteMsg => { - return { - update_govec_addr: ({ - addr - } as const) - }; - }; - static updateAdmin = ({ - addr - }: CamelCasedProperties["update_admin"]>): ExecuteMsg => { - return { - update_admin: ({ - addr - } as const) - }; - }; -} -export abstract class FactoryQueryMessageBuilder { - static wallets = ({ - limit, - startAfter - }: CamelCasedProperties["wallets"]>): QueryMsg => { - return { - wallets: ({ - limit, - start_after: startAfter - } as const) - }; - }; - static walletsOf = ({ - limit, - startAfter, - user - }: CamelCasedProperties["wallets_of"]>): QueryMsg => { - return { - wallets_of: ({ - limit, - start_after: startAfter, - user - } as const) - }; - }; - static codeId = ({ - ty - }: CamelCasedProperties["code_id"]>): QueryMsg => { - return { - code_id: ({ - ty - } as const) - }; - }; - static fee = (): QueryMsg => { - return { - fee: ({} as const) - }; - }; - static govecAddr = (): QueryMsg => { - return { - govec_addr: ({} as const) - }; - }; - static adminAddr = (): QueryMsg => { - return { - admin_addr: ({} as const) - }; - }; -} \ No newline at end of file diff --git a/__output__/builder/default/Minter.msg-builder.ts b/__output__/builder/default/Minter.msg-builder.ts deleted file mode 100644 index e139b2ad..00000000 --- a/__output__/builder/default/Minter.msg-builder.ts +++ /dev/null @@ -1,104 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; -import { CamelCasedProperties } from "type-fest"; -export abstract class MinterExecuteMessageBuilder { - static mint = (): ExecuteMsg => { - return { - mint: ({} as const) - }; - }; - static setWhitelist = ({ - whitelist - }: CamelCasedProperties["set_whitelist"]>): ExecuteMsg => { - return { - set_whitelist: ({ - whitelist - } as const) - }; - }; - static updateStartTime = (): ExecuteMsg => { - return { - update_start_time: ({} as const) - }; - }; - static updatePerAddressLimit = ({ - perAddressLimit - }: CamelCasedProperties["update_per_address_limit"]>): ExecuteMsg => { - return { - update_per_address_limit: ({ - per_address_limit: perAddressLimit - } as const) - }; - }; - static mintTo = ({ - recipient - }: CamelCasedProperties["mint_to"]>): ExecuteMsg => { - return { - mint_to: ({ - recipient - } as const) - }; - }; - static mintFor = ({ - recipient, - tokenId - }: CamelCasedProperties["mint_for"]>): ExecuteMsg => { - return { - mint_for: ({ - recipient, - token_id: tokenId - } as const) - }; - }; - static withdraw = (): ExecuteMsg => { - return { - withdraw: ({} as const) - }; - }; -} -export abstract class MinterQueryMessageBuilder { - static config = (): QueryMsg => { - return { - config: ({} as const) - }; - }; - static mintableNumTokens = (): QueryMsg => { - return { - mintable_num_tokens: ({} as const) - }; - }; - static startTime = (): QueryMsg => { - return { - start_time: ({} as const) - }; - }; - static mintPrice = (): QueryMsg => { - return { - mint_price: ({} as const) - }; - }; - static mintCount = ({ - address - }: CamelCasedProperties["mint_count"]>): QueryMsg => { - return { - mint_count: ({ - address - } as const) - }; - }; -} \ No newline at end of file diff --git a/__output__/builder/no-extends/CwAdminFactory.msg-builder.ts b/__output__/builder/no-extends/CwAdminFactory.msg-builder.ts deleted file mode 100644 index 2a04624c..00000000 --- a/__output__/builder/no-extends/CwAdminFactory.msg-builder.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; -import { CamelCasedProperties } from "type-fest"; -export abstract class CwAdminFactoryExecuteMessageBuilder { - static instantiateContractWithSelfAdmin = ({ - codeId, - instantiateMsg, - label - }: CamelCasedProperties["instantiate_contract_with_self_admin"]>): ExecuteMsg => { - return { - instantiate_contract_with_self_admin: ({ - code_id: codeId, - instantiate_msg: instantiateMsg, - label - } as const) - }; - }; -} \ No newline at end of file diff --git a/__output__/builder/no-extends/CwCodeIdRegistry.msg-builder.ts b/__output__/builder/no-extends/CwCodeIdRegistry.msg-builder.ts deleted file mode 100644 index 5727cd91..00000000 --- a/__output__/builder/no-extends/CwCodeIdRegistry.msg-builder.ts +++ /dev/null @@ -1,133 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; -import { CamelCasedProperties } from "type-fest"; -export abstract class CwCodeIdRegistryExecuteMessageBuilder { - static receive = ({ - amount, - msg, - sender - }: CamelCasedProperties["receive"]>): ExecuteMsg => { - return { - receive: ({ - amount, - msg, - sender - } as const) - }; - }; - static register = ({ - chainId, - checksum, - codeId, - name, - version - }: CamelCasedProperties["register"]>): ExecuteMsg => { - return { - register: ({ - chain_id: chainId, - checksum, - code_id: codeId, - name, - version - } as const) - }; - }; - static setOwner = ({ - chainId, - name, - owner - }: CamelCasedProperties["set_owner"]>): ExecuteMsg => { - return { - set_owner: ({ - chain_id: chainId, - name, - owner - } as const) - }; - }; - static unregister = ({ - chainId, - codeId - }: CamelCasedProperties["unregister"]>): ExecuteMsg => { - return { - unregister: ({ - chain_id: chainId, - code_id: codeId - } as const) - }; - }; - static updateConfig = ({ - admin, - paymentInfo - }: CamelCasedProperties["update_config"]>): ExecuteMsg => { - return { - update_config: ({ - admin, - payment_info: paymentInfo - } as const) - }; - }; -} -export abstract class CwCodeIdRegistryQueryMessageBuilder { - static config = (): QueryMsg => { - return { - config: ({} as const) - }; - }; - static getRegistration = ({ - chainId, - name, - version - }: CamelCasedProperties["get_registration"]>): QueryMsg => { - return { - get_registration: ({ - chain_id: chainId, - name, - version - } as const) - }; - }; - static infoForCodeId = ({ - chainId, - codeId - }: CamelCasedProperties["info_for_code_id"]>): QueryMsg => { - return { - info_for_code_id: ({ - chain_id: chainId, - code_id: codeId - } as const) - }; - }; - static listRegistrations = ({ - chainId, - name - }: CamelCasedProperties["list_registrations"]>): QueryMsg => { - return { - list_registrations: ({ - chain_id: chainId, - name - } as const) - }; - }; -} \ No newline at end of file diff --git a/__output__/builder/no-extends/CwSingle.msg-builder.ts b/__output__/builder/no-extends/CwSingle.msg-builder.ts deleted file mode 100644 index bdc753da..00000000 --- a/__output__/builder/no-extends/CwSingle.msg-builder.ts +++ /dev/null @@ -1,219 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; -import { CamelCasedProperties } from "type-fest"; -export abstract class CwSingleExecuteMessageBuilder { - static propose = ({ - description, - msgs, - title - }: CamelCasedProperties["propose"]>): ExecuteMsg => { - return { - propose: ({ - description, - msgs, - title - } as const) - }; - }; - static vote = ({ - proposalId, - vote - }: CamelCasedProperties["vote"]>): ExecuteMsg => { - return { - vote: ({ - proposal_id: proposalId, - vote - } as const) - }; - }; - static execute = ({ - proposalId - }: CamelCasedProperties["execute"]>): ExecuteMsg => { - return { - execute: ({ - proposal_id: proposalId - } as const) - }; - }; - static close = ({ - proposalId - }: CamelCasedProperties["close"]>): ExecuteMsg => { - return { - close: ({ - proposal_id: proposalId - } as const) - }; - }; - static updateConfig = ({ - allowRevoting, - dao, - depositInfo, - maxVotingPeriod, - minVotingPeriod, - onlyMembersExecute, - threshold - }: CamelCasedProperties["update_config"]>): ExecuteMsg => { - return { - update_config: ({ - allow_revoting: allowRevoting, - dao, - deposit_info: depositInfo, - max_voting_period: maxVotingPeriod, - min_voting_period: minVotingPeriod, - only_members_execute: onlyMembersExecute, - threshold - } as const) - }; - }; - static addProposalHook = ({ - address - }: CamelCasedProperties["add_proposal_hook"]>): ExecuteMsg => { - return { - add_proposal_hook: ({ - address - } as const) - }; - }; - static removeProposalHook = ({ - address - }: CamelCasedProperties["remove_proposal_hook"]>): ExecuteMsg => { - return { - remove_proposal_hook: ({ - address - } as const) - }; - }; - static addVoteHook = ({ - address - }: CamelCasedProperties["add_vote_hook"]>): ExecuteMsg => { - return { - add_vote_hook: ({ - address - } as const) - }; - }; - static removeVoteHook = ({ - address - }: CamelCasedProperties["remove_vote_hook"]>): ExecuteMsg => { - return { - remove_vote_hook: ({ - address - } as const) - }; - }; -} -export abstract class CwSingleQueryMessageBuilder { - static config = (): QueryMsg => { - return { - config: ({} as const) - }; - }; - static proposal = ({ - proposalId - }: CamelCasedProperties["proposal"]>): QueryMsg => { - return { - proposal: ({ - proposal_id: proposalId - } as const) - }; - }; - static listProposals = ({ - limit, - startAfter - }: CamelCasedProperties["list_proposals"]>): QueryMsg => { - return { - list_proposals: ({ - limit, - start_after: startAfter - } as const) - }; - }; - static reverseProposals = ({ - limit, - startBefore - }: CamelCasedProperties["reverse_proposals"]>): QueryMsg => { - return { - reverse_proposals: ({ - limit, - start_before: startBefore - } as const) - }; - }; - static proposalCount = (): QueryMsg => { - return { - proposal_count: ({} as const) - }; - }; - static vote = ({ - proposalId, - voter - }: CamelCasedProperties["vote"]>): QueryMsg => { - return { - vote: ({ - proposal_id: proposalId, - voter - } as const) - }; - }; - static listVotes = ({ - limit, - proposalId, - startAfter - }: CamelCasedProperties["list_votes"]>): QueryMsg => { - return { - list_votes: ({ - limit, - proposal_id: proposalId, - start_after: startAfter - } as const) - }; - }; - static proposalHooks = (): QueryMsg => { - return { - proposal_hooks: ({} as const) - }; - }; - static voteHooks = (): QueryMsg => { - return { - vote_hooks: ({} as const) - }; - }; - static info = (): QueryMsg => { - return { - info: ({} as const) - }; - }; -} \ No newline at end of file diff --git a/__output__/builder/no-extends/Factory.msg-builder.ts b/__output__/builder/no-extends/Factory.msg-builder.ts deleted file mode 100644 index 2bbace3f..00000000 --- a/__output__/builder/no-extends/Factory.msg-builder.ts +++ /dev/null @@ -1,149 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; -import { CamelCasedProperties } from "type-fest"; -export abstract class FactoryExecuteMessageBuilder { - static createWallet = ({ - createWalletMsg - }: CamelCasedProperties["create_wallet"]>): ExecuteMsg => { - return { - create_wallet: ({ - create_wallet_msg: createWalletMsg - } as const) - }; - }; - static updateProxyUser = ({ - newUser, - oldUser - }: CamelCasedProperties["update_proxy_user"]>): ExecuteMsg => { - return { - update_proxy_user: ({ - new_user: newUser, - old_user: oldUser - } as const) - }; - }; - static migrateWallet = ({ - migrationMsg, - walletAddress - }: CamelCasedProperties["migrate_wallet"]>): ExecuteMsg => { - return { - migrate_wallet: ({ - migration_msg: migrationMsg, - wallet_address: walletAddress - } as const) - }; - }; - static updateCodeId = ({ - newCodeId, - ty - }: CamelCasedProperties["update_code_id"]>): ExecuteMsg => { - return { - update_code_id: ({ - new_code_id: newCodeId, - ty - } as const) - }; - }; - static updateWalletFee = ({ - newFee - }: CamelCasedProperties["update_wallet_fee"]>): ExecuteMsg => { - return { - update_wallet_fee: ({ - new_fee: newFee - } as const) - }; - }; - static updateGovecAddr = ({ - addr - }: CamelCasedProperties["update_govec_addr"]>): ExecuteMsg => { - return { - update_govec_addr: ({ - addr - } as const) - }; - }; - static updateAdmin = ({ - addr - }: CamelCasedProperties["update_admin"]>): ExecuteMsg => { - return { - update_admin: ({ - addr - } as const) - }; - }; -} -export abstract class FactoryQueryMessageBuilder { - static wallets = ({ - limit, - startAfter - }: CamelCasedProperties["wallets"]>): QueryMsg => { - return { - wallets: ({ - limit, - start_after: startAfter - } as const) - }; - }; - static walletsOf = ({ - limit, - startAfter, - user - }: CamelCasedProperties["wallets_of"]>): QueryMsg => { - return { - wallets_of: ({ - limit, - start_after: startAfter, - user - } as const) - }; - }; - static codeId = ({ - ty - }: CamelCasedProperties["code_id"]>): QueryMsg => { - return { - code_id: ({ - ty - } as const) - }; - }; - static fee = (): QueryMsg => { - return { - fee: ({} as const) - }; - }; - static govecAddr = (): QueryMsg => { - return { - govec_addr: ({} as const) - }; - }; - static adminAddr = (): QueryMsg => { - return { - admin_addr: ({} as const) - }; - }; -} \ No newline at end of file diff --git a/__output__/builder/no-extends/Minter.msg-builder.ts b/__output__/builder/no-extends/Minter.msg-builder.ts deleted file mode 100644 index e139b2ad..00000000 --- a/__output__/builder/no-extends/Minter.msg-builder.ts +++ /dev/null @@ -1,104 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; -import { CamelCasedProperties } from "type-fest"; -export abstract class MinterExecuteMessageBuilder { - static mint = (): ExecuteMsg => { - return { - mint: ({} as const) - }; - }; - static setWhitelist = ({ - whitelist - }: CamelCasedProperties["set_whitelist"]>): ExecuteMsg => { - return { - set_whitelist: ({ - whitelist - } as const) - }; - }; - static updateStartTime = (): ExecuteMsg => { - return { - update_start_time: ({} as const) - }; - }; - static updatePerAddressLimit = ({ - perAddressLimit - }: CamelCasedProperties["update_per_address_limit"]>): ExecuteMsg => { - return { - update_per_address_limit: ({ - per_address_limit: perAddressLimit - } as const) - }; - }; - static mintTo = ({ - recipient - }: CamelCasedProperties["mint_to"]>): ExecuteMsg => { - return { - mint_to: ({ - recipient - } as const) - }; - }; - static mintFor = ({ - recipient, - tokenId - }: CamelCasedProperties["mint_for"]>): ExecuteMsg => { - return { - mint_for: ({ - recipient, - token_id: tokenId - } as const) - }; - }; - static withdraw = (): ExecuteMsg => { - return { - withdraw: ({} as const) - }; - }; -} -export abstract class MinterQueryMessageBuilder { - static config = (): QueryMsg => { - return { - config: ({} as const) - }; - }; - static mintableNumTokens = (): QueryMsg => { - return { - mintable_num_tokens: ({} as const) - }; - }; - static startTime = (): QueryMsg => { - return { - start_time: ({} as const) - }; - }; - static mintPrice = (): QueryMsg => { - return { - mint_price: ({} as const) - }; - }; - static mintCount = ({ - address - }: CamelCasedProperties["mint_count"]>): QueryMsg => { - return { - mint_count: ({ - address - } as const) - }; - }; -} \ No newline at end of file diff --git a/__output__/cosmwasm/CW4Group.client.ts b/__output__/cosmwasm/CW4Group.client.ts deleted file mode 100644 index 87cd927c..00000000 --- a/__output__/cosmwasm/CW4Group.client.ts +++ /dev/null @@ -1,177 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { Coin, StdFee } from "@cosmjs/amino"; -import { InstantiateMsg, Member, ExecuteMsg, QueryMsg, QueryResponse, AdminResponse, TotalWeightResponse, MemberListResponse, MemberResponse, HooksResponse } from "./CW4Group.types"; -export interface CW4GroupReadOnlyInterface { - contractAddress: string; - admin: () => Promise; - totalWeight: () => Promise; - listMembers: ({ - limit, - startAfter - }: { - limit?: number; - startAfter?: string; - }) => Promise; - member: ({ - addr, - atHeight - }: { - addr: string; - atHeight?: number; - }) => Promise; - hooks: () => Promise; -} -export class CW4GroupQueryClient implements CW4GroupReadOnlyInterface { - client: CosmWasmClient; - contractAddress: string; - - constructor(client: CosmWasmClient, contractAddress: string) { - this.client = client; - this.contractAddress = contractAddress; - this.admin = this.admin.bind(this); - this.totalWeight = this.totalWeight.bind(this); - this.listMembers = this.listMembers.bind(this); - this.member = this.member.bind(this); - this.hooks = this.hooks.bind(this); - } - - admin = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - admin: {} - }); - }; - totalWeight = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - total_weight: {} - }); - }; - listMembers = async ({ - limit, - startAfter - }: { - limit?: number; - startAfter?: string; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - list_members: { - limit, - start_after: startAfter - } - }); - }; - member = async ({ - addr, - atHeight - }: { - addr: string; - atHeight?: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - member: { - addr, - at_height: atHeight - } - }); - }; - hooks = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - hooks: {} - }); - }; -} -export interface CW4GroupInterface extends CW4GroupReadOnlyInterface { - contractAddress: string; - sender: string; - updateAdmin: ({ - admin - }: { - admin?: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - updateMembers: ({ - add, - remove - }: { - add: Member[]; - remove: string[]; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - addHook: ({ - addr - }: { - addr: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; - removeHook: ({ - addr - }: { - addr: string; - }, fee?: number | StdFee | "auto", memo?: string, funds?: Coin[]) => Promise; -} -export class CW4GroupClient extends CW4GroupQueryClient implements CW4GroupInterface { - client: SigningCosmWasmClient; - sender: string; - contractAddress: string; - - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { - super(client, contractAddress); - this.client = client; - this.sender = sender; - this.contractAddress = contractAddress; - this.updateAdmin = this.updateAdmin.bind(this); - this.updateMembers = this.updateMembers.bind(this); - this.addHook = this.addHook.bind(this); - this.removeHook = this.removeHook.bind(this); - } - - updateAdmin = async ({ - admin - }: { - admin?: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - update_admin: { - admin - } - }, fee, memo, funds); - }; - updateMembers = async ({ - add, - remove - }: { - add: Member[]; - remove: string[]; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - update_members: { - add, - remove - } - }, fee, memo, funds); - }; - addHook = async ({ - addr - }: { - addr: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - add_hook: { - addr - } - }, fee, memo, funds); - }; - removeHook = async ({ - addr - }: { - addr: string; - }, fee: number | StdFee | "auto" = "auto", memo?: string, funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - remove_hook: { - addr - } - }, fee, memo, funds); - }; -} \ No newline at end of file diff --git a/__output__/cosmwasm/CW4Group.message-composer.ts b/__output__/cosmwasm/CW4Group.message-composer.ts deleted file mode 100644 index d6b6a62c..00000000 --- a/__output__/cosmwasm/CW4Group.message-composer.ts +++ /dev/null @@ -1,130 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "cosmwasm"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; -import { InstantiateMsg, Member, ExecuteMsg, QueryMsg, QueryResponse, AdminResponse, TotalWeightResponse, MemberListResponse, MemberResponse, HooksResponse } from "./CW4Group.types"; -export interface CW4GroupMessage { - contractAddress: string; - sender: string; - updateAdmin: ({ - admin - }: { - admin?: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; - updateMembers: ({ - add, - remove - }: { - add: Member[]; - remove: string[]; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; - addHook: ({ - addr - }: { - addr: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; - removeHook: ({ - addr - }: { - addr: string; - }, funds?: Coin[]) => MsgExecuteContractEncodeObject; -} -export class CW4GroupMessageComposer implements CW4GroupMessage { - sender: string; - contractAddress: string; - - constructor(sender: string, contractAddress: string) { - this.sender = sender; - this.contractAddress = contractAddress; - this.updateAdmin = this.updateAdmin.bind(this); - this.updateMembers = this.updateMembers.bind(this); - this.addHook = this.addHook.bind(this); - this.removeHook = this.removeHook.bind(this); - } - - updateAdmin = ({ - admin - }: { - admin?: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { - return { - typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", - value: MsgExecuteContract.fromPartial({ - sender: this.sender, - contract: this.contractAddress, - msg: toUtf8(JSON.stringify({ - update_admin: { - admin - } - })), - funds - }) - }; - }; - updateMembers = ({ - add, - remove - }: { - add: Member[]; - remove: string[]; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { - return { - typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", - value: MsgExecuteContract.fromPartial({ - sender: this.sender, - contract: this.contractAddress, - msg: toUtf8(JSON.stringify({ - update_members: { - add, - remove - } - })), - funds - }) - }; - }; - addHook = ({ - addr - }: { - addr: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { - return { - typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", - value: MsgExecuteContract.fromPartial({ - sender: this.sender, - contract: this.contractAddress, - msg: toUtf8(JSON.stringify({ - add_hook: { - addr - } - })), - funds - }) - }; - }; - removeHook = ({ - addr - }: { - addr: string; - }, funds?: Coin[]): MsgExecuteContractEncodeObject => { - return { - typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", - value: MsgExecuteContract.fromPartial({ - sender: this.sender, - contract: this.contractAddress, - msg: toUtf8(JSON.stringify({ - remove_hook: { - addr - } - })), - funds - }) - }; - }; -} \ No newline at end of file diff --git a/__output__/cosmwasm/CW4Group.react-query.ts b/__output__/cosmwasm/CW4Group.react-query.ts deleted file mode 100644 index 420c1a09..00000000 --- a/__output__/cosmwasm/CW4Group.react-query.ts +++ /dev/null @@ -1,66 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { UseQueryOptions, useQuery } from "react-query"; -import { InstantiateMsg, Member, ExecuteMsg, QueryMsg, QueryResponse, AdminResponse, TotalWeightResponse, MemberListResponse, MemberResponse, HooksResponse } from "./CW4Group.types"; -import { CW4GroupQueryClient } from "./CW4Group.client"; -export interface CW4GroupReactQuery { - client: CW4GroupQueryClient; - options?: UseQueryOptions; -} -export interface CW4GroupHooksQuery extends CW4GroupReactQuery {} -export function useCW4GroupHooksQuery({ - client, - options -}: CW4GroupHooksQuery) { - return useQuery(["cW4GroupHooks", client.contractAddress], () => client.hooks(), options); -} -export interface CW4GroupMemberQuery extends CW4GroupReactQuery { - args: { - addr: string; - atHeight?: number; - }; -} -export function useCW4GroupMemberQuery({ - client, - args, - options -}: CW4GroupMemberQuery) { - return useQuery(["cW4GroupMember", client.contractAddress, JSON.stringify(args)], () => client.member({ - addr: args.addr, - atHeight: args.atHeight - }), options); -} -export interface CW4GroupListMembersQuery extends CW4GroupReactQuery { - args: { - limit?: number; - startAfter?: string; - }; -} -export function useCW4GroupListMembersQuery({ - client, - args, - options -}: CW4GroupListMembersQuery) { - return useQuery(["cW4GroupListMembers", client.contractAddress, JSON.stringify(args)], () => client.listMembers({ - limit: args.limit, - startAfter: args.startAfter - }), options); -} -export interface CW4GroupTotalWeightQuery extends CW4GroupReactQuery {} -export function useCW4GroupTotalWeightQuery({ - client, - options -}: CW4GroupTotalWeightQuery) { - return useQuery(["cW4GroupTotalWeight", client.contractAddress], () => client.totalWeight(), options); -} -export interface CW4GroupAdminQuery extends CW4GroupReactQuery {} -export function useCW4GroupAdminQuery({ - client, - options -}: CW4GroupAdminQuery) { - return useQuery(["cW4GroupAdmin", client.contractAddress], () => client.admin(), options); -} \ No newline at end of file diff --git a/__output__/cosmwasm/CW4Group.recoil.ts b/__output__/cosmwasm/CW4Group.recoil.ts deleted file mode 100644 index 26463bbc..00000000 --- a/__output__/cosmwasm/CW4Group.recoil.ts +++ /dev/null @@ -1,94 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { selectorFamily } from "recoil"; -import { cosmWasmClient } from "./chain"; -import { InstantiateMsg, Member, ExecuteMsg, QueryMsg, QueryResponse, AdminResponse, TotalWeightResponse, MemberListResponse, MemberResponse, HooksResponse } from "./CW4Group.types"; -import { CW4GroupQueryClient } from "./CW4Group.client"; -type QueryClientParams = { - contractAddress: string; -}; -export const queryClient = selectorFamily({ - key: "cW4GroupQueryClient", - get: ({ - contractAddress - }) => ({ - get - }) => { - const client = get(cosmWasmClient); - return new CW4GroupQueryClient(client, contractAddress); - } -}); -export const adminSelector = selectorFamily; -}>({ - key: "cW4GroupAdmin", - get: ({ - params, - ...queryClientParams - }) => async ({ - get - }) => { - const client = get(queryClient(queryClientParams)); - return await client.admin(...params); - } -}); -export const totalWeightSelector = selectorFamily; -}>({ - key: "cW4GroupTotalWeight", - get: ({ - params, - ...queryClientParams - }) => async ({ - get - }) => { - const client = get(queryClient(queryClientParams)); - return await client.totalWeight(...params); - } -}); -export const listMembersSelector = selectorFamily; -}>({ - key: "cW4GroupListMembers", - get: ({ - params, - ...queryClientParams - }) => async ({ - get - }) => { - const client = get(queryClient(queryClientParams)); - return await client.listMembers(...params); - } -}); -export const memberSelector = selectorFamily; -}>({ - key: "cW4GroupMember", - get: ({ - params, - ...queryClientParams - }) => async ({ - get - }) => { - const client = get(queryClient(queryClientParams)); - return await client.member(...params); - } -}); -export const hooksSelector = selectorFamily; -}>({ - key: "cW4GroupHooks", - get: ({ - params, - ...queryClientParams - }) => async ({ - get - }) => { - const client = get(queryClient(queryClientParams)); - return await client.hooks(...params); - } -}); \ No newline at end of file diff --git a/__output__/cosmwasm/CW4Group.types.ts b/__output__/cosmwasm/CW4Group.types.ts deleted file mode 100644 index 1dfa9766..00000000 --- a/__output__/cosmwasm/CW4Group.types.ts +++ /dev/null @@ -1,75 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -export interface InstantiateMsg { - admin?: string | null; - members: Member[]; -} -export interface Member { - addr: string; - weight: number; -} -export type ExecuteMsg = { - update_admin: { - admin?: string | null; - }; -} | { - update_members: { - add: Member[]; - remove: string[]; - }; -} | { - add_hook: { - addr: string; - }; -} | { - remove_hook: { - addr: string; - }; -}; -export type QueryMsg = { - admin: {}; -} | { - total_weight: {}; -} | { - list_members: { - limit?: number | null; - start_after?: string | null; - }; -} | { - member: { - addr: string; - at_height?: number | null; - }; -} | { - hooks: {}; -}; -export type QueryResponse = { - admin: AdminResponse; -} | { - total_weight: TotalWeightResponse; -} | { - list_members: MemberListResponse; -} | { - member: MemberResponse; -} | { - hooks: HooksResponse; -}; -export interface AdminResponse { - admin?: string | null; -} -export interface TotalWeightResponse { - weight: number; -} -export interface MemberListResponse { - members: Member[]; -} -export interface MemberResponse { - weight?: number | null; -} -export interface HooksResponse { - hooks: string[]; -} \ No newline at end of file diff --git a/__output__/vectis/factory-opt/Factory.react-query.ts b/__output__/vectis/factory-opt/Factory.react-query.ts deleted file mode 100644 index 94e03744..00000000 --- a/__output__/vectis/factory-opt/Factory.react-query.ts +++ /dev/null @@ -1,105 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { UseQueryOptions, useQuery } from "react-query"; -import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; -import { FactoryQueryClient } from "./Factory.client"; -export interface FactoryAdminAddrQuery { - client?: FactoryQueryClient; - options?: UseQueryOptions; -} -export function useFactoryAdminAddrQuery({ - client, - options -}: FactoryAdminAddrQuery) { - return useQuery(["factoryAdminAddr", client?.contractAddress], () => client ? client.adminAddr() : undefined, { ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true) - }); -} -export interface FactoryGovecAddrQuery { - client?: FactoryQueryClient; - options?: UseQueryOptions; -} -export function useFactoryGovecAddrQuery({ - client, - options -}: FactoryGovecAddrQuery) { - return useQuery(["factoryGovecAddr", client?.contractAddress], () => client ? client.govecAddr() : undefined, { ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true) - }); -} -export interface FactoryFeeQuery { - client?: FactoryQueryClient; - options?: UseQueryOptions; -} -export function useFactoryFeeQuery({ - client, - options -}: FactoryFeeQuery) { - return useQuery(["factoryFee", client?.contractAddress], () => client ? client.fee() : undefined, { ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true) - }); -} -export interface FactoryCodeIdQuery { - client?: FactoryQueryClient; - options?: UseQueryOptions; - args: { - ty: CodeIdType; - }; -} -export function useFactoryCodeIdQuery({ - client, - args, - options -}: FactoryCodeIdQuery) { - return useQuery(["factoryCodeId", client?.contractAddress, JSON.stringify(args)], () => client ? client.codeId({ - ty: args.ty - }) : undefined, { ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true) - }); -} -export interface FactoryWalletsOfQuery { - client?: FactoryQueryClient; - options?: UseQueryOptions; - args: { - limit?: number; - startAfter?: string; - user: string; - }; -} -export function useFactoryWalletsOfQuery({ - client, - args, - options -}: FactoryWalletsOfQuery) { - return useQuery(["factoryWalletsOf", client?.contractAddress, JSON.stringify(args)], () => client ? client.walletsOf({ - limit: args.limit, - startAfter: args.startAfter, - user: args.user - }) : undefined, { ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true) - }); -} -export interface FactoryWalletsQuery { - client?: FactoryQueryClient; - options?: UseQueryOptions; - args: { - limit?: number; - startAfter?: WalletQueryPrefix; - }; -} -export function useFactoryWalletsQuery({ - client, - args, - options -}: FactoryWalletsQuery) { - return useQuery(["factoryWallets", client?.contractAddress, JSON.stringify(args)], () => client ? client.wallets({ - limit: args.limit, - startAfter: args.startAfter - }) : undefined, { ...options, - enabled: !!client && (options?.enabled != undefined ? options.enabled : true) - }); -} \ No newline at end of file diff --git a/__output__/vectis/factory-query-factory/Factory.react-query.ts b/__output__/vectis/factory-query-factory/Factory.react-query.ts deleted file mode 100644 index e233c2bb..00000000 --- a/__output__/vectis/factory-query-factory/Factory.react-query.ts +++ /dev/null @@ -1,114 +0,0 @@ -/** -* This file was automatically generated by @cosmwasm/ts-codegen@latest. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @cosmwasm/ts-codegen generate command to regenerate this file. -*/ - -import { UseQueryOptions, useQuery } from "react-query"; -import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; -import { FactoryQueryClient } from "./Factory.client"; -export const factoryQueryKeys = { - contract: ([{ - contract: "factory" - }] as const), - address: (contractAddress: string) => ([{ ...factoryQueryKeys.contract[0], - address: contractAddress - }] as const), - wallets: (contractAddress: string, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], - method: "wallets", - args - }] as const), - walletsOf: (contractAddress: string, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], - method: "wallets_of", - args - }] as const), - codeId: (contractAddress: string, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], - method: "code_id", - args - }] as const), - fee: (contractAddress: string, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], - method: "fee", - args - }] as const), - govecAddr: (contractAddress: string, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], - method: "govec_addr", - args - }] as const), - adminAddr: (contractAddress: string, args?: Record) => ([{ ...factoryQueryKeys.address(contractAddress)[0], - method: "admin_addr", - args - }] as const) -}; -export interface FactoryReactQuery { - client: FactoryQueryClient; - options?: UseQueryOptions; -} -export interface FactoryAdminAddrQuery extends FactoryReactQuery {} -export function useFactoryAdminAddrQuery({ - client, - options -}: FactoryAdminAddrQuery) { - return useQuery(factoryQueryKeys.adminAddr(client.contractAddress), () => client.adminAddr(), options); -} -export interface FactoryGovecAddrQuery extends FactoryReactQuery {} -export function useFactoryGovecAddrQuery({ - client, - options -}: FactoryGovecAddrQuery) { - return useQuery(factoryQueryKeys.govecAddr(client.contractAddress), () => client.govecAddr(), options); -} -export interface FactoryFeeQuery extends FactoryReactQuery {} -export function useFactoryFeeQuery({ - client, - options -}: FactoryFeeQuery) { - return useQuery(factoryQueryKeys.fee(client.contractAddress), () => client.fee(), options); -} -export interface FactoryCodeIdQuery extends FactoryReactQuery { - args: { - ty: CodeIdType; - }; -} -export function useFactoryCodeIdQuery({ - client, - args, - options -}: FactoryCodeIdQuery) { - return useQuery(factoryQueryKeys.codeId(client.contractAddress, args), () => client.codeId({ - ty: args.ty - }), options); -} -export interface FactoryWalletsOfQuery extends FactoryReactQuery { - args: { - limit?: number; - startAfter?: string; - user: string; - }; -} -export function useFactoryWalletsOfQuery({ - client, - args, - options -}: FactoryWalletsOfQuery) { - return useQuery(factoryQueryKeys.walletsOf(client.contractAddress, args), () => client.walletsOf({ - limit: args.limit, - startAfter: args.startAfter, - user: args.user - }), options); -} -export interface FactoryWalletsQuery extends FactoryReactQuery { - args: { - limit?: number; - startAfter?: WalletQueryPrefix; - }; -} -export function useFactoryWalletsQuery({ - client, - args, - options -}: FactoryWalletsQuery) { - return useQuery(factoryQueryKeys.wallets(client.contractAddress, args), () => client.wallets({ - limit: args.limit, - startAfter: args.startAfter - }), options); -} \ No newline at end of file From 372ec82feafaddd25ad795fbed5796115af1b5d7 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 9 Aug 2023 14:48:43 -0700 Subject: [PATCH 161/287] output fixtures readme --- README.md | 4 +- .../CwAdminFactory.message-composer.ts | 4 +- .../contracts/CwAdminFactory.provider.ts | 6 +- .../CwCodeIdRegistry.message-composer.ts | 4 +- .../contracts/CwCodeIdRegistry.provider.ts | 6 +- .../contracts/CwSingle.message-composer.ts | 4 +- .../contracts/CwSingle.provider.ts | 6 +- .../contracts/Factory.message-composer.ts | 4 +- .../contracts/Factory.provider.ts | 6 +- .../contracts/Minter.message-composer.ts | 4 +- .../bundler_test/contracts/Minter.provider.ts | 6 +- .../contracts/contractContextProviders.ts | 20 ++--- .../CwAdminFactory.message-composer.ts | 4 +- .../default/CwAdminFactory.provider.ts | 6 +- .../CwCodeIdRegistry.message-composer.ts | 4 +- .../default/CwCodeIdRegistry.provider.ts | 6 +- .../default/CwSingle.message-composer.ts | 4 +- .../builder/default/CwSingle.provider.ts | 6 +- .../default/Factory.message-composer.ts | 4 +- .../builder/default/Factory.provider.ts | 6 +- .../default/Minter.message-composer.ts | 4 +- __output__/builder/default/Minter.provider.ts | 6 +- .../default/contractContextProviders.ts | 20 ++--- .../CwAdminFactory.message-composer.ts | 4 +- .../CwCodeIdRegistry.message-composer.ts | 4 +- .../no-extends/CwSingle.message-composer.ts | 4 +- .../no-extends/Factory.message-composer.ts | 4 +- .../no-extends/Minter.message-composer.ts | 4 +- .../Sg721Updatable.message-composer.ts | 4 +- packages/ts-codegen/README.md | 83 +++++++++++++++---- .../src/plugins/message-composer.ts | 4 +- 31 files changed, 154 insertions(+), 101 deletions(-) diff --git a/README.md b/README.md index bc062836..a3e9e513 100644 --- a/README.md +++ b/README.md @@ -278,8 +278,8 @@ cosmwasm-ts-codegen generate \ ``` #### Message Builder Options -| option | description | -|------------------------- | ------------------------------ | +| option | description | +|------------------------- | ---------------------------------- | | `messageBuilder.enabled` | enable the messageBuilder plugin | diff --git a/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts b/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts index 96fcfa44..bef32013 100644 --- a/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts @@ -9,7 +9,7 @@ import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; -export interface CwAdminFactoryMessage { +export interface CwAdminFactoryMsg { contractAddress: string; sender: string; instantiateContractWithSelfAdmin: ({ @@ -22,7 +22,7 @@ export interface CwAdminFactoryMessage { label: string; }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } -export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { +export class CwAdminFactoryMsgComposer implements CwAdminFactoryMsg { sender: string; contractAddress: string; diff --git a/__output__/builder/bundler_test/contracts/CwAdminFactory.provider.ts b/__output__/builder/bundler_test/contracts/CwAdminFactory.provider.ts index f8d0b76d..24c5a646 100644 --- a/__output__/builder/bundler_test/contracts/CwAdminFactory.provider.ts +++ b/__output__/builder/bundler_test/contracts/CwAdminFactory.provider.ts @@ -6,14 +6,14 @@ import { ContractBase, IContractConstructor } from "./contractContextBase"; import { CwAdminFactoryClient, CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; -import { CwAdminFactoryMessageComposer } from "./CwAdminFactory.message-composer"; -export class CwAdminFactory extends ContractBase { +import { CwAdminFactoryMsgComposer } from "./CwAdminFactory.message-composer"; +export class CwAdminFactory extends ContractBase { constructor({ address, cosmWasmClient, signingCosmWasmClient }: IContractConstructor) { - super(address, cosmWasmClient, signingCosmWasmClient, CwAdminFactoryClient, CwAdminFactoryQueryClient, CwAdminFactoryMessageComposer); + super(address, cosmWasmClient, signingCosmWasmClient, CwAdminFactoryClient, CwAdminFactoryQueryClient, CwAdminFactoryMsgComposer); } } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts index 9c28ec26..5e2f60b2 100644 --- a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts @@ -9,7 +9,7 @@ import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; -export interface CwCodeIdRegistryMessage { +export interface CwCodeIdRegistryMsg { contractAddress: string; sender: string; receive: ({ @@ -58,7 +58,7 @@ export interface CwCodeIdRegistryMessage { paymentInfo?: PaymentInfo; }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } -export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage { +export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { sender: string; contractAddress: string; diff --git a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.provider.ts b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.provider.ts index ba841f2f..eee19b43 100644 --- a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.provider.ts +++ b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.provider.ts @@ -6,14 +6,14 @@ import { ContractBase, IContractConstructor } from "./contractContextBase"; import { CwCodeIdRegistryClient, CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; -import { CwCodeIdRegistryMessageComposer } from "./CwCodeIdRegistry.message-composer"; -export class CwCodeIdRegistry extends ContractBase { +import { CwCodeIdRegistryMsgComposer } from "./CwCodeIdRegistry.message-composer"; +export class CwCodeIdRegistry extends ContractBase { constructor({ address, cosmWasmClient, signingCosmWasmClient }: IContractConstructor) { - super(address, cosmWasmClient, signingCosmWasmClient, CwCodeIdRegistryClient, CwCodeIdRegistryQueryClient, CwCodeIdRegistryMessageComposer); + super(address, cosmWasmClient, signingCosmWasmClient, CwCodeIdRegistryClient, CwCodeIdRegistryQueryClient, CwCodeIdRegistryMsgComposer); } } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts b/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts index 465f2b1a..1fcde7c6 100644 --- a/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts @@ -8,7 +8,7 @@ import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; -export interface CwSingleMessage { +export interface CwSingleMsg { contractAddress: string; sender: string; propose: ({ @@ -75,7 +75,7 @@ export interface CwSingleMessage { address: string; }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } -export class CwSingleMessageComposer implements CwSingleMessage { +export class CwSingleMsgComposer implements CwSingleMsg { sender: string; contractAddress: string; diff --git a/__output__/builder/bundler_test/contracts/CwSingle.provider.ts b/__output__/builder/bundler_test/contracts/CwSingle.provider.ts index e3b2a3b3..2bd53f0f 100644 --- a/__output__/builder/bundler_test/contracts/CwSingle.provider.ts +++ b/__output__/builder/bundler_test/contracts/CwSingle.provider.ts @@ -6,14 +6,14 @@ import { ContractBase, IContractConstructor } from "./contractContextBase"; import { CwSingleClient, CwSingleQueryClient } from "./CwSingle.client"; -import { CwSingleMessageComposer } from "./CwSingle.message-composer"; -export class CwSingle extends ContractBase { +import { CwSingleMsgComposer } from "./CwSingle.message-composer"; +export class CwSingle extends ContractBase { constructor({ address, cosmWasmClient, signingCosmWasmClient }: IContractConstructor) { - super(address, cosmWasmClient, signingCosmWasmClient, CwSingleClient, CwSingleQueryClient, CwSingleMessageComposer); + super(address, cosmWasmClient, signingCosmWasmClient, CwSingleClient, CwSingleQueryClient, CwSingleMsgComposer); } } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Factory.message-composer.ts b/__output__/builder/bundler_test/contracts/Factory.message-composer.ts index 9b9ae7c4..d5100d04 100644 --- a/__output__/builder/bundler_test/contracts/Factory.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/Factory.message-composer.ts @@ -8,7 +8,7 @@ import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; -export interface FactoryMessage { +export interface FactoryMsg { contractAddress: string; sender: string; createWallet: ({ @@ -53,7 +53,7 @@ export interface FactoryMessage { addr: string; }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } -export class FactoryMessageComposer implements FactoryMessage { +export class FactoryMsgComposer implements FactoryMsg { sender: string; contractAddress: string; diff --git a/__output__/builder/bundler_test/contracts/Factory.provider.ts b/__output__/builder/bundler_test/contracts/Factory.provider.ts index 34273f44..c60015f4 100644 --- a/__output__/builder/bundler_test/contracts/Factory.provider.ts +++ b/__output__/builder/bundler_test/contracts/Factory.provider.ts @@ -6,14 +6,14 @@ import { ContractBase, IContractConstructor } from "./contractContextBase"; import { FactoryClient, FactoryQueryClient } from "./Factory.client"; -import { FactoryMessageComposer } from "./Factory.message-composer"; -export class Factory extends ContractBase { +import { FactoryMsgComposer } from "./Factory.message-composer"; +export class Factory extends ContractBase { constructor({ address, cosmWasmClient, signingCosmWasmClient }: IContractConstructor) { - super(address, cosmWasmClient, signingCosmWasmClient, FactoryClient, FactoryQueryClient, FactoryMessageComposer); + super(address, cosmWasmClient, signingCosmWasmClient, FactoryClient, FactoryQueryClient, FactoryMsgComposer); } } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/Minter.message-composer.ts b/__output__/builder/bundler_test/contracts/Minter.message-composer.ts index 57ecfa82..28a24747 100644 --- a/__output__/builder/bundler_test/contracts/Minter.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/Minter.message-composer.ts @@ -8,7 +8,7 @@ import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; -export interface MinterMessage { +export interface MinterMsg { contractAddress: string; sender: string; mint: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; @@ -37,7 +37,7 @@ export interface MinterMessage { }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; withdraw: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; } -export class MinterMessageComposer implements MinterMessage { +export class MinterMsgComposer implements MinterMsg { sender: string; contractAddress: string; diff --git a/__output__/builder/bundler_test/contracts/Minter.provider.ts b/__output__/builder/bundler_test/contracts/Minter.provider.ts index c5e6aa5f..8d3a1eaa 100644 --- a/__output__/builder/bundler_test/contracts/Minter.provider.ts +++ b/__output__/builder/bundler_test/contracts/Minter.provider.ts @@ -6,14 +6,14 @@ import { ContractBase, IContractConstructor } from "./contractContextBase"; import { MinterClient, MinterQueryClient } from "./Minter.client"; -import { MinterMessageComposer } from "./Minter.message-composer"; -export class Minter extends ContractBase { +import { MinterMsgComposer } from "./Minter.message-composer"; +export class Minter extends ContractBase { constructor({ address, cosmWasmClient, signingCosmWasmClient }: IContractConstructor) { - super(address, cosmWasmClient, signingCosmWasmClient, MinterClient, MinterQueryClient, MinterMessageComposer); + super(address, cosmWasmClient, signingCosmWasmClient, MinterClient, MinterQueryClient, MinterMsgComposer); } } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/contractContextProviders.ts b/__output__/builder/bundler_test/contracts/contractContextProviders.ts index bf15d71a..ca57a66e 100644 --- a/__output__/builder/bundler_test/contracts/contractContextProviders.ts +++ b/__output__/builder/bundler_test/contracts/contractContextProviders.ts @@ -8,30 +8,30 @@ import { CosmWasmClient, SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate import { IQueryClientProvider, ISigningClientProvider, IMessageComposerProvider } from "./contractContextBase"; import { FactoryQueryClient } from "./Factory.client"; import { FactoryClient } from "./Factory.client"; -import { FactoryMessageComposer } from "./Factory.message-composer"; +import { FactoryMsgComposer } from "./Factory.message-composer"; import { Factory } from "./Factory.provider"; import { MinterQueryClient } from "./Minter.client"; import { MinterClient } from "./Minter.client"; -import { MinterMessageComposer } from "./Minter.message-composer"; +import { MinterMsgComposer } from "./Minter.message-composer"; import { Minter } from "./Minter.provider"; import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; import { CwAdminFactoryClient } from "./CwAdminFactory.client"; -import { CwAdminFactoryMessageComposer } from "./CwAdminFactory.message-composer"; +import { CwAdminFactoryMsgComposer } from "./CwAdminFactory.message-composer"; import { CwAdminFactory } from "./CwAdminFactory.provider"; import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; import { CwCodeIdRegistryClient } from "./CwCodeIdRegistry.client"; -import { CwCodeIdRegistryMessageComposer } from "./CwCodeIdRegistry.message-composer"; +import { CwCodeIdRegistryMsgComposer } from "./CwCodeIdRegistry.message-composer"; import { CwCodeIdRegistry } from "./CwCodeIdRegistry.provider"; import { CwSingleQueryClient } from "./CwSingle.client"; import { CwSingleClient } from "./CwSingle.client"; -import { CwSingleMessageComposer } from "./CwSingle.message-composer"; +import { CwSingleMsgComposer } from "./CwSingle.message-composer"; import { CwSingle } from "./CwSingle.provider"; export interface IContractsContext { - factory: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; - minter: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; - cwAdminFactory: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; - cwCodeIdRegistry: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; - cwSingle: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; + factory: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; + minter: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; + cwAdminFactory: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; + cwCodeIdRegistry: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; + cwSingle: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; } export const getProviders = (address?: string, cosmWasmClient?: CosmWasmClient, signingCosmWasmClient?: SigningCosmWasmClient) => ({ factory: new Factory({ diff --git a/__output__/builder/default/CwAdminFactory.message-composer.ts b/__output__/builder/default/CwAdminFactory.message-composer.ts index 96fcfa44..bef32013 100644 --- a/__output__/builder/default/CwAdminFactory.message-composer.ts +++ b/__output__/builder/default/CwAdminFactory.message-composer.ts @@ -9,7 +9,7 @@ import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; -export interface CwAdminFactoryMessage { +export interface CwAdminFactoryMsg { contractAddress: string; sender: string; instantiateContractWithSelfAdmin: ({ @@ -22,7 +22,7 @@ export interface CwAdminFactoryMessage { label: string; }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } -export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { +export class CwAdminFactoryMsgComposer implements CwAdminFactoryMsg { sender: string; contractAddress: string; diff --git a/__output__/builder/default/CwAdminFactory.provider.ts b/__output__/builder/default/CwAdminFactory.provider.ts index f8d0b76d..24c5a646 100644 --- a/__output__/builder/default/CwAdminFactory.provider.ts +++ b/__output__/builder/default/CwAdminFactory.provider.ts @@ -6,14 +6,14 @@ import { ContractBase, IContractConstructor } from "./contractContextBase"; import { CwAdminFactoryClient, CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; -import { CwAdminFactoryMessageComposer } from "./CwAdminFactory.message-composer"; -export class CwAdminFactory extends ContractBase { +import { CwAdminFactoryMsgComposer } from "./CwAdminFactory.message-composer"; +export class CwAdminFactory extends ContractBase { constructor({ address, cosmWasmClient, signingCosmWasmClient }: IContractConstructor) { - super(address, cosmWasmClient, signingCosmWasmClient, CwAdminFactoryClient, CwAdminFactoryQueryClient, CwAdminFactoryMessageComposer); + super(address, cosmWasmClient, signingCosmWasmClient, CwAdminFactoryClient, CwAdminFactoryQueryClient, CwAdminFactoryMsgComposer); } } \ No newline at end of file diff --git a/__output__/builder/default/CwCodeIdRegistry.message-composer.ts b/__output__/builder/default/CwCodeIdRegistry.message-composer.ts index 9c28ec26..5e2f60b2 100644 --- a/__output__/builder/default/CwCodeIdRegistry.message-composer.ts +++ b/__output__/builder/default/CwCodeIdRegistry.message-composer.ts @@ -9,7 +9,7 @@ import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; -export interface CwCodeIdRegistryMessage { +export interface CwCodeIdRegistryMsg { contractAddress: string; sender: string; receive: ({ @@ -58,7 +58,7 @@ export interface CwCodeIdRegistryMessage { paymentInfo?: PaymentInfo; }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } -export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage { +export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { sender: string; contractAddress: string; diff --git a/__output__/builder/default/CwCodeIdRegistry.provider.ts b/__output__/builder/default/CwCodeIdRegistry.provider.ts index ba841f2f..eee19b43 100644 --- a/__output__/builder/default/CwCodeIdRegistry.provider.ts +++ b/__output__/builder/default/CwCodeIdRegistry.provider.ts @@ -6,14 +6,14 @@ import { ContractBase, IContractConstructor } from "./contractContextBase"; import { CwCodeIdRegistryClient, CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; -import { CwCodeIdRegistryMessageComposer } from "./CwCodeIdRegistry.message-composer"; -export class CwCodeIdRegistry extends ContractBase { +import { CwCodeIdRegistryMsgComposer } from "./CwCodeIdRegistry.message-composer"; +export class CwCodeIdRegistry extends ContractBase { constructor({ address, cosmWasmClient, signingCosmWasmClient }: IContractConstructor) { - super(address, cosmWasmClient, signingCosmWasmClient, CwCodeIdRegistryClient, CwCodeIdRegistryQueryClient, CwCodeIdRegistryMessageComposer); + super(address, cosmWasmClient, signingCosmWasmClient, CwCodeIdRegistryClient, CwCodeIdRegistryQueryClient, CwCodeIdRegistryMsgComposer); } } \ No newline at end of file diff --git a/__output__/builder/default/CwSingle.message-composer.ts b/__output__/builder/default/CwSingle.message-composer.ts index 465f2b1a..1fcde7c6 100644 --- a/__output__/builder/default/CwSingle.message-composer.ts +++ b/__output__/builder/default/CwSingle.message-composer.ts @@ -8,7 +8,7 @@ import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; -export interface CwSingleMessage { +export interface CwSingleMsg { contractAddress: string; sender: string; propose: ({ @@ -75,7 +75,7 @@ export interface CwSingleMessage { address: string; }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } -export class CwSingleMessageComposer implements CwSingleMessage { +export class CwSingleMsgComposer implements CwSingleMsg { sender: string; contractAddress: string; diff --git a/__output__/builder/default/CwSingle.provider.ts b/__output__/builder/default/CwSingle.provider.ts index e3b2a3b3..2bd53f0f 100644 --- a/__output__/builder/default/CwSingle.provider.ts +++ b/__output__/builder/default/CwSingle.provider.ts @@ -6,14 +6,14 @@ import { ContractBase, IContractConstructor } from "./contractContextBase"; import { CwSingleClient, CwSingleQueryClient } from "./CwSingle.client"; -import { CwSingleMessageComposer } from "./CwSingle.message-composer"; -export class CwSingle extends ContractBase { +import { CwSingleMsgComposer } from "./CwSingle.message-composer"; +export class CwSingle extends ContractBase { constructor({ address, cosmWasmClient, signingCosmWasmClient }: IContractConstructor) { - super(address, cosmWasmClient, signingCosmWasmClient, CwSingleClient, CwSingleQueryClient, CwSingleMessageComposer); + super(address, cosmWasmClient, signingCosmWasmClient, CwSingleClient, CwSingleQueryClient, CwSingleMsgComposer); } } \ No newline at end of file diff --git a/__output__/builder/default/Factory.message-composer.ts b/__output__/builder/default/Factory.message-composer.ts index 9b9ae7c4..d5100d04 100644 --- a/__output__/builder/default/Factory.message-composer.ts +++ b/__output__/builder/default/Factory.message-composer.ts @@ -8,7 +8,7 @@ import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; -export interface FactoryMessage { +export interface FactoryMsg { contractAddress: string; sender: string; createWallet: ({ @@ -53,7 +53,7 @@ export interface FactoryMessage { addr: string; }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } -export class FactoryMessageComposer implements FactoryMessage { +export class FactoryMsgComposer implements FactoryMsg { sender: string; contractAddress: string; diff --git a/__output__/builder/default/Factory.provider.ts b/__output__/builder/default/Factory.provider.ts index 34273f44..c60015f4 100644 --- a/__output__/builder/default/Factory.provider.ts +++ b/__output__/builder/default/Factory.provider.ts @@ -6,14 +6,14 @@ import { ContractBase, IContractConstructor } from "./contractContextBase"; import { FactoryClient, FactoryQueryClient } from "./Factory.client"; -import { FactoryMessageComposer } from "./Factory.message-composer"; -export class Factory extends ContractBase { +import { FactoryMsgComposer } from "./Factory.message-composer"; +export class Factory extends ContractBase { constructor({ address, cosmWasmClient, signingCosmWasmClient }: IContractConstructor) { - super(address, cosmWasmClient, signingCosmWasmClient, FactoryClient, FactoryQueryClient, FactoryMessageComposer); + super(address, cosmWasmClient, signingCosmWasmClient, FactoryClient, FactoryQueryClient, FactoryMsgComposer); } } \ No newline at end of file diff --git a/__output__/builder/default/Minter.message-composer.ts b/__output__/builder/default/Minter.message-composer.ts index 57ecfa82..28a24747 100644 --- a/__output__/builder/default/Minter.message-composer.ts +++ b/__output__/builder/default/Minter.message-composer.ts @@ -8,7 +8,7 @@ import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; -export interface MinterMessage { +export interface MinterMsg { contractAddress: string; sender: string; mint: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; @@ -37,7 +37,7 @@ export interface MinterMessage { }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; withdraw: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; } -export class MinterMessageComposer implements MinterMessage { +export class MinterMsgComposer implements MinterMsg { sender: string; contractAddress: string; diff --git a/__output__/builder/default/Minter.provider.ts b/__output__/builder/default/Minter.provider.ts index c5e6aa5f..8d3a1eaa 100644 --- a/__output__/builder/default/Minter.provider.ts +++ b/__output__/builder/default/Minter.provider.ts @@ -6,14 +6,14 @@ import { ContractBase, IContractConstructor } from "./contractContextBase"; import { MinterClient, MinterQueryClient } from "./Minter.client"; -import { MinterMessageComposer } from "./Minter.message-composer"; -export class Minter extends ContractBase { +import { MinterMsgComposer } from "./Minter.message-composer"; +export class Minter extends ContractBase { constructor({ address, cosmWasmClient, signingCosmWasmClient }: IContractConstructor) { - super(address, cosmWasmClient, signingCosmWasmClient, MinterClient, MinterQueryClient, MinterMessageComposer); + super(address, cosmWasmClient, signingCosmWasmClient, MinterClient, MinterQueryClient, MinterMsgComposer); } } \ No newline at end of file diff --git a/__output__/builder/default/contractContextProviders.ts b/__output__/builder/default/contractContextProviders.ts index bf15d71a..ca57a66e 100644 --- a/__output__/builder/default/contractContextProviders.ts +++ b/__output__/builder/default/contractContextProviders.ts @@ -8,30 +8,30 @@ import { CosmWasmClient, SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate import { IQueryClientProvider, ISigningClientProvider, IMessageComposerProvider } from "./contractContextBase"; import { FactoryQueryClient } from "./Factory.client"; import { FactoryClient } from "./Factory.client"; -import { FactoryMessageComposer } from "./Factory.message-composer"; +import { FactoryMsgComposer } from "./Factory.message-composer"; import { Factory } from "./Factory.provider"; import { MinterQueryClient } from "./Minter.client"; import { MinterClient } from "./Minter.client"; -import { MinterMessageComposer } from "./Minter.message-composer"; +import { MinterMsgComposer } from "./Minter.message-composer"; import { Minter } from "./Minter.provider"; import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; import { CwAdminFactoryClient } from "./CwAdminFactory.client"; -import { CwAdminFactoryMessageComposer } from "./CwAdminFactory.message-composer"; +import { CwAdminFactoryMsgComposer } from "./CwAdminFactory.message-composer"; import { CwAdminFactory } from "./CwAdminFactory.provider"; import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; import { CwCodeIdRegistryClient } from "./CwCodeIdRegistry.client"; -import { CwCodeIdRegistryMessageComposer } from "./CwCodeIdRegistry.message-composer"; +import { CwCodeIdRegistryMsgComposer } from "./CwCodeIdRegistry.message-composer"; import { CwCodeIdRegistry } from "./CwCodeIdRegistry.provider"; import { CwSingleQueryClient } from "./CwSingle.client"; import { CwSingleClient } from "./CwSingle.client"; -import { CwSingleMessageComposer } from "./CwSingle.message-composer"; +import { CwSingleMsgComposer } from "./CwSingle.message-composer"; import { CwSingle } from "./CwSingle.provider"; export interface IContractsContext { - factory: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; - minter: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; - cwAdminFactory: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; - cwCodeIdRegistry: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; - cwSingle: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; + factory: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; + minter: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; + cwAdminFactory: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; + cwCodeIdRegistry: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; + cwSingle: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; } export const getProviders = (address?: string, cosmWasmClient?: CosmWasmClient, signingCosmWasmClient?: SigningCosmWasmClient) => ({ factory: new Factory({ diff --git a/__output__/builder/no-extends/CwAdminFactory.message-composer.ts b/__output__/builder/no-extends/CwAdminFactory.message-composer.ts index 96fcfa44..bef32013 100644 --- a/__output__/builder/no-extends/CwAdminFactory.message-composer.ts +++ b/__output__/builder/no-extends/CwAdminFactory.message-composer.ts @@ -9,7 +9,7 @@ import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; -export interface CwAdminFactoryMessage { +export interface CwAdminFactoryMsg { contractAddress: string; sender: string; instantiateContractWithSelfAdmin: ({ @@ -22,7 +22,7 @@ export interface CwAdminFactoryMessage { label: string; }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } -export class CwAdminFactoryMessageComposer implements CwAdminFactoryMessage { +export class CwAdminFactoryMsgComposer implements CwAdminFactoryMsg { sender: string; contractAddress: string; diff --git a/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts b/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts index 9c28ec26..5e2f60b2 100644 --- a/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts +++ b/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts @@ -9,7 +9,7 @@ import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; -export interface CwCodeIdRegistryMessage { +export interface CwCodeIdRegistryMsg { contractAddress: string; sender: string; receive: ({ @@ -58,7 +58,7 @@ export interface CwCodeIdRegistryMessage { paymentInfo?: PaymentInfo; }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } -export class CwCodeIdRegistryMessageComposer implements CwCodeIdRegistryMessage { +export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { sender: string; contractAddress: string; diff --git a/__output__/builder/no-extends/CwSingle.message-composer.ts b/__output__/builder/no-extends/CwSingle.message-composer.ts index 465f2b1a..1fcde7c6 100644 --- a/__output__/builder/no-extends/CwSingle.message-composer.ts +++ b/__output__/builder/no-extends/CwSingle.message-composer.ts @@ -8,7 +8,7 @@ import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; -export interface CwSingleMessage { +export interface CwSingleMsg { contractAddress: string; sender: string; propose: ({ @@ -75,7 +75,7 @@ export interface CwSingleMessage { address: string; }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } -export class CwSingleMessageComposer implements CwSingleMessage { +export class CwSingleMsgComposer implements CwSingleMsg { sender: string; contractAddress: string; diff --git a/__output__/builder/no-extends/Factory.message-composer.ts b/__output__/builder/no-extends/Factory.message-composer.ts index 9b9ae7c4..d5100d04 100644 --- a/__output__/builder/no-extends/Factory.message-composer.ts +++ b/__output__/builder/no-extends/Factory.message-composer.ts @@ -8,7 +8,7 @@ import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; -export interface FactoryMessage { +export interface FactoryMsg { contractAddress: string; sender: string; createWallet: ({ @@ -53,7 +53,7 @@ export interface FactoryMessage { addr: string; }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } -export class FactoryMessageComposer implements FactoryMessage { +export class FactoryMsgComposer implements FactoryMsg { sender: string; contractAddress: string; diff --git a/__output__/builder/no-extends/Minter.message-composer.ts b/__output__/builder/no-extends/Minter.message-composer.ts index 57ecfa82..28a24747 100644 --- a/__output__/builder/no-extends/Minter.message-composer.ts +++ b/__output__/builder/no-extends/Minter.message-composer.ts @@ -8,7 +8,7 @@ import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; -export interface MinterMessage { +export interface MinterMsg { contractAddress: string; sender: string; mint: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; @@ -37,7 +37,7 @@ export interface MinterMessage { }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; withdraw: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; } -export class MinterMessageComposer implements MinterMessage { +export class MinterMsgComposer implements MinterMsg { sender: string; contractAddress: string; diff --git a/__output__/sg721-updatable/Sg721Updatable.message-composer.ts b/__output__/sg721-updatable/Sg721Updatable.message-composer.ts index d717a293..aae3f337 100644 --- a/__output__/sg721-updatable/Sg721Updatable.message-composer.ts +++ b/__output__/sg721-updatable/Sg721Updatable.message-composer.ts @@ -9,7 +9,7 @@ import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; import { toUtf8 } from "@cosmjs/encoding"; import { Expiration, Timestamp, Uint64, AllNftInfoResponse, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, AllOperatorsResponse, AllTokensResponse, ApprovalResponse, ApprovalsResponse, Decimal, CollectionInfoResponse, RoyaltyInfoResponse, ContractInfoResponse, ExecuteMsgForNullable_EmptyAndEmpty, Binary, UpdateCollectionInfoMsgForRoyaltyInfoResponse, InstantiateMsg, CollectionInfoForRoyaltyInfoResponse, MinterResponse, NftInfoResponse, NumTokensResponse, QueryMsg, TokensResponse } from "./Sg721Updatable.types"; -export interface Sg721UpdatableMessage { +export interface Sg721UpdatableMsg { contractAddress: string; sender: string; freezeTokenMetadata: (_funds?: Coin[]) => MsgExecuteContractEncodeObject; @@ -94,7 +94,7 @@ export interface Sg721UpdatableMessage { msg: Empty; }, _funds?: Coin[]) => MsgExecuteContractEncodeObject; } -export class Sg721UpdatableMessageComposer implements Sg721UpdatableMessage { +export class Sg721UpdatableMsgComposer implements Sg721UpdatableMsg { sender: string; contractAddress: string; diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index efbaf3bc..a3e9e513 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -47,7 +47,7 @@ The quickest and easiest way to interact with CosmWasm Contracts. `@cosmwasm/ts- - [Exporting Schemas](#exporting-schemas) - [Developing](#developing) - [Related](#related) -## Quickstart +## Quickstart Clone your project and `cd` into your contracts folder @@ -133,7 +133,7 @@ codegen({ console.log('✨ all done!'); }); ``` -#### Types +#### Types Typescript types and interfaces are generated in separate files so they can be imported into various generated plugins. @@ -149,7 +149,7 @@ Typescript types and interfaces are generated in separate files so they can be i ### Client -The `client` plugin will generate TS client classes for your contracts. This option generates a `QueryClient` for queries as well as a `Client` for queries and mutations. +The `client` plugin will generate TS client classes for your contracts. This option generates a `QueryClient` for queries as well as a `Client` for queries and mutations. [see example output code](https://gist.github.com/pyramation/30508678b7563e286f06ccc5ac384817) @@ -189,7 +189,7 @@ Generate [react-query v3](https://react-query-v3.tanstack.com/) or [react-query | `reactQuery.camelize` | use camelCase style for property names | -#### React Query via CLI +#### React Query via CLI Here is an example without optional client, using v3 for `react-query`, without mutations: @@ -231,7 +231,7 @@ cosmwasm-ts-codegen generate \ --plugin recoil \ --schema ./schema \ --out ./ts \ - --name MyContractName + --name MyContractName ``` #### Recoil Options @@ -253,7 +253,7 @@ cosmwasm-ts-codegen generate \ --plugin message-composer \ --schema ./schema \ --out ./ts \ - --name MyContractName + --name MyContractName ``` #### Message Composer Options @@ -274,12 +274,12 @@ cosmwasm-ts-codegen generate \ --plugin message-builder \ --schema ./schema \ --out ./ts \ - --name MyContractName + --name MyContractName ``` #### Message Builder Options -| option | description | -|------------------------- | ------------------------------ | +| option | description | +|------------------------- | ---------------------------------- | | `messageBuilder.enabled` | enable the messageBuilder plugin | @@ -296,8 +296,8 @@ import { useChain } from '@cosmos-kit/react'; import { ContractsProvider } from '../path/to/codegen/contracts-context'; export default function YourComponent() { - - const { + + const { address, getCosmWasmClient, getSigningCosmWasmClient @@ -357,11 +357,64 @@ const { CwAdminFactoryClient } = contracts.CwAdminFactory; | `bundle.scope` | name of the scope, defaults to `contracts` (you can use `.` to make more scopes) | | `bundle.bundleFile` | name of the bundle file | +#### Coding Style + +| option | description | +| --------------------- | -------------------------------------------------------------------------------- | +| `useShorthandCtor` | Enable using shorthand constructor. Default: false | + +Using shorthand constructor(Might not be transpiled correctly with babel): + +```ts + constructor( + protected address: string | undefined, + protected cosmWasmClient: CosmWasmClient | undefined, + protected signingCosmWasmClient: SigningCosmWasmClient | undefined, + private TSign?: new ( + client: SigningCosmWasmClient, + sender: string, + contractAddress: string + ) => TSign, + private TQuery?: new ( + client: CosmWasmClient, + contractAddress: string + ) => TQuery, + private TMsgComposer?: new ( + sender: string, + contractAddress: string + ) => TMsgComposer + ) {} +``` + +Without using shorthand constructor: + +```ts + address: string | undefined; + ... + TMsgComposer?: new ( + sender: string, + contractAddress: string + ) => TMsgComposer; + + constructor( + address: string | undefined, + ... + TMsgComposer?: new ( + sender: string, + contractAddress: string + ) => TMsgComposer + ) { + this.address = address; + ... + this.TMsgComposer = TMsgComposer; + } +``` + ### CLI Usage and Examples #### Interactive prompt -The CLI is interactive, and if you don't specify an option, it will interactively prompt you. +The CLI is interactive, and if you don't specify an option, it will interactively prompt you. ```sh cosmwasm-ts-codegen generate @@ -444,12 +497,12 @@ cosmwasm-ts-codegen generate \ for lower-level access, you can import the various plugins directly: ```ts -import { +import { generateTypes, generateClient, generateReactQuery, generateRecoil, - generateMessageComposer, + generateMessageComposer } from '@cosmwasm/ts-codegen'; ``` ### Example Output @@ -541,7 +594,7 @@ export_schema_with_title( ### Initial setup ``` -yarn +yarn yarn bootstrap ``` diff --git a/packages/ts-codegen/src/plugins/message-composer.ts b/packages/ts-codegen/src/plugins/message-composer.ts index 3e9ffe8c..277b6045 100644 --- a/packages/ts-codegen/src/plugins/message-composer.ts +++ b/packages/ts-codegen/src/plugins/message-composer.ts @@ -54,8 +54,8 @@ export class MessageComposerPlugin extends BuilderPluginBase { if (ExecuteMsg) { const children = getMessageProperties(ExecuteMsg); if (children.length > 0) { - const TheClass = pascal(`${name}MessageComposer`); - const Interface = pascal(`${name}Message`); + const TheClass = pascal(`${name}MsgComposer`); + const Interface = pascal(`${name}Msg`); body.push( w.createMessageComposerInterface(context, Interface, ExecuteMsg) From 34feaf9d151b5e5605b988a7eb4b3c9248d46fb6 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 9 Aug 2023 14:56:38 -0700 Subject: [PATCH 162/287] readme --- README.md | 8 ++++---- packages/ts-codegen/README.md | 18 ++++++++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index bd11f05e..8843fcae 100644 --- a/README.md +++ b/README.md @@ -369,11 +369,11 @@ const { CwAdminFactoryClient } = contracts.CwAdminFactory; #### Coding Style -| option | description | -| --------------------- | -------------------------------------------------------------------------------- | -| `useShorthandCtor` | Enable using shorthand constructor. Default: true | +| option | description | default | +| --------------------- | ---------------------------------------------- | +| `useShorthandCtor` | Enable using shorthand constructor. | true | -Using shorthand constructor(Might not be transpiled correctly with babel): +Using shorthand constructor (Might not be transpiled correctly with babel): ```ts constructor( diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index a3e9e513..8843fcae 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -317,6 +317,16 @@ export default function YourComponent() { }; ``` +If you're using Babel, please make sure include '@babel/preset-react' in devDeps and presets in .babelrc.js: + +```js + presets: [ + '@babel/typescript', + '@babel/env', + '@babel/preset-react', + ] +``` + #### Use Contracts Hooks Usage Once enabled, you can get contracts very simply: @@ -359,11 +369,11 @@ const { CwAdminFactoryClient } = contracts.CwAdminFactory; #### Coding Style -| option | description | -| --------------------- | -------------------------------------------------------------------------------- | -| `useShorthandCtor` | Enable using shorthand constructor. Default: false | +| option | description | default | +| --------------------- | ---------------------------------------------- | +| `useShorthandCtor` | Enable using shorthand constructor. | true | -Using shorthand constructor(Might not be transpiled correctly with babel): +Using shorthand constructor (Might not be transpiled correctly with babel): ```ts constructor( From fa5aea0a8de61f713a8dad85c5f7965e82c3b5c0 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 9 Aug 2023 14:57:29 -0700 Subject: [PATCH 163/287] chore(release): publish - @cosmwasm/ts-codegen@0.35.0 - wasm-ast-types@0.26.0 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index fb82be09..d49c63c0 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.35.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.34.2...@cosmwasm/ts-codegen@0.35.0) (2023-08-09) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.34.2](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.34.1...@cosmwasm/ts-codegen@0.34.2) (2023-07-30) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index ce28a9a7..7196d082 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.34.2", + "version": "0.35.0", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.25.0" + "wasm-ast-types": "^0.26.0" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index ef1b272a..f1ad5bfd 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.26.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.25.0...wasm-ast-types@0.26.0) (2023-08-09) + +**Note:** Version bump only for package wasm-ast-types + + + + + # [0.25.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.24.0...wasm-ast-types@0.25.0) (2023-07-28) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index d6c024ae..7e68964c 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.25.0", + "version": "0.26.0", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From 4c969705e808b1e64771185c9e37aa4168dc81a0 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 9 Aug 2023 15:25:21 -0700 Subject: [PATCH 164/287] default reactQuery to v4 --- packages/ts-codegen/src/commands/generate.ts | 2 +- .../wasm-ast-types/src/context/context.ts | 2 +- .../src/react-query/react-query.spec.ts | 24 ++++++++++++------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/packages/ts-codegen/src/commands/generate.ts b/packages/ts-codegen/src/commands/generate.ts index da45c51e..ce3cc49c 100644 --- a/packages/ts-codegen/src/commands/generate.ts +++ b/packages/ts-codegen/src/commands/generate.ts @@ -64,7 +64,7 @@ export default async (argv) => { type: 'list', name: 'version', message: 'which react-query version?', - default: 'v3', + default: 'v4', choices: ['v3', 'v4'] }, { diff --git a/packages/wasm-ast-types/src/context/context.ts b/packages/wasm-ast-types/src/context/context.ts index 3db892d2..c67beaf6 100644 --- a/packages/wasm-ast-types/src/context/context.ts +++ b/packages/wasm-ast-types/src/context/context.ts @@ -115,7 +115,7 @@ export const defaultOptions: RenderOptions = { reactQuery: { enabled: false, optionalClient: false, - version: 'v3', + version: 'v4', mutations: false, camelize: true, queryKeys: false diff --git a/packages/wasm-ast-types/src/react-query/react-query.spec.ts b/packages/wasm-ast-types/src/react-query/react-query.spec.ts index 19921053..bad63977 100644 --- a/packages/wasm-ast-types/src/react-query/react-query.spec.ts +++ b/packages/wasm-ast-types/src/react-query/react-query.spec.ts @@ -9,16 +9,16 @@ import { createReactQueryMutationHooks, } from './react-query' import { expectCode, makeContext } from '../../test-utils'; -import { createMessageBuilderClass } from '../message-builder'; - -const execCtx = makeContext(execute_msg); -const queryCtx = makeContext(query_msg); it('createReactQueryHooks', () => { expectCode(t.program( createReactQueryHooks( { - context: queryCtx, + context: makeContext(query_msg, { + reactQuery: { + version: 'v3', + } + }), queryMsg: query_msg, contractName: 'Sg721', QueryClient: 'Sg721QueryClient' @@ -29,6 +29,7 @@ it('createReactQueryHooks', () => { { context: makeContext(query_msg, { reactQuery: { + version: 'v3', optionalClient: true } }), @@ -84,7 +85,11 @@ it('createReactQueryHooks', () => { expectCode(t.program( createReactQueryMutationHooks( { - context: execCtx, + context: makeContext(execute_msg, { + reactQuery: { + version: 'v3' + } + }), execMsg: execute_msg, contractName: 'Sg721', ExecuteClient: 'Sg721Client', @@ -93,11 +98,14 @@ it('createReactQueryHooks', () => { }); it('ownership', () => { - const ownershipCtx = makeContext(ownership); expectCode(t.program( createReactQueryMutationHooks( { - context: ownershipCtx, + context: makeContext(ownership, { + reactQuery: { + version: 'v3' + } + }), execMsg: ownership, contractName: 'Ownership', ExecuteClient: 'OwnershipClient', From 0cad0afb48264cc726c06a6ff7a1453e7cabb4b5 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 9 Aug 2023 15:25:36 -0700 Subject: [PATCH 165/287] chore(release): publish - @cosmwasm/ts-codegen@0.35.1 - wasm-ast-types@0.26.1 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index d49c63c0..64602698 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.35.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.35.0...@cosmwasm/ts-codegen@0.35.1) (2023-08-09) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + # [0.35.0](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.34.2...@cosmwasm/ts-codegen@0.35.0) (2023-08-09) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 7196d082..24a8ce9c 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.35.0", + "version": "0.35.1", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.26.0" + "wasm-ast-types": "^0.26.1" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index f1ad5bfd..502ef01c 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.26.1](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.26.0...wasm-ast-types@0.26.1) (2023-08-09) + +**Note:** Version bump only for package wasm-ast-types + + + + + # [0.26.0](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.25.0...wasm-ast-types@0.26.0) (2023-08-09) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index 7e68964c..a5a31ad4 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.26.0", + "version": "0.26.1", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From 91f16c3b72fb24e85dcbc814bb8848ad5c05a6a1 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 9 Aug 2023 15:26:29 -0700 Subject: [PATCH 166/287] tests --- __fixtures__/issues/98/out/98.react-query.ts | 6 ++-- .../contracts/CwAdminFactory.react-query.ts | 6 ++-- .../contracts/CwCodeIdRegistry.react-query.ts | 6 ++-- .../contracts/CwSingle.react-query.ts | 6 ++-- .../contracts/Factory.react-query.ts | 6 ++-- .../contracts/Minter.react-query.ts | 6 ++-- .../default/CwAdminFactory.react-query.ts | 6 ++-- .../default/CwCodeIdRegistry.react-query.ts | 6 ++-- .../builder/default/CwSingle.react-query.ts | 6 ++-- .../builder/default/Factory.react-query.ts | 6 ++-- .../builder/default/Minter.react-query.ts | 6 ++-- .../invoke/CwAdminFactory.react-query.ts | 6 ++-- .../invoke/CwCodeIdRegistry.react-query.ts | 6 ++-- .../builder/invoke/CwSingle.react-query.ts | 6 ++-- .../builder/invoke/Factory.react-query.ts | 6 ++-- .../builder/invoke/Minter.react-query.ts | 6 ++-- .../no-extends/CwAdminFactory.react-query.ts | 6 ++-- .../CwCodeIdRegistry.react-query.ts | 6 ++-- .../no-extends/CwSingle.react-query.ts | 6 ++-- .../builder/no-extends/Factory.react-query.ts | 6 ++-- .../builder/no-extends/Minter.react-query.ts | 6 ++-- .../CwAdminFactory.react-query.ts | 6 ++-- .../CwCodeIdRegistry.react-query.ts | 6 ++-- .../CwNamedGroups.react-query.ts | 6 ++-- .../CwProposalSingle.react-query.ts | 6 ++-- .../accounts-nft/AccountsNft.react-query.ts | 6 ++-- .../Cw3FixedMultiSig.react-query.ts | 6 ++-- .../cw4-group/Cw4Group.react-query.ts | 6 ++-- .../cyberpunk/CyberPunk.react-query.ts | 6 ++-- .../hackatom/HackAtom.react-query.ts | 6 ++-- __output__/minter/Minter.react-query.ts | 6 ++-- .../Sg721Updatable.react-query.ts | 6 ++-- __output__/sg721/Sg721.react-query.ts | 6 ++-- .../Factory.react-query.ts | 6 ++-- .../Factory.react-query.ts | 6 ++-- .../factory-query-keys/Factory.react-query.ts | 6 ++-- .../vectis/factory/Factory.react-query.ts | 6 ++-- __output__/vectis/govec/Govec.react-query.ts | 6 ++-- __output__/vectis/proxy/Proxy.react-query.ts | 6 ++-- .../__snapshots__/builder.test.ts.snap | 32 +++++++++---------- 40 files changed, 172 insertions(+), 94 deletions(-) diff --git a/__fixtures__/issues/98/out/98.react-query.ts b/__fixtures__/issues/98/out/98.react-query.ts index f9e31110..c6314122 100644 --- a/__fixtures__/issues/98/out/98.react-query.ts +++ b/__fixtures__/issues/98/out/98.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { Uint128, InstantiateMsg, Coin, ExecuteMsg, InstallableExecMsg, Binary, ExecMsg, QueryMsg, InstallableQueryMsg, QueryMsg1, ConfigResponse, NullablePlugin, CanonicalAddr, Plugin, PluginsResponse } from "./98.types"; import { 98QueryClient } from "./98.client"; export interface 98ReactQuery { client: 98QueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface 98GetPluginByIdQuery extends 98ReactQuery { args: { diff --git a/__output__/builder/bundler_test/contracts/CwAdminFactory.react-query.ts b/__output__/builder/bundler_test/contracts/CwAdminFactory.react-query.ts index be2aa1b7..3a3014d7 100644 --- a/__output__/builder/bundler_test/contracts/CwAdminFactory.react-query.ts +++ b/__output__/builder/bundler_test/contracts/CwAdminFactory.react-query.ts @@ -4,10 +4,12 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions } from "react-query"; +import { UseQueryOptions } from "@tanstack/react-query"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; export interface CwAdminFactoryReactQuery { client: CwAdminFactoryQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.react-query.ts b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.react-query.ts index d2bcdc8f..fe6add33 100644 --- a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.react-query.ts +++ b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; export interface CwCodeIdRegistryReactQuery { client: CwCodeIdRegistryQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface CwCodeIdRegistryListRegistrationsQuery extends CwCodeIdRegistryReactQuery { args: { diff --git a/__output__/builder/bundler_test/contracts/CwSingle.react-query.ts b/__output__/builder/bundler_test/contracts/CwSingle.react-query.ts index 874561b4..98b118db 100644 --- a/__output__/builder/bundler_test/contracts/CwSingle.react-query.ts +++ b/__output__/builder/bundler_test/contracts/CwSingle.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; import { CwSingleQueryClient } from "./CwSingle.client"; export interface CwSingleReactQuery { client: CwSingleQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface CwSingleInfoQuery extends CwSingleReactQuery {} export function useCwSingleInfoQuery({ diff --git a/__output__/builder/bundler_test/contracts/Factory.react-query.ts b/__output__/builder/bundler_test/contracts/Factory.react-query.ts index 2d40ad5e..0bbeba10 100644 --- a/__output__/builder/bundler_test/contracts/Factory.react-query.ts +++ b/__output__/builder/bundler_test/contracts/Factory.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { FactoryQueryClient } from "./Factory.client"; export interface FactoryReactQuery { client: FactoryQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface FactoryAdminAddrQuery extends FactoryReactQuery {} export function useFactoryAdminAddrQuery({ diff --git a/__output__/builder/bundler_test/contracts/Minter.react-query.ts b/__output__/builder/bundler_test/contracts/Minter.react-query.ts index 007bcfd9..f66f79e3 100644 --- a/__output__/builder/bundler_test/contracts/Minter.react-query.ts +++ b/__output__/builder/bundler_test/contracts/Minter.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; import { MinterQueryClient } from "./Minter.client"; export interface MinterReactQuery { client: MinterQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface MinterMintCountQuery extends MinterReactQuery { args: { diff --git a/__output__/builder/default/CwAdminFactory.react-query.ts b/__output__/builder/default/CwAdminFactory.react-query.ts index be2aa1b7..3a3014d7 100644 --- a/__output__/builder/default/CwAdminFactory.react-query.ts +++ b/__output__/builder/default/CwAdminFactory.react-query.ts @@ -4,10 +4,12 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions } from "react-query"; +import { UseQueryOptions } from "@tanstack/react-query"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; export interface CwAdminFactoryReactQuery { client: CwAdminFactoryQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } \ No newline at end of file diff --git a/__output__/builder/default/CwCodeIdRegistry.react-query.ts b/__output__/builder/default/CwCodeIdRegistry.react-query.ts index d2bcdc8f..fe6add33 100644 --- a/__output__/builder/default/CwCodeIdRegistry.react-query.ts +++ b/__output__/builder/default/CwCodeIdRegistry.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; export interface CwCodeIdRegistryReactQuery { client: CwCodeIdRegistryQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface CwCodeIdRegistryListRegistrationsQuery extends CwCodeIdRegistryReactQuery { args: { diff --git a/__output__/builder/default/CwSingle.react-query.ts b/__output__/builder/default/CwSingle.react-query.ts index 874561b4..98b118db 100644 --- a/__output__/builder/default/CwSingle.react-query.ts +++ b/__output__/builder/default/CwSingle.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; import { CwSingleQueryClient } from "./CwSingle.client"; export interface CwSingleReactQuery { client: CwSingleQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface CwSingleInfoQuery extends CwSingleReactQuery {} export function useCwSingleInfoQuery({ diff --git a/__output__/builder/default/Factory.react-query.ts b/__output__/builder/default/Factory.react-query.ts index 2d40ad5e..0bbeba10 100644 --- a/__output__/builder/default/Factory.react-query.ts +++ b/__output__/builder/default/Factory.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { FactoryQueryClient } from "./Factory.client"; export interface FactoryReactQuery { client: FactoryQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface FactoryAdminAddrQuery extends FactoryReactQuery {} export function useFactoryAdminAddrQuery({ diff --git a/__output__/builder/default/Minter.react-query.ts b/__output__/builder/default/Minter.react-query.ts index 007bcfd9..f66f79e3 100644 --- a/__output__/builder/default/Minter.react-query.ts +++ b/__output__/builder/default/Minter.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; import { MinterQueryClient } from "./Minter.client"; export interface MinterReactQuery { client: MinterQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface MinterMintCountQuery extends MinterReactQuery { args: { diff --git a/__output__/builder/invoke/CwAdminFactory.react-query.ts b/__output__/builder/invoke/CwAdminFactory.react-query.ts index be2aa1b7..3a3014d7 100644 --- a/__output__/builder/invoke/CwAdminFactory.react-query.ts +++ b/__output__/builder/invoke/CwAdminFactory.react-query.ts @@ -4,10 +4,12 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions } from "react-query"; +import { UseQueryOptions } from "@tanstack/react-query"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; export interface CwAdminFactoryReactQuery { client: CwAdminFactoryQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } \ No newline at end of file diff --git a/__output__/builder/invoke/CwCodeIdRegistry.react-query.ts b/__output__/builder/invoke/CwCodeIdRegistry.react-query.ts index d2bcdc8f..fe6add33 100644 --- a/__output__/builder/invoke/CwCodeIdRegistry.react-query.ts +++ b/__output__/builder/invoke/CwCodeIdRegistry.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; export interface CwCodeIdRegistryReactQuery { client: CwCodeIdRegistryQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface CwCodeIdRegistryListRegistrationsQuery extends CwCodeIdRegistryReactQuery { args: { diff --git a/__output__/builder/invoke/CwSingle.react-query.ts b/__output__/builder/invoke/CwSingle.react-query.ts index 874561b4..98b118db 100644 --- a/__output__/builder/invoke/CwSingle.react-query.ts +++ b/__output__/builder/invoke/CwSingle.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; import { CwSingleQueryClient } from "./CwSingle.client"; export interface CwSingleReactQuery { client: CwSingleQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface CwSingleInfoQuery extends CwSingleReactQuery {} export function useCwSingleInfoQuery({ diff --git a/__output__/builder/invoke/Factory.react-query.ts b/__output__/builder/invoke/Factory.react-query.ts index 2d40ad5e..0bbeba10 100644 --- a/__output__/builder/invoke/Factory.react-query.ts +++ b/__output__/builder/invoke/Factory.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { FactoryQueryClient } from "./Factory.client"; export interface FactoryReactQuery { client: FactoryQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface FactoryAdminAddrQuery extends FactoryReactQuery {} export function useFactoryAdminAddrQuery({ diff --git a/__output__/builder/invoke/Minter.react-query.ts b/__output__/builder/invoke/Minter.react-query.ts index 007bcfd9..f66f79e3 100644 --- a/__output__/builder/invoke/Minter.react-query.ts +++ b/__output__/builder/invoke/Minter.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; import { MinterQueryClient } from "./Minter.client"; export interface MinterReactQuery { client: MinterQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface MinterMintCountQuery extends MinterReactQuery { args: { diff --git a/__output__/builder/no-extends/CwAdminFactory.react-query.ts b/__output__/builder/no-extends/CwAdminFactory.react-query.ts index be2aa1b7..3a3014d7 100644 --- a/__output__/builder/no-extends/CwAdminFactory.react-query.ts +++ b/__output__/builder/no-extends/CwAdminFactory.react-query.ts @@ -4,10 +4,12 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions } from "react-query"; +import { UseQueryOptions } from "@tanstack/react-query"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; export interface CwAdminFactoryReactQuery { client: CwAdminFactoryQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } \ No newline at end of file diff --git a/__output__/builder/no-extends/CwCodeIdRegistry.react-query.ts b/__output__/builder/no-extends/CwCodeIdRegistry.react-query.ts index d2bcdc8f..fe6add33 100644 --- a/__output__/builder/no-extends/CwCodeIdRegistry.react-query.ts +++ b/__output__/builder/no-extends/CwCodeIdRegistry.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; export interface CwCodeIdRegistryReactQuery { client: CwCodeIdRegistryQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface CwCodeIdRegistryListRegistrationsQuery extends CwCodeIdRegistryReactQuery { args: { diff --git a/__output__/builder/no-extends/CwSingle.react-query.ts b/__output__/builder/no-extends/CwSingle.react-query.ts index 874561b4..98b118db 100644 --- a/__output__/builder/no-extends/CwSingle.react-query.ts +++ b/__output__/builder/no-extends/CwSingle.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; import { CwSingleQueryClient } from "./CwSingle.client"; export interface CwSingleReactQuery { client: CwSingleQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface CwSingleInfoQuery extends CwSingleReactQuery {} export function useCwSingleInfoQuery({ diff --git a/__output__/builder/no-extends/Factory.react-query.ts b/__output__/builder/no-extends/Factory.react-query.ts index 2d40ad5e..0bbeba10 100644 --- a/__output__/builder/no-extends/Factory.react-query.ts +++ b/__output__/builder/no-extends/Factory.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { FactoryQueryClient } from "./Factory.client"; export interface FactoryReactQuery { client: FactoryQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface FactoryAdminAddrQuery extends FactoryReactQuery {} export function useFactoryAdminAddrQuery({ diff --git a/__output__/builder/no-extends/Minter.react-query.ts b/__output__/builder/no-extends/Minter.react-query.ts index 007bcfd9..f66f79e3 100644 --- a/__output__/builder/no-extends/Minter.react-query.ts +++ b/__output__/builder/no-extends/Minter.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; import { MinterQueryClient } from "./Minter.client"; export interface MinterReactQuery { client: MinterQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface MinterMintCountQuery extends MinterReactQuery { args: { diff --git a/__output__/daodao/cw-admin-factory/CwAdminFactory.react-query.ts b/__output__/daodao/cw-admin-factory/CwAdminFactory.react-query.ts index be2aa1b7..3a3014d7 100644 --- a/__output__/daodao/cw-admin-factory/CwAdminFactory.react-query.ts +++ b/__output__/daodao/cw-admin-factory/CwAdminFactory.react-query.ts @@ -4,10 +4,12 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions } from "react-query"; +import { UseQueryOptions } from "@tanstack/react-query"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; import { CwAdminFactoryQueryClient } from "./CwAdminFactory.client"; export interface CwAdminFactoryReactQuery { client: CwAdminFactoryQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } \ No newline at end of file diff --git a/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.react-query.ts b/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.react-query.ts index d2bcdc8f..fe6add33 100644 --- a/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.react-query.ts +++ b/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; import { CwCodeIdRegistryQueryClient } from "./CwCodeIdRegistry.client"; export interface CwCodeIdRegistryReactQuery { client: CwCodeIdRegistryQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface CwCodeIdRegistryListRegistrationsQuery extends CwCodeIdRegistryReactQuery { args: { diff --git a/__output__/daodao/cw-named-groups/CwNamedGroups.react-query.ts b/__output__/daodao/cw-named-groups/CwNamedGroups.react-query.ts index f50712b2..74e31da2 100644 --- a/__output__/daodao/cw-named-groups/CwNamedGroups.react-query.ts +++ b/__output__/daodao/cw-named-groups/CwNamedGroups.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { DumpResponse, Group, ExecuteMsg, InstantiateMsg, Addr, ListAddressesResponse, ListGroupsResponse, QueryMsg } from "./CwNamedGroups.types"; import { CwNamedGroupsQueryClient } from "./CwNamedGroups.client"; export interface CwNamedGroupsReactQuery { client: CwNamedGroupsQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface CwNamedGroupsIsAddressInGroupQuery extends CwNamedGroupsReactQuery { args: { diff --git a/__output__/daodao/cw-proposal-single/CwProposalSingle.react-query.ts b/__output__/daodao/cw-proposal-single/CwProposalSingle.react-query.ts index d9c0a85e..0e5b4357 100644 --- a/__output__/daodao/cw-proposal-single/CwProposalSingle.react-query.ts +++ b/__output__/daodao/cw-proposal-single/CwProposalSingle.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwProposalSingle.types"; import { CwProposalSingleQueryClient } from "./CwProposalSingle.client"; export interface CwProposalSingleReactQuery { client: CwProposalSingleQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface CwProposalSingleInfoQuery extends CwProposalSingleReactQuery {} export function useCwProposalSingleInfoQuery({ diff --git a/__output__/idl-version/accounts-nft/AccountsNft.react-query.ts b/__output__/idl-version/accounts-nft/AccountsNft.react-query.ts index 641b624b..87c16e6b 100644 --- a/__output__/idl-version/accounts-nft/AccountsNft.react-query.ts +++ b/__output__/idl-version/accounts-nft/AccountsNft.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, VaultBaseForString, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, String, TokensResponse, ArrayOfVaultBaseForString, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse } from "./AccountsNft.types"; import { AccountsNftQueryClient } from "./AccountsNft.client"; export interface AccountsNftReactQuery { client: AccountsNftQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface AccountsNftMinterQuery extends AccountsNftReactQuery {} export function useAccountsNftMinterQuery({ diff --git a/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.react-query.ts b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.react-query.ts index dd485541..4711d0c1 100644 --- a/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.react-query.ts +++ b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { Duration, Threshold, Decimal, InstantiateMsg, Voter, ExecuteMsg, Expiration, Timestamp, Uint64, CosmosMsgForEmpty, BankMsg, Uint128, StakingMsg, DistributionMsg, WasmMsg, Binary, Vote, Coin, Empty, QueryMsg, Status, ThresholdResponse, ProposalListResponse, ProposalResponseForEmpty, VoterListResponse, VoterDetail, VoteListResponse, VoteInfo, VoteResponse, VoterResponse } from "./Cw3FixedMultiSig.types"; import { Cw3FixedMultiSigQueryClient } from "./Cw3FixedMultiSig.client"; export interface Cw3FixedMultiSigReactQuery { client: Cw3FixedMultiSigQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface Cw3FixedMultiSigListVotersQuery extends Cw3FixedMultiSigReactQuery { args: { diff --git a/__output__/idl-version/cw4-group/Cw4Group.react-query.ts b/__output__/idl-version/cw4-group/Cw4Group.react-query.ts index c6773c81..8fa81170 100644 --- a/__output__/idl-version/cw4-group/Cw4Group.react-query.ts +++ b/__output__/idl-version/cw4-group/Cw4Group.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { InstantiateMsg, Member, ExecuteMsg, QueryMsg, AdminResponse, HooksResponse, MemberListResponse, MemberResponse, TotalWeightResponse } from "./Cw4Group.types"; import { Cw4GroupQueryClient } from "./Cw4Group.client"; export interface Cw4GroupReactQuery { client: Cw4GroupQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface Cw4GroupHooksQuery extends Cw4GroupReactQuery {} export function useCw4GroupHooksQuery({ diff --git a/__output__/idl-version/cyberpunk/CyberPunk.react-query.ts b/__output__/idl-version/cyberpunk/CyberPunk.react-query.ts index 37307588..c1d11e8d 100644 --- a/__output__/idl-version/cyberpunk/CyberPunk.react-query.ts +++ b/__output__/idl-version/cyberpunk/CyberPunk.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { InstantiateMsg, ExecuteMsg, QueryMsg, Timestamp, Uint64, Addr, Env, BlockInfo, ContractInfo, TransactionInfo } from "./CyberPunk.types"; import { CyberPunkQueryClient } from "./CyberPunk.client"; export interface CyberPunkReactQuery { client: CyberPunkQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface CyberPunkMirrorEnvQuery extends CyberPunkReactQuery {} export function useCyberPunkMirrorEnvQuery({ diff --git a/__output__/idl-version/hackatom/HackAtom.react-query.ts b/__output__/idl-version/hackatom/HackAtom.react-query.ts index 549016db..815a0759 100644 --- a/__output__/idl-version/hackatom/HackAtom.react-query.ts +++ b/__output__/idl-version/hackatom/HackAtom.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, SudoMsg, Uint128, Coin, IntResponse, AllBalanceResponse, Binary, RecurseResponse, VerifierResponse } from "./HackAtom.types"; import { HackAtomQueryClient } from "./HackAtom.client"; export interface HackAtomReactQuery { client: HackAtomQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface HackAtomGetIntQuery extends HackAtomReactQuery {} export function useHackAtomGetIntQuery({ diff --git a/__output__/minter/Minter.react-query.ts b/__output__/minter/Minter.react-query.ts index 007bcfd9..f66f79e3 100644 --- a/__output__/minter/Minter.react-query.ts +++ b/__output__/minter/Minter.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; import { MinterQueryClient } from "./Minter.client"; export interface MinterReactQuery { client: MinterQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface MinterMintCountQuery extends MinterReactQuery { args: { diff --git a/__output__/sg721-updatable/Sg721Updatable.react-query.ts b/__output__/sg721-updatable/Sg721Updatable.react-query.ts index f0795d29..c45bbcb6 100644 --- a/__output__/sg721-updatable/Sg721Updatable.react-query.ts +++ b/__output__/sg721-updatable/Sg721Updatable.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { Expiration, Timestamp, Uint64, AllNftInfoResponse, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, AllOperatorsResponse, AllTokensResponse, ApprovalResponse, ApprovalsResponse, Decimal, CollectionInfoResponse, RoyaltyInfoResponse, ContractInfoResponse, ExecuteMsgForNullable_EmptyAndEmpty, Binary, UpdateCollectionInfoMsgForRoyaltyInfoResponse, InstantiateMsg, CollectionInfoForRoyaltyInfoResponse, MinterResponse, NftInfoResponse, NumTokensResponse, QueryMsg, TokensResponse } from "./Sg721Updatable.types"; import { Sg721UpdatableQueryClient } from "./Sg721Updatable.client"; export interface Sg721UpdatableReactQuery { client: Sg721UpdatableQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface Sg721UpdatableCollectionInfoQuery extends Sg721UpdatableReactQuery {} export function useSg721UpdatableCollectionInfoQuery({ diff --git a/__output__/sg721/Sg721.react-query.ts b/__output__/sg721/Sg721.react-query.ts index 3a62ccbf..d575ea1e 100644 --- a/__output__/sg721/Sg721.react-query.ts +++ b/__output__/sg721/Sg721.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { Expiration, Timestamp, Uint64, AllNftInfoResponse, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, AllOperatorsResponse, AllTokensResponse, ApprovalResponse, ApprovalsResponse, Decimal, CollectionInfoResponse, RoyaltyInfoResponse, ContractInfoResponse, ExecuteMsgForEmpty, Binary, MintMsgForEmpty, InstantiateMsg, CollectionInfoForRoyaltyInfoResponse, MinterResponse, NftInfoResponse, NumTokensResponse, OperatorsResponse, QueryMsg, TokensResponse } from "./Sg721.types"; import { Sg721QueryClient } from "./Sg721.client"; export interface Sg721ReactQuery { client: Sg721QueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface Sg721CollectionInfoQuery extends Sg721ReactQuery {} export function useSg721CollectionInfoQuery({ diff --git a/__output__/vectis/factory-optional-client/Factory.react-query.ts b/__output__/vectis/factory-optional-client/Factory.react-query.ts index d4ae40f0..1f00b810 100644 --- a/__output__/vectis/factory-optional-client/Factory.react-query.ts +++ b/__output__/vectis/factory-optional-client/Factory.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { FactoryQueryClient } from "./Factory.client"; export interface FactoryReactQuery { client: FactoryQueryClient | undefined; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface FactoryAdminAddrQuery extends FactoryReactQuery {} export function useFactoryAdminAddrQuery({ diff --git a/__output__/vectis/factory-query-keys-optional-client/Factory.react-query.ts b/__output__/vectis/factory-query-keys-optional-client/Factory.react-query.ts index 1e598df4..812d7ffc 100644 --- a/__output__/vectis/factory-query-keys-optional-client/Factory.react-query.ts +++ b/__output__/vectis/factory-query-keys-optional-client/Factory.react-query.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { FactoryQueryClient } from "./Factory.client"; export const factoryQueryKeys = { @@ -41,7 +41,9 @@ export const factoryQueryKeys = { }; export interface FactoryReactQuery { client: FactoryQueryClient | undefined; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface FactoryAdminAddrQuery extends FactoryReactQuery {} export function useFactoryAdminAddrQuery({ diff --git a/__output__/vectis/factory-query-keys/Factory.react-query.ts b/__output__/vectis/factory-query-keys/Factory.react-query.ts index 83c13696..f49b6b05 100644 --- a/__output__/vectis/factory-query-keys/Factory.react-query.ts +++ b/__output__/vectis/factory-query-keys/Factory.react-query.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { FactoryQueryClient } from "./Factory.client"; export const factoryQueryKeys = { @@ -109,7 +109,9 @@ export const factoryQueries = { }; export interface FactoryReactQuery { client: FactoryQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface FactoryAdminAddrQuery extends FactoryReactQuery {} export function useFactoryAdminAddrQuery({ diff --git a/__output__/vectis/factory/Factory.react-query.ts b/__output__/vectis/factory/Factory.react-query.ts index 2d40ad5e..0bbeba10 100644 --- a/__output__/vectis/factory/Factory.react-query.ts +++ b/__output__/vectis/factory/Factory.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { FactoryQueryClient } from "./Factory.client"; export interface FactoryReactQuery { client: FactoryQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface FactoryAdminAddrQuery extends FactoryReactQuery {} export function useFactoryAdminAddrQuery({ diff --git a/__output__/vectis/govec/Govec.react-query.ts b/__output__/vectis/govec/Govec.react-query.ts index 88d2ed1f..f9325d4e 100644 --- a/__output__/vectis/govec/Govec.react-query.ts +++ b/__output__/vectis/govec/Govec.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { CanExecuteRelayResponse, CosmosMsgForEmpty, BankMsg, Uint128, StakingMsg, DistributionMsg, WasmMsg, Binary, Coin, Empty, ExecuteMsgForEmpty, Addr, RelayTransaction, Guardians, MultiSig, InfoResponse, ContractVersion, InstantiateMsg, CreateWalletMsg, QueryMsg, Uint64 } from "./Govec.types"; import { GovecQueryClient } from "./Govec.client"; export interface GovecReactQuery { client: GovecQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface GovecCanExecuteRelayQuery extends GovecReactQuery { args: { diff --git a/__output__/vectis/proxy/Proxy.react-query.ts b/__output__/vectis/proxy/Proxy.react-query.ts index a6fc6d41..1fa04415 100644 --- a/__output__/vectis/proxy/Proxy.react-query.ts +++ b/__output__/vectis/proxy/Proxy.react-query.ts @@ -4,12 +4,14 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions, useQuery } from "react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; import { CanExecuteRelayResponse, CosmosMsgForEmpty, BankMsg, Uint128, StakingMsg, DistributionMsg, WasmMsg, Binary, Coin, Empty, ExecuteMsgForEmpty, Addr, RelayTransaction, Guardians, MultiSig, InfoResponse, ContractVersion, InstantiateMsg, CreateWalletMsg, QueryMsg, Uint64 } from "./Proxy.types"; import { ProxyQueryClient } from "./Proxy.client"; export interface ProxyReactQuery { client: ProxyQueryClient; - options?: UseQueryOptions; + options?: Omit, "'queryKey' | 'queryFn' | 'initialData'"> & { + initialData?: undefined; + }; } export interface ProxyCanExecuteRelayQuery extends ProxyReactQuery { args: { diff --git a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap index 1450280c..d7f5762d 100644 --- a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap +++ b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap @@ -30,7 +30,7 @@ TSBuilder { "mutations": false, "optionalClient": false, "queryKeys": false, - "version": "v3", + "version": "v4", }, "recoil": Object { "enabled": false, @@ -68,7 +68,7 @@ TSBuilder { "mutations": false, "optionalClient": false, "queryKeys": false, - "version": "v3", + "version": "v4", }, "recoil": Object { "enabled": false, @@ -107,7 +107,7 @@ TSBuilder { "mutations": false, "optionalClient": false, "queryKeys": false, - "version": "v3", + "version": "v4", }, "recoil": Object { "enabled": false, @@ -146,7 +146,7 @@ TSBuilder { "mutations": false, "optionalClient": false, "queryKeys": false, - "version": "v3", + "version": "v4", }, "recoil": Object { "enabled": false, @@ -185,7 +185,7 @@ TSBuilder { "mutations": false, "optionalClient": false, "queryKeys": false, - "version": "v3", + "version": "v4", }, "recoil": Object { "enabled": false, @@ -224,7 +224,7 @@ TSBuilder { "mutations": false, "optionalClient": false, "queryKeys": false, - "version": "v3", + "version": "v4", }, "recoil": Object { "enabled": false, @@ -265,7 +265,7 @@ TSBuilder { "mutations": false, "optionalClient": false, "queryKeys": false, - "version": "v3", + "version": "v4", }, "recoil": Object { "enabled": false, @@ -304,7 +304,7 @@ TSBuilder { "mutations": false, "optionalClient": false, "queryKeys": false, - "version": "v3", + "version": "v4", }, "recoil": Object { "enabled": false, @@ -355,7 +355,7 @@ TSBuilder { "mutations": false, "optionalClient": false, "queryKeys": false, - "version": "v3", + "version": "v4", }, "recoil": Object { "enabled": false, @@ -393,7 +393,7 @@ TSBuilder { "mutations": false, "optionalClient": false, "queryKeys": false, - "version": "v3", + "version": "v4", }, "recoil": Object { "enabled": false, @@ -432,7 +432,7 @@ TSBuilder { "mutations": false, "optionalClient": false, "queryKeys": false, - "version": "v3", + "version": "v4", }, "recoil": Object { "enabled": false, @@ -471,7 +471,7 @@ TSBuilder { "mutations": false, "optionalClient": false, "queryKeys": false, - "version": "v3", + "version": "v4", }, "recoil": Object { "enabled": false, @@ -510,7 +510,7 @@ TSBuilder { "mutations": false, "optionalClient": false, "queryKeys": false, - "version": "v3", + "version": "v4", }, "recoil": Object { "enabled": false, @@ -549,7 +549,7 @@ TSBuilder { "mutations": false, "optionalClient": false, "queryKeys": false, - "version": "v3", + "version": "v4", }, "recoil": Object { "enabled": false, @@ -590,7 +590,7 @@ TSBuilder { "mutations": false, "optionalClient": false, "queryKeys": false, - "version": "v3", + "version": "v4", }, "recoil": Object { "enabled": false, @@ -629,7 +629,7 @@ TSBuilder { "mutations": false, "optionalClient": false, "queryKeys": false, - "version": "v3", + "version": "v4", }, "recoil": Object { "enabled": false, From 14b6ad96c879b82747fc1462ffa34ca86dbfb929 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 9 Aug 2023 15:33:32 -0700 Subject: [PATCH 167/287] readme --- README.md | 14 +++++++++----- packages/ts-codegen/README.md | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 8843fcae..fb62421c 100644 --- a/README.md +++ b/README.md @@ -317,16 +317,20 @@ export default function YourComponent() { }; ``` -If you're using Babel, please make sure include '@babel/preset-react' in devDeps and presets in .babelrc.js: +#### Use Contracts Provider Babel/TSC config + +If you're using Babel, please make sure include `'@babel/preset-react'` in devDeps and presets in `.babelrc.js`: ```js presets: [ - '@babel/typescript', - '@babel/env', - '@babel/preset-react', - ] + '@babel/typescript', + '@babel/env', + '@babel/preset-react', + ] ``` +For `tsc`, you should set the `jsx` option to `'react'` in your `tsconfig.json`. + #### Use Contracts Hooks Usage Once enabled, you can get contracts very simply: diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index 8843fcae..fb62421c 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -317,16 +317,20 @@ export default function YourComponent() { }; ``` -If you're using Babel, please make sure include '@babel/preset-react' in devDeps and presets in .babelrc.js: +#### Use Contracts Provider Babel/TSC config + +If you're using Babel, please make sure include `'@babel/preset-react'` in devDeps and presets in `.babelrc.js`: ```js presets: [ - '@babel/typescript', - '@babel/env', - '@babel/preset-react', - ] + '@babel/typescript', + '@babel/env', + '@babel/preset-react', + ] ``` +For `tsc`, you should set the `jsx` option to `'react'` in your `tsconfig.json`. + #### Use Contracts Hooks Usage Once enabled, you can get contracts very simply: From 6f697e9e9b4f816b793cd286642b3ece3d916779 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 9 Aug 2023 15:33:39 -0700 Subject: [PATCH 168/287] chore(release): publish - @cosmwasm/ts-codegen@0.35.2 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 64602698..347f65b5 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.35.2](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.35.1...@cosmwasm/ts-codegen@0.35.2) (2023-08-09) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.35.1](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.35.0...@cosmwasm/ts-codegen@0.35.1) (2023-08-09) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 24a8ce9c..7d309ba0 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.35.1", + "version": "0.35.2", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From d84c86cd1cf9bd895cef53dddfbc02969400fd58 Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Fri, 11 Aug 2023 05:36:56 +0800 Subject: [PATCH 169/287] fixed export ContractsConfig fixed undefined issue of getting providerInfo --- .../builder/bundler_test/contracts/contracts-context.tsx | 2 +- __output__/builder/default/contracts-context.tsx | 2 +- packages/ts-codegen/src/helpers/contractsContextTSX.ts | 2 +- packages/ts-codegen/src/plugins/provider-bundle.ts | 2 +- packages/ts-codegen/src/plugins/provider.ts | 2 +- packages/ts-codegen/types/src/builder/builder.d.ts | 4 ++-- .../ts-codegen/types/src/helpers/contractsContextTSX.d.ts | 2 +- packages/wasm-ast-types/types/context/imports.d.ts | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/__output__/builder/bundler_test/contracts/contracts-context.tsx b/__output__/builder/bundler_test/contracts/contracts-context.tsx index d972e515..74cb9c9f 100644 --- a/__output__/builder/bundler_test/contracts/contracts-context.tsx +++ b/__output__/builder/bundler_test/contracts/contracts-context.tsx @@ -13,7 +13,7 @@ import { import { IContractsContext, getProviders } from './contractContextProviders'; -interface ContractsConfig { +export interface ContractsConfig { address: string | undefined; getCosmWasmClient: () => Promise; getSigningCosmWasmClient: () => Promise; diff --git a/__output__/builder/default/contracts-context.tsx b/__output__/builder/default/contracts-context.tsx index d972e515..74cb9c9f 100644 --- a/__output__/builder/default/contracts-context.tsx +++ b/__output__/builder/default/contracts-context.tsx @@ -13,7 +13,7 @@ import { import { IContractsContext, getProviders } from './contractContextProviders'; -interface ContractsConfig { +export interface ContractsConfig { address: string | undefined; getCosmWasmClient: () => Promise; getSigningCosmWasmClient: () => Promise; diff --git a/packages/ts-codegen/src/helpers/contractsContextTSX.ts b/packages/ts-codegen/src/helpers/contractsContextTSX.ts index 03a439b6..a247f243 100644 --- a/packages/ts-codegen/src/helpers/contractsContextTSX.ts +++ b/packages/ts-codegen/src/helpers/contractsContextTSX.ts @@ -7,7 +7,7 @@ import { import { IContractsContext, getProviders } from './contractContextProviders'; -interface ContractsConfig { +export interface ContractsConfig { address: string | undefined; getCosmWasmClient: () => Promise; getSigningCosmWasmClient: () => Promise; diff --git a/packages/ts-codegen/src/plugins/provider-bundle.ts b/packages/ts-codegen/src/plugins/provider-bundle.ts index 7be51f1f..c99fa255 100644 --- a/packages/ts-codegen/src/plugins/provider-bundle.ts +++ b/packages/ts-codegen/src/plugins/provider-bundle.ts @@ -42,7 +42,7 @@ export class ContractsProviderBundlePlugin extends BuilderPluginBase(...args: any[]) => (context: TContext) => ImportObj); -export type UtilMapping = { +export declare type GetUtilFn = ((...args: any[]) => (context: TContext) => ImportObj); +export declare type UtilMapping = { [key: string]: ImportObj | string | GetUtilFn; }; export declare const UTILS: { From 0d12e6ff8339a16ab021c172fc91a31d95fb2c66 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Thu, 10 Aug 2023 20:00:00 -0700 Subject: [PATCH 170/287] chore(release): publish - @cosmwasm/ts-codegen@0.35.3 - wasm-ast-types@0.26.2 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 347f65b5..6f3f0ae5 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.35.3](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.35.2...@cosmwasm/ts-codegen@0.35.3) (2023-08-11) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.35.2](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.35.1...@cosmwasm/ts-codegen@0.35.2) (2023-08-09) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 7d309ba0..99536047 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.35.2", + "version": "0.35.3", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.26.1" + "wasm-ast-types": "^0.26.2" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 502ef01c..7efa9ac0 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.26.2](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.26.1...wasm-ast-types@0.26.2) (2023-08-11) + +**Note:** Version bump only for package wasm-ast-types + + + + + ## [0.26.1](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.26.0...wasm-ast-types@0.26.1) (2023-08-09) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index a5a31ad4..01b0fb22 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.26.1", + "version": "0.26.2", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From cf673f09e2095395e5c20802457e760dde43343d Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Thu, 18 Jan 2024 18:35:12 -0800 Subject: [PATCH 171/287] readme --- README.md | 2 +- packages/ts-codegen/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fb62421c..87476002 100644 --- a/README.md +++ b/README.md @@ -643,5 +643,5 @@ Checkout these related projects: ## Credits -🛠 Built by Cosmology — if you like our tools, please consider delegating to [our validator ⚛️](https://cosmology.tech/validator) +🛠 Built by Cosmology — if you like our tools, please consider delegating to [our validator ⚛️](https://cosmology.zone/validator) diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index fb62421c..87476002 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -643,5 +643,5 @@ Checkout these related projects: ## Credits -🛠 Built by Cosmology — if you like our tools, please consider delegating to [our validator ⚛️](https://cosmology.tech/validator) +🛠 Built by Cosmology — if you like our tools, please consider delegating to [our validator ⚛️](https://cosmology.zone/validator) From 9fb8bedb57a14c3e4f2a3a700e0cc39549197cd5 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Thu, 18 Jan 2024 18:40:50 -0800 Subject: [PATCH 172/287] chore(release): publish - @cosmwasm/ts-codegen@0.35.4 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 6f3f0ae5..edae4c0a 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.35.4](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.35.3...@cosmwasm/ts-codegen@0.35.4) (2024-01-19) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.35.3](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.35.2...@cosmwasm/ts-codegen@0.35.3) (2023-08-11) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 99536047..a6e7fe3f 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.35.3", + "version": "0.35.4", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From fbf5dc5a515de26279577cf6da20b907afacf696 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Thu, 18 Jan 2024 21:03:17 -0800 Subject: [PATCH 173/287] readme --- README.md | 4 ++-- packages/ts-codegen/README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 87476002..e9e8a9ef 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,7 @@ Generate [react-query v3](https://react-query-v3.tanstack.com/) or [react-query #### React Query Options | option | description | -| --------------------------- | --------------------------------------------------------------------------- | +| --------------------------- | ---------------------------------------------------------------------------- | | `reactQuery.enabled` | enable the react-query plugin | | `reactQuery.optionalClient` | allows contract client to be undefined as the component renders | | `reactQuery.queryKeys` | generates a const queryKeys object for use with invalidations and set values | @@ -374,7 +374,7 @@ const { CwAdminFactoryClient } = contracts.CwAdminFactory; #### Coding Style | option | description | default | -| --------------------- | ---------------------------------------------- | +| --------------------- | ------------------------------------ | ------- | | `useShorthandCtor` | Enable using shorthand constructor. | true | Using shorthand constructor (Might not be transpiled correctly with babel): diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index 87476002..e9e8a9ef 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -179,7 +179,7 @@ Generate [react-query v3](https://react-query-v3.tanstack.com/) or [react-query #### React Query Options | option | description | -| --------------------------- | --------------------------------------------------------------------------- | +| --------------------------- | ---------------------------------------------------------------------------- | | `reactQuery.enabled` | enable the react-query plugin | | `reactQuery.optionalClient` | allows contract client to be undefined as the component renders | | `reactQuery.queryKeys` | generates a const queryKeys object for use with invalidations and set values | @@ -374,7 +374,7 @@ const { CwAdminFactoryClient } = contracts.CwAdminFactory; #### Coding Style | option | description | default | -| --------------------- | ---------------------------------------------- | +| --------------------- | ------------------------------------ | ------- | | `useShorthandCtor` | Enable using shorthand constructor. | true | Using shorthand constructor (Might not be transpiled correctly with babel): From aee116c0cab9c73e50eb6fdbee1edacc06791b8a Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Thu, 18 Jan 2024 21:03:24 -0800 Subject: [PATCH 174/287] chore(release): publish - @cosmwasm/ts-codegen@0.35.5 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index edae4c0a..27b4f8b4 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.35.5](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.35.4...@cosmwasm/ts-codegen@0.35.5) (2024-01-19) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.35.4](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.35.3...@cosmwasm/ts-codegen@0.35.4) (2024-01-19) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index a6e7fe3f..14aca704 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.35.4", + "version": "0.35.5", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", From 970c13e9a99287227b9adec06cb632337bc1dd55 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Thu, 18 Jan 2024 21:13:58 -0800 Subject: [PATCH 175/287] license --- LICENSE-Apache | 2 +- packages/ts-codegen/LICENSE-Apache | 2 +- packages/ts-codegen/LICENSE-MIT | 2 +- packages/wasm-ast-types/LICENSE-Apache | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/LICENSE-Apache b/LICENSE-Apache index ce3fa7bf..9acc9b1b 100644 --- a/LICENSE-Apache +++ b/LICENSE-Apache @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2022 Dan Lynch +Copyright (c) 2024 Web, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/packages/ts-codegen/LICENSE-Apache b/packages/ts-codegen/LICENSE-Apache index ce3fa7bf..9acc9b1b 100644 --- a/packages/ts-codegen/LICENSE-Apache +++ b/packages/ts-codegen/LICENSE-Apache @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2022 Dan Lynch +Copyright (c) 2024 Web, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/packages/ts-codegen/LICENSE-MIT b/packages/ts-codegen/LICENSE-MIT index e6388ba7..5a949f08 100644 --- a/packages/ts-codegen/LICENSE-MIT +++ b/packages/ts-codegen/LICENSE-MIT @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Dan Lynch +Copyright (c) 2024 Web, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/wasm-ast-types/LICENSE-Apache b/packages/wasm-ast-types/LICENSE-Apache index ce3fa7bf..9acc9b1b 100644 --- a/packages/wasm-ast-types/LICENSE-Apache +++ b/packages/wasm-ast-types/LICENSE-Apache @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2022 Dan Lynch +Copyright (c) 2024 Web, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From dfa17766765676da28c11922b711cd65aa6306ee Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Thu, 18 Jan 2024 21:14:04 -0800 Subject: [PATCH 176/287] chore(release): publish - @cosmwasm/ts-codegen@0.35.6 - wasm-ast-types@0.26.3 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 27b4f8b4..0a296a55 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.35.6](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.35.5...@cosmwasm/ts-codegen@0.35.6) (2024-01-19) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.35.5](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.35.4...@cosmwasm/ts-codegen@0.35.5) (2024-01-19) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 14aca704..78e1d8da 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.35.5", + "version": "0.35.6", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.26.2" + "wasm-ast-types": "^0.26.3" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index 7efa9ac0..a48455e5 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.26.3](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.26.2...wasm-ast-types@0.26.3) (2024-01-19) + +**Note:** Version bump only for package wasm-ast-types + + + + + ## [0.26.2](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.26.1...wasm-ast-types@0.26.2) (2023-08-11) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index 01b0fb22..1b54ccca 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.26.2", + "version": "0.26.3", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From 043124f0075b9d80321dc77482a01a1594acae10 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Thu, 18 Jan 2024 22:33:22 -0800 Subject: [PATCH 177/287] readme --- README.md | 18 +++++++++++++----- packages/ts-codegen/README.md | 18 +++++++++++++----- packages/wasm-ast-types/README.md | 23 +++++++++++++++++++++++ 3 files changed, 49 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e9e8a9ef..8fa7ca5c 100644 --- a/README.md +++ b/README.md @@ -635,13 +635,21 @@ See the [docs](https://github.com/CosmWasm/ts-codegen/blob/main/packages/wasm-as Checkout these related projects: -* [@cosmology/telescope](https://github.com/cosmology-tech/telescope) a "babel for the Cosmos", Telescope is a TypeScript Transpiler for Cosmos Protobufs. -* [chain-registry](https://github.com/cosmology-tech/chain-registry) an npm module for the official Cosmos chain-registry. -* [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) A wallet connector for the Cosmos ⚛️ -* [create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) set up a modern Cosmos app by running one command. -* [starship](https://github.com/cosmology-tech/starship) a k8s-based unified development environment for Cosmos Ecosystem +* [@cosmology/telescope](https://github.com/cosmology-tech/telescope) Your Frontend Companion for Building with TypeScript with Cosmos SDK Modules. +* [@cosmwasm/ts-codegen](https://github.com/CosmWasm/ts-codegen) Convert your CosmWasm smart contracts into dev-friendly TypeScript classes. +* [chain-registry](https://github.com/cosmology-tech/chain-registry) Everything from token symbols, logos, and IBC denominations for all assets you want to support in your application. +* [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) Experience the convenience of connecting with a variety of web3 wallets through a single, streamlined interface. +* [create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) Set up a modern Cosmos app by running one command. +* [interchain-ui](https://github.com/cosmology-tech/interchain-ui) The Interchain Design System, empowering developers with a flexible, easy-to-use UI kit. +* [starship](https://github.com/cosmology-tech/starship) Unified Testing and Development for the Interchain. ## Credits 🛠 Built by Cosmology — if you like our tools, please consider delegating to [our validator ⚛️](https://cosmology.zone/validator) + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED “AS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index e9e8a9ef..8fa7ca5c 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -635,13 +635,21 @@ See the [docs](https://github.com/CosmWasm/ts-codegen/blob/main/packages/wasm-as Checkout these related projects: -* [@cosmology/telescope](https://github.com/cosmology-tech/telescope) a "babel for the Cosmos", Telescope is a TypeScript Transpiler for Cosmos Protobufs. -* [chain-registry](https://github.com/cosmology-tech/chain-registry) an npm module for the official Cosmos chain-registry. -* [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) A wallet connector for the Cosmos ⚛️ -* [create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) set up a modern Cosmos app by running one command. -* [starship](https://github.com/cosmology-tech/starship) a k8s-based unified development environment for Cosmos Ecosystem +* [@cosmology/telescope](https://github.com/cosmology-tech/telescope) Your Frontend Companion for Building with TypeScript with Cosmos SDK Modules. +* [@cosmwasm/ts-codegen](https://github.com/CosmWasm/ts-codegen) Convert your CosmWasm smart contracts into dev-friendly TypeScript classes. +* [chain-registry](https://github.com/cosmology-tech/chain-registry) Everything from token symbols, logos, and IBC denominations for all assets you want to support in your application. +* [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) Experience the convenience of connecting with a variety of web3 wallets through a single, streamlined interface. +* [create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) Set up a modern Cosmos app by running one command. +* [interchain-ui](https://github.com/cosmology-tech/interchain-ui) The Interchain Design System, empowering developers with a flexible, easy-to-use UI kit. +* [starship](https://github.com/cosmology-tech/starship) Unified Testing and Development for the Interchain. ## Credits 🛠 Built by Cosmology — if you like our tools, please consider delegating to [our validator ⚛️](https://cosmology.zone/validator) + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED “AS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. diff --git a/packages/wasm-ast-types/README.md b/packages/wasm-ast-types/README.md index 264ed788..1f1bafac 100644 --- a/packages/wasm-ast-types/README.md +++ b/packages/wasm-ast-types/README.md @@ -128,3 +128,26 @@ export const createNewGenerator = () => { ); }; ``` + +## Related + +Checkout these related projects: + +* [@cosmology/telescope](https://github.com/cosmology-tech/telescope) Your Frontend Companion for Building with TypeScript with Cosmos SDK Modules. +* [@cosmwasm/ts-codegen](https://github.com/CosmWasm/ts-codegen) Convert your CosmWasm smart contracts into dev-friendly TypeScript classes. +* [chain-registry](https://github.com/cosmology-tech/chain-registry) Everything from token symbols, logos, and IBC denominations for all assets you want to support in your application. +* [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) Experience the convenience of connecting with a variety of web3 wallets through a single, streamlined interface. +* [create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) Set up a modern Cosmos app by running one command. +* [interchain-ui](https://github.com/cosmology-tech/interchain-ui) The Interchain Design System, empowering developers with a flexible, easy-to-use UI kit. +* [starship](https://github.com/cosmology-tech/starship) Unified Testing and Development for the Interchain. + +## Credits + +🛠 Built by Cosmology — if you like our tools, please consider delegating to [our validator ⚛️](https://cosmology.zone/validator) + + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED “AS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. From eeba0cf1e0cbadfb6cfc103412108e763fdb9f6a Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Thu, 18 Jan 2024 22:33:26 -0800 Subject: [PATCH 178/287] chore(release): publish - @cosmwasm/ts-codegen@0.35.7 - wasm-ast-types@0.26.4 --- packages/ts-codegen/CHANGELOG.md | 8 ++++++++ packages/ts-codegen/package.json | 4 ++-- packages/wasm-ast-types/CHANGELOG.md | 8 ++++++++ packages/wasm-ast-types/package.json | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/ts-codegen/CHANGELOG.md b/packages/ts-codegen/CHANGELOG.md index 0a296a55..0722d282 100644 --- a/packages/ts-codegen/CHANGELOG.md +++ b/packages/ts-codegen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.35.7](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.35.6...@cosmwasm/ts-codegen@0.35.7) (2024-01-19) + +**Note:** Version bump only for package @cosmwasm/ts-codegen + + + + + ## [0.35.6](https://github.com/cosmwasm/ts-codegen/compare/@cosmwasm/ts-codegen@0.35.5...@cosmwasm/ts-codegen@0.35.6) (2024-01-19) **Note:** Version bump only for package @cosmwasm/ts-codegen diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 78e1d8da..faaf53f4 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -1,6 +1,6 @@ { "name": "@cosmwasm/ts-codegen", - "version": "0.35.6", + "version": "0.35.7", "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.", "author": "Dan Lynch ", "homepage": "https://github.com/cosmwasm/ts-codegen", @@ -96,6 +96,6 @@ "parse-package-name": "1.0.0", "rimraf": "3.0.2", "shelljs": "0.8.5", - "wasm-ast-types": "^0.26.3" + "wasm-ast-types": "^0.26.4" } } diff --git a/packages/wasm-ast-types/CHANGELOG.md b/packages/wasm-ast-types/CHANGELOG.md index a48455e5..6b038db6 100644 --- a/packages/wasm-ast-types/CHANGELOG.md +++ b/packages/wasm-ast-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.26.4](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.26.3...wasm-ast-types@0.26.4) (2024-01-19) + +**Note:** Version bump only for package wasm-ast-types + + + + + ## [0.26.3](https://github.com/pyramation/cosmwasm-typescript-gen/compare/wasm-ast-types@0.26.2...wasm-ast-types@0.26.3) (2024-01-19) **Note:** Version bump only for package wasm-ast-types diff --git a/packages/wasm-ast-types/package.json b/packages/wasm-ast-types/package.json index 1b54ccca..2b95d6f7 100644 --- a/packages/wasm-ast-types/package.json +++ b/packages/wasm-ast-types/package.json @@ -1,6 +1,6 @@ { "name": "wasm-ast-types", - "version": "0.26.3", + "version": "0.26.4", "description": "CosmWasm TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme", From 9b1c0335fc8ab715f739ba7c50e63b5021f26639 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Tue, 16 Apr 2024 18:53:56 -0700 Subject: [PATCH 179/287] updates --- .editorconfig | 12 - .eslintignore | 10 - .eslintrc.json | 39 + .github/workflows/run-tests.yaml | 31 +- .gitignore | 14 +- .prettierrc.json | 6 + .vscode/settings.json | 22 +- .yarn/releases/yarn-1.18.0.cjs | 147155 --------------- .yarnrc | 9 - .yarnrc.yml | 3 - LICENSE-Apache | 2 +- LICENSE-MIT | 2 +- README.md | 4 +- .../accounts-nft/AccountsNft.client.ts | 4 +- .../accounts-nft/AccountsNft.react-query.ts | 2 +- babel.config.js | 4 - lerna.json | 5 +- package.json | 52 +- packages/ts-codegen/.babelrc.js | 14 - packages/ts-codegen/.editorconfig | 12 - packages/ts-codegen/.eslintignore | 5 - packages/ts-codegen/.gitignore | 49 - packages/ts-codegen/.npmignore | 44 - packages/ts-codegen/.npmrc | 1 - packages/ts-codegen/.vscode/settings.json | 18 - packages/ts-codegen/CHANGELOG.md | 128 +- packages/ts-codegen/LICENSE-Apache | 2 +- packages/ts-codegen/LICENSE-MIT | 2 +- packages/ts-codegen/README.md | 4 +- .../__snapshots__/builder.test.ts.snap | 276 +- packages/ts-codegen/__tests__/builder.test.ts | 12 +- packages/ts-codegen/__tests__/bundler.test.ts | 11 +- .../__tests__/ts-codegen.issue-98.test.ts | 29 +- packages/ts-codegen/jest.config.js | 18 + packages/ts-codegen/package.json | 71 +- .../ts-codegen/scripts/{cmds.js => cmds.ts} | 10 +- packages/ts-codegen/src/builder/builder.ts | 29 +- packages/ts-codegen/src/bundler/bundler.ts | 34 +- packages/ts-codegen/src/{cli.js => cli.ts} | 0 packages/ts-codegen/src/{cmds.js => cmds.ts} | 0 .../src/commands/create-boilerplate.ts | 3 +- packages/ts-codegen/src/commands/generate.ts | 5 +- packages/ts-codegen/src/commands/install.ts | 5 +- packages/ts-codegen/src/{file.js => file.ts} | 0 packages/ts-codegen/src/generators/client.ts | 1 + .../src/generators/message-composer.ts | 1 + .../ts-codegen/src/generators/msg-builder.ts | 1 + .../ts-codegen/src/generators/react-query.ts | 1 + packages/ts-codegen/src/generators/recoil.ts | 6 +- packages/ts-codegen/src/generators/types.ts | 1 + .../ts-codegen/src/plugins/plugin-base.ts | 11 +- packages/ts-codegen/src/plugins/provider.ts | 4 +- packages/ts-codegen/src/plugins/recoil.ts | 8 +- .../src/{ts-codegen.js => ts-codegen.ts} | 0 packages/ts-codegen/src/types.ts | 4 + packages/ts-codegen/src/utils/clean.ts | 4 +- packages/ts-codegen/src/utils/cleanse.ts | 12 +- packages/ts-codegen/src/utils/files.ts | 6 +- packages/ts-codegen/src/utils/parse.ts | 14 +- .../src/utils/{prompt.js => prompt.ts} | 1 + packages/ts-codegen/src/utils/schemas.ts | 42 +- packages/ts-codegen/tsconfig.esm.json | 9 + packages/ts-codegen/tsconfig.json | 26 +- .../ts-codegen/types/src/builder/builder.d.ts | 53 - .../ts-codegen/types/src/builder/index.d.ts | 1 - .../ts-codegen/types/src/bundler/bundler.d.ts | 4 - .../ts-codegen/types/src/bundler/index.d.ts | 1 - packages/ts-codegen/types/src/cli.d.ts | 1 - packages/ts-codegen/types/src/cmds.d.ts | 1 - .../src/commands/create-boilerplate.d.ts | 2 - .../types/src/commands/generate.d.ts | 2 - .../types/src/commands/install.d.ts | 2 - packages/ts-codegen/types/src/file.d.ts | 2 - .../types/src/generators/client.d.ts | 5 - .../types/src/generators/create-helpers.d.ts | 3 - .../src/generators/message-composer.d.ts | 5 - .../types/src/generators/msg-builder.d.ts | 5 - .../types/src/generators/msg-builder.ts | 5 - .../types/src/generators/react-query.d.ts | 4 - .../types/src/generators/recoil.d.ts | 4 - .../types/src/generators/types.d.ts | 4 - .../src/helpers/contractContextBase.d.ts | 1 - .../contractContextBaseShortHandCtor.d.ts | 1 - .../src/helpers/contractsContextTSX.d.ts | 1 - .../ts-codegen/types/src/helpers/index.d.ts | 3 - packages/ts-codegen/types/src/index.d.ts | 12 - .../ts-codegen/types/src/plugins/client.d.ts | 13 - .../ts-codegen/types/src/plugins/index.d.ts | 1 - .../types/src/plugins/message-builder.d.ts | 12 - .../types/src/plugins/message-composer.d.ts | 13 - .../types/src/plugins/msg-builder.d.ts | 12 - .../types/src/plugins/plugin-base.d.ts | 51 - .../types/src/plugins/provider-bundle.d.ts | 13 - .../types/src/plugins/provider.d.ts | 15 - .../types/src/plugins/react-query.d.ts | 12 - .../ts-codegen/types/src/plugins/recoil.d.ts | 13 - .../ts-codegen/types/src/plugins/types.d.ts | 12 - .../types/src/plugins/use-contracts.d.ts | 12 - packages/ts-codegen/types/src/ts-codegen.d.ts | 2 - packages/ts-codegen/types/src/types.d.ts | 16 - .../ts-codegen/types/src/utils/clean.d.ts | 1 - .../ts-codegen/types/src/utils/cleanse.d.ts | 1 - .../ts-codegen/types/src/utils/files.d.ts | 3 - .../ts-codegen/types/src/utils/header.d.ts | 1 - .../ts-codegen/types/src/utils/index.d.ts | 1 - .../ts-codegen/types/src/utils/parse.d.ts | 1 - .../ts-codegen/types/src/utils/prompt.d.ts | 3 - .../ts-codegen/types/src/utils/schemas.d.ts | 10 - .../ts-codegen/types/src/utils/unused.d.ts | 5 - .eslintrc.js => packages/types/.eslintrc.js | 7 +- packages/types/LICENSE-Apache | 201 + packages/types/LICENSE-MIT | 21 + packages/types/README.md | 153 + packages/types/jest.config.js | 18 + packages/types/package.json | 74 + packages/types/src/idl.ts | 16 + packages/types/src/index.ts | 2 + packages/types/src/types.ts | 55 + packages/types/tsconfig.esm.json | 9 + packages/types/tsconfig.json | 9 + packages/wasm-ast-types/.babelrc.js | 14 - packages/wasm-ast-types/.editorconfig | 12 - packages/wasm-ast-types/.eslintignore | 5 - packages/wasm-ast-types/.gitignore | 48 - packages/wasm-ast-types/.npmignore | 43 - packages/wasm-ast-types/.npmrc | 1 - packages/wasm-ast-types/.vscode/settings.json | 18 - packages/wasm-ast-types/CHANGELOG.md | 144 +- packages/wasm-ast-types/LICENSE-Apache | 2 +- packages/wasm-ast-types/LICENSE-MIT | 2 +- packages/wasm-ast-types/README.md | 2 +- .../babel/__snapshots__/babel.test.ts.snap} | 0 .../__tests__/babel/babel.test.ts | 483 + .../ts-client.account-nfts.spec.ts.snap | 0 .../ts-client.arrays-ref.spec.ts.snap | 0 .../ts-client.arrays.spec.ts.snap | 0 .../ts-client.cw-named-groups.test.ts.snap | 0 .../ts-client.cw-proposal-single.test.ts.snap | 0 .../ts-client.empty-enums.spec.ts.snap | 0 .../ts-client.issue-101.spec.ts.snap | 0 .../ts-client.issue-103.test.ts.snap | 0 .../ts-client.issue-71.test.ts.snap | 0 .../ts-client.issue-98.test.ts.snap | 0 .../ts-client.issues.test.ts.snap | 0 .../ts-client.overrides.spec.ts.snap | 0 .../ts-client.sg721.spec.ts.snap | 0 .../__snapshots__/ts-client.spec.ts.snap | 0 .../ts-client.vectis.spec.ts.snap | 0 .../ts-client.wager.spec.ts.snap | 0 .../client/ts-client.account-nfts.test.ts | 38 + .../client/ts-client.arrays-ref.test.ts} | 0 .../client/ts-client.arrays.test.ts} | 0 .../client}/ts-client.cw-named-groups.test.ts | 0 .../ts-client.cw-proposal-single.test.ts | 0 .../client/ts-client.empty-enums.test.ts} | 0 .../client/ts-client.issue-101.test.ts} | 0 .../client}/ts-client.issue-103.test.ts | 0 .../client}/ts-client.issue-71.test.ts | 0 .../client}/ts-client.issue-98.test.ts | 0 .../client}/ts-client.issues.test.ts | 0 .../client/ts-client.overrides.test.ts} | 0 .../client/ts-client.sg721.test.ts} | 0 .../client/ts-client.test.ts} | 0 .../__tests__/client/ts-client.vectis.test.ts | 94 + .../client/ts-client.wager.test.ts} | 0 .../message-builder.test.ts.snap} | 0 .../message-builder/message-builder.test.ts} | 0 .../message-composer.test.ts.snap} | 0 .../message-composer.test.ts} | 0 .../__snapshots__/provider.test.ts.snap} | 0 .../__tests__/provider/provider.test.ts | 81 + .../__snapshots__/react-query.test.ts.snap} | 0 .../react-query/react-query.test.ts} | 0 .../recoil/__snapshots__/recoil.test.ts.snap} | 0 .../__tests__/recoil/recoil.test.ts | 35 + packages/wasm-ast-types/jest.config.js | 18 + packages/wasm-ast-types/package.json | 83 +- .../scripts/{test-ast.js => test-ast.ts} | 1 + packages/wasm-ast-types/src/client/client.ts | 10 +- .../test/ts-client.account-nfts.spec.ts | 55 - .../src/client/test/ts-client.vectis.spec.ts | 97 - .../wasm-ast-types/src/context/context.ts | 35 +- .../wasm-ast-types/src/context/imports.ts | 130 +- packages/wasm-ast-types/src/index.ts | 1 - .../src/message-builder/message-builder.ts | 2 +- .../src/message-composer/message-composer.ts | 10 +- .../src/provider/provider.spec.ts | 81 - .../wasm-ast-types/src/provider/provider.ts | 6 +- .../src/react-query/react-query.ts | 87 +- .../wasm-ast-types/src/recoil/recoil.spec.ts | 38 - packages/wasm-ast-types/src/recoil/recoil.ts | 6 +- packages/wasm-ast-types/src/types.ts | 44 - .../wasm-ast-types/src/utils/babel.spec.ts | 511 - packages/wasm-ast-types/src/utils/babel.ts | 66 +- packages/wasm-ast-types/src/utils/ref.ts | 4 +- packages/wasm-ast-types/src/utils/types.ts | 33 +- .../wasm-ast-types/test-utils/fixtures.ts | 17 + packages/wasm-ast-types/test-utils/index.ts | 41 +- packages/wasm-ast-types/test-utils/utils.ts | 42 + packages/wasm-ast-types/tsconfig.esm.json | 9 + packages/wasm-ast-types/tsconfig.json | 27 +- .../wasm-ast-types/types/client/client.d.ts | 15 - .../wasm-ast-types/types/client/index.d.ts | 1 - .../wasm-ast-types/types/context/context.d.ts | 124 - .../wasm-ast-types/types/context/imports.d.ts | 47 - .../wasm-ast-types/types/context/index.d.ts | 2 - packages/wasm-ast-types/types/index.d.ts | 9 - .../types/message-builder/index.d.ts | 1 - .../message-builder/message-builder.d.ts | 4 - .../types/message-composer/index.d.ts | 1 - .../message-composer/message-composer.d.ts | 5 - .../wasm-ast-types/types/provider/index.d.ts | 1 - .../types/provider/provider.d.ts | 18 - .../types/react-query/index.d.ts | 1 - .../types/react-query/react-query.d.ts | 84 - .../wasm-ast-types/types/recoil/index.d.ts | 1 - .../wasm-ast-types/types/recoil/recoil.d.ts | 30 - packages/wasm-ast-types/types/types.d.ts | 41 - .../wasm-ast-types/types/utils/babel.d.ts | 50 - .../wasm-ast-types/types/utils/constants.d.ts | 11 - .../wasm-ast-types/types/utils/index.d.ts | 6 - packages/wasm-ast-types/types/utils/ref.d.ts | 2 - .../wasm-ast-types/types/utils/types.d.ts | 22 - tsconfig.json | 16 + yarn.lock | 8889 +- 225 files changed, 7373 insertions(+), 153704 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintignore create mode 100644 .eslintrc.json create mode 100644 .prettierrc.json delete mode 100755 .yarn/releases/yarn-1.18.0.cjs delete mode 100644 .yarnrc delete mode 100644 .yarnrc.yml delete mode 100644 babel.config.js delete mode 100644 packages/ts-codegen/.babelrc.js delete mode 100644 packages/ts-codegen/.editorconfig delete mode 100644 packages/ts-codegen/.eslintignore delete mode 100644 packages/ts-codegen/.gitignore delete mode 100644 packages/ts-codegen/.npmignore delete mode 100644 packages/ts-codegen/.npmrc delete mode 100644 packages/ts-codegen/.vscode/settings.json create mode 100644 packages/ts-codegen/jest.config.js rename packages/ts-codegen/scripts/{cmds.js => cmds.ts} (83%) rename packages/ts-codegen/src/{cli.js => cli.ts} (100%) rename packages/ts-codegen/src/{cmds.js => cmds.ts} (100%) rename packages/ts-codegen/src/{file.js => file.ts} (100%) rename packages/ts-codegen/src/{ts-codegen.js => ts-codegen.ts} (100%) create mode 100644 packages/ts-codegen/src/types.ts rename packages/ts-codegen/src/utils/{prompt.js => prompt.ts} (99%) create mode 100644 packages/ts-codegen/tsconfig.esm.json delete mode 100644 packages/ts-codegen/types/src/builder/builder.d.ts delete mode 100644 packages/ts-codegen/types/src/builder/index.d.ts delete mode 100644 packages/ts-codegen/types/src/bundler/bundler.d.ts delete mode 100644 packages/ts-codegen/types/src/bundler/index.d.ts delete mode 100644 packages/ts-codegen/types/src/cli.d.ts delete mode 100644 packages/ts-codegen/types/src/cmds.d.ts delete mode 100644 packages/ts-codegen/types/src/commands/create-boilerplate.d.ts delete mode 100644 packages/ts-codegen/types/src/commands/generate.d.ts delete mode 100644 packages/ts-codegen/types/src/commands/install.d.ts delete mode 100644 packages/ts-codegen/types/src/file.d.ts delete mode 100644 packages/ts-codegen/types/src/generators/client.d.ts delete mode 100644 packages/ts-codegen/types/src/generators/create-helpers.d.ts delete mode 100644 packages/ts-codegen/types/src/generators/message-composer.d.ts delete mode 100644 packages/ts-codegen/types/src/generators/msg-builder.d.ts delete mode 100644 packages/ts-codegen/types/src/generators/msg-builder.ts delete mode 100644 packages/ts-codegen/types/src/generators/react-query.d.ts delete mode 100644 packages/ts-codegen/types/src/generators/recoil.d.ts delete mode 100644 packages/ts-codegen/types/src/generators/types.d.ts delete mode 100644 packages/ts-codegen/types/src/helpers/contractContextBase.d.ts delete mode 100644 packages/ts-codegen/types/src/helpers/contractContextBaseShortHandCtor.d.ts delete mode 100644 packages/ts-codegen/types/src/helpers/contractsContextTSX.d.ts delete mode 100644 packages/ts-codegen/types/src/helpers/index.d.ts delete mode 100644 packages/ts-codegen/types/src/index.d.ts delete mode 100644 packages/ts-codegen/types/src/plugins/client.d.ts delete mode 100644 packages/ts-codegen/types/src/plugins/index.d.ts delete mode 100644 packages/ts-codegen/types/src/plugins/message-builder.d.ts delete mode 100644 packages/ts-codegen/types/src/plugins/message-composer.d.ts delete mode 100644 packages/ts-codegen/types/src/plugins/msg-builder.d.ts delete mode 100644 packages/ts-codegen/types/src/plugins/plugin-base.d.ts delete mode 100644 packages/ts-codegen/types/src/plugins/provider-bundle.d.ts delete mode 100644 packages/ts-codegen/types/src/plugins/provider.d.ts delete mode 100644 packages/ts-codegen/types/src/plugins/react-query.d.ts delete mode 100644 packages/ts-codegen/types/src/plugins/recoil.d.ts delete mode 100644 packages/ts-codegen/types/src/plugins/types.d.ts delete mode 100644 packages/ts-codegen/types/src/plugins/use-contracts.d.ts delete mode 100644 packages/ts-codegen/types/src/ts-codegen.d.ts delete mode 100644 packages/ts-codegen/types/src/types.d.ts delete mode 100644 packages/ts-codegen/types/src/utils/clean.d.ts delete mode 100644 packages/ts-codegen/types/src/utils/cleanse.d.ts delete mode 100644 packages/ts-codegen/types/src/utils/files.d.ts delete mode 100644 packages/ts-codegen/types/src/utils/header.d.ts delete mode 100644 packages/ts-codegen/types/src/utils/index.d.ts delete mode 100644 packages/ts-codegen/types/src/utils/parse.d.ts delete mode 100644 packages/ts-codegen/types/src/utils/prompt.d.ts delete mode 100644 packages/ts-codegen/types/src/utils/schemas.d.ts delete mode 100644 packages/ts-codegen/types/src/utils/unused.d.ts rename .eslintrc.js => packages/types/.eslintrc.js (92%) create mode 100644 packages/types/LICENSE-Apache create mode 100644 packages/types/LICENSE-MIT create mode 100644 packages/types/README.md create mode 100644 packages/types/jest.config.js create mode 100644 packages/types/package.json create mode 100644 packages/types/src/idl.ts create mode 100644 packages/types/src/index.ts create mode 100644 packages/types/src/types.ts create mode 100644 packages/types/tsconfig.esm.json create mode 100644 packages/types/tsconfig.json delete mode 100644 packages/wasm-ast-types/.babelrc.js delete mode 100644 packages/wasm-ast-types/.editorconfig delete mode 100644 packages/wasm-ast-types/.eslintignore delete mode 100644 packages/wasm-ast-types/.gitignore delete mode 100644 packages/wasm-ast-types/.npmignore delete mode 100644 packages/wasm-ast-types/.npmrc delete mode 100644 packages/wasm-ast-types/.vscode/settings.json rename packages/wasm-ast-types/{src/utils/__snapshots__/babel.spec.ts.snap => __tests__/babel/__snapshots__/babel.test.ts.snap} (100%) create mode 100644 packages/wasm-ast-types/__tests__/babel/babel.test.ts rename packages/wasm-ast-types/{src/client/test => __tests__/client}/__snapshots__/ts-client.account-nfts.spec.ts.snap (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/__snapshots__/ts-client.arrays-ref.spec.ts.snap (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/__snapshots__/ts-client.arrays.spec.ts.snap (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/__snapshots__/ts-client.cw-named-groups.test.ts.snap (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/__snapshots__/ts-client.cw-proposal-single.test.ts.snap (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/__snapshots__/ts-client.empty-enums.spec.ts.snap (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/__snapshots__/ts-client.issue-101.spec.ts.snap (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/__snapshots__/ts-client.issue-103.test.ts.snap (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/__snapshots__/ts-client.issue-71.test.ts.snap (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/__snapshots__/ts-client.issue-98.test.ts.snap (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/__snapshots__/ts-client.issues.test.ts.snap (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/__snapshots__/ts-client.overrides.spec.ts.snap (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/__snapshots__/ts-client.sg721.spec.ts.snap (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/__snapshots__/ts-client.spec.ts.snap (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/__snapshots__/ts-client.vectis.spec.ts.snap (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/__snapshots__/ts-client.wager.spec.ts.snap (100%) create mode 100644 packages/wasm-ast-types/__tests__/client/ts-client.account-nfts.test.ts rename packages/wasm-ast-types/{src/client/test/ts-client.arrays-ref.spec.ts => __tests__/client/ts-client.arrays-ref.test.ts} (100%) rename packages/wasm-ast-types/{src/client/test/ts-client.arrays.spec.ts => __tests__/client/ts-client.arrays.test.ts} (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/ts-client.cw-named-groups.test.ts (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/ts-client.cw-proposal-single.test.ts (100%) rename packages/wasm-ast-types/{src/client/test/ts-client.empty-enums.spec.ts => __tests__/client/ts-client.empty-enums.test.ts} (100%) rename packages/wasm-ast-types/{src/client/test/ts-client.issue-101.spec.ts => __tests__/client/ts-client.issue-101.test.ts} (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/ts-client.issue-103.test.ts (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/ts-client.issue-71.test.ts (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/ts-client.issue-98.test.ts (100%) rename packages/wasm-ast-types/{src/client/test => __tests__/client}/ts-client.issues.test.ts (100%) rename packages/wasm-ast-types/{src/client/test/ts-client.overrides.spec.ts => __tests__/client/ts-client.overrides.test.ts} (100%) rename packages/wasm-ast-types/{src/client/test/ts-client.sg721.spec.ts => __tests__/client/ts-client.sg721.test.ts} (100%) rename packages/wasm-ast-types/{src/client/test/ts-client.spec.ts => __tests__/client/ts-client.test.ts} (100%) create mode 100644 packages/wasm-ast-types/__tests__/client/ts-client.vectis.test.ts rename packages/wasm-ast-types/{src/client/test/ts-client.wager.spec.ts => __tests__/client/ts-client.wager.test.ts} (100%) rename packages/wasm-ast-types/{src/message-builder/__snapshots__/message-builder.spec.ts.snap => __tests__/message-builder/__snapshots__/message-builder.test.ts.snap} (100%) rename packages/wasm-ast-types/{src/message-builder/message-builder.spec.ts => __tests__/message-builder/message-builder.test.ts} (100%) rename packages/wasm-ast-types/{src/message-composer/__snapshots__/message-composer.spec.ts.snap => __tests__/message-composer/__snapshots__/message-composer.test.ts.snap} (100%) rename packages/wasm-ast-types/{src/message-composer/message-composer.spec.ts => __tests__/message-composer/message-composer.test.ts} (100%) rename packages/wasm-ast-types/{src/provider/__snapshots__/provider.spec.ts.snap => __tests__/provider/__snapshots__/provider.test.ts.snap} (100%) create mode 100644 packages/wasm-ast-types/__tests__/provider/provider.test.ts rename packages/wasm-ast-types/{src/react-query/__snapshots__/react-query.spec.ts.snap => __tests__/react-query/__snapshots__/react-query.test.ts.snap} (100%) rename packages/wasm-ast-types/{src/react-query/react-query.spec.ts => __tests__/react-query/react-query.test.ts} (100%) rename packages/wasm-ast-types/{src/recoil/__snapshots__/recoil.spec.ts.snap => __tests__/recoil/__snapshots__/recoil.test.ts.snap} (100%) create mode 100644 packages/wasm-ast-types/__tests__/recoil/recoil.test.ts create mode 100644 packages/wasm-ast-types/jest.config.js rename packages/wasm-ast-types/scripts/{test-ast.js => test-ast.ts} (96%) delete mode 100644 packages/wasm-ast-types/src/client/test/ts-client.account-nfts.spec.ts delete mode 100644 packages/wasm-ast-types/src/client/test/ts-client.vectis.spec.ts delete mode 100644 packages/wasm-ast-types/src/provider/provider.spec.ts delete mode 100644 packages/wasm-ast-types/src/recoil/recoil.spec.ts delete mode 100644 packages/wasm-ast-types/src/types.ts delete mode 100644 packages/wasm-ast-types/src/utils/babel.spec.ts create mode 100644 packages/wasm-ast-types/test-utils/fixtures.ts create mode 100644 packages/wasm-ast-types/test-utils/utils.ts create mode 100644 packages/wasm-ast-types/tsconfig.esm.json delete mode 100644 packages/wasm-ast-types/types/client/client.d.ts delete mode 100644 packages/wasm-ast-types/types/client/index.d.ts delete mode 100644 packages/wasm-ast-types/types/context/context.d.ts delete mode 100644 packages/wasm-ast-types/types/context/imports.d.ts delete mode 100644 packages/wasm-ast-types/types/context/index.d.ts delete mode 100644 packages/wasm-ast-types/types/index.d.ts delete mode 100644 packages/wasm-ast-types/types/message-builder/index.d.ts delete mode 100644 packages/wasm-ast-types/types/message-builder/message-builder.d.ts delete mode 100644 packages/wasm-ast-types/types/message-composer/index.d.ts delete mode 100644 packages/wasm-ast-types/types/message-composer/message-composer.d.ts delete mode 100644 packages/wasm-ast-types/types/provider/index.d.ts delete mode 100644 packages/wasm-ast-types/types/provider/provider.d.ts delete mode 100644 packages/wasm-ast-types/types/react-query/index.d.ts delete mode 100644 packages/wasm-ast-types/types/react-query/react-query.d.ts delete mode 100644 packages/wasm-ast-types/types/recoil/index.d.ts delete mode 100644 packages/wasm-ast-types/types/recoil/recoil.d.ts delete mode 100644 packages/wasm-ast-types/types/types.d.ts delete mode 100644 packages/wasm-ast-types/types/utils/babel.d.ts delete mode 100644 packages/wasm-ast-types/types/utils/constants.d.ts delete mode 100644 packages/wasm-ast-types/types/utils/index.d.ts delete mode 100644 packages/wasm-ast-types/types/utils/ref.d.ts delete mode 100644 packages/wasm-ast-types/types/utils/types.d.ts create mode 100644 tsconfig.json diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 4a7ea303..00000000 --- a/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index f497e718..00000000 --- a/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -*.json -*.md -*.css -*.d.ts - -node_modules/ -dist/ -main/ -module/ -coverage/ diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..afb9b718 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,39 @@ +{ + "env": { + "browser": true, + "es2021": true, + "node": true, + "jest": true + }, + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "prettier" + ], + "overrides": [], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module" + }, + "plugins": ["@typescript-eslint", "simple-import-sort", "unused-imports"], + "rules": { + "simple-import-sort/imports": 1, + "simple-import-sort/exports": 1, + "unused-imports/no-unused-imports": 1, + "@typescript-eslint/no-unused-vars": [ + 1, + { + "argsIgnorePattern": "React|res|next|^_" + } + ], + "@typescript-eslint/no-explicit-any": 0, + "@typescript-eslint/no-var-requires": 0, + "no-console": 0, + "@typescript-eslint/ban-ts-comment": 0, + "prefer-const": 0, + "no-case-declarations": 0, + "no-implicit-globals": 0, + "@typescript-eslint/no-unsafe-declaration-merging": 0 + } +} diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index fcadd4e9..cd9d9c60 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -12,19 +12,22 @@ jobs: run-tests: runs-on: ubuntu-latest steps: - - name: checkout 🛎️ - uses: actions/checkout@v2.3.1 - - name: node - uses: actions/setup-node@v3 + - name: Checkout Repository 🛎️ + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 with: - node-version: 16.14.0 - - name: deps - run: yarn - - name: bootstrap - run: yarn bootstrap - - name: build + node-version: '20.x' + + - name: Install Dependencies + run: yarn install + + - name: Build Project run: yarn build - - name: ts-codegen - run: cd ./packages/ts-codegen && yarn test - - name: wasm-ast-types - run: cd ./packages/wasm-ast-types && yarn test \ No newline at end of file + + - name: Test @cosmwasm/ts-codegen + run: cd packages/ts-codegen && yarn test + + - name: Test ast + run: cd ./packages/ast && yarn test \ No newline at end of file diff --git a/.gitignore b/.gitignore index 031b0da3..cb78b839 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,5 @@ -.DS_Store -.eslintcache -*.log -**/node_modules -coverage -packages/**/build -packages/**/main -packages/**/module -testgen +**/node_modules/ +**/.DS_Store +**/dist +**/yarn-error.log +lerna-debug.log \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 00000000..f0eb61e0 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,6 @@ +{ + "trailingComma": "es5", + "tabWidth": 2, + "semi": true, + "singleQuote": false +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 1d4e4d63..95030db5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,16 +1,16 @@ { + "editor.defaultFormatter": "vscode.typescript-language-features", "editor.formatOnSave": true, - "[javascriptreact]": { - "editor.formatOnSave": false - }, - "[javascript]": { - "editor.formatOnSave": false - }, "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": "explicit" }, "eslint.validate": [ - "javascript", - "javascriptreact" - ] -} \ No newline at end of file + "javascript", + "javascriptreact", + "typescript", + "typescriptreact" + ], + "eslint.format.enable": false, + "typescript.tsdk": "node_modules/typescript/lib", + "editor.tabSize": 2 +} diff --git a/.yarn/releases/yarn-1.18.0.cjs b/.yarn/releases/yarn-1.18.0.cjs deleted file mode 100755 index b2492e1c..00000000 --- a/.yarn/releases/yarn-1.18.0.cjs +++ /dev/null @@ -1,147155 +0,0 @@ -#!/usr/bin/env node -module.exports = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // identity function for calling harmony imports with the correct context -/******/ __webpack_require__.i = function(value) { return value; }; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 549); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports) { - -module.exports = require("path"); - -/***/ }), -/* 1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = __extends; -/* unused harmony export __assign */ -/* unused harmony export __rest */ -/* unused harmony export __decorate */ -/* unused harmony export __param */ -/* unused harmony export __metadata */ -/* unused harmony export __awaiter */ -/* unused harmony export __generator */ -/* unused harmony export __exportStar */ -/* unused harmony export __values */ -/* unused harmony export __read */ -/* unused harmony export __spread */ -/* unused harmony export __await */ -/* unused harmony export __asyncGenerator */ -/* unused harmony export __asyncDelegator */ -/* unused harmony export __asyncValues */ -/* unused harmony export __makeTemplateObject */ -/* unused harmony export __importStar */ -/* unused harmony export __importDefault */ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global Reflect, Promise */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -function __extends(d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} - -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -} - -function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -function __awaiter(thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - 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; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -function __exportStar(m, exports) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} - -function __values(o) { - var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; - if (m) return m.call(o); - return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; -} - -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } -} - -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result.default = mod; - return result; -} - -function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _promise = __webpack_require__(227); - -var _promise2 = _interopRequireDefault(_promise); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (fn) { - return function () { - var gen = fn.apply(this, arguments); - return new _promise2.default(function (resolve, reject) { - function step(key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - - if (info.done) { - resolve(value); - } else { - return _promise2.default.resolve(value).then(function (value) { - step("next", value); - }, function (err) { - step("throw", err); - }); - } - } - - return step("next"); - }); - }; -}; - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - -module.exports = require("util"); - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getFirstSuitableFolder = exports.readFirstAvailableStream = exports.makeTempDir = exports.hardlinksWork = exports.writeFilePreservingEol = exports.getFileSizeOnDisk = exports.walk = exports.symlink = exports.find = exports.readJsonAndFile = exports.readJson = exports.readFileAny = exports.hardlinkBulk = exports.copyBulk = exports.unlink = exports.glob = exports.link = exports.chmod = exports.lstat = exports.exists = exports.mkdirp = exports.stat = exports.access = exports.rename = exports.readdir = exports.realpath = exports.readlink = exports.writeFile = exports.open = exports.readFileBuffer = exports.lockQueue = exports.constants = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -let buildActionsForCopy = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { - - // - let build = (() => { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { - const src = data.src, - dest = data.dest, - type = data.type; - - const onFresh = data.onFresh || noop; - const onDone = data.onDone || noop; - - // TODO https://github.com/yarnpkg/yarn/issues/3751 - // related to bundled dependencies handling - if (files.has(dest.toLowerCase())) { - reporter.verbose(`The case-insensitive file ${dest} shouldn't be copied twice in one bulk copy`); - } else { - files.add(dest.toLowerCase()); - } - - if (type === 'symlink') { - yield mkdirp((_path || _load_path()).default.dirname(dest)); - onFresh(); - actions.symlink.push({ - dest, - linkname: src - }); - onDone(); - return; - } - - if (events.ignoreBasenames.indexOf((_path || _load_path()).default.basename(src)) >= 0) { - // ignored file - return; - } - - const srcStat = yield lstat(src); - let srcFiles; - - if (srcStat.isDirectory()) { - srcFiles = yield readdir(src); - } - - let destStat; - try { - // try accessing the destination - destStat = yield lstat(dest); - } catch (e) { - // proceed if destination doesn't exist, otherwise error - if (e.code !== 'ENOENT') { - throw e; - } - } - - // if destination exists - if (destStat) { - const bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink(); - const bothFolders = srcStat.isDirectory() && destStat.isDirectory(); - const bothFiles = srcStat.isFile() && destStat.isFile(); - - // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving - // us modes that aren't valid. investigate this, it's generally safe to proceed. - - /* if (srcStat.mode !== destStat.mode) { - try { - await access(dest, srcStat.mode); - } catch (err) {} - } */ - - if (bothFiles && artifactFiles.has(dest)) { - // this file gets changed during build, likely by a custom install script. Don't bother checking it. - onDone(); - reporter.verbose(reporter.lang('verboseFileSkipArtifact', src)); - return; - } - - if (bothFiles && srcStat.size === destStat.size && (0, (_fsNormalized || _load_fsNormalized()).fileDatesEqual)(srcStat.mtime, destStat.mtime)) { - // we can safely assume this is the same file - onDone(); - reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.size, +srcStat.mtime)); - return; - } - - if (bothSymlinks) { - const srcReallink = yield readlink(src); - if (srcReallink === (yield readlink(dest))) { - // if both symlinks are the same then we can continue on - onDone(); - reporter.verbose(reporter.lang('verboseFileSkipSymlink', src, dest, srcReallink)); - return; - } - } - - if (bothFolders) { - // mark files that aren't in this folder as possibly extraneous - const destFiles = yield readdir(dest); - invariant(srcFiles, 'src files not initialised'); - - for (var _iterator4 = destFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { - var _ref6; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref6 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref6 = _i4.value; - } - - const file = _ref6; - - if (srcFiles.indexOf(file) < 0) { - const loc = (_path || _load_path()).default.join(dest, file); - possibleExtraneous.add(loc); - - if ((yield lstat(loc)).isDirectory()) { - for (var _iterator5 = yield readdir(loc), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { - var _ref7; - - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref7 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref7 = _i5.value; - } - - const file = _ref7; - - possibleExtraneous.add((_path || _load_path()).default.join(loc, file)); - } - } - } - } - } - } - - if (destStat && destStat.isSymbolicLink()) { - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest); - destStat = null; - } - - if (srcStat.isSymbolicLink()) { - onFresh(); - const linkname = yield readlink(src); - actions.symlink.push({ - dest, - linkname - }); - onDone(); - } else if (srcStat.isDirectory()) { - if (!destStat) { - reporter.verbose(reporter.lang('verboseFileFolder', dest)); - yield mkdirp(dest); - } - - const destParts = dest.split((_path || _load_path()).default.sep); - while (destParts.length) { - files.add(destParts.join((_path || _load_path()).default.sep).toLowerCase()); - destParts.pop(); - } - - // push all files to queue - invariant(srcFiles, 'src files not initialised'); - let remaining = srcFiles.length; - if (!remaining) { - onDone(); - } - for (var _iterator6 = srcFiles, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { - var _ref8; - - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref8 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref8 = _i6.value; - } - - const file = _ref8; - - queue.push({ - dest: (_path || _load_path()).default.join(dest, file), - onFresh, - onDone: function (_onDone) { - function onDone() { - return _onDone.apply(this, arguments); - } - - onDone.toString = function () { - return _onDone.toString(); - }; - - return onDone; - }(function () { - if (--remaining === 0) { - onDone(); - } - }), - src: (_path || _load_path()).default.join(src, file) - }); - } - } else if (srcStat.isFile()) { - onFresh(); - actions.file.push({ - src, - dest, - atime: srcStat.atime, - mtime: srcStat.mtime, - mode: srcStat.mode - }); - onDone(); - } else { - throw new Error(`unsure how to copy this: ${src}`); - } - }); - - return function build(_x5) { - return _ref5.apply(this, arguments); - }; - })(); - - const artifactFiles = new Set(events.artifactFiles || []); - const files = new Set(); - - // initialise events - for (var _iterator = queue, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref2; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; - } - - const item = _ref2; - - const onDone = item.onDone; - item.onDone = function () { - events.onProgress(item.dest); - if (onDone) { - onDone(); - } - }; - } - events.onStart(queue.length); - - // start building actions - const actions = { - file: [], - symlink: [], - link: [] - }; - - // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items - // at a time due to the requirement to push items onto the queue - while (queue.length) { - const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); - yield Promise.all(items.map(build)); - } - - // simulate the existence of some files to prevent considering them extraneous - for (var _iterator2 = artifactFiles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { - var _ref3; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref3 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref3 = _i2.value; - } - - const file = _ref3; - - if (possibleExtraneous.has(file)) { - reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', file)); - possibleExtraneous.delete(file); - } - } - - for (var _iterator3 = possibleExtraneous, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { - var _ref4; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref4 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref4 = _i3.value; - } - - const loc = _ref4; - - if (files.has(loc.toLowerCase())) { - possibleExtraneous.delete(loc); - } - } - - return actions; - }); - - return function buildActionsForCopy(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -})(); - -let buildActionsForHardlink = (() => { - var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { - - // - let build = (() => { - var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { - const src = data.src, - dest = data.dest; - - const onFresh = data.onFresh || noop; - const onDone = data.onDone || noop; - if (files.has(dest.toLowerCase())) { - // Fixes issue https://github.com/yarnpkg/yarn/issues/2734 - // When bulk hardlinking we have A -> B structure that we want to hardlink to A1 -> B1, - // package-linker passes that modules A1 and B1 need to be hardlinked, - // the recursive linking algorithm of A1 ends up scheduling files in B1 to be linked twice which will case - // an exception. - onDone(); - return; - } - files.add(dest.toLowerCase()); - - if (events.ignoreBasenames.indexOf((_path || _load_path()).default.basename(src)) >= 0) { - // ignored file - return; - } - - const srcStat = yield lstat(src); - let srcFiles; - - if (srcStat.isDirectory()) { - srcFiles = yield readdir(src); - } - - const destExists = yield exists(dest); - if (destExists) { - const destStat = yield lstat(dest); - - const bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink(); - const bothFolders = srcStat.isDirectory() && destStat.isDirectory(); - const bothFiles = srcStat.isFile() && destStat.isFile(); - - if (srcStat.mode !== destStat.mode) { - try { - yield access(dest, srcStat.mode); - } catch (err) { - // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving - // us modes that aren't valid. investigate this, it's generally safe to proceed. - reporter.verbose(err); - } - } - - if (bothFiles && artifactFiles.has(dest)) { - // this file gets changed during build, likely by a custom install script. Don't bother checking it. - onDone(); - reporter.verbose(reporter.lang('verboseFileSkipArtifact', src)); - return; - } - - // correct hardlink - if (bothFiles && srcStat.ino !== null && srcStat.ino === destStat.ino) { - onDone(); - reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.ino)); - return; - } - - if (bothSymlinks) { - const srcReallink = yield readlink(src); - if (srcReallink === (yield readlink(dest))) { - // if both symlinks are the same then we can continue on - onDone(); - reporter.verbose(reporter.lang('verboseFileSkipSymlink', src, dest, srcReallink)); - return; - } - } - - if (bothFolders) { - // mark files that aren't in this folder as possibly extraneous - const destFiles = yield readdir(dest); - invariant(srcFiles, 'src files not initialised'); - - for (var _iterator10 = destFiles, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) { - var _ref14; - - if (_isArray10) { - if (_i10 >= _iterator10.length) break; - _ref14 = _iterator10[_i10++]; - } else { - _i10 = _iterator10.next(); - if (_i10.done) break; - _ref14 = _i10.value; - } - - const file = _ref14; - - if (srcFiles.indexOf(file) < 0) { - const loc = (_path || _load_path()).default.join(dest, file); - possibleExtraneous.add(loc); - - if ((yield lstat(loc)).isDirectory()) { - for (var _iterator11 = yield readdir(loc), _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) { - var _ref15; - - if (_isArray11) { - if (_i11 >= _iterator11.length) break; - _ref15 = _iterator11[_i11++]; - } else { - _i11 = _iterator11.next(); - if (_i11.done) break; - _ref15 = _i11.value; - } - - const file = _ref15; - - possibleExtraneous.add((_path || _load_path()).default.join(loc, file)); - } - } - } - } - } - } - - if (srcStat.isSymbolicLink()) { - onFresh(); - const linkname = yield readlink(src); - actions.symlink.push({ - dest, - linkname - }); - onDone(); - } else if (srcStat.isDirectory()) { - reporter.verbose(reporter.lang('verboseFileFolder', dest)); - yield mkdirp(dest); - - const destParts = dest.split((_path || _load_path()).default.sep); - while (destParts.length) { - files.add(destParts.join((_path || _load_path()).default.sep).toLowerCase()); - destParts.pop(); - } - - // push all files to queue - invariant(srcFiles, 'src files not initialised'); - let remaining = srcFiles.length; - if (!remaining) { - onDone(); - } - for (var _iterator12 = srcFiles, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) { - var _ref16; - - if (_isArray12) { - if (_i12 >= _iterator12.length) break; - _ref16 = _iterator12[_i12++]; - } else { - _i12 = _iterator12.next(); - if (_i12.done) break; - _ref16 = _i12.value; - } - - const file = _ref16; - - queue.push({ - onFresh, - src: (_path || _load_path()).default.join(src, file), - dest: (_path || _load_path()).default.join(dest, file), - onDone: function (_onDone2) { - function onDone() { - return _onDone2.apply(this, arguments); - } - - onDone.toString = function () { - return _onDone2.toString(); - }; - - return onDone; - }(function () { - if (--remaining === 0) { - onDone(); - } - }) - }); - } - } else if (srcStat.isFile()) { - onFresh(); - actions.link.push({ - src, - dest, - removeDest: destExists - }); - onDone(); - } else { - throw new Error(`unsure how to copy this: ${src}`); - } - }); - - return function build(_x10) { - return _ref13.apply(this, arguments); - }; - })(); - - const artifactFiles = new Set(events.artifactFiles || []); - const files = new Set(); - - // initialise events - for (var _iterator7 = queue, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { - var _ref10; - - if (_isArray7) { - if (_i7 >= _iterator7.length) break; - _ref10 = _iterator7[_i7++]; - } else { - _i7 = _iterator7.next(); - if (_i7.done) break; - _ref10 = _i7.value; - } - - const item = _ref10; - - const onDone = item.onDone || noop; - item.onDone = function () { - events.onProgress(item.dest); - onDone(); - }; - } - events.onStart(queue.length); - - // start building actions - const actions = { - file: [], - symlink: [], - link: [] - }; - - // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items - // at a time due to the requirement to push items onto the queue - while (queue.length) { - const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); - yield Promise.all(items.map(build)); - } - - // simulate the existence of some files to prevent considering them extraneous - for (var _iterator8 = artifactFiles, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) { - var _ref11; - - if (_isArray8) { - if (_i8 >= _iterator8.length) break; - _ref11 = _iterator8[_i8++]; - } else { - _i8 = _iterator8.next(); - if (_i8.done) break; - _ref11 = _i8.value; - } - - const file = _ref11; - - if (possibleExtraneous.has(file)) { - reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', file)); - possibleExtraneous.delete(file); - } - } - - for (var _iterator9 = possibleExtraneous, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) { - var _ref12; - - if (_isArray9) { - if (_i9 >= _iterator9.length) break; - _ref12 = _iterator9[_i9++]; - } else { - _i9 = _iterator9.next(); - if (_i9.done) break; - _ref12 = _i9.value; - } - - const loc = _ref12; - - if (files.has(loc.toLowerCase())) { - possibleExtraneous.delete(loc); - } - } - - return actions; - }); - - return function buildActionsForHardlink(_x6, _x7, _x8, _x9) { - return _ref9.apply(this, arguments); - }; -})(); - -let copyBulk = exports.copyBulk = (() => { - var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { - const events = { - onStart: _events && _events.onStart || noop, - onProgress: _events && _events.onProgress || noop, - possibleExtraneous: _events ? _events.possibleExtraneous : new Set(), - ignoreBasenames: _events && _events.ignoreBasenames || [], - artifactFiles: _events && _events.artifactFiles || [] - }; - - const actions = yield buildActionsForCopy(queue, events, events.possibleExtraneous, reporter); - events.onStart(actions.file.length + actions.symlink.length + actions.link.length); - - const fileActions = actions.file; - - const currentlyWriting = new Map(); - - yield (_promise || _load_promise()).queue(fileActions, (() => { - var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { - let writePromise; - while (writePromise = currentlyWriting.get(data.dest)) { - yield writePromise; - } - - reporter.verbose(reporter.lang('verboseFileCopy', data.src, data.dest)); - const copier = (0, (_fsNormalized || _load_fsNormalized()).copyFile)(data, function () { - return currentlyWriting.delete(data.dest); - }); - currentlyWriting.set(data.dest, copier); - events.onProgress(data.dest); - return copier; - }); - - return function (_x14) { - return _ref18.apply(this, arguments); - }; - })(), CONCURRENT_QUEUE_ITEMS); - - // we need to copy symlinks last as they could reference files we were copying - const symlinkActions = actions.symlink; - yield (_promise || _load_promise()).queue(symlinkActions, function (data) { - const linkname = (_path || _load_path()).default.resolve((_path || _load_path()).default.dirname(data.dest), data.linkname); - reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname)); - return symlink(linkname, data.dest); - }); - }); - - return function copyBulk(_x11, _x12, _x13) { - return _ref17.apply(this, arguments); - }; -})(); - -let hardlinkBulk = exports.hardlinkBulk = (() => { - var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { - const events = { - onStart: _events && _events.onStart || noop, - onProgress: _events && _events.onProgress || noop, - possibleExtraneous: _events ? _events.possibleExtraneous : new Set(), - artifactFiles: _events && _events.artifactFiles || [], - ignoreBasenames: [] - }; - - const actions = yield buildActionsForHardlink(queue, events, events.possibleExtraneous, reporter); - events.onStart(actions.file.length + actions.symlink.length + actions.link.length); - - const fileActions = actions.link; - - yield (_promise || _load_promise()).queue(fileActions, (() => { - var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { - reporter.verbose(reporter.lang('verboseFileLink', data.src, data.dest)); - if (data.removeDest) { - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(data.dest); - } - yield link(data.src, data.dest); - }); - - return function (_x18) { - return _ref20.apply(this, arguments); - }; - })(), CONCURRENT_QUEUE_ITEMS); - - // we need to copy symlinks last as they could reference files we were copying - const symlinkActions = actions.symlink; - yield (_promise || _load_promise()).queue(symlinkActions, function (data) { - const linkname = (_path || _load_path()).default.resolve((_path || _load_path()).default.dirname(data.dest), data.linkname); - reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname)); - return symlink(linkname, data.dest); - }); - }); - - return function hardlinkBulk(_x15, _x16, _x17) { - return _ref19.apply(this, arguments); - }; -})(); - -let readFileAny = exports.readFileAny = (() => { - var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (files) { - for (var _iterator13 = files, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator]();;) { - var _ref22; - - if (_isArray13) { - if (_i13 >= _iterator13.length) break; - _ref22 = _iterator13[_i13++]; - } else { - _i13 = _iterator13.next(); - if (_i13.done) break; - _ref22 = _i13.value; - } - - const file = _ref22; - - if (yield exists(file)) { - return readFile(file); - } - } - return null; - }); - - return function readFileAny(_x19) { - return _ref21.apply(this, arguments); - }; -})(); - -let readJson = exports.readJson = (() => { - var _ref23 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { - return (yield readJsonAndFile(loc)).object; - }); - - return function readJson(_x20) { - return _ref23.apply(this, arguments); - }; -})(); - -let readJsonAndFile = exports.readJsonAndFile = (() => { - var _ref24 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { - const file = yield readFile(loc); - try { - return { - object: (0, (_map || _load_map()).default)(JSON.parse(stripBOM(file))), - content: file - }; - } catch (err) { - err.message = `${loc}: ${err.message}`; - throw err; - } - }); - - return function readJsonAndFile(_x21) { - return _ref24.apply(this, arguments); - }; -})(); - -let find = exports.find = (() => { - var _ref25 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename, dir) { - const parts = dir.split((_path || _load_path()).default.sep); - - while (parts.length) { - const loc = parts.concat(filename).join((_path || _load_path()).default.sep); - - if (yield exists(loc)) { - return loc; - } else { - parts.pop(); - } - } - - return false; - }); - - return function find(_x22, _x23) { - return _ref25.apply(this, arguments); - }; -})(); - -let symlink = exports.symlink = (() => { - var _ref26 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest) { - if (process.platform !== 'win32') { - // use relative paths otherwise which will be retained if the directory is moved - src = (_path || _load_path()).default.relative((_path || _load_path()).default.dirname(dest), src); - // When path.relative returns an empty string for the current directory, we should instead use - // '.', which is a valid fs.symlink target. - src = src || '.'; - } - - try { - const stats = yield lstat(dest); - if (stats.isSymbolicLink()) { - const resolved = dest; - if (resolved === src) { - return; - } - } - } catch (err) { - if (err.code !== 'ENOENT') { - throw err; - } - } - - // We use rimraf for unlink which never throws an ENOENT on missing target - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest); - - if (process.platform === 'win32') { - // use directory junctions if possible on win32, this requires absolute paths - yield fsSymlink(src, dest, 'junction'); - } else { - yield fsSymlink(src, dest); - } - }); - - return function symlink(_x24, _x25) { - return _ref26.apply(this, arguments); - }; -})(); - -let walk = exports.walk = (() => { - var _ref27 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, relativeDir, ignoreBasenames = new Set()) { - let files = []; - - let filenames = yield readdir(dir); - if (ignoreBasenames.size) { - filenames = filenames.filter(function (name) { - return !ignoreBasenames.has(name); - }); - } - - for (var _iterator14 = filenames, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator]();;) { - var _ref28; - - if (_isArray14) { - if (_i14 >= _iterator14.length) break; - _ref28 = _iterator14[_i14++]; - } else { - _i14 = _iterator14.next(); - if (_i14.done) break; - _ref28 = _i14.value; - } - - const name = _ref28; - - const relative = relativeDir ? (_path || _load_path()).default.join(relativeDir, name) : name; - const loc = (_path || _load_path()).default.join(dir, name); - const stat = yield lstat(loc); - - files.push({ - relative, - basename: name, - absolute: loc, - mtime: +stat.mtime - }); - - if (stat.isDirectory()) { - files = files.concat((yield walk(loc, relative, ignoreBasenames))); - } - } - - return files; - }); - - return function walk(_x26, _x27) { - return _ref27.apply(this, arguments); - }; -})(); - -let getFileSizeOnDisk = exports.getFileSizeOnDisk = (() => { - var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { - const stat = yield lstat(loc); - const size = stat.size, - blockSize = stat.blksize; - - - return Math.ceil(size / blockSize) * blockSize; - }); - - return function getFileSizeOnDisk(_x28) { - return _ref29.apply(this, arguments); - }; -})(); - -let getEolFromFile = (() => { - var _ref30 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path) { - if (!(yield exists(path))) { - return undefined; - } - - const buffer = yield readFileBuffer(path); - - for (let i = 0; i < buffer.length; ++i) { - if (buffer[i] === cr) { - return '\r\n'; - } - if (buffer[i] === lf) { - return '\n'; - } - } - return undefined; - }); - - return function getEolFromFile(_x29) { - return _ref30.apply(this, arguments); - }; -})(); - -let writeFilePreservingEol = exports.writeFilePreservingEol = (() => { - var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path, data) { - const eol = (yield getEolFromFile(path)) || (_os || _load_os()).default.EOL; - if (eol !== '\n') { - data = data.replace(/\n/g, eol); - } - yield writeFile(path, data); - }); - - return function writeFilePreservingEol(_x30, _x31) { - return _ref31.apply(this, arguments); - }; -})(); - -let hardlinksWork = exports.hardlinksWork = (() => { - var _ref32 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) { - const filename = 'test-file' + Math.random(); - const file = (_path || _load_path()).default.join(dir, filename); - const fileLink = (_path || _load_path()).default.join(dir, filename + '-link'); - try { - yield writeFile(file, 'test'); - yield link(file, fileLink); - } catch (err) { - return false; - } finally { - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(file); - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(fileLink); - } - return true; - }); - - return function hardlinksWork(_x32) { - return _ref32.apply(this, arguments); - }; -})(); - -// not a strict polyfill for Node's fs.mkdtemp - - -let makeTempDir = exports.makeTempDir = (() => { - var _ref33 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (prefix) { - const dir = (_path || _load_path()).default.join((_os || _load_os()).default.tmpdir(), `yarn-${prefix || ''}-${Date.now()}-${Math.random()}`); - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dir); - yield mkdirp(dir); - return dir; - }); - - return function makeTempDir(_x33) { - return _ref33.apply(this, arguments); - }; -})(); - -let readFirstAvailableStream = exports.readFirstAvailableStream = (() => { - var _ref34 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) { - for (var _iterator15 = paths, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator]();;) { - var _ref35; - - if (_isArray15) { - if (_i15 >= _iterator15.length) break; - _ref35 = _iterator15[_i15++]; - } else { - _i15 = _iterator15.next(); - if (_i15.done) break; - _ref35 = _i15.value; - } - - const path = _ref35; - - try { - const fd = yield open(path, 'r'); - return (_fs || _load_fs()).default.createReadStream(path, { fd }); - } catch (err) { - // Try the next one - } - } - return null; - }); - - return function readFirstAvailableStream(_x34) { - return _ref34.apply(this, arguments); - }; -})(); - -let getFirstSuitableFolder = exports.getFirstSuitableFolder = (() => { - var _ref36 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths, mode = constants.W_OK | constants.X_OK) { - const result = { - skipped: [], - folder: null - }; - - for (var _iterator16 = paths, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : _iterator16[Symbol.iterator]();;) { - var _ref37; - - if (_isArray16) { - if (_i16 >= _iterator16.length) break; - _ref37 = _iterator16[_i16++]; - } else { - _i16 = _iterator16.next(); - if (_i16.done) break; - _ref37 = _i16.value; - } - - const folder = _ref37; - - try { - yield mkdirp(folder); - yield access(folder, mode); - - result.folder = folder; - - return result; - } catch (error) { - result.skipped.push({ - error, - folder - }); - } - } - return result; - }); - - return function getFirstSuitableFolder(_x35) { - return _ref36.apply(this, arguments); - }; -})(); - -exports.copy = copy; -exports.readFile = readFile; -exports.readFileRaw = readFileRaw; -exports.normalizeOS = normalizeOS; - -var _fs; - -function _load_fs() { - return _fs = _interopRequireDefault(__webpack_require__(5)); -} - -var _glob; - -function _load_glob() { - return _glob = _interopRequireDefault(__webpack_require__(99)); -} - -var _os; - -function _load_os() { - return _os = _interopRequireDefault(__webpack_require__(49)); -} - -var _path; - -function _load_path() { - return _path = _interopRequireDefault(__webpack_require__(0)); -} - -var _blockingQueue; - -function _load_blockingQueue() { - return _blockingQueue = _interopRequireDefault(__webpack_require__(110)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireWildcard(__webpack_require__(50)); -} - -var _promise2; - -function _load_promise2() { - return _promise2 = __webpack_require__(50); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(29)); -} - -var _fsNormalized; - -function _load_fsNormalized() { - return _fsNormalized = __webpack_require__(218); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const constants = exports.constants = typeof (_fs || _load_fs()).default.constants !== 'undefined' ? (_fs || _load_fs()).default.constants : { - R_OK: (_fs || _load_fs()).default.R_OK, - W_OK: (_fs || _load_fs()).default.W_OK, - X_OK: (_fs || _load_fs()).default.X_OK -}; - -const lockQueue = exports.lockQueue = new (_blockingQueue || _load_blockingQueue()).default('fs lock'); - -const readFileBuffer = exports.readFileBuffer = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readFile); -const open = exports.open = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.open); -const writeFile = exports.writeFile = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.writeFile); -const readlink = exports.readlink = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readlink); -const realpath = exports.realpath = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.realpath); -const readdir = exports.readdir = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readdir); -const rename = exports.rename = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.rename); -const access = exports.access = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.access); -const stat = exports.stat = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.stat); -const mkdirp = exports.mkdirp = (0, (_promise2 || _load_promise2()).promisify)(__webpack_require__(145)); -const exists = exports.exists = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.exists, true); -const lstat = exports.lstat = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.lstat); -const chmod = exports.chmod = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.chmod); -const link = exports.link = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.link); -const glob = exports.glob = (0, (_promise2 || _load_promise2()).promisify)((_glob || _load_glob()).default); -exports.unlink = (_fsNormalized || _load_fsNormalized()).unlink; - -// fs.copyFile uses the native file copying instructions on the system, performing much better -// than any JS-based solution and consumes fewer resources. Repeated testing to fine tune the -// concurrency level revealed 128 as the sweet spot on a quad-core, 16 CPU Intel system with SSD. - -const CONCURRENT_QUEUE_ITEMS = (_fs || _load_fs()).default.copyFile ? 128 : 4; - -const fsSymlink = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.symlink); -const invariant = __webpack_require__(9); -const stripBOM = __webpack_require__(160); - -const noop = () => {}; - -function copy(src, dest, reporter) { - return copyBulk([{ src, dest }], reporter); -} - -function _readFile(loc, encoding) { - return new Promise((resolve, reject) => { - (_fs || _load_fs()).default.readFile(loc, encoding, function (err, content) { - if (err) { - reject(err); - } else { - resolve(content); - } - }); - }); -} - -function readFile(loc) { - return _readFile(loc, 'utf8').then(normalizeOS); -} - -function readFileRaw(loc) { - return _readFile(loc, 'binary'); -} - -function normalizeOS(body) { - return body.replace(/\r\n/g, '\n'); -} - -const cr = '\r'.charCodeAt(0); -const lf = '\n'.charCodeAt(0); - -/***/ }), -/* 5 */ -/***/ (function(module, exports) { - -module.exports = require("fs"); - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -class MessageError extends Error { - constructor(msg, code) { - super(msg); - this.code = code; - } - -} - -exports.MessageError = MessageError; -class ProcessSpawnError extends MessageError { - constructor(msg, code, process) { - super(msg, code); - this.process = process; - } - -} - -exports.ProcessSpawnError = ProcessSpawnError; -class SecurityError extends MessageError {} - -exports.SecurityError = SecurityError; -class ProcessTermError extends MessageError {} - -exports.ProcessTermError = ProcessTermError; -class ResponseError extends Error { - constructor(msg, responseCode) { - super(msg); - this.responseCode = responseCode; - } - -} - -exports.ResponseError = ResponseError; -class OneTimePasswordError extends Error {} -exports.OneTimePasswordError = OneTimePasswordError; - -/***/ }), -/* 7 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscriber; }); -/* unused harmony export SafeSubscriber */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isFunction__ = __webpack_require__(154); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Observer__ = __webpack_require__(420); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(25); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_symbol_rxSubscriber__ = __webpack_require__(321); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__config__ = __webpack_require__(185); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util_hostReportError__ = __webpack_require__(323); -/** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */ - - - - - - - -var Subscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](Subscriber, _super); - function Subscriber(destinationOrNext, error, complete) { - var _this = _super.call(this) || this; - _this.syncErrorValue = null; - _this.syncErrorThrown = false; - _this.syncErrorThrowable = false; - _this.isStopped = false; - _this._parentSubscription = null; - switch (arguments.length) { - case 0: - _this.destination = __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */]; - break; - case 1: - if (!destinationOrNext) { - _this.destination = __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */]; - break; - } - if (typeof destinationOrNext === 'object') { - if (destinationOrNext instanceof Subscriber) { - _this.syncErrorThrowable = destinationOrNext.syncErrorThrowable; - _this.destination = destinationOrNext; - destinationOrNext.add(_this); - } - else { - _this.syncErrorThrowable = true; - _this.destination = new SafeSubscriber(_this, destinationOrNext); - } - break; - } - default: - _this.syncErrorThrowable = true; - _this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete); - break; - } - return _this; - } - Subscriber.prototype[__WEBPACK_IMPORTED_MODULE_4__internal_symbol_rxSubscriber__["a" /* rxSubscriber */]] = function () { return this; }; - Subscriber.create = function (next, error, complete) { - var subscriber = new Subscriber(next, error, complete); - subscriber.syncErrorThrowable = false; - return subscriber; - }; - Subscriber.prototype.next = function (value) { - if (!this.isStopped) { - this._next(value); - } - }; - Subscriber.prototype.error = function (err) { - if (!this.isStopped) { - this.isStopped = true; - this._error(err); - } - }; - Subscriber.prototype.complete = function () { - if (!this.isStopped) { - this.isStopped = true; - this._complete(); - } - }; - Subscriber.prototype.unsubscribe = function () { - if (this.closed) { - return; - } - this.isStopped = true; - _super.prototype.unsubscribe.call(this); - }; - Subscriber.prototype._next = function (value) { - this.destination.next(value); - }; - Subscriber.prototype._error = function (err) { - this.destination.error(err); - this.unsubscribe(); - }; - Subscriber.prototype._complete = function () { - this.destination.complete(); - this.unsubscribe(); - }; - Subscriber.prototype._unsubscribeAndRecycle = function () { - var _a = this, _parent = _a._parent, _parents = _a._parents; - this._parent = null; - this._parents = null; - this.unsubscribe(); - this.closed = false; - this.isStopped = false; - this._parent = _parent; - this._parents = _parents; - this._parentSubscription = null; - return this; - }; - return Subscriber; -}(__WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */])); - -var SafeSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SafeSubscriber, _super); - function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) { - var _this = _super.call(this) || this; - _this._parentSubscriber = _parentSubscriber; - var next; - var context = _this; - if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isFunction__["a" /* isFunction */])(observerOrNext)) { - next = observerOrNext; - } - else if (observerOrNext) { - next = observerOrNext.next; - error = observerOrNext.error; - complete = observerOrNext.complete; - if (observerOrNext !== __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */]) { - context = Object.create(observerOrNext); - if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isFunction__["a" /* isFunction */])(context.unsubscribe)) { - _this.add(context.unsubscribe.bind(context)); - } - context.unsubscribe = _this.unsubscribe.bind(_this); - } - } - _this._context = context; - _this._next = next; - _this._error = error; - _this._complete = complete; - return _this; - } - SafeSubscriber.prototype.next = function (value) { - if (!this.isStopped && this._next) { - var _parentSubscriber = this._parentSubscriber; - if (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { - this.__tryOrUnsub(this._next, value); - } - else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) { - this.unsubscribe(); - } - } - }; - SafeSubscriber.prototype.error = function (err) { - if (!this.isStopped) { - var _parentSubscriber = this._parentSubscriber; - var useDeprecatedSynchronousErrorHandling = __WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling; - if (this._error) { - if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { - this.__tryOrUnsub(this._error, err); - this.unsubscribe(); - } - else { - this.__tryOrSetError(_parentSubscriber, this._error, err); - this.unsubscribe(); - } - } - else if (!_parentSubscriber.syncErrorThrowable) { - this.unsubscribe(); - if (useDeprecatedSynchronousErrorHandling) { - throw err; - } - __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err); - } - else { - if (useDeprecatedSynchronousErrorHandling) { - _parentSubscriber.syncErrorValue = err; - _parentSubscriber.syncErrorThrown = true; - } - else { - __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err); - } - this.unsubscribe(); - } - } - }; - SafeSubscriber.prototype.complete = function () { - var _this = this; - if (!this.isStopped) { - var _parentSubscriber = this._parentSubscriber; - if (this._complete) { - var wrappedComplete = function () { return _this._complete.call(_this._context); }; - if (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { - this.__tryOrUnsub(wrappedComplete); - this.unsubscribe(); - } - else { - this.__tryOrSetError(_parentSubscriber, wrappedComplete); - this.unsubscribe(); - } - } - else { - this.unsubscribe(); - } - } - }; - SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) { - try { - fn.call(this._context, value); - } - catch (err) { - this.unsubscribe(); - if (__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) { - throw err; - } - else { - __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err); - } - } - }; - SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) { - if (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) { - throw new Error('bad call'); - } - try { - fn.call(this._context, value); - } - catch (err) { - if (__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) { - parent.syncErrorValue = err; - parent.syncErrorThrown = true; - return true; - } - else { - __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err); - return true; - } - } - return false; - }; - SafeSubscriber.prototype._unsubscribe = function () { - var _parentSubscriber = this._parentSubscriber; - this._context = null; - this._parentSubscriber = null; - _parentSubscriber.unsubscribe(); - }; - return SafeSubscriber; -}(Subscriber)); - -//# sourceMappingURL=Subscriber.js.map - - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getPathKey = getPathKey; -const os = __webpack_require__(49); -const path = __webpack_require__(0); -const userHome = __webpack_require__(66).default; - -var _require = __webpack_require__(225); - -const getCacheDir = _require.getCacheDir, - getConfigDir = _require.getConfigDir, - getDataDir = _require.getDataDir; - -const isWebpackBundle = __webpack_require__(278); - -const DEPENDENCY_TYPES = exports.DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies', 'peerDependencies']; -const OWNED_DEPENDENCY_TYPES = exports.OWNED_DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies']; - -const RESOLUTIONS = exports.RESOLUTIONS = 'resolutions'; -const MANIFEST_FIELDS = exports.MANIFEST_FIELDS = [RESOLUTIONS, ...DEPENDENCY_TYPES]; - -const SUPPORTED_NODE_VERSIONS = exports.SUPPORTED_NODE_VERSIONS = '^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0'; - -const YARN_REGISTRY = exports.YARN_REGISTRY = 'https://registry.yarnpkg.com'; -const NPM_REGISTRY_RE = exports.NPM_REGISTRY_RE = /https?:\/\/registry\.npmjs\.org/g; - -const YARN_DOCS = exports.YARN_DOCS = 'https://yarnpkg.com/en/docs/cli/'; -const YARN_INSTALLER_SH = exports.YARN_INSTALLER_SH = 'https://yarnpkg.com/install.sh'; -const YARN_INSTALLER_MSI = exports.YARN_INSTALLER_MSI = 'https://yarnpkg.com/latest.msi'; - -const SELF_UPDATE_VERSION_URL = exports.SELF_UPDATE_VERSION_URL = 'https://yarnpkg.com/latest-version'; - -// cache version, bump whenever we make backwards incompatible changes -const CACHE_VERSION = exports.CACHE_VERSION = 4; - -// lockfile version, bump whenever we make backwards incompatible changes -const LOCKFILE_VERSION = exports.LOCKFILE_VERSION = 1; - -// max amount of network requests to perform concurrently -const NETWORK_CONCURRENCY = exports.NETWORK_CONCURRENCY = 8; - -// HTTP timeout used when downloading packages -const NETWORK_TIMEOUT = exports.NETWORK_TIMEOUT = 30 * 1000; // in milliseconds - -// max amount of child processes to execute concurrently -const CHILD_CONCURRENCY = exports.CHILD_CONCURRENCY = 5; - -const REQUIRED_PACKAGE_KEYS = exports.REQUIRED_PACKAGE_KEYS = ['name', 'version', '_uid']; - -function getPreferredCacheDirectories() { - const preferredCacheDirectories = [getCacheDir()]; - - if (process.getuid) { - // $FlowFixMe: process.getuid exists, dammit - preferredCacheDirectories.push(path.join(os.tmpdir(), `.yarn-cache-${process.getuid()}`)); - } - - preferredCacheDirectories.push(path.join(os.tmpdir(), `.yarn-cache`)); - - return preferredCacheDirectories; -} - -const PREFERRED_MODULE_CACHE_DIRECTORIES = exports.PREFERRED_MODULE_CACHE_DIRECTORIES = getPreferredCacheDirectories(); -const CONFIG_DIRECTORY = exports.CONFIG_DIRECTORY = getConfigDir(); -const DATA_DIRECTORY = exports.DATA_DIRECTORY = getDataDir(); -const LINK_REGISTRY_DIRECTORY = exports.LINK_REGISTRY_DIRECTORY = path.join(DATA_DIRECTORY, 'link'); -const GLOBAL_MODULE_DIRECTORY = exports.GLOBAL_MODULE_DIRECTORY = path.join(DATA_DIRECTORY, 'global'); - -const NODE_BIN_PATH = exports.NODE_BIN_PATH = process.execPath; -const YARN_BIN_PATH = exports.YARN_BIN_PATH = getYarnBinPath(); - -// Webpack needs to be configured with node.__dirname/__filename = false -function getYarnBinPath() { - if (isWebpackBundle) { - return __filename; - } else { - return path.join(__dirname, '..', 'bin', 'yarn.js'); - } -} - -const NODE_MODULES_FOLDER = exports.NODE_MODULES_FOLDER = 'node_modules'; -const NODE_PACKAGE_JSON = exports.NODE_PACKAGE_JSON = 'package.json'; - -const PNP_FILENAME = exports.PNP_FILENAME = '.pnp.js'; - -const POSIX_GLOBAL_PREFIX = exports.POSIX_GLOBAL_PREFIX = `${process.env.DESTDIR || ''}/usr/local`; -const FALLBACK_GLOBAL_PREFIX = exports.FALLBACK_GLOBAL_PREFIX = path.join(userHome, '.yarn'); - -const META_FOLDER = exports.META_FOLDER = '.yarn-meta'; -const INTEGRITY_FILENAME = exports.INTEGRITY_FILENAME = '.yarn-integrity'; -const LOCKFILE_FILENAME = exports.LOCKFILE_FILENAME = 'yarn.lock'; -const METADATA_FILENAME = exports.METADATA_FILENAME = '.yarn-metadata.json'; -const TARBALL_FILENAME = exports.TARBALL_FILENAME = '.yarn-tarball.tgz'; -const CLEAN_FILENAME = exports.CLEAN_FILENAME = '.yarnclean'; - -const NPM_LOCK_FILENAME = exports.NPM_LOCK_FILENAME = 'package-lock.json'; -const NPM_SHRINKWRAP_FILENAME = exports.NPM_SHRINKWRAP_FILENAME = 'npm-shrinkwrap.json'; - -const DEFAULT_INDENT = exports.DEFAULT_INDENT = ' '; -const SINGLE_INSTANCE_PORT = exports.SINGLE_INSTANCE_PORT = 31997; -const SINGLE_INSTANCE_FILENAME = exports.SINGLE_INSTANCE_FILENAME = '.yarn-single-instance'; - -const ENV_PATH_KEY = exports.ENV_PATH_KEY = getPathKey(process.platform, process.env); - -function getPathKey(platform, env) { - let pathKey = 'PATH'; - - // windows calls its path "Path" usually, but this is not guaranteed. - if (platform === 'win32') { - pathKey = 'Path'; - - for (const key in env) { - if (key.toLowerCase() === 'path') { - pathKey = key; - } - } - } - - return pathKey; -} - -const VERSION_COLOR_SCHEME = exports.VERSION_COLOR_SCHEME = { - major: 'red', - premajor: 'red', - minor: 'yellow', - preminor: 'yellow', - patch: 'green', - prepatch: 'green', - prerelease: 'red', - unchanged: 'white', - unknown: 'red' -}; - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -/** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ - -var NODE_ENV = process.env.NODE_ENV; - -var invariant = function(condition, format, a, b, c, d, e, f) { - if (NODE_ENV !== 'production') { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); - } - } - - if (!condition) { - var error; - if (format === undefined) { - error = new Error( - 'Minified exception occurred; use the non-minified dev environment ' + - 'for the full error message and additional helpful warnings.' - ); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error( - format.replace(/%s/g, function() { return args[argIndex++]; }) - ); - error.name = 'Invariant Violation'; - } - - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } -}; - -module.exports = invariant; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var YAMLException = __webpack_require__(54); - -var TYPE_CONSTRUCTOR_OPTIONS = [ - 'kind', - 'resolve', - 'construct', - 'instanceOf', - 'predicate', - 'represent', - 'defaultStyle', - 'styleAliases' -]; - -var YAML_NODE_KINDS = [ - 'scalar', - 'sequence', - 'mapping' -]; - -function compileStyleAliases(map) { - var result = {}; - - if (map !== null) { - Object.keys(map).forEach(function (style) { - map[style].forEach(function (alias) { - result[String(alias)] = style; - }); - }); - } - - return result; -} - -function Type(tag, options) { - options = options || {}; - - Object.keys(options).forEach(function (name) { - if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { - throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); - } - }); - - // TODO: Add tag format check. - this.tag = tag; - this.kind = options['kind'] || null; - this.resolve = options['resolve'] || function () { return true; }; - this.construct = options['construct'] || function (data) { return data; }; - this.instanceOf = options['instanceOf'] || null; - this.predicate = options['predicate'] || null; - this.represent = options['represent'] || null; - this.defaultStyle = options['defaultStyle'] || null; - this.styleAliases = compileStyleAliases(options['styleAliases'] || null); - - if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { - throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); - } -} - -module.exports = Type; - - -/***/ }), -/* 11 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Observable; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_canReportError__ = __webpack_require__(322); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_toSubscriber__ = __webpack_require__(932); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_symbol_observable__ = __webpack_require__(117); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_pipe__ = __webpack_require__(324); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__config__ = __webpack_require__(185); -/** PURE_IMPORTS_START _util_canReportError,_util_toSubscriber,_internal_symbol_observable,_util_pipe,_config PURE_IMPORTS_END */ - - - - - -var Observable = /*@__PURE__*/ (function () { - function Observable(subscribe) { - this._isScalar = false; - if (subscribe) { - this._subscribe = subscribe; - } - } - Observable.prototype.lift = function (operator) { - var observable = new Observable(); - observable.source = this; - observable.operator = operator; - return observable; - }; - Observable.prototype.subscribe = function (observerOrNext, error, complete) { - var operator = this.operator; - var sink = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_toSubscriber__["a" /* toSubscriber */])(observerOrNext, error, complete); - if (operator) { - operator.call(sink, this.source); - } - else { - sink.add(this.source || (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ? - this._subscribe(sink) : - this._trySubscribe(sink)); - } - if (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) { - if (sink.syncErrorThrowable) { - sink.syncErrorThrowable = false; - if (sink.syncErrorThrown) { - throw sink.syncErrorValue; - } - } - } - return sink; - }; - Observable.prototype._trySubscribe = function (sink) { - try { - return this._subscribe(sink); - } - catch (err) { - if (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) { - sink.syncErrorThrown = true; - sink.syncErrorValue = err; - } - if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_canReportError__["a" /* canReportError */])(sink)) { - sink.error(err); - } - else { - console.warn(err); - } - } - }; - Observable.prototype.forEach = function (next, promiseCtor) { - var _this = this; - promiseCtor = getPromiseCtor(promiseCtor); - return new promiseCtor(function (resolve, reject) { - var subscription; - subscription = _this.subscribe(function (value) { - try { - next(value); - } - catch (err) { - reject(err); - if (subscription) { - subscription.unsubscribe(); - } - } - }, reject, resolve); - }); - }; - Observable.prototype._subscribe = function (subscriber) { - var source = this.source; - return source && source.subscribe(subscriber); - }; - Observable.prototype[__WEBPACK_IMPORTED_MODULE_2__internal_symbol_observable__["a" /* observable */]] = function () { - return this; - }; - Observable.prototype.pipe = function () { - var operations = []; - for (var _i = 0; _i < arguments.length; _i++) { - operations[_i] = arguments[_i]; - } - if (operations.length === 0) { - return this; - } - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_pipe__["b" /* pipeFromArray */])(operations)(this); - }; - Observable.prototype.toPromise = function (promiseCtor) { - var _this = this; - promiseCtor = getPromiseCtor(promiseCtor); - return new promiseCtor(function (resolve, reject) { - var value; - _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); }); - }); - }; - Observable.create = function (subscribe) { - return new Observable(subscribe); - }; - return Observable; -}()); - -function getPromiseCtor(promiseCtor) { - if (!promiseCtor) { - promiseCtor = __WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].Promise || Promise; - } - if (!promiseCtor) { - throw new Error('no Promise impl found'); - } - return promiseCtor; -} -//# sourceMappingURL=Observable.js.map - - -/***/ }), -/* 12 */ -/***/ (function(module, exports) { - -module.exports = require("crypto"); - -/***/ }), -/* 13 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return OuterSubscriber; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); -/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ - - -var OuterSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](OuterSubscriber, _super); - function OuterSubscriber() { - return _super !== null && _super.apply(this, arguments) || this; - } - OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { - this.destination.next(innerValue); - }; - OuterSubscriber.prototype.notifyError = function (error, innerSub) { - this.destination.error(error); - }; - OuterSubscriber.prototype.notifyComplete = function (innerSub) { - this.destination.complete(); - }; - return OuterSubscriber; -}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); - -//# sourceMappingURL=OuterSubscriber.js.map - - -/***/ }), -/* 14 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = subscribeToResult; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__InnerSubscriber__ = __webpack_require__(84); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__subscribeTo__ = __webpack_require__(446); -/** PURE_IMPORTS_START _InnerSubscriber,_subscribeTo PURE_IMPORTS_END */ - - -function subscribeToResult(outerSubscriber, result, outerValue, outerIndex, destination) { - if (destination === void 0) { - destination = new __WEBPACK_IMPORTED_MODULE_0__InnerSubscriber__["a" /* InnerSubscriber */](outerSubscriber, outerValue, outerIndex); - } - if (destination.closed) { - return; - } - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__subscribeTo__["a" /* subscribeTo */])(result)(destination); -} -//# sourceMappingURL=subscribeToResult.js.map - - -/***/ }), -/* 15 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* eslint-disable node/no-deprecated-api */ - - - -var buffer = __webpack_require__(64) -var Buffer = buffer.Buffer - -var safer = {} - -var key - -for (key in buffer) { - if (!buffer.hasOwnProperty(key)) continue - if (key === 'SlowBuffer' || key === 'Buffer') continue - safer[key] = buffer[key] -} - -var Safer = safer.Buffer = {} -for (key in Buffer) { - if (!Buffer.hasOwnProperty(key)) continue - if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue - Safer[key] = Buffer[key] -} - -safer.Buffer.prototype = Buffer.prototype - -if (!Safer.from || Safer.from === Uint8Array.from) { - Safer.from = function (value, encodingOrOffset, length) { - if (typeof value === 'number') { - throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value) - } - if (value && typeof value.length === 'undefined') { - throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value) - } - return Buffer(value, encodingOrOffset, length) - } -} - -if (!Safer.alloc) { - Safer.alloc = function (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) - } - if (size < 0 || size >= 2 * (1 << 30)) { - throw new RangeError('The value "' + size + '" is invalid for option "size"') - } - var buf = Buffer(size) - if (!fill || fill.length === 0) { - buf.fill(0) - } else if (typeof encoding === 'string') { - buf.fill(fill, encoding) - } else { - buf.fill(fill) - } - return buf - } -} - -if (!safer.kStringMaxLength) { - try { - safer.kStringMaxLength = process.binding('buffer').kStringMaxLength - } catch (e) { - // we can't determine kStringMaxLength in environments where process.binding - // is unsupported, so let's not set it - } -} - -if (!safer.constants) { - safer.constants = { - MAX_LENGTH: safer.kMaxLength - } - if (safer.kStringMaxLength) { - safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength - } -} - -module.exports = safer - - -/***/ }), -/* 16 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright (c) 2012, Mark Cavage. All rights reserved. -// Copyright 2015 Joyent, Inc. - -var assert = __webpack_require__(28); -var Stream = __webpack_require__(23).Stream; -var util = __webpack_require__(3); - - -///--- Globals - -/* JSSTYLED */ -var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/; - - -///--- Internal - -function _capitalize(str) { - return (str.charAt(0).toUpperCase() + str.slice(1)); -} - -function _toss(name, expected, oper, arg, actual) { - throw new assert.AssertionError({ - message: util.format('%s (%s) is required', name, expected), - actual: (actual === undefined) ? typeof (arg) : actual(arg), - expected: expected, - operator: oper || '===', - stackStartFunction: _toss.caller - }); -} - -function _getClass(arg) { - return (Object.prototype.toString.call(arg).slice(8, -1)); -} - -function noop() { - // Why even bother with asserts? -} - - -///--- Exports - -var types = { - bool: { - check: function (arg) { return typeof (arg) === 'boolean'; } - }, - func: { - check: function (arg) { return typeof (arg) === 'function'; } - }, - string: { - check: function (arg) { return typeof (arg) === 'string'; } - }, - object: { - check: function (arg) { - return typeof (arg) === 'object' && arg !== null; - } - }, - number: { - check: function (arg) { - return typeof (arg) === 'number' && !isNaN(arg); - } - }, - finite: { - check: function (arg) { - return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg); - } - }, - buffer: { - check: function (arg) { return Buffer.isBuffer(arg); }, - operator: 'Buffer.isBuffer' - }, - array: { - check: function (arg) { return Array.isArray(arg); }, - operator: 'Array.isArray' - }, - stream: { - check: function (arg) { return arg instanceof Stream; }, - operator: 'instanceof', - actual: _getClass - }, - date: { - check: function (arg) { return arg instanceof Date; }, - operator: 'instanceof', - actual: _getClass - }, - regexp: { - check: function (arg) { return arg instanceof RegExp; }, - operator: 'instanceof', - actual: _getClass - }, - uuid: { - check: function (arg) { - return typeof (arg) === 'string' && UUID_REGEXP.test(arg); - }, - operator: 'isUUID' - } -}; - -function _setExports(ndebug) { - var keys = Object.keys(types); - var out; - - /* re-export standard assert */ - if (process.env.NODE_NDEBUG) { - out = noop; - } else { - out = function (arg, msg) { - if (!arg) { - _toss(msg, 'true', arg); - } - }; - } - - /* standard checks */ - keys.forEach(function (k) { - if (ndebug) { - out[k] = noop; - return; - } - var type = types[k]; - out[k] = function (arg, msg) { - if (!type.check(arg)) { - _toss(msg, k, type.operator, arg, type.actual); - } - }; - }); - - /* optional checks */ - keys.forEach(function (k) { - var name = 'optional' + _capitalize(k); - if (ndebug) { - out[name] = noop; - return; - } - var type = types[k]; - out[name] = function (arg, msg) { - if (arg === undefined || arg === null) { - return; - } - if (!type.check(arg)) { - _toss(msg, k, type.operator, arg, type.actual); - } - }; - }); - - /* arrayOf checks */ - keys.forEach(function (k) { - var name = 'arrayOf' + _capitalize(k); - if (ndebug) { - out[name] = noop; - return; - } - var type = types[k]; - var expected = '[' + k + ']'; - out[name] = function (arg, msg) { - if (!Array.isArray(arg)) { - _toss(msg, expected, type.operator, arg, type.actual); - } - var i; - for (i = 0; i < arg.length; i++) { - if (!type.check(arg[i])) { - _toss(msg, expected, type.operator, arg, type.actual); - } - } - }; - }); - - /* optionalArrayOf checks */ - keys.forEach(function (k) { - var name = 'optionalArrayOf' + _capitalize(k); - if (ndebug) { - out[name] = noop; - return; - } - var type = types[k]; - var expected = '[' + k + ']'; - out[name] = function (arg, msg) { - if (arg === undefined || arg === null) { - return; - } - if (!Array.isArray(arg)) { - _toss(msg, expected, type.operator, arg, type.actual); - } - var i; - for (i = 0; i < arg.length; i++) { - if (!type.check(arg[i])) { - _toss(msg, expected, type.operator, arg, type.actual); - } - } - }; - }); - - /* re-export built-in assertions */ - Object.keys(assert).forEach(function (k) { - if (k === 'AssertionError') { - out[k] = assert[k]; - return; - } - if (ndebug) { - out[k] = noop; - return; - } - out[k] = assert[k]; - }); - - /* export ourselves (for unit tests _only_) */ - out._setExports = _setExports; - - return out; -} - -module.exports = _setExports(process.env.NODE_NDEBUG); - - -/***/ }), -/* 17 */ -/***/ (function(module, exports) { - -// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 -var global = module.exports = typeof window != 'undefined' && window.Math == Math - ? window : typeof self != 'undefined' && self.Math == Math ? self - // eslint-disable-next-line no-new-func - : Function('return this')(); -if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef - - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.sortAlpha = sortAlpha; -exports.sortOptionsByFlags = sortOptionsByFlags; -exports.entries = entries; -exports.removePrefix = removePrefix; -exports.removeSuffix = removeSuffix; -exports.addSuffix = addSuffix; -exports.hyphenate = hyphenate; -exports.camelCase = camelCase; -exports.compareSortedArrays = compareSortedArrays; -exports.sleep = sleep; -const _camelCase = __webpack_require__(230); - -function sortAlpha(a, b) { - // sort alphabetically in a deterministic way - const shortLen = Math.min(a.length, b.length); - for (let i = 0; i < shortLen; i++) { - const aChar = a.charCodeAt(i); - const bChar = b.charCodeAt(i); - if (aChar !== bChar) { - return aChar - bChar; - } - } - return a.length - b.length; -} - -function sortOptionsByFlags(a, b) { - const aOpt = a.flags.replace(/-/g, ''); - const bOpt = b.flags.replace(/-/g, ''); - return sortAlpha(aOpt, bOpt); -} - -function entries(obj) { - const entries = []; - if (obj) { - for (const key in obj) { - entries.push([key, obj[key]]); - } - } - return entries; -} - -function removePrefix(pattern, prefix) { - if (pattern.startsWith(prefix)) { - pattern = pattern.slice(prefix.length); - } - - return pattern; -} - -function removeSuffix(pattern, suffix) { - if (pattern.endsWith(suffix)) { - return pattern.slice(0, -suffix.length); - } - - return pattern; -} - -function addSuffix(pattern, suffix) { - if (!pattern.endsWith(suffix)) { - return pattern + suffix; - } - - return pattern; -} - -function hyphenate(str) { - return str.replace(/[A-Z]/g, match => { - return '-' + match.charAt(0).toLowerCase(); - }); -} - -function camelCase(str) { - if (/[A-Z]/.test(str)) { - return null; - } else { - return _camelCase(str); - } -} - -function compareSortedArrays(array1, array2) { - if (array1.length !== array2.length) { - return false; - } - for (let i = 0, len = array1.length; i < len; i++) { - if (array1[i] !== array2[i]) { - return false; - } - } - return true; -} - -function sleep(ms) { - return new Promise(resolve => { - setTimeout(resolve, ms); - }); -} - -/***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.stringify = exports.parse = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _parse; - -function _load_parse() { - return _parse = __webpack_require__(105); -} - -Object.defineProperty(exports, 'parse', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_parse || _load_parse()).default; - } -}); - -var _stringify; - -function _load_stringify() { - return _stringify = __webpack_require__(199); -} - -Object.defineProperty(exports, 'stringify', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_stringify || _load_stringify()).default; - } -}); -exports.implodeEntry = implodeEntry; -exports.explodeEntry = explodeEntry; - -var _misc; - -function _load_misc() { - return _misc = __webpack_require__(18); -} - -var _normalizePattern; - -function _load_normalizePattern() { - return _normalizePattern = __webpack_require__(37); -} - -var _parse2; - -function _load_parse2() { - return _parse2 = _interopRequireDefault(__webpack_require__(105)); -} - -var _constants; - -function _load_constants() { - return _constants = __webpack_require__(8); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const invariant = __webpack_require__(9); - -const path = __webpack_require__(0); -const ssri = __webpack_require__(77); - -function getName(pattern) { - return (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern).name; -} - -function blankObjectUndefined(obj) { - return obj && Object.keys(obj).length ? obj : undefined; -} - -function keyForRemote(remote) { - return remote.resolved || (remote.reference && remote.hash ? `${remote.reference}#${remote.hash}` : null); -} - -function serializeIntegrity(integrity) { - // We need this because `Integrity.toString()` does not use sorting to ensure a stable string output - // See https://git.io/vx2Hy - return integrity.toString().split(' ').sort().join(' '); -} - -function implodeEntry(pattern, obj) { - const inferredName = getName(pattern); - const integrity = obj.integrity ? serializeIntegrity(obj.integrity) : ''; - const imploded = { - name: inferredName === obj.name ? undefined : obj.name, - version: obj.version, - uid: obj.uid === obj.version ? undefined : obj.uid, - resolved: obj.resolved, - registry: obj.registry === 'npm' ? undefined : obj.registry, - dependencies: blankObjectUndefined(obj.dependencies), - optionalDependencies: blankObjectUndefined(obj.optionalDependencies), - permissions: blankObjectUndefined(obj.permissions), - prebuiltVariants: blankObjectUndefined(obj.prebuiltVariants) - }; - if (integrity) { - imploded.integrity = integrity; - } - return imploded; -} - -function explodeEntry(pattern, obj) { - obj.optionalDependencies = obj.optionalDependencies || {}; - obj.dependencies = obj.dependencies || {}; - obj.uid = obj.uid || obj.version; - obj.permissions = obj.permissions || {}; - obj.registry = obj.registry || 'npm'; - obj.name = obj.name || getName(pattern); - const integrity = obj.integrity; - if (integrity && integrity.isIntegrity) { - obj.integrity = ssri.parse(integrity); - } - return obj; -} - -class Lockfile { - constructor({ cache, source, parseResultType } = {}) { - this.source = source || ''; - this.cache = cache; - this.parseResultType = parseResultType; - } - - // source string if the `cache` was parsed - - - // if true, we're parsing an old yarn file and need to update integrity fields - hasEntriesExistWithoutIntegrity() { - if (!this.cache) { - return false; - } - - for (const key in this.cache) { - // $FlowFixMe - `this.cache` is clearly defined at this point - if (!/^.*@(file:|http)/.test(key) && this.cache[key] && !this.cache[key].integrity) { - return true; - } - } - - return false; - } - - static fromDirectory(dir, reporter) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // read the manifest in this directory - const lockfileLoc = path.join(dir, (_constants || _load_constants()).LOCKFILE_FILENAME); - - let lockfile; - let rawLockfile = ''; - let parseResult; - - if (yield (_fs || _load_fs()).exists(lockfileLoc)) { - rawLockfile = yield (_fs || _load_fs()).readFile(lockfileLoc); - parseResult = (0, (_parse2 || _load_parse2()).default)(rawLockfile, lockfileLoc); - - if (reporter) { - if (parseResult.type === 'merge') { - reporter.info(reporter.lang('lockfileMerged')); - } else if (parseResult.type === 'conflict') { - reporter.warn(reporter.lang('lockfileConflict')); - } - } - - lockfile = parseResult.object; - } else if (reporter) { - reporter.info(reporter.lang('noLockfileFound')); - } - - return new Lockfile({ cache: lockfile, source: rawLockfile, parseResultType: parseResult && parseResult.type }); - })(); - } - - getLocked(pattern) { - const cache = this.cache; - if (!cache) { - return undefined; - } - - const shrunk = pattern in cache && cache[pattern]; - - if (typeof shrunk === 'string') { - return this.getLocked(shrunk); - } else if (shrunk) { - explodeEntry(pattern, shrunk); - return shrunk; - } - - return undefined; - } - - removePattern(pattern) { - const cache = this.cache; - if (!cache) { - return; - } - delete cache[pattern]; - } - - getLockfile(patterns) { - const lockfile = {}; - const seen = new Map(); - - // order by name so that lockfile manifest is assigned to the first dependency with this manifest - // the others that have the same remoteKey will just refer to the first - // ordering allows for consistency in lockfile when it is serialized - const sortedPatternsKeys = Object.keys(patterns).sort((_misc || _load_misc()).sortAlpha); - - for (var _iterator = sortedPatternsKeys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - const pattern = _ref; - - const pkg = patterns[pattern]; - const remote = pkg._remote, - ref = pkg._reference; - - invariant(ref, 'Package is missing a reference'); - invariant(remote, 'Package is missing a remote'); - - const remoteKey = keyForRemote(remote); - const seenPattern = remoteKey && seen.get(remoteKey); - if (seenPattern) { - // no point in duplicating it - lockfile[pattern] = seenPattern; - - // if we're relying on our name being inferred and two of the patterns have - // different inferred names then we need to set it - if (!seenPattern.name && getName(pattern) !== pkg.name) { - seenPattern.name = pkg.name; - } - continue; - } - const obj = implodeEntry(pattern, { - name: pkg.name, - version: pkg.version, - uid: pkg._uid, - resolved: remote.resolved, - integrity: remote.integrity, - registry: remote.registry, - dependencies: pkg.dependencies, - peerDependencies: pkg.peerDependencies, - optionalDependencies: pkg.optionalDependencies, - permissions: ref.permissions, - prebuiltVariants: pkg.prebuiltVariants - }); - - lockfile[pattern] = obj; - - if (remoteKey) { - seen.set(remoteKey, obj); - } - } - - return lockfile; - } -} -exports.default = Lockfile; - -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { - -var store = __webpack_require__(133)('wks'); -var uid = __webpack_require__(137); -var Symbol = __webpack_require__(17).Symbol; -var USE_SYMBOL = typeof Symbol == 'function'; - -var $exports = module.exports = function (name) { - return store[name] || (store[name] = - USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); -}; - -$exports.store = store; - - -/***/ }), -/* 21 */ -/***/ (function(module, exports) { - -exports = module.exports = SemVer; - -// The debug function is excluded entirely from the minified version. -/* nomin */ var debug; -/* nomin */ if (typeof process === 'object' && - /* nomin */ process.env && - /* nomin */ process.env.NODE_DEBUG && - /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG)) - /* nomin */ debug = function() { - /* nomin */ var args = Array.prototype.slice.call(arguments, 0); - /* nomin */ args.unshift('SEMVER'); - /* nomin */ console.log.apply(console, args); - /* nomin */ }; -/* nomin */ else - /* nomin */ debug = function() {}; - -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -exports.SEMVER_SPEC_VERSION = '2.0.0'; - -var MAX_LENGTH = 256; -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; - -// Max safe segment length for coercion. -var MAX_SAFE_COMPONENT_LENGTH = 16; - -// The actual regexps go on exports.re -var re = exports.re = []; -var src = exports.src = []; -var R = 0; - -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. - -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - -var NUMERICIDENTIFIER = R++; -src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; -var NUMERICIDENTIFIERLOOSE = R++; -src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; - - -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -var NONNUMERICIDENTIFIER = R++; -src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; - - -// ## Main Version -// Three dot-separated numeric identifiers. - -var MAINVERSION = R++; -src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')'; - -var MAINVERSIONLOOSE = R++; -src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; - -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -var PRERELEASEIDENTIFIER = R++; -src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + - '|' + src[NONNUMERICIDENTIFIER] + ')'; - -var PRERELEASEIDENTIFIERLOOSE = R++; -src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + - '|' + src[NONNUMERICIDENTIFIER] + ')'; - - -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -var PRERELEASE = R++; -src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + - '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; - -var PRERELEASELOOSE = R++; -src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + - '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; - -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -var BUILDIDENTIFIER = R++; -src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; - -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -var BUILD = R++; -src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + - '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; - - -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. - -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. - -var FULL = R++; -var FULLPLAIN = 'v?' + src[MAINVERSION] + - src[PRERELEASE] + '?' + - src[BUILD] + '?'; - -src[FULL] = '^' + FULLPLAIN + '$'; - -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + - src[PRERELEASELOOSE] + '?' + - src[BUILD] + '?'; - -var LOOSE = R++; -src[LOOSE] = '^' + LOOSEPLAIN + '$'; - -var GTLT = R++; -src[GTLT] = '((?:<|>)?=?)'; - -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -var XRANGEIDENTIFIERLOOSE = R++; -src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; -var XRANGEIDENTIFIER = R++; -src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; - -var XRANGEPLAIN = R++; -src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:' + src[PRERELEASE] + ')?' + - src[BUILD] + '?' + - ')?)?'; - -var XRANGEPLAINLOOSE = R++; -src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:' + src[PRERELEASELOOSE] + ')?' + - src[BUILD] + '?' + - ')?)?'; - -var XRANGE = R++; -src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; -var XRANGELOOSE = R++; -src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; - -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -var COERCE = R++; -src[COERCE] = '(?:^|[^\\d])' + - '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:$|[^\\d])'; - -// Tilde ranges. -// Meaning is "reasonably at or greater than" -var LONETILDE = R++; -src[LONETILDE] = '(?:~>?)'; - -var TILDETRIM = R++; -src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; -re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); -var tildeTrimReplace = '$1~'; - -var TILDE = R++; -src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; -var TILDELOOSE = R++; -src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; - -// Caret ranges. -// Meaning is "at least and backwards compatible with" -var LONECARET = R++; -src[LONECARET] = '(?:\\^)'; - -var CARETTRIM = R++; -src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; -re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); -var caretTrimReplace = '$1^'; - -var CARET = R++; -src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; -var CARETLOOSE = R++; -src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; - -// A simple gt/lt/eq thing, or just "" to indicate "any version" -var COMPARATORLOOSE = R++; -src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; -var COMPARATOR = R++; -src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; - - -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -var COMPARATORTRIM = R++; -src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + - '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; - -// this one has to use the /g flag -re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); -var comparatorTrimReplace = '$1$2$3'; - - -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -var HYPHENRANGE = R++; -src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAIN] + ')' + - '\\s*$'; - -var HYPHENRANGELOOSE = R++; -src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s*$'; - -// Star ranges basically just allow anything at all. -var STAR = R++; -src[STAR] = '(<|>)?=?\\s*\\*'; - -// Compile to actual regexp objects. -// All are flag-free, unless they were created above with a flag. -for (var i = 0; i < R; i++) { - debug(i, src[i]); - if (!re[i]) - re[i] = new RegExp(src[i]); -} - -exports.parse = parse; -function parse(version, loose) { - if (version instanceof SemVer) - return version; - - if (typeof version !== 'string') - return null; - - if (version.length > MAX_LENGTH) - return null; - - var r = loose ? re[LOOSE] : re[FULL]; - if (!r.test(version)) - return null; - - try { - return new SemVer(version, loose); - } catch (er) { - return null; - } -} - -exports.valid = valid; -function valid(version, loose) { - var v = parse(version, loose); - return v ? v.version : null; -} - - -exports.clean = clean; -function clean(version, loose) { - var s = parse(version.trim().replace(/^[=v]+/, ''), loose); - return s ? s.version : null; -} - -exports.SemVer = SemVer; - -function SemVer(version, loose) { - if (version instanceof SemVer) { - if (version.loose === loose) - return version; - else - version = version.version; - } else if (typeof version !== 'string') { - throw new TypeError('Invalid Version: ' + version); - } - - if (version.length > MAX_LENGTH) - throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') - - if (!(this instanceof SemVer)) - return new SemVer(version, loose); - - debug('SemVer', version, loose); - this.loose = loose; - var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); - - if (!m) - throw new TypeError('Invalid Version: ' + version); - - this.raw = version; - - // these are actually numbers - this.major = +m[1]; - this.minor = +m[2]; - this.patch = +m[3]; - - if (this.major > MAX_SAFE_INTEGER || this.major < 0) - throw new TypeError('Invalid major version') - - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) - throw new TypeError('Invalid minor version') - - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) - throw new TypeError('Invalid patch version') - - // numberify any prerelease numeric ids - if (!m[4]) - this.prerelease = []; - else - this.prerelease = m[4].split('.').map(function(id) { - if (/^[0-9]+$/.test(id)) { - var num = +id; - if (num >= 0 && num < MAX_SAFE_INTEGER) - return num; - } - return id; - }); - - this.build = m[5] ? m[5].split('.') : []; - this.format(); -} - -SemVer.prototype.format = function() { - this.version = this.major + '.' + this.minor + '.' + this.patch; - if (this.prerelease.length) - this.version += '-' + this.prerelease.join('.'); - return this.version; -}; - -SemVer.prototype.toString = function() { - return this.version; -}; - -SemVer.prototype.compare = function(other) { - debug('SemVer.compare', this.version, this.loose, other); - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - return this.compareMain(other) || this.comparePre(other); -}; - -SemVer.prototype.compareMain = function(other) { - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - return compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch); -}; - -SemVer.prototype.comparePre = function(other) { - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) - return -1; - else if (!this.prerelease.length && other.prerelease.length) - return 1; - else if (!this.prerelease.length && !other.prerelease.length) - return 0; - - var i = 0; - do { - var a = this.prerelease[i]; - var b = other.prerelease[i]; - debug('prerelease compare', i, a, b); - if (a === undefined && b === undefined) - return 0; - else if (b === undefined) - return 1; - else if (a === undefined) - return -1; - else if (a === b) - continue; - else - return compareIdentifiers(a, b); - } while (++i); -}; - -// preminor will bump the version up to the next minor release, and immediately -// down to pre-release. premajor and prepatch work the same way. -SemVer.prototype.inc = function(release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0; - this.patch = 0; - this.minor = 0; - this.major++; - this.inc('pre', identifier); - break; - case 'preminor': - this.prerelease.length = 0; - this.patch = 0; - this.minor++; - this.inc('pre', identifier); - break; - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0; - this.inc('patch', identifier); - this.inc('pre', identifier); - break; - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) - this.inc('patch', identifier); - this.inc('pre', identifier); - break; - - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) - this.major++; - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break; - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) - this.minor++; - this.patch = 0; - this.prerelease = []; - break; - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) - this.patch++; - this.prerelease = []; - break; - // This probably shouldn't be used publicly. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. - case 'pre': - if (this.prerelease.length === 0) - this.prerelease = [0]; - else { - var i = this.prerelease.length; - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++; - i = -2; - } - } - if (i === -1) // didn't increment anything - this.prerelease.push(0); - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) - this.prerelease = [identifier, 0]; - } else - this.prerelease = [identifier, 0]; - } - break; - - default: - throw new Error('invalid increment argument: ' + release); - } - this.format(); - this.raw = this.version; - return this; -}; - -exports.inc = inc; -function inc(version, release, loose, identifier) { - if (typeof(loose) === 'string') { - identifier = loose; - loose = undefined; - } - - try { - return new SemVer(version, loose).inc(release, identifier).version; - } catch (er) { - return null; - } -} - -exports.diff = diff; -function diff(version1, version2) { - if (eq(version1, version2)) { - return null; - } else { - var v1 = parse(version1); - var v2 = parse(version2); - if (v1.prerelease.length || v2.prerelease.length) { - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return 'pre'+key; - } - } - } - return 'prerelease'; - } - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return key; - } - } - } - } -} - -exports.compareIdentifiers = compareIdentifiers; - -var numeric = /^[0-9]+$/; -function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.test(b); - - if (anum && bnum) { - a = +a; - b = +b; - } - - return (anum && !bnum) ? -1 : - (bnum && !anum) ? 1 : - a < b ? -1 : - a > b ? 1 : - 0; -} - -exports.rcompareIdentifiers = rcompareIdentifiers; -function rcompareIdentifiers(a, b) { - return compareIdentifiers(b, a); -} - -exports.major = major; -function major(a, loose) { - return new SemVer(a, loose).major; -} - -exports.minor = minor; -function minor(a, loose) { - return new SemVer(a, loose).minor; -} - -exports.patch = patch; -function patch(a, loose) { - return new SemVer(a, loose).patch; -} - -exports.compare = compare; -function compare(a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)); -} - -exports.compareLoose = compareLoose; -function compareLoose(a, b) { - return compare(a, b, true); -} - -exports.rcompare = rcompare; -function rcompare(a, b, loose) { - return compare(b, a, loose); -} - -exports.sort = sort; -function sort(list, loose) { - return list.sort(function(a, b) { - return exports.compare(a, b, loose); - }); -} - -exports.rsort = rsort; -function rsort(list, loose) { - return list.sort(function(a, b) { - return exports.rcompare(a, b, loose); - }); -} - -exports.gt = gt; -function gt(a, b, loose) { - return compare(a, b, loose) > 0; -} - -exports.lt = lt; -function lt(a, b, loose) { - return compare(a, b, loose) < 0; -} - -exports.eq = eq; -function eq(a, b, loose) { - return compare(a, b, loose) === 0; -} - -exports.neq = neq; -function neq(a, b, loose) { - return compare(a, b, loose) !== 0; -} - -exports.gte = gte; -function gte(a, b, loose) { - return compare(a, b, loose) >= 0; -} - -exports.lte = lte; -function lte(a, b, loose) { - return compare(a, b, loose) <= 0; -} - -exports.cmp = cmp; -function cmp(a, op, b, loose) { - var ret; - switch (op) { - case '===': - if (typeof a === 'object') a = a.version; - if (typeof b === 'object') b = b.version; - ret = a === b; - break; - case '!==': - if (typeof a === 'object') a = a.version; - if (typeof b === 'object') b = b.version; - ret = a !== b; - break; - case '': case '=': case '==': ret = eq(a, b, loose); break; - case '!=': ret = neq(a, b, loose); break; - case '>': ret = gt(a, b, loose); break; - case '>=': ret = gte(a, b, loose); break; - case '<': ret = lt(a, b, loose); break; - case '<=': ret = lte(a, b, loose); break; - default: throw new TypeError('Invalid operator: ' + op); - } - return ret; -} - -exports.Comparator = Comparator; -function Comparator(comp, loose) { - if (comp instanceof Comparator) { - if (comp.loose === loose) - return comp; - else - comp = comp.value; - } - - if (!(this instanceof Comparator)) - return new Comparator(comp, loose); - - debug('comparator', comp, loose); - this.loose = loose; - this.parse(comp); - - if (this.semver === ANY) - this.value = ''; - else - this.value = this.operator + this.semver.version; - - debug('comp', this); -} - -var ANY = {}; -Comparator.prototype.parse = function(comp) { - var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; - var m = comp.match(r); - - if (!m) - throw new TypeError('Invalid comparator: ' + comp); - - this.operator = m[1]; - if (this.operator === '=') - this.operator = ''; - - // if it literally is just '>' or '' then allow anything. - if (!m[2]) - this.semver = ANY; - else - this.semver = new SemVer(m[2], this.loose); -}; - -Comparator.prototype.toString = function() { - return this.value; -}; - -Comparator.prototype.test = function(version) { - debug('Comparator.test', version, this.loose); - - if (this.semver === ANY) - return true; - - if (typeof version === 'string') - version = new SemVer(version, this.loose); - - return cmp(version, this.operator, this.semver, this.loose); -}; - -Comparator.prototype.intersects = function(comp, loose) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required'); - } - - var rangeTmp; - - if (this.operator === '') { - rangeTmp = new Range(comp.value, loose); - return satisfies(this.value, rangeTmp, loose); - } else if (comp.operator === '') { - rangeTmp = new Range(this.value, loose); - return satisfies(comp.semver, rangeTmp, loose); - } - - var sameDirectionIncreasing = - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '>=' || comp.operator === '>'); - var sameDirectionDecreasing = - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '<=' || comp.operator === '<'); - var sameSemVer = this.semver.version === comp.semver.version; - var differentDirectionsInclusive = - (this.operator === '>=' || this.operator === '<=') && - (comp.operator === '>=' || comp.operator === '<='); - var oppositeDirectionsLessThan = - cmp(this.semver, '<', comp.semver, loose) && - ((this.operator === '>=' || this.operator === '>') && - (comp.operator === '<=' || comp.operator === '<')); - var oppositeDirectionsGreaterThan = - cmp(this.semver, '>', comp.semver, loose) && - ((this.operator === '<=' || this.operator === '<') && - (comp.operator === '>=' || comp.operator === '>')); - - return sameDirectionIncreasing || sameDirectionDecreasing || - (sameSemVer && differentDirectionsInclusive) || - oppositeDirectionsLessThan || oppositeDirectionsGreaterThan; -}; - - -exports.Range = Range; -function Range(range, loose) { - if (range instanceof Range) { - if (range.loose === loose) { - return range; - } else { - return new Range(range.raw, loose); - } - } - - if (range instanceof Comparator) { - return new Range(range.value, loose); - } - - if (!(this instanceof Range)) - return new Range(range, loose); - - this.loose = loose; - - // First, split based on boolean or || - this.raw = range; - this.set = range.split(/\s*\|\|\s*/).map(function(range) { - return this.parseRange(range.trim()); - }, this).filter(function(c) { - // throw out any that are not relevant for whatever reason - return c.length; - }); - - if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range); - } - - this.format(); -} - -Range.prototype.format = function() { - this.range = this.set.map(function(comps) { - return comps.join(' ').trim(); - }).join('||').trim(); - return this.range; -}; - -Range.prototype.toString = function() { - return this.range; -}; - -Range.prototype.parseRange = function(range) { - var loose = this.loose; - range = range.trim(); - debug('range', range, loose); - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug('hyphen replace', range); - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); - debug('comparator trim', range, re[COMPARATORTRIM]); - - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[TILDETRIM], tildeTrimReplace); - - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[CARETTRIM], caretTrimReplace); - - // normalize spaces - range = range.split(/\s+/).join(' '); - - // At this point, the range is completely trimmed and - // ready to be split into comparators. - - var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; - var set = range.split(' ').map(function(comp) { - return parseComparator(comp, loose); - }).join(' ').split(/\s+/); - if (this.loose) { - // in loose mode, throw out any that are not valid comparators - set = set.filter(function(comp) { - return !!comp.match(compRe); - }); - } - set = set.map(function(comp) { - return new Comparator(comp, loose); - }); - - return set; -}; - -Range.prototype.intersects = function(range, loose) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required'); - } - - return this.set.some(function(thisComparators) { - return thisComparators.every(function(thisComparator) { - return range.set.some(function(rangeComparators) { - return rangeComparators.every(function(rangeComparator) { - return thisComparator.intersects(rangeComparator, loose); - }); - }); - }); - }); -}; - -// Mostly just for testing and legacy API reasons -exports.toComparators = toComparators; -function toComparators(range, loose) { - return new Range(range, loose).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(' ').trim().split(' '); - }); -} - -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -function parseComparator(comp, loose) { - debug('comp', comp); - comp = replaceCarets(comp, loose); - debug('caret', comp); - comp = replaceTildes(comp, loose); - debug('tildes', comp); - comp = replaceXRanges(comp, loose); - debug('xrange', comp); - comp = replaceStars(comp, loose); - debug('stars', comp); - return comp; -} - -function isX(id) { - return !id || id.toLowerCase() === 'x' || id === '*'; -} - -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 -function replaceTildes(comp, loose) { - return comp.trim().split(/\s+/).map(function(comp) { - return replaceTilde(comp, loose); - }).join(' '); -} - -function replaceTilde(comp, loose) { - var r = loose ? re[TILDELOOSE] : re[TILDE]; - return comp.replace(r, function(_, M, m, p, pr) { - debug('tilde', comp, _, M, m, p, pr); - var ret; - - if (isX(M)) - ret = ''; - else if (isX(m)) - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - else if (isX(p)) - // ~1.2 == >=1.2.0 <1.3.0 - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - else if (pr) { - debug('replaceTilde pr', pr); - if (pr.charAt(0) !== '-') - pr = '-' + pr; - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0'; - } else - // ~1.2.3 == >=1.2.3 <1.3.0 - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0'; - - debug('tilde return', ret); - return ret; - }); -} - -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2.0 --> >=1.2.0 <2.0.0 -function replaceCarets(comp, loose) { - return comp.trim().split(/\s+/).map(function(comp) { - return replaceCaret(comp, loose); - }).join(' '); -} - -function replaceCaret(comp, loose) { - debug('caret', comp, loose); - var r = loose ? re[CARETLOOSE] : re[CARET]; - return comp.replace(r, function(_, M, m, p, pr) { - debug('caret', comp, _, M, m, p, pr); - var ret; - - if (isX(M)) - ret = ''; - else if (isX(m)) - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - else if (isX(p)) { - if (M === '0') - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - else - ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; - } else if (pr) { - debug('replaceCaret pr', pr); - if (pr.charAt(0) !== '-') - pr = '-' + pr; - if (M === '0') { - if (m === '0') - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + m + '.' + (+p + 1); - else - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0'; - } else - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + (+M + 1) + '.0.0'; - } else { - debug('no pr'); - if (M === '0') { - if (m === '0') - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + m + '.' + (+p + 1); - else - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0'; - } else - ret = '>=' + M + '.' + m + '.' + p + - ' <' + (+M + 1) + '.0.0'; - } - - debug('caret return', ret); - return ret; - }); -} - -function replaceXRanges(comp, loose) { - debug('replaceXRanges', comp, loose); - return comp.split(/\s+/).map(function(comp) { - return replaceXRange(comp, loose); - }).join(' '); -} - -function replaceXRange(comp, loose) { - comp = comp.trim(); - var r = loose ? re[XRANGELOOSE] : re[XRANGE]; - return comp.replace(r, function(ret, gtlt, M, m, p, pr) { - debug('xRange', comp, ret, gtlt, M, m, p, pr); - var xM = isX(M); - var xm = xM || isX(m); - var xp = xm || isX(p); - var anyX = xp; - - if (gtlt === '=' && anyX) - gtlt = ''; - - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0'; - } else { - // nothing is forbidden - ret = '*'; - } - } else if (gtlt && anyX) { - // replace X with 0 - if (xm) - m = 0; - if (xp) - p = 0; - - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - // >1.2.3 => >= 1.2.4 - gtlt = '>='; - if (xm) { - M = +M + 1; - m = 0; - p = 0; - } else if (xp) { - m = +m + 1; - p = 0; - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<'; - if (xm) - M = +M + 1; - else - m = +m + 1; - } - - ret = gtlt + M + '.' + m + '.' + p; - } else if (xm) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - } else if (xp) { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - } - - debug('xRange return', ret); - - return ret; - }); -} - -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -function replaceStars(comp, loose) { - debug('replaceStars', comp, loose); - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[STAR], ''); -} - -// This function is passed to string.replace(re[HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0 -function hyphenReplace($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) { - - if (isX(fM)) - from = ''; - else if (isX(fm)) - from = '>=' + fM + '.0.0'; - else if (isX(fp)) - from = '>=' + fM + '.' + fm + '.0'; - else - from = '>=' + from; - - if (isX(tM)) - to = ''; - else if (isX(tm)) - to = '<' + (+tM + 1) + '.0.0'; - else if (isX(tp)) - to = '<' + tM + '.' + (+tm + 1) + '.0'; - else if (tpr) - to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; - else - to = '<=' + to; - - return (from + ' ' + to).trim(); -} - - -// if ANY of the sets match ALL of its comparators, then pass -Range.prototype.test = function(version) { - if (!version) - return false; - - if (typeof version === 'string') - version = new SemVer(version, this.loose); - - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version)) - return true; - } - return false; -}; - -function testSet(set, version) { - for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) - return false; - } - - if (version.prerelease.length) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (var i = 0; i < set.length; i++) { - debug(set[i].semver); - if (set[i].semver === ANY) - continue; - - if (set[i].semver.prerelease.length > 0) { - var allowed = set[i].semver; - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) - return true; - } - } - - // Version has a -pre, but it's not one of the ones we like. - return false; - } - - return true; -} - -exports.satisfies = satisfies; -function satisfies(version, range, loose) { - try { - range = new Range(range, loose); - } catch (er) { - return false; - } - return range.test(version); -} - -exports.maxSatisfying = maxSatisfying; -function maxSatisfying(versions, range, loose) { - var max = null; - var maxSV = null; - try { - var rangeObj = new Range(range, loose); - } catch (er) { - return null; - } - versions.forEach(function (v) { - if (rangeObj.test(v)) { // satisfies(v, range, loose) - if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) - max = v; - maxSV = new SemVer(max, loose); - } - } - }) - return max; -} - -exports.minSatisfying = minSatisfying; -function minSatisfying(versions, range, loose) { - var min = null; - var minSV = null; - try { - var rangeObj = new Range(range, loose); - } catch (er) { - return null; - } - versions.forEach(function (v) { - if (rangeObj.test(v)) { // satisfies(v, range, loose) - if (!min || minSV.compare(v) === 1) { // compare(min, v, true) - min = v; - minSV = new SemVer(min, loose); - } - } - }) - return min; -} - -exports.validRange = validRange; -function validRange(range, loose) { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, loose).range || '*'; - } catch (er) { - return null; - } -} - -// Determine if version is less than all the versions possible in the range -exports.ltr = ltr; -function ltr(version, range, loose) { - return outside(version, range, '<', loose); -} - -// Determine if version is greater than all the versions possible in the range. -exports.gtr = gtr; -function gtr(version, range, loose) { - return outside(version, range, '>', loose); -} - -exports.outside = outside; -function outside(version, range, hilo, loose) { - version = new SemVer(version, loose); - range = new Range(range, loose); - - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case '>': - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = '>'; - ecomp = '>='; - break; - case '<': - gtfn = lt; - ltefn = gte; - ltfn = gt; - comp = '<'; - ecomp = '<='; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); - } - - // If it satisifes the range it is not outside - if (satisfies(version, range, loose)) { - return false; - } - - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. - - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i]; - - var high = null; - var low = null; - - comparators.forEach(function(comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator; - low = low || comparator; - if (gtfn(comparator.semver, high.semver, loose)) { - high = comparator; - } else if (ltfn(comparator.semver, low.semver, loose)) { - low = comparator; - } - }); - - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false; - } - - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; - } - } - return true; -} - -exports.prerelease = prerelease; -function prerelease(version, loose) { - var parsed = parse(version, loose); - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null; -} - -exports.intersects = intersects; -function intersects(r1, r2, loose) { - r1 = new Range(r1, loose) - r2 = new Range(r2, loose) - return r1.intersects(r2) -} - -exports.coerce = coerce; -function coerce(version) { - if (version instanceof SemVer) - return version; - - if (typeof version !== 'string') - return null; - - var match = version.match(re[COERCE]); - - if (match == null) - return null; - - return parse((match[1] || '0') + '.' + (match[2] || '0') + '.' + (match[3] || '0')); -} - - -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _assign = __webpack_require__(591); - -var _assign2 = _interopRequireDefault(_assign); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = _assign2.default || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; -}; - -/***/ }), -/* 23 */ -/***/ (function(module, exports) { - -module.exports = require("stream"); - -/***/ }), -/* 24 */ -/***/ (function(module, exports) { - -module.exports = require("url"); - -/***/ }), -/* 25 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscription; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isArray__ = __webpack_require__(41); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isObject__ = __webpack_require__(444); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isFunction__ = __webpack_require__(154); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_tryCatch__ = __webpack_require__(56); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_errorObject__ = __webpack_require__(47); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__ = __webpack_require__(441); -/** PURE_IMPORTS_START _util_isArray,_util_isObject,_util_isFunction,_util_tryCatch,_util_errorObject,_util_UnsubscriptionError PURE_IMPORTS_END */ - - - - - - -var Subscription = /*@__PURE__*/ (function () { - function Subscription(unsubscribe) { - this.closed = false; - this._parent = null; - this._parents = null; - this._subscriptions = null; - if (unsubscribe) { - this._unsubscribe = unsubscribe; - } - } - Subscription.prototype.unsubscribe = function () { - var hasErrors = false; - var errors; - if (this.closed) { - return; - } - var _a = this, _parent = _a._parent, _parents = _a._parents, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions; - this.closed = true; - this._parent = null; - this._parents = null; - this._subscriptions = null; - var index = -1; - var len = _parents ? _parents.length : 0; - while (_parent) { - _parent.remove(this); - _parent = ++index < len && _parents[index] || null; - } - if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isFunction__["a" /* isFunction */])(_unsubscribe)) { - var trial = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_tryCatch__["a" /* tryCatch */])(_unsubscribe).call(this); - if (trial === __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */]) { - hasErrors = true; - errors = errors || (__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e instanceof __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */] ? - flattenUnsubscriptionErrors(__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e.errors) : [__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e]); - } - } - if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_isArray__["a" /* isArray */])(_subscriptions)) { - index = -1; - len = _subscriptions.length; - while (++index < len) { - var sub = _subscriptions[index]; - if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isObject__["a" /* isObject */])(sub)) { - var trial = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_tryCatch__["a" /* tryCatch */])(sub.unsubscribe).call(sub); - if (trial === __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */]) { - hasErrors = true; - errors = errors || []; - var err = __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e; - if (err instanceof __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */]) { - errors = errors.concat(flattenUnsubscriptionErrors(err.errors)); - } - else { - errors.push(err); - } - } - } - } - } - if (hasErrors) { - throw new __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */](errors); - } - }; - Subscription.prototype.add = function (teardown) { - if (!teardown || (teardown === Subscription.EMPTY)) { - return Subscription.EMPTY; - } - if (teardown === this) { - return this; - } - var subscription = teardown; - switch (typeof teardown) { - case 'function': - subscription = new Subscription(teardown); - case 'object': - if (subscription.closed || typeof subscription.unsubscribe !== 'function') { - return subscription; - } - else if (this.closed) { - subscription.unsubscribe(); - return subscription; - } - else if (typeof subscription._addParent !== 'function') { - var tmp = subscription; - subscription = new Subscription(); - subscription._subscriptions = [tmp]; - } - break; - default: - throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.'); - } - var subscriptions = this._subscriptions || (this._subscriptions = []); - subscriptions.push(subscription); - subscription._addParent(this); - return subscription; - }; - Subscription.prototype.remove = function (subscription) { - var subscriptions = this._subscriptions; - if (subscriptions) { - var subscriptionIndex = subscriptions.indexOf(subscription); - if (subscriptionIndex !== -1) { - subscriptions.splice(subscriptionIndex, 1); - } - } - }; - Subscription.prototype._addParent = function (parent) { - var _a = this, _parent = _a._parent, _parents = _a._parents; - if (!_parent || _parent === parent) { - this._parent = parent; - } - else if (!_parents) { - this._parents = [parent]; - } - else if (_parents.indexOf(parent) === -1) { - _parents.push(parent); - } - }; - Subscription.EMPTY = (function (empty) { - empty.closed = true; - return empty; - }(new Subscription())); - return Subscription; -}()); - -function flattenUnsubscriptionErrors(errors) { - return errors.reduce(function (errs, err) { return errs.concat((err instanceof __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */]) ? err.errors : err); }, []); -} -//# sourceMappingURL=Subscription.js.map - - -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2015 Joyent, Inc. - -module.exports = { - bufferSplit: bufferSplit, - addRSAMissing: addRSAMissing, - calculateDSAPublic: calculateDSAPublic, - calculateED25519Public: calculateED25519Public, - calculateX25519Public: calculateX25519Public, - mpNormalize: mpNormalize, - mpDenormalize: mpDenormalize, - ecNormalize: ecNormalize, - countZeros: countZeros, - assertCompatible: assertCompatible, - isCompatible: isCompatible, - opensslKeyDeriv: opensslKeyDeriv, - opensshCipherInfo: opensshCipherInfo, - publicFromPrivateECDSA: publicFromPrivateECDSA, - zeroPadToLength: zeroPadToLength, - writeBitString: writeBitString, - readBitString: readBitString -}; - -var assert = __webpack_require__(16); -var Buffer = __webpack_require__(15).Buffer; -var PrivateKey = __webpack_require__(33); -var Key = __webpack_require__(27); -var crypto = __webpack_require__(12); -var algs = __webpack_require__(32); -var asn1 = __webpack_require__(65); - -var ec, jsbn; -var nacl; - -var MAX_CLASS_DEPTH = 3; - -function isCompatible(obj, klass, needVer) { - if (obj === null || typeof (obj) !== 'object') - return (false); - if (needVer === undefined) - needVer = klass.prototype._sshpkApiVersion; - if (obj instanceof klass && - klass.prototype._sshpkApiVersion[0] == needVer[0]) - return (true); - var proto = Object.getPrototypeOf(obj); - var depth = 0; - while (proto.constructor.name !== klass.name) { - proto = Object.getPrototypeOf(proto); - if (!proto || ++depth > MAX_CLASS_DEPTH) - return (false); - } - if (proto.constructor.name !== klass.name) - return (false); - var ver = proto._sshpkApiVersion; - if (ver === undefined) - ver = klass._oldVersionDetect(obj); - if (ver[0] != needVer[0] || ver[1] < needVer[1]) - return (false); - return (true); -} - -function assertCompatible(obj, klass, needVer, name) { - if (name === undefined) - name = 'object'; - assert.ok(obj, name + ' must not be null'); - assert.object(obj, name + ' must be an object'); - if (needVer === undefined) - needVer = klass.prototype._sshpkApiVersion; - if (obj instanceof klass && - klass.prototype._sshpkApiVersion[0] == needVer[0]) - return; - var proto = Object.getPrototypeOf(obj); - var depth = 0; - while (proto.constructor.name !== klass.name) { - proto = Object.getPrototypeOf(proto); - assert.ok(proto && ++depth <= MAX_CLASS_DEPTH, - name + ' must be a ' + klass.name + ' instance'); - } - assert.strictEqual(proto.constructor.name, klass.name, - name + ' must be a ' + klass.name + ' instance'); - var ver = proto._sshpkApiVersion; - if (ver === undefined) - ver = klass._oldVersionDetect(obj); - assert.ok(ver[0] == needVer[0] && ver[1] >= needVer[1], - name + ' must be compatible with ' + klass.name + ' klass ' + - 'version ' + needVer[0] + '.' + needVer[1]); -} - -var CIPHER_LEN = { - 'des-ede3-cbc': { key: 7, iv: 8 }, - 'aes-128-cbc': { key: 16, iv: 16 } -}; -var PKCS5_SALT_LEN = 8; - -function opensslKeyDeriv(cipher, salt, passphrase, count) { - assert.buffer(salt, 'salt'); - assert.buffer(passphrase, 'passphrase'); - assert.number(count, 'iteration count'); - - var clen = CIPHER_LEN[cipher]; - assert.object(clen, 'supported cipher'); - - salt = salt.slice(0, PKCS5_SALT_LEN); - - var D, D_prev, bufs; - var material = Buffer.alloc(0); - while (material.length < clen.key + clen.iv) { - bufs = []; - if (D_prev) - bufs.push(D_prev); - bufs.push(passphrase); - bufs.push(salt); - D = Buffer.concat(bufs); - for (var j = 0; j < count; ++j) - D = crypto.createHash('md5').update(D).digest(); - material = Buffer.concat([material, D]); - D_prev = D; - } - - return ({ - key: material.slice(0, clen.key), - iv: material.slice(clen.key, clen.key + clen.iv) - }); -} - -/* Count leading zero bits on a buffer */ -function countZeros(buf) { - var o = 0, obit = 8; - while (o < buf.length) { - var mask = (1 << obit); - if ((buf[o] & mask) === mask) - break; - obit--; - if (obit < 0) { - o++; - obit = 8; - } - } - return (o*8 + (8 - obit) - 1); -} - -function bufferSplit(buf, chr) { - assert.buffer(buf); - assert.string(chr); - - var parts = []; - var lastPart = 0; - var matches = 0; - for (var i = 0; i < buf.length; ++i) { - if (buf[i] === chr.charCodeAt(matches)) - ++matches; - else if (buf[i] === chr.charCodeAt(0)) - matches = 1; - else - matches = 0; - - if (matches >= chr.length) { - var newPart = i + 1; - parts.push(buf.slice(lastPart, newPart - matches)); - lastPart = newPart; - matches = 0; - } - } - if (lastPart <= buf.length) - parts.push(buf.slice(lastPart, buf.length)); - - return (parts); -} - -function ecNormalize(buf, addZero) { - assert.buffer(buf); - if (buf[0] === 0x00 && buf[1] === 0x04) { - if (addZero) - return (buf); - return (buf.slice(1)); - } else if (buf[0] === 0x04) { - if (!addZero) - return (buf); - } else { - while (buf[0] === 0x00) - buf = buf.slice(1); - if (buf[0] === 0x02 || buf[0] === 0x03) - throw (new Error('Compressed elliptic curve points ' + - 'are not supported')); - if (buf[0] !== 0x04) - throw (new Error('Not a valid elliptic curve point')); - if (!addZero) - return (buf); - } - var b = Buffer.alloc(buf.length + 1); - b[0] = 0x0; - buf.copy(b, 1); - return (b); -} - -function readBitString(der, tag) { - if (tag === undefined) - tag = asn1.Ber.BitString; - var buf = der.readString(tag, true); - assert.strictEqual(buf[0], 0x00, 'bit strings with unused bits are ' + - 'not supported (0x' + buf[0].toString(16) + ')'); - return (buf.slice(1)); -} - -function writeBitString(der, buf, tag) { - if (tag === undefined) - tag = asn1.Ber.BitString; - var b = Buffer.alloc(buf.length + 1); - b[0] = 0x00; - buf.copy(b, 1); - der.writeBuffer(b, tag); -} - -function mpNormalize(buf) { - assert.buffer(buf); - while (buf.length > 1 && buf[0] === 0x00 && (buf[1] & 0x80) === 0x00) - buf = buf.slice(1); - if ((buf[0] & 0x80) === 0x80) { - var b = Buffer.alloc(buf.length + 1); - b[0] = 0x00; - buf.copy(b, 1); - buf = b; - } - return (buf); -} - -function mpDenormalize(buf) { - assert.buffer(buf); - while (buf.length > 1 && buf[0] === 0x00) - buf = buf.slice(1); - return (buf); -} - -function zeroPadToLength(buf, len) { - assert.buffer(buf); - assert.number(len); - while (buf.length > len) { - assert.equal(buf[0], 0x00); - buf = buf.slice(1); - } - while (buf.length < len) { - var b = Buffer.alloc(buf.length + 1); - b[0] = 0x00; - buf.copy(b, 1); - buf = b; - } - return (buf); -} - -function bigintToMpBuf(bigint) { - var buf = Buffer.from(bigint.toByteArray()); - buf = mpNormalize(buf); - return (buf); -} - -function calculateDSAPublic(g, p, x) { - assert.buffer(g); - assert.buffer(p); - assert.buffer(x); - try { - var bigInt = __webpack_require__(81).BigInteger; - } catch (e) { - throw (new Error('To load a PKCS#8 format DSA private key, ' + - 'the node jsbn library is required.')); - } - g = new bigInt(g); - p = new bigInt(p); - x = new bigInt(x); - var y = g.modPow(x, p); - var ybuf = bigintToMpBuf(y); - return (ybuf); -} - -function calculateED25519Public(k) { - assert.buffer(k); - - if (nacl === undefined) - nacl = __webpack_require__(75); - - var kp = nacl.sign.keyPair.fromSeed(new Uint8Array(k)); - return (Buffer.from(kp.publicKey)); -} - -function calculateX25519Public(k) { - assert.buffer(k); - - if (nacl === undefined) - nacl = __webpack_require__(75); - - var kp = nacl.box.keyPair.fromSeed(new Uint8Array(k)); - return (Buffer.from(kp.publicKey)); -} - -function addRSAMissing(key) { - assert.object(key); - assertCompatible(key, PrivateKey, [1, 1]); - try { - var bigInt = __webpack_require__(81).BigInteger; - } catch (e) { - throw (new Error('To write a PEM private key from ' + - 'this source, the node jsbn lib is required.')); - } - - var d = new bigInt(key.part.d.data); - var buf; - - if (!key.part.dmodp) { - var p = new bigInt(key.part.p.data); - var dmodp = d.mod(p.subtract(1)); - - buf = bigintToMpBuf(dmodp); - key.part.dmodp = {name: 'dmodp', data: buf}; - key.parts.push(key.part.dmodp); - } - if (!key.part.dmodq) { - var q = new bigInt(key.part.q.data); - var dmodq = d.mod(q.subtract(1)); - - buf = bigintToMpBuf(dmodq); - key.part.dmodq = {name: 'dmodq', data: buf}; - key.parts.push(key.part.dmodq); - } -} - -function publicFromPrivateECDSA(curveName, priv) { - assert.string(curveName, 'curveName'); - assert.buffer(priv); - if (ec === undefined) - ec = __webpack_require__(139); - if (jsbn === undefined) - jsbn = __webpack_require__(81).BigInteger; - var params = algs.curves[curveName]; - var p = new jsbn(params.p); - var a = new jsbn(params.a); - var b = new jsbn(params.b); - var curve = new ec.ECCurveFp(p, a, b); - var G = curve.decodePointHex(params.G.toString('hex')); - - var d = new jsbn(mpNormalize(priv)); - var pub = G.multiply(d); - pub = Buffer.from(curve.encodePointHex(pub), 'hex'); - - var parts = []; - parts.push({name: 'curve', data: Buffer.from(curveName)}); - parts.push({name: 'Q', data: pub}); - - var key = new Key({type: 'ecdsa', curve: curve, parts: parts}); - return (key); -} - -function opensshCipherInfo(cipher) { - var inf = {}; - switch (cipher) { - case '3des-cbc': - inf.keySize = 24; - inf.blockSize = 8; - inf.opensslName = 'des-ede3-cbc'; - break; - case 'blowfish-cbc': - inf.keySize = 16; - inf.blockSize = 8; - inf.opensslName = 'bf-cbc'; - break; - case 'aes128-cbc': - case 'aes128-ctr': - case 'aes128-gcm@openssh.com': - inf.keySize = 16; - inf.blockSize = 16; - inf.opensslName = 'aes-128-' + cipher.slice(7, 10); - break; - case 'aes192-cbc': - case 'aes192-ctr': - case 'aes192-gcm@openssh.com': - inf.keySize = 24; - inf.blockSize = 16; - inf.opensslName = 'aes-192-' + cipher.slice(7, 10); - break; - case 'aes256-cbc': - case 'aes256-ctr': - case 'aes256-gcm@openssh.com': - inf.keySize = 32; - inf.blockSize = 16; - inf.opensslName = 'aes-256-' + cipher.slice(7, 10); - break; - default: - throw (new Error( - 'Unsupported openssl cipher "' + cipher + '"')); - } - return (inf); -} - - -/***/ }), -/* 27 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2017 Joyent, Inc. - -module.exports = Key; - -var assert = __webpack_require__(16); -var algs = __webpack_require__(32); -var crypto = __webpack_require__(12); -var Fingerprint = __webpack_require__(156); -var Signature = __webpack_require__(74); -var DiffieHellman = __webpack_require__(325).DiffieHellman; -var errs = __webpack_require__(73); -var utils = __webpack_require__(26); -var PrivateKey = __webpack_require__(33); -var edCompat; - -try { - edCompat = __webpack_require__(454); -} catch (e) { - /* Just continue through, and bail out if we try to use it. */ -} - -var InvalidAlgorithmError = errs.InvalidAlgorithmError; -var KeyParseError = errs.KeyParseError; - -var formats = {}; -formats['auto'] = __webpack_require__(455); -formats['pem'] = __webpack_require__(86); -formats['pkcs1'] = __webpack_require__(327); -formats['pkcs8'] = __webpack_require__(157); -formats['rfc4253'] = __webpack_require__(103); -formats['ssh'] = __webpack_require__(456); -formats['ssh-private'] = __webpack_require__(192); -formats['openssh'] = formats['ssh-private']; -formats['dnssec'] = __webpack_require__(326); - -function Key(opts) { - assert.object(opts, 'options'); - assert.arrayOfObject(opts.parts, 'options.parts'); - assert.string(opts.type, 'options.type'); - assert.optionalString(opts.comment, 'options.comment'); - - var algInfo = algs.info[opts.type]; - if (typeof (algInfo) !== 'object') - throw (new InvalidAlgorithmError(opts.type)); - - var partLookup = {}; - for (var i = 0; i < opts.parts.length; ++i) { - var part = opts.parts[i]; - partLookup[part.name] = part; - } - - this.type = opts.type; - this.parts = opts.parts; - this.part = partLookup; - this.comment = undefined; - this.source = opts.source; - - /* for speeding up hashing/fingerprint operations */ - this._rfc4253Cache = opts._rfc4253Cache; - this._hashCache = {}; - - var sz; - this.curve = undefined; - if (this.type === 'ecdsa') { - var curve = this.part.curve.data.toString(); - this.curve = curve; - sz = algs.curves[curve].size; - } else if (this.type === 'ed25519' || this.type === 'curve25519') { - sz = 256; - this.curve = 'curve25519'; - } else { - var szPart = this.part[algInfo.sizePart]; - sz = szPart.data.length; - sz = sz * 8 - utils.countZeros(szPart.data); - } - this.size = sz; -} - -Key.formats = formats; - -Key.prototype.toBuffer = function (format, options) { - if (format === undefined) - format = 'ssh'; - assert.string(format, 'format'); - assert.object(formats[format], 'formats[format]'); - assert.optionalObject(options, 'options'); - - if (format === 'rfc4253') { - if (this._rfc4253Cache === undefined) - this._rfc4253Cache = formats['rfc4253'].write(this); - return (this._rfc4253Cache); - } - - return (formats[format].write(this, options)); -}; - -Key.prototype.toString = function (format, options) { - return (this.toBuffer(format, options).toString()); -}; - -Key.prototype.hash = function (algo) { - assert.string(algo, 'algorithm'); - algo = algo.toLowerCase(); - if (algs.hashAlgs[algo] === undefined) - throw (new InvalidAlgorithmError(algo)); - - if (this._hashCache[algo]) - return (this._hashCache[algo]); - var hash = crypto.createHash(algo). - update(this.toBuffer('rfc4253')).digest(); - this._hashCache[algo] = hash; - return (hash); -}; - -Key.prototype.fingerprint = function (algo) { - if (algo === undefined) - algo = 'sha256'; - assert.string(algo, 'algorithm'); - var opts = { - type: 'key', - hash: this.hash(algo), - algorithm: algo - }; - return (new Fingerprint(opts)); -}; - -Key.prototype.defaultHashAlgorithm = function () { - var hashAlgo = 'sha1'; - if (this.type === 'rsa') - hashAlgo = 'sha256'; - if (this.type === 'dsa' && this.size > 1024) - hashAlgo = 'sha256'; - if (this.type === 'ed25519') - hashAlgo = 'sha512'; - if (this.type === 'ecdsa') { - if (this.size <= 256) - hashAlgo = 'sha256'; - else if (this.size <= 384) - hashAlgo = 'sha384'; - else - hashAlgo = 'sha512'; - } - return (hashAlgo); -}; - -Key.prototype.createVerify = function (hashAlgo) { - if (hashAlgo === undefined) - hashAlgo = this.defaultHashAlgorithm(); - assert.string(hashAlgo, 'hash algorithm'); - - /* ED25519 is not supported by OpenSSL, use a javascript impl. */ - if (this.type === 'ed25519' && edCompat !== undefined) - return (new edCompat.Verifier(this, hashAlgo)); - if (this.type === 'curve25519') - throw (new Error('Curve25519 keys are not suitable for ' + - 'signing or verification')); - - var v, nm, err; - try { - nm = hashAlgo.toUpperCase(); - v = crypto.createVerify(nm); - } catch (e) { - err = e; - } - if (v === undefined || (err instanceof Error && - err.message.match(/Unknown message digest/))) { - nm = 'RSA-'; - nm += hashAlgo.toUpperCase(); - v = crypto.createVerify(nm); - } - assert.ok(v, 'failed to create verifier'); - var oldVerify = v.verify.bind(v); - var key = this.toBuffer('pkcs8'); - var curve = this.curve; - var self = this; - v.verify = function (signature, fmt) { - if (Signature.isSignature(signature, [2, 0])) { - if (signature.type !== self.type) - return (false); - if (signature.hashAlgorithm && - signature.hashAlgorithm !== hashAlgo) - return (false); - if (signature.curve && self.type === 'ecdsa' && - signature.curve !== curve) - return (false); - return (oldVerify(key, signature.toBuffer('asn1'))); - - } else if (typeof (signature) === 'string' || - Buffer.isBuffer(signature)) { - return (oldVerify(key, signature, fmt)); - - /* - * Avoid doing this on valid arguments, walking the prototype - * chain can be quite slow. - */ - } else if (Signature.isSignature(signature, [1, 0])) { - throw (new Error('signature was created by too old ' + - 'a version of sshpk and cannot be verified')); - - } else { - throw (new TypeError('signature must be a string, ' + - 'Buffer, or Signature object')); - } - }; - return (v); -}; - -Key.prototype.createDiffieHellman = function () { - if (this.type === 'rsa') - throw (new Error('RSA keys do not support Diffie-Hellman')); - - return (new DiffieHellman(this)); -}; -Key.prototype.createDH = Key.prototype.createDiffieHellman; - -Key.parse = function (data, format, options) { - if (typeof (data) !== 'string') - assert.buffer(data, 'data'); - if (format === undefined) - format = 'auto'; - assert.string(format, 'format'); - if (typeof (options) === 'string') - options = { filename: options }; - assert.optionalObject(options, 'options'); - if (options === undefined) - options = {}; - assert.optionalString(options.filename, 'options.filename'); - if (options.filename === undefined) - options.filename = '(unnamed)'; - - assert.object(formats[format], 'formats[format]'); - - try { - var k = formats[format].read(data, options); - if (k instanceof PrivateKey) - k = k.toPublic(); - if (!k.comment) - k.comment = options.filename; - return (k); - } catch (e) { - if (e.name === 'KeyEncryptedError') - throw (e); - throw (new KeyParseError(options.filename, format, e)); - } -}; - -Key.isKey = function (obj, ver) { - return (utils.isCompatible(obj, Key, ver)); -}; - -/* - * API versions for Key: - * [1,0] -- initial ver, may take Signature for createVerify or may not - * [1,1] -- added pkcs1, pkcs8 formats - * [1,2] -- added auto, ssh-private, openssh formats - * [1,3] -- added defaultHashAlgorithm - * [1,4] -- added ed support, createDH - * [1,5] -- first explicitly tagged version - * [1,6] -- changed ed25519 part names - */ -Key.prototype._sshpkApiVersion = [1, 6]; - -Key._oldVersionDetect = function (obj) { - assert.func(obj.toBuffer); - assert.func(obj.fingerprint); - if (obj.createDH) - return ([1, 4]); - if (obj.defaultHashAlgorithm) - return ([1, 3]); - if (obj.formats['auto']) - return ([1, 2]); - if (obj.formats['pkcs1']) - return ([1, 1]); - return ([1, 0]); -}; - - -/***/ }), -/* 28 */ -/***/ (function(module, exports) { - -module.exports = require("assert"); - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = nullify; -function nullify(obj = {}) { - if (Array.isArray(obj)) { - for (var _iterator = obj, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - const item = _ref; - - nullify(item); - } - } else if (obj !== null && typeof obj === 'object' || typeof obj === 'function') { - Object.setPrototypeOf(obj, null); - - // for..in can only be applied to 'object', not 'function' - if (typeof obj === 'object') { - for (const key in obj) { - nullify(obj[key]); - } - } - } - - return obj; -} - -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -const escapeStringRegexp = __webpack_require__(388); -const ansiStyles = __webpack_require__(506); -const stdoutColor = __webpack_require__(598).stdout; - -const template = __webpack_require__(599); - -const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); - -// `supportsColor.level` → `ansiStyles.color[name]` mapping -const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m']; - -// `color-convert` models to exclude from the Chalk API due to conflicts and such -const skipModels = new Set(['gray']); - -const styles = Object.create(null); - -function applyOptions(obj, options) { - options = options || {}; - - // Detect level if not set manually - const scLevel = stdoutColor ? stdoutColor.level : 0; - obj.level = options.level === undefined ? scLevel : options.level; - obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0; -} - -function Chalk(options) { - // We check for this.template here since calling `chalk.constructor()` - // by itself will have a `this` of a previously constructed chalk object - if (!this || !(this instanceof Chalk) || this.template) { - const chalk = {}; - applyOptions(chalk, options); - - chalk.template = function () { - const args = [].slice.call(arguments); - return chalkTag.apply(null, [chalk.template].concat(args)); - }; - - Object.setPrototypeOf(chalk, Chalk.prototype); - Object.setPrototypeOf(chalk.template, chalk); - - chalk.template.constructor = Chalk; - - return chalk.template; - } - - applyOptions(this, options); -} - -// Use bright blue on Windows as the normal blue color is illegible -if (isSimpleWindowsTerm) { - ansiStyles.blue.open = '\u001B[94m'; -} - -for (const key of Object.keys(ansiStyles)) { - ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); - - styles[key] = { - get() { - const codes = ansiStyles[key]; - return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key); - } - }; -} - -styles.visible = { - get() { - return build.call(this, this._styles || [], true, 'visible'); - } -}; - -ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g'); -for (const model of Object.keys(ansiStyles.color.ansi)) { - if (skipModels.has(model)) { - continue; - } - - styles[model] = { - get() { - const level = this.level; - return function () { - const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); - const codes = { - open, - close: ansiStyles.color.close, - closeRe: ansiStyles.color.closeRe - }; - return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); - }; - } - }; -} - -ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g'); -for (const model of Object.keys(ansiStyles.bgColor.ansi)) { - if (skipModels.has(model)) { - continue; - } - - const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); - styles[bgModel] = { - get() { - const level = this.level; - return function () { - const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); - const codes = { - open, - close: ansiStyles.bgColor.close, - closeRe: ansiStyles.bgColor.closeRe - }; - return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); - }; - } - }; -} - -const proto = Object.defineProperties(() => {}, styles); - -function build(_styles, _empty, key) { - const builder = function () { - return applyStyle.apply(builder, arguments); - }; - - builder._styles = _styles; - builder._empty = _empty; - - const self = this; - - Object.defineProperty(builder, 'level', { - enumerable: true, - get() { - return self.level; - }, - set(level) { - self.level = level; - } - }); - - Object.defineProperty(builder, 'enabled', { - enumerable: true, - get() { - return self.enabled; - }, - set(enabled) { - self.enabled = enabled; - } - }); - - // See below for fix regarding invisible grey/dim combination on Windows - builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey'; - - // `__proto__` is used because we must return a function, but there is - // no way to create a function with a different prototype - builder.__proto__ = proto; // eslint-disable-line no-proto - - return builder; -} - -function applyStyle() { - // Support varags, but simply cast to string in case there's only one arg - const args = arguments; - const argsLen = args.length; - let str = String(arguments[0]); - - if (argsLen === 0) { - return ''; - } - - if (argsLen > 1) { - // Don't slice `arguments`, it prevents V8 optimizations - for (let a = 1; a < argsLen; a++) { - str += ' ' + args[a]; - } - } - - if (!this.enabled || this.level <= 0 || !str) { - return this._empty ? '' : str; - } - - // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, - // see https://github.com/chalk/chalk/issues/58 - // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. - const originalDim = ansiStyles.dim.open; - if (isSimpleWindowsTerm && this.hasGrey) { - ansiStyles.dim.open = ''; - } - - for (const code of this._styles.slice().reverse()) { - // Replace any instances already present with a re-opening code - // otherwise only the part of the string until said closing code - // will be colored, and the rest will simply be 'plain'. - str = code.open + str.replace(code.closeRe, code.open) + code.close; - - // Close the styling before a linebreak and reopen - // after next line to fix a bleed issue on macOS - // https://github.com/chalk/chalk/pull/92 - str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); - } - - // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue - ansiStyles.dim.open = originalDim; - - return str; -} - -function chalkTag(chalk, strings) { - if (!Array.isArray(strings)) { - // If chalk() was called by itself or with a string, - // return the string itself as a string. - return [].slice.call(arguments, 1).join(' '); - } - - const args = [].slice.call(arguments, 2); - const parts = [strings.raw[0]]; - - for (let i = 1; i < strings.length; i++) { - parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&')); - parts.push(String(strings.raw[i])); - } - - return template(chalk, parts.join('')); -} - -Object.defineProperties(Chalk.prototype, styles); - -module.exports = Chalk(); // eslint-disable-line new-cap -module.exports.supportsColor = stdoutColor; -module.exports.default = module.exports; // For TypeScript - - -/***/ }), -/* 31 */ -/***/ (function(module, exports) { - -var core = module.exports = { version: '2.5.7' }; -if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef - - -/***/ }), -/* 32 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2015 Joyent, Inc. - -var Buffer = __webpack_require__(15).Buffer; - -var algInfo = { - 'dsa': { - parts: ['p', 'q', 'g', 'y'], - sizePart: 'p' - }, - 'rsa': { - parts: ['e', 'n'], - sizePart: 'n' - }, - 'ecdsa': { - parts: ['curve', 'Q'], - sizePart: 'Q' - }, - 'ed25519': { - parts: ['A'], - sizePart: 'A' - } -}; -algInfo['curve25519'] = algInfo['ed25519']; - -var algPrivInfo = { - 'dsa': { - parts: ['p', 'q', 'g', 'y', 'x'] - }, - 'rsa': { - parts: ['n', 'e', 'd', 'iqmp', 'p', 'q'] - }, - 'ecdsa': { - parts: ['curve', 'Q', 'd'] - }, - 'ed25519': { - parts: ['A', 'k'] - } -}; -algPrivInfo['curve25519'] = algPrivInfo['ed25519']; - -var hashAlgs = { - 'md5': true, - 'sha1': true, - 'sha256': true, - 'sha384': true, - 'sha512': true -}; - -/* - * Taken from - * http://csrc.nist.gov/groups/ST/toolkit/documents/dss/NISTReCur.pdf - */ -var curves = { - 'nistp256': { - size: 256, - pkcs8oid: '1.2.840.10045.3.1.7', - p: Buffer.from(('00' + - 'ffffffff 00000001 00000000 00000000' + - '00000000 ffffffff ffffffff ffffffff'). - replace(/ /g, ''), 'hex'), - a: Buffer.from(('00' + - 'FFFFFFFF 00000001 00000000 00000000' + - '00000000 FFFFFFFF FFFFFFFF FFFFFFFC'). - replace(/ /g, ''), 'hex'), - b: Buffer.from(( - '5ac635d8 aa3a93e7 b3ebbd55 769886bc' + - '651d06b0 cc53b0f6 3bce3c3e 27d2604b'). - replace(/ /g, ''), 'hex'), - s: Buffer.from(('00' + - 'c49d3608 86e70493 6a6678e1 139d26b7' + - '819f7e90'). - replace(/ /g, ''), 'hex'), - n: Buffer.from(('00' + - 'ffffffff 00000000 ffffffff ffffffff' + - 'bce6faad a7179e84 f3b9cac2 fc632551'). - replace(/ /g, ''), 'hex'), - G: Buffer.from(('04' + - '6b17d1f2 e12c4247 f8bce6e5 63a440f2' + - '77037d81 2deb33a0 f4a13945 d898c296' + - '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16' + - '2bce3357 6b315ece cbb64068 37bf51f5'). - replace(/ /g, ''), 'hex') - }, - 'nistp384': { - size: 384, - pkcs8oid: '1.3.132.0.34', - p: Buffer.from(('00' + - 'ffffffff ffffffff ffffffff ffffffff' + - 'ffffffff ffffffff ffffffff fffffffe' + - 'ffffffff 00000000 00000000 ffffffff'). - replace(/ /g, ''), 'hex'), - a: Buffer.from(('00' + - 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + - 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE' + - 'FFFFFFFF 00000000 00000000 FFFFFFFC'). - replace(/ /g, ''), 'hex'), - b: Buffer.from(( - 'b3312fa7 e23ee7e4 988e056b e3f82d19' + - '181d9c6e fe814112 0314088f 5013875a' + - 'c656398d 8a2ed19d 2a85c8ed d3ec2aef'). - replace(/ /g, ''), 'hex'), - s: Buffer.from(('00' + - 'a335926a a319a27a 1d00896a 6773a482' + - '7acdac73'). - replace(/ /g, ''), 'hex'), - n: Buffer.from(('00' + - 'ffffffff ffffffff ffffffff ffffffff' + - 'ffffffff ffffffff c7634d81 f4372ddf' + - '581a0db2 48b0a77a ecec196a ccc52973'). - replace(/ /g, ''), 'hex'), - G: Buffer.from(('04' + - 'aa87ca22 be8b0537 8eb1c71e f320ad74' + - '6e1d3b62 8ba79b98 59f741e0 82542a38' + - '5502f25d bf55296c 3a545e38 72760ab7' + - '3617de4a 96262c6f 5d9e98bf 9292dc29' + - 'f8f41dbd 289a147c e9da3113 b5f0b8c0' + - '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'). - replace(/ /g, ''), 'hex') - }, - 'nistp521': { - size: 521, - pkcs8oid: '1.3.132.0.35', - p: Buffer.from(( - '01ffffff ffffffff ffffffff ffffffff' + - 'ffffffff ffffffff ffffffff ffffffff' + - 'ffffffff ffffffff ffffffff ffffffff' + - 'ffffffff ffffffff ffffffff ffffffff' + - 'ffff').replace(/ /g, ''), 'hex'), - a: Buffer.from(('01FF' + - 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + - 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + - 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + - 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC'). - replace(/ /g, ''), 'hex'), - b: Buffer.from(('51' + - '953eb961 8e1c9a1f 929a21a0 b68540ee' + - 'a2da725b 99b315f3 b8b48991 8ef109e1' + - '56193951 ec7e937b 1652c0bd 3bb1bf07' + - '3573df88 3d2c34f1 ef451fd4 6b503f00'). - replace(/ /g, ''), 'hex'), - s: Buffer.from(('00' + - 'd09e8800 291cb853 96cc6717 393284aa' + - 'a0da64ba').replace(/ /g, ''), 'hex'), - n: Buffer.from(('01ff' + - 'ffffffff ffffffff ffffffff ffffffff' + - 'ffffffff ffffffff ffffffff fffffffa' + - '51868783 bf2f966b 7fcc0148 f709a5d0' + - '3bb5c9b8 899c47ae bb6fb71e 91386409'). - replace(/ /g, ''), 'hex'), - G: Buffer.from(('04' + - '00c6 858e06b7 0404e9cd 9e3ecb66 2395b442' + - '9c648139 053fb521 f828af60 6b4d3dba' + - 'a14b5e77 efe75928 fe1dc127 a2ffa8de' + - '3348b3c1 856a429b f97e7e31 c2e5bd66' + - '0118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9' + - '98f54449 579b4468 17afbd17 273e662c' + - '97ee7299 5ef42640 c550b901 3fad0761' + - '353c7086 a272c240 88be9476 9fd16650'). - replace(/ /g, ''), 'hex') - } -}; - -module.exports = { - info: algInfo, - privInfo: algPrivInfo, - hashAlgs: hashAlgs, - curves: curves -}; - - -/***/ }), -/* 33 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2017 Joyent, Inc. - -module.exports = PrivateKey; - -var assert = __webpack_require__(16); -var Buffer = __webpack_require__(15).Buffer; -var algs = __webpack_require__(32); -var crypto = __webpack_require__(12); -var Fingerprint = __webpack_require__(156); -var Signature = __webpack_require__(74); -var errs = __webpack_require__(73); -var util = __webpack_require__(3); -var utils = __webpack_require__(26); -var dhe = __webpack_require__(325); -var generateECDSA = dhe.generateECDSA; -var generateED25519 = dhe.generateED25519; -var edCompat; -var nacl; - -try { - edCompat = __webpack_require__(454); -} catch (e) { - /* Just continue through, and bail out if we try to use it. */ -} - -var Key = __webpack_require__(27); - -var InvalidAlgorithmError = errs.InvalidAlgorithmError; -var KeyParseError = errs.KeyParseError; -var KeyEncryptedError = errs.KeyEncryptedError; - -var formats = {}; -formats['auto'] = __webpack_require__(455); -formats['pem'] = __webpack_require__(86); -formats['pkcs1'] = __webpack_require__(327); -formats['pkcs8'] = __webpack_require__(157); -formats['rfc4253'] = __webpack_require__(103); -formats['ssh-private'] = __webpack_require__(192); -formats['openssh'] = formats['ssh-private']; -formats['ssh'] = formats['ssh-private']; -formats['dnssec'] = __webpack_require__(326); - -function PrivateKey(opts) { - assert.object(opts, 'options'); - Key.call(this, opts); - - this._pubCache = undefined; -} -util.inherits(PrivateKey, Key); - -PrivateKey.formats = formats; - -PrivateKey.prototype.toBuffer = function (format, options) { - if (format === undefined) - format = 'pkcs1'; - assert.string(format, 'format'); - assert.object(formats[format], 'formats[format]'); - assert.optionalObject(options, 'options'); - - return (formats[format].write(this, options)); -}; - -PrivateKey.prototype.hash = function (algo) { - return (this.toPublic().hash(algo)); -}; - -PrivateKey.prototype.toPublic = function () { - if (this._pubCache) - return (this._pubCache); - - var algInfo = algs.info[this.type]; - var pubParts = []; - for (var i = 0; i < algInfo.parts.length; ++i) { - var p = algInfo.parts[i]; - pubParts.push(this.part[p]); - } - - this._pubCache = new Key({ - type: this.type, - source: this, - parts: pubParts - }); - if (this.comment) - this._pubCache.comment = this.comment; - return (this._pubCache); -}; - -PrivateKey.prototype.derive = function (newType) { - assert.string(newType, 'type'); - var priv, pub, pair; - - if (this.type === 'ed25519' && newType === 'curve25519') { - if (nacl === undefined) - nacl = __webpack_require__(75); - - priv = this.part.k.data; - if (priv[0] === 0x00) - priv = priv.slice(1); - - pair = nacl.box.keyPair.fromSecretKey(new Uint8Array(priv)); - pub = Buffer.from(pair.publicKey); - - return (new PrivateKey({ - type: 'curve25519', - parts: [ - { name: 'A', data: utils.mpNormalize(pub) }, - { name: 'k', data: utils.mpNormalize(priv) } - ] - })); - } else if (this.type === 'curve25519' && newType === 'ed25519') { - if (nacl === undefined) - nacl = __webpack_require__(75); - - priv = this.part.k.data; - if (priv[0] === 0x00) - priv = priv.slice(1); - - pair = nacl.sign.keyPair.fromSeed(new Uint8Array(priv)); - pub = Buffer.from(pair.publicKey); - - return (new PrivateKey({ - type: 'ed25519', - parts: [ - { name: 'A', data: utils.mpNormalize(pub) }, - { name: 'k', data: utils.mpNormalize(priv) } - ] - })); - } - throw (new Error('Key derivation not supported from ' + this.type + - ' to ' + newType)); -}; - -PrivateKey.prototype.createVerify = function (hashAlgo) { - return (this.toPublic().createVerify(hashAlgo)); -}; - -PrivateKey.prototype.createSign = function (hashAlgo) { - if (hashAlgo === undefined) - hashAlgo = this.defaultHashAlgorithm(); - assert.string(hashAlgo, 'hash algorithm'); - - /* ED25519 is not supported by OpenSSL, use a javascript impl. */ - if (this.type === 'ed25519' && edCompat !== undefined) - return (new edCompat.Signer(this, hashAlgo)); - if (this.type === 'curve25519') - throw (new Error('Curve25519 keys are not suitable for ' + - 'signing or verification')); - - var v, nm, err; - try { - nm = hashAlgo.toUpperCase(); - v = crypto.createSign(nm); - } catch (e) { - err = e; - } - if (v === undefined || (err instanceof Error && - err.message.match(/Unknown message digest/))) { - nm = 'RSA-'; - nm += hashAlgo.toUpperCase(); - v = crypto.createSign(nm); - } - assert.ok(v, 'failed to create verifier'); - var oldSign = v.sign.bind(v); - var key = this.toBuffer('pkcs1'); - var type = this.type; - var curve = this.curve; - v.sign = function () { - var sig = oldSign(key); - if (typeof (sig) === 'string') - sig = Buffer.from(sig, 'binary'); - sig = Signature.parse(sig, type, 'asn1'); - sig.hashAlgorithm = hashAlgo; - sig.curve = curve; - return (sig); - }; - return (v); -}; - -PrivateKey.parse = function (data, format, options) { - if (typeof (data) !== 'string') - assert.buffer(data, 'data'); - if (format === undefined) - format = 'auto'; - assert.string(format, 'format'); - if (typeof (options) === 'string') - options = { filename: options }; - assert.optionalObject(options, 'options'); - if (options === undefined) - options = {}; - assert.optionalString(options.filename, 'options.filename'); - if (options.filename === undefined) - options.filename = '(unnamed)'; - - assert.object(formats[format], 'formats[format]'); - - try { - var k = formats[format].read(data, options); - assert.ok(k instanceof PrivateKey, 'key is not a private key'); - if (!k.comment) - k.comment = options.filename; - return (k); - } catch (e) { - if (e.name === 'KeyEncryptedError') - throw (e); - throw (new KeyParseError(options.filename, format, e)); - } -}; - -PrivateKey.isPrivateKey = function (obj, ver) { - return (utils.isCompatible(obj, PrivateKey, ver)); -}; - -PrivateKey.generate = function (type, options) { - if (options === undefined) - options = {}; - assert.object(options, 'options'); - - switch (type) { - case 'ecdsa': - if (options.curve === undefined) - options.curve = 'nistp256'; - assert.string(options.curve, 'options.curve'); - return (generateECDSA(options.curve)); - case 'ed25519': - return (generateED25519()); - default: - throw (new Error('Key generation not supported with key ' + - 'type "' + type + '"')); - } -}; - -/* - * API versions for PrivateKey: - * [1,0] -- initial ver - * [1,1] -- added auto, pkcs[18], openssh/ssh-private formats - * [1,2] -- added defaultHashAlgorithm - * [1,3] -- added derive, ed, createDH - * [1,4] -- first tagged version - * [1,5] -- changed ed25519 part names and format - */ -PrivateKey.prototype._sshpkApiVersion = [1, 5]; - -PrivateKey._oldVersionDetect = function (obj) { - assert.func(obj.toPublic); - assert.func(obj.createSign); - if (obj.derive) - return ([1, 3]); - if (obj.defaultHashAlgorithm) - return ([1, 2]); - if (obj.formats['auto']) - return ([1, 1]); - return ([1, 0]); -}; - - -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.wrapLifecycle = exports.run = exports.install = exports.Install = undefined; - -var _extends2; - -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(22)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -let install = exports.install = (() => { - var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, lockfile) { - yield wrapLifecycle(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const install = new Install(flags, config, reporter, lockfile); - yield install.init(); - })); - }); - - return function install(_x7, _x8, _x9, _x10) { - return _ref29.apply(this, arguments); - }; -})(); - -let run = exports.run = (() => { - var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - let lockfile; - let error = 'installCommandRenamed'; - if (flags.lockfile === false) { - lockfile = new (_lockfile || _load_lockfile()).default(); - } else { - lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); - } - - if (args.length) { - const exampleArgs = args.slice(); - - if (flags.saveDev) { - exampleArgs.push('--dev'); - } - if (flags.savePeer) { - exampleArgs.push('--peer'); - } - if (flags.saveOptional) { - exampleArgs.push('--optional'); - } - if (flags.saveExact) { - exampleArgs.push('--exact'); - } - if (flags.saveTilde) { - exampleArgs.push('--tilde'); - } - let command = 'add'; - if (flags.global) { - error = 'globalFlagRemoved'; - command = 'global add'; - } - throw new (_errors || _load_errors()).MessageError(reporter.lang(error, `yarn ${command} ${exampleArgs.join(' ')}`)); - } - - yield install(config, reporter, flags, lockfile); - }); - - return function run(_x11, _x12, _x13, _x14) { - return _ref31.apply(this, arguments); - }; -})(); - -let wrapLifecycle = exports.wrapLifecycle = (() => { - var _ref32 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags, factory) { - yield config.executeLifecycleScript('preinstall'); - - yield factory(); - - // npm behaviour, seems kinda funky but yay compatibility - yield config.executeLifecycleScript('install'); - yield config.executeLifecycleScript('postinstall'); - - if (!config.production) { - if (!config.disablePrepublish) { - yield config.executeLifecycleScript('prepublish'); - } - yield config.executeLifecycleScript('prepare'); - } - }); - - return function wrapLifecycle(_x15, _x16, _x17) { - return _ref32.apply(this, arguments); - }; -})(); - -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; - -var _objectPath; - -function _load_objectPath() { - return _objectPath = _interopRequireDefault(__webpack_require__(304)); -} - -var _hooks; - -function _load_hooks() { - return _hooks = __webpack_require__(374); -} - -var _index; - -function _load_index() { - return _index = _interopRequireDefault(__webpack_require__(220)); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _integrityChecker; - -function _load_integrityChecker() { - return _integrityChecker = _interopRequireDefault(__webpack_require__(208)); -} - -var _lockfile; - -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(19)); -} - -var _lockfile2; - -function _load_lockfile2() { - return _lockfile2 = __webpack_require__(19); -} - -var _packageFetcher; - -function _load_packageFetcher() { - return _packageFetcher = _interopRequireWildcard(__webpack_require__(210)); -} - -var _packageInstallScripts; - -function _load_packageInstallScripts() { - return _packageInstallScripts = _interopRequireDefault(__webpack_require__(557)); -} - -var _packageCompatibility; - -function _load_packageCompatibility() { - return _packageCompatibility = _interopRequireWildcard(__webpack_require__(209)); -} - -var _packageResolver; - -function _load_packageResolver() { - return _packageResolver = _interopRequireDefault(__webpack_require__(366)); -} - -var _packageLinker; - -function _load_packageLinker() { - return _packageLinker = _interopRequireDefault(__webpack_require__(211)); -} - -var _index2; - -function _load_index2() { - return _index2 = __webpack_require__(57); -} - -var _index3; - -function _load_index3() { - return _index3 = __webpack_require__(78); -} - -var _autoclean; - -function _load_autoclean() { - return _autoclean = __webpack_require__(354); -} - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(8)); -} - -var _normalizePattern; - -function _load_normalizePattern() { - return _normalizePattern = __webpack_require__(37); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(29)); -} - -var _yarnVersion; - -function _load_yarnVersion() { - return _yarnVersion = __webpack_require__(120); -} - -var _generatePnpMap; - -function _load_generatePnpMap() { - return _generatePnpMap = __webpack_require__(579); -} - -var _workspaceLayout; - -function _load_workspaceLayout() { - return _workspaceLayout = _interopRequireDefault(__webpack_require__(90)); -} - -var _resolutionMap; - -function _load_resolutionMap() { - return _resolutionMap = _interopRequireDefault(__webpack_require__(214)); -} - -var _guessName; - -function _load_guessName() { - return _guessName = _interopRequireDefault(__webpack_require__(169)); -} - -var _audit; - -function _load_audit() { - return _audit = _interopRequireDefault(__webpack_require__(353)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const deepEqual = __webpack_require__(631); - -const emoji = __webpack_require__(302); -const invariant = __webpack_require__(9); -const path = __webpack_require__(0); -const semver = __webpack_require__(21); -const uuid = __webpack_require__(119); -const ssri = __webpack_require__(77); - -const ONE_DAY = 1000 * 60 * 60 * 24; - -/** - * Try and detect the installation method for Yarn and provide a command to update it with. - */ - -function getUpdateCommand(installationMethod) { - if (installationMethod === 'tar') { - return `curl --compressed -o- -L ${(_constants || _load_constants()).YARN_INSTALLER_SH} | bash`; - } - - if (installationMethod === 'homebrew') { - return 'brew upgrade yarn'; - } - - if (installationMethod === 'deb') { - return 'sudo apt-get update && sudo apt-get install yarn'; - } - - if (installationMethod === 'rpm') { - return 'sudo yum install yarn'; - } - - if (installationMethod === 'npm') { - return 'npm install --global yarn'; - } - - if (installationMethod === 'chocolatey') { - return 'choco upgrade yarn'; - } - - if (installationMethod === 'apk') { - return 'apk update && apk add -u yarn'; - } - - if (installationMethod === 'portage') { - return 'sudo emerge --sync && sudo emerge -au sys-apps/yarn'; - } - - return null; -} - -function getUpdateInstaller(installationMethod) { - // Windows - if (installationMethod === 'msi') { - return (_constants || _load_constants()).YARN_INSTALLER_MSI; - } - - return null; -} - -function normalizeFlags(config, rawFlags) { - const flags = { - // install - har: !!rawFlags.har, - ignorePlatform: !!rawFlags.ignorePlatform, - ignoreEngines: !!rawFlags.ignoreEngines, - ignoreScripts: !!rawFlags.ignoreScripts, - ignoreOptional: !!rawFlags.ignoreOptional, - force: !!rawFlags.force, - flat: !!rawFlags.flat, - lockfile: rawFlags.lockfile !== false, - pureLockfile: !!rawFlags.pureLockfile, - updateChecksums: !!rawFlags.updateChecksums, - skipIntegrityCheck: !!rawFlags.skipIntegrityCheck, - frozenLockfile: !!rawFlags.frozenLockfile, - linkDuplicates: !!rawFlags.linkDuplicates, - checkFiles: !!rawFlags.checkFiles, - audit: !!rawFlags.audit, - - // add - peer: !!rawFlags.peer, - dev: !!rawFlags.dev, - optional: !!rawFlags.optional, - exact: !!rawFlags.exact, - tilde: !!rawFlags.tilde, - ignoreWorkspaceRootCheck: !!rawFlags.ignoreWorkspaceRootCheck, - - // outdated, update-interactive - includeWorkspaceDeps: !!rawFlags.includeWorkspaceDeps, - - // add, remove, update - workspaceRootIsCwd: rawFlags.workspaceRootIsCwd !== false - }; - - if (config.getOption('ignore-scripts')) { - flags.ignoreScripts = true; - } - - if (config.getOption('ignore-platform')) { - flags.ignorePlatform = true; - } - - if (config.getOption('ignore-engines')) { - flags.ignoreEngines = true; - } - - if (config.getOption('ignore-optional')) { - flags.ignoreOptional = true; - } - - if (config.getOption('force')) { - flags.force = true; - } - - return flags; -} - -class Install { - constructor(flags, config, reporter, lockfile) { - this.rootManifestRegistries = []; - this.rootPatternsToOrigin = (0, (_map || _load_map()).default)(); - this.lockfile = lockfile; - this.reporter = reporter; - this.config = config; - this.flags = normalizeFlags(config, flags); - this.resolutions = (0, (_map || _load_map()).default)(); // Legacy resolutions field used for flat install mode - this.resolutionMap = new (_resolutionMap || _load_resolutionMap()).default(config); // Selective resolutions for nested dependencies - this.resolver = new (_packageResolver || _load_packageResolver()).default(config, lockfile, this.resolutionMap); - this.integrityChecker = new (_integrityChecker || _load_integrityChecker()).default(config); - this.linker = new (_packageLinker || _load_packageLinker()).default(config, this.resolver); - this.scripts = new (_packageInstallScripts || _load_packageInstallScripts()).default(config, this.resolver, this.flags.force); - } - - /** - * Create a list of dependency requests from the current directories manifests. - */ - - fetchRequestFromCwd(excludePatterns = [], ignoreUnusedPatterns = false) { - var _this = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const patterns = []; - const deps = []; - let resolutionDeps = []; - const manifest = {}; - - const ignorePatterns = []; - const usedPatterns = []; - let workspaceLayout; - - // some commands should always run in the context of the entire workspace - const cwd = _this.flags.includeWorkspaceDeps || _this.flags.workspaceRootIsCwd ? _this.config.lockfileFolder : _this.config.cwd; - - // non-workspaces are always root, otherwise check for workspace root - const cwdIsRoot = !_this.config.workspaceRootFolder || _this.config.lockfileFolder === cwd; - - // exclude package names that are in install args - const excludeNames = []; - for (var _iterator = excludePatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - const pattern = _ref; - - if ((0, (_index3 || _load_index3()).getExoticResolver)(pattern)) { - excludeNames.push((0, (_guessName || _load_guessName()).default)(pattern)); - } else { - // extract the name - const parts = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern); - excludeNames.push(parts.name); - } - } - - const stripExcluded = function stripExcluded(manifest) { - for (var _iterator2 = excludeNames, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { - var _ref2; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref2 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref2 = _i2.value; - } - - const exclude = _ref2; - - if (manifest.dependencies && manifest.dependencies[exclude]) { - delete manifest.dependencies[exclude]; - } - if (manifest.devDependencies && manifest.devDependencies[exclude]) { - delete manifest.devDependencies[exclude]; - } - if (manifest.optionalDependencies && manifest.optionalDependencies[exclude]) { - delete manifest.optionalDependencies[exclude]; - } - } - }; - - for (var _iterator3 = Object.keys((_index2 || _load_index2()).registries), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { - var _ref3; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref3 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref3 = _i3.value; - } - - const registry = _ref3; - - const filename = (_index2 || _load_index2()).registries[registry].filename; - - const loc = path.join(cwd, filename); - if (!(yield (_fs || _load_fs()).exists(loc))) { - continue; - } - - _this.rootManifestRegistries.push(registry); - - const projectManifestJson = yield _this.config.readJson(loc); - yield (0, (_index || _load_index()).default)(projectManifestJson, cwd, _this.config, cwdIsRoot); - - Object.assign(_this.resolutions, projectManifestJson.resolutions); - Object.assign(manifest, projectManifestJson); - - _this.resolutionMap.init(_this.resolutions); - for (var _iterator4 = Object.keys(_this.resolutionMap.resolutionsByPackage), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { - var _ref4; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref4 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref4 = _i4.value; - } - - const packageName = _ref4; - - const optional = (_objectPath || _load_objectPath()).default.has(manifest.optionalDependencies, packageName) && _this.flags.ignoreOptional; - for (var _iterator8 = _this.resolutionMap.resolutionsByPackage[packageName], _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) { - var _ref9; - - if (_isArray8) { - if (_i8 >= _iterator8.length) break; - _ref9 = _iterator8[_i8++]; - } else { - _i8 = _iterator8.next(); - if (_i8.done) break; - _ref9 = _i8.value; - } - - const _ref8 = _ref9; - const pattern = _ref8.pattern; - - resolutionDeps = [...resolutionDeps, { registry, pattern, optional, hint: 'resolution' }]; - } - } - - const pushDeps = function pushDeps(depType, manifest, { hint, optional }, isUsed) { - if (ignoreUnusedPatterns && !isUsed) { - return; - } - // We only take unused dependencies into consideration to get deterministic hoisting. - // Since flat mode doesn't care about hoisting and everything is top level and specified then we can safely - // leave these out. - if (_this.flags.flat && !isUsed) { - return; - } - const depMap = manifest[depType]; - for (const name in depMap) { - if (excludeNames.indexOf(name) >= 0) { - continue; - } - - let pattern = name; - if (!_this.lockfile.getLocked(pattern)) { - // when we use --save we save the dependency to the lockfile with just the name rather than the - // version combo - pattern += '@' + depMap[name]; - } - - // normalization made sure packages are mentioned only once - if (isUsed) { - usedPatterns.push(pattern); - } else { - ignorePatterns.push(pattern); - } - - _this.rootPatternsToOrigin[pattern] = depType; - patterns.push(pattern); - deps.push({ pattern, registry, hint, optional, workspaceName: manifest.name, workspaceLoc: manifest._loc }); - } - }; - - if (cwdIsRoot) { - pushDeps('dependencies', projectManifestJson, { hint: null, optional: false }, true); - pushDeps('devDependencies', projectManifestJson, { hint: 'dev', optional: false }, !_this.config.production); - pushDeps('optionalDependencies', projectManifestJson, { hint: 'optional', optional: true }, true); - } - - if (_this.config.workspaceRootFolder) { - const workspaceLoc = cwdIsRoot ? loc : path.join(_this.config.lockfileFolder, filename); - const workspacesRoot = path.dirname(workspaceLoc); - - let workspaceManifestJson = projectManifestJson; - if (!cwdIsRoot) { - // the manifest we read before was a child workspace, so get the root - workspaceManifestJson = yield _this.config.readJson(workspaceLoc); - yield (0, (_index || _load_index()).default)(workspaceManifestJson, workspacesRoot, _this.config, true); - } - - const workspaces = yield _this.config.resolveWorkspaces(workspacesRoot, workspaceManifestJson); - workspaceLayout = new (_workspaceLayout || _load_workspaceLayout()).default(workspaces, _this.config); - - // add virtual manifest that depends on all workspaces, this way package hoisters and resolvers will work fine - const workspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.dependencies); - for (var _iterator5 = Object.keys(workspaces), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { - var _ref5; - - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref5 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref5 = _i5.value; - } - - const workspaceName = _ref5; - - const workspaceManifest = workspaces[workspaceName].manifest; - workspaceDependencies[workspaceName] = workspaceManifest.version; - - // include dependencies from all workspaces - if (_this.flags.includeWorkspaceDeps) { - pushDeps('dependencies', workspaceManifest, { hint: null, optional: false }, true); - pushDeps('devDependencies', workspaceManifest, { hint: 'dev', optional: false }, !_this.config.production); - pushDeps('optionalDependencies', workspaceManifest, { hint: 'optional', optional: true }, true); - } - } - const virtualDependencyManifest = { - _uid: '', - name: `workspace-aggregator-${uuid.v4()}`, - version: '1.0.0', - _registry: 'npm', - _loc: workspacesRoot, - dependencies: workspaceDependencies, - devDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.devDependencies), - optionalDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.optionalDependencies), - private: workspaceManifestJson.private, - workspaces: workspaceManifestJson.workspaces - }; - workspaceLayout.virtualManifestName = virtualDependencyManifest.name; - const virtualDep = {}; - virtualDep[virtualDependencyManifest.name] = virtualDependencyManifest.version; - workspaces[virtualDependencyManifest.name] = { loc: workspacesRoot, manifest: virtualDependencyManifest }; - - // ensure dependencies that should be excluded are stripped from the correct manifest - stripExcluded(cwdIsRoot ? virtualDependencyManifest : workspaces[projectManifestJson.name].manifest); - - pushDeps('workspaces', { workspaces: virtualDep }, { hint: 'workspaces', optional: false }, true); - - const implicitWorkspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceDependencies); - - for (var _iterator6 = (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { - var _ref6; - - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref6 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref6 = _i6.value; - } - - const type = _ref6; - - for (var _iterator7 = Object.keys(projectManifestJson[type] || {}), _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { - var _ref7; - - if (_isArray7) { - if (_i7 >= _iterator7.length) break; - _ref7 = _iterator7[_i7++]; - } else { - _i7 = _iterator7.next(); - if (_i7.done) break; - _ref7 = _i7.value; - } - - const dependencyName = _ref7; - - delete implicitWorkspaceDependencies[dependencyName]; - } - } - - pushDeps('dependencies', { dependencies: implicitWorkspaceDependencies }, { hint: 'workspaces', optional: false }, true); - } - - break; - } - - // inherit root flat flag - if (manifest.flat) { - _this.flags.flat = true; - } - - return { - requests: [...resolutionDeps, ...deps], - patterns, - manifest, - usedPatterns, - ignorePatterns, - workspaceLayout - }; - })(); - } - - /** - * TODO description - */ - - prepareRequests(requests) { - return requests; - } - - preparePatterns(patterns) { - return patterns; - } - preparePatternsForLinking(patterns, cwdManifest, cwdIsRoot) { - return patterns; - } - - prepareManifests() { - var _this2 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const manifests = yield _this2.config.getRootManifests(); - return manifests; - })(); - } - - bailout(patterns, workspaceLayout) { - var _this3 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // We don't want to skip the audit - it could yield important errors - if (_this3.flags.audit) { - return false; - } - // PNP is so fast that the integrity check isn't pertinent - if (_this3.config.plugnplayEnabled) { - return false; - } - if (_this3.flags.skipIntegrityCheck || _this3.flags.force) { - return false; - } - const lockfileCache = _this3.lockfile.cache; - if (!lockfileCache) { - return false; - } - const lockfileClean = _this3.lockfile.parseResultType === 'success'; - const match = yield _this3.integrityChecker.check(patterns, lockfileCache, _this3.flags, workspaceLayout); - if (_this3.flags.frozenLockfile && (!lockfileClean || match.missingPatterns.length > 0)) { - throw new (_errors || _load_errors()).MessageError(_this3.reporter.lang('frozenLockfileError')); - } - - const haveLockfile = yield (_fs || _load_fs()).exists(path.join(_this3.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME)); - - const lockfileIntegrityPresent = !_this3.lockfile.hasEntriesExistWithoutIntegrity(); - const integrityBailout = lockfileIntegrityPresent || !_this3.config.autoAddIntegrity; - - if (match.integrityMatches && haveLockfile && lockfileClean && integrityBailout) { - _this3.reporter.success(_this3.reporter.lang('upToDate')); - return true; - } - - if (match.integrityFileMissing && haveLockfile) { - // Integrity file missing, force script installations - _this3.scripts.setForce(true); - return false; - } - - if (match.hardRefreshRequired) { - // e.g. node version doesn't match, force script installations - _this3.scripts.setForce(true); - return false; - } - - if (!patterns.length && !match.integrityFileMissing) { - _this3.reporter.success(_this3.reporter.lang('nothingToInstall')); - yield _this3.createEmptyManifestFolders(); - yield _this3.saveLockfileAndIntegrity(patterns, workspaceLayout); - return true; - } - - return false; - })(); - } - - /** - * Produce empty folders for all used root manifests. - */ - - createEmptyManifestFolders() { - var _this4 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (_this4.config.modulesFolder) { - // already created - return; - } - - for (var _iterator9 = _this4.rootManifestRegistries, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) { - var _ref10; - - if (_isArray9) { - if (_i9 >= _iterator9.length) break; - _ref10 = _iterator9[_i9++]; - } else { - _i9 = _iterator9.next(); - if (_i9.done) break; - _ref10 = _i9.value; - } - - const registryName = _ref10; - const folder = _this4.config.registries[registryName].folder; - - yield (_fs || _load_fs()).mkdirp(path.join(_this4.config.lockfileFolder, folder)); - } - })(); - } - - /** - * TODO description - */ - - markIgnored(patterns) { - for (var _iterator10 = patterns, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) { - var _ref11; - - if (_isArray10) { - if (_i10 >= _iterator10.length) break; - _ref11 = _iterator10[_i10++]; - } else { - _i10 = _iterator10.next(); - if (_i10.done) break; - _ref11 = _i10.value; - } - - const pattern = _ref11; - - const manifest = this.resolver.getStrictResolvedPattern(pattern); - const ref = manifest._reference; - invariant(ref, 'expected package reference'); - - // just mark the package as ignored. if the package is used by a required package, the hoister - // will take care of that. - ref.ignore = true; - } - } - - /** - * helper method that gets only recent manifests - * used by global.ls command - */ - getFlattenedDeps() { - var _this5 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _ref12 = yield _this5.fetchRequestFromCwd(); - - const depRequests = _ref12.requests, - rawPatterns = _ref12.patterns; - - - yield _this5.resolver.init(depRequests, {}); - - const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this5.resolver.getManifests(), _this5.config); - _this5.resolver.updateManifests(manifests); - - return _this5.flatten(rawPatterns); - })(); - } - - /** - * TODO description - */ - - init() { - var _this6 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - _this6.checkUpdate(); - - // warn if we have a shrinkwrap - if (yield (_fs || _load_fs()).exists(path.join(_this6.config.lockfileFolder, (_constants || _load_constants()).NPM_SHRINKWRAP_FILENAME))) { - _this6.reporter.warn(_this6.reporter.lang('shrinkwrapWarning')); - } - - // warn if we have an npm lockfile - if (yield (_fs || _load_fs()).exists(path.join(_this6.config.lockfileFolder, (_constants || _load_constants()).NPM_LOCK_FILENAME))) { - _this6.reporter.warn(_this6.reporter.lang('npmLockfileWarning')); - } - - if (_this6.config.plugnplayEnabled) { - _this6.reporter.info(_this6.reporter.lang('plugnplaySuggestV2L1')); - _this6.reporter.info(_this6.reporter.lang('plugnplaySuggestV2L2')); - } - - let flattenedTopLevelPatterns = []; - const steps = []; - - var _ref13 = yield _this6.fetchRequestFromCwd(); - - const depRequests = _ref13.requests, - rawPatterns = _ref13.patterns, - ignorePatterns = _ref13.ignorePatterns, - workspaceLayout = _ref13.workspaceLayout, - manifest = _ref13.manifest; - - let topLevelPatterns = []; - - const artifacts = yield _this6.integrityChecker.getArtifacts(); - if (artifacts) { - _this6.linker.setArtifacts(artifacts); - _this6.scripts.setArtifacts(artifacts); - } - - if ((_packageCompatibility || _load_packageCompatibility()).shouldCheck(manifest, _this6.flags)) { - steps.push((() => { - var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - _this6.reporter.step(curr, total, _this6.reporter.lang('checkingManifest'), emoji.get('mag')); - yield _this6.checkCompatibility(); - }); - - return function (_x, _x2) { - return _ref14.apply(this, arguments); - }; - })()); - } - - const audit = new (_audit || _load_audit()).default(_this6.config, _this6.reporter, { groups: (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES }); - let auditFoundProblems = false; - - steps.push(function (curr, total) { - return (0, (_hooks || _load_hooks()).callThroughHook)('resolveStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - _this6.reporter.step(curr, total, _this6.reporter.lang('resolvingPackages'), emoji.get('mag')); - yield _this6.resolver.init(_this6.prepareRequests(depRequests), { - isFlat: _this6.flags.flat, - isFrozen: _this6.flags.frozenLockfile, - workspaceLayout - }); - topLevelPatterns = _this6.preparePatterns(rawPatterns); - flattenedTopLevelPatterns = yield _this6.flatten(topLevelPatterns); - return { bailout: !_this6.flags.audit && (yield _this6.bailout(topLevelPatterns, workspaceLayout)) }; - })); - }); - - if (_this6.flags.audit) { - steps.push(function (curr, total) { - return (0, (_hooks || _load_hooks()).callThroughHook)('auditStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - _this6.reporter.step(curr, total, _this6.reporter.lang('auditRunning'), emoji.get('mag')); - if (_this6.flags.offline) { - _this6.reporter.warn(_this6.reporter.lang('auditOffline')); - return { bailout: false }; - } - const preparedManifests = yield _this6.prepareManifests(); - // $FlowFixMe - Flow considers `m` in the map operation to be "mixed", so does not recognize `m.object` - const mergedManifest = Object.assign({}, ...Object.values(preparedManifests).map(function (m) { - return m.object; - })); - const auditVulnerabilityCounts = yield audit.performAudit(mergedManifest, _this6.lockfile, _this6.resolver, _this6.linker, topLevelPatterns); - auditFoundProblems = auditVulnerabilityCounts.info || auditVulnerabilityCounts.low || auditVulnerabilityCounts.moderate || auditVulnerabilityCounts.high || auditVulnerabilityCounts.critical; - return { bailout: yield _this6.bailout(topLevelPatterns, workspaceLayout) }; - })); - }); - } - - steps.push(function (curr, total) { - return (0, (_hooks || _load_hooks()).callThroughHook)('fetchStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - _this6.markIgnored(ignorePatterns); - _this6.reporter.step(curr, total, _this6.reporter.lang('fetchingPackages'), emoji.get('truck')); - const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this6.resolver.getManifests(), _this6.config); - _this6.resolver.updateManifests(manifests); - yield (_packageCompatibility || _load_packageCompatibility()).check(_this6.resolver.getManifests(), _this6.config, _this6.flags.ignoreEngines); - })); - }); - - steps.push(function (curr, total) { - return (0, (_hooks || _load_hooks()).callThroughHook)('linkStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // remove integrity hash to make this operation atomic - yield _this6.integrityChecker.removeIntegrityFile(); - _this6.reporter.step(curr, total, _this6.reporter.lang('linkingDependencies'), emoji.get('link')); - flattenedTopLevelPatterns = _this6.preparePatternsForLinking(flattenedTopLevelPatterns, manifest, _this6.config.lockfileFolder === _this6.config.cwd); - yield _this6.linker.init(flattenedTopLevelPatterns, workspaceLayout, { - linkDuplicates: _this6.flags.linkDuplicates, - ignoreOptional: _this6.flags.ignoreOptional - }); - })); - }); - - if (_this6.config.plugnplayEnabled) { - steps.push(function (curr, total) { - return (0, (_hooks || _load_hooks()).callThroughHook)('pnpStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const pnpPath = `${_this6.config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`; - - const code = yield (0, (_generatePnpMap || _load_generatePnpMap()).generatePnpMap)(_this6.config, flattenedTopLevelPatterns, { - resolver: _this6.resolver, - reporter: _this6.reporter, - targetPath: pnpPath, - workspaceLayout - }); - - try { - const file = yield (_fs || _load_fs()).readFile(pnpPath); - if (file === code) { - return; - } - } catch (error) {} - - yield (_fs || _load_fs()).writeFile(pnpPath, code); - yield (_fs || _load_fs()).chmod(pnpPath, 0o755); - })); - }); - } - - steps.push(function (curr, total) { - return (0, (_hooks || _load_hooks()).callThroughHook)('buildStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - _this6.reporter.step(curr, total, _this6.flags.force ? _this6.reporter.lang('rebuildingPackages') : _this6.reporter.lang('buildingFreshPackages'), emoji.get('hammer')); - - if (_this6.config.ignoreScripts) { - _this6.reporter.warn(_this6.reporter.lang('ignoredScripts')); - } else { - yield _this6.scripts.init(flattenedTopLevelPatterns); - } - })); - }); - - if (_this6.flags.har) { - steps.push((() => { - var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - const formattedDate = new Date().toISOString().replace(/:/g, '-'); - const filename = `yarn-install_${formattedDate}.har`; - _this6.reporter.step(curr, total, _this6.reporter.lang('savingHar', filename), emoji.get('black_circle_for_record')); - yield _this6.config.requestManager.saveHar(filename); - }); - - return function (_x3, _x4) { - return _ref21.apply(this, arguments); - }; - })()); - } - - if (yield _this6.shouldClean()) { - steps.push((() => { - var _ref22 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - _this6.reporter.step(curr, total, _this6.reporter.lang('cleaningModules'), emoji.get('recycle')); - yield (0, (_autoclean || _load_autoclean()).clean)(_this6.config, _this6.reporter); - }); - - return function (_x5, _x6) { - return _ref22.apply(this, arguments); - }; - })()); - } - - let currentStep = 0; - for (var _iterator11 = steps, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) { - var _ref23; - - if (_isArray11) { - if (_i11 >= _iterator11.length) break; - _ref23 = _iterator11[_i11++]; - } else { - _i11 = _iterator11.next(); - if (_i11.done) break; - _ref23 = _i11.value; - } - - const step = _ref23; - - const stepResult = yield step(++currentStep, steps.length); - if (stepResult && stepResult.bailout) { - if (_this6.flags.audit) { - audit.summary(); - } - if (auditFoundProblems) { - _this6.reporter.warn(_this6.reporter.lang('auditRunAuditForDetails')); - } - _this6.maybeOutputUpdate(); - return flattenedTopLevelPatterns; - } - } - - // fin! - if (_this6.flags.audit) { - audit.summary(); - } - if (auditFoundProblems) { - _this6.reporter.warn(_this6.reporter.lang('auditRunAuditForDetails')); - } - yield _this6.saveLockfileAndIntegrity(topLevelPatterns, workspaceLayout); - yield _this6.persistChanges(); - _this6.maybeOutputUpdate(); - _this6.config.requestManager.clearCache(); - return flattenedTopLevelPatterns; - })(); - } - - checkCompatibility() { - var _this7 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _ref24 = yield _this7.fetchRequestFromCwd(); - - const manifest = _ref24.manifest; - - yield (_packageCompatibility || _load_packageCompatibility()).checkOne(manifest, _this7.config, _this7.flags.ignoreEngines); - })(); - } - - persistChanges() { - var _this8 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // get all the different registry manifests in this folder - const manifests = yield _this8.config.getRootManifests(); - - if (yield _this8.applyChanges(manifests)) { - yield _this8.config.saveRootManifests(manifests); - } - })(); - } - - applyChanges(manifests) { - let hasChanged = false; - - if (this.config.plugnplayPersist) { - const object = manifests.npm.object; - - - if (typeof object.installConfig !== 'object') { - object.installConfig = {}; - } - - if (this.config.plugnplayEnabled && object.installConfig.pnp !== true) { - object.installConfig.pnp = true; - hasChanged = true; - } else if (!this.config.plugnplayEnabled && typeof object.installConfig.pnp !== 'undefined') { - delete object.installConfig.pnp; - hasChanged = true; - } - - if (Object.keys(object.installConfig).length === 0) { - delete object.installConfig; - } - } - - return Promise.resolve(hasChanged); - } - - /** - * Check if we should run the cleaning step. - */ - - shouldClean() { - return (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).CLEAN_FILENAME)); - } - - /** - * TODO - */ - - flatten(patterns) { - var _this9 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (!_this9.flags.flat) { - return patterns; - } - - const flattenedPatterns = []; - - for (var _iterator12 = _this9.resolver.getAllDependencyNamesByLevelOrder(patterns), _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) { - var _ref25; - - if (_isArray12) { - if (_i12 >= _iterator12.length) break; - _ref25 = _iterator12[_i12++]; - } else { - _i12 = _iterator12.next(); - if (_i12.done) break; - _ref25 = _i12.value; - } - - const name = _ref25; - - const infos = _this9.resolver.getAllInfoForPackageName(name).filter(function (manifest) { - const ref = manifest._reference; - invariant(ref, 'expected package reference'); - return !ref.ignore; - }); - - if (infos.length === 0) { - continue; - } - - if (infos.length === 1) { - // single version of this package - // take out a single pattern as multiple patterns may have resolved to this package - flattenedPatterns.push(_this9.resolver.patternsByPackage[name][0]); - continue; - } - - const options = infos.map(function (info) { - const ref = info._reference; - invariant(ref, 'expected reference'); - return { - // TODO `and is required by {PARENT}`, - name: _this9.reporter.lang('manualVersionResolutionOption', ref.patterns.join(', '), info.version), - - value: info.version - }; - }); - const versions = infos.map(function (info) { - return info.version; - }); - let version; - - const resolutionVersion = _this9.resolutions[name]; - if (resolutionVersion && versions.indexOf(resolutionVersion) >= 0) { - // use json `resolution` version - version = resolutionVersion; - } else { - version = yield _this9.reporter.select(_this9.reporter.lang('manualVersionResolution', name), _this9.reporter.lang('answer'), options); - _this9.resolutions[name] = version; - } - - flattenedPatterns.push(_this9.resolver.collapseAllVersionsOfPackage(name, version)); - } - - // save resolutions to their appropriate root manifest - if (Object.keys(_this9.resolutions).length) { - const manifests = yield _this9.config.getRootManifests(); - - for (const name in _this9.resolutions) { - const version = _this9.resolutions[name]; - - const patterns = _this9.resolver.patternsByPackage[name]; - if (!patterns) { - continue; - } - - let manifest; - for (var _iterator13 = patterns, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator]();;) { - var _ref26; - - if (_isArray13) { - if (_i13 >= _iterator13.length) break; - _ref26 = _iterator13[_i13++]; - } else { - _i13 = _iterator13.next(); - if (_i13.done) break; - _ref26 = _i13.value; - } - - const pattern = _ref26; - - manifest = _this9.resolver.getResolvedPattern(pattern); - if (manifest) { - break; - } - } - invariant(manifest, 'expected manifest'); - - const ref = manifest._reference; - invariant(ref, 'expected reference'); - - const object = manifests[ref.registry].object; - object.resolutions = object.resolutions || {}; - object.resolutions[name] = version; - } - - yield _this9.config.saveRootManifests(manifests); - } - - return flattenedPatterns; - })(); - } - - /** - * Remove offline tarballs that are no longer required - */ - - pruneOfflineMirror(lockfile) { - var _this10 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const mirror = _this10.config.getOfflineMirrorPath(); - if (!mirror) { - return; - } - - const requiredTarballs = new Set(); - for (const dependency in lockfile) { - const resolved = lockfile[dependency].resolved; - if (resolved) { - const basename = path.basename(resolved.split('#')[0]); - if (dependency[0] === '@' && basename[0] !== '@') { - requiredTarballs.add(`${dependency.split('/')[0]}-${basename}`); - } - requiredTarballs.add(basename); - } - } - - const mirrorFiles = yield (_fs || _load_fs()).walk(mirror); - for (var _iterator14 = mirrorFiles, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator]();;) { - var _ref27; - - if (_isArray14) { - if (_i14 >= _iterator14.length) break; - _ref27 = _iterator14[_i14++]; - } else { - _i14 = _iterator14.next(); - if (_i14.done) break; - _ref27 = _i14.value; - } - - const file = _ref27; - - const isTarball = path.extname(file.basename) === '.tgz'; - // if using experimental-pack-script-packages-in-mirror flag, don't unlink prebuilt packages - const hasPrebuiltPackage = file.relative.startsWith('prebuilt/'); - if (isTarball && !hasPrebuiltPackage && !requiredTarballs.has(file.basename)) { - yield (_fs || _load_fs()).unlink(file.absolute); - } - } - })(); - } - - /** - * Save updated integrity and lockfiles. - */ - - saveLockfileAndIntegrity(patterns, workspaceLayout) { - var _this11 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const resolvedPatterns = {}; - Object.keys(_this11.resolver.patterns).forEach(function (pattern) { - if (!workspaceLayout || !workspaceLayout.getManifestByPattern(pattern)) { - resolvedPatterns[pattern] = _this11.resolver.patterns[pattern]; - } - }); - - // TODO this code is duplicated in a few places, need a common way to filter out workspace patterns from lockfile - patterns = patterns.filter(function (p) { - return !workspaceLayout || !workspaceLayout.getManifestByPattern(p); - }); - - const lockfileBasedOnResolver = _this11.lockfile.getLockfile(resolvedPatterns); - - if (_this11.config.pruneOfflineMirror) { - yield _this11.pruneOfflineMirror(lockfileBasedOnResolver); - } - - // write integrity hash - if (!_this11.config.plugnplayEnabled) { - yield _this11.integrityChecker.save(patterns, lockfileBasedOnResolver, _this11.flags, workspaceLayout, _this11.scripts.getArtifacts()); - } - - // --no-lockfile or --pure-lockfile or --frozen-lockfile - if (_this11.flags.lockfile === false || _this11.flags.pureLockfile || _this11.flags.frozenLockfile) { - return; - } - - const lockFileHasAllPatterns = patterns.every(function (p) { - return _this11.lockfile.getLocked(p); - }); - const lockfilePatternsMatch = Object.keys(_this11.lockfile.cache || {}).every(function (p) { - return lockfileBasedOnResolver[p]; - }); - const resolverPatternsAreSameAsInLockfile = Object.keys(lockfileBasedOnResolver).every(function (pattern) { - const manifest = _this11.lockfile.getLocked(pattern); - return manifest && manifest.resolved === lockfileBasedOnResolver[pattern].resolved && deepEqual(manifest.prebuiltVariants, lockfileBasedOnResolver[pattern].prebuiltVariants); - }); - const integrityPatternsAreSameAsInLockfile = Object.keys(lockfileBasedOnResolver).every(function (pattern) { - const existingIntegrityInfo = lockfileBasedOnResolver[pattern].integrity; - if (!existingIntegrityInfo) { - // if this entry does not have an integrity, no need to re-write the lockfile because of it - return true; - } - const manifest = _this11.lockfile.getLocked(pattern); - if (manifest && manifest.integrity) { - const manifestIntegrity = ssri.stringify(manifest.integrity); - return manifestIntegrity === existingIntegrityInfo; - } - return false; - }); - - // remove command is followed by install with force, lockfile will be rewritten in any case then - if (!_this11.flags.force && _this11.lockfile.parseResultType === 'success' && lockFileHasAllPatterns && lockfilePatternsMatch && resolverPatternsAreSameAsInLockfile && integrityPatternsAreSameAsInLockfile && patterns.length) { - return; - } - - // build lockfile location - const loc = path.join(_this11.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME); - - // write lockfile - const lockSource = (0, (_lockfile2 || _load_lockfile2()).stringify)(lockfileBasedOnResolver, false, _this11.config.enableLockfileVersions); - yield (_fs || _load_fs()).writeFilePreservingEol(loc, lockSource); - - _this11._logSuccessSaveLockfile(); - })(); - } - - _logSuccessSaveLockfile() { - this.reporter.success(this.reporter.lang('savedLockfile')); - } - - /** - * Load the dependency graph of the current install. Only does package resolving and wont write to the cwd. - */ - hydrate(ignoreUnusedPatterns) { - var _this12 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const request = yield _this12.fetchRequestFromCwd([], ignoreUnusedPatterns); - const depRequests = request.requests, - rawPatterns = request.patterns, - ignorePatterns = request.ignorePatterns, - workspaceLayout = request.workspaceLayout; - - - yield _this12.resolver.init(depRequests, { - isFlat: _this12.flags.flat, - isFrozen: _this12.flags.frozenLockfile, - workspaceLayout - }); - yield _this12.flatten(rawPatterns); - _this12.markIgnored(ignorePatterns); - - // fetch packages, should hit cache most of the time - const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this12.resolver.getManifests(), _this12.config); - _this12.resolver.updateManifests(manifests); - yield (_packageCompatibility || _load_packageCompatibility()).check(_this12.resolver.getManifests(), _this12.config, _this12.flags.ignoreEngines); - - // expand minimal manifests - for (var _iterator15 = _this12.resolver.getManifests(), _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator]();;) { - var _ref28; - - if (_isArray15) { - if (_i15 >= _iterator15.length) break; - _ref28 = _iterator15[_i15++]; - } else { - _i15 = _iterator15.next(); - if (_i15.done) break; - _ref28 = _i15.value; - } - - const manifest = _ref28; - - const ref = manifest._reference; - invariant(ref, 'expected reference'); - const type = ref.remote.type; - // link specifier won't ever hit cache - - let loc = ''; - if (type === 'link') { - continue; - } else if (type === 'workspace') { - if (!ref.remote.reference) { - continue; - } - loc = ref.remote.reference; - } else { - loc = _this12.config.generateModuleCachePath(ref); - } - const newPkg = yield _this12.config.readManifest(loc); - yield _this12.resolver.updateManifest(ref, newPkg); - } - - return request; - })(); - } - - /** - * Check for updates every day and output a nag message if there's a newer version. - */ - - checkUpdate() { - if (this.config.nonInteractive) { - // don't show upgrade dialog on CI or non-TTY terminals - return; - } - - // don't check if disabled - if (this.config.getOption('disable-self-update-check')) { - return; - } - - // only check for updates once a day - const lastUpdateCheck = Number(this.config.getOption('lastUpdateCheck')) || 0; - if (lastUpdateCheck && Date.now() - lastUpdateCheck < ONE_DAY) { - return; - } - - // don't bug for updates on tagged releases - if ((_yarnVersion || _load_yarnVersion()).version.indexOf('-') >= 0) { - return; - } - - this._checkUpdate().catch(() => { - // swallow errors - }); - } - - _checkUpdate() { - var _this13 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - let latestVersion = yield _this13.config.requestManager.request({ - url: (_constants || _load_constants()).SELF_UPDATE_VERSION_URL - }); - invariant(typeof latestVersion === 'string', 'expected string'); - latestVersion = latestVersion.trim(); - if (!semver.valid(latestVersion)) { - return; - } - - // ensure we only check for updates periodically - _this13.config.registries.yarn.saveHomeConfig({ - lastUpdateCheck: Date.now() - }); - - if (semver.gt(latestVersion, (_yarnVersion || _load_yarnVersion()).version)) { - const installationMethod = yield (0, (_yarnVersion || _load_yarnVersion()).getInstallationMethod)(); - _this13.maybeOutputUpdate = function () { - _this13.reporter.warn(_this13.reporter.lang('yarnOutdated', latestVersion, (_yarnVersion || _load_yarnVersion()).version)); - - const command = getUpdateCommand(installationMethod); - if (command) { - _this13.reporter.info(_this13.reporter.lang('yarnOutdatedCommand')); - _this13.reporter.command(command); - } else { - const installer = getUpdateInstaller(installationMethod); - if (installer) { - _this13.reporter.info(_this13.reporter.lang('yarnOutdatedInstaller', installer)); - } - } - }; - } - })(); - } - - /** - * Method to override with a possible upgrade message. - */ - - maybeOutputUpdate() {} -} - -exports.Install = Install; -function hasWrapper(commander, args) { - return true; -} - -function setFlags(commander) { - commander.description('Yarn install is used to install all dependencies for a project.'); - commander.usage('install [flags]'); - commander.option('-A, --audit', 'Run vulnerability audit on installed packages'); - commander.option('-g, --global', 'DEPRECATED'); - commander.option('-S, --save', 'DEPRECATED - save package to your `dependencies`'); - commander.option('-D, --save-dev', 'DEPRECATED - save package to your `devDependencies`'); - commander.option('-P, --save-peer', 'DEPRECATED - save package to your `peerDependencies`'); - commander.option('-O, --save-optional', 'DEPRECATED - save package to your `optionalDependencies`'); - commander.option('-E, --save-exact', 'DEPRECATED'); - commander.option('-T, --save-tilde', 'DEPRECATED'); -} - -/***/ }), -/* 35 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(52); -module.exports = function (it) { - if (!isObject(it)) throw TypeError(it + ' is not an object!'); - return it; -}; - - -/***/ }), -/* 36 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return SubjectSubscriber; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subject; }); -/* unused harmony export AnonymousSubject */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Observable__ = __webpack_require__(11); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscriber__ = __webpack_require__(7); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(25); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__ = __webpack_require__(189); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__SubjectSubscription__ = __webpack_require__(422); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_symbol_rxSubscriber__ = __webpack_require__(321); -/** PURE_IMPORTS_START tslib,_Observable,_Subscriber,_Subscription,_util_ObjectUnsubscribedError,_SubjectSubscription,_internal_symbol_rxSubscriber PURE_IMPORTS_END */ - - - - - - - -var SubjectSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SubjectSubscriber, _super); - function SubjectSubscriber(destination) { - var _this = _super.call(this, destination) || this; - _this.destination = destination; - return _this; - } - return SubjectSubscriber; -}(__WEBPACK_IMPORTED_MODULE_2__Subscriber__["a" /* Subscriber */])); - -var Subject = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](Subject, _super); - function Subject() { - var _this = _super.call(this) || this; - _this.observers = []; - _this.closed = false; - _this.isStopped = false; - _this.hasError = false; - _this.thrownError = null; - return _this; - } - Subject.prototype[__WEBPACK_IMPORTED_MODULE_6__internal_symbol_rxSubscriber__["a" /* rxSubscriber */]] = function () { - return new SubjectSubscriber(this); - }; - Subject.prototype.lift = function (operator) { - var subject = new AnonymousSubject(this, this); - subject.operator = operator; - return subject; - }; - Subject.prototype.next = function (value) { - if (this.closed) { - throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */](); - } - if (!this.isStopped) { - var observers = this.observers; - var len = observers.length; - var copy = observers.slice(); - for (var i = 0; i < len; i++) { - copy[i].next(value); - } - } - }; - Subject.prototype.error = function (err) { - if (this.closed) { - throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */](); - } - this.hasError = true; - this.thrownError = err; - this.isStopped = true; - var observers = this.observers; - var len = observers.length; - var copy = observers.slice(); - for (var i = 0; i < len; i++) { - copy[i].error(err); - } - this.observers.length = 0; - }; - Subject.prototype.complete = function () { - if (this.closed) { - throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */](); - } - this.isStopped = true; - var observers = this.observers; - var len = observers.length; - var copy = observers.slice(); - for (var i = 0; i < len; i++) { - copy[i].complete(); - } - this.observers.length = 0; - }; - Subject.prototype.unsubscribe = function () { - this.isStopped = true; - this.closed = true; - this.observers = null; - }; - Subject.prototype._trySubscribe = function (subscriber) { - if (this.closed) { - throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */](); - } - else { - return _super.prototype._trySubscribe.call(this, subscriber); - } - }; - Subject.prototype._subscribe = function (subscriber) { - if (this.closed) { - throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */](); - } - else if (this.hasError) { - subscriber.error(this.thrownError); - return __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY; - } - else if (this.isStopped) { - subscriber.complete(); - return __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY; - } - else { - this.observers.push(subscriber); - return new __WEBPACK_IMPORTED_MODULE_5__SubjectSubscription__["a" /* SubjectSubscription */](this, subscriber); - } - }; - Subject.prototype.asObservable = function () { - var observable = new __WEBPACK_IMPORTED_MODULE_1__Observable__["a" /* Observable */](); - observable.source = this; - return observable; - }; - Subject.create = function (destination, source) { - return new AnonymousSubject(destination, source); - }; - return Subject; -}(__WEBPACK_IMPORTED_MODULE_1__Observable__["a" /* Observable */])); - -var AnonymousSubject = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AnonymousSubject, _super); - function AnonymousSubject(destination, source) { - var _this = _super.call(this) || this; - _this.destination = destination; - _this.source = source; - return _this; - } - AnonymousSubject.prototype.next = function (value) { - var destination = this.destination; - if (destination && destination.next) { - destination.next(value); - } - }; - AnonymousSubject.prototype.error = function (err) { - var destination = this.destination; - if (destination && destination.error) { - this.destination.error(err); - } - }; - AnonymousSubject.prototype.complete = function () { - var destination = this.destination; - if (destination && destination.complete) { - this.destination.complete(); - } - }; - AnonymousSubject.prototype._subscribe = function (subscriber) { - var source = this.source; - if (source) { - return this.source.subscribe(subscriber); - } - else { - return __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY; - } - }; - return AnonymousSubject; -}(Subject)); - -//# sourceMappingURL=Subject.js.map - - -/***/ }), -/* 37 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.normalizePattern = normalizePattern; - -/** - * Explode and normalize a pattern into its name and range. - */ - -function normalizePattern(pattern) { - let hasVersion = false; - let range = 'latest'; - let name = pattern; - - // if we're a scope then remove the @ and add it back later - let isScoped = false; - if (name[0] === '@') { - isScoped = true; - name = name.slice(1); - } - - // take first part as the name - const parts = name.split('@'); - if (parts.length > 1) { - name = parts.shift(); - range = parts.join('@'); - - if (range) { - hasVersion = true; - } else { - range = '*'; - } - } - - // add back @ scope suffix - if (isScoped) { - name = `@${name}`; - } - - return { name, range, hasVersion }; -} - -/***/ }), -/* 38 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;/** - * @license - * Lodash - * Copyright JS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -;(function() { - - /** Used as a safe reference for `undefined` in pre-ES5 environments. */ - var undefined; - - /** Used as the semantic version number. */ - var VERSION = '4.17.10'; - - /** Used as the size to enable large array optimizations. */ - var LARGE_ARRAY_SIZE = 200; - - /** Error message constants. */ - var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', - FUNC_ERROR_TEXT = 'Expected a function'; - - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; - - /** Used as the maximum memoize cache size. */ - var MAX_MEMOIZE_SIZE = 500; - - /** Used as the internal argument placeholder. */ - var PLACEHOLDER = '__lodash_placeholder__'; - - /** Used to compose bitmasks for cloning. */ - var CLONE_DEEP_FLAG = 1, - CLONE_FLAT_FLAG = 2, - CLONE_SYMBOLS_FLAG = 4; - - /** Used to compose bitmasks for value comparisons. */ - var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; - - /** Used to compose bitmasks for function metadata. */ - var WRAP_BIND_FLAG = 1, - WRAP_BIND_KEY_FLAG = 2, - WRAP_CURRY_BOUND_FLAG = 4, - WRAP_CURRY_FLAG = 8, - WRAP_CURRY_RIGHT_FLAG = 16, - WRAP_PARTIAL_FLAG = 32, - WRAP_PARTIAL_RIGHT_FLAG = 64, - WRAP_ARY_FLAG = 128, - WRAP_REARG_FLAG = 256, - WRAP_FLIP_FLAG = 512; - - /** Used as default options for `_.truncate`. */ - var DEFAULT_TRUNC_LENGTH = 30, - DEFAULT_TRUNC_OMISSION = '...'; - - /** Used to detect hot functions by number of calls within a span of milliseconds. */ - var HOT_COUNT = 800, - HOT_SPAN = 16; - - /** Used to indicate the type of lazy iteratees. */ - var LAZY_FILTER_FLAG = 1, - LAZY_MAP_FLAG = 2, - LAZY_WHILE_FLAG = 3; - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - - /** Used as references for the maximum length and index of an array. */ - var MAX_ARRAY_LENGTH = 4294967295, - MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, - HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; - - /** Used to associate wrap methods with their bit flags. */ - var wrapFlags = [ - ['ary', WRAP_ARY_FLAG], - ['bind', WRAP_BIND_FLAG], - ['bindKey', WRAP_BIND_KEY_FLAG], - ['curry', WRAP_CURRY_FLAG], - ['curryRight', WRAP_CURRY_RIGHT_FLAG], - ['flip', WRAP_FLIP_FLAG], - ['partial', WRAP_PARTIAL_FLAG], - ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], - ['rearg', WRAP_REARG_FLAG] - ]; - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - asyncTag = '[object AsyncFunction]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - domExcTag = '[object DOMException]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - nullTag = '[object Null]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - proxyTag = '[object Proxy]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - undefinedTag = '[object Undefined]', - weakMapTag = '[object WeakMap]', - weakSetTag = '[object WeakSet]'; - - var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - - /** Used to match empty string literals in compiled template source. */ - var reEmptyStringLeading = /\b__p \+= '';/g, - reEmptyStringMiddle = /\b(__p \+=) '' \+/g, - reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; - - /** Used to match HTML entities and HTML characters. */ - var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, - reUnescapedHtml = /[&<>"']/g, - reHasEscapedHtml = RegExp(reEscapedHtml.source), - reHasUnescapedHtml = RegExp(reUnescapedHtml.source); - - /** Used to match template delimiters. */ - var reEscape = /<%-([\s\S]+?)%>/g, - reEvaluate = /<%([\s\S]+?)%>/g, - reInterpolate = /<%=([\s\S]+?)%>/g; - - /** Used to match property names within property paths. */ - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - - /** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, - reHasRegExpChar = RegExp(reRegExpChar.source); - - /** Used to match leading and trailing whitespace. */ - var reTrim = /^\s+|\s+$/g, - reTrimStart = /^\s+/, - reTrimEnd = /\s+$/; - - /** Used to match wrap detail comments. */ - var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, - reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, - reSplitDetails = /,? & /; - - /** Used to match words composed of alphanumeric characters. */ - var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; - - /** Used to match backslashes in property paths. */ - var reEscapeChar = /\\(\\)?/g; - - /** - * Used to match - * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). - */ - var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; - - /** Used to match `RegExp` flags from their coerced string values. */ - var reFlags = /\w*$/; - - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; - - /** Used to detect host constructors (Safari). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; - - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; - - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; - - /** Used to match Latin Unicode letters (excluding mathematical operators). */ - var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; - - /** Used to ensure capturing order of template delimiters. */ - var reNoMatch = /($^)/; - - /** Used to match unescaped characters in compiled string literals. */ - var reUnescapedString = /['\n\r\u2028\u2029\\]/g; - - /** Used to compose unicode character classes. */ - var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f', - reComboHalfMarksRange = '\\ufe20-\\ufe2f', - rsComboSymbolsRange = '\\u20d0-\\u20ff', - rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, - rsDingbatRange = '\\u2700-\\u27bf', - rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', - rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', - rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', - rsPunctuationRange = '\\u2000-\\u206f', - rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', - rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', - rsVarRange = '\\ufe0e\\ufe0f', - rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; - - /** Used to compose unicode capture groups. */ - var rsApos = "['\u2019]", - rsAstral = '[' + rsAstralRange + ']', - rsBreak = '[' + rsBreakRange + ']', - rsCombo = '[' + rsComboRange + ']', - rsDigits = '\\d+', - rsDingbat = '[' + rsDingbatRange + ']', - rsLower = '[' + rsLowerRange + ']', - rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsUpper = '[' + rsUpperRange + ']', - rsZWJ = '\\u200d'; - - /** Used to compose unicode regexes. */ - var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', - rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', - rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', - rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', - reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', - rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - - /** Used to match apostrophes. */ - var reApos = RegExp(rsApos, 'g'); - - /** - * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and - * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). - */ - var reComboMark = RegExp(rsCombo, 'g'); - - /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ - var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - - /** Used to match complex or compound words. */ - var reUnicodeWord = RegExp([ - rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', - rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', - rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, - rsUpper + '+' + rsOptContrUpper, - rsOrdUpper, - rsOrdLower, - rsDigits, - rsEmoji - ].join('|'), 'g'); - - /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ - var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); - - /** Used to detect strings that need a more robust regexp to match words. */ - var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; - - /** Used to assign default `context` object properties. */ - var contextProps = [ - 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', - 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', - 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', - 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', - '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' - ]; - - /** Used to make template sourceURLs easier to identify. */ - var templateCounter = -1; - - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = - typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = - typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = - typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = - typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = - typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = - typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = - typedArrayTags[errorTag] = typedArrayTags[funcTag] = - typedArrayTags[mapTag] = typedArrayTags[numberTag] = - typedArrayTags[objectTag] = typedArrayTags[regexpTag] = - typedArrayTags[setTag] = typedArrayTags[stringTag] = - typedArrayTags[weakMapTag] = false; - - /** Used to identify `toStringTag` values supported by `_.clone`. */ - var cloneableTags = {}; - cloneableTags[argsTag] = cloneableTags[arrayTag] = - cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = - cloneableTags[boolTag] = cloneableTags[dateTag] = - cloneableTags[float32Tag] = cloneableTags[float64Tag] = - cloneableTags[int8Tag] = cloneableTags[int16Tag] = - cloneableTags[int32Tag] = cloneableTags[mapTag] = - cloneableTags[numberTag] = cloneableTags[objectTag] = - cloneableTags[regexpTag] = cloneableTags[setTag] = - cloneableTags[stringTag] = cloneableTags[symbolTag] = - cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = - cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; - cloneableTags[errorTag] = cloneableTags[funcTag] = - cloneableTags[weakMapTag] = false; - - /** Used to map Latin Unicode letters to basic Latin letters. */ - var deburredLetters = { - // Latin-1 Supplement block. - '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', - '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', - '\xc7': 'C', '\xe7': 'c', - '\xd0': 'D', '\xf0': 'd', - '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', - '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', - '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', - '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', - '\xd1': 'N', '\xf1': 'n', - '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', - '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', - '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', - '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', - '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', - '\xc6': 'Ae', '\xe6': 'ae', - '\xde': 'Th', '\xfe': 'th', - '\xdf': 'ss', - // Latin Extended-A block. - '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', - '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', - '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', - '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', - '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', - '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', - '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', - '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', - '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', - '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', - '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', - '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', - '\u0134': 'J', '\u0135': 'j', - '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', - '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', - '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', - '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', - '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', - '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', - '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', - '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', - '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', - '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', - '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', - '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', - '\u0163': 't', '\u0165': 't', '\u0167': 't', - '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', - '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', - '\u0174': 'W', '\u0175': 'w', - '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', - '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', - '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', - '\u0132': 'IJ', '\u0133': 'ij', - '\u0152': 'Oe', '\u0153': 'oe', - '\u0149': "'n", '\u017f': 's' - }; - - /** Used to map characters to HTML entities. */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; - - /** Used to map HTML entities to characters. */ - var htmlUnescapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'" - }; - - /** Used to escape characters for inclusion in compiled string literals. */ - var stringEscapes = { - '\\': '\\', - "'": "'", - '\n': 'n', - '\r': 'r', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - /** Built-in method references without a dependency on `root`. */ - var freeParseFloat = parseFloat, - freeParseInt = parseInt; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - - /** Detect free variable `self`. */ - var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || Function('return this')(); - - /** Detect free variable `exports`. */ - var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - - /** Detect free variable `module`. */ - var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = freeModule && freeModule.exports === freeExports; - - /** Detect free variable `process` from Node.js. */ - var freeProcess = moduleExports && freeGlobal.process; - - /** Used to access faster Node.js helpers. */ - var nodeUtil = (function() { - try { - // Use `util.types` for Node.js 10+. - var types = freeModule && freeModule.require && freeModule.require('util').types; - - if (types) { - return types; - } - - // Legacy `process.binding('util')` for Node.js < 10. - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} - }()); - - /* Node.js helper references. */ - var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, - nodeIsDate = nodeUtil && nodeUtil.isDate, - nodeIsMap = nodeUtil && nodeUtil.isMap, - nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, - nodeIsSet = nodeUtil && nodeUtil.isSet, - nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - - /*--------------------------------------------------------------------------*/ - - /** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ - function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); - } - - /** - * A specialized version of `baseAggregator` for arrays. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ - function arrayAggregator(array, setter, iteratee, accumulator) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - var value = array[index]; - setter(accumulator, value, iteratee(value), array); - } - return accumulator; - } - - /** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEach(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; - } - - /** - * A specialized version of `_.forEachRight` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEachRight(array, iteratee) { - var length = array == null ? 0 : array.length; - - while (length--) { - if (iteratee(array[length], length, array) === false) { - break; - } - } - return array; - } - - /** - * A specialized version of `_.every` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - */ - function arrayEvery(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (!predicate(array[index], index, array)) { - return false; - } - } - return true; - } - - /** - * A specialized version of `_.filter` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function arrayFilter(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; - } - } - return result; - } - - /** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ - function arrayIncludes(array, value) { - var length = array == null ? 0 : array.length; - return !!length && baseIndexOf(array, value, 0) > -1; - } - - /** - * This function is like `arrayIncludes` except that it accepts a comparator. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ - function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } - } - return false; - } - - /** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function arrayMap(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; - } - - /** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ - function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; - } - - /** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array == null ? 0 : array.length; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; - } - - /** - * A specialized version of `_.reduceRight` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the last element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduceRight(array, iteratee, accumulator, initAccum) { - var length = array == null ? 0 : array.length; - if (initAccum && length) { - accumulator = array[--length]; - } - while (length--) { - accumulator = iteratee(accumulator, array[length], length, array); - } - return accumulator; - } - - /** - * A specialized version of `_.some` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function arraySome(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; - } - - /** - * Gets the size of an ASCII `string`. - * - * @private - * @param {string} string The string inspect. - * @returns {number} Returns the string size. - */ - var asciiSize = baseProperty('length'); - - /** - * Converts an ASCII `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function asciiToArray(string) { - return string.split(''); - } - - /** - * Splits an ASCII `string` into an array of its words. - * - * @private - * @param {string} The string to inspect. - * @returns {Array} Returns the words of `string`. - */ - function asciiWords(string) { - return string.match(reAsciiWord) || []; - } - - /** - * The base implementation of methods like `_.findKey` and `_.findLastKey`, - * without support for iteratee shorthands, which iterates over `collection` - * using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the found element or its key, else `undefined`. - */ - function baseFindKey(collection, predicate, eachFunc) { - var result; - eachFunc(collection, function(value, key, collection) { - if (predicate(value, key, collection)) { - result = key; - return false; - } - }); - return result; - } - - /** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; - } - - /** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOf(array, value, fromIndex) { - return value === value - ? strictIndexOf(array, value, fromIndex) - : baseFindIndex(array, baseIsNaN, fromIndex); - } - - /** - * This function is like `baseIndexOf` except that it accepts a comparator. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @param {Function} comparator The comparator invoked per element. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOfWith(array, value, fromIndex, comparator) { - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (comparator(array[index], value)) { - return index; - } - } - return -1; - } - - /** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ - function baseIsNaN(value) { - return value !== value; - } - - /** - * The base implementation of `_.mean` and `_.meanBy` without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the mean. - */ - function baseMean(array, iteratee) { - var length = array == null ? 0 : array.length; - return length ? (baseSum(array, iteratee) / length) : NAN; - } - - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; - } - - /** - * The base implementation of `_.propertyOf` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @returns {Function} Returns the new accessor function. - */ - function basePropertyOf(object) { - return function(key) { - return object == null ? undefined : object[key]; - }; - } - - /** - * The base implementation of `_.reduce` and `_.reduceRight`, without support - * for iteratee shorthands, which iterates over `collection` using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} accumulator The initial value. - * @param {boolean} initAccum Specify using the first or last element of - * `collection` as the initial value. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the accumulated value. - */ - function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { - eachFunc(collection, function(value, index, collection) { - accumulator = initAccum - ? (initAccum = false, value) - : iteratee(accumulator, value, index, collection); - }); - return accumulator; - } - - /** - * The base implementation of `_.sortBy` which uses `comparer` to define the - * sort order of `array` and replaces criteria objects with their corresponding - * values. - * - * @private - * @param {Array} array The array to sort. - * @param {Function} comparer The function to define sort order. - * @returns {Array} Returns `array`. - */ - function baseSortBy(array, comparer) { - var length = array.length; - - array.sort(comparer); - while (length--) { - array[length] = array[length].value; - } - return array; - } - - /** - * The base implementation of `_.sum` and `_.sumBy` without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the sum. - */ - function baseSum(array, iteratee) { - var result, - index = -1, - length = array.length; - - while (++index < length) { - var current = iteratee(array[index]); - if (current !== undefined) { - result = result === undefined ? current : (result + current); - } - } - return result; - } - - /** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ - function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; - } - - /** - * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array - * of key-value pairs for `object` corresponding to the property names of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the key-value pairs. - */ - function baseToPairs(object, props) { - return arrayMap(props, function(key) { - return [key, object[key]]; - }); - } - - /** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ - function baseUnary(func) { - return function(value) { - return func(value); - }; - } - - /** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ - function baseValues(object, props) { - return arrayMap(props, function(key) { - return object[key]; - }); - } - - /** - * Checks if a `cache` value for `key` exists. - * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function cacheHas(cache, key) { - return cache.has(key); - } - - /** - * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the first unmatched string symbol. - */ - function charsStartIndex(strSymbols, chrSymbols) { - var index = -1, - length = strSymbols.length; - - while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; - } - - /** - * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the last unmatched string symbol. - */ - function charsEndIndex(strSymbols, chrSymbols) { - var index = strSymbols.length; - - while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; - } - - /** - * Gets the number of `placeholder` occurrences in `array`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} placeholder The placeholder to search for. - * @returns {number} Returns the placeholder count. - */ - function countHolders(array, placeholder) { - var length = array.length, - result = 0; - - while (length--) { - if (array[length] === placeholder) { - ++result; - } - } - return result; - } - - /** - * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A - * letters to basic Latin letters. - * - * @private - * @param {string} letter The matched letter to deburr. - * @returns {string} Returns the deburred letter. - */ - var deburrLetter = basePropertyOf(deburredLetters); - - /** - * Used by `_.escape` to convert characters to HTML entities. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - var escapeHtmlChar = basePropertyOf(htmlEscapes); - - /** - * Used by `_.template` to escape characters for inclusion in compiled string literals. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeStringChar(chr) { - return '\\' + stringEscapes[chr]; - } - - /** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ - function getValue(object, key) { - return object == null ? undefined : object[key]; - } - - /** - * Checks if `string` contains Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a symbol is found, else `false`. - */ - function hasUnicode(string) { - return reHasUnicode.test(string); - } - - /** - * Checks if `string` contains a word composed of Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a word is found, else `false`. - */ - function hasUnicodeWord(string) { - return reHasUnicodeWord.test(string); - } - - /** - * Converts `iterator` to an array. - * - * @private - * @param {Object} iterator The iterator to convert. - * @returns {Array} Returns the converted array. - */ - function iteratorToArray(iterator) { - var data, - result = []; - - while (!(data = iterator.next()).done) { - result.push(data.value); - } - return result; - } - - /** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ - function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; - } - - /** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ - function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; - } - - /** - * Replaces all `placeholder` elements in `array` with an internal placeholder - * and returns an array of their indexes. - * - * @private - * @param {Array} array The array to modify. - * @param {*} placeholder The placeholder to replace. - * @returns {Array} Returns the new array of placeholder indexes. - */ - function replaceHolders(array, placeholder) { - var index = -1, - length = array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (value === placeholder || value === PLACEHOLDER) { - array[index] = PLACEHOLDER; - result[resIndex++] = index; - } - } - return result; - } - - /** - * Gets the value at `key`, unless `key` is "__proto__". - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ - function safeGet(object, key) { - return key == '__proto__' - ? undefined - : object[key]; - } - - /** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ - function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; - } - - /** - * Converts `set` to its value-value pairs. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the value-value pairs. - */ - function setToPairs(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = [value, value]; - }); - return result; - } - - /** - * A specialized version of `_.indexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function strictIndexOf(array, value, fromIndex) { - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * A specialized version of `_.lastIndexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function strictLastIndexOf(array, value, fromIndex) { - var index = fromIndex + 1; - while (index--) { - if (array[index] === value) { - return index; - } - } - return index; - } - - /** - * Gets the number of symbols in `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the string size. - */ - function stringSize(string) { - return hasUnicode(string) - ? unicodeSize(string) - : asciiSize(string); - } - - /** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function stringToArray(string) { - return hasUnicode(string) - ? unicodeToArray(string) - : asciiToArray(string); - } - - /** - * Used by `_.unescape` to convert HTML entities to characters. - * - * @private - * @param {string} chr The matched character to unescape. - * @returns {string} Returns the unescaped character. - */ - var unescapeHtmlChar = basePropertyOf(htmlUnescapes); - - /** - * Gets the size of a Unicode `string`. - * - * @private - * @param {string} string The string inspect. - * @returns {number} Returns the string size. - */ - function unicodeSize(string) { - var result = reUnicode.lastIndex = 0; - while (reUnicode.test(string)) { - ++result; - } - return result; - } - - /** - * Converts a Unicode `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function unicodeToArray(string) { - return string.match(reUnicode) || []; - } - - /** - * Splits a Unicode `string` into an array of its words. - * - * @private - * @param {string} The string to inspect. - * @returns {Array} Returns the words of `string`. - */ - function unicodeWords(string) { - return string.match(reUnicodeWord) || []; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Create a new pristine `lodash` function using the `context` object. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Util - * @param {Object} [context=root] The context object. - * @returns {Function} Returns a new `lodash` function. - * @example - * - * _.mixin({ 'foo': _.constant('foo') }); - * - * var lodash = _.runInContext(); - * lodash.mixin({ 'bar': lodash.constant('bar') }); - * - * _.isFunction(_.foo); - * // => true - * _.isFunction(_.bar); - * // => false - * - * lodash.isFunction(lodash.foo); - * // => false - * lodash.isFunction(lodash.bar); - * // => true - * - * // Create a suped-up `defer` in Node.js. - * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; - */ - var runInContext = (function runInContext(context) { - context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); - - /** Built-in constructor references. */ - var Array = context.Array, - Date = context.Date, - Error = context.Error, - Function = context.Function, - Math = context.Math, - Object = context.Object, - RegExp = context.RegExp, - String = context.String, - TypeError = context.TypeError; - - /** Used for built-in method references. */ - var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; - - /** Used to detect overreaching core-js shims. */ - var coreJsData = context['__core-js_shared__']; - - /** Used to resolve the decompiled source of functions. */ - var funcToString = funcProto.toString; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** Used to generate unique IDs. */ - var idCounter = 0; - - /** Used to detect methods masquerading as native. */ - var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; - }()); - - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var nativeObjectToString = objectProto.toString; - - /** Used to infer the `Object` constructor. */ - var objectCtorString = funcToString.call(Object); - - /** Used to restore the original `_` reference in `_.noConflict`. */ - var oldDash = root._; - - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' - ); - - /** Built-in value references. */ - var Buffer = moduleExports ? context.Buffer : undefined, - Symbol = context.Symbol, - Uint8Array = context.Uint8Array, - allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, - getPrototype = overArg(Object.getPrototypeOf, Object), - objectCreate = Object.create, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice, - spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, - symIterator = Symbol ? Symbol.iterator : undefined, - symToStringTag = Symbol ? Symbol.toStringTag : undefined; - - var defineProperty = (function() { - try { - var func = getNative(Object, 'defineProperty'); - func({}, '', {}); - return func; - } catch (e) {} - }()); - - /** Mocked built-ins. */ - var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, - ctxNow = Date && Date.now !== root.Date.now && Date.now, - ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeCeil = Math.ceil, - nativeFloor = Math.floor, - nativeGetSymbols = Object.getOwnPropertySymbols, - nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, - nativeIsFinite = context.isFinite, - nativeJoin = arrayProto.join, - nativeKeys = overArg(Object.keys, Object), - nativeMax = Math.max, - nativeMin = Math.min, - nativeNow = Date.now, - nativeParseInt = context.parseInt, - nativeRandom = Math.random, - nativeReverse = arrayProto.reverse; - - /* Built-in method references that are verified to be native. */ - var DataView = getNative(context, 'DataView'), - Map = getNative(context, 'Map'), - Promise = getNative(context, 'Promise'), - Set = getNative(context, 'Set'), - WeakMap = getNative(context, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); - - /** Used to store function metadata. */ - var metaMap = WeakMap && new WeakMap; - - /** Used to lookup unminified function names. */ - var realNames = {}; - - /** Used to detect maps, sets, and weakmaps. */ - var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); - - /** Used to convert symbols to primitives and strings. */ - var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` object which wraps `value` to enable implicit method - * chain sequences. Methods that operate on and return arrays, collections, - * and functions can be chained together. Methods that retrieve a single value - * or may return a primitive value will automatically end the chain sequence - * and return the unwrapped value. Otherwise, the value must be unwrapped - * with `_#value`. - * - * Explicit chain sequences, which must be unwrapped with `_#value`, may be - * enabled using `_.chain`. - * - * The execution of chained methods is lazy, that is, it's deferred until - * `_#value` is implicitly or explicitly called. - * - * Lazy evaluation allows several methods to support shortcut fusion. - * Shortcut fusion is an optimization to merge iteratee calls; this avoids - * the creation of intermediate arrays and can greatly reduce the number of - * iteratee executions. Sections of a chain sequence qualify for shortcut - * fusion if the section is applied to an array and iteratees accept only - * one argument. The heuristic for whether a section qualifies for shortcut - * fusion is subject to change. - * - * Chaining is supported in custom builds as long as the `_#value` method is - * directly or indirectly included in the build. - * - * In addition to lodash methods, wrappers have `Array` and `String` methods. - * - * The wrapper `Array` methods are: - * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` - * - * The wrapper `String` methods are: - * `replace` and `split` - * - * The wrapper methods that support shortcut fusion are: - * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, - * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, - * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` - * - * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, - * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, - * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, - * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, - * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, - * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, - * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, - * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, - * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, - * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, - * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, - * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, - * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, - * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, - * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, - * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, - * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, - * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, - * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, - * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, - * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, - * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, - * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, - * `zipObject`, `zipObjectDeep`, and `zipWith` - * - * The wrapper methods that are **not** chainable by default are: - * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, - * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, - * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, - * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, - * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, - * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, - * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, - * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, - * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, - * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, - * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, - * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, - * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, - * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, - * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, - * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, - * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, - * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, - * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, - * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, - * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, - * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, - * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, - * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, - * `upperFirst`, `value`, and `words` - * - * @name _ - * @constructor - * @category Seq - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var wrapped = _([1, 2, 3]); - * - * // Returns an unwrapped value. - * wrapped.reduce(_.add); - * // => 6 - * - * // Returns a wrapped value. - * var squares = wrapped.map(square); - * - * _.isArray(squares); - * // => false - * - * _.isArray(squares.value()); - * // => true - */ - function lodash(value) { - if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty.call(value, '__wrapped__')) { - return wrapperClone(value); - } - } - return new LodashWrapper(value); - } - - /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} proto The object to inherit from. - * @returns {Object} Returns the new object. - */ - var baseCreate = (function() { - function object() {} - return function(proto) { - if (!isObject(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object.prototype = proto; - var result = new object; - object.prototype = undefined; - return result; - }; - }()); - - /** - * The function whose prototype chain sequence wrappers inherit from. - * - * @private - */ - function baseLodash() { - // No operation performed. - } - - /** - * The base constructor for creating `lodash` wrapper objects. - * - * @private - * @param {*} value The value to wrap. - * @param {boolean} [chainAll] Enable explicit method chain sequences. - */ - function LodashWrapper(value, chainAll) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__chain__ = !!chainAll; - this.__index__ = 0; - this.__values__ = undefined; - } - - /** - * By default, the template delimiters used by lodash are like those in - * embedded Ruby (ERB) as well as ES2015 template strings. Change the - * following template settings to use alternative delimiters. - * - * @static - * @memberOf _ - * @type {Object} - */ - lodash.templateSettings = { - - /** - * Used to detect `data` property values to be HTML-escaped. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'escape': reEscape, - - /** - * Used to detect code to be evaluated. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'evaluate': reEvaluate, - - /** - * Used to detect `data` property values to inject. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'interpolate': reInterpolate, - - /** - * Used to reference the data object in the template text. - * - * @memberOf _.templateSettings - * @type {string} - */ - 'variable': '', - - /** - * Used to import variables into the compiled template. - * - * @memberOf _.templateSettings - * @type {Object} - */ - 'imports': { - - /** - * A reference to the `lodash` function. - * - * @memberOf _.templateSettings.imports - * @type {Function} - */ - '_': lodash - } - }; - - // Ensure wrappers are instances of `baseLodash`. - lodash.prototype = baseLodash.prototype; - lodash.prototype.constructor = lodash; - - LodashWrapper.prototype = baseCreate(baseLodash.prototype); - LodashWrapper.prototype.constructor = LodashWrapper; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. - * - * @private - * @constructor - * @param {*} value The value to wrap. - */ - function LazyWrapper(value) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__dir__ = 1; - this.__filtered__ = false; - this.__iteratees__ = []; - this.__takeCount__ = MAX_ARRAY_LENGTH; - this.__views__ = []; - } - - /** - * Creates a clone of the lazy wrapper object. - * - * @private - * @name clone - * @memberOf LazyWrapper - * @returns {Object} Returns the cloned `LazyWrapper` object. - */ - function lazyClone() { - var result = new LazyWrapper(this.__wrapped__); - result.__actions__ = copyArray(this.__actions__); - result.__dir__ = this.__dir__; - result.__filtered__ = this.__filtered__; - result.__iteratees__ = copyArray(this.__iteratees__); - result.__takeCount__ = this.__takeCount__; - result.__views__ = copyArray(this.__views__); - return result; - } - - /** - * Reverses the direction of lazy iteration. - * - * @private - * @name reverse - * @memberOf LazyWrapper - * @returns {Object} Returns the new reversed `LazyWrapper` object. - */ - function lazyReverse() { - if (this.__filtered__) { - var result = new LazyWrapper(this); - result.__dir__ = -1; - result.__filtered__ = true; - } else { - result = this.clone(); - result.__dir__ *= -1; - } - return result; - } - - /** - * Extracts the unwrapped value from its lazy wrapper. - * - * @private - * @name value - * @memberOf LazyWrapper - * @returns {*} Returns the unwrapped value. - */ - function lazyValue() { - var array = this.__wrapped__.value(), - dir = this.__dir__, - isArr = isArray(array), - isRight = dir < 0, - arrLength = isArr ? array.length : 0, - view = getView(0, arrLength, this.__views__), - start = view.start, - end = view.end, - length = end - start, - index = isRight ? end : (start - 1), - iteratees = this.__iteratees__, - iterLength = iteratees.length, - resIndex = 0, - takeCount = nativeMin(length, this.__takeCount__); - - if (!isArr || (!isRight && arrLength == length && takeCount == length)) { - return baseWrapperValue(array, this.__actions__); - } - var result = []; - - outer: - while (length-- && resIndex < takeCount) { - index += dir; - - var iterIndex = -1, - value = array[index]; - - while (++iterIndex < iterLength) { - var data = iteratees[iterIndex], - iteratee = data.iteratee, - type = data.type, - computed = iteratee(value); - - if (type == LAZY_MAP_FLAG) { - value = computed; - } else if (!computed) { - if (type == LAZY_FILTER_FLAG) { - continue outer; - } else { - break outer; - } - } - } - result[resIndex++] = value; - } - return result; - } - - // Ensure `LazyWrapper` is an instance of `baseLodash`. - LazyWrapper.prototype = baseCreate(baseLodash.prototype); - LazyWrapper.prototype.constructor = LazyWrapper; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Hash(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ - function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - this.size = 0; - } - - /** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function hashDelete(key) { - var result = this.has(key) && delete this.__data__[key]; - this.size -= result ? 1 : 0; - return result; - } - - /** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; - } - - /** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function hashHas(key) { - var data = this.__data__; - return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); - } - - /** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ - function hashSet(key, value) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; - } - - // Add methods to `Hash`. - Hash.prototype.clear = hashClear; - Hash.prototype['delete'] = hashDelete; - Hash.prototype.get = hashGet; - Hash.prototype.has = hashHas; - Hash.prototype.set = hashSet; - - /*------------------------------------------------------------------------*/ - - /** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function ListCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ - function listCacheClear() { - this.__data__ = []; - this.size = 0; - } - - /** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - --this.size; - return true; - } - - /** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; - } - - /** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; - } - - /** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ - function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - ++this.size; - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; - } - - // Add methods to `ListCache`. - ListCache.prototype.clear = listCacheClear; - ListCache.prototype['delete'] = listCacheDelete; - ListCache.prototype.get = listCacheGet; - ListCache.prototype.has = listCacheHas; - ListCache.prototype.set = listCacheSet; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function MapCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ - function mapCacheClear() { - this.size = 0; - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; - } - - /** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function mapCacheDelete(key) { - var result = getMapData(this, key)['delete'](key); - this.size -= result ? 1 : 0; - return result; - } - - /** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function mapCacheGet(key) { - return getMapData(this, key).get(key); - } - - /** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function mapCacheHas(key) { - return getMapData(this, key).has(key); - } - - /** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ - function mapCacheSet(key, value) { - var data = getMapData(this, key), - size = data.size; - - data.set(key, value); - this.size += data.size == size ? 0 : 1; - return this; - } - - // Add methods to `MapCache`. - MapCache.prototype.clear = mapCacheClear; - MapCache.prototype['delete'] = mapCacheDelete; - MapCache.prototype.get = mapCacheGet; - MapCache.prototype.has = mapCacheHas; - MapCache.prototype.set = mapCacheSet; - - /*------------------------------------------------------------------------*/ - - /** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ - function SetCache(values) { - var index = -1, - length = values == null ? 0 : values.length; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } - } - - /** - * Adds `value` to the array cache. - * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. - */ - function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; - } - - /** - * Checks if `value` is in the array cache. - * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ - function setCacheHas(value) { - return this.__data__.has(value); - } - - // Add methods to `SetCache`. - SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; - SetCache.prototype.has = setCacheHas; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Stack(entries) { - var data = this.__data__ = new ListCache(entries); - this.size = data.size; - } - - /** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ - function stackClear() { - this.__data__ = new ListCache; - this.size = 0; - } - - /** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function stackDelete(key) { - var data = this.__data__, - result = data['delete'](key); - - this.size = data.size; - return result; - } - - /** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function stackGet(key) { - return this.__data__.get(key); - } - - /** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function stackHas(key) { - return this.__data__.has(key); - } - - /** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. - */ - function stackSet(key, value) { - var data = this.__data__; - if (data instanceof ListCache) { - var pairs = data.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - this.size = ++data.size; - return this; - } - data = this.__data__ = new MapCache(pairs); - } - data.set(key, value); - this.size = data.size; - return this; - } - - // Add methods to `Stack`. - Stack.prototype.clear = stackClear; - Stack.prototype['delete'] = stackDelete; - Stack.prototype.get = stackGet; - Stack.prototype.has = stackHas; - Stack.prototype.set = stackSet; - - /*------------------------------------------------------------------------*/ - - /** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ - function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; - - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); - } - } - return result; - } - - /** - * A specialized version of `_.sample` for arrays. - * - * @private - * @param {Array} array The array to sample. - * @returns {*} Returns the random element. - */ - function arraySample(array) { - var length = array.length; - return length ? array[baseRandom(0, length - 1)] : undefined; - } - - /** - * A specialized version of `_.sampleSize` for arrays. - * - * @private - * @param {Array} array The array to sample. - * @param {number} n The number of elements to sample. - * @returns {Array} Returns the random elements. - */ - function arraySampleSize(array, n) { - return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); - } - - /** - * A specialized version of `_.shuffle` for arrays. - * - * @private - * @param {Array} array The array to shuffle. - * @returns {Array} Returns the new shuffled array. - */ - function arrayShuffle(array) { - return shuffleSelf(copyArray(array)); - } - - /** - * This function is like `assignValue` except that it doesn't assign - * `undefined` values. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignMergeValue(object, key, value) { - if ((value !== undefined && !eq(object[key], value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } - } - - /** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } - } - - /** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; - } - - /** - * Aggregates elements of `collection` on `accumulator` with keys transformed - * by `iteratee` and values set by `setter`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ - function baseAggregator(collection, setter, iteratee, accumulator) { - baseEach(collection, function(value, key, collection) { - setter(accumulator, value, iteratee(value), collection); - }); - return accumulator; - } - - /** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); - } - - /** - * The base implementation of `_.assignIn` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssignIn(object, source) { - return object && copyObject(source, keysIn(source), object); - } - - /** - * The base implementation of `assignValue` and `assignMergeValue` without - * value checks. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function baseAssignValue(object, key, value) { - if (key == '__proto__' && defineProperty) { - defineProperty(object, key, { - 'configurable': true, - 'enumerable': true, - 'value': value, - 'writable': true - }); - } else { - object[key] = value; - } - } - - /** - * The base implementation of `_.at` without support for individual paths. - * - * @private - * @param {Object} object The object to iterate over. - * @param {string[]} paths The property paths to pick. - * @returns {Array} Returns the picked elements. - */ - function baseAt(object, paths) { - var index = -1, - length = paths.length, - result = Array(length), - skip = object == null; - - while (++index < length) { - result[index] = skip ? undefined : get(object, paths[index]); - } - return result; - } - - /** - * The base implementation of `_.clamp` which doesn't coerce arguments. - * - * @private - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. - */ - function baseClamp(number, lower, upper) { - if (number === number) { - if (upper !== undefined) { - number = number <= upper ? number : upper; - } - if (lower !== undefined) { - number = number >= lower ? number : lower; - } - } - return number; - } - - /** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} bitmask The bitmask flags. - * 1 - Deep clone - * 2 - Flatten inherited properties - * 4 - Clone symbols - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ - function baseClone(value, bitmask, customizer, key, object, stack) { - var result, - isDeep = bitmask & CLONE_DEEP_FLAG, - isFlat = bitmask & CLONE_FLAT_FLAG, - isFull = bitmask & CLONE_SYMBOLS_FLAG; - - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = (isFlat || isFunc) ? {} : initCloneObject(value); - if (!isDeep) { - return isFlat - ? copySymbolsIn(value, baseAssignIn(result, value)) - : copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); - - if (isSet(value)) { - value.forEach(function(subValue) { - result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); - }); - - return result; - } - - if (isMap(value)) { - value.forEach(function(subValue, key) { - result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - - return result; - } - - var keysFunc = isFull - ? (isFlat ? getAllKeysIn : getAllKeys) - : (isFlat ? keysIn : keys); - - var props = isArr ? undefined : keysFunc(value); - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - return result; - } - - /** - * The base implementation of `_.conforms` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property predicates to conform to. - * @returns {Function} Returns the new spec function. - */ - function baseConforms(source) { - var props = keys(source); - return function(object) { - return baseConformsTo(object, source, props); - }; - } - - /** - * The base implementation of `_.conformsTo` which accepts `props` to check. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property predicates to conform to. - * @returns {boolean} Returns `true` if `object` conforms, else `false`. - */ - function baseConformsTo(object, source, props) { - var length = props.length; - if (object == null) { - return !length; - } - object = Object(object); - while (length--) { - var key = props[length], - predicate = source[key], - value = object[key]; - - if ((value === undefined && !(key in object)) || !predicate(value)) { - return false; - } - } - return true; - } - - /** - * The base implementation of `_.delay` and `_.defer` which accepts `args` - * to provide to `func`. - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {Array} args The arguments to provide to `func`. - * @returns {number|Object} Returns the timer id or timeout object. - */ - function baseDelay(func, wait, args) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return setTimeout(function() { func.apply(undefined, args); }, wait); - } - - /** - * The base implementation of methods like `_.difference` without support - * for excluding multiple arrays or iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - */ - function baseDifference(array, values, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - isCommon = true, - length = array.length, - result = [], - valuesLength = values.length; - - if (!length) { - return result; - } - if (iteratee) { - values = arrayMap(values, baseUnary(iteratee)); - } - if (comparator) { - includes = arrayIncludesWith; - isCommon = false; - } - else if (values.length >= LARGE_ARRAY_SIZE) { - includes = cacheHas; - isCommon = false; - values = new SetCache(values); - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee == null ? value : iteratee(value); - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === computed) { - continue outer; - } - } - result.push(value); - } - else if (!includes(values, computed, comparator)) { - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.forEach` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ - var baseEach = createBaseEach(baseForOwn); - - /** - * The base implementation of `_.forEachRight` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ - var baseEachRight = createBaseEach(baseForOwnRight, true); - - /** - * The base implementation of `_.every` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false` - */ - function baseEvery(collection, predicate) { - var result = true; - baseEach(collection, function(value, index, collection) { - result = !!predicate(value, index, collection); - return result; - }); - return result; - } - - /** - * The base implementation of methods like `_.max` and `_.min` which accepts a - * `comparator` to determine the extremum value. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The iteratee invoked per iteration. - * @param {Function} comparator The comparator used to compare values. - * @returns {*} Returns the extremum value. - */ - function baseExtremum(array, iteratee, comparator) { - var index = -1, - length = array.length; - - while (++index < length) { - var value = array[index], - current = iteratee(value); - - if (current != null && (computed === undefined - ? (current === current && !isSymbol(current)) - : comparator(current, computed) - )) { - var computed = current, - result = value; - } - } - return result; - } - - /** - * The base implementation of `_.fill` without an iteratee call guard. - * - * @private - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - */ - function baseFill(array, value, start, end) { - var length = array.length; - - start = toInteger(start); - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = (end === undefined || end > length) ? length : toInteger(end); - if (end < 0) { - end += length; - } - end = start > end ? 0 : toLength(end); - while (start < end) { - array[start++] = value; - } - return array; - } - - /** - * The base implementation of `_.filter` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function baseFilter(collection, predicate) { - var result = []; - baseEach(collection, function(value, index, collection) { - if (predicate(value, index, collection)) { - result.push(value); - } - }); - return result; - } - - /** - * The base implementation of `_.flatten` with support for restricting flattening. - * - * @private - * @param {Array} array The array to flatten. - * @param {number} depth The maximum recursion depth. - * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. - * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. - */ - function baseFlatten(array, depth, predicate, isStrict, result) { - var index = -1, - length = array.length; - - predicate || (predicate = isFlattenable); - result || (result = []); - - while (++index < length) { - var value = array[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; - } - - /** - * The base implementation of `baseForOwn` which iterates over `object` - * properties returned by `keysFunc` and invokes `iteratee` for each property. - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseFor = createBaseFor(); - - /** - * This function is like `baseFor` except that it iterates over properties - * in the opposite order. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseForRight = createBaseFor(true); - - /** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); - } - - /** - * The base implementation of `_.forOwnRight` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwnRight(object, iteratee) { - return object && baseForRight(object, iteratee, keys); - } - - /** - * The base implementation of `_.functions` which creates an array of - * `object` function property names filtered from `props`. - * - * @private - * @param {Object} object The object to inspect. - * @param {Array} props The property names to filter. - * @returns {Array} Returns the function names. - */ - function baseFunctions(object, props) { - return arrayFilter(props, function(key) { - return isFunction(object[key]); - }); - } - - /** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ - function baseGet(object, path) { - path = castPath(path, object); - - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[toKey(path[index++])]; - } - return (index && index == length) ? object : undefined; - } - - /** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. - */ - function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); - } - - /** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); - } - - /** - * The base implementation of `_.gt` which doesn't coerce arguments. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, - * else `false`. - */ - function baseGt(value, other) { - return value > other; - } - - /** - * The base implementation of `_.has` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHas(object, key) { - return object != null && hasOwnProperty.call(object, key); - } - - /** - * The base implementation of `_.hasIn` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHasIn(object, key) { - return object != null && key in Object(object); - } - - /** - * The base implementation of `_.inRange` which doesn't coerce arguments. - * - * @private - * @param {number} number The number to check. - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. - */ - function baseInRange(number, start, end) { - return number >= nativeMin(start, end) && number < nativeMax(start, end); - } - - /** - * The base implementation of methods like `_.intersection`, without support - * for iteratee shorthands, that accepts an array of arrays to inspect. - * - * @private - * @param {Array} arrays The arrays to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of shared values. - */ - function baseIntersection(arrays, iteratee, comparator) { - var includes = comparator ? arrayIncludesWith : arrayIncludes, - length = arrays[0].length, - othLength = arrays.length, - othIndex = othLength, - caches = Array(othLength), - maxLength = Infinity, - result = []; - - while (othIndex--) { - var array = arrays[othIndex]; - if (othIndex && iteratee) { - array = arrayMap(array, baseUnary(iteratee)); - } - maxLength = nativeMin(array.length, maxLength); - caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) - ? new SetCache(othIndex && array) - : undefined; - } - array = arrays[0]; - - var index = -1, - seen = caches[0]; - - outer: - while (++index < length && result.length < maxLength) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (!(seen - ? cacheHas(seen, computed) - : includes(result, computed, comparator) - )) { - othIndex = othLength; - while (--othIndex) { - var cache = caches[othIndex]; - if (!(cache - ? cacheHas(cache, computed) - : includes(arrays[othIndex], computed, comparator)) - ) { - continue outer; - } - } - if (seen) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.invert` and `_.invertBy` which inverts - * `object` with values transformed by `iteratee` and set by `setter`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform values. - * @param {Object} accumulator The initial inverted object. - * @returns {Function} Returns `accumulator`. - */ - function baseInverter(object, setter, iteratee, accumulator) { - baseForOwn(object, function(value, key, object) { - setter(accumulator, iteratee(value), key, object); - }); - return accumulator; - } - - /** - * The base implementation of `_.invoke` without support for individual - * method arguments. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {Array} args The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - */ - function baseInvoke(object, path, args) { - path = castPath(path, object); - object = parent(object, path); - var func = object == null ? object : object[toKey(last(path))]; - return func == null ? undefined : apply(func, object, args); - } - - /** - * The base implementation of `_.isArguments`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - */ - function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; - } - - /** - * The base implementation of `_.isArrayBuffer` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. - */ - function baseIsArrayBuffer(value) { - return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; - } - - /** - * The base implementation of `_.isDate` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a date object, else `false`. - */ - function baseIsDate(value) { - return isObjectLike(value) && baseGetTag(value) == dateTag; - } - - /** - * The base implementation of `_.isEqual` which supports partial comparisons - * and tracks traversed objects. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {boolean} bitmask The bitmask flags. - * 1 - Unordered comparison - * 2 - Partial comparison - * @param {Function} [customizer] The function to customize comparisons. - * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ - function baseIsEqual(value, other, bitmask, customizer, stack) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); - } - - /** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = objIsArr ? arrayTag : getTag(object), - othTag = othIsArr ? arrayTag : getTag(other); - - objTag = objTag == argsTag ? objectTag : objTag; - othTag = othTag == argsTag ? objectTag : othTag; - - var objIsObj = objTag == objectTag, - othIsObj = othTag == objectTag, - isSameTag = objTag == othTag; - - if (isSameTag && isBuffer(object)) { - if (!isBuffer(other)) { - return false; - } - objIsArr = true; - objIsObj = false; - } - if (isSameTag && !objIsObj) { - stack || (stack = new Stack); - return (objIsArr || isTypedArray(object)) - ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) - : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); - } - if (!(bitmask & COMPARE_PARTIAL_FLAG)) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - - if (objIsWrapped || othIsWrapped) { - var objUnwrapped = objIsWrapped ? object.value() : object, - othUnwrapped = othIsWrapped ? other.value() : other; - - stack || (stack = new Stack); - return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); - } - } - if (!isSameTag) { - return false; - } - stack || (stack = new Stack); - return equalObjects(object, other, bitmask, customizer, equalFunc, stack); - } - - /** - * The base implementation of `_.isMap` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. - */ - function baseIsMap(value) { - return isObjectLike(value) && getTag(value) == mapTag; - } - - /** - * The base implementation of `_.isMatch` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Array} matchData The property names, values, and compare flags to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ - function baseIsMatch(object, source, matchData, customizer) { - var index = matchData.length, - length = index, - noCustomizer = !customizer; - - if (object == null) { - return !length; - } - object = Object(object); - while (index--) { - var data = matchData[index]; - if ((noCustomizer && data[2]) - ? data[1] !== object[data[0]] - : !(data[0] in object) - ) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], - objValue = object[key], - srcValue = data[1]; - - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object)) { - return false; - } - } else { - var stack = new Stack; - if (customizer) { - var result = customizer(objValue, srcValue, key, object, source, stack); - } - if (!(result === undefined - ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) - : result - )) { - return false; - } - } - } - return true; - } - - /** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ - function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); - } - - /** - * The base implementation of `_.isRegExp` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. - */ - function baseIsRegExp(value) { - return isObjectLike(value) && baseGetTag(value) == regexpTag; - } - - /** - * The base implementation of `_.isSet` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. - */ - function baseIsSet(value) { - return isObjectLike(value) && getTag(value) == setTag; - } - - /** - * The base implementation of `_.isTypedArray` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ - function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; - } - - /** - * The base implementation of `_.iteratee`. - * - * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. - */ - function baseIteratee(value) { - // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. - // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. - if (typeof value == 'function') { - return value; - } - if (value == null) { - return identity; - } - if (typeof value == 'object') { - return isArray(value) - ? baseMatchesProperty(value[0], value[1]) - : baseMatches(value); - } - return property(value); - } - - /** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; - } - - /** - * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), - result = []; - - for (var key in object) { - if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; - } - - /** - * The base implementation of `_.lt` which doesn't coerce arguments. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, - * else `false`. - */ - function baseLt(value, other) { - return value < other; - } - - /** - * The base implementation of `_.map` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value, key, collection) { - result[++index] = iteratee(value, key, collection); - }); - return result; - } - - /** - * The base implementation of `_.matches` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new spec function. - */ - function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - return matchesStrictComparable(matchData[0][0], matchData[0][1]); - } - return function(object) { - return object === source || baseIsMatch(object, source, matchData); - }; - } - - /** - * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. - * - * @private - * @param {string} path The path of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ - function baseMatchesProperty(path, srcValue) { - if (isKey(path) && isStrictComparable(srcValue)) { - return matchesStrictComparable(toKey(path), srcValue); - } - return function(object) { - var objValue = get(object, path); - return (objValue === undefined && objValue === srcValue) - ? hasIn(object, path) - : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); - }; - } - - /** - * The base implementation of `_.merge` without support for multiple sources. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {number} srcIndex The index of `source`. - * @param {Function} [customizer] The function to customize merged values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ - function baseMerge(object, source, srcIndex, customizer, stack) { - if (object === source) { - return; - } - baseFor(source, function(srcValue, key) { - if (isObject(srcValue)) { - stack || (stack = new Stack); - baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); - } - else { - var newValue = customizer - ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) - : undefined; - - if (newValue === undefined) { - newValue = srcValue; - } - assignMergeValue(object, key, newValue); - } - }, keysIn); - } - - /** - * A specialized version of `baseMerge` for arrays and objects which performs - * deep merges and tracks traversed objects enabling objects with circular - * references to be merged. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {string} key The key of the value to merge. - * @param {number} srcIndex The index of `source`. - * @param {Function} mergeFunc The function to merge values. - * @param {Function} [customizer] The function to customize assigned values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ - function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { - var objValue = safeGet(object, key), - srcValue = safeGet(source, key), - stacked = stack.get(srcValue); - - if (stacked) { - assignMergeValue(object, key, stacked); - return; - } - var newValue = customizer - ? customizer(objValue, srcValue, (key + ''), object, source, stack) - : undefined; - - var isCommon = newValue === undefined; - - if (isCommon) { - var isArr = isArray(srcValue), - isBuff = !isArr && isBuffer(srcValue), - isTyped = !isArr && !isBuff && isTypedArray(srcValue); - - newValue = srcValue; - if (isArr || isBuff || isTyped) { - if (isArray(objValue)) { - newValue = objValue; - } - else if (isArrayLikeObject(objValue)) { - newValue = copyArray(objValue); - } - else if (isBuff) { - isCommon = false; - newValue = cloneBuffer(srcValue, true); - } - else if (isTyped) { - isCommon = false; - newValue = cloneTypedArray(srcValue, true); - } - else { - newValue = []; - } - } - else if (isPlainObject(srcValue) || isArguments(srcValue)) { - newValue = objValue; - if (isArguments(objValue)) { - newValue = toPlainObject(objValue); - } - else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { - newValue = initCloneObject(srcValue); - } - } - else { - isCommon = false; - } - } - if (isCommon) { - // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, newValue); - mergeFunc(newValue, srcValue, srcIndex, customizer, stack); - stack['delete'](srcValue); - } - assignMergeValue(object, key, newValue); - } - - /** - * The base implementation of `_.nth` which doesn't coerce arguments. - * - * @private - * @param {Array} array The array to query. - * @param {number} n The index of the element to return. - * @returns {*} Returns the nth element of `array`. - */ - function baseNth(array, n) { - var length = array.length; - if (!length) { - return; - } - n += n < 0 ? length : 0; - return isIndex(n, length) ? array[n] : undefined; - } - - /** - * The base implementation of `_.orderBy` without param guards. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. - * @param {string[]} orders The sort orders of `iteratees`. - * @returns {Array} Returns the new sorted array. - */ - function baseOrderBy(collection, iteratees, orders) { - var index = -1; - iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee())); - - var result = baseMap(collection, function(value, key, collection) { - var criteria = arrayMap(iteratees, function(iteratee) { - return iteratee(value); - }); - return { 'criteria': criteria, 'index': ++index, 'value': value }; - }); - - return baseSortBy(result, function(object, other) { - return compareMultiple(object, other, orders); - }); - } - - /** - * The base implementation of `_.pick` without support for individual - * property identifiers. - * - * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @returns {Object} Returns the new object. - */ - function basePick(object, paths) { - return basePickBy(object, paths, function(value, path) { - return hasIn(object, path); - }); - } - - /** - * The base implementation of `_.pickBy` without support for iteratee shorthands. - * - * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @param {Function} predicate The function invoked per property. - * @returns {Object} Returns the new object. - */ - function basePickBy(object, paths, predicate) { - var index = -1, - length = paths.length, - result = {}; - - while (++index < length) { - var path = paths[index], - value = baseGet(object, path); - - if (predicate(value, path)) { - baseSet(result, castPath(path, object), value); - } - } - return result; - } - - /** - * A specialized version of `baseProperty` which supports deep paths. - * - * @private - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function basePropertyDeep(path) { - return function(object) { - return baseGet(object, path); - }; - } - - /** - * The base implementation of `_.pullAllBy` without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns `array`. - */ - function basePullAll(array, values, iteratee, comparator) { - var indexOf = comparator ? baseIndexOfWith : baseIndexOf, - index = -1, - length = values.length, - seen = array; - - if (array === values) { - values = copyArray(values); - } - if (iteratee) { - seen = arrayMap(array, baseUnary(iteratee)); - } - while (++index < length) { - var fromIndex = 0, - value = values[index], - computed = iteratee ? iteratee(value) : value; - - while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { - if (seen !== array) { - splice.call(seen, fromIndex, 1); - } - splice.call(array, fromIndex, 1); - } - } - return array; - } - - /** - * The base implementation of `_.pullAt` without support for individual - * indexes or capturing the removed elements. - * - * @private - * @param {Array} array The array to modify. - * @param {number[]} indexes The indexes of elements to remove. - * @returns {Array} Returns `array`. - */ - function basePullAt(array, indexes) { - var length = array ? indexes.length : 0, - lastIndex = length - 1; - - while (length--) { - var index = indexes[length]; - if (length == lastIndex || index !== previous) { - var previous = index; - if (isIndex(index)) { - splice.call(array, index, 1); - } else { - baseUnset(array, index); - } - } - } - return array; - } - - /** - * The base implementation of `_.random` without support for returning - * floating-point numbers. - * - * @private - * @param {number} lower The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the random number. - */ - function baseRandom(lower, upper) { - return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); - } - - /** - * The base implementation of `_.range` and `_.rangeRight` which doesn't - * coerce arguments. - * - * @private - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @param {number} step The value to increment or decrement by. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the range of numbers. - */ - function baseRange(start, end, step, fromRight) { - var index = -1, - length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), - result = Array(length); - - while (length--) { - result[fromRight ? length : ++index] = start; - start += step; - } - return result; - } - - /** - * The base implementation of `_.repeat` which doesn't coerce arguments. - * - * @private - * @param {string} string The string to repeat. - * @param {number} n The number of times to repeat the string. - * @returns {string} Returns the repeated string. - */ - function baseRepeat(string, n) { - var result = ''; - if (!string || n < 1 || n > MAX_SAFE_INTEGER) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = nativeFloor(n / 2); - if (n) { - string += string; - } - } while (n); - - return result; - } - - /** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - */ - function baseRest(func, start) { - return setToString(overRest(func, start, identity), func + ''); - } - - /** - * The base implementation of `_.sample`. - * - * @private - * @param {Array|Object} collection The collection to sample. - * @returns {*} Returns the random element. - */ - function baseSample(collection) { - return arraySample(values(collection)); - } - - /** - * The base implementation of `_.sampleSize` without param guards. - * - * @private - * @param {Array|Object} collection The collection to sample. - * @param {number} n The number of elements to sample. - * @returns {Array} Returns the random elements. - */ - function baseSampleSize(collection, n) { - var array = values(collection); - return shuffleSelf(array, baseClamp(n, 0, array.length)); - } - - /** - * The base implementation of `_.set`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. - */ - function baseSet(object, path, value, customizer) { - if (!isObject(object)) { - return object; - } - path = castPath(path, object); - - var index = -1, - length = path.length, - lastIndex = length - 1, - nested = object; - - while (nested != null && ++index < length) { - var key = toKey(path[index]), - newValue = value; - - if (index != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : undefined; - if (newValue === undefined) { - newValue = isObject(objValue) - ? objValue - : (isIndex(path[index + 1]) ? [] : {}); - } - } - assignValue(nested, key, newValue); - nested = nested[key]; - } - return object; - } - - /** - * The base implementation of `setData` without support for hot loop shorting. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ - var baseSetData = !metaMap ? identity : function(func, data) { - metaMap.set(func, data); - return func; - }; - - /** - * The base implementation of `setToString` without support for hot loop shorting. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ - var baseSetToString = !defineProperty ? identity : function(func, string) { - return defineProperty(func, 'toString', { - 'configurable': true, - 'enumerable': false, - 'value': constant(string), - 'writable': true - }); - }; - - /** - * The base implementation of `_.shuffle`. - * - * @private - * @param {Array|Object} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. - */ - function baseShuffle(collection) { - return shuffleSelf(values(collection)); - } - - /** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; - } - - /** - * The base implementation of `_.some` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function baseSome(collection, predicate) { - var result; - - baseEach(collection, function(value, index, collection) { - result = predicate(value, index, collection); - return !result; - }); - return !!result; - } - - /** - * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which - * performs a binary search of `array` to determine the index at which `value` - * should be inserted into `array` in order to maintain its sort order. - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ - function baseSortedIndex(array, value, retHighest) { - var low = 0, - high = array == null ? low : array.length; - - if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { - while (low < high) { - var mid = (low + high) >>> 1, - computed = array[mid]; - - if (computed !== null && !isSymbol(computed) && - (retHighest ? (computed <= value) : (computed < value))) { - low = mid + 1; - } else { - high = mid; - } - } - return high; - } - return baseSortedIndexBy(array, value, identity, retHighest); - } - - /** - * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` - * which invokes `iteratee` for `value` and each element of `array` to compute - * their sort ranking. The iteratee is invoked with one argument; (value). - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} iteratee The iteratee invoked per element. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ - function baseSortedIndexBy(array, value, iteratee, retHighest) { - value = iteratee(value); - - var low = 0, - high = array == null ? 0 : array.length, - valIsNaN = value !== value, - valIsNull = value === null, - valIsSymbol = isSymbol(value), - valIsUndefined = value === undefined; - - while (low < high) { - var mid = nativeFloor((low + high) / 2), - computed = iteratee(array[mid]), - othIsDefined = computed !== undefined, - othIsNull = computed === null, - othIsReflexive = computed === computed, - othIsSymbol = isSymbol(computed); - - if (valIsNaN) { - var setLow = retHighest || othIsReflexive; - } else if (valIsUndefined) { - setLow = othIsReflexive && (retHighest || othIsDefined); - } else if (valIsNull) { - setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); - } else if (valIsSymbol) { - setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); - } else if (othIsNull || othIsSymbol) { - setLow = false; - } else { - setLow = retHighest ? (computed <= value) : (computed < value); - } - if (setLow) { - low = mid + 1; - } else { - high = mid; - } - } - return nativeMin(high, MAX_ARRAY_INDEX); - } - - /** - * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ - function baseSortedUniq(array, iteratee) { - var index = -1, - length = array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - if (!index || !eq(computed, seen)) { - var seen = computed; - result[resIndex++] = value === 0 ? 0 : value; - } - } - return result; - } - - /** - * The base implementation of `_.toNumber` which doesn't ensure correct - * conversions of binary, hexadecimal, or octal string values. - * - * @private - * @param {*} value The value to process. - * @returns {number} Returns the number. - */ - function baseToNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - return +value; - } - - /** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ - function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isArray(value)) { - // Recursively convert values (susceptible to call stack limits). - return arrayMap(value, baseToString) + ''; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } - - /** - * The base implementation of `_.uniqBy` without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ - function baseUniq(array, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - length = array.length, - isCommon = true, - result = [], - seen = result; - - if (comparator) { - isCommon = false; - includes = arrayIncludesWith; - } - else if (length >= LARGE_ARRAY_SIZE) { - var set = iteratee ? null : createSet(array); - if (set) { - return setToArray(set); - } - isCommon = false; - includes = cacheHas; - seen = new SetCache; - } - else { - seen = iteratee ? [] : result; - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } - else if (!includes(seen, computed, comparator)) { - if (seen !== result) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.unset`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The property path to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. - */ - function baseUnset(object, path) { - path = castPath(path, object); - object = parent(object, path); - return object == null || delete object[toKey(last(path))]; - } - - /** - * The base implementation of `_.update`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to update. - * @param {Function} updater The function to produce the updated value. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. - */ - function baseUpdate(object, path, updater, customizer) { - return baseSet(object, path, updater(baseGet(object, path)), customizer); - } - - /** - * The base implementation of methods like `_.dropWhile` and `_.takeWhile` - * without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to query. - * @param {Function} predicate The function invoked per iteration. - * @param {boolean} [isDrop] Specify dropping elements instead of taking them. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the slice of `array`. - */ - function baseWhile(array, predicate, isDrop, fromRight) { - var length = array.length, - index = fromRight ? length : -1; - - while ((fromRight ? index-- : ++index < length) && - predicate(array[index], index, array)) {} - - return isDrop - ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) - : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); - } - - /** - * The base implementation of `wrapperValue` which returns the result of - * performing a sequence of actions on the unwrapped `value`, where each - * successive action is supplied the return value of the previous. - * - * @private - * @param {*} value The unwrapped value. - * @param {Array} actions Actions to perform to resolve the unwrapped value. - * @returns {*} Returns the resolved value. - */ - function baseWrapperValue(value, actions) { - var result = value; - if (result instanceof LazyWrapper) { - result = result.value(); - } - return arrayReduce(actions, function(result, action) { - return action.func.apply(action.thisArg, arrayPush([result], action.args)); - }, result); - } - - /** - * The base implementation of methods like `_.xor`, without support for - * iteratee shorthands, that accepts an array of arrays to inspect. - * - * @private - * @param {Array} arrays The arrays to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of values. - */ - function baseXor(arrays, iteratee, comparator) { - var length = arrays.length; - if (length < 2) { - return length ? baseUniq(arrays[0]) : []; - } - var index = -1, - result = Array(length); - - while (++index < length) { - var array = arrays[index], - othIndex = -1; - - while (++othIndex < length) { - if (othIndex != index) { - result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); - } - } - } - return baseUniq(baseFlatten(result, 1), iteratee, comparator); - } - - /** - * This base implementation of `_.zipObject` which assigns values using `assignFunc`. - * - * @private - * @param {Array} props The property identifiers. - * @param {Array} values The property values. - * @param {Function} assignFunc The function to assign values. - * @returns {Object} Returns the new object. - */ - function baseZipObject(props, values, assignFunc) { - var index = -1, - length = props.length, - valsLength = values.length, - result = {}; - - while (++index < length) { - var value = index < valsLength ? values[index] : undefined; - assignFunc(result, props[index], value); - } - return result; - } - - /** - * Casts `value` to an empty array if it's not an array like object. - * - * @private - * @param {*} value The value to inspect. - * @returns {Array|Object} Returns the cast array-like object. - */ - function castArrayLikeObject(value) { - return isArrayLikeObject(value) ? value : []; - } - - /** - * Casts `value` to `identity` if it's not a function. - * - * @private - * @param {*} value The value to inspect. - * @returns {Function} Returns cast function. - */ - function castFunction(value) { - return typeof value == 'function' ? value : identity; - } - - /** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @param {Object} [object] The object to query keys on. - * @returns {Array} Returns the cast property path array. - */ - function castPath(value, object) { - if (isArray(value)) { - return value; - } - return isKey(value, object) ? [value] : stringToPath(toString(value)); - } - - /** - * A `baseRest` alias which can be replaced with `identity` by module - * replacement plugins. - * - * @private - * @type {Function} - * @param {Function} func The function to apply a rest parameter to. - * @returns {Function} Returns the new function. - */ - var castRest = baseRest; - - /** - * Casts `array` to a slice if it's needed. - * - * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. - */ - function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); - } - - /** - * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). - * - * @private - * @param {number|Object} id The timer id or timeout object of the timer to clear. - */ - var clearTimeout = ctxClearTimeout || function(id) { - return root.clearTimeout(id); - }; - - /** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ - function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var length = buffer.length, - result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); - - buffer.copy(result); - return result; - } - - /** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ - function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; - } - - /** - * Creates a clone of `dataView`. - * - * @private - * @param {Object} dataView The data view to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned data view. - */ - function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); - } - - /** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ - function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; - } - - /** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ - function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; - } - - /** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ - function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); - } - - /** - * Compares values to sort them in ascending order. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {number} Returns the sort order indicator for `value`. - */ - function compareAscending(value, other) { - if (value !== other) { - var valIsDefined = value !== undefined, - valIsNull = value === null, - valIsReflexive = value === value, - valIsSymbol = isSymbol(value); - - var othIsDefined = other !== undefined, - othIsNull = other === null, - othIsReflexive = other === other, - othIsSymbol = isSymbol(other); - - if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || - (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || - (valIsNull && othIsDefined && othIsReflexive) || - (!valIsDefined && othIsReflexive) || - !valIsReflexive) { - return 1; - } - if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || - (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || - (othIsNull && valIsDefined && valIsReflexive) || - (!othIsDefined && valIsReflexive) || - !othIsReflexive) { - return -1; - } - } - return 0; - } - - /** - * Used by `_.orderBy` to compare multiple properties of a value to another - * and stable sort them. - * - * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, - * specify an order of "desc" for descending or "asc" for ascending sort order - * of corresponding values. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {boolean[]|string[]} orders The order to sort by for each property. - * @returns {number} Returns the sort order indicator for `object`. - */ - function compareMultiple(object, other, orders) { - var index = -1, - objCriteria = object.criteria, - othCriteria = other.criteria, - length = objCriteria.length, - ordersLength = orders.length; - - while (++index < length) { - var result = compareAscending(objCriteria[index], othCriteria[index]); - if (result) { - if (index >= ordersLength) { - return result; - } - var order = orders[index]; - return result * (order == 'desc' ? -1 : 1); - } - } - // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications - // that causes it, under certain circumstances, to provide the same value for - // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 - // for more details. - // - // This also ensures a stable sort in V8 and other engines. - // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. - return object.index - other.index; - } - - /** - * Creates an array that is the composition of partially applied arguments, - * placeholders, and provided arguments into a single array of arguments. - * - * @private - * @param {Array} args The provided arguments. - * @param {Array} partials The arguments to prepend to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @params {boolean} [isCurried] Specify composing for a curried function. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgs(args, partials, holders, isCurried) { - var argsIndex = -1, - argsLength = args.length, - holdersLength = holders.length, - leftIndex = -1, - leftLength = partials.length, - rangeLength = nativeMax(argsLength - holdersLength, 0), - result = Array(leftLength + rangeLength), - isUncurried = !isCurried; - - while (++leftIndex < leftLength) { - result[leftIndex] = partials[leftIndex]; - } - while (++argsIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result[holders[argsIndex]] = args[argsIndex]; - } - } - while (rangeLength--) { - result[leftIndex++] = args[argsIndex++]; - } - return result; - } - - /** - * This function is like `composeArgs` except that the arguments composition - * is tailored for `_.partialRight`. - * - * @private - * @param {Array} args The provided arguments. - * @param {Array} partials The arguments to append to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @params {boolean} [isCurried] Specify composing for a curried function. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgsRight(args, partials, holders, isCurried) { - var argsIndex = -1, - argsLength = args.length, - holdersIndex = -1, - holdersLength = holders.length, - rightIndex = -1, - rightLength = partials.length, - rangeLength = nativeMax(argsLength - holdersLength, 0), - result = Array(rangeLength + rightLength), - isUncurried = !isCurried; - - while (++argsIndex < rangeLength) { - result[argsIndex] = args[argsIndex]; - } - var offset = argsIndex; - while (++rightIndex < rightLength) { - result[offset + rightIndex] = partials[rightIndex]; - } - while (++holdersIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result[offset + holders[holdersIndex]] = args[argsIndex++]; - } - } - return result; - } - - /** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ - function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; - } - - /** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ - function copyObject(source, props, object, customizer) { - var isNew = !object; - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; - - if (newValue === undefined) { - newValue = source[key]; - } - if (isNew) { - baseAssignValue(object, key, newValue); - } else { - assignValue(object, key, newValue); - } - } - return object; - } - - /** - * Copies own symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ - function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); - } - - /** - * Copies own and inherited symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ - function copySymbolsIn(source, object) { - return copyObject(source, getSymbolsIn(source), object); - } - - /** - * Creates a function like `_.groupBy`. - * - * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} [initializer] The accumulator object initializer. - * @returns {Function} Returns the new aggregator function. - */ - function createAggregator(setter, initializer) { - return function(collection, iteratee) { - var func = isArray(collection) ? arrayAggregator : baseAggregator, - accumulator = initializer ? initializer() : {}; - - return func(collection, setter, getIteratee(iteratee, 2), accumulator); - }; - } - - /** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ - function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; - - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); - } - - /** - * Creates a `baseEach` or `baseEachRight` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee); - } - var length = collection.length, - index = fromRight ? length : -1, - iterable = Object(collection); - - while ((fromRight ? index-- : ++index < length)) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; - } - - /** - * Creates a base function for methods like `_.forIn` and `_.forOwn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; - } - - /** - * Creates a function that wraps `func` to invoke it with the optional `this` - * binding of `thisArg`. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createBind(func, bitmask, thisArg) { - var isBind = bitmask & WRAP_BIND_FLAG, - Ctor = createCtor(func); - - function wrapper() { - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return fn.apply(isBind ? thisArg : this, arguments); - } - return wrapper; - } - - /** - * Creates a function like `_.lowerFirst`. - * - * @private - * @param {string} methodName The name of the `String` case method to use. - * @returns {Function} Returns the new case function. - */ - function createCaseFirst(methodName) { - return function(string) { - string = toString(string); - - var strSymbols = hasUnicode(string) - ? stringToArray(string) - : undefined; - - var chr = strSymbols - ? strSymbols[0] - : string.charAt(0); - - var trailing = strSymbols - ? castSlice(strSymbols, 1).join('') - : string.slice(1); - - return chr[methodName]() + trailing; - }; - } - - /** - * Creates a function like `_.camelCase`. - * - * @private - * @param {Function} callback The function to combine each word. - * @returns {Function} Returns the new compounder function. - */ - function createCompounder(callback) { - return function(string) { - return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); - }; - } - - /** - * Creates a function that produces an instance of `Ctor` regardless of - * whether it was invoked as part of a `new` expression or by `call` or `apply`. - * - * @private - * @param {Function} Ctor The constructor to wrap. - * @returns {Function} Returns the new wrapped function. - */ - function createCtor(Ctor) { - return function() { - // Use a `switch` statement to work with class constructors. See - // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist - // for more details. - var args = arguments; - switch (args.length) { - case 0: return new Ctor; - case 1: return new Ctor(args[0]); - case 2: return new Ctor(args[0], args[1]); - case 3: return new Ctor(args[0], args[1], args[2]); - case 4: return new Ctor(args[0], args[1], args[2], args[3]); - case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); - case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); - case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); - } - var thisBinding = baseCreate(Ctor.prototype), - result = Ctor.apply(thisBinding, args); - - // Mimic the constructor's `return` behavior. - // See https://es5.github.io/#x13.2.2 for more details. - return isObject(result) ? result : thisBinding; - }; - } - - /** - * Creates a function that wraps `func` to enable currying. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {number} arity The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createCurry(func, bitmask, arity) { - var Ctor = createCtor(func); - - function wrapper() { - var length = arguments.length, - args = Array(length), - index = length, - placeholder = getHolder(wrapper); - - while (index--) { - args[index] = arguments[index]; - } - var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) - ? [] - : replaceHolders(args, placeholder); - - length -= holders.length; - if (length < arity) { - return createRecurry( - func, bitmask, createHybrid, wrapper.placeholder, undefined, - args, holders, undefined, undefined, arity - length); - } - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return apply(fn, this, args); - } - return wrapper; - } - - /** - * Creates a `_.find` or `_.findLast` function. - * - * @private - * @param {Function} findIndexFunc The function to find the collection index. - * @returns {Function} Returns the new find function. - */ - function createFind(findIndexFunc) { - return function(collection, predicate, fromIndex) { - var iterable = Object(collection); - if (!isArrayLike(collection)) { - var iteratee = getIteratee(predicate, 3); - collection = keys(collection); - predicate = function(key) { return iteratee(iterable[key], key, iterable); }; - } - var index = findIndexFunc(collection, predicate, fromIndex); - return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; - }; - } - - /** - * Creates a `_.flow` or `_.flowRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new flow function. - */ - function createFlow(fromRight) { - return flatRest(function(funcs) { - var length = funcs.length, - index = length, - prereq = LodashWrapper.prototype.thru; - - if (fromRight) { - funcs.reverse(); - } - while (index--) { - var func = funcs[index]; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (prereq && !wrapper && getFuncName(func) == 'wrapper') { - var wrapper = new LodashWrapper([], true); - } - } - index = wrapper ? index : length; - while (++index < length) { - func = funcs[index]; - - var funcName = getFuncName(func), - data = funcName == 'wrapper' ? getData(func) : undefined; - - if (data && isLaziable(data[0]) && - data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && - !data[4].length && data[9] == 1 - ) { - wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); - } else { - wrapper = (func.length == 1 && isLaziable(func)) - ? wrapper[funcName]() - : wrapper.thru(func); - } - } - return function() { - var args = arguments, - value = args[0]; - - if (wrapper && args.length == 1 && isArray(value)) { - return wrapper.plant(value).value(); - } - var index = 0, - result = length ? funcs[index].apply(this, args) : value; - - while (++index < length) { - result = funcs[index].call(this, result); - } - return result; - }; - }); - } - - /** - * Creates a function that wraps `func` to invoke it with optional `this` - * binding of `thisArg`, partial application, and currying. - * - * @private - * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to - * the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [partialsRight] The arguments to append to those provided - * to the new function. - * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { - var isAry = bitmask & WRAP_ARY_FLAG, - isBind = bitmask & WRAP_BIND_FLAG, - isBindKey = bitmask & WRAP_BIND_KEY_FLAG, - isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), - isFlip = bitmask & WRAP_FLIP_FLAG, - Ctor = isBindKey ? undefined : createCtor(func); - - function wrapper() { - var length = arguments.length, - args = Array(length), - index = length; - - while (index--) { - args[index] = arguments[index]; - } - if (isCurried) { - var placeholder = getHolder(wrapper), - holdersCount = countHolders(args, placeholder); - } - if (partials) { - args = composeArgs(args, partials, holders, isCurried); - } - if (partialsRight) { - args = composeArgsRight(args, partialsRight, holdersRight, isCurried); - } - length -= holdersCount; - if (isCurried && length < arity) { - var newHolders = replaceHolders(args, placeholder); - return createRecurry( - func, bitmask, createHybrid, wrapper.placeholder, thisArg, - args, newHolders, argPos, ary, arity - length - ); - } - var thisBinding = isBind ? thisArg : this, - fn = isBindKey ? thisBinding[func] : func; - - length = args.length; - if (argPos) { - args = reorder(args, argPos); - } else if (isFlip && length > 1) { - args.reverse(); - } - if (isAry && ary < length) { - args.length = ary; - } - if (this && this !== root && this instanceof wrapper) { - fn = Ctor || createCtor(fn); - } - return fn.apply(thisBinding, args); - } - return wrapper; - } - - /** - * Creates a function like `_.invertBy`. - * - * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} toIteratee The function to resolve iteratees. - * @returns {Function} Returns the new inverter function. - */ - function createInverter(setter, toIteratee) { - return function(object, iteratee) { - return baseInverter(object, setter, toIteratee(iteratee), {}); - }; - } - - /** - * Creates a function that performs a mathematical operation on two values. - * - * @private - * @param {Function} operator The function to perform the operation. - * @param {number} [defaultValue] The value used for `undefined` arguments. - * @returns {Function} Returns the new mathematical operation function. - */ - function createMathOperation(operator, defaultValue) { - return function(value, other) { - var result; - if (value === undefined && other === undefined) { - return defaultValue; - } - if (value !== undefined) { - result = value; - } - if (other !== undefined) { - if (result === undefined) { - return other; - } - if (typeof value == 'string' || typeof other == 'string') { - value = baseToString(value); - other = baseToString(other); - } else { - value = baseToNumber(value); - other = baseToNumber(other); - } - result = operator(value, other); - } - return result; - }; - } - - /** - * Creates a function like `_.over`. - * - * @private - * @param {Function} arrayFunc The function to iterate over iteratees. - * @returns {Function} Returns the new over function. - */ - function createOver(arrayFunc) { - return flatRest(function(iteratees) { - iteratees = arrayMap(iteratees, baseUnary(getIteratee())); - return baseRest(function(args) { - var thisArg = this; - return arrayFunc(iteratees, function(iteratee) { - return apply(iteratee, thisArg, args); - }); - }); - }); - } - - /** - * Creates the padding for `string` based on `length`. The `chars` string - * is truncated if the number of characters exceeds `length`. - * - * @private - * @param {number} length The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padding for `string`. - */ - function createPadding(length, chars) { - chars = chars === undefined ? ' ' : baseToString(chars); - - var charsLength = chars.length; - if (charsLength < 2) { - return charsLength ? baseRepeat(chars, length) : chars; - } - var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); - return hasUnicode(chars) - ? castSlice(stringToArray(result), 0, length).join('') - : result.slice(0, length); - } - - /** - * Creates a function that wraps `func` to invoke it with the `this` binding - * of `thisArg` and `partials` prepended to the arguments it receives. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} partials The arguments to prepend to those provided to - * the new function. - * @returns {Function} Returns the new wrapped function. - */ - function createPartial(func, bitmask, thisArg, partials) { - var isBind = bitmask & WRAP_BIND_FLAG, - Ctor = createCtor(func); - - function wrapper() { - var argsIndex = -1, - argsLength = arguments.length, - leftIndex = -1, - leftLength = partials.length, - args = Array(leftLength + argsLength), - fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - - while (++leftIndex < leftLength) { - args[leftIndex] = partials[leftIndex]; - } - while (argsLength--) { - args[leftIndex++] = arguments[++argsIndex]; - } - return apply(fn, isBind ? thisArg : this, args); - } - return wrapper; - } - - /** - * Creates a `_.range` or `_.rangeRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new range function. - */ - function createRange(fromRight) { - return function(start, end, step) { - if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { - end = step = undefined; - } - // Ensure the sign of `-0` is preserved. - start = toFinite(start); - if (end === undefined) { - end = start; - start = 0; - } else { - end = toFinite(end); - } - step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); - return baseRange(start, end, step, fromRight); - }; - } - - /** - * Creates a function that performs a relational operation on two values. - * - * @private - * @param {Function} operator The function to perform the operation. - * @returns {Function} Returns the new relational operation function. - */ - function createRelationalOperation(operator) { - return function(value, other) { - if (!(typeof value == 'string' && typeof other == 'string')) { - value = toNumber(value); - other = toNumber(other); - } - return operator(value, other); - }; - } - - /** - * Creates a function that wraps `func` to continue currying. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {Function} wrapFunc The function to create the `func` wrapper. - * @param {*} placeholder The placeholder value. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to - * the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { - var isCurry = bitmask & WRAP_CURRY_FLAG, - newHolders = isCurry ? holders : undefined, - newHoldersRight = isCurry ? undefined : holders, - newPartials = isCurry ? partials : undefined, - newPartialsRight = isCurry ? undefined : partials; - - bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); - bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); - - if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { - bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); - } - var newData = [ - func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, - newHoldersRight, argPos, ary, arity - ]; - - var result = wrapFunc.apply(undefined, newData); - if (isLaziable(func)) { - setData(result, newData); - } - result.placeholder = placeholder; - return setWrapToString(result, func, bitmask); - } - - /** - * Creates a function like `_.round`. - * - * @private - * @param {string} methodName The name of the `Math` method to use when rounding. - * @returns {Function} Returns the new round function. - */ - function createRound(methodName) { - var func = Math[methodName]; - return function(number, precision) { - number = toNumber(number); - precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); - if (precision) { - // Shift with exponential notation to avoid floating-point issues. - // See [MDN](https://mdn.io/round#Examples) for more details. - var pair = (toString(number) + 'e').split('e'), - value = func(pair[0] + 'e' + (+pair[1] + precision)); - - pair = (toString(value) + 'e').split('e'); - return +(pair[0] + 'e' + (+pair[1] - precision)); - } - return func(number); - }; - } - - /** - * Creates a set object of `values`. - * - * @private - * @param {Array} values The values to add to the set. - * @returns {Object} Returns the new set. - */ - var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { - return new Set(values); - }; - - /** - * Creates a `_.toPairs` or `_.toPairsIn` function. - * - * @private - * @param {Function} keysFunc The function to get the keys of a given object. - * @returns {Function} Returns the new pairs function. - */ - function createToPairs(keysFunc) { - return function(object) { - var tag = getTag(object); - if (tag == mapTag) { - return mapToArray(object); - } - if (tag == setTag) { - return setToPairs(object); - } - return baseToPairs(object, keysFunc(object)); - }; - } - - /** - * Creates a function that either curries or invokes `func` with optional - * `this` binding and partially applied arguments. - * - * @private - * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask flags. - * 1 - `_.bind` - * 2 - `_.bindKey` - * 4 - `_.curry` or `_.curryRight` of a bound function - * 8 - `_.curry` - * 16 - `_.curryRight` - * 32 - `_.partial` - * 64 - `_.partialRight` - * 128 - `_.rearg` - * 256 - `_.ary` - * 512 - `_.flip` - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to be partially applied. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { - var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; - if (!isBindKey && typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - var length = partials ? partials.length : 0; - if (!length) { - bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); - partials = holders = undefined; - } - ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); - arity = arity === undefined ? arity : toInteger(arity); - length -= holders ? holders.length : 0; - - if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { - var partialsRight = partials, - holdersRight = holders; - - partials = holders = undefined; - } - var data = isBindKey ? undefined : getData(func); - - var newData = [ - func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, - argPos, ary, arity - ]; - - if (data) { - mergeData(newData, data); - } - func = newData[0]; - bitmask = newData[1]; - thisArg = newData[2]; - partials = newData[3]; - holders = newData[4]; - arity = newData[9] = newData[9] === undefined - ? (isBindKey ? 0 : func.length) - : nativeMax(newData[9] - length, 0); - - if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { - bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); - } - if (!bitmask || bitmask == WRAP_BIND_FLAG) { - var result = createBind(func, bitmask, thisArg); - } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { - result = createCurry(func, bitmask, arity); - } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { - result = createPartial(func, bitmask, thisArg, partials); - } else { - result = createHybrid.apply(undefined, newData); - } - var setter = data ? baseSetData : setData; - return setWrapToString(setter(result, newData), func, bitmask); - } - - /** - * Used by `_.defaults` to customize its `_.assignIn` use to assign properties - * of source objects to the destination object for all destination properties - * that resolve to `undefined`. - * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to assign. - * @param {Object} object The parent object of `objValue`. - * @returns {*} Returns the value to assign. - */ - function customDefaultsAssignIn(objValue, srcValue, key, object) { - if (objValue === undefined || - (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { - return srcValue; - } - return objValue; - } - - /** - * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source - * objects into destination objects that are passed thru. - * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to merge. - * @param {Object} object The parent object of `objValue`. - * @param {Object} source The parent object of `srcValue`. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - * @returns {*} Returns the value to assign. - */ - function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { - if (isObject(objValue) && isObject(srcValue)) { - // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, objValue); - baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); - stack['delete'](srcValue); - } - return objValue; - } - - /** - * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain - * objects. - * - * @private - * @param {*} value The value to inspect. - * @param {string} key The key of the property to inspect. - * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. - */ - function customOmitClone(value) { - return isPlainObject(value) ? undefined : value; - } - - /** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. - * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ - function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - arrLength = array.length, - othLength = other.length; - - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(array); - if (stacked && stack.get(other)) { - return stacked == other; - } - var index = -1, - result = true, - seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; - - stack.set(array, other); - stack.set(other, array); - - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, arrValue, index, other, array, stack) - : customizer(arrValue, othValue, index, array, other, stack); - } - if (compared !== undefined) { - if (compared) { - continue; - } - result = false; - break; - } - // Recursively compare arrays (susceptible to call stack limits). - if (seen) { - if (!arraySome(other, function(othValue, othIndex) { - if (!cacheHas(seen, othIndex) && - (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { - return seen.push(othIndex); - } - })) { - result = false; - break; - } - } else if (!( - arrValue === othValue || - equalFunc(arrValue, othValue, bitmask, customizer, stack) - )) { - result = false; - break; - } - } - stack['delete'](array); - stack['delete'](other); - return result; - } - - /** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { - switch (tag) { - case dataViewTag: - if ((object.byteLength != other.byteLength) || - (object.byteOffset != other.byteOffset)) { - return false; - } - object = object.buffer; - other = other.buffer; - - case arrayBufferTag: - if ((object.byteLength != other.byteLength) || - !equalFunc(new Uint8Array(object), new Uint8Array(other))) { - return false; - } - return true; - - case boolTag: - case dateTag: - case numberTag: - // Coerce booleans to `1` or `0` and dates to milliseconds. - // Invalid dates are coerced to `NaN`. - return eq(+object, +other); - - case errorTag: - return object.name == other.name && object.message == other.message; - - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings, primitives and objects, - // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring - // for more details. - return object == (other + ''); - - case mapTag: - var convert = mapToArray; - - case setTag: - var isPartial = bitmask & COMPARE_PARTIAL_FLAG; - convert || (convert = setToArray); - - if (object.size != other.size && !isPartial) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked) { - return stacked == other; - } - bitmask |= COMPARE_UNORDERED_FLAG; - - // Recursively compare objects (susceptible to call stack limits). - stack.set(object, other); - var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); - stack['delete'](object); - return result; - - case symbolTag: - if (symbolValueOf) { - return symbolValueOf.call(object) == symbolValueOf.call(other); - } - } - return false; - } - - /** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - objProps = getAllKeys(object), - objLength = objProps.length, - othProps = getAllKeys(other), - othLength = othProps.length; - - if (objLength != othLength && !isPartial) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { - return false; - } - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked && stack.get(other)) { - return stacked == other; - } - var result = true; - stack.set(object, other); - stack.set(other, object); - - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, objValue, key, other, object, stack) - : customizer(objValue, othValue, key, object, other, stack); - } - // Recursively compare objects (susceptible to call stack limits). - if (!(compared === undefined - ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) - : compared - )) { - result = false; - break; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (result && !skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; - - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - result = false; - } - } - stack['delete'](object); - stack['delete'](other); - return result; - } - - /** - * A specialized version of `baseRest` which flattens the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @returns {Function} Returns the new function. - */ - function flatRest(func) { - return setToString(overRest(func, undefined, flatten), func + ''); - } - - /** - * Creates an array of own enumerable property names and symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ - function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); - } - - /** - * Creates an array of own and inherited enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ - function getAllKeysIn(object) { - return baseGetAllKeys(object, keysIn, getSymbolsIn); - } - - /** - * Gets metadata for `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {*} Returns the metadata for `func`. - */ - var getData = !metaMap ? noop : function(func) { - return metaMap.get(func); - }; - - /** - * Gets the name of `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {string} Returns the function name. - */ - function getFuncName(func) { - var result = (func.name + ''), - array = realNames[result], - length = hasOwnProperty.call(realNames, result) ? array.length : 0; - - while (length--) { - var data = array[length], - otherFunc = data.func; - if (otherFunc == null || otherFunc == func) { - return data.name; - } - } - return result; - } - - /** - * Gets the argument placeholder value for `func`. - * - * @private - * @param {Function} func The function to inspect. - * @returns {*} Returns the placeholder value. - */ - function getHolder(func) { - var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; - return object.placeholder; - } - - /** - * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, - * this function returns the custom method, otherwise it returns `baseIteratee`. - * If arguments are provided, the chosen function is invoked with them and - * its result is returned. - * - * @private - * @param {*} [value] The value to convert to an iteratee. - * @param {number} [arity] The arity of the created iteratee. - * @returns {Function} Returns the chosen function or its result. - */ - function getIteratee() { - var result = lodash.iteratee || iteratee; - result = result === iteratee ? baseIteratee : result; - return arguments.length ? result(arguments[0], arguments[1]) : result; - } - - /** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ - function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; - } - - /** - * Gets the property names, values, and compare flags of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the match data of `object`. - */ - function getMatchData(object) { - var result = keys(object), - length = result.length; - - while (length--) { - var key = result[length], - value = object[key]; - - result[length] = [key, value, isStrictComparable(value)]; - } - return result; - } - - /** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ - function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; - } - - /** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ - function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; - - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} - - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } - } - return result; - } - - /** - * Creates an array of the own enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ - var getSymbols = !nativeGetSymbols ? stubArray : function(object) { - if (object == null) { - return []; - } - object = Object(object); - return arrayFilter(nativeGetSymbols(object), function(symbol) { - return propertyIsEnumerable.call(object, symbol); - }); - }; - - /** - * Creates an array of the own and inherited enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ - var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { - var result = []; - while (object) { - arrayPush(result, getSymbols(object)); - object = getPrototype(object); - } - return result; - }; - - /** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - var getTag = baseGetTag; - - // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. - if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = baseGetTag(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : ''; - - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; - } - - /** - * Gets the view, applying any `transforms` to the `start` and `end` positions. - * - * @private - * @param {number} start The start of the view. - * @param {number} end The end of the view. - * @param {Array} transforms The transformations to apply to the view. - * @returns {Object} Returns an object containing the `start` and `end` - * positions of the view. - */ - function getView(start, end, transforms) { - var index = -1, - length = transforms.length; - - while (++index < length) { - var data = transforms[index], - size = data.size; - - switch (data.type) { - case 'drop': start += size; break; - case 'dropRight': end -= size; break; - case 'take': end = nativeMin(end, start + size); break; - case 'takeRight': start = nativeMax(start, end - size); break; - } - } - return { 'start': start, 'end': end }; - } - - /** - * Extracts wrapper details from the `source` body comment. - * - * @private - * @param {string} source The source to inspect. - * @returns {Array} Returns the wrapper details. - */ - function getWrapDetails(source) { - var match = source.match(reWrapDetails); - return match ? match[1].split(reSplitDetails) : []; - } - - /** - * Checks if `path` exists on `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @param {Function} hasFunc The function to check properties. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - */ - function hasPath(object, path, hasFunc) { - path = castPath(path, object); - - var index = -1, - length = path.length, - result = false; - - while (++index < length) { - var key = toKey(path[index]); - if (!(result = object != null && hasFunc(object, key))) { - break; - } - object = object[key]; - } - if (result || ++index != length) { - return result; - } - length = object == null ? 0 : object.length; - return !!length && isLength(length) && isIndex(key, length) && - (isArray(object) || isArguments(object)); - } - - /** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ - function initCloneArray(array) { - var length = array.length, - result = new array.constructor(length); - - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; - } - - /** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; - } - - /** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case dataViewTag: - return cloneDataView(object, isDeep); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return new Ctor; - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - return cloneRegExp(object); - - case setTag: - return new Ctor; - - case symbolTag: - return cloneSymbol(object); - } - } - - /** - * Inserts wrapper `details` in a comment at the top of the `source` body. - * - * @private - * @param {string} source The source to modify. - * @returns {Array} details The details to insert. - * @returns {string} Returns the modified source. - */ - function insertWrapDetails(source, details) { - var length = details.length; - if (!length) { - return source; - } - var lastIndex = length - 1; - details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; - details = details.join(length > 2 ? ', ' : ' '); - return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); - } - - /** - * Checks if `value` is a flattenable `arguments` object or array. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. - */ - function isFlattenable(value) { - return isArray(value) || isArguments(value) || - !!(spreadableSymbol && value && value[spreadableSymbol]); - } - - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; - - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); - } - - /** - * Checks if the given arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, - * else `false`. - */ - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object) - ) { - return eq(object[index], value); - } - return false; - } - - /** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ - function isKey(value, object) { - if (isArray(value)) { - return false; - } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; - } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); - } - - /** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ - function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); - } - - /** - * Checks if `func` has a lazy counterpart. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` has a lazy counterpart, - * else `false`. - */ - function isLaziable(func) { - var funcName = getFuncName(func), - other = lodash[funcName]; - - if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { - return false; - } - if (func === other) { - return true; - } - var data = getData(other); - return !!data && func === data[0]; - } - - /** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ - function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); - } - - /** - * Checks if `func` is capable of being masked. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `func` is maskable, else `false`. - */ - var isMaskable = coreJsData ? isFunction : stubFalse; - - /** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ - function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; - } - - /** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ - function isStrictComparable(value) { - return value === value && !isObject(value); - } - - /** - * A specialized version of `matchesProperty` for source values suitable - * for strict equality comparisons, i.e. `===`. - * - * @private - * @param {string} key The key of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ - function matchesStrictComparable(key, srcValue) { - return function(object) { - if (object == null) { - return false; - } - return object[key] === srcValue && - (srcValue !== undefined || (key in Object(object))); - }; - } - - /** - * A specialized version of `_.memoize` which clears the memoized function's - * cache when it exceeds `MAX_MEMOIZE_SIZE`. - * - * @private - * @param {Function} func The function to have its output memoized. - * @returns {Function} Returns the new memoized function. - */ - function memoizeCapped(func) { - var result = memoize(func, function(key) { - if (cache.size === MAX_MEMOIZE_SIZE) { - cache.clear(); - } - return key; - }); - - var cache = result.cache; - return result; - } - - /** - * Merges the function metadata of `source` into `data`. - * - * Merging metadata reduces the number of wrappers used to invoke a function. - * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` - * may be applied regardless of execution order. Methods like `_.ary` and - * `_.rearg` modify function arguments, making the order in which they are - * executed important, preventing the merging of metadata. However, we make - * an exception for a safe combined case where curried functions have `_.ary` - * and or `_.rearg` applied. - * - * @private - * @param {Array} data The destination metadata. - * @param {Array} source The source metadata. - * @returns {Array} Returns `data`. - */ - function mergeData(data, source) { - var bitmask = data[1], - srcBitmask = source[1], - newBitmask = bitmask | srcBitmask, - isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); - - var isCombo = - ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || - ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || - ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); - - // Exit early if metadata can't be merged. - if (!(isCommon || isCombo)) { - return data; - } - // Use source `thisArg` if available. - if (srcBitmask & WRAP_BIND_FLAG) { - data[2] = source[2]; - // Set when currying a bound function. - newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; - } - // Compose partial arguments. - var value = source[3]; - if (value) { - var partials = data[3]; - data[3] = partials ? composeArgs(partials, value, source[4]) : value; - data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; - } - // Compose partial right arguments. - value = source[5]; - if (value) { - partials = data[5]; - data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; - data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; - } - // Use source `argPos` if available. - value = source[7]; - if (value) { - data[7] = value; - } - // Use source `ary` if it's smaller. - if (srcBitmask & WRAP_ARY_FLAG) { - data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); - } - // Use source `arity` if one is not provided. - if (data[9] == null) { - data[9] = source[9]; - } - // Use source `func` and merge bitmasks. - data[0] = source[0]; - data[1] = newBitmask; - - return data; - } - - /** - * This function is like - * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * except that it includes inherited enumerable properties. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } - } - return result; - } - - /** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ - function objectToString(value) { - return nativeObjectToString.call(value); - } - - /** - * A specialized version of `baseRest` which transforms the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @param {Function} transform The rest array transform. - * @returns {Function} Returns the new function. - */ - function overRest(func, start, transform) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = transform(array); - return apply(func, this, otherArgs); - }; - } - - /** - * Gets the parent value at `path` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} path The path to get the parent value of. - * @returns {*} Returns the parent value. - */ - function parent(object, path) { - return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); - } - - /** - * Reorder `array` according to the specified indexes where the element at - * the first index is assigned as the first element, the element at - * the second index is assigned as the second element, and so on. - * - * @private - * @param {Array} array The array to reorder. - * @param {Array} indexes The arranged array indexes. - * @returns {Array} Returns `array`. - */ - function reorder(array, indexes) { - var arrLength = array.length, - length = nativeMin(indexes.length, arrLength), - oldArray = copyArray(array); - - while (length--) { - var index = indexes[length]; - array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; - } - return array; - } - - /** - * Sets metadata for `func`. - * - * **Note:** If this function becomes hot, i.e. is invoked a lot in a short - * period of time, it will trip its breaker and transition to an identity - * function to avoid garbage collection pauses in V8. See - * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) - * for more details. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ - var setData = shortOut(baseSetData); - - /** - * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @returns {number|Object} Returns the timer id or timeout object. - */ - var setTimeout = ctxSetTimeout || function(func, wait) { - return root.setTimeout(func, wait); - }; - - /** - * Sets the `toString` method of `func` to return `string`. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ - var setToString = shortOut(baseSetToString); - - /** - * Sets the `toString` method of `wrapper` to mimic the source of `reference` - * with wrapper details in a comment at the top of the source body. - * - * @private - * @param {Function} wrapper The function to modify. - * @param {Function} reference The reference function. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @returns {Function} Returns `wrapper`. - */ - function setWrapToString(wrapper, reference, bitmask) { - var source = (reference + ''); - return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); - } - - /** - * Creates a function that'll short out and invoke `identity` instead - * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` - * milliseconds. - * - * @private - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new shortable function. - */ - function shortOut(func) { - var count = 0, - lastCalled = 0; - - return function() { - var stamp = nativeNow(), - remaining = HOT_SPAN - (stamp - lastCalled); - - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return arguments[0]; - } - } else { - count = 0; - } - return func.apply(undefined, arguments); - }; - } - - /** - * A specialized version of `_.shuffle` which mutates and sets the size of `array`. - * - * @private - * @param {Array} array The array to shuffle. - * @param {number} [size=array.length] The size of `array`. - * @returns {Array} Returns `array`. - */ - function shuffleSelf(array, size) { - var index = -1, - length = array.length, - lastIndex = length - 1; - - size = size === undefined ? length : size; - while (++index < size) { - var rand = baseRandom(index, lastIndex), - value = array[rand]; - - array[rand] = array[index]; - array[index] = value; - } - array.length = size; - return array; - } - - /** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ - var stringToPath = memoizeCapped(function(string) { - var result = []; - if (string.charCodeAt(0) === 46 /* . */) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, subString) { - result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; - }); - - /** - * Converts `value` to a string key if it's not a string or symbol. - * - * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. - */ - function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } - - /** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to convert. - * @returns {string} Returns the source code. - */ - function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; - } - - /** - * Updates wrapper `details` based on `bitmask` flags. - * - * @private - * @returns {Array} details The details to modify. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @returns {Array} Returns `details`. - */ - function updateWrapDetails(details, bitmask) { - arrayEach(wrapFlags, function(pair) { - var value = '_.' + pair[0]; - if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { - details.push(value); - } - }); - return details.sort(); - } - - /** - * Creates a clone of `wrapper`. - * - * @private - * @param {Object} wrapper The wrapper to clone. - * @returns {Object} Returns the cloned wrapper. - */ - function wrapperClone(wrapper) { - if (wrapper instanceof LazyWrapper) { - return wrapper.clone(); - } - var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); - result.__actions__ = copyArray(wrapper.__actions__); - result.__index__ = wrapper.__index__; - result.__values__ = wrapper.__values__; - return result; - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates an array of elements split into groups the length of `size`. - * If `array` can't be split evenly, the final chunk will be the remaining - * elements. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to process. - * @param {number} [size=1] The length of each chunk - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the new array of chunks. - * @example - * - * _.chunk(['a', 'b', 'c', 'd'], 2); - * // => [['a', 'b'], ['c', 'd']] - * - * _.chunk(['a', 'b', 'c', 'd'], 3); - * // => [['a', 'b', 'c'], ['d']] - */ - function chunk(array, size, guard) { - if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { - size = 1; - } else { - size = nativeMax(toInteger(size), 0); - } - var length = array == null ? 0 : array.length; - if (!length || size < 1) { - return []; - } - var index = 0, - resIndex = 0, - result = Array(nativeCeil(length / size)); - - while (index < length) { - result[resIndex++] = baseSlice(array, index, (index += size)); - } - return result; - } - - /** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] - */ - function compact(array) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (value) { - result[resIndex++] = value; - } - } - return result; - } - - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to concatenate. - * @param {...*} [values] The values to concatenate. - * @returns {Array} Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - function concat() { - var length = arguments.length; - if (!length) { - return []; - } - var args = Array(length - 1), - array = arguments[0], - index = length; - - while (index--) { - args[index - 1] = arguments[index]; - } - return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); - } - - /** - * Creates an array of `array` values not included in the other given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. The order and references of result values are - * determined by the first array. - * - * **Note:** Unlike `_.pullAll`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @see _.without, _.xor - * @example - * - * _.difference([2, 1], [2, 3]); - * // => [1] - */ - var difference = baseRest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) - : []; - }); - - /** - * This method is like `_.difference` except that it accepts `iteratee` which - * is invoked for each element of `array` and `values` to generate the criterion - * by which they're compared. The order and references of result values are - * determined by the first array. The iteratee is invoked with one argument: - * (value). - * - * **Note:** Unlike `_.pullAllBy`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [1.2] - * - * // The `_.property` iteratee shorthand. - * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - var differenceBy = baseRest(function(array, values) { - var iteratee = last(values); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) - : []; - }); - - /** - * This method is like `_.difference` except that it accepts `comparator` - * which is invoked to compare elements of `array` to `values`. The order and - * references of result values are determined by the first array. The comparator - * is invoked with two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.pullAllWith`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - var differenceWith = baseRest(function(array, values) { - var comparator = last(values); - if (isArrayLikeObject(comparator)) { - comparator = undefined; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) - : []; - }); - - /** - * Creates a slice of `array` with `n` elements dropped from the beginning. - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.drop([1, 2, 3]); - * // => [2, 3] - * - * _.drop([1, 2, 3], 2); - * // => [3] - * - * _.drop([1, 2, 3], 5); - * // => [] - * - * _.drop([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function drop(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - return baseSlice(array, n < 0 ? 0 : n, length); - } - - /** - * Creates a slice of `array` with `n` elements dropped from the end. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRight([1, 2, 3]); - * // => [1, 2] - * - * _.dropRight([1, 2, 3], 2); - * // => [1] - * - * _.dropRight([1, 2, 3], 5); - * // => [] - * - * _.dropRight([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function dropRight(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, 0, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` excluding elements dropped from the end. - * Elements are dropped until `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.dropRightWhile(users, function(o) { return !o.active; }); - * // => objects for ['barney'] - * - * // The `_.matches` iteratee shorthand. - * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); - * // => objects for ['barney', 'fred'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.dropRightWhile(users, ['active', false]); - * // => objects for ['barney'] - * - * // The `_.property` iteratee shorthand. - * _.dropRightWhile(users, 'active'); - * // => objects for ['barney', 'fred', 'pebbles'] - */ - function dropRightWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), true, true) - : []; - } - - /** - * Creates a slice of `array` excluding elements dropped from the beginning. - * Elements are dropped until `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.dropWhile(users, function(o) { return !o.active; }); - * // => objects for ['pebbles'] - * - * // The `_.matches` iteratee shorthand. - * _.dropWhile(users, { 'user': 'barney', 'active': false }); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.dropWhile(users, ['active', false]); - * // => objects for ['pebbles'] - * - * // The `_.property` iteratee shorthand. - * _.dropWhile(users, 'active'); - * // => objects for ['barney', 'fred', 'pebbles'] - */ - function dropWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), true) - : []; - } - - /** - * Fills elements of `array` with `value` from `start` up to, but not - * including, `end`. - * - * **Note:** This method mutates `array`. - * - * @static - * @memberOf _ - * @since 3.2.0 - * @category Array - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.fill(array, 'a'); - * console.log(array); - * // => ['a', 'a', 'a'] - * - * _.fill(Array(3), 2); - * // => [2, 2, 2] - * - * _.fill([4, 6, 8, 10], '*', 1, 3); - * // => [4, '*', '*', 10] - */ - function fill(array, value, start, end) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { - start = 0; - end = length; - } - return baseFill(array, value, start, end); - } - - /** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for instead of the element itself. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.findIndex(users, function(o) { return o.user == 'barney'; }); - * // => 0 - * - * // The `_.matches` iteratee shorthand. - * _.findIndex(users, { 'user': 'fred', 'active': false }); - * // => 1 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findIndex(users, ['active', false]); - * // => 0 - * - * // The `_.property` iteratee shorthand. - * _.findIndex(users, 'active'); - * // => 2 - */ - function findIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); - } - return baseFindIndex(array, getIteratee(predicate, 3), index); - } - - /** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); - * // => 2 - * - * // The `_.matches` iteratee shorthand. - * _.findLastIndex(users, { 'user': 'barney', 'active': true }); - * // => 0 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastIndex(users, ['active', false]); - * // => 2 - * - * // The `_.property` iteratee shorthand. - * _.findLastIndex(users, 'active'); - * // => 0 - */ - function findLastIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length - 1; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = fromIndex < 0 - ? nativeMax(length + index, 0) - : nativeMin(index, length - 1); - } - return baseFindIndex(array, getIteratee(predicate, 3), index, true); - } - - /** - * Flattens `array` a single level deep. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flatten([1, [2, [3, [4]], 5]]); - * // => [1, 2, [3, [4]], 5] - */ - function flatten(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, 1) : []; - } - - /** - * Recursively flattens `array`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flattenDeep([1, [2, [3, [4]], 5]]); - * // => [1, 2, 3, 4, 5] - */ - function flattenDeep(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, INFINITY) : []; - } - - /** - * Recursively flatten `array` up to `depth` times. - * - * @static - * @memberOf _ - * @since 4.4.0 - * @category Array - * @param {Array} array The array to flatten. - * @param {number} [depth=1] The maximum recursion depth. - * @returns {Array} Returns the new flattened array. - * @example - * - * var array = [1, [2, [3, [4]], 5]]; - * - * _.flattenDepth(array, 1); - * // => [1, 2, [3, [4]], 5] - * - * _.flattenDepth(array, 2); - * // => [1, 2, 3, [4], 5] - */ - function flattenDepth(array, depth) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - depth = depth === undefined ? 1 : toInteger(depth); - return baseFlatten(array, depth); - } - - /** - * The inverse of `_.toPairs`; this method returns an object composed - * from key-value `pairs`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} pairs The key-value pairs. - * @returns {Object} Returns the new object. - * @example - * - * _.fromPairs([['a', 1], ['b', 2]]); - * // => { 'a': 1, 'b': 2 } - */ - function fromPairs(pairs) { - var index = -1, - length = pairs == null ? 0 : pairs.length, - result = {}; - - while (++index < length) { - var pair = pairs[index]; - result[pair[0]] = pair[1]; - } - return result; - } - - /** - * Gets the first element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @alias first - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the first element of `array`. - * @example - * - * _.head([1, 2, 3]); - * // => 1 - * - * _.head([]); - * // => undefined - */ - function head(array) { - return (array && array.length) ? array[0] : undefined; - } - - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the - * offset from the end of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // Search from the `fromIndex`. - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - function indexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); - } - return baseIndexOf(array, value, index); - } - - /** - * Gets all but the last element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.initial([1, 2, 3]); - * // => [1, 2] - */ - function initial(array) { - var length = array == null ? 0 : array.length; - return length ? baseSlice(array, 0, -1) : []; - } - - /** - * Creates an array of unique values that are included in all given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. The order and references of result values are - * determined by the first array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * _.intersection([2, 1], [2, 3]); - * // => [2] - */ - var intersection = baseRest(function(arrays) { - var mapped = arrayMap(arrays, castArrayLikeObject); - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped) - : []; - }); - - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which they're compared. The order and references of result values are - * determined by the first array. The iteratee is invoked with one argument: - * (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [2.1] - * - * // The `_.property` iteratee shorthand. - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - var intersectionBy = baseRest(function(arrays) { - var iteratee = last(arrays), - mapped = arrayMap(arrays, castArrayLikeObject); - - if (iteratee === last(mapped)) { - iteratee = undefined; - } else { - mapped.pop(); - } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, getIteratee(iteratee, 2)) - : []; - }); - - /** - * This method is like `_.intersection` except that it accepts `comparator` - * which is invoked to compare elements of `arrays`. The order and references - * of result values are determined by the first array. The comparator is - * invoked with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - var intersectionWith = baseRest(function(arrays) { - var comparator = last(arrays), - mapped = arrayMap(arrays, castArrayLikeObject); - - comparator = typeof comparator == 'function' ? comparator : undefined; - if (comparator) { - mapped.pop(); - } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, undefined, comparator) - : []; - }); - - /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to convert. - * @param {string} [separator=','] The element separator. - * @returns {string} Returns the joined string. - * @example - * - * _.join(['a', 'b', 'c'], '~'); - * // => 'a~b~c' - */ - function join(array, separator) { - return array == null ? '' : nativeJoin.call(array, separator); - } - - /** - * Gets the last element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - */ - function last(array) { - var length = array == null ? 0 : array.length; - return length ? array[length - 1] : undefined; - } - - /** - * This method is like `_.indexOf` except that it iterates over elements of - * `array` from right to left. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.lastIndexOf([1, 2, 1, 2], 2); - * // => 3 - * - * // Search from the `fromIndex`. - * _.lastIndexOf([1, 2, 1, 2], 2, 2); - * // => 1 - */ - function lastIndexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); - } - return value === value - ? strictLastIndexOf(array, value, index) - : baseFindIndex(array, baseIsNaN, index, true); - } - - /** - * Gets the element at index `n` of `array`. If `n` is negative, the nth - * element from the end is returned. - * - * @static - * @memberOf _ - * @since 4.11.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=0] The index of the element to return. - * @returns {*} Returns the nth element of `array`. - * @example - * - * var array = ['a', 'b', 'c', 'd']; - * - * _.nth(array, 1); - * // => 'b' - * - * _.nth(array, -2); - * // => 'c'; - */ - function nth(array, n) { - return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; - } - - /** - * Removes all given values from `array` using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` - * to remove elements from an array by predicate. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {...*} [values] The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = ['a', 'b', 'c', 'a', 'b', 'c']; - * - * _.pull(array, 'a', 'c'); - * console.log(array); - * // => ['b', 'b'] - */ - var pull = baseRest(pullAll); - - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = ['a', 'b', 'c', 'a', 'b', 'c']; - * - * _.pullAll(array, ['a', 'c']); - * console.log(array); - * // => ['b', 'b'] - */ - function pullAll(array, values) { - return (array && array.length && values && values.length) - ? basePullAll(array, values) - : array; - } - - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to generate the criterion - * by which they're compared. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - function pullAllBy(array, values, iteratee) { - return (array && array.length && values && values.length) - ? basePullAll(array, values, getIteratee(iteratee, 2)) - : array; - } - - /** - * This method is like `_.pullAll` except that it accepts `comparator` which - * is invoked to compare elements of `array` to `values`. The comparator is - * invoked with two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 4.6.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - function pullAllWith(array, values, comparator) { - return (array && array.length && values && values.length) - ? basePullAll(array, values, undefined, comparator) - : array; - } - - /** - * Removes elements from `array` corresponding to `indexes` and returns an - * array of removed elements. - * - * **Note:** Unlike `_.at`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {...(number|number[])} [indexes] The indexes of elements to remove. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = ['a', 'b', 'c', 'd']; - * var pulled = _.pullAt(array, [1, 3]); - * - * console.log(array); - * // => ['a', 'c'] - * - * console.log(pulled); - * // => ['b', 'd'] - */ - var pullAt = flatRest(function(array, indexes) { - var length = array == null ? 0 : array.length, - result = baseAt(array, indexes); - - basePullAt(array, arrayMap(indexes, function(index) { - return isIndex(index, length) ? +index : index; - }).sort(compareAscending)); - - return result; - }); - - /** - * Removes all elements from `array` that `predicate` returns truthy for - * and returns an array of the removed elements. The predicate is invoked - * with three arguments: (value, index, array). - * - * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` - * to pull elements from an array by value. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [1, 2, 3, 4]; - * var evens = _.remove(array, function(n) { - * return n % 2 == 0; - * }); - * - * console.log(array); - * // => [1, 3] - * - * console.log(evens); - * // => [2, 4] - */ - function remove(array, predicate) { - var result = []; - if (!(array && array.length)) { - return result; - } - var index = -1, - indexes = [], - length = array.length; - - predicate = getIteratee(predicate, 3); - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result.push(value); - indexes.push(index); - } - } - basePullAt(array, indexes); - return result; - } - - /** - * Reverses `array` so that the first element becomes the last, the second - * element becomes the second to last, and so on. - * - * **Note:** This method mutates `array` and is based on - * [`Array#reverse`](https://mdn.io/Array/reverse). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.reverse(array); - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - function reverse(array) { - return array == null ? array : nativeReverse.call(array); - } - - /** - * Creates a slice of `array` from `start` up to, but not including, `end`. - * - * **Note:** This method is used instead of - * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are - * returned. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function slice(array, start, end) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { - start = 0; - end = length; - } - else { - start = start == null ? 0 : toInteger(start); - end = end === undefined ? length : toInteger(end); - } - return baseSlice(array, start, end); - } - - /** - * Uses a binary search to determine the lowest index at which `value` - * should be inserted into `array` in order to maintain its sort order. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - */ - function sortedIndex(array, value) { - return baseSortedIndex(array, value); - } - - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * var objects = [{ 'x': 4 }, { 'x': 5 }]; - * - * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); - * // => 0 - * - * // The `_.property` iteratee shorthand. - * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); - * // => 0 - */ - function sortedIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); - } - - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedIndexOf([4, 5, 5, 5, 6], 5); - * // => 1 - */ - function sortedIndexOf(array, value) { - var length = array == null ? 0 : array.length; - if (length) { - var index = baseSortedIndex(array, value); - if (index < length && eq(array[index], value)) { - return index; - } - } - return -1; - } - - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedLastIndex([4, 5, 5, 5, 6], 5); - * // => 4 - */ - function sortedLastIndex(array, value) { - return baseSortedIndex(array, value, true); - } - - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * var objects = [{ 'x': 4 }, { 'x': 5 }]; - * - * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); - * // => 1 - * - * // The `_.property` iteratee shorthand. - * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); - * // => 1 - */ - function sortedLastIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); - } - - /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); - * // => 3 - */ - function sortedLastIndexOf(array, value) { - var length = array == null ? 0 : array.length; - if (length) { - var index = baseSortedIndex(array, value, true) - 1; - if (eq(array[index], value)) { - return index; - } - } - return -1; - } - - /** - * This method is like `_.uniq` except that it's designed and optimized - * for sorted arrays. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.sortedUniq([1, 1, 2]); - * // => [1, 2] - */ - function sortedUniq(array) { - return (array && array.length) - ? baseSortedUniq(array) - : []; - } - - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.3] - */ - function sortedUniqBy(array, iteratee) { - return (array && array.length) - ? baseSortedUniq(array, getIteratee(iteratee, 2)) - : []; - } - - /** - * Gets all but the first element of `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.tail([1, 2, 3]); - * // => [2, 3] - */ - function tail(array) { - var length = array == null ? 0 : array.length; - return length ? baseSlice(array, 1, length) : []; - } - - /** - * Creates a slice of `array` with `n` elements taken from the beginning. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.take([1, 2, 3]); - * // => [1] - * - * _.take([1, 2, 3], 2); - * // => [1, 2] - * - * _.take([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.take([1, 2, 3], 0); - * // => [] - */ - function take(array, n, guard) { - if (!(array && array.length)) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - return baseSlice(array, 0, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` with `n` elements taken from the end. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRight([1, 2, 3]); - * // => [3] - * - * _.takeRight([1, 2, 3], 2); - * // => [2, 3] - * - * _.takeRight([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.takeRight([1, 2, 3], 0); - * // => [] - */ - function takeRight(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, n < 0 ? 0 : n, length); - } - - /** - * Creates a slice of `array` with elements taken from the end. Elements are - * taken until `predicate` returns falsey. The predicate is invoked with - * three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.takeRightWhile(users, function(o) { return !o.active; }); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.matches` iteratee shorthand. - * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); - * // => objects for ['pebbles'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.takeRightWhile(users, ['active', false]); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.property` iteratee shorthand. - * _.takeRightWhile(users, 'active'); - * // => [] - */ - function takeRightWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), false, true) - : []; - } - - /** - * Creates a slice of `array` with elements taken from the beginning. Elements - * are taken until `predicate` returns falsey. The predicate is invoked with - * three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.takeWhile(users, function(o) { return !o.active; }); - * // => objects for ['barney', 'fred'] - * - * // The `_.matches` iteratee shorthand. - * _.takeWhile(users, { 'user': 'barney', 'active': false }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.takeWhile(users, ['active', false]); - * // => objects for ['barney', 'fred'] - * - * // The `_.property` iteratee shorthand. - * _.takeWhile(users, 'active'); - * // => [] - */ - function takeWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3)) - : []; - } - - /** - * Creates an array of unique values, in order, from all given arrays using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.union([2], [1, 2]); - * // => [2, 1] - */ - var union = baseRest(function(arrays) { - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); - }); - - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by - * which uniqueness is computed. Result values are chosen from the first - * array in which the value occurs. The iteratee is invoked with one argument: - * (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.unionBy([2.1], [1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // The `_.property` iteratee shorthand. - * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - var unionBy = baseRest(function(arrays) { - var iteratee = last(arrays); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); - }); - - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. Result values are chosen from - * the first array in which the value occurs. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - var unionWith = baseRest(function(arrays) { - var comparator = last(arrays); - comparator = typeof comparator == 'function' ? comparator : undefined; - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); - }); - - /** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurrence of each element - * is kept. The order of result values is determined by the order they occur - * in the array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.uniq([2, 1, 2]); - * // => [2, 1] - */ - function uniq(array) { - return (array && array.length) ? baseUniq(array) : []; - } - - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The order of result values is determined by the - * order they occur in the array. The iteratee is invoked with one argument: - * (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // The `_.property` iteratee shorthand. - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - function uniqBy(array, iteratee) { - return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; - } - - /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The order of result values is - * determined by the order they occur in the array.The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - function uniqWith(array, comparator) { - comparator = typeof comparator == 'function' ? comparator : undefined; - return (array && array.length) ? baseUniq(array, undefined, comparator) : []; - } - - /** - * This method is like `_.zip` except that it accepts an array of grouped - * elements and creates an array regrouping the elements to their pre-zip - * configuration. - * - * @static - * @memberOf _ - * @since 1.2.0 - * @category Array - * @param {Array} array The array of grouped elements to process. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); - * // => [['a', 1, true], ['b', 2, false]] - * - * _.unzip(zipped); - * // => [['a', 'b'], [1, 2], [true, false]] - */ - function unzip(array) { - if (!(array && array.length)) { - return []; - } - var length = 0; - array = arrayFilter(array, function(group) { - if (isArrayLikeObject(group)) { - length = nativeMax(group.length, length); - return true; - } - }); - return baseTimes(length, function(index) { - return arrayMap(array, baseProperty(index)); - }); - } - - /** - * This method is like `_.unzip` except that it accepts `iteratee` to specify - * how regrouped values should be combined. The iteratee is invoked with the - * elements of each group: (...group). - * - * @static - * @memberOf _ - * @since 3.8.0 - * @category Array - * @param {Array} array The array of grouped elements to process. - * @param {Function} [iteratee=_.identity] The function to combine - * regrouped values. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip([1, 2], [10, 20], [100, 200]); - * // => [[1, 10, 100], [2, 20, 200]] - * - * _.unzipWith(zipped, _.add); - * // => [3, 30, 300] - */ - function unzipWith(array, iteratee) { - if (!(array && array.length)) { - return []; - } - var result = unzip(array); - if (iteratee == null) { - return result; - } - return arrayMap(result, function(group) { - return apply(iteratee, undefined, group); - }); - } - - /** - * Creates an array excluding all given values using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.pull`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...*} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @see _.difference, _.xor - * @example - * - * _.without([2, 1, 2, 3], 1, 2); - * // => [3] - */ - var without = baseRest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, values) - : []; - }); - - /** - * Creates an array of unique values that is the - * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) - * of the given arrays. The order of result values is determined by the order - * they occur in the arrays. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of filtered values. - * @see _.difference, _.without - * @example - * - * _.xor([2, 1], [2, 3]); - * // => [1, 3] - */ - var xor = baseRest(function(arrays) { - return baseXor(arrayFilter(arrays, isArrayLikeObject)); - }); - - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by - * which by which they're compared. The order of result values is determined - * by the order they occur in the arrays. The iteratee is invoked with one - * argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [1.2, 3.4] - * - * // The `_.property` iteratee shorthand. - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - var xorBy = baseRest(function(arrays) { - var iteratee = last(arrays); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); - }); - - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The order of result values is - * determined by the order they occur in the arrays. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - var xorWith = baseRest(function(arrays) { - var comparator = last(arrays); - comparator = typeof comparator == 'function' ? comparator : undefined; - return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); - }); - - /** - * Creates an array of grouped elements, the first of which contains the - * first elements of the given arrays, the second of which contains the - * second elements of the given arrays, and so on. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zip(['a', 'b'], [1, 2], [true, false]); - * // => [['a', 1, true], ['b', 2, false]] - */ - var zip = baseRest(unzip); - - /** - * This method is like `_.fromPairs` except that it accepts two arrays, - * one of property identifiers and one of corresponding values. - * - * @static - * @memberOf _ - * @since 0.4.0 - * @category Array - * @param {Array} [props=[]] The property identifiers. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example - * - * _.zipObject(['a', 'b'], [1, 2]); - * // => { 'a': 1, 'b': 2 } - */ - function zipObject(props, values) { - return baseZipObject(props || [], values || [], assignValue); - } - - /** - * This method is like `_.zipObject` except that it supports property paths. - * - * @static - * @memberOf _ - * @since 4.1.0 - * @category Array - * @param {Array} [props=[]] The property identifiers. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example - * - * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); - * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } - */ - function zipObjectDeep(props, values) { - return baseZipObject(props || [], values || [], baseSet); - } - - /** - * This method is like `_.zip` except that it accepts `iteratee` to specify - * how grouped values should be combined. The iteratee is invoked with the - * elements of each group: (...group). - * - * @static - * @memberOf _ - * @since 3.8.0 - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @param {Function} [iteratee=_.identity] The function to combine - * grouped values. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { - * return a + b + c; - * }); - * // => [111, 222] - */ - var zipWith = baseRest(function(arrays) { - var length = arrays.length, - iteratee = length > 1 ? arrays[length - 1] : undefined; - - iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; - return unzipWith(arrays, iteratee); - }); - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` wrapper instance that wraps `value` with explicit method - * chain sequences enabled. The result of such sequences must be unwrapped - * with `_#value`. - * - * @static - * @memberOf _ - * @since 1.3.0 - * @category Seq - * @param {*} value The value to wrap. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'pebbles', 'age': 1 } - * ]; - * - * var youngest = _ - * .chain(users) - * .sortBy('age') - * .map(function(o) { - * return o.user + ' is ' + o.age; - * }) - * .head() - * .value(); - * // => 'pebbles is 1' - */ - function chain(value) { - var result = lodash(value); - result.__chain__ = true; - return result; - } - - /** - * This method invokes `interceptor` and returns `value`. The interceptor - * is invoked with one argument; (value). The purpose of this method is to - * "tap into" a method chain sequence in order to modify intermediate results. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @returns {*} Returns `value`. - * @example - * - * _([1, 2, 3]) - * .tap(function(array) { - * // Mutate input array. - * array.pop(); - * }) - * .reverse() - * .value(); - * // => [2, 1] - */ - function tap(value, interceptor) { - interceptor(value); - return value; - } - - /** - * This method is like `_.tap` except that it returns the result of `interceptor`. - * The purpose of this method is to "pass thru" values replacing intermediate - * results in a method chain sequence. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Seq - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @returns {*} Returns the result of `interceptor`. - * @example - * - * _(' abc ') - * .chain() - * .trim() - * .thru(function(value) { - * return [value]; - * }) - * .value(); - * // => ['abc'] - */ - function thru(value, interceptor) { - return interceptor(value); - } - - /** - * This method is the wrapper version of `_.at`. - * - * @name at - * @memberOf _ - * @since 1.0.0 - * @category Seq - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; - * - * _(object).at(['a[0].b.c', 'a[1]']).value(); - * // => [3, 4] - */ - var wrapperAt = flatRest(function(paths) { - var length = paths.length, - start = length ? paths[0] : 0, - value = this.__wrapped__, - interceptor = function(object) { return baseAt(object, paths); }; - - if (length > 1 || this.__actions__.length || - !(value instanceof LazyWrapper) || !isIndex(start)) { - return this.thru(interceptor); - } - value = value.slice(start, +start + (length ? 1 : 0)); - value.__actions__.push({ - 'func': thru, - 'args': [interceptor], - 'thisArg': undefined - }); - return new LodashWrapper(value, this.__chain__).thru(function(array) { - if (length && !array.length) { - array.push(undefined); - } - return array; - }); - }); - - /** - * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. - * - * @name chain - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // A sequence without explicit chaining. - * _(users).head(); - * // => { 'user': 'barney', 'age': 36 } - * - * // A sequence with explicit chaining. - * _(users) - * .chain() - * .head() - * .pick('user') - * .value(); - * // => { 'user': 'barney' } - */ - function wrapperChain() { - return chain(this); - } - - /** - * Executes the chain sequence and returns the wrapped result. - * - * @name commit - * @memberOf _ - * @since 3.2.0 - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapped = _(array).push(3); - * - * console.log(array); - * // => [1, 2] - * - * wrapped = wrapped.commit(); - * console.log(array); - * // => [1, 2, 3] - * - * wrapped.last(); - * // => 3 - * - * console.log(array); - * // => [1, 2, 3] - */ - function wrapperCommit() { - return new LodashWrapper(this.value(), this.__chain__); - } - - /** - * Gets the next value on a wrapped object following the - * [iterator protocol](https://mdn.io/iteration_protocols#iterator). - * - * @name next - * @memberOf _ - * @since 4.0.0 - * @category Seq - * @returns {Object} Returns the next iterator value. - * @example - * - * var wrapped = _([1, 2]); - * - * wrapped.next(); - * // => { 'done': false, 'value': 1 } - * - * wrapped.next(); - * // => { 'done': false, 'value': 2 } - * - * wrapped.next(); - * // => { 'done': true, 'value': undefined } - */ - function wrapperNext() { - if (this.__values__ === undefined) { - this.__values__ = toArray(this.value()); - } - var done = this.__index__ >= this.__values__.length, - value = done ? undefined : this.__values__[this.__index__++]; - - return { 'done': done, 'value': value }; - } - - /** - * Enables the wrapper to be iterable. - * - * @name Symbol.iterator - * @memberOf _ - * @since 4.0.0 - * @category Seq - * @returns {Object} Returns the wrapper object. - * @example - * - * var wrapped = _([1, 2]); - * - * wrapped[Symbol.iterator]() === wrapped; - * // => true - * - * Array.from(wrapped); - * // => [1, 2] - */ - function wrapperToIterator() { - return this; - } - - /** - * Creates a clone of the chain sequence planting `value` as the wrapped value. - * - * @name plant - * @memberOf _ - * @since 3.2.0 - * @category Seq - * @param {*} value The value to plant. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var wrapped = _([1, 2]).map(square); - * var other = wrapped.plant([3, 4]); - * - * other.value(); - * // => [9, 16] - * - * wrapped.value(); - * // => [1, 4] - */ - function wrapperPlant(value) { - var result, - parent = this; - - while (parent instanceof baseLodash) { - var clone = wrapperClone(parent); - clone.__index__ = 0; - clone.__values__ = undefined; - if (result) { - previous.__wrapped__ = clone; - } else { - result = clone; - } - var previous = clone; - parent = parent.__wrapped__; - } - previous.__wrapped__ = value; - return result; - } - - /** - * This method is the wrapper version of `_.reverse`. - * - * **Note:** This method mutates the wrapped array. - * - * @name reverse - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2, 3]; - * - * _(array).reverse().value() - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - function wrapperReverse() { - var value = this.__wrapped__; - if (value instanceof LazyWrapper) { - var wrapped = value; - if (this.__actions__.length) { - wrapped = new LazyWrapper(this); - } - wrapped = wrapped.reverse(); - wrapped.__actions__.push({ - 'func': thru, - 'args': [reverse], - 'thisArg': undefined - }); - return new LodashWrapper(wrapped, this.__chain__); - } - return this.thru(reverse); - } - - /** - * Executes the chain sequence to resolve the unwrapped value. - * - * @name value - * @memberOf _ - * @since 0.1.0 - * @alias toJSON, valueOf - * @category Seq - * @returns {*} Returns the resolved unwrapped value. - * @example - * - * _([1, 2, 3]).value(); - * // => [1, 2, 3] - */ - function wrapperValue() { - return baseWrapperValue(this.__wrapped__, this.__actions__); - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The corresponding value of - * each key is the number of times the key was returned by `iteratee`. The - * iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.countBy([6.1, 4.2, 6.3], Math.floor); - * // => { '4': 1, '6': 2 } - * - * // The `_.property` iteratee shorthand. - * _.countBy(['one', 'two', 'three'], 'length'); - * // => { '3': 2, '5': 1 } - */ - var countBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - ++result[key]; - } else { - baseAssignValue(result, key, 1); - } - }); - - /** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * Iteration is stopped once `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * **Note:** This method returns `true` for - * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because - * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of - * elements of empty collections. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.every(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.every(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.every(users, 'active'); - * // => false - */ - function every(collection, predicate, guard) { - var func = isArray(collection) ? arrayEvery : baseEvery; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; - } - return func(collection, getIteratee(predicate, 3)); - } - - /** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * **Note:** Unlike `_.remove`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @see _.reject - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * _.filter(users, function(o) { return !o.active; }); - * // => objects for ['fred'] - * - * // The `_.matches` iteratee shorthand. - * _.filter(users, { 'age': 36, 'active': true }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.filter(users, ['active', false]); - * // => objects for ['fred'] - * - * // The `_.property` iteratee shorthand. - * _.filter(users, 'active'); - * // => objects for ['barney'] - */ - function filter(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, getIteratee(predicate, 3)); - } - - /** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=0] The index to search from. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; - * - * _.find(users, function(o) { return o.age < 40; }); - * // => object for 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.find(users, { 'age': 1, 'active': true }); - * // => object for 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.find(users, ['active', false]); - * // => object for 'fred' - * - * // The `_.property` iteratee shorthand. - * _.find(users, 'active'); - * // => object for 'barney' - */ - var find = createFind(findIndex); - - /** - * This method is like `_.find` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=collection.length-1] The index to search from. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * _.findLast([1, 2, 3, 4], function(n) { - * return n % 2 == 1; - * }); - * // => 3 - */ - var findLast = createFind(findLastIndex); - - /** - * Creates a flattened array of values by running each element in `collection` - * thru `iteratee` and flattening the mapped results. The iteratee is invoked - * with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [n, n]; - * } - * - * _.flatMap([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - function flatMap(collection, iteratee) { - return baseFlatten(map(collection, iteratee), 1); - } - - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @static - * @memberOf _ - * @since 4.7.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - function flatMapDeep(collection, iteratee) { - return baseFlatten(map(collection, iteratee), INFINITY); - } - - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @static - * @memberOf _ - * @since 4.7.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {number} [depth=1] The maximum recursion depth. - * @returns {Array} Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - function flatMapDepth(collection, iteratee, depth) { - depth = depth === undefined ? 1 : toInteger(depth); - return baseFlatten(map(collection, iteratee), depth); - } - - /** - * Iterates over elements of `collection` and invokes `iteratee` for each element. - * The iteratee is invoked with three arguments: (value, index|key, collection). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" - * property are iterated like arrays. To avoid this behavior use `_.forIn` - * or `_.forOwn` for object iteration. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @alias each - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @see _.forEachRight - * @example - * - * _.forEach([1, 2], function(value) { - * console.log(value); - * }); - * // => Logs `1` then `2`. - * - * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a' then 'b' (iteration order is not guaranteed). - */ - function forEach(collection, iteratee) { - var func = isArray(collection) ? arrayEach : baseEach; - return func(collection, getIteratee(iteratee, 3)); - } - - /** - * This method is like `_.forEach` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @alias eachRight - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @see _.forEach - * @example - * - * _.forEachRight([1, 2], function(value) { - * console.log(value); - * }); - * // => Logs `2` then `1`. - */ - function forEachRight(collection, iteratee) { - var func = isArray(collection) ? arrayEachRight : baseEachRight; - return func(collection, getIteratee(iteratee, 3)); - } - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The order of grouped values - * is determined by the order they occur in `collection`. The corresponding - * value of each key is an array of elements responsible for generating the - * key. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.groupBy([6.1, 4.2, 6.3], Math.floor); - * // => { '4': [4.2], '6': [6.1, 6.3] } - * - * // The `_.property` iteratee shorthand. - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } - */ - var groupBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - result[key].push(value); - } else { - baseAssignValue(result, key, [value]); - } - }); - - /** - * Checks if `value` is in `collection`. If `collection` is a string, it's - * checked for a substring of `value`, otherwise - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * is used for equality comparisons. If `fromIndex` is negative, it's used as - * the offset from the end of `collection`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. - * @returns {boolean} Returns `true` if `value` is found, else `false`. - * @example - * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'a': 1, 'b': 2 }, 1); - * // => true - * - * _.includes('abcd', 'bc'); - * // => true - */ - function includes(collection, value, fromIndex, guard) { - collection = isArrayLike(collection) ? collection : values(collection); - fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; - - var length = collection.length; - if (fromIndex < 0) { - fromIndex = nativeMax(length + fromIndex, 0); - } - return isString(collection) - ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) - : (!!length && baseIndexOf(collection, value, fromIndex) > -1); - } - - /** - * Invokes the method at `path` of each element in `collection`, returning - * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `path` is a function, it's invoked - * for, and `this` bound to, each element in `collection`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|string} path The path of the method to invoke or - * the function invoked per iteration. - * @param {...*} [args] The arguments to invoke each method with. - * @returns {Array} Returns the array of results. - * @example - * - * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); - * // => [[1, 5, 7], [1, 2, 3]] - * - * _.invokeMap([123, 456], String.prototype.split, ''); - * // => [['1', '2', '3'], ['4', '5', '6']] - */ - var invokeMap = baseRest(function(collection, path, args) { - var index = -1, - isFunc = typeof path == 'function', - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value) { - result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); - }); - return result; - }); - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The corresponding value of - * each key is the last element responsible for generating the key. The - * iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * var array = [ - * { 'dir': 'left', 'code': 97 }, - * { 'dir': 'right', 'code': 100 } - * ]; - * - * _.keyBy(array, function(o) { - * return String.fromCharCode(o.code); - * }); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - * - * _.keyBy(array, 'dir'); - * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } - */ - var keyBy = createAggregator(function(result, value, key) { - baseAssignValue(result, key, value); - }); - - /** - * Creates an array of values by running each element in `collection` thru - * `iteratee`. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. - * - * The guarded methods are: - * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, - * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, - * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, - * `template`, `trim`, `trimEnd`, `trimStart`, and `words` - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - * @example - * - * function square(n) { - * return n * n; - * } - * - * _.map([4, 8], square); - * // => [16, 64] - * - * _.map({ 'a': 4, 'b': 8 }, square); - * // => [16, 64] (iteration order is not guaranteed) - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * // The `_.property` iteratee shorthand. - * _.map(users, 'user'); - * // => ['barney', 'fred'] - */ - function map(collection, iteratee) { - var func = isArray(collection) ? arrayMap : baseMap; - return func(collection, getIteratee(iteratee, 3)); - } - - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] - * The iteratees to sort by. - * @param {string[]} [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // Sort by `user` in ascending order and by `age` in descending order. - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] - */ - function orderBy(collection, iteratees, orders, guard) { - if (collection == null) { - return []; - } - if (!isArray(iteratees)) { - iteratees = iteratees == null ? [] : [iteratees]; - } - orders = guard ? undefined : orders; - if (!isArray(orders)) { - orders = orders == null ? [] : [orders]; - } - return baseOrderBy(collection, iteratees, orders); - } - - /** - * Creates an array of elements split into two groups, the first of which - * contains elements `predicate` returns truthy for, the second of which - * contains elements `predicate` returns falsey for. The predicate is - * invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the array of grouped elements. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true }, - * { 'user': 'pebbles', 'age': 1, 'active': false } - * ]; - * - * _.partition(users, function(o) { return o.active; }); - * // => objects for [['fred'], ['barney', 'pebbles']] - * - * // The `_.matches` iteratee shorthand. - * _.partition(users, { 'age': 1, 'active': false }); - * // => objects for [['pebbles'], ['barney', 'fred']] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.partition(users, ['active', false]); - * // => objects for [['barney', 'pebbles'], ['fred']] - * - * // The `_.property` iteratee shorthand. - * _.partition(users, 'active'); - * // => objects for [['fred'], ['barney', 'pebbles']] - */ - var partition = createAggregator(function(result, value, key) { - result[key ? 0 : 1].push(value); - }, function() { return [[], []]; }); - - /** - * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` thru `iteratee`, where each successive - * invocation is supplied the return value of the previous. If `accumulator` - * is not given, the first element of `collection` is used as the initial - * value. The iteratee is invoked with four arguments: - * (accumulator, value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.reduce`, `_.reduceRight`, and `_.transform`. - * - * The guarded methods are: - * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, - * and `sortBy` - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @returns {*} Returns the accumulated value. - * @see _.reduceRight - * @example - * - * _.reduce([1, 2], function(sum, n) { - * return sum + n; - * }, 0); - * // => 3 - * - * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * return result; - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) - */ - function reduce(collection, iteratee, accumulator) { - var func = isArray(collection) ? arrayReduce : baseReduce, - initAccum = arguments.length < 3; - - return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); - } - - /** - * This method is like `_.reduce` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @returns {*} Returns the accumulated value. - * @see _.reduce - * @example - * - * var array = [[0, 1], [2, 3], [4, 5]]; - * - * _.reduceRight(array, function(flattened, other) { - * return flattened.concat(other); - * }, []); - * // => [4, 5, 2, 3, 0, 1] - */ - function reduceRight(collection, iteratee, accumulator) { - var func = isArray(collection) ? arrayReduceRight : baseReduce, - initAccum = arguments.length < 3; - - return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); - } - - /** - * The opposite of `_.filter`; this method returns the elements of `collection` - * that `predicate` does **not** return truthy for. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @see _.filter - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } - * ]; - * - * _.reject(users, function(o) { return !o.active; }); - * // => objects for ['fred'] - * - * // The `_.matches` iteratee shorthand. - * _.reject(users, { 'age': 40, 'active': true }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.reject(users, ['active', false]); - * // => objects for ['fred'] - * - * // The `_.property` iteratee shorthand. - * _.reject(users, 'active'); - * // => objects for ['barney'] - */ - function reject(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, negate(getIteratee(predicate, 3))); - } - - /** - * Gets a random element from `collection`. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Collection - * @param {Array|Object} collection The collection to sample. - * @returns {*} Returns the random element. - * @example - * - * _.sample([1, 2, 3, 4]); - * // => 2 - */ - function sample(collection) { - var func = isArray(collection) ? arraySample : baseSample; - return func(collection); - } - - /** - * Gets `n` random elements at unique keys from `collection` up to the - * size of `collection`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to sample. - * @param {number} [n=1] The number of elements to sample. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the random elements. - * @example - * - * _.sampleSize([1, 2, 3], 2); - * // => [3, 1] - * - * _.sampleSize([1, 2, 3], 4); - * // => [2, 3, 1] - */ - function sampleSize(collection, n, guard) { - if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { - n = 1; - } else { - n = toInteger(n); - } - var func = isArray(collection) ? arraySampleSize : baseSampleSize; - return func(collection, n); - } - - /** - * Creates an array of shuffled values, using a version of the - * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. - * @example - * - * _.shuffle([1, 2, 3, 4]); - * // => [4, 1, 3, 2] - */ - function shuffle(collection) { - var func = isArray(collection) ? arrayShuffle : baseShuffle; - return func(collection); - } - - /** - * Gets the size of `collection` by returning its length for array-like - * values or the number of own enumerable string keyed properties for objects. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @returns {number} Returns the collection size. - * @example - * - * _.size([1, 2, 3]); - * // => 3 - * - * _.size({ 'a': 1, 'b': 2 }); - * // => 2 - * - * _.size('pebbles'); - * // => 7 - */ - function size(collection) { - if (collection == null) { - return 0; - } - if (isArrayLike(collection)) { - return isString(collection) ? stringSize(collection) : collection.length; - } - var tag = getTag(collection); - if (tag == mapTag || tag == setTag) { - return collection.size; - } - return baseKeys(collection).length; - } - - /** - * Checks if `predicate` returns truthy for **any** element of `collection`. - * Iteration is stopped once `predicate` returns truthy. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - * @example - * - * _.some([null, 0, 'yes', false], Boolean); - * // => true - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.some(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.some(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.some(users, 'active'); - * // => true - */ - function some(collection, predicate, guard) { - var func = isArray(collection) ? arraySome : baseSome; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; - } - return func(collection, getIteratee(predicate, 3)); - } - - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection thru each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {...(Function|Function[])} [iteratees=[_.identity]] - * The iteratees to sort by. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, [function(o) { return o.user; }]); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] - */ - var sortBy = baseRest(function(collection, iteratees) { - if (collection == null) { - return []; - } - var length = iteratees.length; - if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { - iteratees = []; - } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { - iteratees = [iteratees[0]]; - } - return baseOrderBy(collection, baseFlatten(iteratees, 1), []); - }); - - /*------------------------------------------------------------------------*/ - - /** - * Gets the timestamp of the number of milliseconds that have elapsed since - * the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Date - * @returns {number} Returns the timestamp. - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => Logs the number of milliseconds it took for the deferred invocation. - */ - var now = ctxNow || function() { - return root.Date.now(); - }; - - /*------------------------------------------------------------------------*/ - - /** - * The opposite of `_.before`; this method creates a function that invokes - * `func` once it's called `n` or more times. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {number} n The number of calls before `func` is invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var saves = ['profile', 'settings']; - * - * var done = _.after(saves.length, function() { - * console.log('done saving!'); - * }); - * - * _.forEach(saves, function(type) { - * asyncSave({ 'type': type, 'complete': done }); - * }); - * // => Logs 'done saving!' after the two async saves have completed. - */ - function after(n, func) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n < 1) { - return func.apply(this, arguments); - } - }; - } - - /** - * Creates a function that invokes `func`, with up to `n` arguments, - * ignoring any additional arguments. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to cap arguments for. - * @param {number} [n=func.length] The arity cap. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new capped function. - * @example - * - * _.map(['6', '8', '10'], _.ary(parseInt, 1)); - * // => [6, 8, 10] - */ - function ary(func, n, guard) { - n = guard ? undefined : n; - n = (func && n == null) ? func.length : n; - return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); - } - - /** - * Creates a function that invokes `func`, with the `this` binding and arguments - * of the created function, while it's called less than `n` times. Subsequent - * calls to the created function return the result of the last `func` invocation. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {number} n The number of calls at which `func` is no longer invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * jQuery(element).on('click', _.before(5, addContactToList)); - * // => Allows adding up to 4 contacts to the list. - */ - function before(n, func) { - var result; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n > 0) { - result = func.apply(this, arguments); - } - if (n <= 1) { - func = undefined; - } - return result; - }; - } - - /** - * Creates a function that invokes `func` with the `this` binding of `thisArg` - * and `partials` prepended to the arguments it receives. - * - * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for partially applied arguments. - * - * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" - * property of bound functions. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * function greet(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * - * var object = { 'user': 'fred' }; - * - * var bound = _.bind(greet, object, 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * // Bound with placeholders. - * var bound = _.bind(greet, object, _, '!'); - * bound('hi'); - * // => 'hi fred!' - */ - var bind = baseRest(function(func, thisArg, partials) { - var bitmask = WRAP_BIND_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, getHolder(bind)); - bitmask |= WRAP_PARTIAL_FLAG; - } - return createWrap(func, bitmask, thisArg, partials, holders); - }); - - /** - * Creates a function that invokes the method at `object[key]` with `partials` - * prepended to the arguments it receives. - * - * This method differs from `_.bind` by allowing bound functions to reference - * methods that may be redefined or don't yet exist. See - * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) - * for more details. - * - * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * @static - * @memberOf _ - * @since 0.10.0 - * @category Function - * @param {Object} object The object to invoke the method on. - * @param {string} key The key of the method. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var object = { - * 'user': 'fred', - * 'greet': function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * }; - * - * var bound = _.bindKey(object, 'greet', 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * object.greet = function(greeting, punctuation) { - * return greeting + 'ya ' + this.user + punctuation; - * }; - * - * bound('!'); - * // => 'hiya fred!' - * - * // Bound with placeholders. - * var bound = _.bindKey(object, 'greet', _, '!'); - * bound('hi'); - * // => 'hiya fred!' - */ - var bindKey = baseRest(function(object, key, partials) { - var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, getHolder(bindKey)); - bitmask |= WRAP_PARTIAL_FLAG; - } - return createWrap(key, bitmask, object, partials, holders); - }); - - /** - * Creates a function that accepts arguments of `func` and either invokes - * `func` returning its result, if at least `arity` number of arguments have - * been provided, or returns a function that accepts the remaining `func` - * arguments, and so on. The arity of `func` may be specified if `func.length` - * is not sufficient. - * - * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for provided arguments. - * - * **Note:** This method doesn't set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curry(abc); - * - * curried(1)(2)(3); - * // => [1, 2, 3] - * - * curried(1, 2)(3); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // Curried with placeholders. - * curried(1)(_, 3)(2); - * // => [1, 2, 3] - */ - function curry(func, arity, guard) { - arity = guard ? undefined : arity; - var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curry.placeholder; - return result; - } - - /** - * This method is like `_.curry` except that arguments are applied to `func` - * in the manner of `_.partialRight` instead of `_.partial`. - * - * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for provided arguments. - * - * **Note:** This method doesn't set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curryRight(abc); - * - * curried(3)(2)(1); - * // => [1, 2, 3] - * - * curried(2, 3)(1); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // Curried with placeholders. - * curried(3)(1, _)(2); - * // => [1, 2, 3] - */ - function curryRight(func, arity, guard) { - arity = guard ? undefined : arity; - var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curryRight.placeholder; - return result; - } - - /** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed `func` invocations and a `flush` method to immediately invoke them. - * Provide `options` to indicate whether `func` should be invoked on the - * leading and/or trailing edge of the `wait` timeout. The `func` is invoked - * with the last arguments provided to the debounced function. Subsequent - * calls to the debounced function return the result of the last `func` - * invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the debounced function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=false] - * Specify invoking on the leading edge of the timeout. - * @param {number} [options.maxWait] - * The maximum time `func` is allowed to be delayed before it's invoked. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // Invoke `sendMail` when clicked, debouncing subsequent calls. - * jQuery(element).on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); - * var source = new EventSource('/stream'); - * jQuery(source).on('message', debounced); - * - * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel); - */ - function debounce(func, wait, options) { - var lastArgs, - lastThis, - maxWait, - result, - timerId, - lastCallTime, - lastInvokeTime = 0, - leading = false, - maxing = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = toNumber(wait) || 0; - if (isObject(options)) { - leading = !!options.leading; - maxing = 'maxWait' in options; - maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - - function invokeFunc(time) { - var args = lastArgs, - thisArg = lastThis; - - lastArgs = lastThis = undefined; - lastInvokeTime = time; - result = func.apply(thisArg, args); - return result; - } - - function leadingEdge(time) { - // Reset any `maxWait` timer. - lastInvokeTime = time; - // Start the timer for the trailing edge. - timerId = setTimeout(timerExpired, wait); - // Invoke the leading edge. - return leading ? invokeFunc(time) : result; - } - - function remainingWait(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime, - timeWaiting = wait - timeSinceLastCall; - - return maxing - ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) - : timeWaiting; - } - - function shouldInvoke(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime; - - // Either this is the first call, activity has stopped and we're at the - // trailing edge, the system time has gone backwards and we're treating - // it as the trailing edge, or we've hit the `maxWait` limit. - return (lastCallTime === undefined || (timeSinceLastCall >= wait) || - (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); - } - - function timerExpired() { - var time = now(); - if (shouldInvoke(time)) { - return trailingEdge(time); - } - // Restart the timer. - timerId = setTimeout(timerExpired, remainingWait(time)); - } - - function trailingEdge(time) { - timerId = undefined; - - // Only invoke if we have `lastArgs` which means `func` has been - // debounced at least once. - if (trailing && lastArgs) { - return invokeFunc(time); - } - lastArgs = lastThis = undefined; - return result; - } - - function cancel() { - if (timerId !== undefined) { - clearTimeout(timerId); - } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined; - } - - function flush() { - return timerId === undefined ? result : trailingEdge(now()); - } - - function debounced() { - var time = now(), - isInvoking = shouldInvoke(time); - - lastArgs = arguments; - lastThis = this; - lastCallTime = time; - - if (isInvoking) { - if (timerId === undefined) { - return leadingEdge(lastCallTime); - } - if (maxing) { - // Handle invocations in a tight loop. - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); - } - } - if (timerId === undefined) { - timerId = setTimeout(timerExpired, wait); - } - return result; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; - } - - /** - * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to defer. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.defer(function(text) { - * console.log(text); - * }, 'deferred'); - * // => Logs 'deferred' after one millisecond. - */ - var defer = baseRest(function(func, args) { - return baseDelay(func, 1, args); - }); - - /** - * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.delay(function(text) { - * console.log(text); - * }, 1000, 'later'); - * // => Logs 'later' after one second. - */ - var delay = baseRest(function(func, wait, args) { - return baseDelay(func, toNumber(wait) || 0, args); - }); - - /** - * Creates a function that invokes `func` with arguments reversed. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to flip arguments for. - * @returns {Function} Returns the new flipped function. - * @example - * - * var flipped = _.flip(function() { - * return _.toArray(arguments); - * }); - * - * flipped('a', 'b', 'c', 'd'); - * // => ['d', 'c', 'b', 'a'] - */ - function flip(func) { - return createWrap(func, WRAP_FLIP_FLAG); - } - - /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `clear`, `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; - */ - function memoize(func, resolver) { - if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result) || cache; - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; - } - - // Expose `MapCache`. - memoize.Cache = MapCache; - - /** - * Creates a function that negates the result of the predicate `func`. The - * `func` predicate is invoked with the `this` binding and arguments of the - * created function. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} predicate The predicate to negate. - * @returns {Function} Returns the new negated function. - * @example - * - * function isEven(n) { - * return n % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] - */ - function negate(predicate) { - if (typeof predicate != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function() { - var args = arguments; - switch (args.length) { - case 0: return !predicate.call(this); - case 1: return !predicate.call(this, args[0]); - case 2: return !predicate.call(this, args[0], args[1]); - case 3: return !predicate.call(this, args[0], args[1], args[2]); - } - return !predicate.apply(this, args); - }; - } - - /** - * Creates a function that is restricted to invoking `func` once. Repeat calls - * to the function return the value of the first invocation. The `func` is - * invoked with the `this` binding and arguments of the created function. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // => `createApplication` is invoked once - */ - function once(func) { - return before(2, func); - } - - /** - * Creates a function that invokes `func` with its arguments transformed. - * - * @static - * @since 4.0.0 - * @memberOf _ - * @category Function - * @param {Function} func The function to wrap. - * @param {...(Function|Function[])} [transforms=[_.identity]] - * The argument transforms. - * @returns {Function} Returns the new function. - * @example - * - * function doubled(n) { - * return n * 2; - * } - * - * function square(n) { - * return n * n; - * } - * - * var func = _.overArgs(function(x, y) { - * return [x, y]; - * }, [square, doubled]); - * - * func(9, 3); - * // => [81, 6] - * - * func(10, 5); - * // => [100, 10] - */ - var overArgs = castRest(function(func, transforms) { - transforms = (transforms.length == 1 && isArray(transforms[0])) - ? arrayMap(transforms[0], baseUnary(getIteratee())) - : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); - - var funcsLength = transforms.length; - return baseRest(function(args) { - var index = -1, - length = nativeMin(args.length, funcsLength); - - while (++index < length) { - args[index] = transforms[index].call(this, args[index]); - } - return apply(func, this, args); - }); - }); - - /** - * Creates a function that invokes `func` with `partials` prepended to the - * arguments it receives. This method is like `_.bind` except it does **not** - * alter the `this` binding. - * - * The `_.partial.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method doesn't set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @since 0.2.0 - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * function greet(greeting, name) { - * return greeting + ' ' + name; - * } - * - * var sayHelloTo = _.partial(greet, 'hello'); - * sayHelloTo('fred'); - * // => 'hello fred' - * - * // Partially applied with placeholders. - * var greetFred = _.partial(greet, _, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - */ - var partial = baseRest(function(func, partials) { - var holders = replaceHolders(partials, getHolder(partial)); - return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); - }); - - /** - * This method is like `_.partial` except that partially applied arguments - * are appended to the arguments it receives. - * - * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method doesn't set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * function greet(greeting, name) { - * return greeting + ' ' + name; - * } - * - * var greetFred = _.partialRight(greet, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - * - * // Partially applied with placeholders. - * var sayHelloTo = _.partialRight(greet, 'hello', _); - * sayHelloTo('fred'); - * // => 'hello fred' - */ - var partialRight = baseRest(function(func, partials) { - var holders = replaceHolders(partials, getHolder(partialRight)); - return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); - }); - - /** - * Creates a function that invokes `func` with arguments arranged according - * to the specified `indexes` where the argument value at the first index is - * provided as the first argument, the argument value at the second index is - * provided as the second argument, and so on. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to rearrange arguments for. - * @param {...(number|number[])} indexes The arranged argument indexes. - * @returns {Function} Returns the new function. - * @example - * - * var rearged = _.rearg(function(a, b, c) { - * return [a, b, c]; - * }, [2, 0, 1]); - * - * rearged('b', 'c', 'a') - * // => ['a', 'b', 'c'] - */ - var rearg = flatRest(function(func, indexes) { - return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); - }); - - /** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as - * an array. - * - * **Note:** This method is based on the - * [rest parameter](https://mdn.io/rest_parameters). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.rest(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ - function rest(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = start === undefined ? start : toInteger(start); - return baseRest(func, start); - } - - /** - * Creates a function that invokes `func` with the `this` binding of the - * create function and an array of arguments much like - * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). - * - * **Note:** This method is based on the - * [spread operator](https://mdn.io/spread_operator). - * - * @static - * @memberOf _ - * @since 3.2.0 - * @category Function - * @param {Function} func The function to spread arguments over. - * @param {number} [start=0] The start position of the spread. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.spread(function(who, what) { - * return who + ' says ' + what; - * }); - * - * say(['fred', 'hello']); - * // => 'fred says hello' - * - * var numbers = Promise.all([ - * Promise.resolve(40), - * Promise.resolve(36) - * ]); - * - * numbers.then(_.spread(function(x, y) { - * return x + y; - * })); - * // => a Promise of 76 - */ - function spread(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = start == null ? 0 : nativeMax(toInteger(start), 0); - return baseRest(function(args) { - var array = args[start], - otherArgs = castSlice(args, 0, start); - - if (array) { - arrayPush(otherArgs, array); - } - return apply(func, this, otherArgs); - }); - } - - /** - * Creates a throttled function that only invokes `func` at most once per - * every `wait` milliseconds. The throttled function comes with a `cancel` - * method to cancel delayed `func` invocations and a `flush` method to - * immediately invoke them. Provide `options` to indicate whether `func` - * should be invoked on the leading and/or trailing edge of the `wait` - * timeout. The `func` is invoked with the last arguments provided to the - * throttled function. Subsequent calls to the throttled function return the - * result of the last `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the throttled function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.throttle` and `_.debounce`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to throttle. - * @param {number} [wait=0] The number of milliseconds to throttle invocations to. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=true] - * Specify invoking on the leading edge of the timeout. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * // Avoid excessively updating the position while scrolling. - * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); - * - * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. - * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); - * jQuery(element).on('click', throttled); - * - * // Cancel the trailing throttled invocation. - * jQuery(window).on('popstate', throttled.cancel); - */ - function throttle(func, wait, options) { - var leading = true, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (isObject(options)) { - leading = 'leading' in options ? !!options.leading : leading; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - return debounce(func, wait, { - 'leading': leading, - 'maxWait': wait, - 'trailing': trailing - }); - } - - /** - * Creates a function that accepts up to one argument, ignoring any - * additional arguments. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - * @example - * - * _.map(['6', '8', '10'], _.unary(parseInt)); - * // => [6, 8, 10] - */ - function unary(func) { - return ary(func, 1); - } - - /** - * Creates a function that provides `value` to `wrapper` as its first - * argument. Any additional arguments provided to the function are appended - * to those provided to the `wrapper`. The wrapper is invoked with the `this` - * binding of the created function. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {*} value The value to wrap. - * @param {Function} [wrapper=identity] The wrapper function. - * @returns {Function} Returns the new function. - * @example - * - * var p = _.wrap(_.escape, function(func, text) { - * return '

' + func(text) + '

'; - * }); - * - * p('fred, barney, & pebbles'); - * // => '

fred, barney, & pebbles

' - */ - function wrap(value, wrapper) { - return partial(castFunction(wrapper), value); - } - - /*------------------------------------------------------------------------*/ - - /** - * Casts `value` as an array if it's not one. - * - * @static - * @memberOf _ - * @since 4.4.0 - * @category Lang - * @param {*} value The value to inspect. - * @returns {Array} Returns the cast array. - * @example - * - * _.castArray(1); - * // => [1] - * - * _.castArray({ 'a': 1 }); - * // => [{ 'a': 1 }] - * - * _.castArray('abc'); - * // => ['abc'] - * - * _.castArray(null); - * // => [null] - * - * _.castArray(undefined); - * // => [undefined] - * - * _.castArray(); - * // => [] - * - * var array = [1, 2, 3]; - * console.log(_.castArray(array) === array); - * // => true - */ - function castArray() { - if (!arguments.length) { - return []; - } - var value = arguments[0]; - return isArray(value) ? value : [value]; - } - - /** - * Creates a shallow clone of `value`. - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) - * and supports cloning arrays, array buffers, booleans, date objects, maps, - * numbers, `Object` objects, regexes, sets, strings, symbols, and typed - * arrays. The own enumerable properties of `arguments` objects are cloned - * as plain objects. An empty object is returned for uncloneable values such - * as error objects, functions, DOM nodes, and WeakMaps. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to clone. - * @returns {*} Returns the cloned value. - * @see _.cloneDeep - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var shallow = _.clone(objects); - * console.log(shallow[0] === objects[0]); - * // => true - */ - function clone(value) { - return baseClone(value, CLONE_SYMBOLS_FLAG); - } - - /** - * This method is like `_.clone` except that it accepts `customizer` which - * is invoked to produce the cloned value. If `customizer` returns `undefined`, - * cloning is handled by the method instead. The `customizer` is invoked with - * up to four arguments; (value [, index|key, object, stack]). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to clone. - * @param {Function} [customizer] The function to customize cloning. - * @returns {*} Returns the cloned value. - * @see _.cloneDeepWith - * @example - * - * function customizer(value) { - * if (_.isElement(value)) { - * return value.cloneNode(false); - * } - * } - * - * var el = _.cloneWith(document.body, customizer); - * - * console.log(el === document.body); - * // => false - * console.log(el.nodeName); - * // => 'BODY' - * console.log(el.childNodes.length); - * // => 0 - */ - function cloneWith(value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); - } - - /** - * This method is like `_.clone` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Lang - * @param {*} value The value to recursively clone. - * @returns {*} Returns the deep cloned value. - * @see _.clone - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var deep = _.cloneDeep(objects); - * console.log(deep[0] === objects[0]); - * // => false - */ - function cloneDeep(value) { - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); - } - - /** - * This method is like `_.cloneWith` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to recursively clone. - * @param {Function} [customizer] The function to customize cloning. - * @returns {*} Returns the deep cloned value. - * @see _.cloneWith - * @example - * - * function customizer(value) { - * if (_.isElement(value)) { - * return value.cloneNode(true); - * } - * } - * - * var el = _.cloneDeepWith(document.body, customizer); - * - * console.log(el === document.body); - * // => false - * console.log(el.nodeName); - * // => 'BODY' - * console.log(el.childNodes.length); - * // => 20 - */ - function cloneDeepWith(value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); - } - - /** - * Checks if `object` conforms to `source` by invoking the predicate - * properties of `source` with the corresponding property values of `object`. - * - * **Note:** This method is equivalent to `_.conforms` when `source` is - * partially applied. - * - * @static - * @memberOf _ - * @since 4.14.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property predicates to conform to. - * @returns {boolean} Returns `true` if `object` conforms, else `false`. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * - * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); - * // => true - * - * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); - * // => false - */ - function conformsTo(object, source) { - return source == null || baseConformsTo(object, source, keys(source)); - } - - /** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - function eq(value, other) { - return value === other || (value !== value && other !== other); - } - - /** - * Checks if `value` is greater than `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, - * else `false`. - * @see _.lt - * @example - * - * _.gt(3, 1); - * // => true - * - * _.gt(3, 3); - * // => false - * - * _.gt(1, 3); - * // => false - */ - var gt = createRelationalOperation(baseGt); - - /** - * Checks if `value` is greater than or equal to `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than or equal to - * `other`, else `false`. - * @see _.lte - * @example - * - * _.gte(3, 1); - * // => true - * - * _.gte(3, 3); - * // => true - * - * _.gte(1, 3); - * // => false - */ - var gte = createRelationalOperation(function(value, other) { - return value >= other; - }); - - /** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee'); - }; - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; - - /** - * Checks if `value` is classified as an `ArrayBuffer` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. - * @example - * - * _.isArrayBuffer(new ArrayBuffer(2)); - * // => true - * - * _.isArrayBuffer(new Array(2)); - * // => false - */ - var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; - - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); - } - - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } - - /** - * Checks if `value` is classified as a boolean primitive or object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. - * @example - * - * _.isBoolean(false); - * // => true - * - * _.isBoolean(null); - * // => false - */ - function isBoolean(value) { - return value === true || value === false || - (isObjectLike(value) && baseGetTag(value) == boolTag); - } - - /** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ - var isBuffer = nativeIsBuffer || stubFalse; - - /** - * Checks if `value` is classified as a `Date` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a date object, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - * - * _.isDate('Mon April 23 2012'); - * // => false - */ - var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; - - /** - * Checks if `value` is likely a DOM element. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. - * @example - * - * _.isElement(document.body); - * // => true - * - * _.isElement(''); - * // => false - */ - function isElement(value) { - return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); - } - - /** - * Checks if `value` is an empty object, collection, map, or set. - * - * Objects are considered empty if they have no own enumerable string keyed - * properties. - * - * Array-like values such as `arguments` objects, arrays, buffers, strings, or - * jQuery-like collections are considered empty if they have a `length` of `0`. - * Similarly, maps and sets are considered empty if they have a `size` of `0`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */ - function isEmpty(value) { - if (value == null) { - return true; - } - if (isArrayLike(value) && - (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || - isBuffer(value) || isTypedArray(value) || isArguments(value))) { - return !value.length; - } - var tag = getTag(value); - if (tag == mapTag || tag == setTag) { - return !value.size; - } - if (isPrototype(value)) { - return !baseKeys(value).length; - } - for (var key in value) { - if (hasOwnProperty.call(value, key)) { - return false; - } - } - return true; - } - - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are compared by strict equality, i.e. `===`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - function isEqual(value, other) { - return baseIsEqual(value, other); - } - - /** - * This method is like `_.isEqual` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined`, comparisons - * are handled by the method instead. The `customizer` is invoked with up to - * six arguments: (objValue, othValue [, index|key, object, other, stack]). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - function isEqualWith(value, other, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - var result = customizer ? customizer(value, other) : undefined; - return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; - } - - /** - * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, - * `SyntaxError`, `TypeError`, or `URIError` object. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. - * @example - * - * _.isError(new Error); - * // => true - * - * _.isError(Error); - * // => false - */ - function isError(value) { - if (!isObjectLike(value)) { - return false; - } - var tag = baseGetTag(value); - return tag == errorTag || tag == domExcTag || - (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); - } - - /** - * Checks if `value` is a finite primitive number. - * - * **Note:** This method is based on - * [`Number.isFinite`](https://mdn.io/Number/isFinite). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. - * @example - * - * _.isFinite(3); - * // => true - * - * _.isFinite(Number.MIN_VALUE); - * // => true - * - * _.isFinite(Infinity); - * // => false - * - * _.isFinite('3'); - * // => false - */ - function isFinite(value) { - return typeof value == 'number' && nativeIsFinite(value); - } - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - if (!isObject(value)) { - return false; - } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; - } - - /** - * Checks if `value` is an integer. - * - * **Note:** This method is based on - * [`Number.isInteger`](https://mdn.io/Number/isInteger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an integer, else `false`. - * @example - * - * _.isInteger(3); - * // => true - * - * _.isInteger(Number.MIN_VALUE); - * // => false - * - * _.isInteger(Infinity); - * // => false - * - * _.isInteger('3'); - * // => false - */ - function isInteger(value) { - return typeof value == 'number' && value == toInteger(value); - } - - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); - } - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return value != null && typeof value == 'object'; - } - - /** - * Checks if `value` is classified as a `Map` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. - * @example - * - * _.isMap(new Map); - * // => true - * - * _.isMap(new WeakMap); - * // => false - */ - var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; - - /** - * Performs a partial deep comparison between `object` and `source` to - * determine if `object` contains equivalent property values. - * - * **Note:** This method is equivalent to `_.matches` when `source` is - * partially applied. - * - * Partial comparisons will match empty array and empty object `source` - * values against any array or object value, respectively. See `_.isEqual` - * for a list of supported value comparisons. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * - * _.isMatch(object, { 'b': 2 }); - * // => true - * - * _.isMatch(object, { 'b': 1 }); - * // => false - */ - function isMatch(object, source) { - return object === source || baseIsMatch(object, source, getMatchData(source)); - } - - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined`, comparisons - * are handled by the method instead. The `customizer` is invoked with five - * arguments: (objValue, srcValue, index|key, object, source). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - function isMatchWith(object, source, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseIsMatch(object, source, getMatchData(source), customizer); - } - - /** - * Checks if `value` is `NaN`. - * - * **Note:** This method is based on - * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as - * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for - * `undefined` and other non-number values. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ - function isNaN(value) { - // An `NaN` primitive is the only value that is not equal to itself. - // Perform the `toStringTag` check first to avoid errors with some - // ActiveX objects in IE. - return isNumber(value) && value != +value; - } - - /** - * Checks if `value` is a pristine native function. - * - * **Note:** This method can't reliably detect native functions in the presence - * of the core-js package because core-js circumvents this kind of detection. - * Despite multiple requests, the core-js maintainer has made it clear: any - * attempt to fix the detection will be obstructed. As a result, we're left - * with little choice but to throw an error. Unfortunately, this also affects - * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), - * which rely on core-js. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ - function isNative(value) { - if (isMaskable(value)) { - throw new Error(CORE_ERROR_TEXT); - } - return baseIsNative(value); - } - - /** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(void 0); - * // => false - */ - function isNull(value) { - return value === null; - } - - /** - * Checks if `value` is `null` or `undefined`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is nullish, else `false`. - * @example - * - * _.isNil(null); - * // => true - * - * _.isNil(void 0); - * // => true - * - * _.isNil(NaN); - * // => false - */ - function isNil(value) { - return value == null; - } - - /** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are - * classified as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a number, else `false`. - * @example - * - * _.isNumber(3); - * // => true - * - * _.isNumber(Number.MIN_VALUE); - * // => true - * - * _.isNumber(Infinity); - * // => true - * - * _.isNumber('3'); - * // => false - */ - function isNumber(value) { - return typeof value == 'number' || - (isObjectLike(value) && baseGetTag(value) == numberTag); - } - - /** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ - function isPlainObject(value) { - if (!isObjectLike(value) || baseGetTag(value) != objectTag) { - return false; - } - var proto = getPrototype(value); - if (proto === null) { - return true; - } - var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return typeof Ctor == 'function' && Ctor instanceof Ctor && - funcToString.call(Ctor) == objectCtorString; - } - - /** - * Checks if `value` is classified as a `RegExp` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. - * @example - * - * _.isRegExp(/abc/); - * // => true - * - * _.isRegExp('/abc/'); - * // => false - */ - var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; - - /** - * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 - * double precision number which isn't the result of a rounded unsafe integer. - * - * **Note:** This method is based on - * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. - * @example - * - * _.isSafeInteger(3); - * // => true - * - * _.isSafeInteger(Number.MIN_VALUE); - * // => false - * - * _.isSafeInteger(Infinity); - * // => false - * - * _.isSafeInteger('3'); - * // => false - */ - function isSafeInteger(value) { - return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is classified as a `Set` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. - * @example - * - * _.isSet(new Set); - * // => true - * - * _.isSet(new WeakSet); - * // => false - */ - var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; - - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a string, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); - } - - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == symbolTag); - } - - /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ - var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - - /** - * Checks if `value` is `undefined`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - * - * _.isUndefined(null); - * // => false - */ - function isUndefined(value) { - return value === undefined; - } - - /** - * Checks if `value` is classified as a `WeakMap` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. - * @example - * - * _.isWeakMap(new WeakMap); - * // => true - * - * _.isWeakMap(new Map); - * // => false - */ - function isWeakMap(value) { - return isObjectLike(value) && getTag(value) == weakMapTag; - } - - /** - * Checks if `value` is classified as a `WeakSet` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. - * @example - * - * _.isWeakSet(new WeakSet); - * // => true - * - * _.isWeakSet(new Set); - * // => false - */ - function isWeakSet(value) { - return isObjectLike(value) && baseGetTag(value) == weakSetTag; - } - - /** - * Checks if `value` is less than `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, - * else `false`. - * @see _.gt - * @example - * - * _.lt(1, 3); - * // => true - * - * _.lt(3, 3); - * // => false - * - * _.lt(3, 1); - * // => false - */ - var lt = createRelationalOperation(baseLt); - - /** - * Checks if `value` is less than or equal to `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than or equal to - * `other`, else `false`. - * @see _.gte - * @example - * - * _.lte(1, 3); - * // => true - * - * _.lte(3, 3); - * // => true - * - * _.lte(3, 1); - * // => false - */ - var lte = createRelationalOperation(function(value, other) { - return value <= other; - }); - - /** - * Converts `value` to an array. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Array} Returns the converted array. - * @example - * - * _.toArray({ 'a': 1, 'b': 2 }); - * // => [1, 2] - * - * _.toArray('abc'); - * // => ['a', 'b', 'c'] - * - * _.toArray(1); - * // => [] - * - * _.toArray(null); - * // => [] - */ - function toArray(value) { - if (!value) { - return []; - } - if (isArrayLike(value)) { - return isString(value) ? stringToArray(value) : copyArray(value); - } - if (symIterator && value[symIterator]) { - return iteratorToArray(value[symIterator]()); - } - var tag = getTag(value), - func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); - - return func(value); - } - - /** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ - function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; - } - - /** - * Converts `value` to an integer. - * - * **Note:** This method is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ - function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; - } - - /** - * Converts `value` to an integer suitable for use as the length of an - * array-like object. - * - * **Note:** This method is based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toLength(3.2); - * // => 3 - * - * _.toLength(Number.MIN_VALUE); - * // => 0 - * - * _.toLength(Infinity); - * // => 4294967295 - * - * _.toLength('3.2'); - * // => 3 - */ - function toLength(value) { - return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; - } - - /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ - function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); - } - - /** - * Converts `value` to a plain object flattening inherited enumerable string - * keyed properties of `value` to own properties of the plain object. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {Object} Returns the converted plain object. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.assign({ 'a': 1 }, new Foo); - * // => { 'a': 1, 'b': 2 } - * - * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); - * // => { 'a': 1, 'b': 2, 'c': 3 } - */ - function toPlainObject(value) { - return copyObject(value, keysIn(value)); - } - - /** - * Converts `value` to a safe integer. A safe integer can be compared and - * represented correctly. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toSafeInteger(3.2); - * // => 3 - * - * _.toSafeInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toSafeInteger(Infinity); - * // => 9007199254740991 - * - * _.toSafeInteger('3.2'); - * // => 3 - */ - function toSafeInteger(value) { - return value - ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) - : (value === 0 ? value : 0); - } - - /** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - function toString(value) { - return value == null ? '' : baseToString(value); - } - - /*------------------------------------------------------------------------*/ - - /** - * Assigns own enumerable string keyed properties of source objects to the - * destination object. Source objects are applied from left to right. - * Subsequent sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @static - * @memberOf _ - * @since 0.10.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.assignIn - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * function Bar() { - * this.c = 3; - * } - * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; - * - * _.assign({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3 } - */ - var assign = createAssigner(function(object, source) { - if (isPrototype(source) || isArrayLike(source)) { - copyObject(source, keys(source), object); - return; - } - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - assignValue(object, key, source[key]); - } - } - }); - - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.assign - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * function Bar() { - * this.c = 3; - * } - * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; - * - * _.assignIn({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } - */ - var assignIn = createAssigner(function(object, source) { - copyObject(source, keysIn(source), object); - }); - - /** - * This method is like `_.assignIn` except that it accepts `customizer` - * which is invoked to produce the assigned values. If `customizer` returns - * `undefined`, assignment is handled by the method instead. The `customizer` - * is invoked with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias extendWith - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @see _.assignWith - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keysIn(source), object, customizer); - }); - - /** - * This method is like `_.assign` except that it accepts `customizer` - * which is invoked to produce the assigned values. If `customizer` returns - * `undefined`, assignment is handled by the method instead. The `customizer` - * is invoked with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @see _.assignInWith - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - var assignWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keys(source), object, customizer); - }); - - /** - * Creates an array of values corresponding to `paths` of `object`. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Array} Returns the picked values. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; - * - * _.at(object, ['a[0].b.c', 'a[1]']); - * // => [3, 4] - */ - var at = flatRest(baseAt); - - /** - * Creates an object that inherits from the `prototype` object. If a - * `properties` object is given, its own enumerable string keyed properties - * are assigned to the created object. - * - * @static - * @memberOf _ - * @since 2.3.0 - * @category Object - * @param {Object} prototype The object to inherit from. - * @param {Object} [properties] The properties to assign to the object. - * @returns {Object} Returns the new object. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * function Circle() { - * Shape.call(this); - * } - * - * Circle.prototype = _.create(Shape.prototype, { - * 'constructor': Circle - * }); - * - * var circle = new Circle; - * circle instanceof Circle; - * // => true - * - * circle instanceof Shape; - * // => true - */ - function create(prototype, properties) { - var result = baseCreate(prototype); - return properties == null ? result : baseAssign(result, properties); - } - - /** - * Assigns own and inherited enumerable string keyed properties of source - * objects to the destination object for all destination properties that - * resolve to `undefined`. Source objects are applied from left to right. - * Once a property is set, additional values of the same property are ignored. - * - * **Note:** This method mutates `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.defaultsDeep - * @example - * - * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - var defaults = baseRest(function(object, sources) { - object = Object(object); - - var index = -1; - var length = sources.length; - var guard = length > 2 ? sources[2] : undefined; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - length = 1; - } - - while (++index < length) { - var source = sources[index]; - var props = keysIn(source); - var propsIndex = -1; - var propsLength = props.length; - - while (++propsIndex < propsLength) { - var key = props[propsIndex]; - var value = object[key]; - - if (value === undefined || - (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { - object[key] = source[key]; - } - } - } - - return object; - }); - - /** - * This method is like `_.defaults` except that it recursively assigns - * default properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 3.10.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.defaults - * @example - * - * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); - * // => { 'a': { 'b': 2, 'c': 3 } } - */ - var defaultsDeep = baseRest(function(args) { - args.push(undefined, customDefaultsMerge); - return apply(mergeWith, undefined, args); - }); - - /** - * This method is like `_.find` except that it returns the key of the first - * element `predicate` returns truthy for instead of the element itself. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Object - * @param {Object} object The object to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, - * else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findKey(users, function(o) { return o.age < 40; }); - * // => 'barney' (iteration order is not guaranteed) - * - * // The `_.matches` iteratee shorthand. - * _.findKey(users, { 'age': 1, 'active': true }); - * // => 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findKey(users, ['active', false]); - * // => 'fred' - * - * // The `_.property` iteratee shorthand. - * _.findKey(users, 'active'); - * // => 'barney' - */ - function findKey(object, predicate) { - return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); - } - - /** - * This method is like `_.findKey` except that it iterates over elements of - * a collection in the opposite order. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, - * else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findLastKey(users, function(o) { return o.age < 40; }); - * // => returns 'pebbles' assuming `_.findKey` returns 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.findLastKey(users, { 'age': 36, 'active': true }); - * // => 'barney' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastKey(users, ['active', false]); - * // => 'fred' - * - * // The `_.property` iteratee shorthand. - * _.findLastKey(users, 'active'); - * // => 'pebbles' - */ - function findLastKey(object, predicate) { - return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); - } - - /** - * Iterates over own and inherited enumerable string keyed properties of an - * object and invokes `iteratee` for each property. The iteratee is invoked - * with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @since 0.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forInRight - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forIn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). - */ - function forIn(object, iteratee) { - return object == null - ? object - : baseFor(object, getIteratee(iteratee, 3), keysIn); - } - - /** - * This method is like `_.forIn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forIn - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forInRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. - */ - function forInRight(object, iteratee) { - return object == null - ? object - : baseForRight(object, getIteratee(iteratee, 3), keysIn); - } - - /** - * Iterates over own enumerable string keyed properties of an object and - * invokes `iteratee` for each property. The iteratee is invoked with three - * arguments: (value, key, object). Iteratee functions may exit iteration - * early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @since 0.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forOwnRight - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a' then 'b' (iteration order is not guaranteed). - */ - function forOwn(object, iteratee) { - return object && baseForOwn(object, getIteratee(iteratee, 3)); - } - - /** - * This method is like `_.forOwn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forOwn - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwnRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. - */ - function forOwnRight(object, iteratee) { - return object && baseForOwnRight(object, getIteratee(iteratee, 3)); - } - - /** - * Creates an array of function property names from own enumerable properties - * of `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the function names. - * @see _.functionsIn - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functions(new Foo); - * // => ['a', 'b'] - */ - function functions(object) { - return object == null ? [] : baseFunctions(object, keys(object)); - } - - /** - * Creates an array of function property names from own and inherited - * enumerable properties of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the function names. - * @see _.functions - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functionsIn(new Foo); - * // => ['a', 'b', 'c'] - */ - function functionsIn(object) { - return object == null ? [] : baseFunctions(object, keysIn(object)); - } - - /** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined`, the `defaultValue` is returned in its place. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ - function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; - } - - /** - * Checks if `path` is a direct property of `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': 2 } }; - * var other = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b'); - * // => true - * - * _.has(object, ['a', 'b']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - function has(object, path) { - return object != null && hasPath(object, path, baseHas); - } - - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b'); - * // => true - * - * _.hasIn(object, ['a', 'b']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - function hasIn(object, path) { - return object != null && hasPath(object, path, baseHasIn); - } - - /** - * Creates an object composed of the inverted keys and values of `object`. - * If `object` contains duplicate values, subsequent values overwrite - * property assignments of previous values. - * - * @static - * @memberOf _ - * @since 0.7.0 - * @category Object - * @param {Object} object The object to invert. - * @returns {Object} Returns the new inverted object. - * @example - * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; - * - * _.invert(object); - * // => { '1': 'c', '2': 'b' } - */ - var invert = createInverter(function(result, value, key) { - if (value != null && - typeof value.toString != 'function') { - value = nativeObjectToString.call(value); - } - - result[value] = key; - }, constant(identity)); - - /** - * This method is like `_.invert` except that the inverted object is generated - * from the results of running each element of `object` thru `iteratee`. The - * corresponding inverted value of each inverted key is an array of keys - * responsible for generating the inverted value. The iteratee is invoked - * with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.1.0 - * @category Object - * @param {Object} object The object to invert. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Object} Returns the new inverted object. - * @example - * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; - * - * _.invertBy(object); - * // => { '1': ['a', 'c'], '2': ['b'] } - * - * _.invertBy(object, function(value) { - * return 'group' + value; - * }); - * // => { 'group1': ['a', 'c'], 'group2': ['b'] } - */ - var invertBy = createInverter(function(result, value, key) { - if (value != null && - typeof value.toString != 'function') { - value = nativeObjectToString.call(value); - } - - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } - }, getIteratee); - - /** - * Invokes the method at `path` of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {...*} [args] The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - * @example - * - * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; - * - * _.invoke(object, 'a[0].b.c.slice', 1, 3); - * // => [2, 3] - */ - var invoke = baseRest(baseInvoke); - - /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ - function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); - } - - /** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ - function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); - } - - /** - * The opposite of `_.mapValues`; this method creates an object with the - * same values as `object` and keys generated by running each own enumerable - * string keyed property of `object` thru `iteratee`. The iteratee is invoked - * with three arguments: (value, key, object). - * - * @static - * @memberOf _ - * @since 3.8.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns the new mapped object. - * @see _.mapValues - * @example - * - * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { - * return key + value; - * }); - * // => { 'a1': 1, 'b2': 2 } - */ - function mapKeys(object, iteratee) { - var result = {}; - iteratee = getIteratee(iteratee, 3); - - baseForOwn(object, function(value, key, object) { - baseAssignValue(result, iteratee(value, key, object), value); - }); - return result; - } - - /** - * Creates an object with the same keys as `object` and values generated - * by running each own enumerable string keyed property of `object` thru - * `iteratee`. The iteratee is invoked with three arguments: - * (value, key, object). - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns the new mapped object. - * @see _.mapKeys - * @example - * - * var users = { - * 'fred': { 'user': 'fred', 'age': 40 }, - * 'pebbles': { 'user': 'pebbles', 'age': 1 } - * }; - * - * _.mapValues(users, function(o) { return o.age; }); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) - * - * // The `_.property` iteratee shorthand. - * _.mapValues(users, 'age'); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) - */ - function mapValues(object, iteratee) { - var result = {}; - iteratee = getIteratee(iteratee, 3); - - baseForOwn(object, function(value, key, object) { - baseAssignValue(result, key, iteratee(value, key, object)); - }); - return result; - } - - /** - * This method is like `_.assign` except that it recursively merges own and - * inherited enumerable string keyed properties of source objects into the - * destination object. Source properties that resolve to `undefined` are - * skipped if a destination value exists. Array and plain object properties - * are merged recursively. Other objects and value types are overridden by - * assignment. Source objects are applied from left to right. Subsequent - * sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * var object = { - * 'a': [{ 'b': 2 }, { 'd': 4 }] - * }; - * - * var other = { - * 'a': [{ 'c': 3 }, { 'e': 5 }] - * }; - * - * _.merge(object, other); - * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } - */ - var merge = createAssigner(function(object, source, srcIndex) { - baseMerge(object, source, srcIndex); - }); - - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined`, merging is handled by the - * method instead. The `customizer` is invoked with six arguments: - * (objValue, srcValue, key, object, source, stack). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} customizer The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { 'a': [1], 'b': [2] }; - * var other = { 'a': [3], 'b': [4] }; - * - * _.mergeWith(object, other, customizer); - * // => { 'a': [1, 3], 'b': [2, 4] } - */ - var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { - baseMerge(object, source, srcIndex, customizer); - }); - - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable property paths of `object` that are not omitted. - * - * **Note:** This method is considerably slower than `_.pick`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [paths] The property paths to omit. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - var omit = flatRest(function(object, paths) { - var result = {}; - if (object == null) { - return result; - } - var isDeep = false; - paths = arrayMap(paths, function(path) { - path = castPath(path, object); - isDeep || (isDeep = path.length > 1); - return path; - }); - copyObject(object, getAllKeysIn(object), result); - if (isDeep) { - result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); - } - var length = paths.length; - while (length--) { - baseUnset(result, paths[length]); - } - return result; - }); - - /** - * The opposite of `_.pickBy`; this method creates an object composed of - * the own and inherited enumerable string keyed properties of `object` that - * `predicate` doesn't return truthy for. The predicate is invoked with two - * arguments: (value, key). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The source object. - * @param {Function} [predicate=_.identity] The function invoked per property. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } - */ - function omitBy(object, predicate) { - return pickBy(object, negate(getIteratee(predicate))); - } - - /** - * Creates an object composed of the picked `object` properties. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - var pick = flatRest(function(object, paths) { - return object == null ? {} : basePick(object, paths); - }); - - /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with two arguments: (value, key). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The source object. - * @param {Function} [predicate=_.identity] The function invoked per property. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } - */ - function pickBy(object, predicate) { - if (object == null) { - return {}; - } - var props = arrayMap(getAllKeysIn(object), function(prop) { - return [prop]; - }); - predicate = getIteratee(predicate); - return basePickBy(object, props, function(value, path) { - return predicate(value, path[0]); - }); - } - - /** - * This method is like `_.get` except that if the resolved value is a - * function it's invoked with the `this` binding of its parent object and - * its result is returned. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to resolve. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; - * - * _.result(object, 'a[0].b.c1'); - * // => 3 - * - * _.result(object, 'a[0].b.c2'); - * // => 4 - * - * _.result(object, 'a[0].b.c3', 'default'); - * // => 'default' - * - * _.result(object, 'a[0].b.c3', _.constant('default')); - * // => 'default' - */ - function result(object, path, defaultValue) { - path = castPath(path, object); - - var index = -1, - length = path.length; - - // Ensure the loop is entered when path is empty. - if (!length) { - length = 1; - object = undefined; - } - while (++index < length) { - var value = object == null ? undefined : object[toKey(path[index])]; - if (value === undefined) { - index = length; - value = defaultValue; - } - object = isFunction(value) ? value.call(object) : value; - } - return object; - } - - /** - * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, - * it's created. Arrays are created for missing index properties while objects - * are created for all other missing properties. Use `_.setWith` to customize - * `path` creation. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @returns {Object} Returns `object`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.set(object, 'a[0].b.c', 4); - * console.log(object.a[0].b.c); - * // => 4 - * - * _.set(object, ['x', '0', 'y', 'z'], 5); - * console.log(object.x[0].y.z); - * // => 5 - */ - function set(object, path, value) { - return object == null ? object : baseSet(object, path, value); - } - - /** - * This method is like `_.set` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * var object = {}; - * - * _.setWith(object, '[0][1]', 'a', Object); - * // => { '0': { '1': 'a' } } - */ - function setWith(object, path, value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return object == null ? object : baseSet(object, path, value, customizer); - } - - /** - * Creates an array of own enumerable string keyed-value pairs for `object` - * which can be consumed by `_.fromPairs`. If `object` is a map or set, its - * entries are returned. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias entries - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the key-value pairs. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.toPairs(new Foo); - * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) - */ - var toPairs = createToPairs(keys); - - /** - * Creates an array of own and inherited enumerable string keyed-value pairs - * for `object` which can be consumed by `_.fromPairs`. If `object` is a map - * or set, its entries are returned. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias entriesIn - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the key-value pairs. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.toPairsIn(new Foo); - * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) - */ - var toPairsIn = createToPairs(keysIn); - - /** - * An alternative to `_.reduce`; this method transforms `object` to a new - * `accumulator` object which is the result of running each of its own - * enumerable string keyed properties thru `iteratee`, with each invocation - * potentially mutating the `accumulator` object. If `accumulator` is not - * provided, a new object with the same `[[Prototype]]` will be used. The - * iteratee is invoked with four arguments: (accumulator, value, key, object). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @since 1.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The custom accumulator value. - * @returns {*} Returns the accumulated value. - * @example - * - * _.transform([2, 3, 4], function(result, n) { - * result.push(n *= n); - * return n % 2 == 0; - * }, []); - * // => [4, 9] - * - * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } - */ - function transform(object, iteratee, accumulator) { - var isArr = isArray(object), - isArrLike = isArr || isBuffer(object) || isTypedArray(object); - - iteratee = getIteratee(iteratee, 4); - if (accumulator == null) { - var Ctor = object && object.constructor; - if (isArrLike) { - accumulator = isArr ? new Ctor : []; - } - else if (isObject(object)) { - accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; - } - else { - accumulator = {}; - } - } - (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { - return iteratee(accumulator, value, index, object); - }); - return accumulator; - } - - /** - * Removes the property at `path` of `object`. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 7 } }] }; - * _.unset(object, 'a[0].b.c'); - * // => true - * - * console.log(object); - * // => { 'a': [{ 'b': {} }] }; - * - * _.unset(object, ['a', '0', 'b', 'c']); - * // => true - * - * console.log(object); - * // => { 'a': [{ 'b': {} }] }; - */ - function unset(object, path) { - return object == null ? true : baseUnset(object, path); - } - - /** - * This method is like `_.set` except that accepts `updater` to produce the - * value to set. Use `_.updateWith` to customize `path` creation. The `updater` - * is invoked with one argument: (value). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.6.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {Function} updater The function to produce the updated value. - * @returns {Object} Returns `object`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.update(object, 'a[0].b.c', function(n) { return n * n; }); - * console.log(object.a[0].b.c); - * // => 9 - * - * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); - * console.log(object.x[0].y.z); - * // => 0 - */ - function update(object, path, updater) { - return object == null ? object : baseUpdate(object, path, castFunction(updater)); - } - - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.6.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {Function} updater The function to produce the updated value. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - function updateWith(object, path, updater, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); - } - - /** - * Creates an array of the own enumerable string keyed property values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.values(new Foo); - * // => [1, 2] (iteration order is not guaranteed) - * - * _.values('hi'); - * // => ['h', 'i'] - */ - function values(object) { - return object == null ? [] : baseValues(object, keys(object)); - } - - /** - * Creates an array of the own and inherited enumerable string keyed property - * values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.valuesIn(new Foo); - * // => [1, 2, 3] (iteration order is not guaranteed) - */ - function valuesIn(object) { - return object == null ? [] : baseValues(object, keysIn(object)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Number - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - function clamp(number, lower, upper) { - if (upper === undefined) { - upper = lower; - lower = undefined; - } - if (upper !== undefined) { - upper = toNumber(upper); - upper = upper === upper ? upper : 0; - } - if (lower !== undefined) { - lower = toNumber(lower); - lower = lower === lower ? lower : 0; - } - return baseClamp(toNumber(number), lower, upper); - } - - /** - * Checks if `n` is between `start` and up to, but not including, `end`. If - * `end` is not specified, it's set to `start` with `start` then set to `0`. - * If `start` is greater than `end` the params are swapped to support - * negative ranges. - * - * @static - * @memberOf _ - * @since 3.3.0 - * @category Number - * @param {number} number The number to check. - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. - * @see _.range, _.rangeRight - * @example - * - * _.inRange(3, 2, 4); - * // => true - * - * _.inRange(4, 8); - * // => true - * - * _.inRange(4, 2); - * // => false - * - * _.inRange(2, 2); - * // => false - * - * _.inRange(1.2, 2); - * // => true - * - * _.inRange(5.2, 4); - * // => false - * - * _.inRange(-3, -2, -6); - * // => true - */ - function inRange(number, start, end) { - start = toFinite(start); - if (end === undefined) { - end = start; - start = 0; - } else { - end = toFinite(end); - } - number = toNumber(number); - return baseInRange(number, start, end); - } - - /** - * Produces a random number between the inclusive `lower` and `upper` bounds. - * If only one argument is provided a number between `0` and the given number - * is returned. If `floating` is `true`, or either `lower` or `upper` are - * floats, a floating-point number is returned instead of an integer. - * - * **Note:** JavaScript follows the IEEE-754 standard for resolving - * floating-point values which can produce unexpected results. - * - * @static - * @memberOf _ - * @since 0.7.0 - * @category Number - * @param {number} [lower=0] The lower bound. - * @param {number} [upper=1] The upper bound. - * @param {boolean} [floating] Specify returning a floating-point number. - * @returns {number} Returns the random number. - * @example - * - * _.random(0, 5); - * // => an integer between 0 and 5 - * - * _.random(5); - * // => also an integer between 0 and 5 - * - * _.random(5, true); - * // => a floating-point number between 0 and 5 - * - * _.random(1.2, 5.2); - * // => a floating-point number between 1.2 and 5.2 - */ - function random(lower, upper, floating) { - if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { - upper = floating = undefined; - } - if (floating === undefined) { - if (typeof upper == 'boolean') { - floating = upper; - upper = undefined; - } - else if (typeof lower == 'boolean') { - floating = lower; - lower = undefined; - } - } - if (lower === undefined && upper === undefined) { - lower = 0; - upper = 1; - } - else { - lower = toFinite(lower); - if (upper === undefined) { - upper = lower; - lower = 0; - } else { - upper = toFinite(upper); - } - } - if (lower > upper) { - var temp = lower; - lower = upper; - upper = temp; - } - if (floating || lower % 1 || upper % 1) { - var rand = nativeRandom(); - return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); - } - return baseRandom(lower, upper); - } - - /*------------------------------------------------------------------------*/ - - /** - * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the camel cased string. - * @example - * - * _.camelCase('Foo Bar'); - * // => 'fooBar' - * - * _.camelCase('--foo-bar--'); - * // => 'fooBar' - * - * _.camelCase('__FOO_BAR__'); - * // => 'fooBar' - */ - var camelCase = createCompounder(function(result, word, index) { - word = word.toLowerCase(); - return result + (index ? capitalize(word) : word); - }); - - /** - * Converts the first character of `string` to upper case and the remaining - * to lower case. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to capitalize. - * @returns {string} Returns the capitalized string. - * @example - * - * _.capitalize('FRED'); - * // => 'Fred' - */ - function capitalize(string) { - return upperFirst(toString(string).toLowerCase()); - } - - /** - * Deburrs `string` by converting - * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) - * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) - * letters to basic Latin letters and removing - * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to deburr. - * @returns {string} Returns the deburred string. - * @example - * - * _.deburr('déjà vu'); - * // => 'deja vu' - */ - function deburr(string) { - string = toString(string); - return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); - } - - /** - * Checks if `string` ends with the given target string. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to inspect. - * @param {string} [target] The string to search for. - * @param {number} [position=string.length] The position to search up to. - * @returns {boolean} Returns `true` if `string` ends with `target`, - * else `false`. - * @example - * - * _.endsWith('abc', 'c'); - * // => true - * - * _.endsWith('abc', 'b'); - * // => false - * - * _.endsWith('abc', 'b', 2); - * // => true - */ - function endsWith(string, target, position) { - string = toString(string); - target = baseToString(target); - - var length = string.length; - position = position === undefined - ? length - : baseClamp(toInteger(position), 0, length); - - var end = position; - position -= target.length; - return position >= 0 && string.slice(position, end) == target; - } - - /** - * Converts the characters "&", "<", ">", '"', and "'" in `string` to their - * corresponding HTML entities. - * - * **Note:** No other characters are escaped. To escape additional - * characters use a third-party library like [_he_](https://mths.be/he). - * - * Though the ">" character is escaped for symmetry, characters like - * ">" and "/" don't need escaping in HTML and have no special meaning - * unless they're part of a tag or unquoted attribute value. See - * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) - * (under "semi-related fun fact") for more details. - * - * When working with HTML you should always - * [quote attribute values](http://wonko.com/post/html-escaping) to reduce - * XSS vectors. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escape('fred, barney, & pebbles'); - * // => 'fred, barney, & pebbles' - */ - function escape(string) { - string = toString(string); - return (string && reHasUnescapedHtml.test(string)) - ? string.replace(reUnescapedHtml, escapeHtmlChar) - : string; - } - - /** - * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", - * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escapeRegExp('[lodash](https://lodash.com/)'); - * // => '\[lodash\]\(https://lodash\.com/\)' - */ - function escapeRegExp(string) { - string = toString(string); - return (string && reHasRegExpChar.test(string)) - ? string.replace(reRegExpChar, '\\$&') - : string; - } - - /** - * Converts `string` to - * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the kebab cased string. - * @example - * - * _.kebabCase('Foo Bar'); - * // => 'foo-bar' - * - * _.kebabCase('fooBar'); - * // => 'foo-bar' - * - * _.kebabCase('__FOO_BAR__'); - * // => 'foo-bar' - */ - var kebabCase = createCompounder(function(result, word, index) { - return result + (index ? '-' : '') + word.toLowerCase(); - }); - - /** - * Converts `string`, as space separated words, to lower case. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the lower cased string. - * @example - * - * _.lowerCase('--Foo-Bar--'); - * // => 'foo bar' - * - * _.lowerCase('fooBar'); - * // => 'foo bar' - * - * _.lowerCase('__FOO_BAR__'); - * // => 'foo bar' - */ - var lowerCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + word.toLowerCase(); - }); - - /** - * Converts the first character of `string` to lower case. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.lowerFirst('Fred'); - * // => 'fred' - * - * _.lowerFirst('FRED'); - * // => 'fRED' - */ - var lowerFirst = createCaseFirst('toLowerCase'); - - /** - * Pads `string` on the left and right sides if it's shorter than `length`. - * Padding characters are truncated if they can't be evenly divided by `length`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.pad('abc', 8); - * // => ' abc ' - * - * _.pad('abc', 8, '_-'); - * // => '_-abc_-_' - * - * _.pad('abc', 3); - * // => 'abc' - */ - function pad(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - if (!length || strLength >= length) { - return string; - } - var mid = (length - strLength) / 2; - return ( - createPadding(nativeFloor(mid), chars) + - string + - createPadding(nativeCeil(mid), chars) - ); - } - - /** - * Pads `string` on the right side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padEnd('abc', 6); - * // => 'abc ' - * - * _.padEnd('abc', 6, '_-'); - * // => 'abc_-_' - * - * _.padEnd('abc', 3); - * // => 'abc' - */ - function padEnd(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - return (length && strLength < length) - ? (string + createPadding(length - strLength, chars)) - : string; - } - - /** - * Pads `string` on the left side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padStart('abc', 6); - * // => ' abc' - * - * _.padStart('abc', 6, '_-'); - * // => '_-_abc' - * - * _.padStart('abc', 3); - * // => 'abc' - */ - function padStart(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - return (length && strLength < length) - ? (createPadding(length - strLength, chars) + string) - : string; - } - - /** - * Converts `string` to an integer of the specified radix. If `radix` is - * `undefined` or `0`, a `radix` of `10` is used unless `value` is a - * hexadecimal, in which case a `radix` of `16` is used. - * - * **Note:** This method aligns with the - * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category String - * @param {string} string The string to convert. - * @param {number} [radix=10] The radix to interpret `value` by. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {number} Returns the converted integer. - * @example - * - * _.parseInt('08'); - * // => 8 - * - * _.map(['6', '08', '10'], _.parseInt); - * // => [6, 8, 10] - */ - function parseInt(string, radix, guard) { - if (guard || radix == null) { - radix = 0; - } else if (radix) { - radix = +radix; - } - return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); - } - - /** - * Repeats the given string `n` times. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to repeat. - * @param {number} [n=1] The number of times to repeat the string. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {string} Returns the repeated string. - * @example - * - * _.repeat('*', 3); - * // => '***' - * - * _.repeat('abc', 2); - * // => 'abcabc' - * - * _.repeat('abc', 0); - * // => '' - */ - function repeat(string, n, guard) { - if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { - n = 1; - } else { - n = toInteger(n); - } - return baseRepeat(toString(string), n); - } - - /** - * Replaces matches for `pattern` in `string` with `replacement`. - * - * **Note:** This method is based on - * [`String#replace`](https://mdn.io/String/replace). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to modify. - * @param {RegExp|string} pattern The pattern to replace. - * @param {Function|string} replacement The match replacement. - * @returns {string} Returns the modified string. - * @example - * - * _.replace('Hi Fred', 'Fred', 'Barney'); - * // => 'Hi Barney' - */ - function replace() { - var args = arguments, - string = toString(args[0]); - - return args.length < 3 ? string : string.replace(args[1], args[2]); - } - - /** - * Converts `string` to - * [snake case](https://en.wikipedia.org/wiki/Snake_case). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the snake cased string. - * @example - * - * _.snakeCase('Foo Bar'); - * // => 'foo_bar' - * - * _.snakeCase('fooBar'); - * // => 'foo_bar' - * - * _.snakeCase('--FOO-BAR--'); - * // => 'foo_bar' - */ - var snakeCase = createCompounder(function(result, word, index) { - return result + (index ? '_' : '') + word.toLowerCase(); - }); - - /** - * Splits `string` by `separator`. - * - * **Note:** This method is based on - * [`String#split`](https://mdn.io/String/split). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to split. - * @param {RegExp|string} separator The separator pattern to split by. - * @param {number} [limit] The length to truncate results to. - * @returns {Array} Returns the string segments. - * @example - * - * _.split('a-b-c', '-', 2); - * // => ['a', 'b'] - */ - function split(string, separator, limit) { - if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { - separator = limit = undefined; - } - limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; - if (!limit) { - return []; - } - string = toString(string); - if (string && ( - typeof separator == 'string' || - (separator != null && !isRegExp(separator)) - )) { - separator = baseToString(separator); - if (!separator && hasUnicode(string)) { - return castSlice(stringToArray(string), 0, limit); - } - } - return string.split(separator, limit); - } - - /** - * Converts `string` to - * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). - * - * @static - * @memberOf _ - * @since 3.1.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the start cased string. - * @example - * - * _.startCase('--foo-bar--'); - * // => 'Foo Bar' - * - * _.startCase('fooBar'); - * // => 'Foo Bar' - * - * _.startCase('__FOO_BAR__'); - * // => 'FOO BAR' - */ - var startCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + upperFirst(word); - }); - - /** - * Checks if `string` starts with the given target string. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to inspect. - * @param {string} [target] The string to search for. - * @param {number} [position=0] The position to search from. - * @returns {boolean} Returns `true` if `string` starts with `target`, - * else `false`. - * @example - * - * _.startsWith('abc', 'a'); - * // => true - * - * _.startsWith('abc', 'b'); - * // => false - * - * _.startsWith('abc', 'b', 1); - * // => true - */ - function startsWith(string, target, position) { - string = toString(string); - position = position == null - ? 0 - : baseClamp(toInteger(position), 0, string.length); - - target = baseToString(target); - return string.slice(position, position + target.length) == target; - } - - /** - * Creates a compiled template function that can interpolate data properties - * in "interpolate" delimiters, HTML-escape interpolated data properties in - * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data - * properties may be accessed as free variables in the template. If a setting - * object is given, it takes precedence over `_.templateSettings` values. - * - * **Note:** In the development build `_.template` utilizes - * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) - * for easier debugging. - * - * For more information on precompiling templates see - * [lodash's custom builds documentation](https://lodash.com/custom-builds). - * - * For more information on Chrome extension sandboxes see - * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category String - * @param {string} [string=''] The template string. - * @param {Object} [options={}] The options object. - * @param {RegExp} [options.escape=_.templateSettings.escape] - * The HTML "escape" delimiter. - * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] - * The "evaluate" delimiter. - * @param {Object} [options.imports=_.templateSettings.imports] - * An object to import into the template as free variables. - * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] - * The "interpolate" delimiter. - * @param {string} [options.sourceURL='lodash.templateSources[n]'] - * The sourceURL of the compiled template. - * @param {string} [options.variable='obj'] - * The data object variable name. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the compiled template function. - * @example - * - * // Use the "interpolate" delimiter to create a compiled template. - * var compiled = _.template('hello <%= user %>!'); - * compiled({ 'user': 'fred' }); - * // => 'hello fred!' - * - * // Use the HTML "escape" delimiter to escape data property values. - * var compiled = _.template('<%- value %>'); - * compiled({ 'value': '