@snagsolutions/sdk 0.1.0-alpha.13 → 0.1.0-alpha.14

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.
Files changed (241) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +1 -1
  3. package/core.d.ts.map +1 -1
  4. package/core.js +12 -6
  5. package/core.js.map +1 -1
  6. package/core.mjs +12 -6
  7. package/core.mjs.map +1 -1
  8. package/index.d.mts +9 -9
  9. package/index.d.ts +9 -9
  10. package/index.d.ts.map +1 -1
  11. package/index.js +1 -1
  12. package/index.js.map +1 -1
  13. package/index.mjs +1 -1
  14. package/index.mjs.map +1 -1
  15. package/package.json +29 -8
  16. package/resources/assets/assets.d.ts +153 -0
  17. package/resources/assets/assets.d.ts.map +1 -0
  18. package/resources/assets/assets.js +69 -0
  19. package/resources/assets/assets.js.map +1 -0
  20. package/resources/assets/assets.mjs +42 -0
  21. package/resources/assets/assets.mjs.map +1 -0
  22. package/resources/assets/index.d.ts +7 -0
  23. package/resources/assets/index.d.ts.map +1 -0
  24. package/resources/assets/index.js +17 -0
  25. package/resources/assets/index.js.map +1 -0
  26. package/resources/assets/index.mjs +8 -0
  27. package/resources/assets/index.mjs.map +1 -0
  28. package/resources/assets/minting.d.ts +95 -0
  29. package/resources/assets/minting.d.ts.map +1 -0
  30. package/resources/assets/minting.js +15 -0
  31. package/resources/assets/minting.js.map +1 -0
  32. package/resources/assets/minting.mjs +11 -0
  33. package/resources/assets/minting.mjs.map +1 -0
  34. package/resources/assets/referral/index.d.ts +3 -0
  35. package/resources/assets/referral/index.d.ts.map +1 -0
  36. package/resources/assets/referral/index.js +9 -0
  37. package/resources/assets/referral/index.js.map +1 -0
  38. package/resources/assets/referral/index.mjs +4 -0
  39. package/resources/assets/referral/index.mjs.map +1 -0
  40. package/resources/assets/referral/referral.d.ts +30 -0
  41. package/resources/assets/referral/referral.d.ts.map +1 -0
  42. package/resources/assets/referral/referral.js +46 -0
  43. package/resources/assets/referral/referral.js.map +1 -0
  44. package/resources/assets/referral/referral.mjs +19 -0
  45. package/resources/assets/referral/referral.mjs.map +1 -0
  46. package/resources/assets/referral/users.d.ts +57 -0
  47. package/resources/assets/referral/users.d.ts.map +1 -0
  48. package/resources/assets/referral/users.js +21 -0
  49. package/resources/assets/referral/users.js.map +1 -0
  50. package/resources/assets/referral/users.mjs +17 -0
  51. package/resources/assets/referral/users.mjs.map +1 -0
  52. package/resources/assets/users.d.ts +285 -0
  53. package/resources/assets/users.d.ts.map +1 -0
  54. package/resources/assets/users.js +34 -0
  55. package/resources/assets/users.js.map +1 -0
  56. package/resources/assets/users.mjs +30 -0
  57. package/resources/assets/users.mjs.map +1 -0
  58. package/resources/assets/website-collections.d.ts +73 -0
  59. package/resources/assets/website-collections.d.ts.map +1 -0
  60. package/resources/assets/website-collections.js +25 -0
  61. package/resources/assets/website-collections.js.map +1 -0
  62. package/resources/assets/website-collections.mjs +21 -0
  63. package/resources/assets/website-collections.mjs.map +1 -0
  64. package/resources/assets/website-user-roles.d.ts +73 -0
  65. package/resources/assets/website-user-roles.d.ts.map +1 -0
  66. package/resources/assets/website-user-roles.js +22 -0
  67. package/resources/assets/website-user-roles.js.map +1 -0
  68. package/resources/assets/website-user-roles.mjs +18 -0
  69. package/resources/assets/website-user-roles.mjs.map +1 -0
  70. package/resources/auction-bids.d.ts +2 -32
  71. package/resources/auction-bids.d.ts.map +1 -1
  72. package/resources/auction-bids.js +0 -10
  73. package/resources/auction-bids.js.map +1 -1
  74. package/resources/auction-bids.mjs +0 -10
  75. package/resources/auction-bids.mjs.map +1 -1
  76. package/resources/drip/drip.d.ts +4 -4
  77. package/resources/drip/drip.d.ts.map +1 -1
  78. package/resources/drip/drip.js.map +1 -1
  79. package/resources/drip/drip.mjs.map +1 -1
  80. package/resources/drip/index.d.ts +2 -2
  81. package/resources/drip/index.d.ts.map +1 -1
  82. package/resources/drip/index.js.map +1 -1
  83. package/resources/drip/index.mjs.map +1 -1
  84. package/resources/drip/quests.d.ts +0 -164
  85. package/resources/drip/quests.d.ts.map +1 -1
  86. package/resources/drip/quests.js +0 -8
  87. package/resources/drip/quests.js.map +1 -1
  88. package/resources/drip/quests.mjs +0 -8
  89. package/resources/drip/quests.mjs.map +1 -1
  90. package/resources/drip/status.d.ts +0 -22
  91. package/resources/drip/status.d.ts.map +1 -1
  92. package/resources/drip/status.js +0 -7
  93. package/resources/drip/status.js.map +1 -1
  94. package/resources/drip/status.mjs +0 -7
  95. package/resources/drip/status.mjs.map +1 -1
  96. package/resources/index.d.ts +2 -2
  97. package/resources/index.d.ts.map +1 -1
  98. package/resources/index.js +1 -1
  99. package/resources/index.js.map +1 -1
  100. package/resources/index.mjs +1 -1
  101. package/resources/index.mjs.map +1 -1
  102. package/resources/loyalty/accounts.d.ts +0 -153
  103. package/resources/loyalty/accounts.d.ts.map +1 -1
  104. package/resources/loyalty/accounts.js +0 -7
  105. package/resources/loyalty/accounts.js.map +1 -1
  106. package/resources/loyalty/accounts.mjs +0 -7
  107. package/resources/loyalty/accounts.mjs.map +1 -1
  108. package/resources/loyalty/badges.d.ts +639 -72
  109. package/resources/loyalty/badges.d.ts.map +1 -1
  110. package/resources/loyalty/currencies.d.ts +1 -7
  111. package/resources/loyalty/currencies.d.ts.map +1 -1
  112. package/resources/loyalty/index.d.ts +3 -3
  113. package/resources/loyalty/index.d.ts.map +1 -1
  114. package/resources/loyalty/index.js +2 -2
  115. package/resources/loyalty/index.js.map +1 -1
  116. package/resources/loyalty/index.mjs +1 -1
  117. package/resources/loyalty/index.mjs.map +1 -1
  118. package/resources/loyalty/loyalty.d.ts +7 -7
  119. package/resources/loyalty/loyalty.d.ts.map +1 -1
  120. package/resources/loyalty/loyalty.js +2 -2
  121. package/resources/loyalty/loyalty.js.map +1 -1
  122. package/resources/loyalty/loyalty.mjs +2 -2
  123. package/resources/loyalty/loyalty.mjs.map +1 -1
  124. package/resources/loyalty/multipliers.d.ts +29 -4
  125. package/resources/loyalty/multipliers.d.ts.map +1 -1
  126. package/resources/loyalty/multipliers.js +3 -3
  127. package/resources/loyalty/multipliers.js.map +1 -1
  128. package/resources/loyalty/multipliers.mjs +3 -3
  129. package/resources/loyalty/multipliers.mjs.map +1 -1
  130. package/resources/loyalty/rule-edits.d.ts +1 -1
  131. package/resources/loyalty/rule-edits.d.ts.map +1 -1
  132. package/resources/loyalty/rule-edits.js +1 -1
  133. package/resources/loyalty/rule-edits.js.map +1 -1
  134. package/resources/loyalty/rule-edits.mjs +1 -1
  135. package/resources/loyalty/rule-edits.mjs.map +1 -1
  136. package/resources/loyalty/rules.d.ts +132 -71
  137. package/resources/loyalty/rules.d.ts.map +1 -1
  138. package/resources/loyalty/transaction-entries/accounts.d.ts +191 -0
  139. package/resources/loyalty/transaction-entries/accounts.d.ts.map +1 -0
  140. package/resources/loyalty/transaction-entries/accounts.js +24 -0
  141. package/resources/loyalty/transaction-entries/accounts.js.map +1 -0
  142. package/resources/loyalty/transaction-entries/accounts.mjs +20 -0
  143. package/resources/loyalty/transaction-entries/accounts.mjs.map +1 -0
  144. package/resources/loyalty/transaction-entries/index.d.ts +5 -0
  145. package/resources/loyalty/transaction-entries/index.d.ts.map +1 -0
  146. package/resources/loyalty/transaction-entries/index.js +13 -0
  147. package/resources/loyalty/transaction-entries/index.js.map +1 -0
  148. package/resources/loyalty/transaction-entries/index.mjs +6 -0
  149. package/resources/loyalty/transaction-entries/index.mjs.map +1 -0
  150. package/resources/loyalty/transaction-entries/questions-responses.d.ts +97 -0
  151. package/resources/loyalty/transaction-entries/questions-responses.d.ts.map +1 -0
  152. package/resources/loyalty/transaction-entries/questions-responses.js +22 -0
  153. package/resources/loyalty/transaction-entries/questions-responses.js.map +1 -0
  154. package/resources/loyalty/transaction-entries/questions-responses.mjs +18 -0
  155. package/resources/loyalty/transaction-entries/questions-responses.mjs.map +1 -0
  156. package/resources/loyalty/transaction-entries/questions.d.ts +150 -0
  157. package/resources/loyalty/transaction-entries/questions.d.ts.map +1 -0
  158. package/resources/loyalty/transaction-entries/questions.js +27 -0
  159. package/resources/loyalty/transaction-entries/questions.js.map +1 -0
  160. package/resources/loyalty/transaction-entries/questions.mjs +23 -0
  161. package/resources/loyalty/transaction-entries/questions.mjs.map +1 -0
  162. package/resources/loyalty/transaction-entries/transaction-entries.d.ts +300 -0
  163. package/resources/loyalty/transaction-entries/transaction-entries.d.ts.map +1 -0
  164. package/resources/loyalty/transaction-entries/transaction-entries.js +66 -0
  165. package/resources/loyalty/transaction-entries/transaction-entries.js.map +1 -0
  166. package/resources/loyalty/transaction-entries/transaction-entries.mjs +39 -0
  167. package/resources/loyalty/transaction-entries/transaction-entries.mjs.map +1 -0
  168. package/resources/users/index.d.ts +2 -2
  169. package/resources/users/index.d.ts.map +1 -1
  170. package/resources/users/index.js.map +1 -1
  171. package/resources/users/index.mjs +2 -2
  172. package/resources/users/index.mjs.map +1 -1
  173. package/resources/users/metadatas.d.ts +79 -11
  174. package/resources/users/metadatas.d.ts.map +1 -1
  175. package/resources/users/metadatas.js +6 -0
  176. package/resources/users/metadatas.js.map +1 -1
  177. package/resources/users/metadatas.mjs +6 -0
  178. package/resources/users/metadatas.mjs.map +1 -1
  179. package/resources/users/users.d.ts +4 -4
  180. package/resources/users/users.d.ts.map +1 -1
  181. package/resources/users/users.js.map +1 -1
  182. package/resources/users/users.mjs +2 -2
  183. package/resources/users/users.mjs.map +1 -1
  184. package/resources/users/wallets.d.ts +0 -189
  185. package/resources/users/wallets.d.ts.map +1 -1
  186. package/resources/users/wallets.js +0 -19
  187. package/resources/users/wallets.js.map +1 -1
  188. package/resources/users/wallets.mjs +0 -19
  189. package/resources/users/wallets.mjs.map +1 -1
  190. package/src/core.ts +14 -6
  191. package/src/index.ts +14 -12
  192. package/src/resources/assets/assets.ts +294 -0
  193. package/src/resources/assets/index.ts +38 -0
  194. package/src/resources/assets/minting.ts +153 -0
  195. package/src/resources/assets/referral/index.ts +14 -0
  196. package/src/resources/assets/referral/referral.ts +74 -0
  197. package/src/resources/assets/referral/users.ts +99 -0
  198. package/src/resources/assets/users.ts +415 -0
  199. package/src/resources/assets/website-collections.ts +147 -0
  200. package/src/resources/assets/website-user-roles.ts +107 -0
  201. package/src/resources/auction-bids.ts +2 -48
  202. package/src/resources/drip/drip.ts +4 -8
  203. package/src/resources/drip/index.ts +2 -2
  204. package/src/resources/drip/quests.ts +1 -206
  205. package/src/resources/drip/status.ts +1 -29
  206. package/src/resources/index.ts +7 -2
  207. package/src/resources/loyalty/accounts.ts +1 -195
  208. package/src/resources/loyalty/badges.ts +779 -77
  209. package/src/resources/loyalty/currencies.ts +1 -7
  210. package/src/resources/loyalty/index.ts +7 -2
  211. package/src/resources/loyalty/loyalty.ts +14 -8
  212. package/src/resources/loyalty/multipliers.ts +49 -4
  213. package/src/resources/loyalty/rule-edits.ts +2 -2
  214. package/src/resources/loyalty/rules.ts +247 -159
  215. package/src/resources/loyalty/transaction-entries/accounts.ts +251 -0
  216. package/src/resources/loyalty/transaction-entries/index.ts +34 -0
  217. package/src/resources/loyalty/transaction-entries/questions-responses.ts +146 -0
  218. package/src/resources/loyalty/transaction-entries/questions.ts +208 -0
  219. package/src/resources/loyalty/transaction-entries/transaction-entries.ts +525 -0
  220. package/src/resources/users/index.ts +8 -9
  221. package/src/resources/users/metadatas.ts +109 -10
  222. package/src/resources/users/users.ts +11 -17
  223. package/src/resources/users/wallets.ts +1 -267
  224. package/src/version.ts +1 -1
  225. package/version.d.ts +1 -1
  226. package/version.js +1 -1
  227. package/version.mjs +1 -1
  228. package/resources/assets.d.ts +0 -50
  229. package/resources/assets.d.ts.map +0 -1
  230. package/resources/assets.js +0 -17
  231. package/resources/assets.js.map +0 -1
  232. package/resources/assets.mjs +0 -13
  233. package/resources/assets.mjs.map +0 -1
  234. package/resources/loyalty/transaction-entries.d.ts +0 -175
  235. package/resources/loyalty/transaction-entries.d.ts.map +0 -1
  236. package/resources/loyalty/transaction-entries.js +0 -16
  237. package/resources/loyalty/transaction-entries.js.map +0 -1
  238. package/resources/loyalty/transaction-entries.mjs +0 -12
  239. package/resources/loyalty/transaction-entries.mjs.map +0 -1
  240. package/src/resources/assets.ts +0 -71
  241. package/src/resources/loyalty/transaction-entries.ts +0 -229
@@ -0,0 +1,525 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../resource';
4
+ import { isRequestOptions } from '../../../core';
5
+ import * as Core from '../../../core';
6
+ import * as AccountsAPI from './accounts';
7
+ import {
8
+ AccountListParams,
9
+ AccountListResponse,
10
+ AccountRetrieveRankParams,
11
+ AccountRetrieveRankResponse,
12
+ Accounts,
13
+ } from './accounts';
14
+ import * as QuestionsAPI from './questions';
15
+ import {
16
+ QuestionCreateParams,
17
+ QuestionCreateResponse,
18
+ QuestionListParams,
19
+ QuestionListResponse,
20
+ QuestionUpdateParams,
21
+ QuestionUpdateResponse,
22
+ Questions,
23
+ } from './questions';
24
+ import * as QuestionsResponsesAPI from './questions-responses';
25
+ import {
26
+ QuestionsResponseListParams,
27
+ QuestionsResponseListResponse,
28
+ QuestionsResponseSubmitParams,
29
+ QuestionsResponseSubmitResponse,
30
+ QuestionsResponses,
31
+ } from './questions-responses';
32
+
33
+ export class TransactionEntries extends APIResource {
34
+ accounts: AccountsAPI.Accounts = new AccountsAPI.Accounts(this._client);
35
+ questions: QuestionsAPI.Questions = new QuestionsAPI.Questions(this._client);
36
+ questionsResponses: QuestionsResponsesAPI.QuestionsResponses = new QuestionsResponsesAPI.QuestionsResponses(
37
+ this._client,
38
+ );
39
+
40
+ /**
41
+ * Fetch loyalty transaction entries for wallets or users, representing account
42
+ * balance changes.
43
+ */
44
+ list(
45
+ query?: TransactionEntryListParams,
46
+ options?: Core.RequestOptions,
47
+ ): Core.APIPromise<TransactionEntryListResponse>;
48
+ list(options?: Core.RequestOptions): Core.APIPromise<TransactionEntryListResponse>;
49
+ list(
50
+ query: TransactionEntryListParams | Core.RequestOptions = {},
51
+ options?: Core.RequestOptions,
52
+ ): Core.APIPromise<TransactionEntryListResponse> {
53
+ if (isRequestOptions(query)) {
54
+ return this.list({}, query);
55
+ }
56
+ return this._client.get('/api/loyalty/transaction_entries', { query, ...options });
57
+ }
58
+
59
+ /**
60
+ * Create a loyalty transaction to update account balances.
61
+ */
62
+ createTransaction(
63
+ body: TransactionEntryCreateTransactionParams,
64
+ options?: Core.RequestOptions,
65
+ ): Core.APIPromise<TransactionEntryCreateTransactionResponse> {
66
+ return this._client.post('/api/loyalty/transactions', { body, ...options });
67
+ }
68
+
69
+ /**
70
+ * Retrieve configured loyalty rule groups
71
+ */
72
+ listRuleGroups(
73
+ query?: TransactionEntryListRuleGroupsParams,
74
+ options?: Core.RequestOptions,
75
+ ): Core.APIPromise<TransactionEntryListRuleGroupsResponse>;
76
+ listRuleGroups(options?: Core.RequestOptions): Core.APIPromise<TransactionEntryListRuleGroupsResponse>;
77
+ listRuleGroups(
78
+ query: TransactionEntryListRuleGroupsParams | Core.RequestOptions = {},
79
+ options?: Core.RequestOptions,
80
+ ): Core.APIPromise<TransactionEntryListRuleGroupsResponse> {
81
+ if (isRequestOptions(query)) {
82
+ return this.listRuleGroups({}, query);
83
+ }
84
+ return this._client.get('/api/loyalty/rule_groups', { query, ...options });
85
+ }
86
+ }
87
+
88
+ export interface TransactionEntryListResponse {
89
+ data: Array<TransactionEntryListResponse.Data>;
90
+
91
+ hasNextPage: boolean;
92
+ }
93
+
94
+ export namespace TransactionEntryListResponse {
95
+ /**
96
+ * Schema for a loyalty transaction entry
97
+ */
98
+ export interface Data {
99
+ /**
100
+ * Unique identifier for the transaction entry
101
+ */
102
+ id: string;
103
+
104
+ /**
105
+ * Amount involved in the transaction
106
+ */
107
+ amount: number;
108
+
109
+ /**
110
+ * Timestamp when the transaction entry was created
111
+ */
112
+ createdAt: string;
113
+
114
+ /**
115
+ * Direction of the transaction entry
116
+ */
117
+ direction: 'credit' | 'debit';
118
+
119
+ /**
120
+ * Unique identifier for the loyalty account
121
+ */
122
+ loyaltyAccountId: string;
123
+
124
+ /**
125
+ * Details of the loyalty transaction
126
+ */
127
+ loyaltyTransaction: Data.LoyaltyTransaction;
128
+
129
+ /**
130
+ * Unique identifier for the organization
131
+ */
132
+ organizationId: string;
133
+
134
+ /**
135
+ * Type of the loyalty transaction
136
+ */
137
+ type: 'auction_bid' | 'direct_mint' | 'loyalty_rule' | 'api_key' | 'order';
138
+
139
+ /**
140
+ * Timestamp when the transaction entry was last updated
141
+ */
142
+ updatedAt: string;
143
+
144
+ /**
145
+ * Unique identifier for the website
146
+ */
147
+ websiteId: string;
148
+
149
+ /**
150
+ * Optional metadata for the transaction entry
151
+ */
152
+ metadata?: Record<string, unknown>;
153
+ }
154
+
155
+ export namespace Data {
156
+ /**
157
+ * Details of the loyalty transaction
158
+ */
159
+ export interface LoyaltyTransaction {
160
+ /**
161
+ * Unique identifier for the loyalty transaction
162
+ */
163
+ id: string;
164
+
165
+ /**
166
+ * Type of the loyalty transaction
167
+ */
168
+ type: 'auction_bid' | 'direct_mint' | 'loyalty_rule' | 'api_key' | 'order';
169
+
170
+ /**
171
+ * Details of the loyalty rule associated with the transaction
172
+ */
173
+ loyaltyRule?: LoyaltyTransaction.LoyaltyRule;
174
+ }
175
+
176
+ export namespace LoyaltyTransaction {
177
+ /**
178
+ * Details of the loyalty rule associated with the transaction
179
+ */
180
+ export interface LoyaltyRule {
181
+ /**
182
+ * Unique identifier for the loyalty rule
183
+ */
184
+ id: string;
185
+
186
+ /**
187
+ * Type of the loyalty rule
188
+ */
189
+ type: string;
190
+
191
+ /**
192
+ * Description of the loyalty rule
193
+ */
194
+ description?: string;
195
+
196
+ /**
197
+ * Optional metadata for the loyalty rule
198
+ */
199
+ metadata?: Record<string, unknown>;
200
+
201
+ /**
202
+ * Name of the loyalty rule
203
+ */
204
+ name?: string;
205
+ }
206
+ }
207
+ }
208
+ }
209
+
210
+ export interface TransactionEntryCreateTransactionResponse {
211
+ id: string;
212
+
213
+ createdAt: string;
214
+
215
+ description: string;
216
+
217
+ entries: Array<TransactionEntryCreateTransactionResponse.Entry>;
218
+
219
+ updatedAt: string;
220
+ }
221
+
222
+ export namespace TransactionEntryCreateTransactionResponse {
223
+ export interface Entry {
224
+ amount: number;
225
+
226
+ /**
227
+ * Direction of the transaction entry
228
+ */
229
+ direction: 'credit' | 'debit';
230
+
231
+ walletAddress: string;
232
+
233
+ idempotencyKey?: string;
234
+ }
235
+ }
236
+
237
+ export interface TransactionEntryListRuleGroupsResponse {
238
+ data: Array<TransactionEntryListRuleGroupsResponse.Data>;
239
+
240
+ hasNextPage: boolean;
241
+ }
242
+
243
+ export namespace TransactionEntryListRuleGroupsResponse {
244
+ export interface Data {
245
+ id: string;
246
+
247
+ isCollapsible: boolean;
248
+
249
+ isRequired: boolean;
250
+
251
+ loyaltyGroupItems: Array<Data.LoyaltyGroupItem>;
252
+
253
+ name: string;
254
+
255
+ sortId: number;
256
+
257
+ subTitle: string | null;
258
+ }
259
+
260
+ export namespace Data {
261
+ export interface LoyaltyGroupItem {
262
+ id: string;
263
+
264
+ loyaltyRule: LoyaltyGroupItem.LoyaltyRule;
265
+
266
+ sortId: number;
267
+ }
268
+
269
+ export namespace LoyaltyGroupItem {
270
+ export interface LoyaltyRule {
271
+ id: string;
272
+
273
+ amount: number | null;
274
+
275
+ description: string | null;
276
+
277
+ endTime: string | null;
278
+
279
+ hideInUi: boolean;
280
+
281
+ isRequired: boolean;
282
+
283
+ loyaltyCurrencyId: string;
284
+
285
+ name: string;
286
+
287
+ rewardType: 'points' | 'multiplier';
288
+
289
+ type:
290
+ | 'Bonus'
291
+ | 'BoughtOn'
292
+ | 'BoughtWithRoyalties'
293
+ | 'DiscordMessages'
294
+ | 'Listing'
295
+ | 'Lodging'
296
+ | 'MintOn'
297
+ | 'PoapClaim'
298
+ | 'SnagSocialsConnected'
299
+ | 'SnapshotFullset'
300
+ | 'SnapshotHold'
301
+ | 'SoldOn'
302
+ | 'SoldWithRoyalties'
303
+ | 'TokenHold'
304
+ | 'TwitterBio'
305
+ | 'TwitterHashTagPost'
306
+ | 'Retweet'
307
+ | 'check_in'
308
+ | 'code_entry'
309
+ | 'connect_wallet'
310
+ | 'connected_discord'
311
+ | 'connected_email'
312
+ | 'connected_epic'
313
+ | 'connected_steam'
314
+ | 'connected_telegram'
315
+ | 'connected_twitter'
316
+ | 'create_partner_account'
317
+ | 'discord_member'
318
+ | 'drip_x_follow'
319
+ | 'drip_x_new_tweet'
320
+ | 'drip_x_text_in_bio'
321
+ | 'drip_x_text_in_comment'
322
+ | 'drip_x_text_in_name'
323
+ | 'drip_x_tweet'
324
+ | 'external_rule'
325
+ | 'link_click'
326
+ | 'manual_upload'
327
+ | 'profile_completed'
328
+ | 'referred_user'
329
+ | 'smart_contract_event'
330
+ | 'snapshot_governance'
331
+ | 'telegram_join'
332
+ | 'telegram_messages'
333
+ | 'text_input'
334
+ | 'token_hold_erc20'
335
+ | 'tweet_liked_by_project'
336
+ | 'twitter_comment'
337
+ | 'twitter_follow'
338
+ | 'twitter_followers'
339
+ | 'twitter_like'
340
+ | 'twitter_post_hashtag'
341
+ | 'quiz'
342
+ | 'poll';
343
+ }
344
+ }
345
+ }
346
+ }
347
+
348
+ export interface TransactionEntryListParams {
349
+ /**
350
+ * Direction of the transaction entry to filter by
351
+ */
352
+ direction?: 'credit' | 'debit';
353
+
354
+ /**
355
+ * Key to ensure idempotency of the request
356
+ */
357
+ idempotencyKey?: string;
358
+
359
+ /**
360
+ * Maximum number of records to return (max 1000)
361
+ */
362
+ limit?: number;
363
+
364
+ /**
365
+ * Unique identifier for the loyalty rule to filter by
366
+ */
367
+ loyaltyRuleId?: string;
368
+
369
+ /**
370
+ * Unique identifier for the loyalty transaction to filter by
371
+ */
372
+ loyaltyTransactionId?: string;
373
+
374
+ /**
375
+ * Field to order the results by
376
+ */
377
+ orderBy?: 'createdAt' | 'updatedAt' | 'loyaltyAccountLockVersion';
378
+
379
+ /**
380
+ * Unique identifier for the organization to filter by
381
+ */
382
+ organizationId?: string;
383
+
384
+ /**
385
+ * Pagination cursor to start after a specific resource ID
386
+ */
387
+ startingAfter?: string;
388
+
389
+ /**
390
+ * Type of the loyalty transaction to filter by
391
+ */
392
+ type?: 'auction_bid' | 'direct_mint' | 'loyalty_rule' | 'api_key' | 'order';
393
+
394
+ /**
395
+ * When passed in return the list of fulfilled entries for loyalty rules. If a
396
+ * loyalty rule has a fulfilled entry this means the user cannot currently complete
397
+ * the rule. Must be passed in with userId or walletAddress.
398
+ */
399
+ userCompletedLoyaltyRuleId?: string | Array<string>;
400
+
401
+ /**
402
+ * External identifier for the user group controlled by you
403
+ */
404
+ userGroupExternalIdentifier?: string;
405
+
406
+ /**
407
+ * Unique identifier for the user group
408
+ */
409
+ userGroupId?: string;
410
+
411
+ /**
412
+ * User ID or array of User IDs to filter by
413
+ */
414
+ userId?: string | Array<string>;
415
+
416
+ /**
417
+ * Wallet address or array of wallet addresses to filter by
418
+ */
419
+ walletAddress?: string | Array<string>;
420
+
421
+ /**
422
+ * Identifier for the wallet group to filter by
423
+ */
424
+ walletGroupIdentifier?: string;
425
+
426
+ /**
427
+ * Unique identifier for the website to filter by
428
+ */
429
+ websiteId?: string;
430
+ }
431
+
432
+ export interface TransactionEntryCreateTransactionParams {
433
+ /**
434
+ * Description of the loyalty transaction
435
+ */
436
+ description: string;
437
+
438
+ /**
439
+ * Array of transaction entries
440
+ */
441
+ entries: Array<TransactionEntryCreateTransactionParams.Entry>;
442
+
443
+ /**
444
+ * Unique identifier for the loyalty currency
445
+ */
446
+ loyaltyCurrencyId?: string;
447
+ }
448
+
449
+ export namespace TransactionEntryCreateTransactionParams {
450
+ export interface Entry {
451
+ /**
452
+ * Transaction entry amount.
453
+ */
454
+ amount: number;
455
+
456
+ /**
457
+ * Direction of the transaction entry for this wallet address
458
+ */
459
+ direction?: 'credit' | 'debit';
460
+
461
+ /**
462
+ * Idempotency key for the transaction entry. Creation will fail if already exists
463
+ * for this wallet address.
464
+ */
465
+ idempotencyKey?: string;
466
+
467
+ /**
468
+ * The wallet address of the user
469
+ */
470
+ walletAddress?: string;
471
+ }
472
+ }
473
+
474
+ export interface TransactionEntryListRuleGroupsParams {
475
+ excludeHidden?: string;
476
+
477
+ limit?: number;
478
+
479
+ organizationId?: string;
480
+
481
+ startingAfter?: string;
482
+
483
+ websiteId?: string;
484
+ }
485
+
486
+ TransactionEntries.Accounts = Accounts;
487
+ TransactionEntries.Questions = Questions;
488
+ TransactionEntries.QuestionsResponses = QuestionsResponses;
489
+
490
+ export declare namespace TransactionEntries {
491
+ export {
492
+ type TransactionEntryListResponse as TransactionEntryListResponse,
493
+ type TransactionEntryCreateTransactionResponse as TransactionEntryCreateTransactionResponse,
494
+ type TransactionEntryListRuleGroupsResponse as TransactionEntryListRuleGroupsResponse,
495
+ type TransactionEntryListParams as TransactionEntryListParams,
496
+ type TransactionEntryCreateTransactionParams as TransactionEntryCreateTransactionParams,
497
+ type TransactionEntryListRuleGroupsParams as TransactionEntryListRuleGroupsParams,
498
+ };
499
+
500
+ export {
501
+ Accounts as Accounts,
502
+ type AccountListResponse as AccountListResponse,
503
+ type AccountRetrieveRankResponse as AccountRetrieveRankResponse,
504
+ type AccountListParams as AccountListParams,
505
+ type AccountRetrieveRankParams as AccountRetrieveRankParams,
506
+ };
507
+
508
+ export {
509
+ Questions as Questions,
510
+ type QuestionCreateResponse as QuestionCreateResponse,
511
+ type QuestionUpdateResponse as QuestionUpdateResponse,
512
+ type QuestionListResponse as QuestionListResponse,
513
+ type QuestionCreateParams as QuestionCreateParams,
514
+ type QuestionUpdateParams as QuestionUpdateParams,
515
+ type QuestionListParams as QuestionListParams,
516
+ };
517
+
518
+ export {
519
+ QuestionsResponses as QuestionsResponses,
520
+ type QuestionsResponseListResponse as QuestionsResponseListResponse,
521
+ type QuestionsResponseSubmitResponse as QuestionsResponseSubmitResponse,
522
+ type QuestionsResponseListParams as QuestionsResponseListParams,
523
+ type QuestionsResponseSubmitParams as QuestionsResponseSubmitParams,
524
+ };
525
+ }
@@ -1,12 +1,11 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- export { Metadatas, type MetadataCreateResponse, type MetadataCreateParams } from './metadatas';
4
- export { Users } from './users';
5
3
  export {
6
- Wallets,
7
- type WalletCreateResponse,
8
- type WalletListResponse,
9
- type WalletDeleteResponse,
10
- type WalletCreateParams,
11
- type WalletListParams,
12
- } from './wallets';
4
+ Metadatas,
5
+ type MetadataCreateResponse,
6
+ type MetadataRetrieveResponse,
7
+ type MetadataCreateParams,
8
+ type MetadataRetrieveParams,
9
+ } from './metadatas';
10
+ export { Users } from './users';
11
+ export { Wallets } from './wallets';
@@ -6,7 +6,7 @@ import * as Core from '../../core';
6
6
 
7
7
  export class Metadatas extends APIResource {
8
8
  /**
9
- * This endpoint allows you to create or edit a user metadata
9
+ * This endpoint is used to create user metadata
10
10
  */
11
11
  create(body?: MetadataCreateParams, options?: Core.RequestOptions): Core.APIPromise<MetadataCreateResponse>;
12
12
  create(options?: Core.RequestOptions): Core.APIPromise<MetadataCreateResponse>;
@@ -19,11 +19,26 @@ export class Metadatas extends APIResource {
19
19
  }
20
20
  return this._client.post('/api/users/metadatas', { body, ...options });
21
21
  }
22
+
23
+ /**
24
+ * This endpoint is used to get user metadata
25
+ */
26
+ retrieve(
27
+ query?: MetadataRetrieveParams,
28
+ options?: Core.RequestOptions,
29
+ ): Core.APIPromise<MetadataRetrieveResponse>;
30
+ retrieve(options?: Core.RequestOptions): Core.APIPromise<MetadataRetrieveResponse>;
31
+ retrieve(
32
+ query: MetadataRetrieveParams | Core.RequestOptions = {},
33
+ options?: Core.RequestOptions,
34
+ ): Core.APIPromise<MetadataRetrieveResponse> {
35
+ if (isRequestOptions(query)) {
36
+ return this.retrieve({}, query);
37
+ }
38
+ return this._client.get('/api/users/metadatas', { query, ...options });
39
+ }
22
40
  }
