Skip to content

Commit

Permalink
generate types and update health computer
Browse files Browse the repository at this point in the history
  • Loading branch information
bobthebuidlr committed Jun 17, 2024
1 parent 7ceb6e7 commit f167daa
Show file tree
Hide file tree
Showing 68 changed files with 1,249 additions and 376 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-nocheck
/**
* This file was automatically generated by @cosmwasm/ts-codegen@0.35.3.
* This file was automatically generated by @cosmwasm/ts-codegen@1.10.0.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run the @cosmwasm/ts-codegen generate command to regenerate this file.
*/
Expand Down Expand Up @@ -106,7 +106,6 @@ export interface MarsAccountNftReadOnlyInterface {
export class MarsAccountNftQueryClient implements MarsAccountNftReadOnlyInterface {
client: CosmWasmClient
contractAddress: string

constructor(client: CosmWasmClient, contractAddress: string) {
this.client = client
this.contractAddress = contractAddress
Expand All @@ -125,7 +124,6 @@ export class MarsAccountNftQueryClient implements MarsAccountNftReadOnlyInterfac
this.minter = this.minter.bind(this)
this.ownership = this.ownership.bind(this)
}

config = async (): Promise<NftConfigBaseForString> => {
return this.client.queryContractSmart(this.contractAddress, {
config: {},
Expand Down Expand Up @@ -403,7 +401,6 @@ export class MarsAccountNftClient
client: SigningCosmWasmClient
sender: string
contractAddress: string

constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) {
super(client, contractAddress)
this.client = client
Expand All @@ -421,7 +418,6 @@ export class MarsAccountNftClient
this.revokeAll = this.revokeAll.bind(this)
this.updateOwnership = this.updateOwnership.bind(this)
}

updateConfig = async (
{
updates,
Expand Down
177 changes: 147 additions & 30 deletions scripts/types/generated/mars-account-nft/MarsAccountNft.react-query.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-nocheck
/**
* This file was automatically generated by @cosmwasm/ts-codegen@0.35.3.
* This file was automatically generated by @cosmwasm/ts-codegen@1.10.0.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run the @cosmwasm/ts-codegen generate command to regenerate this file.
*/
Expand Down Expand Up @@ -45,48 +45,123 @@ export const marsAccountNftQueryKeys = {
},
] as const,
address: (contractAddress: string | undefined) =>
[{ ...marsAccountNftQueryKeys.contract[0], address: contractAddress }] as const,
[
{
...marsAccountNftQueryKeys.contract[0],
address: contractAddress,
},
] as const,
config: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
[{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'config', args }] as const,
[
{
...marsAccountNftQueryKeys.address(contractAddress)[0],
method: 'config',
args,
},
] as const,
nextId: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
[{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'next_id', args }] as const,
[
{
...marsAccountNftQueryKeys.address(contractAddress)[0],
method: 'next_id',
args,
},
] as const,
ownerOf: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
[{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'owner_of', args }] as const,
[
{
...marsAccountNftQueryKeys.address(contractAddress)[0],
method: 'owner_of',
args,
},
] as const,
approval: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
[{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'approval', args }] as const,
[
{
...marsAccountNftQueryKeys.address(contractAddress)[0],
method: 'approval',
args,
},
] as const,
approvals: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
[
{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'approvals', args },
{
...marsAccountNftQueryKeys.address(contractAddress)[0],
method: 'approvals',
args,
},
] as const,
allOperators: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
[
{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'all_operators', args },
{
...marsAccountNftQueryKeys.address(contractAddress)[0],
method: 'all_operators',
args,
},
] as const,
numTokens: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
[
{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'num_tokens', args },
{
...marsAccountNftQueryKeys.address(contractAddress)[0],
method: 'num_tokens',
args,
},
] as const,
contractInfo: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
[
{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'contract_info', args },
{
...marsAccountNftQueryKeys.address(contractAddress)[0],
method: 'contract_info',
args,
},
] as const,
nftInfo: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
[{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'nft_info', args }] as const,
[
{
...marsAccountNftQueryKeys.address(contractAddress)[0],
method: 'nft_info',
args,
},
] as const,
allNftInfo: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
[
{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'all_nft_info', args },
{
...marsAccountNftQueryKeys.address(contractAddress)[0],
method: 'all_nft_info',
args,
},
] as const,
tokens: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
[{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'tokens', args }] as const,
[
{
...marsAccountNftQueryKeys.address(contractAddress)[0],
method: 'tokens',
args,
},
] as const,
allTokens: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
[
{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'all_tokens', args },
{
...marsAccountNftQueryKeys.address(contractAddress)[0],
method: 'all_tokens',
args,
},
] as const,
minter: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
[{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'minter', args }] as const,
[
{
...marsAccountNftQueryKeys.address(contractAddress)[0],
method: 'minter',
args,
},
] as const,
ownership: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
[
{ ...marsAccountNftQueryKeys.address(contractAddress)[0], method: 'ownership', args },
{
...marsAccountNftQueryKeys.address(contractAddress)[0],
method: 'ownership',
args,
},
] as const,
}
export interface MarsAccountNftReactQuery<TResponse, TData = TResponse> {
Expand All @@ -107,7 +182,10 @@ export function useMarsAccountNftOwnershipQuery<TData = OwnershipForAddr>({
return useQuery<OwnershipForAddr, Error, TData>(
marsAccountNftQueryKeys.ownership(client?.contractAddress),
() => (client ? client.ownership() : Promise.reject(new Error('Invalid client'))),
{ ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
{
...options,
enabled: !!client && (options?.enabled != undefined ? options.enabled : true),
},
)
}
export interface MarsAccountNftMinterQuery<TData>
Expand All @@ -119,7 +197,10 @@ export function useMarsAccountNftMinterQuery<TData = MinterResponse>({
return useQuery<MinterResponse, Error, TData>(
marsAccountNftQueryKeys.minter(client?.contractAddress),
() => (client ? client.minter() : Promise.reject(new Error('Invalid client'))),
{ ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
{
...options,
enabled: !!client && (options?.enabled != undefined ? options.enabled : true),
},
)
}
export interface MarsAccountNftAllTokensQuery<TData>
Expand All @@ -143,7 +224,10 @@ export function useMarsAccountNftAllTokensQuery<TData = TokensResponse>({
startAfter: args.startAfter,
})
: Promise.reject(new Error('Invalid client')),
{ ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
{
...options,
enabled: !!client && (options?.enabled != undefined ? options.enabled : true),
},
)
}
export interface MarsAccountNftTokensQuery<TData>
Expand All @@ -169,7 +253,10 @@ export function useMarsAccountNftTokensQuery<TData = TokensResponse>({
startAfter: args.startAfter,
})
: Promise.reject(new Error('Invalid client')),
{ ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
{
...options,
enabled: !!client && (options?.enabled != undefined ? options.enabled : true),
},
)
}
export interface MarsAccountNftAllNftInfoQuery<TData>
Expand All @@ -193,7 +280,10 @@ export function useMarsAccountNftAllNftInfoQuery<TData = AllNftInfoResponseForEm
tokenId: args.tokenId,
})
: Promise.reject(new Error('Invalid client')),
{ ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
{
...options,
enabled: !!client && (options?.enabled != undefined ? options.enabled : true),
},
)
}
export interface MarsAccountNftNftInfoQuery<TData>
Expand All @@ -215,7 +305,10 @@ export function useMarsAccountNftNftInfoQuery<TData = NftInfoResponseForEmpty>({
tokenId: args.tokenId,
})
: Promise.reject(new Error('Invalid client')),
{ ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
{
...options,
enabled: !!client && (options?.enabled != undefined ? options.enabled : true),
},
)
}
export interface MarsAccountNftContractInfoQuery<TData>
Expand All @@ -227,7 +320,10 @@ export function useMarsAccountNftContractInfoQuery<TData = ContractInfoResponse>
return useQuery<ContractInfoResponse, Error, TData>(
marsAccountNftQueryKeys.contractInfo(client?.contractAddress),
() => (client ? client.contractInfo() : Promise.reject(new Error('Invalid client'))),
{ ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
{
...options,
enabled: !!client && (options?.enabled != undefined ? options.enabled : true),
},
)
}
export interface MarsAccountNftNumTokensQuery<TData>
Expand All @@ -239,7 +335,10 @@ export function useMarsAccountNftNumTokensQuery<TData = NumTokensResponse>({
return useQuery<NumTokensResponse, Error, TData>(
marsAccountNftQueryKeys.numTokens(client?.contractAddress),
() => (client ? client.numTokens() : Promise.reject(new Error('Invalid client'))),
{ ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
{
...options,
enabled: !!client && (options?.enabled != undefined ? options.enabled : true),
},
)
}
export interface MarsAccountNftAllOperatorsQuery<TData>
Expand Down Expand Up @@ -267,7 +366,10 @@ export function useMarsAccountNftAllOperatorsQuery<TData = OperatorsResponse>({
startAfter: args.startAfter,
})
: Promise.reject(new Error('Invalid client')),
{ ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
{
...options,
enabled: !!client && (options?.enabled != undefined ? options.enabled : true),
},
)
}
export interface MarsAccountNftApprovalsQuery<TData>
Expand All @@ -291,7 +393,10 @@ export function useMarsAccountNftApprovalsQuery<TData = ApprovalsResponse>({
tokenId: args.tokenId,
})
: Promise.reject(new Error('Invalid client')),
{ ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
{
...options,
enabled: !!client && (options?.enabled != undefined ? options.enabled : true),
},
)
}
export interface MarsAccountNftApprovalQuery<TData>
Expand All @@ -317,7 +422,10 @@ export function useMarsAccountNftApprovalQuery<TData = ApprovalResponse>({
tokenId: args.tokenId,
})
: Promise.reject(new Error('Invalid client')),
{ ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
{
...options,
enabled: !!client && (options?.enabled != undefined ? options.enabled : true),
},
)
}
export interface MarsAccountNftOwnerOfQuery<TData>
Expand All @@ -341,7 +449,10 @@ export function useMarsAccountNftOwnerOfQuery<TData = OwnerOfResponse>({
tokenId: args.tokenId,
})
: Promise.reject(new Error('Invalid client')),
{ ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
{
...options,
enabled: !!client && (options?.enabled != undefined ? options.enabled : true),
},
)
}
export interface MarsAccountNftNextIdQuery<TData> extends MarsAccountNftReactQuery<String, TData> {}
Expand All @@ -352,7 +463,10 @@ export function useMarsAccountNftNextIdQuery<TData = String>({
return useQuery<String, Error, TData>(
marsAccountNftQueryKeys.nextId(client?.contractAddress),
() => (client ? client.nextId() : Promise.reject(new Error('Invalid client'))),
{ ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
{
...options,
enabled: !!client && (options?.enabled != undefined ? options.enabled : true),
},
)
}
export interface MarsAccountNftConfigQuery<TData>
Expand All @@ -364,7 +478,10 @@ export function useMarsAccountNftConfigQuery<TData = NftConfigBaseForString>({
return useQuery<NftConfigBaseForString, Error, TData>(
marsAccountNftQueryKeys.config(client?.contractAddress),
() => (client ? client.config() : Promise.reject(new Error('Invalid client'))),
{ ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
{
...options,
enabled: !!client && (options?.enabled != undefined ? options.enabled : true),
},
)
}
export interface MarsAccountNftUpdateOwnershipMutation {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-nocheck
/**
* This file was automatically generated by @cosmwasm/ts-codegen@0.35.3.
* This file was automatically generated by @cosmwasm/ts-codegen@1.10.0.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run the @cosmwasm/ts-codegen generate command to regenerate this file.
*/
Expand Down
8 changes: 6 additions & 2 deletions scripts/types/generated/mars-account-nft/bundle.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-nocheck
/**
* This file was automatically generated by @cosmwasm/ts-codegen@0.35.3.
* This file was automatically generated by @cosmwasm/ts-codegen@1.10.0.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run the @cosmwasm/ts-codegen generate command to regenerate this file.
*/
Expand All @@ -9,5 +9,9 @@ import * as _0 from './MarsAccountNft.types'
import * as _1 from './MarsAccountNft.client'
import * as _2 from './MarsAccountNft.react-query'
export namespace contracts {
export const MarsAccountNft = { ..._0, ..._1, ..._2 }
export const MarsAccountNft = {
..._0,
..._1,
..._2,
}
}
Loading

0 comments on commit f167daa

Please sign in to comment.