wasm-ast-types 0.26.4 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE-Apache +201 -0
- package/LICENSE-MIT +21 -0
- package/README.md +1 -1
- package/{types/client → client}/client.d.ts +2 -2
- package/client/client.js +275 -0
- package/client/index.js +17 -0
- package/{types/context → context}/context.d.ts +9 -22
- package/context/context.js +114 -0
- package/{types/context → context}/imports.d.ts +9 -8
- package/context/imports.js +166 -0
- package/context/index.js +18 -0
- package/esm/client/client.js +238 -0
- package/esm/client/index.js +1 -0
- package/esm/context/context.js +104 -0
- package/esm/context/imports.js +136 -0
- package/{module → esm}/context/index.js +1 -1
- package/{src/index.ts → esm/index.js} +0 -1
- package/esm/message-builder/message-builder.js +64 -0
- package/esm/message-composer/message-composer.js +105 -0
- package/esm/provider/provider.js +97 -0
- package/esm/react-query/react-query.js +458 -0
- package/esm/recoil/recoil.js +110 -0
- package/esm/utils/babel.js +231 -0
- package/esm/utils/constants.js +20 -0
- package/esm/utils/ref.js +4 -0
- package/esm/utils/types.js +343 -0
- package/{types/index.d.ts → index.d.ts} +0 -1
- package/index.js +24 -0
- package/message-builder/index.js +17 -0
- package/{types/message-builder → message-builder}/message-builder.d.ts +1 -1
- package/message-builder/message-builder.js +91 -0
- package/message-composer/index.d.ts +1 -0
- package/message-composer/index.js +17 -0
- package/{types/message-composer → message-composer}/message-composer.d.ts +1 -1
- package/message-composer/message-composer.js +133 -0
- package/package.json +19 -68
- package/provider/index.d.ts +1 -0
- package/provider/index.js +17 -0
- package/provider/provider.js +127 -0
- package/react-query/index.d.ts +1 -0
- package/react-query/index.js +17 -0
- package/{types/react-query → react-query}/react-query.d.ts +2 -3
- package/react-query/react-query.js +490 -0
- package/recoil/index.d.ts +1 -0
- package/recoil/index.js +17 -0
- package/{types/recoil → recoil}/recoil.d.ts +1 -1
- package/recoil/recoil.js +140 -0
- package/{types/utils → utils}/babel.d.ts +9 -8
- package/utils/babel.js +285 -0
- package/utils/constants.js +46 -0
- package/utils/index.js +26 -0
- package/{types/utils → utils}/ref.d.ts +1 -1
- package/utils/ref.js +8 -0
- package/{types/utils → utils}/types.d.ts +8 -8
- package/utils/types.js +379 -0
- package/main/client/client.js +0 -196
- package/main/client/index.js +0 -16
- package/main/client/test/ts-client.account-nfts.spec.js +0 -28
- package/main/client/test/ts-client.arrays-ref.spec.js +0 -19
- package/main/client/test/ts-client.arrays.spec.js +0 -26
- package/main/client/test/ts-client.cw-named-groups.test.js +0 -19
- package/main/client/test/ts-client.cw-proposal-single.test.js +0 -23
- package/main/client/test/ts-client.empty-enums.spec.js +0 -13
- package/main/client/test/ts-client.issue-101.spec.js +0 -23
- package/main/client/test/ts-client.issue-103.test.js +0 -44
- package/main/client/test/ts-client.issue-71.test.js +0 -81
- package/main/client/test/ts-client.issue-98.test.js +0 -28
- package/main/client/test/ts-client.issues.test.js +0 -81
- package/main/client/test/ts-client.overrides.spec.js +0 -33
- package/main/client/test/ts-client.sg721.spec.js +0 -19
- package/main/client/test/ts-client.spec.js +0 -87
- package/main/client/test/ts-client.vectis.spec.js +0 -46
- package/main/client/test/ts-client.wager.spec.js +0 -39
- package/main/context/context.js +0 -162
- package/main/context/imports.js +0 -159
- package/main/context/index.js +0 -27
- package/main/index.js +0 -104
- package/main/message-builder/index.js +0 -16
- package/main/message-builder/message-builder.js +0 -62
- package/main/message-builder/message-builder.spec.js +0 -20
- package/main/message-composer/index.js +0 -16
- package/main/message-composer/message-composer.js +0 -86
- package/main/message-composer/message-composer.spec.js +0 -23
- package/main/provider/index.js +0 -16
- package/main/provider/provider.js +0 -71
- package/main/provider/provider.spec.js +0 -60
- package/main/react-query/index.js +0 -16
- package/main/react-query/react-query.js +0 -413
- package/main/react-query/react-query.spec.js +0 -91
- package/main/recoil/index.js +0 -16
- package/main/recoil/recoil.js +0 -61
- package/main/recoil/recoil.spec.js +0 -20
- package/main/types.js +0 -4
- package/main/utils/babel.js +0 -282
- package/main/utils/babel.spec.js +0 -109
- package/main/utils/constants.js +0 -26
- package/main/utils/index.js +0 -65
- package/main/utils/ref.js +0 -12
- package/main/utils/types.js +0 -343
- package/module/client/client.js +0 -166
- package/module/client/index.js +0 -1
- package/module/client/test/ts-client.account-nfts.spec.js +0 -25
- package/module/client/test/ts-client.arrays-ref.spec.js +0 -16
- package/module/client/test/ts-client.arrays.spec.js +0 -23
- package/module/client/test/ts-client.cw-named-groups.test.js +0 -16
- package/module/client/test/ts-client.cw-proposal-single.test.js +0 -20
- package/module/client/test/ts-client.empty-enums.spec.js +0 -10
- package/module/client/test/ts-client.issue-101.spec.js +0 -22
- package/module/client/test/ts-client.issue-103.test.js +0 -41
- package/module/client/test/ts-client.issue-71.test.js +0 -21
- package/module/client/test/ts-client.issue-98.test.js +0 -25
- package/module/client/test/ts-client.issues.test.js +0 -21
- package/module/client/test/ts-client.overrides.spec.js +0 -30
- package/module/client/test/ts-client.sg721.spec.js +0 -16
- package/module/client/test/ts-client.spec.js +0 -84
- package/module/client/test/ts-client.vectis.spec.js +0 -43
- package/module/client/test/ts-client.wager.spec.js +0 -36
- package/module/context/context.js +0 -116
- package/module/context/imports.js +0 -127
- package/module/index.js +0 -9
- package/module/message-builder/index.js +0 -1
- package/module/message-builder/message-builder.js +0 -52
- package/module/message-builder/message-builder.spec.js +0 -17
- package/module/message-composer/index.js +0 -1
- package/module/message-composer/message-composer.js +0 -70
- package/module/message-composer/message-composer.spec.js +0 -20
- package/module/provider/index.js +0 -1
- package/module/provider/provider.js +0 -45
- package/module/provider/provider.spec.js +0 -58
- package/module/react-query/index.js +0 -1
- package/module/react-query/react-query.js +0 -403
- package/module/react-query/react-query.spec.js +0 -85
- package/module/recoil/index.js +0 -1
- package/module/recoil/recoil.js +0 -46
- package/module/recoil/recoil.spec.js +0 -14
- package/module/types.js +0 -3
- package/module/utils/babel.js +0 -203
- package/module/utils/babel.spec.js +0 -70
- package/module/utils/constants.js +0 -12
- package/module/utils/index.js +0 -6
- package/module/utils/ref.js +0 -4
- package/module/utils/types.js +0 -301
- package/src/client/client.ts +0 -584
- package/src/client/index.ts +0 -1
- package/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap +0 -497
- package/src/client/test/__snapshots__/ts-client.arrays-ref.spec.ts.snap +0 -452
- package/src/client/test/__snapshots__/ts-client.arrays.spec.ts.snap +0 -101
- package/src/client/test/__snapshots__/ts-client.cw-named-groups.test.ts.snap +0 -141
- package/src/client/test/__snapshots__/ts-client.cw-proposal-single.test.ts.snap +0 -341
- package/src/client/test/__snapshots__/ts-client.empty-enums.spec.ts.snap +0 -20
- package/src/client/test/__snapshots__/ts-client.issue-101.spec.ts.snap +0 -47
- package/src/client/test/__snapshots__/ts-client.issue-103.test.ts.snap +0 -79
- package/src/client/test/__snapshots__/ts-client.issue-71.test.ts.snap +0 -432
- package/src/client/test/__snapshots__/ts-client.issue-98.test.ts.snap +0 -117
- package/src/client/test/__snapshots__/ts-client.issues.test.ts.snap +0 -984
- package/src/client/test/__snapshots__/ts-client.overrides.spec.ts.snap +0 -709
- package/src/client/test/__snapshots__/ts-client.sg721.spec.ts.snap +0 -350
- package/src/client/test/__snapshots__/ts-client.spec.ts.snap +0 -723
- package/src/client/test/__snapshots__/ts-client.vectis.spec.ts.snap +0 -337
- package/src/client/test/__snapshots__/ts-client.wager.spec.ts.snap +0 -132
- package/src/client/test/ts-client.account-nfts.spec.ts +0 -55
- package/src/client/test/ts-client.arrays-ref.spec.ts +0 -48
- package/src/client/test/ts-client.arrays.spec.ts +0 -58
- package/src/client/test/ts-client.cw-named-groups.test.ts +0 -48
- package/src/client/test/ts-client.cw-proposal-single.test.ts +0 -50
- package/src/client/test/ts-client.empty-enums.spec.ts +0 -28
- package/src/client/test/ts-client.issue-101.spec.ts +0 -37
- package/src/client/test/ts-client.issue-103.test.ts +0 -106
- package/src/client/test/ts-client.issue-71.test.ts +0 -51
- package/src/client/test/ts-client.issue-98.test.ts +0 -55
- package/src/client/test/ts-client.issues.test.ts +0 -52
- package/src/client/test/ts-client.overrides.spec.ts +0 -74
- package/src/client/test/ts-client.sg721.spec.ts +0 -46
- package/src/client/test/ts-client.spec.ts +0 -166
- package/src/client/test/ts-client.vectis.spec.ts +0 -97
- package/src/client/test/ts-client.wager.spec.ts +0 -63
- package/src/context/context.ts +0 -229
- package/src/context/imports.ts +0 -195
- package/src/context/index.ts +0 -2
- package/src/message-builder/__snapshots__/message-builder.spec.ts.snap +0 -270
- package/src/message-builder/message-builder.spec.ts +0 -24
- package/src/message-builder/message-builder.ts +0 -119
- package/src/message-composer/__snapshots__/message-composer.spec.ts.snap +0 -331
- package/src/message-composer/index.ts +0 -1
- package/src/message-composer/message-composer.spec.ts +0 -46
- package/src/message-composer/message-composer.ts +0 -262
- package/src/provider/__snapshots__/provider.spec.ts.snap +0 -49
- package/src/provider/index.ts +0 -1
- package/src/provider/provider.spec.ts +0 -81
- package/src/provider/provider.ts +0 -237
- package/src/react-query/__snapshots__/react-query.spec.ts.snap +0 -1359
- package/src/react-query/index.ts +0 -1
- package/src/react-query/react-query.spec.ts +0 -116
- package/src/react-query/react-query.ts +0 -1072
- package/src/recoil/__snapshots__/recoil.spec.ts.snap +0 -203
- package/src/recoil/index.ts +0 -1
- package/src/recoil/recoil.spec.ts +0 -38
- package/src/recoil/recoil.ts +0 -307
- package/src/types.ts +0 -44
- package/src/utils/__snapshots__/babel.spec.ts.snap +0 -75
- package/src/utils/babel.spec.ts +0 -511
- package/src/utils/babel.ts +0 -352
- package/src/utils/constants.ts +0 -37
- package/src/utils/ref.ts +0 -6
- package/src/utils/types.ts +0 -478
- package/types/types.d.ts +0 -41
- /package/{types/client → client}/index.d.ts +0 -0
- /package/{types/context → context}/index.d.ts +0 -0
- /package/{src/message-builder/index.ts → esm/message-builder/index.js} +0 -0
- /package/{types/message-composer/index.d.ts → esm/message-composer/index.js} +0 -0
- /package/{types/provider/index.d.ts → esm/provider/index.js} +0 -0
- /package/{types/react-query/index.d.ts → esm/react-query/index.js} +0 -0
- /package/{types/recoil/index.d.ts → esm/recoil/index.js} +0 -0
- /package/{src/utils/index.ts → esm/utils/index.js} +0 -0
- /package/{types/message-builder → message-builder}/index.d.ts +0 -0
- /package/{types/provider → provider}/provider.d.ts +0 -0
- /package/{types/utils → utils}/constants.d.ts +0 -0
- /package/{types/utils → utils}/index.d.ts +0 -0
@@ -1,1359 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`createReactQueryHooks 1`] = `
|
4
|
-
"export interface Sg721ReactQuery<TResponse, TData = TResponse> {
|
5
|
-
client: Sg721QueryClient;
|
6
|
-
options?: UseQueryOptions<TResponse, Error, TData>;
|
7
|
-
}
|
8
|
-
export interface Sg721CollectionInfoQuery<TData> extends Sg721ReactQuery<CollectionInfoResponse, TData> {}
|
9
|
-
export function useSg721CollectionInfoQuery<TData = CollectionInfoResponse>({
|
10
|
-
client,
|
11
|
-
options
|
12
|
-
}: Sg721CollectionInfoQuery<TData>) {
|
13
|
-
return useQuery<CollectionInfoResponse, Error, TData>([\\"sg721CollectionInfo\\", client.contractAddress], () => client.collectionInfo(), options);
|
14
|
-
}
|
15
|
-
export interface Sg721MinterQuery<TData> extends Sg721ReactQuery<MinterResponse, TData> {}
|
16
|
-
export function useSg721MinterQuery<TData = MinterResponse>({
|
17
|
-
client,
|
18
|
-
options
|
19
|
-
}: Sg721MinterQuery<TData>) {
|
20
|
-
return useQuery<MinterResponse, Error, TData>([\\"sg721Minter\\", client.contractAddress], () => client.minter(), options);
|
21
|
-
}
|
22
|
-
export interface Sg721AllTokensQuery<TData> extends Sg721ReactQuery<AllTokensResponse, TData> {
|
23
|
-
args: {
|
24
|
-
limit?: number;
|
25
|
-
startAfter?: string;
|
26
|
-
};
|
27
|
-
}
|
28
|
-
export function useSg721AllTokensQuery<TData = AllTokensResponse>({
|
29
|
-
client,
|
30
|
-
args,
|
31
|
-
options
|
32
|
-
}: Sg721AllTokensQuery<TData>) {
|
33
|
-
return useQuery<AllTokensResponse, Error, TData>([\\"sg721AllTokens\\", client.contractAddress, JSON.stringify(args)], () => client.allTokens({
|
34
|
-
limit: args.limit,
|
35
|
-
startAfter: args.startAfter
|
36
|
-
}), options);
|
37
|
-
}
|
38
|
-
export interface Sg721TokensQuery<TData> extends Sg721ReactQuery<TokensResponse, TData> {
|
39
|
-
args: {
|
40
|
-
limit?: number;
|
41
|
-
owner: string;
|
42
|
-
startAfter?: string;
|
43
|
-
};
|
44
|
-
}
|
45
|
-
export function useSg721TokensQuery<TData = TokensResponse>({
|
46
|
-
client,
|
47
|
-
args,
|
48
|
-
options
|
49
|
-
}: Sg721TokensQuery<TData>) {
|
50
|
-
return useQuery<TokensResponse, Error, TData>([\\"sg721Tokens\\", client.contractAddress, JSON.stringify(args)], () => client.tokens({
|
51
|
-
limit: args.limit,
|
52
|
-
owner: args.owner,
|
53
|
-
startAfter: args.startAfter
|
54
|
-
}), options);
|
55
|
-
}
|
56
|
-
export interface Sg721AllNftInfoQuery<TData> extends Sg721ReactQuery<AllNftInfoResponse, TData> {
|
57
|
-
args: {
|
58
|
-
includeExpired?: boolean;
|
59
|
-
tokenId: string;
|
60
|
-
};
|
61
|
-
}
|
62
|
-
export function useSg721AllNftInfoQuery<TData = AllNftInfoResponse>({
|
63
|
-
client,
|
64
|
-
args,
|
65
|
-
options
|
66
|
-
}: Sg721AllNftInfoQuery<TData>) {
|
67
|
-
return useQuery<AllNftInfoResponse, Error, TData>([\\"sg721AllNftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.allNftInfo({
|
68
|
-
includeExpired: args.includeExpired,
|
69
|
-
tokenId: args.tokenId
|
70
|
-
}), options);
|
71
|
-
}
|
72
|
-
export interface Sg721NftInfoQuery<TData> extends Sg721ReactQuery<NftInfoResponse, TData> {
|
73
|
-
args: {
|
74
|
-
tokenId: string;
|
75
|
-
};
|
76
|
-
}
|
77
|
-
export function useSg721NftInfoQuery<TData = NftInfoResponse>({
|
78
|
-
client,
|
79
|
-
args,
|
80
|
-
options
|
81
|
-
}: Sg721NftInfoQuery<TData>) {
|
82
|
-
return useQuery<NftInfoResponse, Error, TData>([\\"sg721NftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.nftInfo({
|
83
|
-
tokenId: args.tokenId
|
84
|
-
}), options);
|
85
|
-
}
|
86
|
-
export interface Sg721ContractInfoQuery<TData> extends Sg721ReactQuery<ContractInfoResponse, TData> {}
|
87
|
-
export function useSg721ContractInfoQuery<TData = ContractInfoResponse>({
|
88
|
-
client,
|
89
|
-
options
|
90
|
-
}: Sg721ContractInfoQuery<TData>) {
|
91
|
-
return useQuery<ContractInfoResponse, Error, TData>([\\"sg721ContractInfo\\", client.contractAddress], () => client.contractInfo(), options);
|
92
|
-
}
|
93
|
-
export interface Sg721NumTokensQuery<TData> extends Sg721ReactQuery<NumTokensResponse, TData> {}
|
94
|
-
export function useSg721NumTokensQuery<TData = NumTokensResponse>({
|
95
|
-
client,
|
96
|
-
options
|
97
|
-
}: Sg721NumTokensQuery<TData>) {
|
98
|
-
return useQuery<NumTokensResponse, Error, TData>([\\"sg721NumTokens\\", client.contractAddress], () => client.numTokens(), options);
|
99
|
-
}
|
100
|
-
export interface Sg721AllOperatorsQuery<TData> extends Sg721ReactQuery<AllOperatorsResponse, TData> {
|
101
|
-
args: {
|
102
|
-
includeExpired?: boolean;
|
103
|
-
limit?: number;
|
104
|
-
owner: string;
|
105
|
-
startAfter?: string;
|
106
|
-
};
|
107
|
-
}
|
108
|
-
export function useSg721AllOperatorsQuery<TData = AllOperatorsResponse>({
|
109
|
-
client,
|
110
|
-
args,
|
111
|
-
options
|
112
|
-
}: Sg721AllOperatorsQuery<TData>) {
|
113
|
-
return useQuery<AllOperatorsResponse, Error, TData>([\\"sg721AllOperators\\", client.contractAddress, JSON.stringify(args)], () => client.allOperators({
|
114
|
-
includeExpired: args.includeExpired,
|
115
|
-
limit: args.limit,
|
116
|
-
owner: args.owner,
|
117
|
-
startAfter: args.startAfter
|
118
|
-
}), options);
|
119
|
-
}
|
120
|
-
export interface Sg721ApprovalsQuery<TData> extends Sg721ReactQuery<ApprovalsResponse, TData> {
|
121
|
-
args: {
|
122
|
-
includeExpired?: boolean;
|
123
|
-
tokenId: string;
|
124
|
-
};
|
125
|
-
}
|
126
|
-
export function useSg721ApprovalsQuery<TData = ApprovalsResponse>({
|
127
|
-
client,
|
128
|
-
args,
|
129
|
-
options
|
130
|
-
}: Sg721ApprovalsQuery<TData>) {
|
131
|
-
return useQuery<ApprovalsResponse, Error, TData>([\\"sg721Approvals\\", client.contractAddress, JSON.stringify(args)], () => client.approvals({
|
132
|
-
includeExpired: args.includeExpired,
|
133
|
-
tokenId: args.tokenId
|
134
|
-
}), options);
|
135
|
-
}
|
136
|
-
export interface Sg721ApprovalQuery<TData> extends Sg721ReactQuery<ApprovalResponse, TData> {
|
137
|
-
args: {
|
138
|
-
includeExpired?: boolean;
|
139
|
-
spender: string;
|
140
|
-
tokenId: string;
|
141
|
-
};
|
142
|
-
}
|
143
|
-
export function useSg721ApprovalQuery<TData = ApprovalResponse>({
|
144
|
-
client,
|
145
|
-
args,
|
146
|
-
options
|
147
|
-
}: Sg721ApprovalQuery<TData>) {
|
148
|
-
return useQuery<ApprovalResponse, Error, TData>([\\"sg721Approval\\", client.contractAddress, JSON.stringify(args)], () => client.approval({
|
149
|
-
includeExpired: args.includeExpired,
|
150
|
-
spender: args.spender,
|
151
|
-
tokenId: args.tokenId
|
152
|
-
}), options);
|
153
|
-
}
|
154
|
-
export interface Sg721OwnerOfQuery<TData> extends Sg721ReactQuery<OwnerOfResponse, TData> {
|
155
|
-
args: {
|
156
|
-
includeExpired?: boolean;
|
157
|
-
tokenId: string;
|
158
|
-
};
|
159
|
-
}
|
160
|
-
export function useSg721OwnerOfQuery<TData = OwnerOfResponse>({
|
161
|
-
client,
|
162
|
-
args,
|
163
|
-
options
|
164
|
-
}: Sg721OwnerOfQuery<TData>) {
|
165
|
-
return useQuery<OwnerOfResponse, Error, TData>([\\"sg721OwnerOf\\", client.contractAddress, JSON.stringify(args)], () => client.ownerOf({
|
166
|
-
includeExpired: args.includeExpired,
|
167
|
-
tokenId: args.tokenId
|
168
|
-
}), options);
|
169
|
-
}"
|
170
|
-
`;
|
171
|
-
|
172
|
-
exports[`createReactQueryHooks 2`] = `
|
173
|
-
"export interface Sg721ReactQuery<TResponse, TData = TResponse> {
|
174
|
-
client: Sg721QueryClient | undefined;
|
175
|
-
options?: UseQueryOptions<TResponse, Error, TData>;
|
176
|
-
}
|
177
|
-
export interface Sg721CollectionInfoQuery<TData> extends Sg721ReactQuery<CollectionInfoResponse, TData> {}
|
178
|
-
export function useSg721CollectionInfoQuery<TData = CollectionInfoResponse>({
|
179
|
-
client,
|
180
|
-
options
|
181
|
-
}: Sg721CollectionInfoQuery<TData>) {
|
182
|
-
return useQuery<CollectionInfoResponse, Error, TData>([\\"sg721CollectionInfo\\", client?.contractAddress], () => client ? client.collectionInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
183
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
184
|
-
});
|
185
|
-
}
|
186
|
-
export interface Sg721MinterQuery<TData> extends Sg721ReactQuery<MinterResponse, TData> {}
|
187
|
-
export function useSg721MinterQuery<TData = MinterResponse>({
|
188
|
-
client,
|
189
|
-
options
|
190
|
-
}: Sg721MinterQuery<TData>) {
|
191
|
-
return useQuery<MinterResponse, Error, TData>([\\"sg721Minter\\", client?.contractAddress], () => client ? client.minter() : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
192
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
193
|
-
});
|
194
|
-
}
|
195
|
-
export interface Sg721AllTokensQuery<TData> extends Sg721ReactQuery<AllTokensResponse, TData> {
|
196
|
-
args: {
|
197
|
-
limit?: number;
|
198
|
-
startAfter?: string;
|
199
|
-
};
|
200
|
-
}
|
201
|
-
export function useSg721AllTokensQuery<TData = AllTokensResponse>({
|
202
|
-
client,
|
203
|
-
args,
|
204
|
-
options
|
205
|
-
}: Sg721AllTokensQuery<TData>) {
|
206
|
-
return useQuery<AllTokensResponse, Error, TData>([\\"sg721AllTokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allTokens({
|
207
|
-
limit: args.limit,
|
208
|
-
startAfter: args.startAfter
|
209
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
210
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
211
|
-
});
|
212
|
-
}
|
213
|
-
export interface Sg721TokensQuery<TData> extends Sg721ReactQuery<TokensResponse, TData> {
|
214
|
-
args: {
|
215
|
-
limit?: number;
|
216
|
-
owner: string;
|
217
|
-
startAfter?: string;
|
218
|
-
};
|
219
|
-
}
|
220
|
-
export function useSg721TokensQuery<TData = TokensResponse>({
|
221
|
-
client,
|
222
|
-
args,
|
223
|
-
options
|
224
|
-
}: Sg721TokensQuery<TData>) {
|
225
|
-
return useQuery<TokensResponse, Error, TData>([\\"sg721Tokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.tokens({
|
226
|
-
limit: args.limit,
|
227
|
-
owner: args.owner,
|
228
|
-
startAfter: args.startAfter
|
229
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
230
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
231
|
-
});
|
232
|
-
}
|
233
|
-
export interface Sg721AllNftInfoQuery<TData> extends Sg721ReactQuery<AllNftInfoResponse, TData> {
|
234
|
-
args: {
|
235
|
-
includeExpired?: boolean;
|
236
|
-
tokenId: string;
|
237
|
-
};
|
238
|
-
}
|
239
|
-
export function useSg721AllNftInfoQuery<TData = AllNftInfoResponse>({
|
240
|
-
client,
|
241
|
-
args,
|
242
|
-
options
|
243
|
-
}: Sg721AllNftInfoQuery<TData>) {
|
244
|
-
return useQuery<AllNftInfoResponse, Error, TData>([\\"sg721AllNftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allNftInfo({
|
245
|
-
includeExpired: args.includeExpired,
|
246
|
-
tokenId: args.tokenId
|
247
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
248
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
249
|
-
});
|
250
|
-
}
|
251
|
-
export interface Sg721NftInfoQuery<TData> extends Sg721ReactQuery<NftInfoResponse, TData> {
|
252
|
-
args: {
|
253
|
-
tokenId: string;
|
254
|
-
};
|
255
|
-
}
|
256
|
-
export function useSg721NftInfoQuery<TData = NftInfoResponse>({
|
257
|
-
client,
|
258
|
-
args,
|
259
|
-
options
|
260
|
-
}: Sg721NftInfoQuery<TData>) {
|
261
|
-
return useQuery<NftInfoResponse, Error, TData>([\\"sg721NftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.nftInfo({
|
262
|
-
tokenId: args.tokenId
|
263
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
264
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
265
|
-
});
|
266
|
-
}
|
267
|
-
export interface Sg721ContractInfoQuery<TData> extends Sg721ReactQuery<ContractInfoResponse, TData> {}
|
268
|
-
export function useSg721ContractInfoQuery<TData = ContractInfoResponse>({
|
269
|
-
client,
|
270
|
-
options
|
271
|
-
}: Sg721ContractInfoQuery<TData>) {
|
272
|
-
return useQuery<ContractInfoResponse, Error, TData>([\\"sg721ContractInfo\\", client?.contractAddress], () => client ? client.contractInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
273
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
274
|
-
});
|
275
|
-
}
|
276
|
-
export interface Sg721NumTokensQuery<TData> extends Sg721ReactQuery<NumTokensResponse, TData> {}
|
277
|
-
export function useSg721NumTokensQuery<TData = NumTokensResponse>({
|
278
|
-
client,
|
279
|
-
options
|
280
|
-
}: Sg721NumTokensQuery<TData>) {
|
281
|
-
return useQuery<NumTokensResponse, Error, TData>([\\"sg721NumTokens\\", client?.contractAddress], () => client ? client.numTokens() : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
282
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
283
|
-
});
|
284
|
-
}
|
285
|
-
export interface Sg721AllOperatorsQuery<TData> extends Sg721ReactQuery<AllOperatorsResponse, TData> {
|
286
|
-
args: {
|
287
|
-
includeExpired?: boolean;
|
288
|
-
limit?: number;
|
289
|
-
owner: string;
|
290
|
-
startAfter?: string;
|
291
|
-
};
|
292
|
-
}
|
293
|
-
export function useSg721AllOperatorsQuery<TData = AllOperatorsResponse>({
|
294
|
-
client,
|
295
|
-
args,
|
296
|
-
options
|
297
|
-
}: Sg721AllOperatorsQuery<TData>) {
|
298
|
-
return useQuery<AllOperatorsResponse, Error, TData>([\\"sg721AllOperators\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allOperators({
|
299
|
-
includeExpired: args.includeExpired,
|
300
|
-
limit: args.limit,
|
301
|
-
owner: args.owner,
|
302
|
-
startAfter: args.startAfter
|
303
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
304
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
305
|
-
});
|
306
|
-
}
|
307
|
-
export interface Sg721ApprovalsQuery<TData> extends Sg721ReactQuery<ApprovalsResponse, TData> {
|
308
|
-
args: {
|
309
|
-
includeExpired?: boolean;
|
310
|
-
tokenId: string;
|
311
|
-
};
|
312
|
-
}
|
313
|
-
export function useSg721ApprovalsQuery<TData = ApprovalsResponse>({
|
314
|
-
client,
|
315
|
-
args,
|
316
|
-
options
|
317
|
-
}: Sg721ApprovalsQuery<TData>) {
|
318
|
-
return useQuery<ApprovalsResponse, Error, TData>([\\"sg721Approvals\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approvals({
|
319
|
-
includeExpired: args.includeExpired,
|
320
|
-
tokenId: args.tokenId
|
321
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
322
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
323
|
-
});
|
324
|
-
}
|
325
|
-
export interface Sg721ApprovalQuery<TData> extends Sg721ReactQuery<ApprovalResponse, TData> {
|
326
|
-
args: {
|
327
|
-
includeExpired?: boolean;
|
328
|
-
spender: string;
|
329
|
-
tokenId: string;
|
330
|
-
};
|
331
|
-
}
|
332
|
-
export function useSg721ApprovalQuery<TData = ApprovalResponse>({
|
333
|
-
client,
|
334
|
-
args,
|
335
|
-
options
|
336
|
-
}: Sg721ApprovalQuery<TData>) {
|
337
|
-
return useQuery<ApprovalResponse, Error, TData>([\\"sg721Approval\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approval({
|
338
|
-
includeExpired: args.includeExpired,
|
339
|
-
spender: args.spender,
|
340
|
-
tokenId: args.tokenId
|
341
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
342
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
343
|
-
});
|
344
|
-
}
|
345
|
-
export interface Sg721OwnerOfQuery<TData> extends Sg721ReactQuery<OwnerOfResponse, TData> {
|
346
|
-
args: {
|
347
|
-
includeExpired?: boolean;
|
348
|
-
tokenId: string;
|
349
|
-
};
|
350
|
-
}
|
351
|
-
export function useSg721OwnerOfQuery<TData = OwnerOfResponse>({
|
352
|
-
client,
|
353
|
-
args,
|
354
|
-
options
|
355
|
-
}: Sg721OwnerOfQuery<TData>) {
|
356
|
-
return useQuery<OwnerOfResponse, Error, TData>([\\"sg721OwnerOf\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.ownerOf({
|
357
|
-
includeExpired: args.includeExpired,
|
358
|
-
tokenId: args.tokenId
|
359
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
360
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
361
|
-
});
|
362
|
-
}"
|
363
|
-
`;
|
364
|
-
|
365
|
-
exports[`createReactQueryHooks 3`] = `
|
366
|
-
"export interface Sg721ReactQuery<TResponse, TData = TResponse> {
|
367
|
-
client: Sg721QueryClient;
|
368
|
-
options?: Omit<UseQueryOptions<TResponse, Error, TData>, \\"'queryKey' | 'queryFn' | 'initialData'\\"> & {
|
369
|
-
initialData?: undefined;
|
370
|
-
};
|
371
|
-
}
|
372
|
-
export interface Sg721CollectionInfoQuery<TData> extends Sg721ReactQuery<CollectionInfoResponse, TData> {}
|
373
|
-
export function useSg721CollectionInfoQuery<TData = CollectionInfoResponse>({
|
374
|
-
client,
|
375
|
-
options
|
376
|
-
}: Sg721CollectionInfoQuery<TData>) {
|
377
|
-
return useQuery<CollectionInfoResponse, Error, TData>([\\"sg721CollectionInfo\\", client.contractAddress], () => client.collectionInfo(), options);
|
378
|
-
}
|
379
|
-
export interface Sg721MinterQuery<TData> extends Sg721ReactQuery<MinterResponse, TData> {}
|
380
|
-
export function useSg721MinterQuery<TData = MinterResponse>({
|
381
|
-
client,
|
382
|
-
options
|
383
|
-
}: Sg721MinterQuery<TData>) {
|
384
|
-
return useQuery<MinterResponse, Error, TData>([\\"sg721Minter\\", client.contractAddress], () => client.minter(), options);
|
385
|
-
}
|
386
|
-
export interface Sg721AllTokensQuery<TData> extends Sg721ReactQuery<AllTokensResponse, TData> {
|
387
|
-
args: {
|
388
|
-
limit?: number;
|
389
|
-
startAfter?: string;
|
390
|
-
};
|
391
|
-
}
|
392
|
-
export function useSg721AllTokensQuery<TData = AllTokensResponse>({
|
393
|
-
client,
|
394
|
-
args,
|
395
|
-
options
|
396
|
-
}: Sg721AllTokensQuery<TData>) {
|
397
|
-
return useQuery<AllTokensResponse, Error, TData>([\\"sg721AllTokens\\", client.contractAddress, JSON.stringify(args)], () => client.allTokens({
|
398
|
-
limit: args.limit,
|
399
|
-
startAfter: args.startAfter
|
400
|
-
}), options);
|
401
|
-
}
|
402
|
-
export interface Sg721TokensQuery<TData> extends Sg721ReactQuery<TokensResponse, TData> {
|
403
|
-
args: {
|
404
|
-
limit?: number;
|
405
|
-
owner: string;
|
406
|
-
startAfter?: string;
|
407
|
-
};
|
408
|
-
}
|
409
|
-
export function useSg721TokensQuery<TData = TokensResponse>({
|
410
|
-
client,
|
411
|
-
args,
|
412
|
-
options
|
413
|
-
}: Sg721TokensQuery<TData>) {
|
414
|
-
return useQuery<TokensResponse, Error, TData>([\\"sg721Tokens\\", client.contractAddress, JSON.stringify(args)], () => client.tokens({
|
415
|
-
limit: args.limit,
|
416
|
-
owner: args.owner,
|
417
|
-
startAfter: args.startAfter
|
418
|
-
}), options);
|
419
|
-
}
|
420
|
-
export interface Sg721AllNftInfoQuery<TData> extends Sg721ReactQuery<AllNftInfoResponse, TData> {
|
421
|
-
args: {
|
422
|
-
includeExpired?: boolean;
|
423
|
-
tokenId: string;
|
424
|
-
};
|
425
|
-
}
|
426
|
-
export function useSg721AllNftInfoQuery<TData = AllNftInfoResponse>({
|
427
|
-
client,
|
428
|
-
args,
|
429
|
-
options
|
430
|
-
}: Sg721AllNftInfoQuery<TData>) {
|
431
|
-
return useQuery<AllNftInfoResponse, Error, TData>([\\"sg721AllNftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.allNftInfo({
|
432
|
-
includeExpired: args.includeExpired,
|
433
|
-
tokenId: args.tokenId
|
434
|
-
}), options);
|
435
|
-
}
|
436
|
-
export interface Sg721NftInfoQuery<TData> extends Sg721ReactQuery<NftInfoResponse, TData> {
|
437
|
-
args: {
|
438
|
-
tokenId: string;
|
439
|
-
};
|
440
|
-
}
|
441
|
-
export function useSg721NftInfoQuery<TData = NftInfoResponse>({
|
442
|
-
client,
|
443
|
-
args,
|
444
|
-
options
|
445
|
-
}: Sg721NftInfoQuery<TData>) {
|
446
|
-
return useQuery<NftInfoResponse, Error, TData>([\\"sg721NftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.nftInfo({
|
447
|
-
tokenId: args.tokenId
|
448
|
-
}), options);
|
449
|
-
}
|
450
|
-
export interface Sg721ContractInfoQuery<TData> extends Sg721ReactQuery<ContractInfoResponse, TData> {}
|
451
|
-
export function useSg721ContractInfoQuery<TData = ContractInfoResponse>({
|
452
|
-
client,
|
453
|
-
options
|
454
|
-
}: Sg721ContractInfoQuery<TData>) {
|
455
|
-
return useQuery<ContractInfoResponse, Error, TData>([\\"sg721ContractInfo\\", client.contractAddress], () => client.contractInfo(), options);
|
456
|
-
}
|
457
|
-
export interface Sg721NumTokensQuery<TData> extends Sg721ReactQuery<NumTokensResponse, TData> {}
|
458
|
-
export function useSg721NumTokensQuery<TData = NumTokensResponse>({
|
459
|
-
client,
|
460
|
-
options
|
461
|
-
}: Sg721NumTokensQuery<TData>) {
|
462
|
-
return useQuery<NumTokensResponse, Error, TData>([\\"sg721NumTokens\\", client.contractAddress], () => client.numTokens(), options);
|
463
|
-
}
|
464
|
-
export interface Sg721AllOperatorsQuery<TData> extends Sg721ReactQuery<AllOperatorsResponse, TData> {
|
465
|
-
args: {
|
466
|
-
includeExpired?: boolean;
|
467
|
-
limit?: number;
|
468
|
-
owner: string;
|
469
|
-
startAfter?: string;
|
470
|
-
};
|
471
|
-
}
|
472
|
-
export function useSg721AllOperatorsQuery<TData = AllOperatorsResponse>({
|
473
|
-
client,
|
474
|
-
args,
|
475
|
-
options
|
476
|
-
}: Sg721AllOperatorsQuery<TData>) {
|
477
|
-
return useQuery<AllOperatorsResponse, Error, TData>([\\"sg721AllOperators\\", client.contractAddress, JSON.stringify(args)], () => client.allOperators({
|
478
|
-
includeExpired: args.includeExpired,
|
479
|
-
limit: args.limit,
|
480
|
-
owner: args.owner,
|
481
|
-
startAfter: args.startAfter
|
482
|
-
}), options);
|
483
|
-
}
|
484
|
-
export interface Sg721ApprovalsQuery<TData> extends Sg721ReactQuery<ApprovalsResponse, TData> {
|
485
|
-
args: {
|
486
|
-
includeExpired?: boolean;
|
487
|
-
tokenId: string;
|
488
|
-
};
|
489
|
-
}
|
490
|
-
export function useSg721ApprovalsQuery<TData = ApprovalsResponse>({
|
491
|
-
client,
|
492
|
-
args,
|
493
|
-
options
|
494
|
-
}: Sg721ApprovalsQuery<TData>) {
|
495
|
-
return useQuery<ApprovalsResponse, Error, TData>([\\"sg721Approvals\\", client.contractAddress, JSON.stringify(args)], () => client.approvals({
|
496
|
-
includeExpired: args.includeExpired,
|
497
|
-
tokenId: args.tokenId
|
498
|
-
}), options);
|
499
|
-
}
|
500
|
-
export interface Sg721ApprovalQuery<TData> extends Sg721ReactQuery<ApprovalResponse, TData> {
|
501
|
-
args: {
|
502
|
-
includeExpired?: boolean;
|
503
|
-
spender: string;
|
504
|
-
tokenId: string;
|
505
|
-
};
|
506
|
-
}
|
507
|
-
export function useSg721ApprovalQuery<TData = ApprovalResponse>({
|
508
|
-
client,
|
509
|
-
args,
|
510
|
-
options
|
511
|
-
}: Sg721ApprovalQuery<TData>) {
|
512
|
-
return useQuery<ApprovalResponse, Error, TData>([\\"sg721Approval\\", client.contractAddress, JSON.stringify(args)], () => client.approval({
|
513
|
-
includeExpired: args.includeExpired,
|
514
|
-
spender: args.spender,
|
515
|
-
tokenId: args.tokenId
|
516
|
-
}), options);
|
517
|
-
}
|
518
|
-
export interface Sg721OwnerOfQuery<TData> extends Sg721ReactQuery<OwnerOfResponse, TData> {
|
519
|
-
args: {
|
520
|
-
includeExpired?: boolean;
|
521
|
-
tokenId: string;
|
522
|
-
};
|
523
|
-
}
|
524
|
-
export function useSg721OwnerOfQuery<TData = OwnerOfResponse>({
|
525
|
-
client,
|
526
|
-
args,
|
527
|
-
options
|
528
|
-
}: Sg721OwnerOfQuery<TData>) {
|
529
|
-
return useQuery<OwnerOfResponse, Error, TData>([\\"sg721OwnerOf\\", client.contractAddress, JSON.stringify(args)], () => client.ownerOf({
|
530
|
-
includeExpired: args.includeExpired,
|
531
|
-
tokenId: args.tokenId
|
532
|
-
}), options);
|
533
|
-
}"
|
534
|
-
`;
|
535
|
-
|
536
|
-
exports[`createReactQueryHooks 4`] = `
|
537
|
-
"export interface Sg721ReactQuery<TResponse, TData = TResponse> {
|
538
|
-
client: Sg721QueryClient | undefined;
|
539
|
-
options?: Omit<UseQueryOptions<TResponse, Error, TData>, \\"'queryKey' | 'queryFn' | 'initialData'\\"> & {
|
540
|
-
initialData?: undefined;
|
541
|
-
};
|
542
|
-
}
|
543
|
-
export interface Sg721CollectionInfoQuery<TData> extends Sg721ReactQuery<CollectionInfoResponse, TData> {}
|
544
|
-
export function useSg721CollectionInfoQuery<TData = CollectionInfoResponse>({
|
545
|
-
client,
|
546
|
-
options
|
547
|
-
}: Sg721CollectionInfoQuery<TData>) {
|
548
|
-
return useQuery<CollectionInfoResponse, Error, TData>([\\"sg721CollectionInfo\\", client?.contractAddress], () => client ? client.collectionInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
549
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
550
|
-
});
|
551
|
-
}
|
552
|
-
export interface Sg721MinterQuery<TData> extends Sg721ReactQuery<MinterResponse, TData> {}
|
553
|
-
export function useSg721MinterQuery<TData = MinterResponse>({
|
554
|
-
client,
|
555
|
-
options
|
556
|
-
}: Sg721MinterQuery<TData>) {
|
557
|
-
return useQuery<MinterResponse, Error, TData>([\\"sg721Minter\\", client?.contractAddress], () => client ? client.minter() : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
558
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
559
|
-
});
|
560
|
-
}
|
561
|
-
export interface Sg721AllTokensQuery<TData> extends Sg721ReactQuery<AllTokensResponse, TData> {
|
562
|
-
args: {
|
563
|
-
limit?: number;
|
564
|
-
startAfter?: string;
|
565
|
-
};
|
566
|
-
}
|
567
|
-
export function useSg721AllTokensQuery<TData = AllTokensResponse>({
|
568
|
-
client,
|
569
|
-
args,
|
570
|
-
options
|
571
|
-
}: Sg721AllTokensQuery<TData>) {
|
572
|
-
return useQuery<AllTokensResponse, Error, TData>([\\"sg721AllTokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allTokens({
|
573
|
-
limit: args.limit,
|
574
|
-
startAfter: args.startAfter
|
575
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
576
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
577
|
-
});
|
578
|
-
}
|
579
|
-
export interface Sg721TokensQuery<TData> extends Sg721ReactQuery<TokensResponse, TData> {
|
580
|
-
args: {
|
581
|
-
limit?: number;
|
582
|
-
owner: string;
|
583
|
-
startAfter?: string;
|
584
|
-
};
|
585
|
-
}
|
586
|
-
export function useSg721TokensQuery<TData = TokensResponse>({
|
587
|
-
client,
|
588
|
-
args,
|
589
|
-
options
|
590
|
-
}: Sg721TokensQuery<TData>) {
|
591
|
-
return useQuery<TokensResponse, Error, TData>([\\"sg721Tokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.tokens({
|
592
|
-
limit: args.limit,
|
593
|
-
owner: args.owner,
|
594
|
-
startAfter: args.startAfter
|
595
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
596
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
597
|
-
});
|
598
|
-
}
|
599
|
-
export interface Sg721AllNftInfoQuery<TData> extends Sg721ReactQuery<AllNftInfoResponse, TData> {
|
600
|
-
args: {
|
601
|
-
includeExpired?: boolean;
|
602
|
-
tokenId: string;
|
603
|
-
};
|
604
|
-
}
|
605
|
-
export function useSg721AllNftInfoQuery<TData = AllNftInfoResponse>({
|
606
|
-
client,
|
607
|
-
args,
|
608
|
-
options
|
609
|
-
}: Sg721AllNftInfoQuery<TData>) {
|
610
|
-
return useQuery<AllNftInfoResponse, Error, TData>([\\"sg721AllNftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allNftInfo({
|
611
|
-
includeExpired: args.includeExpired,
|
612
|
-
tokenId: args.tokenId
|
613
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
614
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
615
|
-
});
|
616
|
-
}
|
617
|
-
export interface Sg721NftInfoQuery<TData> extends Sg721ReactQuery<NftInfoResponse, TData> {
|
618
|
-
args: {
|
619
|
-
tokenId: string;
|
620
|
-
};
|
621
|
-
}
|
622
|
-
export function useSg721NftInfoQuery<TData = NftInfoResponse>({
|
623
|
-
client,
|
624
|
-
args,
|
625
|
-
options
|
626
|
-
}: Sg721NftInfoQuery<TData>) {
|
627
|
-
return useQuery<NftInfoResponse, Error, TData>([\\"sg721NftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.nftInfo({
|
628
|
-
tokenId: args.tokenId
|
629
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
630
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
631
|
-
});
|
632
|
-
}
|
633
|
-
export interface Sg721ContractInfoQuery<TData> extends Sg721ReactQuery<ContractInfoResponse, TData> {}
|
634
|
-
export function useSg721ContractInfoQuery<TData = ContractInfoResponse>({
|
635
|
-
client,
|
636
|
-
options
|
637
|
-
}: Sg721ContractInfoQuery<TData>) {
|
638
|
-
return useQuery<ContractInfoResponse, Error, TData>([\\"sg721ContractInfo\\", client?.contractAddress], () => client ? client.contractInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
639
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
640
|
-
});
|
641
|
-
}
|
642
|
-
export interface Sg721NumTokensQuery<TData> extends Sg721ReactQuery<NumTokensResponse, TData> {}
|
643
|
-
export function useSg721NumTokensQuery<TData = NumTokensResponse>({
|
644
|
-
client,
|
645
|
-
options
|
646
|
-
}: Sg721NumTokensQuery<TData>) {
|
647
|
-
return useQuery<NumTokensResponse, Error, TData>([\\"sg721NumTokens\\", client?.contractAddress], () => client ? client.numTokens() : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
648
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
649
|
-
});
|
650
|
-
}
|
651
|
-
export interface Sg721AllOperatorsQuery<TData> extends Sg721ReactQuery<AllOperatorsResponse, TData> {
|
652
|
-
args: {
|
653
|
-
includeExpired?: boolean;
|
654
|
-
limit?: number;
|
655
|
-
owner: string;
|
656
|
-
startAfter?: string;
|
657
|
-
};
|
658
|
-
}
|
659
|
-
export function useSg721AllOperatorsQuery<TData = AllOperatorsResponse>({
|
660
|
-
client,
|
661
|
-
args,
|
662
|
-
options
|
663
|
-
}: Sg721AllOperatorsQuery<TData>) {
|
664
|
-
return useQuery<AllOperatorsResponse, Error, TData>([\\"sg721AllOperators\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allOperators({
|
665
|
-
includeExpired: args.includeExpired,
|
666
|
-
limit: args.limit,
|
667
|
-
owner: args.owner,
|
668
|
-
startAfter: args.startAfter
|
669
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
670
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
671
|
-
});
|
672
|
-
}
|
673
|
-
export interface Sg721ApprovalsQuery<TData> extends Sg721ReactQuery<ApprovalsResponse, TData> {
|
674
|
-
args: {
|
675
|
-
includeExpired?: boolean;
|
676
|
-
tokenId: string;
|
677
|
-
};
|
678
|
-
}
|
679
|
-
export function useSg721ApprovalsQuery<TData = ApprovalsResponse>({
|
680
|
-
client,
|
681
|
-
args,
|
682
|
-
options
|
683
|
-
}: Sg721ApprovalsQuery<TData>) {
|
684
|
-
return useQuery<ApprovalsResponse, Error, TData>([\\"sg721Approvals\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approvals({
|
685
|
-
includeExpired: args.includeExpired,
|
686
|
-
tokenId: args.tokenId
|
687
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
688
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
689
|
-
});
|
690
|
-
}
|
691
|
-
export interface Sg721ApprovalQuery<TData> extends Sg721ReactQuery<ApprovalResponse, TData> {
|
692
|
-
args: {
|
693
|
-
includeExpired?: boolean;
|
694
|
-
spender: string;
|
695
|
-
tokenId: string;
|
696
|
-
};
|
697
|
-
}
|
698
|
-
export function useSg721ApprovalQuery<TData = ApprovalResponse>({
|
699
|
-
client,
|
700
|
-
args,
|
701
|
-
options
|
702
|
-
}: Sg721ApprovalQuery<TData>) {
|
703
|
-
return useQuery<ApprovalResponse, Error, TData>([\\"sg721Approval\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approval({
|
704
|
-
includeExpired: args.includeExpired,
|
705
|
-
spender: args.spender,
|
706
|
-
tokenId: args.tokenId
|
707
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
708
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
709
|
-
});
|
710
|
-
}
|
711
|
-
export interface Sg721OwnerOfQuery<TData> extends Sg721ReactQuery<OwnerOfResponse, TData> {
|
712
|
-
args: {
|
713
|
-
includeExpired?: boolean;
|
714
|
-
tokenId: string;
|
715
|
-
};
|
716
|
-
}
|
717
|
-
export function useSg721OwnerOfQuery<TData = OwnerOfResponse>({
|
718
|
-
client,
|
719
|
-
args,
|
720
|
-
options
|
721
|
-
}: Sg721OwnerOfQuery<TData>) {
|
722
|
-
return useQuery<OwnerOfResponse, Error, TData>([\\"sg721OwnerOf\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.ownerOf({
|
723
|
-
includeExpired: args.includeExpired,
|
724
|
-
tokenId: args.tokenId
|
725
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
726
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
727
|
-
});
|
728
|
-
}"
|
729
|
-
`;
|
730
|
-
|
731
|
-
exports[`createReactQueryHooks 5`] = `
|
732
|
-
"export const sg721QueryKeys = {
|
733
|
-
contract: ([{
|
734
|
-
contract: \\"sg721\\"
|
735
|
-
}] as const),
|
736
|
-
address: (contractAddress: string | undefined) => ([{ ...sg721QueryKeys.contract[0],
|
737
|
-
address: contractAddress
|
738
|
-
}] as const),
|
739
|
-
ownerOf: (contractAddress: string | undefined, args?: Record<string, unknown>) => ([{ ...sg721QueryKeys.address(contractAddress)[0],
|
740
|
-
method: \\"owner_of\\",
|
741
|
-
args
|
742
|
-
}] as const),
|
743
|
-
approval: (contractAddress: string | undefined, args?: Record<string, unknown>) => ([{ ...sg721QueryKeys.address(contractAddress)[0],
|
744
|
-
method: \\"approval\\",
|
745
|
-
args
|
746
|
-
}] as const),
|
747
|
-
approvals: (contractAddress: string | undefined, args?: Record<string, unknown>) => ([{ ...sg721QueryKeys.address(contractAddress)[0],
|
748
|
-
method: \\"approvals\\",
|
749
|
-
args
|
750
|
-
}] as const),
|
751
|
-
allOperators: (contractAddress: string | undefined, args?: Record<string, unknown>) => ([{ ...sg721QueryKeys.address(contractAddress)[0],
|
752
|
-
method: \\"all_operators\\",
|
753
|
-
args
|
754
|
-
}] as const),
|
755
|
-
numTokens: (contractAddress: string | undefined, args?: Record<string, unknown>) => ([{ ...sg721QueryKeys.address(contractAddress)[0],
|
756
|
-
method: \\"num_tokens\\",
|
757
|
-
args
|
758
|
-
}] as const),
|
759
|
-
contractInfo: (contractAddress: string | undefined, args?: Record<string, unknown>) => ([{ ...sg721QueryKeys.address(contractAddress)[0],
|
760
|
-
method: \\"contract_info\\",
|
761
|
-
args
|
762
|
-
}] as const),
|
763
|
-
nftInfo: (contractAddress: string | undefined, args?: Record<string, unknown>) => ([{ ...sg721QueryKeys.address(contractAddress)[0],
|
764
|
-
method: \\"nft_info\\",
|
765
|
-
args
|
766
|
-
}] as const),
|
767
|
-
allNftInfo: (contractAddress: string | undefined, args?: Record<string, unknown>) => ([{ ...sg721QueryKeys.address(contractAddress)[0],
|
768
|
-
method: \\"all_nft_info\\",
|
769
|
-
args
|
770
|
-
}] as const),
|
771
|
-
tokens: (contractAddress: string | undefined, args?: Record<string, unknown>) => ([{ ...sg721QueryKeys.address(contractAddress)[0],
|
772
|
-
method: \\"tokens\\",
|
773
|
-
args
|
774
|
-
}] as const),
|
775
|
-
allTokens: (contractAddress: string | undefined, args?: Record<string, unknown>) => ([{ ...sg721QueryKeys.address(contractAddress)[0],
|
776
|
-
method: \\"all_tokens\\",
|
777
|
-
args
|
778
|
-
}] as const),
|
779
|
-
minter: (contractAddress: string | undefined, args?: Record<string, unknown>) => ([{ ...sg721QueryKeys.address(contractAddress)[0],
|
780
|
-
method: \\"minter\\",
|
781
|
-
args
|
782
|
-
}] as const),
|
783
|
-
collectionInfo: (contractAddress: string | undefined, args?: Record<string, unknown>) => ([{ ...sg721QueryKeys.address(contractAddress)[0],
|
784
|
-
method: \\"collection_info\\",
|
785
|
-
args
|
786
|
-
}] as const)
|
787
|
-
};
|
788
|
-
export const sg721Queries = {
|
789
|
-
ownerOf: <TData = OwnerOfResponse,>({
|
790
|
-
client,
|
791
|
-
args,
|
792
|
-
options
|
793
|
-
}: Sg721OwnerOfQuery<TData>): UseQueryOptions<OwnerOfResponse, Error, TData> => ({
|
794
|
-
queryKey: sg721QueryKeys.ownerOf(client?.contractAddress, args),
|
795
|
-
queryFn: () => client ? client.ownerOf({
|
796
|
-
includeExpired: args.includeExpired,
|
797
|
-
tokenId: args.tokenId
|
798
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")),
|
799
|
-
...options,
|
800
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
801
|
-
}),
|
802
|
-
approval: <TData = ApprovalResponse,>({
|
803
|
-
client,
|
804
|
-
args,
|
805
|
-
options
|
806
|
-
}: Sg721ApprovalQuery<TData>): UseQueryOptions<ApprovalResponse, Error, TData> => ({
|
807
|
-
queryKey: sg721QueryKeys.approval(client?.contractAddress, args),
|
808
|
-
queryFn: () => client ? client.approval({
|
809
|
-
includeExpired: args.includeExpired,
|
810
|
-
spender: args.spender,
|
811
|
-
tokenId: args.tokenId
|
812
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")),
|
813
|
-
...options,
|
814
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
815
|
-
}),
|
816
|
-
approvals: <TData = ApprovalsResponse,>({
|
817
|
-
client,
|
818
|
-
args,
|
819
|
-
options
|
820
|
-
}: Sg721ApprovalsQuery<TData>): UseQueryOptions<ApprovalsResponse, Error, TData> => ({
|
821
|
-
queryKey: sg721QueryKeys.approvals(client?.contractAddress, args),
|
822
|
-
queryFn: () => client ? client.approvals({
|
823
|
-
includeExpired: args.includeExpired,
|
824
|
-
tokenId: args.tokenId
|
825
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")),
|
826
|
-
...options,
|
827
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
828
|
-
}),
|
829
|
-
allOperators: <TData = AllOperatorsResponse,>({
|
830
|
-
client,
|
831
|
-
args,
|
832
|
-
options
|
833
|
-
}: Sg721AllOperatorsQuery<TData>): UseQueryOptions<AllOperatorsResponse, Error, TData> => ({
|
834
|
-
queryKey: sg721QueryKeys.allOperators(client?.contractAddress, args),
|
835
|
-
queryFn: () => client ? client.allOperators({
|
836
|
-
includeExpired: args.includeExpired,
|
837
|
-
limit: args.limit,
|
838
|
-
owner: args.owner,
|
839
|
-
startAfter: args.startAfter
|
840
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")),
|
841
|
-
...options,
|
842
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
843
|
-
}),
|
844
|
-
numTokens: <TData = NumTokensResponse,>({
|
845
|
-
client,
|
846
|
-
options
|
847
|
-
}: Sg721NumTokensQuery<TData>): UseQueryOptions<NumTokensResponse, Error, TData> => ({
|
848
|
-
queryKey: sg721QueryKeys.numTokens(client?.contractAddress),
|
849
|
-
queryFn: () => client ? client.numTokens() : Promise.reject(new Error(\\"Invalid client\\")),
|
850
|
-
...options,
|
851
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
852
|
-
}),
|
853
|
-
contractInfo: <TData = ContractInfoResponse,>({
|
854
|
-
client,
|
855
|
-
options
|
856
|
-
}: Sg721ContractInfoQuery<TData>): UseQueryOptions<ContractInfoResponse, Error, TData> => ({
|
857
|
-
queryKey: sg721QueryKeys.contractInfo(client?.contractAddress),
|
858
|
-
queryFn: () => client ? client.contractInfo() : Promise.reject(new Error(\\"Invalid client\\")),
|
859
|
-
...options,
|
860
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
861
|
-
}),
|
862
|
-
nftInfo: <TData = NftInfoResponse,>({
|
863
|
-
client,
|
864
|
-
args,
|
865
|
-
options
|
866
|
-
}: Sg721NftInfoQuery<TData>): UseQueryOptions<NftInfoResponse, Error, TData> => ({
|
867
|
-
queryKey: sg721QueryKeys.nftInfo(client?.contractAddress, args),
|
868
|
-
queryFn: () => client ? client.nftInfo({
|
869
|
-
tokenId: args.tokenId
|
870
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")),
|
871
|
-
...options,
|
872
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
873
|
-
}),
|
874
|
-
allNftInfo: <TData = AllNftInfoResponse,>({
|
875
|
-
client,
|
876
|
-
args,
|
877
|
-
options
|
878
|
-
}: Sg721AllNftInfoQuery<TData>): UseQueryOptions<AllNftInfoResponse, Error, TData> => ({
|
879
|
-
queryKey: sg721QueryKeys.allNftInfo(client?.contractAddress, args),
|
880
|
-
queryFn: () => client ? client.allNftInfo({
|
881
|
-
includeExpired: args.includeExpired,
|
882
|
-
tokenId: args.tokenId
|
883
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")),
|
884
|
-
...options,
|
885
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
886
|
-
}),
|
887
|
-
tokens: <TData = TokensResponse,>({
|
888
|
-
client,
|
889
|
-
args,
|
890
|
-
options
|
891
|
-
}: Sg721TokensQuery<TData>): UseQueryOptions<TokensResponse, Error, TData> => ({
|
892
|
-
queryKey: sg721QueryKeys.tokens(client?.contractAddress, args),
|
893
|
-
queryFn: () => client ? client.tokens({
|
894
|
-
limit: args.limit,
|
895
|
-
owner: args.owner,
|
896
|
-
startAfter: args.startAfter
|
897
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")),
|
898
|
-
...options,
|
899
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
900
|
-
}),
|
901
|
-
allTokens: <TData = AllTokensResponse,>({
|
902
|
-
client,
|
903
|
-
args,
|
904
|
-
options
|
905
|
-
}: Sg721AllTokensQuery<TData>): UseQueryOptions<AllTokensResponse, Error, TData> => ({
|
906
|
-
queryKey: sg721QueryKeys.allTokens(client?.contractAddress, args),
|
907
|
-
queryFn: () => client ? client.allTokens({
|
908
|
-
limit: args.limit,
|
909
|
-
startAfter: args.startAfter
|
910
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")),
|
911
|
-
...options,
|
912
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
913
|
-
}),
|
914
|
-
minter: <TData = MinterResponse,>({
|
915
|
-
client,
|
916
|
-
options
|
917
|
-
}: Sg721MinterQuery<TData>): UseQueryOptions<MinterResponse, Error, TData> => ({
|
918
|
-
queryKey: sg721QueryKeys.minter(client?.contractAddress),
|
919
|
-
queryFn: () => client ? client.minter() : Promise.reject(new Error(\\"Invalid client\\")),
|
920
|
-
...options,
|
921
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
922
|
-
}),
|
923
|
-
collectionInfo: <TData = CollectionInfoResponse,>({
|
924
|
-
client,
|
925
|
-
options
|
926
|
-
}: Sg721CollectionInfoQuery<TData>): UseQueryOptions<CollectionInfoResponse, Error, TData> => ({
|
927
|
-
queryKey: sg721QueryKeys.collectionInfo(client?.contractAddress),
|
928
|
-
queryFn: () => client ? client.collectionInfo() : Promise.reject(new Error(\\"Invalid client\\")),
|
929
|
-
...options,
|
930
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
931
|
-
})
|
932
|
-
};
|
933
|
-
export interface Sg721ReactQuery<TResponse, TData = TResponse> {
|
934
|
-
client: Sg721QueryClient | undefined;
|
935
|
-
options?: Omit<UseQueryOptions<TResponse, Error, TData>, \\"'queryKey' | 'queryFn' | 'initialData'\\"> & {
|
936
|
-
initialData?: undefined;
|
937
|
-
};
|
938
|
-
}
|
939
|
-
export interface Sg721CollectionInfoQuery<TData> extends Sg721ReactQuery<CollectionInfoResponse, TData> {}
|
940
|
-
export function useSg721CollectionInfoQuery<TData = CollectionInfoResponse>({
|
941
|
-
client,
|
942
|
-
options
|
943
|
-
}: Sg721CollectionInfoQuery<TData>) {
|
944
|
-
return useQuery<CollectionInfoResponse, Error, TData>(sg721QueryKeys.collectionInfo(client?.contractAddress), () => client ? client.collectionInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
945
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
946
|
-
});
|
947
|
-
}
|
948
|
-
export interface Sg721MinterQuery<TData> extends Sg721ReactQuery<MinterResponse, TData> {}
|
949
|
-
export function useSg721MinterQuery<TData = MinterResponse>({
|
950
|
-
client,
|
951
|
-
options
|
952
|
-
}: Sg721MinterQuery<TData>) {
|
953
|
-
return useQuery<MinterResponse, Error, TData>(sg721QueryKeys.minter(client?.contractAddress), () => client ? client.minter() : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
954
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
955
|
-
});
|
956
|
-
}
|
957
|
-
export interface Sg721AllTokensQuery<TData> extends Sg721ReactQuery<AllTokensResponse, TData> {
|
958
|
-
args: {
|
959
|
-
limit?: number;
|
960
|
-
startAfter?: string;
|
961
|
-
};
|
962
|
-
}
|
963
|
-
export function useSg721AllTokensQuery<TData = AllTokensResponse>({
|
964
|
-
client,
|
965
|
-
args,
|
966
|
-
options
|
967
|
-
}: Sg721AllTokensQuery<TData>) {
|
968
|
-
return useQuery<AllTokensResponse, Error, TData>(sg721QueryKeys.allTokens(client?.contractAddress, args), () => client ? client.allTokens({
|
969
|
-
limit: args.limit,
|
970
|
-
startAfter: args.startAfter
|
971
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
972
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
973
|
-
});
|
974
|
-
}
|
975
|
-
export interface Sg721TokensQuery<TData> extends Sg721ReactQuery<TokensResponse, TData> {
|
976
|
-
args: {
|
977
|
-
limit?: number;
|
978
|
-
owner: string;
|
979
|
-
startAfter?: string;
|
980
|
-
};
|
981
|
-
}
|
982
|
-
export function useSg721TokensQuery<TData = TokensResponse>({
|
983
|
-
client,
|
984
|
-
args,
|
985
|
-
options
|
986
|
-
}: Sg721TokensQuery<TData>) {
|
987
|
-
return useQuery<TokensResponse, Error, TData>(sg721QueryKeys.tokens(client?.contractAddress, args), () => client ? client.tokens({
|
988
|
-
limit: args.limit,
|
989
|
-
owner: args.owner,
|
990
|
-
startAfter: args.startAfter
|
991
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
992
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
993
|
-
});
|
994
|
-
}
|
995
|
-
export interface Sg721AllNftInfoQuery<TData> extends Sg721ReactQuery<AllNftInfoResponse, TData> {
|
996
|
-
args: {
|
997
|
-
includeExpired?: boolean;
|
998
|
-
tokenId: string;
|
999
|
-
};
|
1000
|
-
}
|
1001
|
-
export function useSg721AllNftInfoQuery<TData = AllNftInfoResponse>({
|
1002
|
-
client,
|
1003
|
-
args,
|
1004
|
-
options
|
1005
|
-
}: Sg721AllNftInfoQuery<TData>) {
|
1006
|
-
return useQuery<AllNftInfoResponse, Error, TData>(sg721QueryKeys.allNftInfo(client?.contractAddress, args), () => client ? client.allNftInfo({
|
1007
|
-
includeExpired: args.includeExpired,
|
1008
|
-
tokenId: args.tokenId
|
1009
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
1010
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
1011
|
-
});
|
1012
|
-
}
|
1013
|
-
export interface Sg721NftInfoQuery<TData> extends Sg721ReactQuery<NftInfoResponse, TData> {
|
1014
|
-
args: {
|
1015
|
-
tokenId: string;
|
1016
|
-
};
|
1017
|
-
}
|
1018
|
-
export function useSg721NftInfoQuery<TData = NftInfoResponse>({
|
1019
|
-
client,
|
1020
|
-
args,
|
1021
|
-
options
|
1022
|
-
}: Sg721NftInfoQuery<TData>) {
|
1023
|
-
return useQuery<NftInfoResponse, Error, TData>(sg721QueryKeys.nftInfo(client?.contractAddress, args), () => client ? client.nftInfo({
|
1024
|
-
tokenId: args.tokenId
|
1025
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
1026
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
1027
|
-
});
|
1028
|
-
}
|
1029
|
-
export interface Sg721ContractInfoQuery<TData> extends Sg721ReactQuery<ContractInfoResponse, TData> {}
|
1030
|
-
export function useSg721ContractInfoQuery<TData = ContractInfoResponse>({
|
1031
|
-
client,
|
1032
|
-
options
|
1033
|
-
}: Sg721ContractInfoQuery<TData>) {
|
1034
|
-
return useQuery<ContractInfoResponse, Error, TData>(sg721QueryKeys.contractInfo(client?.contractAddress), () => client ? client.contractInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
1035
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
1036
|
-
});
|
1037
|
-
}
|
1038
|
-
export interface Sg721NumTokensQuery<TData> extends Sg721ReactQuery<NumTokensResponse, TData> {}
|
1039
|
-
export function useSg721NumTokensQuery<TData = NumTokensResponse>({
|
1040
|
-
client,
|
1041
|
-
options
|
1042
|
-
}: Sg721NumTokensQuery<TData>) {
|
1043
|
-
return useQuery<NumTokensResponse, Error, TData>(sg721QueryKeys.numTokens(client?.contractAddress), () => client ? client.numTokens() : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
1044
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
1045
|
-
});
|
1046
|
-
}
|
1047
|
-
export interface Sg721AllOperatorsQuery<TData> extends Sg721ReactQuery<AllOperatorsResponse, TData> {
|
1048
|
-
args: {
|
1049
|
-
includeExpired?: boolean;
|
1050
|
-
limit?: number;
|
1051
|
-
owner: string;
|
1052
|
-
startAfter?: string;
|
1053
|
-
};
|
1054
|
-
}
|
1055
|
-
export function useSg721AllOperatorsQuery<TData = AllOperatorsResponse>({
|
1056
|
-
client,
|
1057
|
-
args,
|
1058
|
-
options
|
1059
|
-
}: Sg721AllOperatorsQuery<TData>) {
|
1060
|
-
return useQuery<AllOperatorsResponse, Error, TData>(sg721QueryKeys.allOperators(client?.contractAddress, args), () => client ? client.allOperators({
|
1061
|
-
includeExpired: args.includeExpired,
|
1062
|
-
limit: args.limit,
|
1063
|
-
owner: args.owner,
|
1064
|
-
startAfter: args.startAfter
|
1065
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
1066
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
1067
|
-
});
|
1068
|
-
}
|
1069
|
-
export interface Sg721ApprovalsQuery<TData> extends Sg721ReactQuery<ApprovalsResponse, TData> {
|
1070
|
-
args: {
|
1071
|
-
includeExpired?: boolean;
|
1072
|
-
tokenId: string;
|
1073
|
-
};
|
1074
|
-
}
|
1075
|
-
export function useSg721ApprovalsQuery<TData = ApprovalsResponse>({
|
1076
|
-
client,
|
1077
|
-
args,
|
1078
|
-
options
|
1079
|
-
}: Sg721ApprovalsQuery<TData>) {
|
1080
|
-
return useQuery<ApprovalsResponse, Error, TData>(sg721QueryKeys.approvals(client?.contractAddress, args), () => client ? client.approvals({
|
1081
|
-
includeExpired: args.includeExpired,
|
1082
|
-
tokenId: args.tokenId
|
1083
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
1084
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
1085
|
-
});
|
1086
|
-
}
|
1087
|
-
export interface Sg721ApprovalQuery<TData> extends Sg721ReactQuery<ApprovalResponse, TData> {
|
1088
|
-
args: {
|
1089
|
-
includeExpired?: boolean;
|
1090
|
-
spender: string;
|
1091
|
-
tokenId: string;
|
1092
|
-
};
|
1093
|
-
}
|
1094
|
-
export function useSg721ApprovalQuery<TData = ApprovalResponse>({
|
1095
|
-
client,
|
1096
|
-
args,
|
1097
|
-
options
|
1098
|
-
}: Sg721ApprovalQuery<TData>) {
|
1099
|
-
return useQuery<ApprovalResponse, Error, TData>(sg721QueryKeys.approval(client?.contractAddress, args), () => client ? client.approval({
|
1100
|
-
includeExpired: args.includeExpired,
|
1101
|
-
spender: args.spender,
|
1102
|
-
tokenId: args.tokenId
|
1103
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
1104
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
1105
|
-
});
|
1106
|
-
}
|
1107
|
-
export interface Sg721OwnerOfQuery<TData> extends Sg721ReactQuery<OwnerOfResponse, TData> {
|
1108
|
-
args: {
|
1109
|
-
includeExpired?: boolean;
|
1110
|
-
tokenId: string;
|
1111
|
-
};
|
1112
|
-
}
|
1113
|
-
export function useSg721OwnerOfQuery<TData = OwnerOfResponse>({
|
1114
|
-
client,
|
1115
|
-
args,
|
1116
|
-
options
|
1117
|
-
}: Sg721OwnerOfQuery<TData>) {
|
1118
|
-
return useQuery<OwnerOfResponse, Error, TData>(sg721QueryKeys.ownerOf(client?.contractAddress, args), () => client ? client.ownerOf({
|
1119
|
-
includeExpired: args.includeExpired,
|
1120
|
-
tokenId: args.tokenId
|
1121
|
-
}) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
|
1122
|
-
enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
|
1123
|
-
});
|
1124
|
-
}"
|
1125
|
-
`;
|
1126
|
-
|
1127
|
-
exports[`createReactQueryHooks 6`] = `
|
1128
|
-
"export interface Sg721BurnMutation {
|
1129
|
-
client: Sg721Client;
|
1130
|
-
msg: {
|
1131
|
-
tokenId: string;
|
1132
|
-
};
|
1133
|
-
args?: {
|
1134
|
-
fee?: number | StdFee | \\"auto\\";
|
1135
|
-
memo?: string;
|
1136
|
-
funds?: Coin[];
|
1137
|
-
};
|
1138
|
-
}
|
1139
|
-
export function useSg721BurnMutation(options?: Omit<UseMutationOptions<ExecuteResult, Error, Sg721BurnMutation>, \\"mutationFn\\">) {
|
1140
|
-
return useMutation<ExecuteResult, Error, Sg721BurnMutation>(({
|
1141
|
-
client,
|
1142
|
-
msg,
|
1143
|
-
args: {
|
1144
|
-
fee,
|
1145
|
-
memo,
|
1146
|
-
funds
|
1147
|
-
} = {}
|
1148
|
-
}) => client.burn(msg, fee, memo, funds), options);
|
1149
|
-
}
|
1150
|
-
export interface Sg721MintMutation {
|
1151
|
-
client: Sg721Client;
|
1152
|
-
msg: {
|
1153
|
-
extension: Empty;
|
1154
|
-
owner: string;
|
1155
|
-
tokenId: string;
|
1156
|
-
tokenUri?: string;
|
1157
|
-
};
|
1158
|
-
args?: {
|
1159
|
-
fee?: number | StdFee | \\"auto\\";
|
1160
|
-
memo?: string;
|
1161
|
-
funds?: Coin[];
|
1162
|
-
};
|
1163
|
-
}
|
1164
|
-
export function useSg721MintMutation(options?: Omit<UseMutationOptions<ExecuteResult, Error, Sg721MintMutation>, \\"mutationFn\\">) {
|
1165
|
-
return useMutation<ExecuteResult, Error, Sg721MintMutation>(({
|
1166
|
-
client,
|
1167
|
-
msg,
|
1168
|
-
args: {
|
1169
|
-
fee,
|
1170
|
-
memo,
|
1171
|
-
funds
|
1172
|
-
} = {}
|
1173
|
-
}) => client.mint(msg, fee, memo, funds), options);
|
1174
|
-
}
|
1175
|
-
export interface Sg721RevokeAllMutation {
|
1176
|
-
client: Sg721Client;
|
1177
|
-
msg: {
|
1178
|
-
operator: string;
|
1179
|
-
};
|
1180
|
-
args?: {
|
1181
|
-
fee?: number | StdFee | \\"auto\\";
|
1182
|
-
memo?: string;
|
1183
|
-
funds?: Coin[];
|
1184
|
-
};
|
1185
|
-
}
|
1186
|
-
export function useSg721RevokeAllMutation(options?: Omit<UseMutationOptions<ExecuteResult, Error, Sg721RevokeAllMutation>, \\"mutationFn\\">) {
|
1187
|
-
return useMutation<ExecuteResult, Error, Sg721RevokeAllMutation>(({
|
1188
|
-
client,
|
1189
|
-
msg,
|
1190
|
-
args: {
|
1191
|
-
fee,
|
1192
|
-
memo,
|
1193
|
-
funds
|
1194
|
-
} = {}
|
1195
|
-
}) => client.revokeAll(msg, fee, memo, funds), options);
|
1196
|
-
}
|
1197
|
-
export interface Sg721ApproveAllMutation {
|
1198
|
-
client: Sg721Client;
|
1199
|
-
msg: {
|
1200
|
-
expires?: Expiration;
|
1201
|
-
operator: string;
|
1202
|
-
};
|
1203
|
-
args?: {
|
1204
|
-
fee?: number | StdFee | \\"auto\\";
|
1205
|
-
memo?: string;
|
1206
|
-
funds?: Coin[];
|
1207
|
-
};
|
1208
|
-
}
|
1209
|
-
export function useSg721ApproveAllMutation(options?: Omit<UseMutationOptions<ExecuteResult, Error, Sg721ApproveAllMutation>, \\"mutationFn\\">) {
|
1210
|
-
return useMutation<ExecuteResult, Error, Sg721ApproveAllMutation>(({
|
1211
|
-
client,
|
1212
|
-
msg,
|
1213
|
-
args: {
|
1214
|
-
fee,
|
1215
|
-
memo,
|
1216
|
-
funds
|
1217
|
-
} = {}
|
1218
|
-
}) => client.approveAll(msg, fee, memo, funds), options);
|
1219
|
-
}
|
1220
|
-
export interface Sg721RevokeMutation {
|
1221
|
-
client: Sg721Client;
|
1222
|
-
msg: {
|
1223
|
-
spender: string;
|
1224
|
-
tokenId: string;
|
1225
|
-
};
|
1226
|
-
args?: {
|
1227
|
-
fee?: number | StdFee | \\"auto\\";
|
1228
|
-
memo?: string;
|
1229
|
-
funds?: Coin[];
|
1230
|
-
};
|
1231
|
-
}
|
1232
|
-
export function useSg721RevokeMutation(options?: Omit<UseMutationOptions<ExecuteResult, Error, Sg721RevokeMutation>, \\"mutationFn\\">) {
|
1233
|
-
return useMutation<ExecuteResult, Error, Sg721RevokeMutation>(({
|
1234
|
-
client,
|
1235
|
-
msg,
|
1236
|
-
args: {
|
1237
|
-
fee,
|
1238
|
-
memo,
|
1239
|
-
funds
|
1240
|
-
} = {}
|
1241
|
-
}) => client.revoke(msg, fee, memo, funds), options);
|
1242
|
-
}
|
1243
|
-
export interface Sg721ApproveMutation {
|
1244
|
-
client: Sg721Client;
|
1245
|
-
msg: {
|
1246
|
-
expires?: Expiration;
|
1247
|
-
spender: string;
|
1248
|
-
tokenId: string;
|
1249
|
-
};
|
1250
|
-
args?: {
|
1251
|
-
fee?: number | StdFee | \\"auto\\";
|
1252
|
-
memo?: string;
|
1253
|
-
funds?: Coin[];
|
1254
|
-
};
|
1255
|
-
}
|
1256
|
-
export function useSg721ApproveMutation(options?: Omit<UseMutationOptions<ExecuteResult, Error, Sg721ApproveMutation>, \\"mutationFn\\">) {
|
1257
|
-
return useMutation<ExecuteResult, Error, Sg721ApproveMutation>(({
|
1258
|
-
client,
|
1259
|
-
msg,
|
1260
|
-
args: {
|
1261
|
-
fee,
|
1262
|
-
memo,
|
1263
|
-
funds
|
1264
|
-
} = {}
|
1265
|
-
}) => client.approve(msg, fee, memo, funds), options);
|
1266
|
-
}
|
1267
|
-
export interface Sg721SendNftMutation {
|
1268
|
-
client: Sg721Client;
|
1269
|
-
msg: {
|
1270
|
-
contract: string;
|
1271
|
-
msg: Binary;
|
1272
|
-
tokenId: string;
|
1273
|
-
};
|
1274
|
-
args?: {
|
1275
|
-
fee?: number | StdFee | \\"auto\\";
|
1276
|
-
memo?: string;
|
1277
|
-
funds?: Coin[];
|
1278
|
-
};
|
1279
|
-
}
|
1280
|
-
export function useSg721SendNftMutation(options?: Omit<UseMutationOptions<ExecuteResult, Error, Sg721SendNftMutation>, \\"mutationFn\\">) {
|
1281
|
-
return useMutation<ExecuteResult, Error, Sg721SendNftMutation>(({
|
1282
|
-
client,
|
1283
|
-
msg,
|
1284
|
-
args: {
|
1285
|
-
fee,
|
1286
|
-
memo,
|
1287
|
-
funds
|
1288
|
-
} = {}
|
1289
|
-
}) => client.sendNft(msg, fee, memo, funds), options);
|
1290
|
-
}
|
1291
|
-
export interface Sg721TransferNftMutation {
|
1292
|
-
client: Sg721Client;
|
1293
|
-
msg: {
|
1294
|
-
recipient: string;
|
1295
|
-
tokenId: string;
|
1296
|
-
};
|
1297
|
-
args?: {
|
1298
|
-
fee?: number | StdFee | \\"auto\\";
|
1299
|
-
memo?: string;
|
1300
|
-
funds?: Coin[];
|
1301
|
-
};
|
1302
|
-
}
|
1303
|
-
export function useSg721TransferNftMutation(options?: Omit<UseMutationOptions<ExecuteResult, Error, Sg721TransferNftMutation>, \\"mutationFn\\">) {
|
1304
|
-
return useMutation<ExecuteResult, Error, Sg721TransferNftMutation>(({
|
1305
|
-
client,
|
1306
|
-
msg,
|
1307
|
-
args: {
|
1308
|
-
fee,
|
1309
|
-
memo,
|
1310
|
-
funds
|
1311
|
-
} = {}
|
1312
|
-
}) => client.transferNft(msg, fee, memo, funds), options);
|
1313
|
-
}"
|
1314
|
-
`;
|
1315
|
-
|
1316
|
-
exports[`ownership 1`] = `
|
1317
|
-
"export interface OwnershipUpdateOwnershipMutation {
|
1318
|
-
client: OwnershipClient;
|
1319
|
-
msg: Action;
|
1320
|
-
args?: {
|
1321
|
-
fee?: number | StdFee | \\"auto\\";
|
1322
|
-
memo?: string;
|
1323
|
-
funds?: Coin[];
|
1324
|
-
};
|
1325
|
-
}
|
1326
|
-
export function useOwnershipUpdateOwnershipMutation(options?: Omit<UseMutationOptions<ExecuteResult, Error, OwnershipUpdateOwnershipMutation>, \\"mutationFn\\">) {
|
1327
|
-
return useMutation<ExecuteResult, Error, OwnershipUpdateOwnershipMutation>(({
|
1328
|
-
client,
|
1329
|
-
msg,
|
1330
|
-
args: {
|
1331
|
-
fee,
|
1332
|
-
memo,
|
1333
|
-
funds
|
1334
|
-
} = {}
|
1335
|
-
}) => client.updateOwnership(msg, fee, memo, funds), options);
|
1336
|
-
}
|
1337
|
-
export interface OwnershipSetFactoryMutation {
|
1338
|
-
client: OwnershipClient;
|
1339
|
-
msg: {
|
1340
|
-
newFactory: string;
|
1341
|
-
};
|
1342
|
-
args?: {
|
1343
|
-
fee?: number | StdFee | \\"auto\\";
|
1344
|
-
memo?: string;
|
1345
|
-
funds?: Coin[];
|
1346
|
-
};
|
1347
|
-
}
|
1348
|
-
export function useOwnershipSetFactoryMutation(options?: Omit<UseMutationOptions<ExecuteResult, Error, OwnershipSetFactoryMutation>, \\"mutationFn\\">) {
|
1349
|
-
return useMutation<ExecuteResult, Error, OwnershipSetFactoryMutation>(({
|
1350
|
-
client,
|
1351
|
-
msg,
|
1352
|
-
args: {
|
1353
|
-
fee,
|
1354
|
-
memo,
|
1355
|
-
funds
|
1356
|
-
} = {}
|
1357
|
-
}) => client.setFactory(msg, fee, memo, funds), options);
|
1358
|
-
}"
|
1359
|
-
`;
|