-
-
Save pyramation/a9520ccf131177b1841e02a97d7d3731 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/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<CW4GroupQueryClient, QueryClientParams>({ | |
key: "cW4GroupQueryClient", | |
get: ({ | |
contractAddress | |
}) => ({ | |
get | |
}) => { | |
const client = get(cosmWasmClient); | |
return new CW4GroupQueryClient(client, contractAddress); | |
} | |
}); | |
export const adminSelector = selectorFamily<AdminResponse, QueryClientParams & { | |
params: Parameters<CW4GroupQueryClient["admin"]>; | |
}>({ | |
key: "cW4GroupAdmin", | |
get: ({ | |
params, | |
...queryClientParams | |
}) => async ({ | |
get | |
}) => { | |
const client = get(queryClient(queryClientParams)); | |
return await client.admin(...params); | |
} | |
}); | |
export const totalWeightSelector = selectorFamily<TotalWeightResponse, QueryClientParams & { | |
params: Parameters<CW4GroupQueryClient["totalWeight"]>; | |
}>({ | |
key: "cW4GroupTotalWeight", | |
get: ({ | |
params, | |
...queryClientParams | |
}) => async ({ | |
get | |
}) => { | |
const client = get(queryClient(queryClientParams)); | |
return await client.totalWeight(...params); | |
} | |
}); | |
export const listMembersSelector = selectorFamily<ListMembersResponse, QueryClientParams & { | |
params: Parameters<CW4GroupQueryClient["listMembers"]>; | |
}>({ | |
key: "cW4GroupListMembers", | |
get: ({ | |
params, | |
...queryClientParams | |
}) => async ({ | |
get | |
}) => { | |
const client = get(queryClient(queryClientParams)); | |
return await client.listMembers(...params); | |
} | |
}); | |
export const memberSelector = selectorFamily<MemberResponse, QueryClientParams & { | |
params: Parameters<CW4GroupQueryClient["member"]>; | |
}>({ | |
key: "cW4GroupMember", | |
get: ({ | |
params, | |
...queryClientParams | |
}) => async ({ | |
get | |
}) => { | |
const client = get(queryClient(queryClientParams)); | |
return await client.member(...params); | |
} | |
}); | |
export const hooksSelector = selectorFamily<HooksResponse, QueryClientParams & { | |
params: Parameters<CW4GroupQueryClient["hooks"]>; | |
}>({ | |
key: "cW4GroupHooks", | |
get: ({ | |
params, | |
...queryClientParams | |
}) => async ({ | |
get | |
}) => { | |
const client = get(queryClient(queryClientParams)); | |
return await client.hooks(...params); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment