-
-
Save pyramation/48b28a75def1a16b233b369297f05f0e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This file was automatically generated by cosmwasm-typescript-gen. | |
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, | |
* and run the cosmwasm-typescript-gen generate command to regenerate this file. | |
*/ | |
import { selectorFamily } from "recoil"; | |
import { cosmWasmClient } from "./chain"; | |
import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoFor_RoyaltyInfoResponse, RoyaltyInfoResponse } from "./MinterContract.ts"; | |
import { MinterQueryClient } from "./MinterContract.ts"; | |
type QueryClientParams = { | |
contractAddress: string; | |
}; | |
export const queryClient = selectorFamily<MinterQueryClient | undefined, QueryClientParams>({ | |
key: "minterQueryClient", | |
get: ({ | |
contractAddress | |
}) => ({ | |
get | |
}) => { | |
const client = get(cosmWasmClient); | |
if (!client) return; | |
return new MinterQueryClient(client, contractAddress); | |
} | |
}); | |
export const configSelector = selectorFamily<ConfigResponse | undefined, QueryClientParams & { | |
params: Parameters<MinterQueryClient["config"]>; | |
}>({ | |
key: "minterConfig", | |
get: ({ | |
params, | |
...queryClientParams | |
}) => async ({ | |
get | |
}) => { | |
const client = get(queryClient(queryClientParams)); | |
if (!client) return; | |
return await client.config(...params); | |
} | |
}); | |
export const mintableNumTokensSelector = selectorFamily<MintableNumTokensResponse | undefined, QueryClientParams & { | |
params: Parameters<MinterQueryClient["mintableNumTokens"]>; | |
}>({ | |
key: "minterMintableNumTokens", | |
get: ({ | |
params, | |
...queryClientParams | |
}) => async ({ | |
get | |
}) => { | |
const client = get(queryClient(queryClientParams)); | |
if (!client) return; | |
return await client.mintableNumTokens(...params); | |
} | |
}); | |
export const startTimeSelector = selectorFamily<StartTimeResponse | undefined, QueryClientParams & { | |
params: Parameters<MinterQueryClient["startTime"]>; | |
}>({ | |
key: "minterStartTime", | |
get: ({ | |
params, | |
...queryClientParams | |
}) => async ({ | |
get | |
}) => { | |
const client = get(queryClient(queryClientParams)); | |
if (!client) return; | |
return await client.startTime(...params); | |
} | |
}); | |
export const mintPriceSelector = selectorFamily<MintPriceResponse | undefined, QueryClientParams & { | |
params: Parameters<MinterQueryClient["mintPrice"]>; | |
}>({ | |
key: "minterMintPrice", | |
get: ({ | |
params, | |
...queryClientParams | |
}) => async ({ | |
get | |
}) => { | |
const client = get(queryClient(queryClientParams)); | |
if (!client) return; | |
return await client.mintPrice(...params); | |
} | |
}); | |
export const mintCountSelector = selectorFamily<MintCountResponse | undefined, QueryClientParams & { | |
params: Parameters<MinterQueryClient["mintCount"]>; | |
}>({ | |
key: "minterMintCount", | |
get: ({ | |
params, | |
...queryClientParams | |
}) => async ({ | |
get | |
}) => { | |
const client = get(queryClient(queryClientParams)); | |
if (!client) return; | |
return await client.mintCount(...params); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment