@bananapus/nana-sdk-react 3.0.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,8 @@ export * from "./usePreparePayMetadata";
2
2
  export * from "./useNetwork";
3
3
  export * from "./jb721Hook/useFind721DataHook";
4
4
  export * from "./suckers/useSuckers";
5
+ export * from "./shop/useShopPurchases";
6
+ export * from "./shop/useOwnedShopItems";
5
7
  export * from "./token/useNativeTokenSurplus";
6
8
  export * from "./token/useNativeTokenSymbol";
7
9
  export * from "./token/useSuckersNativeTokenSurplus";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,gCAAgC,CAAC"}
@@ -0,0 +1,189 @@
1
+ import { type OwnedShopItem } from "../../lib/bendystraw/queries/shop";
2
+ /**
3
+ * The 721 store items `owner` currently holds for the project in context,
4
+ * newest first — the basis for a redeem/cash-out list. Reads bendystraw `nfts`
5
+ * for the context chain.
6
+ *
7
+ * The index can lag chain state, so verify ownership on-chain (`ownerOf`) before
8
+ * offering or sending a redemption.
9
+ *
10
+ * @param args.owner The holder whose items to list. The query is disabled until set.
11
+ * @param args.limit Page size. Defaults to 100.
12
+ * @param args.offset Page offset for pagination. Defaults to 0.
13
+ * @param args.enabled Whether to run the query. Defaults to true.
14
+ */
15
+ export declare function useOwnedShopItems(args: {
16
+ owner: string | undefined;
17
+ limit?: number;
18
+ offset?: number;
19
+ enabled?: boolean;
20
+ }): {
21
+ error: Error;
22
+ isError: true;
23
+ isPending: false;
24
+ isLoading: false;
25
+ isLoadingError: false;
26
+ isRefetchError: true;
27
+ isSuccess: false;
28
+ isPlaceholderData: false;
29
+ status: "error";
30
+ dataUpdatedAt: number;
31
+ errorUpdatedAt: number;
32
+ failureCount: number;
33
+ failureReason: Error | null;
34
+ errorUpdateCount: number;
35
+ isFetched: boolean;
36
+ isFetchedAfterMount: boolean;
37
+ isFetching: boolean;
38
+ isInitialLoading: boolean;
39
+ isPaused: boolean;
40
+ isRefetching: boolean;
41
+ isStale: boolean;
42
+ isEnabled: boolean;
43
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("../../lib/bendystraw/queries/shop").OwnedShopItemsResult, Error>>;
44
+ fetchStatus: import("@tanstack/query-core").FetchStatus;
45
+ promise: Promise<import("../../lib/bendystraw/queries/shop").OwnedShopItemsResult>;
46
+ data: OwnedShopItem[] | undefined;
47
+ totalCount: number | undefined;
48
+ } | {
49
+ error: null;
50
+ isError: false;
51
+ isPending: false;
52
+ isLoading: false;
53
+ isLoadingError: false;
54
+ isRefetchError: false;
55
+ isSuccess: true;
56
+ isPlaceholderData: false;
57
+ status: "success";
58
+ dataUpdatedAt: number;
59
+ errorUpdatedAt: number;
60
+ failureCount: number;
61
+ failureReason: Error | null;
62
+ errorUpdateCount: number;
63
+ isFetched: boolean;
64
+ isFetchedAfterMount: boolean;
65
+ isFetching: boolean;
66
+ isInitialLoading: boolean;
67
+ isPaused: boolean;
68
+ isRefetching: boolean;
69
+ isStale: boolean;
70
+ isEnabled: boolean;
71
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("../../lib/bendystraw/queries/shop").OwnedShopItemsResult, Error>>;
72
+ fetchStatus: import("@tanstack/query-core").FetchStatus;
73
+ promise: Promise<import("../../lib/bendystraw/queries/shop").OwnedShopItemsResult>;
74
+ data: OwnedShopItem[] | undefined;
75
+ totalCount: number | undefined;
76
+ } | {
77
+ error: Error;
78
+ isError: true;
79
+ isPending: false;
80
+ isLoading: false;
81
+ isLoadingError: true;
82
+ isRefetchError: false;
83
+ isSuccess: false;
84
+ isPlaceholderData: false;
85
+ status: "error";
86
+ dataUpdatedAt: number;
87
+ errorUpdatedAt: number;
88
+ failureCount: number;
89
+ failureReason: Error | null;
90
+ errorUpdateCount: number;
91
+ isFetched: boolean;
92
+ isFetchedAfterMount: boolean;
93
+ isFetching: boolean;
94
+ isInitialLoading: boolean;
95
+ isPaused: boolean;
96
+ isRefetching: boolean;
97
+ isStale: boolean;
98
+ isEnabled: boolean;
99
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("../../lib/bendystraw/queries/shop").OwnedShopItemsResult, Error>>;
100
+ fetchStatus: import("@tanstack/query-core").FetchStatus;
101
+ promise: Promise<import("../../lib/bendystraw/queries/shop").OwnedShopItemsResult>;
102
+ data: OwnedShopItem[] | undefined;
103
+ totalCount: number | undefined;
104
+ } | {
105
+ error: null;
106
+ isError: false;
107
+ isPending: true;
108
+ isLoading: true;
109
+ isLoadingError: false;
110
+ isRefetchError: false;
111
+ isSuccess: false;
112
+ isPlaceholderData: false;
113
+ status: "pending";
114
+ dataUpdatedAt: number;
115
+ errorUpdatedAt: number;
116
+ failureCount: number;
117
+ failureReason: Error | null;
118
+ errorUpdateCount: number;
119
+ isFetched: boolean;
120
+ isFetchedAfterMount: boolean;
121
+ isFetching: boolean;
122
+ isInitialLoading: boolean;
123
+ isPaused: boolean;
124
+ isRefetching: boolean;
125
+ isStale: boolean;
126
+ isEnabled: boolean;
127
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("../../lib/bendystraw/queries/shop").OwnedShopItemsResult, Error>>;
128
+ fetchStatus: import("@tanstack/query-core").FetchStatus;
129
+ promise: Promise<import("../../lib/bendystraw/queries/shop").OwnedShopItemsResult>;
130
+ data: OwnedShopItem[] | undefined;
131
+ totalCount: number | undefined;
132
+ } | {
133
+ error: null;
134
+ isError: false;
135
+ isPending: true;
136
+ isLoadingError: false;
137
+ isRefetchError: false;
138
+ isSuccess: false;
139
+ isPlaceholderData: false;
140
+ status: "pending";
141
+ dataUpdatedAt: number;
142
+ errorUpdatedAt: number;
143
+ failureCount: number;
144
+ failureReason: Error | null;
145
+ errorUpdateCount: number;
146
+ isFetched: boolean;
147
+ isFetchedAfterMount: boolean;
148
+ isFetching: boolean;
149
+ isLoading: boolean;
150
+ isInitialLoading: boolean;
151
+ isPaused: boolean;
152
+ isRefetching: boolean;
153
+ isStale: boolean;
154
+ isEnabled: boolean;
155
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("../../lib/bendystraw/queries/shop").OwnedShopItemsResult, Error>>;
156
+ fetchStatus: import("@tanstack/query-core").FetchStatus;
157
+ promise: Promise<import("../../lib/bendystraw/queries/shop").OwnedShopItemsResult>;
158
+ data: OwnedShopItem[] | undefined;
159
+ totalCount: number | undefined;
160
+ } | {
161
+ isError: false;
162
+ error: null;
163
+ isPending: false;
164
+ isLoading: false;
165
+ isLoadingError: false;
166
+ isRefetchError: false;
167
+ isSuccess: true;
168
+ isPlaceholderData: true;
169
+ status: "success";
170
+ dataUpdatedAt: number;
171
+ errorUpdatedAt: number;
172
+ failureCount: number;
173
+ failureReason: Error | null;
174
+ errorUpdateCount: number;
175
+ isFetched: boolean;
176
+ isFetchedAfterMount: boolean;
177
+ isFetching: boolean;
178
+ isInitialLoading: boolean;
179
+ isPaused: boolean;
180
+ isRefetching: boolean;
181
+ isStale: boolean;
182
+ isEnabled: boolean;
183
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("../../lib/bendystraw/queries/shop").OwnedShopItemsResult, Error>>;
184
+ fetchStatus: import("@tanstack/query-core").FetchStatus;
185
+ promise: Promise<import("../../lib/bendystraw/queries/shop").OwnedShopItemsResult>;
186
+ data: OwnedShopItem[] | undefined;
187
+ totalCount: number | undefined;
188
+ };
189
+ //# sourceMappingURL=useOwnedShopItems.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOwnedShopItems.d.ts","sourceRoot":"","sources":["../../../src/hooks/shop/useOwnedShopItems.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,mCAAmC,CAAC;AAG3C;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwCA"}
@@ -0,0 +1,187 @@
1
+ import { type ShopPurchase } from "../../lib/bendystraw/queries/shop";
2
+ /**
3
+ * Store-item purchases (721 tier mints) for the project in context, newest
4
+ * first — the "customers" feed. Reads bendystraw `mintNftEvents` for the
5
+ * context chain.
6
+ *
7
+ * @param args.beneficiary Only purchases whose beneficiary is this address (the
8
+ * connected wallet's own purchases). Omit for all buyers.
9
+ * @param args.limit Page size. Defaults to 100.
10
+ * @param args.offset Page offset for pagination. Defaults to 0.
11
+ * @param args.enabled Whether to run the query. Defaults to true.
12
+ */
13
+ export declare function useShopPurchases(args?: {
14
+ beneficiary?: string;
15
+ limit?: number;
16
+ offset?: number;
17
+ enabled?: boolean;
18
+ }): {
19
+ error: Error;
20
+ isError: true;
21
+ isPending: false;
22
+ isLoading: false;
23
+ isLoadingError: false;
24
+ isRefetchError: true;
25
+ isSuccess: false;
26
+ isPlaceholderData: false;
27
+ status: "error";
28
+ dataUpdatedAt: number;
29
+ errorUpdatedAt: number;
30
+ failureCount: number;
31
+ failureReason: Error | null;
32
+ errorUpdateCount: number;
33
+ isFetched: boolean;
34
+ isFetchedAfterMount: boolean;
35
+ isFetching: boolean;
36
+ isInitialLoading: boolean;
37
+ isPaused: boolean;
38
+ isRefetching: boolean;
39
+ isStale: boolean;
40
+ isEnabled: boolean;
41
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("../../lib/bendystraw/queries/shop").ShopPurchasesResult, Error>>;
42
+ fetchStatus: import("@tanstack/query-core").FetchStatus;
43
+ promise: Promise<import("../../lib/bendystraw/queries/shop").ShopPurchasesResult>;
44
+ data: ShopPurchase[] | undefined;
45
+ totalCount: number | undefined;
46
+ } | {
47
+ error: null;
48
+ isError: false;
49
+ isPending: false;
50
+ isLoading: false;
51
+ isLoadingError: false;
52
+ isRefetchError: false;
53
+ isSuccess: true;
54
+ isPlaceholderData: false;
55
+ status: "success";
56
+ dataUpdatedAt: number;
57
+ errorUpdatedAt: number;
58
+ failureCount: number;
59
+ failureReason: Error | null;
60
+ errorUpdateCount: number;
61
+ isFetched: boolean;
62
+ isFetchedAfterMount: boolean;
63
+ isFetching: boolean;
64
+ isInitialLoading: boolean;
65
+ isPaused: boolean;
66
+ isRefetching: boolean;
67
+ isStale: boolean;
68
+ isEnabled: boolean;
69
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("../../lib/bendystraw/queries/shop").ShopPurchasesResult, Error>>;
70
+ fetchStatus: import("@tanstack/query-core").FetchStatus;
71
+ promise: Promise<import("../../lib/bendystraw/queries/shop").ShopPurchasesResult>;
72
+ data: ShopPurchase[] | undefined;
73
+ totalCount: number | undefined;
74
+ } | {
75
+ error: Error;
76
+ isError: true;
77
+ isPending: false;
78
+ isLoading: false;
79
+ isLoadingError: true;
80
+ isRefetchError: false;
81
+ isSuccess: false;
82
+ isPlaceholderData: false;
83
+ status: "error";
84
+ dataUpdatedAt: number;
85
+ errorUpdatedAt: number;
86
+ failureCount: number;
87
+ failureReason: Error | null;
88
+ errorUpdateCount: number;
89
+ isFetched: boolean;
90
+ isFetchedAfterMount: boolean;
91
+ isFetching: boolean;
92
+ isInitialLoading: boolean;
93
+ isPaused: boolean;
94
+ isRefetching: boolean;
95
+ isStale: boolean;
96
+ isEnabled: boolean;
97
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("../../lib/bendystraw/queries/shop").ShopPurchasesResult, Error>>;
98
+ fetchStatus: import("@tanstack/query-core").FetchStatus;
99
+ promise: Promise<import("../../lib/bendystraw/queries/shop").ShopPurchasesResult>;
100
+ data: ShopPurchase[] | undefined;
101
+ totalCount: number | undefined;
102
+ } | {
103
+ error: null;
104
+ isError: false;
105
+ isPending: true;
106
+ isLoading: true;
107
+ isLoadingError: false;
108
+ isRefetchError: false;
109
+ isSuccess: false;
110
+ isPlaceholderData: false;
111
+ status: "pending";
112
+ dataUpdatedAt: number;
113
+ errorUpdatedAt: number;
114
+ failureCount: number;
115
+ failureReason: Error | null;
116
+ errorUpdateCount: number;
117
+ isFetched: boolean;
118
+ isFetchedAfterMount: boolean;
119
+ isFetching: boolean;
120
+ isInitialLoading: boolean;
121
+ isPaused: boolean;
122
+ isRefetching: boolean;
123
+ isStale: boolean;
124
+ isEnabled: boolean;
125
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("../../lib/bendystraw/queries/shop").ShopPurchasesResult, Error>>;
126
+ fetchStatus: import("@tanstack/query-core").FetchStatus;
127
+ promise: Promise<import("../../lib/bendystraw/queries/shop").ShopPurchasesResult>;
128
+ data: ShopPurchase[] | undefined;
129
+ totalCount: number | undefined;
130
+ } | {
131
+ error: null;
132
+ isError: false;
133
+ isPending: true;
134
+ isLoadingError: false;
135
+ isRefetchError: false;
136
+ isSuccess: false;
137
+ isPlaceholderData: false;
138
+ status: "pending";
139
+ dataUpdatedAt: number;
140
+ errorUpdatedAt: number;
141
+ failureCount: number;
142
+ failureReason: Error | null;
143
+ errorUpdateCount: number;
144
+ isFetched: boolean;
145
+ isFetchedAfterMount: boolean;
146
+ isFetching: boolean;
147
+ isLoading: boolean;
148
+ isInitialLoading: boolean;
149
+ isPaused: boolean;
150
+ isRefetching: boolean;
151
+ isStale: boolean;
152
+ isEnabled: boolean;
153
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("../../lib/bendystraw/queries/shop").ShopPurchasesResult, Error>>;
154
+ fetchStatus: import("@tanstack/query-core").FetchStatus;
155
+ promise: Promise<import("../../lib/bendystraw/queries/shop").ShopPurchasesResult>;
156
+ data: ShopPurchase[] | undefined;
157
+ totalCount: number | undefined;
158
+ } | {
159
+ isError: false;
160
+ error: null;
161
+ isPending: false;
162
+ isLoading: false;
163
+ isLoadingError: false;
164
+ isRefetchError: false;
165
+ isSuccess: true;
166
+ isPlaceholderData: true;
167
+ status: "success";
168
+ dataUpdatedAt: number;
169
+ errorUpdatedAt: number;
170
+ failureCount: number;
171
+ failureReason: Error | null;
172
+ errorUpdateCount: number;
173
+ isFetched: boolean;
174
+ isFetchedAfterMount: boolean;
175
+ isFetching: boolean;
176
+ isInitialLoading: boolean;
177
+ isPaused: boolean;
178
+ isRefetching: boolean;
179
+ isStale: boolean;
180
+ isEnabled: boolean;
181
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("../../lib/bendystraw/queries/shop").ShopPurchasesResult, Error>>;
182
+ fetchStatus: import("@tanstack/query-core").FetchStatus;
183
+ promise: Promise<import("../../lib/bendystraw/queries/shop").ShopPurchasesResult>;
184
+ data: ShopPurchase[] | undefined;
185
+ totalCount: number | undefined;
186
+ };
187
+ //# sourceMappingURL=useShopPurchases.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useShopPurchases.d.ts","sourceRoot":"","sources":["../../../src/hooks/shop/useShopPurchases.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,mCAAmC,CAAC;AAG3C;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCA"}