23
41
 
24
- /**
25
- * Schema for user metadata response
26
- */
27
42
  export interface MetadataCreateResponse {
28
43
  /**
29
44
  * Unique identifier for the user metadata
@@ -40,15 +55,14 @@ export interface MetadataCreateResponse {
40
55
  */
41
56
  organizationId: string;
42
57
 
43
- /**
44
- * Timestamp when the wallet was last updated
45
- */
46
- updatedAt: string;
58
+ user: MetadataCreateResponse.User;
59
+
60
+ userGroup: MetadataCreateResponse.UserGroup;
47
61
 
48
62
  /**
49
- * Validated and formatted wallet address
63
+ * Identifier for the user group set via api
50
64
  */
51
- walletAddress: string;
65
+ userGroupId: string | null;
52
66
 
53
67
  /**
54
68
  * Identifier for the user wallet group set via api
@@ -61,6 +75,53 @@ export interface MetadataCreateResponse {
61
75
  websiteId: string;
62
76
  }
63
77
 
78
+ export namespace MetadataCreateResponse {
79
+ export interface User {
80
+ /**
81
+ * Id for the user
82
+ */
83
+ id: string;
84
+
85
+ /**
86
+ * Wallet address of the user
87
+ */
88
+ walletAddress: string;
89
+ }
90
+
91
+ export interface UserGroup {
92
+ /**
93
+ * id for the user group
94
+ */
95
+ id: string;
96
+
97
+ /**
98
+ * External identifier for the user group
99
+ */
100
+ externalIdentifier: string | null;
101
+ }
102
+ }
103
+
104
+ /**
105
+ * Response schema for fetching user metadata
106
+ */
107
+ export interface MetadataRetrieveResponse {
108
+ data: Array<MetadataRetrieveResponse.Data>;
109
+
110
+ /**
111
+ * Indicates if there are more records available
112
+ */
113
+ hasNextPage: boolean;
114
+ }
115
+
116
+ export namespace MetadataRetrieveResponse {
117
+ export interface Data {
118
+ /**
119
+ * Unique identifier for the user metadata
120
+ */
121
+ id: string;
122
+ }
123
+ }
124
+
64
125
  export interface MetadataCreateParams {
65
126
  discordUser?: string | null;
66
127
 
@@ -88,6 +149,10 @@ export interface MetadataCreateParams {
88
149
 
89
150
  twitterUserId?: string | null;
90
151
 
152
+ userGroupExternalIdentifier?: string | null;
153
+
154
+ userGroupId?: string;
155
+
91
156
  userId?: string;
92
157
 
93
158
  walletAddress?: string;
@@ -95,9 +160,43 @@ export interface MetadataCreateParams {
95
160
  walletGroupIdentifier?: string | null;
96
161
  }
97
162
 
163
+ export interface MetadataRetrieveParams {
164
+ /**
165
+ * Number of records to fetch
166
+ */
167
+ limit?: number;
168
+
169
+ /**
170
+ * UUID of the organization
171
+ */
172
+ organizationId?: string;
173
+
174
+ /**
175
+ * Fetch records starting after this ID
176
+ */
177
+ startingAfter?: string;
178
+
179
+ /**
180
+ * UUID of the user
181
+ */
182
+ userId?: string;
183
+
184
+ /**
185
+ * Wallet address of the user
186
+ */
187
+ walletAddress?: string;
188
+
189
+ /**
190
+ * UUID of the website
191
+ */
192
+ websiteId?: string;
193
+ }
194
+
98
195
  export declare namespace Metadatas {
99
196
  export {
100
197
  type MetadataCreateResponse as MetadataCreateResponse,
198
+ type MetadataRetrieveResponse as MetadataRetrieveResponse,
101
199
  type MetadataCreateParams as MetadataCreateParams,
200
+ type MetadataRetrieveParams as MetadataRetrieveParams,
102
201
  };
103
202
  }