@privy-io/api-types 0.1.1

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 (507) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/LICENSE +201 -0
  3. package/README.md +364 -0
  4. package/api-promise.d.mts +2 -0
  5. package/api-promise.d.mts.map +1 -0
  6. package/api-promise.d.ts +2 -0
  7. package/api-promise.d.ts.map +1 -0
  8. package/api-promise.js +6 -0
  9. package/api-promise.js.map +1 -0
  10. package/api-promise.mjs +2 -0
  11. package/api-promise.mjs.map +1 -0
  12. package/client.d.mts +233 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +233 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +517 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +513 -0
  19. package/client.mjs.map +1 -0
  20. package/core/api-promise.d.mts +46 -0
  21. package/core/api-promise.d.mts.map +1 -0
  22. package/core/api-promise.d.ts +46 -0
  23. package/core/api-promise.d.ts.map +1 -0
  24. package/core/api-promise.js +74 -0
  25. package/core/api-promise.js.map +1 -0
  26. package/core/api-promise.mjs +70 -0
  27. package/core/api-promise.mjs.map +1 -0
  28. package/core/error.d.mts +46 -0
  29. package/core/error.d.mts.map +1 -0
  30. package/core/error.d.ts +46 -0
  31. package/core/error.d.ts.map +1 -0
  32. package/core/error.js +113 -0
  33. package/core/error.js.map +1 -0
  34. package/core/error.mjs +97 -0
  35. package/core/error.mjs.map +1 -0
  36. package/core/pagination.d.mts +54 -0
  37. package/core/pagination.d.mts.map +1 -0
  38. package/core/pagination.d.ts +54 -0
  39. package/core/pagination.d.ts.map +1 -0
  40. package/core/pagination.js +101 -0
  41. package/core/pagination.js.map +1 -0
  42. package/core/pagination.mjs +95 -0
  43. package/core/pagination.mjs.map +1 -0
  44. package/core/resource.d.mts +6 -0
  45. package/core/resource.d.mts.map +1 -0
  46. package/core/resource.d.ts +6 -0
  47. package/core/resource.d.ts.map +1 -0
  48. package/core/resource.js +11 -0
  49. package/core/resource.js.map +1 -0
  50. package/core/resource.mjs +7 -0
  51. package/core/resource.mjs.map +1 -0
  52. package/core/uploads.d.mts +3 -0
  53. package/core/uploads.d.mts.map +1 -0
  54. package/core/uploads.d.ts +3 -0
  55. package/core/uploads.d.ts.map +1 -0
  56. package/core/uploads.js +6 -0
  57. package/core/uploads.js.map +1 -0
  58. package/core/uploads.mjs +2 -0
  59. package/core/uploads.mjs.map +1 -0
  60. package/error.d.mts +2 -0
  61. package/error.d.mts.map +1 -0
  62. package/error.d.ts +2 -0
  63. package/error.d.ts.map +1 -0
  64. package/error.js +6 -0
  65. package/error.js.map +1 -0
  66. package/error.mjs +2 -0
  67. package/error.mjs.map +1 -0
  68. package/index.d.mts +2 -0
  69. package/index.d.mts.map +1 -0
  70. package/index.d.ts +2 -0
  71. package/index.d.ts.map +1 -0
  72. package/index.js +9 -0
  73. package/index.js.map +1 -0
  74. package/index.mjs +3 -0
  75. package/index.mjs.map +1 -0
  76. package/internal/builtin-types.d.mts +73 -0
  77. package/internal/builtin-types.d.mts.map +1 -0
  78. package/internal/builtin-types.d.ts +73 -0
  79. package/internal/builtin-types.d.ts.map +1 -0
  80. package/internal/builtin-types.js +4 -0
  81. package/internal/builtin-types.js.map +1 -0
  82. package/internal/builtin-types.mjs +3 -0
  83. package/internal/builtin-types.mjs.map +1 -0
  84. package/internal/detect-platform.d.mts +15 -0
  85. package/internal/detect-platform.d.mts.map +1 -0
  86. package/internal/detect-platform.d.ts +15 -0
  87. package/internal/detect-platform.d.ts.map +1 -0
  88. package/internal/detect-platform.js +162 -0
  89. package/internal/detect-platform.js.map +1 -0
  90. package/internal/detect-platform.mjs +157 -0
  91. package/internal/detect-platform.mjs.map +1 -0
  92. package/internal/errors.d.mts +3 -0
  93. package/internal/errors.d.mts.map +1 -0
  94. package/internal/errors.d.ts +3 -0
  95. package/internal/errors.d.ts.map +1 -0
  96. package/internal/errors.js +41 -0
  97. package/internal/errors.js.map +1 -0
  98. package/internal/errors.mjs +36 -0
  99. package/internal/errors.mjs.map +1 -0
  100. package/internal/headers.d.mts +20 -0
  101. package/internal/headers.d.mts.map +1 -0
  102. package/internal/headers.d.ts +20 -0
  103. package/internal/headers.d.ts.map +1 -0
  104. package/internal/headers.js +79 -0
  105. package/internal/headers.js.map +1 -0
  106. package/internal/headers.mjs +74 -0
  107. package/internal/headers.mjs.map +1 -0
  108. package/internal/parse.d.mts +12 -0
  109. package/internal/parse.d.mts.map +1 -0
  110. package/internal/parse.d.ts +12 -0
  111. package/internal/parse.d.ts.map +1 -0
  112. package/internal/parse.js +35 -0
  113. package/internal/parse.js.map +1 -0
  114. package/internal/parse.mjs +32 -0
  115. package/internal/parse.mjs.map +1 -0
  116. package/internal/qs/formats.d.mts +7 -0
  117. package/internal/qs/formats.d.mts.map +1 -0
  118. package/internal/qs/formats.d.ts +7 -0
  119. package/internal/qs/formats.d.ts.map +1 -0
  120. package/internal/qs/formats.js +13 -0
  121. package/internal/qs/formats.js.map +1 -0
  122. package/internal/qs/formats.mjs +9 -0
  123. package/internal/qs/formats.mjs.map +1 -0
  124. package/internal/qs/index.d.mts +10 -0
  125. package/internal/qs/index.d.mts.map +1 -0
  126. package/internal/qs/index.d.ts +10 -0
  127. package/internal/qs/index.d.ts.map +1 -0
  128. package/internal/qs/index.js +14 -0
  129. package/internal/qs/index.js.map +1 -0
  130. package/internal/qs/index.mjs +10 -0
  131. package/internal/qs/index.mjs.map +1 -0
  132. package/internal/qs/stringify.d.mts +3 -0
  133. package/internal/qs/stringify.d.mts.map +1 -0
  134. package/internal/qs/stringify.d.ts +3 -0
  135. package/internal/qs/stringify.d.ts.map +1 -0
  136. package/internal/qs/stringify.js +277 -0
  137. package/internal/qs/stringify.js.map +1 -0
  138. package/internal/qs/stringify.mjs +274 -0
  139. package/internal/qs/stringify.mjs.map +1 -0
  140. package/internal/qs/types.d.mts +57 -0
  141. package/internal/qs/types.d.mts.map +1 -0
  142. package/internal/qs/types.d.ts +57 -0
  143. package/internal/qs/types.d.ts.map +1 -0
  144. package/internal/qs/types.js +3 -0
  145. package/internal/qs/types.js.map +1 -0
  146. package/internal/qs/types.mjs +2 -0
  147. package/internal/qs/types.mjs.map +1 -0
  148. package/internal/qs/utils.d.mts +15 -0
  149. package/internal/qs/utils.d.mts.map +1 -0
  150. package/internal/qs/utils.d.ts +15 -0
  151. package/internal/qs/utils.d.ts.map +1 -0
  152. package/internal/qs/utils.js +230 -0
  153. package/internal/qs/utils.js.map +1 -0
  154. package/internal/qs/utils.mjs +217 -0
  155. package/internal/qs/utils.mjs.map +1 -0
  156. package/internal/request-options.d.mts +75 -0
  157. package/internal/request-options.d.mts.map +1 -0
  158. package/internal/request-options.d.ts +75 -0
  159. package/internal/request-options.d.ts.map +1 -0
  160. package/internal/request-options.js +14 -0
  161. package/internal/request-options.js.map +1 -0
  162. package/internal/request-options.mjs +10 -0
  163. package/internal/request-options.mjs.map +1 -0
  164. package/internal/shim-types.d.mts +17 -0
  165. package/internal/shim-types.d.mts.map +1 -0
  166. package/internal/shim-types.d.ts +17 -0
  167. package/internal/shim-types.d.ts.map +1 -0
  168. package/internal/shim-types.js +4 -0
  169. package/internal/shim-types.js.map +1 -0
  170. package/internal/shim-types.mjs +3 -0
  171. package/internal/shim-types.mjs.map +1 -0
  172. package/internal/shims.d.mts +20 -0
  173. package/internal/shims.d.mts.map +1 -0
  174. package/internal/shims.d.ts +20 -0
  175. package/internal/shims.d.ts.map +1 -0
  176. package/internal/shims.js +92 -0
  177. package/internal/shims.js.map +1 -0
  178. package/internal/shims.mjs +85 -0
  179. package/internal/shims.mjs.map +1 -0
  180. package/internal/to-file.d.mts +45 -0
  181. package/internal/to-file.d.mts.map +1 -0
  182. package/internal/to-file.d.ts +45 -0
  183. package/internal/to-file.d.ts.map +1 -0
  184. package/internal/to-file.js +91 -0
  185. package/internal/to-file.js.map +1 -0
  186. package/internal/to-file.mjs +88 -0
  187. package/internal/to-file.mjs.map +1 -0
  188. package/internal/tslib.js +81 -0
  189. package/internal/tslib.mjs +17 -0
  190. package/internal/types.d.mts +69 -0
  191. package/internal/types.d.mts.map +1 -0
  192. package/internal/types.d.ts +69 -0
  193. package/internal/types.d.ts.map +1 -0
  194. package/internal/types.js +4 -0
  195. package/internal/types.js.map +1 -0
  196. package/internal/types.mjs +3 -0
  197. package/internal/types.mjs.map +1 -0
  198. package/internal/uploads.d.mts +42 -0
  199. package/internal/uploads.d.mts.map +1 -0
  200. package/internal/uploads.d.ts +42 -0
  201. package/internal/uploads.d.ts.map +1 -0
  202. package/internal/uploads.js +141 -0
  203. package/internal/uploads.js.map +1 -0
  204. package/internal/uploads.mjs +131 -0
  205. package/internal/uploads.mjs.map +1 -0
  206. package/internal/utils/base64.d.mts +3 -0
  207. package/internal/utils/base64.d.mts.map +1 -0
  208. package/internal/utils/base64.d.ts +3 -0
  209. package/internal/utils/base64.d.ts.map +1 -0
  210. package/internal/utils/base64.js +38 -0
  211. package/internal/utils/base64.js.map +1 -0
  212. package/internal/utils/base64.mjs +33 -0
  213. package/internal/utils/base64.mjs.map +1 -0
  214. package/internal/utils/bytes.d.mts +4 -0
  215. package/internal/utils/bytes.d.mts.map +1 -0
  216. package/internal/utils/bytes.d.ts +4 -0
  217. package/internal/utils/bytes.d.ts.map +1 -0
  218. package/internal/utils/bytes.js +31 -0
  219. package/internal/utils/bytes.js.map +1 -0
  220. package/internal/utils/bytes.mjs +26 -0
  221. package/internal/utils/bytes.mjs.map +1 -0
  222. package/internal/utils/env.d.mts +9 -0
  223. package/internal/utils/env.d.mts.map +1 -0
  224. package/internal/utils/env.d.ts +9 -0
  225. package/internal/utils/env.d.ts.map +1 -0
  226. package/internal/utils/env.js +22 -0
  227. package/internal/utils/env.js.map +1 -0
  228. package/internal/utils/env.mjs +18 -0
  229. package/internal/utils/env.mjs.map +1 -0
  230. package/internal/utils/log.d.mts +37 -0
  231. package/internal/utils/log.d.mts.map +1 -0
  232. package/internal/utils/log.d.ts +37 -0
  233. package/internal/utils/log.d.ts.map +1 -0
  234. package/internal/utils/log.js +85 -0
  235. package/internal/utils/log.js.map +1 -0
  236. package/internal/utils/log.mjs +79 -0
  237. package/internal/utils/log.mjs.map +1 -0
  238. package/internal/utils/path.d.mts +15 -0
  239. package/internal/utils/path.d.mts.map +1 -0
  240. package/internal/utils/path.d.ts +15 -0
  241. package/internal/utils/path.d.ts.map +1 -0
  242. package/internal/utils/path.js +79 -0
  243. package/internal/utils/path.js.map +1 -0
  244. package/internal/utils/path.mjs +74 -0
  245. package/internal/utils/path.mjs.map +1 -0
  246. package/internal/utils/sleep.d.mts +2 -0
  247. package/internal/utils/sleep.d.mts.map +1 -0
  248. package/internal/utils/sleep.d.ts +2 -0
  249. package/internal/utils/sleep.d.ts.map +1 -0
  250. package/internal/utils/sleep.js +7 -0
  251. package/internal/utils/sleep.js.map +1 -0
  252. package/internal/utils/sleep.mjs +3 -0
  253. package/internal/utils/sleep.mjs.map +1 -0
  254. package/internal/utils/uuid.d.mts +5 -0
  255. package/internal/utils/uuid.d.mts.map +1 -0
  256. package/internal/utils/uuid.d.ts +5 -0
  257. package/internal/utils/uuid.d.ts.map +1 -0
  258. package/internal/utils/uuid.js +19 -0
  259. package/internal/utils/uuid.js.map +1 -0
  260. package/internal/utils/uuid.mjs +15 -0
  261. package/internal/utils/uuid.mjs.map +1 -0
  262. package/internal/utils/values.d.mts +18 -0
  263. package/internal/utils/values.d.mts.map +1 -0
  264. package/internal/utils/values.d.ts +18 -0
  265. package/internal/utils/values.d.ts.map +1 -0
  266. package/internal/utils/values.js +112 -0
  267. package/internal/utils/values.js.map +1 -0
  268. package/internal/utils/values.mjs +94 -0
  269. package/internal/utils/values.mjs.map +1 -0
  270. package/internal/utils.d.mts +7 -0
  271. package/internal/utils.d.mts.map +1 -0
  272. package/internal/utils.d.ts +7 -0
  273. package/internal/utils.d.ts.map +1 -0
  274. package/internal/utils.js +11 -0
  275. package/internal/utils.js.map +1 -0
  276. package/internal/utils.mjs +8 -0
  277. package/internal/utils.mjs.map +1 -0
  278. package/package.json +148 -0
  279. package/pagination.d.mts +2 -0
  280. package/pagination.d.mts.map +1 -0
  281. package/pagination.d.ts +2 -0
  282. package/pagination.d.ts.map +1 -0
  283. package/pagination.js +6 -0
  284. package/pagination.js.map +1 -0
  285. package/pagination.mjs +2 -0
  286. package/pagination.mjs.map +1 -0
  287. package/resource.d.mts +2 -0
  288. package/resource.d.mts.map +1 -0
  289. package/resource.d.ts +2 -0
  290. package/resource.d.ts.map +1 -0
  291. package/resource.js +6 -0
  292. package/resource.js.map +1 -0
  293. package/resource.mjs +2 -0
  294. package/resource.mjs.map +1 -0
  295. package/resources/analytics.d.mts +17 -0
  296. package/resources/analytics.d.mts.map +1 -0
  297. package/resources/analytics.d.ts +17 -0
  298. package/resources/analytics.d.ts.map +1 -0
  299. package/resources/analytics.js +9 -0
  300. package/resources/analytics.js.map +1 -0
  301. package/resources/analytics.mjs +5 -0
  302. package/resources/analytics.mjs.map +1 -0
  303. package/resources/apps.d.mts +126 -0
  304. package/resources/apps.d.mts.map +1 -0
  305. package/resources/apps.d.ts +126 -0
  306. package/resources/apps.d.ts.map +1 -0
  307. package/resources/apps.js +9 -0
  308. package/resources/apps.js.map +1 -0
  309. package/resources/apps.mjs +5 -0
  310. package/resources/apps.mjs.map +1 -0
  311. package/resources/client-auth.d.mts +874 -0
  312. package/resources/client-auth.d.mts.map +1 -0
  313. package/resources/client-auth.d.ts +874 -0
  314. package/resources/client-auth.d.ts.map +1 -0
  315. package/resources/client-auth.js +9 -0
  316. package/resources/client-auth.js.map +1 -0
  317. package/resources/client-auth.mjs +5 -0
  318. package/resources/client-auth.mjs.map +1 -0
  319. package/resources/cross-app.d.mts +24 -0
  320. package/resources/cross-app.d.mts.map +1 -0
  321. package/resources/cross-app.d.ts +24 -0
  322. package/resources/cross-app.d.ts.map +1 -0
  323. package/resources/cross-app.js +9 -0
  324. package/resources/cross-app.js.map +1 -0
  325. package/resources/cross-app.mjs +5 -0
  326. package/resources/cross-app.mjs.map +1 -0
  327. package/resources/embedded-wallets.d.mts +125 -0
  328. package/resources/embedded-wallets.d.mts.map +1 -0
  329. package/resources/embedded-wallets.d.ts +125 -0
  330. package/resources/embedded-wallets.d.ts.map +1 -0
  331. package/resources/embedded-wallets.js +9 -0
  332. package/resources/embedded-wallets.js.map +1 -0
  333. package/resources/embedded-wallets.mjs +5 -0
  334. package/resources/embedded-wallets.mjs.map +1 -0
  335. package/resources/funding.d.mts +101 -0
  336. package/resources/funding.d.mts.map +1 -0
  337. package/resources/funding.d.ts +101 -0
  338. package/resources/funding.d.ts.map +1 -0
  339. package/resources/funding.js +9 -0
  340. package/resources/funding.js.map +1 -0
  341. package/resources/funding.mjs +5 -0
  342. package/resources/funding.mjs.map +1 -0
  343. package/resources/index.d.mts +12 -0
  344. package/resources/index.d.mts.map +1 -0
  345. package/resources/index.d.ts +12 -0
  346. package/resources/index.d.ts.map +1 -0
  347. package/resources/index.js +27 -0
  348. package/resources/index.js.map +1 -0
  349. package/resources/index.mjs +13 -0
  350. package/resources/index.mjs.map +1 -0
  351. package/resources/key-quorums.d.mts +106 -0
  352. package/resources/key-quorums.d.mts.map +1 -0
  353. package/resources/key-quorums.d.ts +106 -0
  354. package/resources/key-quorums.d.ts.map +1 -0
  355. package/resources/key-quorums.js +84 -0
  356. package/resources/key-quorums.js.map +1 -0
  357. package/resources/key-quorums.mjs +80 -0
  358. package/resources/key-quorums.mjs.map +1 -0
  359. package/resources/policies.d.mts +1284 -0
  360. package/resources/policies.d.mts.map +1 -0
  361. package/resources/policies.d.ts +1284 -0
  362. package/resources/policies.d.ts.map +1 -0
  363. package/resources/policies.js +228 -0
  364. package/resources/policies.js.map +1 -0
  365. package/resources/policies.mjs +224 -0
  366. package/resources/policies.mjs.map +1 -0
  367. package/resources/transactions.d.mts +134 -0
  368. package/resources/transactions.d.mts.map +1 -0
  369. package/resources/transactions.d.ts +134 -0
  370. package/resources/transactions.d.ts.map +1 -0
  371. package/resources/transactions.js +23 -0
  372. package/resources/transactions.js.map +1 -0
  373. package/resources/transactions.mjs +19 -0
  374. package/resources/transactions.mjs.map +1 -0
  375. package/resources/users.d.mts +901 -0
  376. package/resources/users.d.mts.map +1 -0
  377. package/resources/users.d.ts +901 -0
  378. package/resources/users.d.ts.map +1 -0
  379. package/resources/users.js +278 -0
  380. package/resources/users.js.map +1 -0
  381. package/resources/users.mjs +274 -0
  382. package/resources/users.mjs.map +1 -0
  383. package/resources/wallets/balance.d.mts +40 -0
  384. package/resources/wallets/balance.d.mts.map +1 -0
  385. package/resources/wallets/balance.d.ts +40 -0
  386. package/resources/wallets/balance.d.ts.map +1 -0
  387. package/resources/wallets/balance.js +24 -0
  388. package/resources/wallets/balance.js.map +1 -0
  389. package/resources/wallets/balance.mjs +20 -0
  390. package/resources/wallets/balance.mjs.map +1 -0
  391. package/resources/wallets/index.d.mts +4 -0
  392. package/resources/wallets/index.d.mts.map +1 -0
  393. package/resources/wallets/index.d.ts +4 -0
  394. package/resources/wallets/index.d.ts.map +1 -0
  395. package/resources/wallets/index.js +11 -0
  396. package/resources/wallets/index.js.map +1 -0
  397. package/resources/wallets/index.mjs +5 -0
  398. package/resources/wallets/index.mjs.map +1 -0
  399. package/resources/wallets/transactions.d.mts +73 -0
  400. package/resources/wallets/transactions.d.mts.map +1 -0
  401. package/resources/wallets/transactions.d.ts +73 -0
  402. package/resources/wallets/transactions.d.ts.map +1 -0
  403. package/resources/wallets/transactions.js +24 -0
  404. package/resources/wallets/transactions.js.map +1 -0
  405. package/resources/wallets/transactions.mjs +20 -0
  406. package/resources/wallets/transactions.mjs.map +1 -0
  407. package/resources/wallets/wallets.d.mts +1137 -0
  408. package/resources/wallets/wallets.d.mts.map +1 -0
  409. package/resources/wallets/wallets.d.ts +1137 -0
  410. package/resources/wallets/wallets.d.ts.map +1 -0
  411. package/resources/wallets/wallets.js +235 -0
  412. package/resources/wallets/wallets.js.map +1 -0
  413. package/resources/wallets/wallets.mjs +230 -0
  414. package/resources/wallets/wallets.mjs.map +1 -0
  415. package/resources/wallets.d.mts +2 -0
  416. package/resources/wallets.d.mts.map +1 -0
  417. package/resources/wallets.d.ts +2 -0
  418. package/resources/wallets.d.ts.map +1 -0
  419. package/resources/wallets.js +6 -0
  420. package/resources/wallets.js.map +1 -0
  421. package/resources/wallets.mjs +3 -0
  422. package/resources/wallets.mjs.map +1 -0
  423. package/resources.d.mts +2 -0
  424. package/resources.d.mts.map +1 -0
  425. package/resources.d.ts +2 -0
  426. package/resources.d.ts.map +1 -0
  427. package/resources.js +5 -0
  428. package/resources.js.map +1 -0
  429. package/resources.mjs +2 -0
  430. package/resources.mjs.map +1 -0
  431. package/src/api-promise.ts +2 -0
  432. package/src/client.ts +1200 -0
  433. package/src/core/README.md +3 -0
  434. package/src/core/api-promise.ts +92 -0
  435. package/src/core/error.ts +130 -0
  436. package/src/core/pagination.ts +152 -0
  437. package/src/core/resource.ts +11 -0
  438. package/src/core/uploads.ts +2 -0
  439. package/src/error.ts +2 -0
  440. package/src/index.ts +3 -0
  441. package/src/internal/README.md +3 -0
  442. package/src/internal/builtin-types.ts +93 -0
  443. package/src/internal/detect-platform.ts +196 -0
  444. package/src/internal/errors.ts +33 -0
  445. package/src/internal/headers.ts +97 -0
  446. package/src/internal/parse.ts +50 -0
  447. package/src/internal/qs/LICENSE.md +13 -0
  448. package/src/internal/qs/README.md +3 -0
  449. package/src/internal/qs/formats.ts +10 -0
  450. package/src/internal/qs/index.ts +13 -0
  451. package/src/internal/qs/stringify.ts +385 -0
  452. package/src/internal/qs/types.ts +71 -0
  453. package/src/internal/qs/utils.ts +265 -0
  454. package/src/internal/request-options.ts +91 -0
  455. package/src/internal/shim-types.ts +26 -0
  456. package/src/internal/shims.ts +107 -0
  457. package/src/internal/to-file.ts +154 -0
  458. package/src/internal/types.ts +95 -0
  459. package/src/internal/uploads.ts +187 -0
  460. package/src/internal/utils/base64.ts +40 -0
  461. package/src/internal/utils/bytes.ts +32 -0
  462. package/src/internal/utils/env.ts +18 -0
  463. package/src/internal/utils/log.ts +126 -0
  464. package/src/internal/utils/path.ts +88 -0
  465. package/src/internal/utils/sleep.ts +3 -0
  466. package/src/internal/utils/uuid.ts +17 -0
  467. package/src/internal/utils/values.ts +105 -0
  468. package/src/internal/utils.ts +8 -0
  469. package/src/lib/.keep +4 -0
  470. package/src/pagination.ts +2 -0
  471. package/src/resource.ts +2 -0
  472. package/src/resources/analytics.ts +20 -0
  473. package/src/resources/apps.ts +213 -0
  474. package/src/resources/client-auth.ts +1323 -0
  475. package/src/resources/cross-app.ts +34 -0
  476. package/src/resources/embedded-wallets.ts +203 -0
  477. package/src/resources/funding.ts +225 -0
  478. package/src/resources/index.ts +191 -0
  479. package/src/resources/key-quorums.ts +177 -0
  480. package/src/resources/policies.ts +1993 -0
  481. package/src/resources/transactions.ts +208 -0
  482. package/src/resources/users.ts +1552 -0
  483. package/src/resources/wallets/balance.ts +103 -0
  484. package/src/resources/wallets/index.ts +29 -0
  485. package/src/resources/wallets/transactions.ts +156 -0
  486. package/src/resources/wallets/wallets.ts +1615 -0
  487. package/src/resources/wallets.ts +3 -0
  488. package/src/resources.ts +1 -0
  489. package/src/tsconfig.json +11 -0
  490. package/src/uploads.ts +2 -0
  491. package/src/version.ts +1 -0
  492. package/uploads.d.mts +2 -0
  493. package/uploads.d.mts.map +1 -0
  494. package/uploads.d.ts +2 -0
  495. package/uploads.d.ts.map +1 -0
  496. package/uploads.js +6 -0
  497. package/uploads.js.map +1 -0
  498. package/uploads.mjs +2 -0
  499. package/uploads.mjs.map +1 -0
  500. package/version.d.mts +2 -0
  501. package/version.d.mts.map +1 -0
  502. package/version.d.ts +2 -0
  503. package/version.d.ts.map +1 -0
  504. package/version.js +5 -0
  505. package/version.js.map +1 -0
  506. package/version.mjs +2 -0
  507. package/version.mjs.map +1 -0
package/src/client.ts ADDED
@@ -0,0 +1,1200 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import type { RequestInit, RequestInfo, BodyInit } from './internal/builtin-types';
4
+ import type { HTTPMethod, PromiseOrValue, MergedRequestInit, FinalizedRequestInit } from './internal/types';
5
+ import { uuid4 } from './internal/utils/uuid';
6
+ import { validatePositiveInteger, isAbsoluteURL, safeJSON } from './internal/utils/values';
7
+ import { sleep } from './internal/utils/sleep';
8
+ export type { Logger, LogLevel } from './internal/utils/log';
9
+ import { castToError, isAbortError } from './internal/errors';
10
+ import type { APIResponseProps } from './internal/parse';
11
+ import { getPlatformHeaders } from './internal/detect-platform';
12
+ import * as Shims from './internal/shims';
13
+ import * as Opts from './internal/request-options';
14
+ import * as qs from './internal/qs';
15
+ import { VERSION } from './version';
16
+ import * as Errors from './core/error';
17
+ import * as Pagination from './core/pagination';
18
+ import { AbstractPage, type CursorParams, CursorResponse } from './core/pagination';
19
+ import * as Uploads from './core/uploads';
20
+ import * as API from './resources/index';
21
+ import { APIPromise } from './core/api-promise';
22
+ import { Analytics, AnalyticsEventInput } from './resources/analytics';
23
+ import { AppResponse, Apps } from './resources/apps';
24
+ import {
25
+ ClientAuth,
26
+ CustomJwtAuthenticateRequestBody,
27
+ CustomJwtLinkRequestBody,
28
+ CustomOAuthProviderID,
29
+ ExternalOAuthProviderID,
30
+ FarcasterAuthenticateRequestBody,
31
+ FarcasterConnectInitResponseBody,
32
+ FarcasterConnectStatusCompletedResponseBody,
33
+ FarcasterConnectStatusPendingResponseBody,
34
+ FarcasterInitRequestBody,
35
+ FarcasterLinkRequestBody,
36
+ FarcasterSignerInitRequestBody,
37
+ FarcasterSignerInitResponseBody,
38
+ FarcasterSignerStatusResponseBody,
39
+ FarcasterUnlinkRequestBody,
40
+ FarcasterV2AuthenticateRequestBody,
41
+ FarcasterV2InitRequestBody,
42
+ FarcasterV2InitResponseBody,
43
+ GuestAuthenticateRequestBody,
44
+ MfaPasskeyEnrollmentRequestBody,
45
+ MfaPasskeyInitRequestBody,
46
+ MfaPasskeyInitResponseBody,
47
+ MfaPasskeyVerifyRequestBody,
48
+ MfaSMSEnrollRequestBody,
49
+ MfaSMSInitRequestBody,
50
+ MfaSMSVerifyRequestBody,
51
+ MfaTotpInitResponseBody,
52
+ MfaTotpInput,
53
+ MfaVerifyResponseBody,
54
+ OAuthAuthenticateRequestBody,
55
+ OAuthAuthorizationCodeRequestBody,
56
+ OAuthInitRequestBody,
57
+ OAuthInitResponseBody,
58
+ OAuthLinkRequestBody,
59
+ OAuthLinkResponseBody,
60
+ OAuthProviderID,
61
+ OAuthUnlinkRequestBody,
62
+ OAuthVerifyRequestBody,
63
+ OAuthVerifyResponseBody,
64
+ OptionalRefreshTokenInput,
65
+ PasskeyAuthenticateRequestBody,
66
+ PasskeyInitAuthenticateResponseBody,
67
+ PasskeyInitLinkResponseBody,
68
+ PasskeyInitRegisterResponseBody,
69
+ PasskeyInitRequestBody,
70
+ PasskeyLinkRequestBody,
71
+ PasskeyRegisterRequestBody,
72
+ PasskeyUnlinkRequestBody,
73
+ PasswordlessAuthenticateRequestBody,
74
+ PasswordlessInitRequestBody,
75
+ PasswordlessLinkRequestBody,
76
+ PasswordlessSMSAuthenticateRequestBody,
77
+ PasswordlessSMSInitRequestBody,
78
+ PasswordlessSMSLinkRequestBody,
79
+ PasswordlessSMSUnlinkRequestBody,
80
+ PasswordlessSMSUpdateRequestBody,
81
+ PasswordlessUnlinkRequestBody,
82
+ PasswordlessUpdateRequestBody,
83
+ PrivyOAuthProviderID,
84
+ SiweAuthenticateRequestBody,
85
+ SiweInitRequestBody,
86
+ SiweInitResponseBody,
87
+ SiweLinkRequestBody,
88
+ SiweLinkSmartWalletRequestBody,
89
+ SiweUnlinkRequestBody,
90
+ SiwsAuthenticateRequestBody,
91
+ SiwsInitRequestBody,
92
+ SiwsInitResponseBody,
93
+ SiwsLinkRequestBody,
94
+ SiwsUnlinkRequestBody,
95
+ TelegramAuthenticateRequestBody,
96
+ TelegramLinkRequestBody,
97
+ TelegramUnlinkRequestBody,
98
+ } from './resources/client-auth';
99
+ import { CrossApp, CrossAppConnectionsResponse } from './resources/cross-app';
100
+ import {
101
+ EmbeddedWallets,
102
+ RecoveryConfigurationICloudRequestBody,
103
+ RecoveryConfigurationICloudResponseBody,
104
+ RecoveryKeyMaterialRequestBody,
105
+ RecoveryKeyMaterialResponseBody,
106
+ RecoveryOAuthAuthenticateResponseBody,
107
+ RecoveryOAuthCallbackICloudExpoRequestBody,
108
+ RecoveryOAuthInitICloudRequestBody,
109
+ RecoveryOAuthInitRequestBody,
110
+ SmartWalletConfiguration,
111
+ SmartWalletConfigurationInput,
112
+ } from './resources/embedded-wallets';
113
+ import {
114
+ CoinbaseOnRampInitInput,
115
+ CoinbaseOnRampInitResponse,
116
+ CoinbaseOnRampStatusResponse,
117
+ Funding,
118
+ MoonpayOnRampSignInput,
119
+ MoonpayOnRampSignResponse,
120
+ } from './resources/funding';
121
+ import {
122
+ KeyQuorum,
123
+ KeyQuorumCreateParams,
124
+ KeyQuorumDeleteParams,
125
+ KeyQuorumDeleteResponse,
126
+ KeyQuorumUpdateParams,
127
+ KeyQuorums,
128
+ } from './resources/key-quorums';
129
+ import {
130
+ Policies,
131
+ Policy,
132
+ PolicyCreateParams,
133
+ PolicyCreateRuleParams,
134
+ PolicyCreateRuleResponse,
135
+ PolicyDeleteParams,
136
+ PolicyDeleteResponse,
137
+ PolicyDeleteRuleParams,
138
+ PolicyDeleteRuleResponse,
139
+ PolicyGetRuleParams,
140
+ PolicyGetRuleResponse,
141
+ PolicyUpdateParams,
142
+ PolicyUpdateRuleParams,
143
+ PolicyUpdateRuleResponse,
144
+ } from './resources/policies';
145
+ import {
146
+ TransactionGetResponse,
147
+ TransactionScanningRequestBody,
148
+ TransactionScanningResponseBody,
149
+ Transactions,
150
+ } from './resources/transactions';
151
+ import {
152
+ AuthenticatedUser,
153
+ LinkedAccount,
154
+ LinkedAccountBitcoinSegwitEmbeddedWallet,
155
+ LinkedAccountBitcoinTaprootEmbeddedWallet,
156
+ LinkedAccountCurveSigningEmbeddedWallet,
157
+ LinkedAccountEmbeddedWallet,
158
+ LinkedAccountEmbeddedWalletWithID,
159
+ LinkedAccountEthereumEmbeddedWallet,
160
+ LinkedAccountSmartWallet,
161
+ LinkedAccountSolanaEmbeddedWallet,
162
+ SmartWalletType,
163
+ User,
164
+ UserCreateParams,
165
+ UserGetByCustomAuthIDParams,
166
+ UserGetByDiscordUsernameParams,
167
+ UserGetByEmailAddressParams,
168
+ UserGetByFarcasterIDParams,
169
+ UserGetByGitHubUsernameParams,
170
+ UserGetByPhoneNumberParams,
171
+ UserGetBySmartWalletAddressParams,
172
+ UserGetByTelegramUserIDParams,
173
+ UserGetByTelegramUsernameParams,
174
+ UserGetByTwitterSubjectParams,
175
+ UserGetByTwitterUsernameParams,
176
+ UserGetByWalletAddressParams,
177
+ UserListParams,
178
+ UserPregenerateWalletsParams,
179
+ UserSearchParams,
180
+ UserSetCustomMetadataParams,
181
+ UserUnlinkLinkedAccountParams,
182
+ UserWithIdentityToken,
183
+ Users,
184
+ UsersCursor,
185
+ } from './resources/users';
186
+ import {
187
+ CurveSigningChainType,
188
+ FirstClassChainType,
189
+ Wallet,
190
+ WalletAuthenticateWithJwtParams,
191
+ WalletAuthenticateWithJwtResponse,
192
+ WalletChainType,
193
+ WalletCreateParams,
194
+ WalletCreateWalletsWithRecoveryParams,
195
+ WalletCreateWalletsWithRecoveryResponse,
196
+ WalletExportParams,
197
+ WalletExportResponse,
198
+ WalletInitImportParams,
199
+ WalletInitImportResponse,
200
+ WalletListParams,
201
+ WalletRawSignParams,
202
+ WalletRawSignResponse,
203
+ WalletRevokeResponse,
204
+ WalletRpcParams,
205
+ WalletRpcResponse,
206
+ WalletSubmitImportParams,
207
+ WalletUpdateParams,
208
+ Wallets,
209
+ WalletsCursor,
210
+ } from './resources/wallets/wallets';
211
+ import { type Fetch } from './internal/builtin-types';
212
+ import { isRunningInBrowser } from './internal/detect-platform';
213
+ import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
214
+ import { FinalRequestOptions, RequestOptions } from './internal/request-options';
215
+ import { toBase64 } from './internal/utils/base64';
216
+ import { readEnv } from './internal/utils/env';
217
+ import {
218
+ type LogLevel,
219
+ type Logger,
220
+ formatRequestDetails,
221
+ loggerFor,
222
+ parseLogLevel,
223
+ } from './internal/utils/log';
224
+ import { isEmptyObj } from './internal/utils/values';
225
+
226
+ const environments = {
227
+ production: 'https://api.privy.io',
228
+ staging: 'https://api.staging.privy.io',
229
+ };
230
+ type Environment = keyof typeof environments;
231
+
232
+ export interface ClientOptions {
233
+ /**
234
+ * App secret authentication.
235
+ */
236
+ appID?: string | undefined;
237
+
238
+ /**
239
+ * App secret authentication.
240
+ */
241
+ appSecret?: string | undefined;
242
+
243
+ /**
244
+ * Specifies the environment to use for the API.
245
+ *
246
+ * Each environment maps to a different base URL:
247
+ * - `production` corresponds to `https://api.privy.io`
248
+ * - `staging` corresponds to `https://api.staging.privy.io`
249
+ */
250
+ environment?: Environment | undefined;
251
+
252
+ /**
253
+ * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
254
+ *
255
+ * Defaults to process.env['PRIVY_BASE_URL'].
256
+ */
257
+ baseURL?: string | null | undefined;
258
+
259
+ /**
260
+ * The maximum amount of time (in milliseconds) that the client should wait for a response
261
+ * from the server before timing out a single request.
262
+ *
263
+ * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
264
+ * much longer than this timeout before the promise succeeds or fails.
265
+ *
266
+ * @unit milliseconds
267
+ */
268
+ timeout?: number | undefined;
269
+ /**
270
+ * Additional `RequestInit` options to be passed to `fetch` calls.
271
+ * Properties will be overridden by per-request `fetchOptions`.
272
+ */
273
+ fetchOptions?: MergedRequestInit | undefined;
274
+
275
+ /**
276
+ * Specify a custom `fetch` function implementation.
277
+ *
278
+ * If not provided, we expect that `fetch` is defined globally.
279
+ */
280
+ fetch?: Fetch | undefined;
281
+
282
+ /**
283
+ * The maximum number of times that the client will retry a request in case of a
284
+ * temporary failure, like a network error or a 5XX error from the server.
285
+ *
286
+ * @default 2
287
+ */
288
+ maxRetries?: number | undefined;
289
+
290
+ /**
291
+ * Default headers to include with every request to the API.
292
+ *
293
+ * These can be removed in individual requests by explicitly setting the
294
+ * header to `null` in request options.
295
+ */
296
+ defaultHeaders?: HeadersLike | undefined;
297
+
298
+ /**
299
+ * Default query parameters to include with every request to the API.
300
+ *
301
+ * These can be removed in individual requests by explicitly setting the
302
+ * param to `undefined` in request options.
303
+ */
304
+ defaultQuery?: Record<string, string | undefined> | undefined;
305
+
306
+ /**
307
+ * Set the log level.
308
+ *
309
+ * Defaults to process.env['PRIVY_LOG'] or 'warn' if it isn't set.
310
+ */
311
+ logLevel?: LogLevel | undefined;
312
+
313
+ /**
314
+ * Set the logger.
315
+ *
316
+ * Defaults to globalThis.console.
317
+ */
318
+ logger?: Logger | undefined;
319
+ }
320
+
321
+ /**
322
+ * API Client for interfacing with the Privy API.
323
+ */
324
+ export class Privy {
325
+ appID: string;
326
+ appSecret: string;
327
+
328
+ baseURL: string;
329
+ maxRetries: number;
330
+ timeout: number;
331
+ logger: Logger | undefined;
332
+ logLevel: LogLevel | undefined;
333
+ fetchOptions: MergedRequestInit | undefined;
334
+
335
+ private fetch: Fetch;
336
+ #encoder: Opts.RequestEncoder;
337
+ protected idempotencyHeader?: string;
338
+ private _options: ClientOptions;
339
+
340
+ /**
341
+ * API Client for interfacing with the Privy API.
342
+ *
343
+ * @param {string | undefined} [opts.appID=process.env['PRIVY_APP_ID'] ?? undefined]
344
+ * @param {string | undefined} [opts.appSecret=process.env['PRIVY_APP_SECRET'] ?? undefined]
345
+ * @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
346
+ * @param {string} [opts.baseURL=process.env['PRIVY_BASE_URL'] ?? https://api.privy.io] - Override the default base URL for the API.
347
+ * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
348
+ * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
349
+ * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
350
+ * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
351
+ * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.
352
+ * @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
353
+ */
354
+ constructor({
355
+ baseURL = readEnv('PRIVY_BASE_URL'),
356
+ appID = readEnv('PRIVY_APP_ID'),
357
+ appSecret = readEnv('PRIVY_APP_SECRET'),
358
+ ...opts
359
+ }: ClientOptions = {}) {
360
+ if (appID === undefined) {
361
+ throw new Errors.PrivyError(
362
+ "The PRIVY_APP_ID environment variable is missing or empty; either provide it, or instantiate the Privy client with an appID option, like new Privy({ appID: 'My App ID' }).",
363
+ );
364
+ }
365
+ if (appSecret === undefined) {
366
+ throw new Errors.PrivyError(
367
+ "The PRIVY_APP_SECRET environment variable is missing or empty; either provide it, or instantiate the Privy client with an appSecret option, like new Privy({ appSecret: 'My App Secret' }).",
368
+ );
369
+ }
370
+
371
+ const options: ClientOptions = {
372
+ appID,
373
+ appSecret,
374
+ ...opts,
375
+ baseURL,
376
+ environment: opts.environment ?? 'production',
377
+ };
378
+
379
+ if (isRunningInBrowser()) {
380
+ throw new Errors.PrivyError(
381
+ "It looks like you're running in a browser-like environment, which is disabled to protect your secret API credentials from attackers. If you have a strong business need for client-side use of this API, please open a GitHub issue with your use-case and security mitigations.",
382
+ );
383
+ }
384
+
385
+ if (baseURL && opts.environment) {
386
+ throw new Errors.PrivyError(
387
+ 'Ambiguous URL; The `baseURL` option (or PRIVY_BASE_URL env var) and the `environment` option are given. If you want to use the environment you must pass baseURL: null',
388
+ );
389
+ }
390
+
391
+ this.baseURL = options.baseURL || environments[options.environment || 'production'];
392
+ this.timeout = options.timeout ?? Privy.DEFAULT_TIMEOUT /* 1 minute */;
393
+ this.logger = options.logger ?? console;
394
+ const defaultLogLevel = 'warn';
395
+ // Set default logLevel early so that we can log a warning in parseLogLevel.
396
+ this.logLevel = defaultLogLevel;
397
+ this.logLevel =
398
+ parseLogLevel(options.logLevel, 'ClientOptions.logLevel', this) ??
399
+ parseLogLevel(readEnv('PRIVY_LOG'), "process.env['PRIVY_LOG']", this) ??
400
+ defaultLogLevel;
401
+ this.fetchOptions = options.fetchOptions;
402
+ this.maxRetries = options.maxRetries ?? 2;
403
+ this.fetch = options.fetch ?? Shims.getDefaultFetch();
404
+ this.#encoder = Opts.FallbackEncoder;
405
+
406
+ this._options = options;
407
+
408
+ this.appID = appID;
409
+ this.appSecret = appSecret;
410
+ }
411
+
412
+ /**
413
+ * Create a new client instance re-using the same options given to the current client with optional overriding.
414
+ */
415
+ withOptions(options: Partial<ClientOptions>): this {
416
+ const client = new (this.constructor as any as new (props: ClientOptions) => typeof this)({
417
+ ...this._options,
418
+ environment: options.environment ? options.environment : undefined,
419
+ baseURL: options.environment ? undefined : this.baseURL,
420
+ maxRetries: this.maxRetries,
421
+ timeout: this.timeout,
422
+ logger: this.logger,
423
+ logLevel: this.logLevel,
424
+ fetch: this.fetch,
425
+ fetchOptions: this.fetchOptions,
426
+ appID: this.appID,
427
+ appSecret: this.appSecret,
428
+ ...options,
429
+ });
430
+ return client;
431
+ }
432
+
433
+ /**
434
+ * Check whether the base URL is set to its default.
435
+ */
436
+ #baseURLOverridden(): boolean {
437
+ return this.baseURL !== environments[this._options.environment || 'production'];
438
+ }
439
+
440
+ protected defaultQuery(): Record<string, string | undefined> | undefined {
441
+ return this._options.defaultQuery;
442
+ }
443
+
444
+ protected validateHeaders({ values, nulls }: NullableHeaders) {
445
+ return;
446
+ }
447
+
448
+ protected async authHeaders(opts: FinalRequestOptions): Promise<NullableHeaders | undefined> {
449
+ if (!this.appID) {
450
+ return undefined;
451
+ }
452
+
453
+ if (!this.appSecret) {
454
+ return undefined;
455
+ }
456
+
457
+ const credentials = `${this.appID}:${this.appSecret}`;
458
+ const Authorization = `Basic ${toBase64(credentials)}`;
459
+ return buildHeaders([{ Authorization }]);
460
+ }
461
+
462
+ protected stringifyQuery(query: Record<string, unknown>): string {
463
+ return qs.stringify(query, { arrayFormat: 'comma' });
464
+ }
465
+
466
+ private getUserAgent(): string {
467
+ return `${this.constructor.name}/JS ${VERSION}`;
468
+ }
469
+
470
+ protected defaultIdempotencyKey(): string {
471
+ return `stainless-node-retry-${uuid4()}`;
472
+ }
473
+
474
+ protected makeStatusError(
475
+ status: number,
476
+ error: Object,
477
+ message: string | undefined,
478
+ headers: Headers,
479
+ ): Errors.APIError {
480
+ return Errors.APIError.generate(status, error, message, headers);
481
+ }
482
+
483
+ buildURL(
484
+ path: string,
485
+ query: Record<string, unknown> | null | undefined,
486
+ defaultBaseURL?: string | undefined,
487
+ ): string {
488
+ const baseURL = (!this.#baseURLOverridden() && defaultBaseURL) || this.baseURL;
489
+ const url =
490
+ isAbsoluteURL(path) ?
491
+ new URL(path)
492
+ : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
493
+
494
+ const defaultQuery = this.defaultQuery();
495
+ if (!isEmptyObj(defaultQuery)) {
496
+ query = { ...defaultQuery, ...query };
497
+ }
498
+
499
+ if (typeof query === 'object' && query && !Array.isArray(query)) {
500
+ url.search = this.stringifyQuery(query as Record<string, unknown>);
501
+ }
502
+
503
+ return url.toString();
504
+ }
505
+
506
+ /**
507
+ * Used as a callback for mutating the given `FinalRequestOptions` object.
508
+ */
509
+ protected async prepareOptions(options: FinalRequestOptions): Promise<void> {}
510
+
511
+ /**
512
+ * Used as a callback for mutating the given `RequestInit` object.
513
+ *
514
+ * This is useful for cases where you want to add certain headers based off of
515
+ * the request properties, e.g. `method` or `url`.
516
+ */
517
+ protected async prepareRequest(
518
+ request: RequestInit,
519
+ { url, options }: { url: string; options: FinalRequestOptions },
520
+ ): Promise<void> {}
521
+
522
+ get<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp> {
523
+ return this.methodRequest('get', path, opts);
524
+ }
525
+
526
+ post<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp> {
527
+ return this.methodRequest('post', path, opts);
528
+ }
529
+
530
+ patch<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp> {
531
+ return this.methodRequest('patch', path, opts);
532
+ }
533
+
534
+ put<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp> {
535
+ return this.methodRequest('put', path, opts);
536
+ }
537
+
538
+ delete<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp> {
539
+ return this.methodRequest('delete', path, opts);
540
+ }
541
+
542
+ private methodRequest<Rsp>(
543
+ method: HTTPMethod,
544
+ path: string,
545
+ opts?: PromiseOrValue<RequestOptions>,
546
+ ): APIPromise<Rsp> {
547
+ return this.request(
548
+ Promise.resolve(opts).then((opts) => {
549
+ return { method, path, ...opts };
550
+ }),
551
+ );
552
+ }
553
+
554
+ request<Rsp>(
555
+ options: PromiseOrValue<FinalRequestOptions>,
556
+ remainingRetries: number | null = null,
557
+ ): APIPromise<Rsp> {
558
+ return new APIPromise(this, this.makeRequest(options, remainingRetries, undefined));
559
+ }
560
+
561
+ private async makeRequest(
562
+ optionsInput: PromiseOrValue<FinalRequestOptions>,
563
+ retriesRemaining: number | null,
564
+ retryOfRequestLogID: string | undefined,
565
+ ): Promise<APIResponseProps> {
566
+ const options = await optionsInput;
567
+ const maxRetries = options.maxRetries ?? this.maxRetries;
568
+ if (retriesRemaining == null) {
569
+ retriesRemaining = maxRetries;
570
+ }
571
+
572
+ await this.prepareOptions(options);
573
+
574
+ const { req, url, timeout } = await this.buildRequest(options, {
575
+ retryCount: maxRetries - retriesRemaining,
576
+ });
577
+
578
+ await this.prepareRequest(req, { url, options });
579
+
580
+ /** Not an API request ID, just for correlating local log entries. */
581
+ const requestLogID = 'log_' + ((Math.random() * (1 << 24)) | 0).toString(16).padStart(6, '0');
582
+ const retryLogStr = retryOfRequestLogID === undefined ? '' : `, retryOf: ${retryOfRequestLogID}`;
583
+ const startTime = Date.now();
584
+
585
+ loggerFor(this).debug(
586
+ `[${requestLogID}] sending request`,
587
+ formatRequestDetails({
588
+ retryOfRequestLogID,
589
+ method: options.method,
590
+ url,
591
+ options,
592
+ headers: req.headers,
593
+ }),
594
+ );
595
+
596
+ if (options.signal?.aborted) {
597
+ throw new Errors.APIUserAbortError();
598
+ }
599
+
600
+ const controller = new AbortController();
601
+ const response = await this.fetchWithTimeout(url, req, timeout, controller).catch(castToError);
602
+ const headersTime = Date.now();
603
+
604
+ if (response instanceof globalThis.Error) {
605
+ const retryMessage = `retrying, ${retriesRemaining} attempts remaining`;
606
+ if (options.signal?.aborted) {
607
+ throw new Errors.APIUserAbortError();
608
+ }
609
+ // detect native connection timeout errors
610
+ // deno throws "TypeError: error sending request for url (https://example/): client error (Connect): tcp connect error: Operation timed out (os error 60): Operation timed out (os error 60)"
611
+ // undici throws "TypeError: fetch failed" with cause "ConnectTimeoutError: Connect Timeout Error (attempted address: example:443, timeout: 1ms)"
612
+ // others do not provide enough information to distinguish timeouts from other connection errors
613
+ const isTimeout =
614
+ isAbortError(response) ||
615
+ /timed? ?out/i.test(String(response) + ('cause' in response ? String(response.cause) : ''));
616
+ if (retriesRemaining) {
617
+ loggerFor(this).info(
618
+ `[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} - ${retryMessage}`,
619
+ );
620
+ loggerFor(this).debug(
621
+ `[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} (${retryMessage})`,
622
+ formatRequestDetails({
623
+ retryOfRequestLogID,
624
+ url,
625
+ durationMs: headersTime - startTime,
626
+ message: response.message,
627
+ }),
628
+ );
629
+ return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID);
630
+ }
631
+ loggerFor(this).info(
632
+ `[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} - error; no more retries left`,
633
+ );
634
+ loggerFor(this).debug(
635
+ `[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} (error; no more retries left)`,
636
+ formatRequestDetails({
637
+ retryOfRequestLogID,
638
+ url,
639
+ durationMs: headersTime - startTime,
640
+ message: response.message,
641
+ }),
642
+ );
643
+ if (isTimeout) {
644
+ throw new Errors.APIConnectionTimeoutError();
645
+ }
646
+ throw new Errors.APIConnectionError({ cause: response });
647
+ }
648
+
649
+ const responseInfo = `[${requestLogID}${retryLogStr}] ${req.method} ${url} ${
650
+ response.ok ? 'succeeded' : 'failed'
651
+ } with status ${response.status} in ${headersTime - startTime}ms`;
652
+
653
+ if (!response.ok) {
654
+ const shouldRetry = await this.shouldRetry(response);
655
+ if (retriesRemaining && shouldRetry) {
656
+ const retryMessage = `retrying, ${retriesRemaining} attempts remaining`;
657
+
658
+ // We don't need the body of this response.
659
+ await Shims.CancelReadableStream(response.body);
660
+ loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
661
+ loggerFor(this).debug(
662
+ `[${requestLogID}] response error (${retryMessage})`,
663
+ formatRequestDetails({
664
+ retryOfRequestLogID,
665
+ url: response.url,
666
+ status: response.status,
667
+ headers: response.headers,
668
+ durationMs: headersTime - startTime,
669
+ }),
670
+ );
671
+ return this.retryRequest(
672
+ options,
673
+ retriesRemaining,
674
+ retryOfRequestLogID ?? requestLogID,
675
+ response.headers,
676
+ );
677
+ }
678
+
679
+ const retryMessage = shouldRetry ? `error; no more retries left` : `error; not retryable`;
680
+
681
+ loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
682
+
683
+ const errText = await response.text().catch((err: any) => castToError(err).message);
684
+ const errJSON = safeJSON(errText);
685
+ const errMessage = errJSON ? undefined : errText;
686
+
687
+ loggerFor(this).debug(
688
+ `[${requestLogID}] response error (${retryMessage})`,
689
+ formatRequestDetails({
690
+ retryOfRequestLogID,
691
+ url: response.url,
692
+ status: response.status,
693
+ headers: response.headers,
694
+ message: errMessage,
695
+ durationMs: Date.now() - startTime,
696
+ }),
697
+ );
698
+
699
+ const err = this.makeStatusError(response.status, errJSON, errMessage, response.headers);
700
+ throw err;
701
+ }
702
+
703
+ loggerFor(this).info(responseInfo);
704
+ loggerFor(this).debug(
705
+ `[${requestLogID}] response start`,
706
+ formatRequestDetails({
707
+ retryOfRequestLogID,
708
+ url: response.url,
709
+ status: response.status,
710
+ headers: response.headers,
711
+ durationMs: headersTime - startTime,
712
+ }),
713
+ );
714
+
715
+ return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
716
+ }
717
+
718
+ getAPIList<Item, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(
719
+ path: string,
720
+ Page: new (...args: any[]) => PageClass,
721
+ opts?: RequestOptions,
722
+ ): Pagination.PagePromise<PageClass, Item> {
723
+ return this.requestAPIList(Page, { method: 'get', path, ...opts });
724
+ }
725
+
726
+ requestAPIList<
727
+ Item = unknown,
728
+ PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>,
729
+ >(
730
+ Page: new (...args: ConstructorParameters<typeof Pagination.AbstractPage>) => PageClass,
731
+ options: FinalRequestOptions,
732
+ ): Pagination.PagePromise<PageClass, Item> {
733
+ const request = this.makeRequest(options, null, undefined);
734
+ return new Pagination.PagePromise<PageClass, Item>(this as any as Privy, request, Page);
735
+ }
736
+
737
+ async fetchWithTimeout(
738
+ url: RequestInfo,
739
+ init: RequestInit | undefined,
740
+ ms: number,
741
+ controller: AbortController,
742
+ ): Promise<Response> {
743
+ const { signal, method, ...options } = init || {};
744
+ if (signal) signal.addEventListener('abort', () => controller.abort());
745
+
746
+ const timeout = setTimeout(() => controller.abort(), ms);
747
+
748
+ const isReadableBody =
749
+ ((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) ||
750
+ (typeof options.body === 'object' && options.body !== null && Symbol.asyncIterator in options.body);
751
+
752
+ const fetchOptions: RequestInit = {
753
+ signal: controller.signal as any,
754
+ ...(isReadableBody ? { duplex: 'half' } : {}),
755
+ method: 'GET',
756
+ ...options,
757
+ };
758
+ if (method) {
759
+ // Custom methods like 'patch' need to be uppercased
760
+ // See https://github.com/nodejs/undici/issues/2294
761
+ fetchOptions.method = method.toUpperCase();
762
+ }
763
+
764
+ try {
765
+ // use undefined this binding; fetch errors if bound to something else in browser/cloudflare
766
+ return await this.fetch.call(undefined, url, fetchOptions);
767
+ } finally {
768
+ clearTimeout(timeout);
769
+ }
770
+ }
771
+
772
+ private async shouldRetry(response: Response): Promise<boolean> {
773
+ // Note this is not a standard header.
774
+ const shouldRetryHeader = response.headers.get('x-should-retry');
775
+
776
+ // If the server explicitly says whether or not to retry, obey.
777
+ if (shouldRetryHeader === 'true') return true;
778
+ if (shouldRetryHeader === 'false') return false;
779
+
780
+ // Retry on request timeouts.
781
+ if (response.status === 408) return true;
782
+
783
+ // Retry on lock timeouts.
784
+ if (response.status === 409) return true;
785
+
786
+ // Retry on rate limits.
787
+ if (response.status === 429) return true;
788
+
789
+ // Retry internal errors.
790
+ if (response.status >= 500) return true;
791
+
792
+ return false;
793
+ }
794
+
795
+ private async retryRequest(
796
+ options: FinalRequestOptions,
797
+ retriesRemaining: number,
798
+ requestLogID: string,
799
+ responseHeaders?: Headers | undefined,
800
+ ): Promise<APIResponseProps> {
801
+ let timeoutMillis: number | undefined;
802
+
803
+ // Note the `retry-after-ms` header may not be standard, but is a good idea and we'd like proactive support for it.
804
+ const retryAfterMillisHeader = responseHeaders?.get('retry-after-ms');
805
+ if (retryAfterMillisHeader) {
806
+ const timeoutMs = parseFloat(retryAfterMillisHeader);
807
+ if (!Number.isNaN(timeoutMs)) {
808
+ timeoutMillis = timeoutMs;
809
+ }
810
+ }
811
+
812
+ // About the Retry-After header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
813
+ const retryAfterHeader = responseHeaders?.get('retry-after');
814
+ if (retryAfterHeader && !timeoutMillis) {
815
+ const timeoutSeconds = parseFloat(retryAfterHeader);
816
+ if (!Number.isNaN(timeoutSeconds)) {
817
+ timeoutMillis = timeoutSeconds * 1000;
818
+ } else {
819
+ timeoutMillis = Date.parse(retryAfterHeader) - Date.now();
820
+ }
821
+ }
822
+
823
+ // If the API asks us to wait a certain amount of time (and it's a reasonable amount),
824
+ // just do what it says, but otherwise calculate a default
825
+ if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) {
826
+ const maxRetries = options.maxRetries ?? this.maxRetries;
827
+ timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
828
+ }
829
+ await sleep(timeoutMillis);
830
+
831
+ return this.makeRequest(options, retriesRemaining - 1, requestLogID);
832
+ }
833
+
834
+ private calculateDefaultRetryTimeoutMillis(retriesRemaining: number, maxRetries: number): number {
835
+ const initialRetryDelay = 0.5;
836
+ const maxRetryDelay = 8.0;
837
+
838
+ const numRetries = maxRetries - retriesRemaining;
839
+
840
+ // Apply exponential backoff, but not more than the max.
841
+ const sleepSeconds = Math.min(initialRetryDelay * Math.pow(2, numRetries), maxRetryDelay);
842
+
843
+ // Apply some jitter, take up to at most 25 percent of the retry time.
844
+ const jitter = 1 - Math.random() * 0.25;
845
+
846
+ return sleepSeconds * jitter * 1000;
847
+ }
848
+
849
+ async buildRequest(
850
+ inputOptions: FinalRequestOptions,
851
+ { retryCount = 0 }: { retryCount?: number } = {},
852
+ ): Promise<{ req: FinalizedRequestInit; url: string; timeout: number }> {
853
+ const options = { ...inputOptions };
854
+ const { method, path, query, defaultBaseURL } = options;
855
+
856
+ const url = this.buildURL(path!, query as Record<string, unknown>, defaultBaseURL);
857
+ if ('timeout' in options) validatePositiveInteger('timeout', options.timeout);
858
+ options.timeout = options.timeout ?? this.timeout;
859
+ const { bodyHeaders, body } = this.buildBody({ options });
860
+ const reqHeaders = await this.buildHeaders({ options: inputOptions, method, bodyHeaders, retryCount });
861
+
862
+ const req: FinalizedRequestInit = {
863
+ method,
864
+ headers: reqHeaders,
865
+ ...(options.signal && { signal: options.signal }),
866
+ ...((globalThis as any).ReadableStream &&
867
+ body instanceof (globalThis as any).ReadableStream && { duplex: 'half' }),
868
+ ...(body && { body }),
869
+ ...((this.fetchOptions as any) ?? {}),
870
+ ...((options.fetchOptions as any) ?? {}),
871
+ };
872
+
873
+ return { req, url, timeout: options.timeout };
874
+ }
875
+
876
+ private async buildHeaders({
877
+ options,
878
+ method,
879
+ bodyHeaders,
880
+ retryCount,
881
+ }: {
882
+ options: FinalRequestOptions;
883
+ method: HTTPMethod;
884
+ bodyHeaders: HeadersLike;
885
+ retryCount: number;
886
+ }): Promise<Headers> {
887
+ let idempotencyHeaders: HeadersLike = {};
888
+ if (this.idempotencyHeader && method !== 'get') {
889
+ if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey();
890
+ idempotencyHeaders[this.idempotencyHeader] = options.idempotencyKey;
891
+ }
892
+
893
+ const headers = buildHeaders([
894
+ idempotencyHeaders,
895
+ {
896
+ Accept: 'application/json',
897
+ 'User-Agent': this.getUserAgent(),
898
+ 'X-Stainless-Retry-Count': String(retryCount),
899
+ ...(options.timeout ? { 'X-Stainless-Timeout': String(Math.trunc(options.timeout / 1000)) } : {}),
900
+ ...getPlatformHeaders(),
901
+ 'privy-app-id': this.appID,
902
+ },
903
+ await this.authHeaders(options),
904
+ this._options.defaultHeaders,
905
+ bodyHeaders,
906
+ options.headers,
907
+ ]);
908
+
909
+ this.validateHeaders(headers);
910
+
911
+ return headers.values;
912
+ }
913
+
914
+ private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
915
+ bodyHeaders: HeadersLike;
916
+ body: BodyInit | undefined;
917
+ } {
918
+ if (!body) {
919
+ return { bodyHeaders: undefined, body: undefined };
920
+ }
921
+ const headers = buildHeaders([rawHeaders]);
922
+ if (
923
+ // Pass raw type verbatim
924
+ ArrayBuffer.isView(body) ||
925
+ body instanceof ArrayBuffer ||
926
+ body instanceof DataView ||
927
+ (typeof body === 'string' &&
928
+ // Preserve legacy string encoding behavior for now
929
+ headers.values.has('content-type')) ||
930
+ // `Blob` is superset of `File`
931
+ ((globalThis as any).Blob && body instanceof (globalThis as any).Blob) ||
932
+ // `FormData` -> `multipart/form-data`
933
+ body instanceof FormData ||
934
+ // `URLSearchParams` -> `application/x-www-form-urlencoded`
935
+ body instanceof URLSearchParams ||
936
+ // Send chunked stream (each chunk has own `length`)
937
+ ((globalThis as any).ReadableStream && body instanceof (globalThis as any).ReadableStream)
938
+ ) {
939
+ return { bodyHeaders: undefined, body: body as BodyInit };
940
+ } else if (
941
+ typeof body === 'object' &&
942
+ (Symbol.asyncIterator in body ||
943
+ (Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
944
+ ) {
945
+ return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
946
+ } else {
947
+ return this.#encoder({ body, headers });
948
+ }
949
+ }
950
+
951
+ static Privy = this;
952
+ static DEFAULT_TIMEOUT = 60000; // 1 minute
953
+
954
+ static PrivyError = Errors.PrivyError;
955
+ static APIError = Errors.APIError;
956
+ static APIConnectionError = Errors.APIConnectionError;
957
+ static APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
958
+ static APIUserAbortError = Errors.APIUserAbortError;
959
+ static NotFoundError = Errors.NotFoundError;
960
+ static ConflictError = Errors.ConflictError;
961
+ static RateLimitError = Errors.RateLimitError;
962
+ static BadRequestError = Errors.BadRequestError;
963
+ static AuthenticationError = Errors.AuthenticationError;
964
+ static InternalServerError = Errors.InternalServerError;
965
+ static PermissionDeniedError = Errors.PermissionDeniedError;
966
+ static UnprocessableEntityError = Errors.UnprocessableEntityError;
967
+
968
+ static toFile = Uploads.toFile;
969
+
970
+ wallets: API.Wallets = new API.Wallets(this);
971
+ apps: API.Apps = new API.Apps(this);
972
+ embeddedWallets: API.EmbeddedWallets = new API.EmbeddedWallets(this);
973
+ clientAuth: API.ClientAuth = new API.ClientAuth(this);
974
+ crossApp: API.CrossApp = new API.CrossApp(this);
975
+ funding: API.Funding = new API.Funding(this);
976
+ users: API.Users = new API.Users(this);
977
+ analytics: API.Analytics = new API.Analytics(this);
978
+ policies: API.Policies = new API.Policies(this);
979
+ transactions: API.Transactions = new API.Transactions(this);
980
+ keyQuorums: API.KeyQuorums = new API.KeyQuorums(this);
981
+ }
982
+
983
+ Privy.Wallets = Wallets;
984
+ Privy.Apps = Apps;
985
+ Privy.EmbeddedWallets = EmbeddedWallets;
986
+ Privy.ClientAuth = ClientAuth;
987
+ Privy.CrossApp = CrossApp;
988
+ Privy.Funding = Funding;
989
+ Privy.Users = Users;
990
+ Privy.Analytics = Analytics;
991
+ Privy.Policies = Policies;
992
+ Privy.Transactions = Transactions;
993
+ Privy.KeyQuorums = KeyQuorums;
994
+
995
+ export declare namespace Privy {
996
+ export type RequestOptions = Opts.RequestOptions;
997
+
998
+ export import Cursor = Pagination.Cursor;
999
+ export { type CursorParams as CursorParams, type CursorResponse as CursorResponse };
1000
+
1001
+ export {
1002
+ Wallets as Wallets,
1003
+ type CurveSigningChainType as CurveSigningChainType,
1004
+ type FirstClassChainType as FirstClassChainType,
1005
+ type Wallet as Wallet,
1006
+ type WalletChainType as WalletChainType,
1007
+ type WalletRevokeResponse as WalletRevokeResponse,
1008
+ type WalletExportResponse as WalletExportResponse,
1009
+ type WalletInitImportResponse as WalletInitImportResponse,
1010
+ type WalletRawSignResponse as WalletRawSignResponse,
1011
+ type WalletRpcResponse as WalletRpcResponse,
1012
+ type WalletAuthenticateWithJwtResponse as WalletAuthenticateWithJwtResponse,
1013
+ type WalletCreateWalletsWithRecoveryResponse as WalletCreateWalletsWithRecoveryResponse,
1014
+ type WalletsCursor as WalletsCursor,
1015
+ type WalletCreateParams as WalletCreateParams,
1016
+ type WalletListParams as WalletListParams,
1017
+ type WalletExportParams as WalletExportParams,
1018
+ type WalletInitImportParams as WalletInitImportParams,
1019
+ type WalletRawSignParams as WalletRawSignParams,
1020
+ type WalletRpcParams as WalletRpcParams,
1021
+ type WalletSubmitImportParams as WalletSubmitImportParams,
1022
+ type WalletUpdateParams as WalletUpdateParams,
1023
+ type WalletAuthenticateWithJwtParams as WalletAuthenticateWithJwtParams,
1024
+ type WalletCreateWalletsWithRecoveryParams as WalletCreateWalletsWithRecoveryParams,
1025
+ };
1026
+
1027
+ export { Apps as Apps, type AppResponse as AppResponse };
1028
+
1029
+ export {
1030
+ EmbeddedWallets as EmbeddedWallets,
1031
+ type RecoveryConfigurationICloudRequestBody as RecoveryConfigurationICloudRequestBody,
1032
+ type RecoveryConfigurationICloudResponseBody as RecoveryConfigurationICloudResponseBody,
1033
+ type RecoveryKeyMaterialRequestBody as RecoveryKeyMaterialRequestBody,
1034
+ type RecoveryKeyMaterialResponseBody as RecoveryKeyMaterialResponseBody,
1035
+ type RecoveryOAuthAuthenticateResponseBody as RecoveryOAuthAuthenticateResponseBody,
1036
+ type RecoveryOAuthCallbackICloudExpoRequestBody as RecoveryOAuthCallbackICloudExpoRequestBody,
1037
+ type RecoveryOAuthInitICloudRequestBody as RecoveryOAuthInitICloudRequestBody,
1038
+ type RecoveryOAuthInitRequestBody as RecoveryOAuthInitRequestBody,
1039
+ type SmartWalletConfiguration as SmartWalletConfiguration,
1040
+ type SmartWalletConfigurationInput as SmartWalletConfigurationInput,
1041
+ };
1042
+
1043
+ export {
1044
+ ClientAuth as ClientAuth,
1045
+ type CustomJwtAuthenticateRequestBody as CustomJwtAuthenticateRequestBody,
1046
+ type CustomJwtLinkRequestBody as CustomJwtLinkRequestBody,
1047
+ type FarcasterAuthenticateRequestBody as FarcasterAuthenticateRequestBody,
1048
+ type FarcasterConnectInitResponseBody as FarcasterConnectInitResponseBody,
1049
+ type FarcasterConnectStatusCompletedResponseBody as FarcasterConnectStatusCompletedResponseBody,
1050
+ type FarcasterConnectStatusPendingResponseBody as FarcasterConnectStatusPendingResponseBody,
1051
+ type FarcasterInitRequestBody as FarcasterInitRequestBody,
1052
+ type FarcasterLinkRequestBody as FarcasterLinkRequestBody,
1053
+ type FarcasterSignerInitRequestBody as FarcasterSignerInitRequestBody,
1054
+ type FarcasterSignerInitResponseBody as FarcasterSignerInitResponseBody,
1055
+ type FarcasterSignerStatusResponseBody as FarcasterSignerStatusResponseBody,
1056
+ type FarcasterUnlinkRequestBody as FarcasterUnlinkRequestBody,
1057
+ type FarcasterV2AuthenticateRequestBody as FarcasterV2AuthenticateRequestBody,
1058
+ type FarcasterV2InitRequestBody as FarcasterV2InitRequestBody,
1059
+ type FarcasterV2InitResponseBody as FarcasterV2InitResponseBody,
1060
+ type GuestAuthenticateRequestBody as GuestAuthenticateRequestBody,
1061
+ type MfaPasskeyEnrollmentRequestBody as MfaPasskeyEnrollmentRequestBody,
1062
+ type MfaPasskeyInitRequestBody as MfaPasskeyInitRequestBody,
1063
+ type MfaPasskeyInitResponseBody as MfaPasskeyInitResponseBody,
1064
+ type MfaPasskeyVerifyRequestBody as MfaPasskeyVerifyRequestBody,
1065
+ type MfaSMSEnrollRequestBody as MfaSMSEnrollRequestBody,
1066
+ type MfaSMSInitRequestBody as MfaSMSInitRequestBody,
1067
+ type MfaSMSVerifyRequestBody as MfaSMSVerifyRequestBody,
1068
+ type MfaTotpInitResponseBody as MfaTotpInitResponseBody,
1069
+ type MfaTotpInput as MfaTotpInput,
1070
+ type MfaVerifyResponseBody as MfaVerifyResponseBody,
1071
+ type OAuthAuthenticateRequestBody as OAuthAuthenticateRequestBody,
1072
+ type OAuthAuthorizationCodeRequestBody as OAuthAuthorizationCodeRequestBody,
1073
+ type OAuthInitRequestBody as OAuthInitRequestBody,
1074
+ type OAuthInitResponseBody as OAuthInitResponseBody,
1075
+ type OAuthLinkRequestBody as OAuthLinkRequestBody,
1076
+ type OAuthLinkResponseBody as OAuthLinkResponseBody,
1077
+ type OAuthUnlinkRequestBody as OAuthUnlinkRequestBody,
1078
+ type OAuthVerifyRequestBody as OAuthVerifyRequestBody,
1079
+ type OAuthVerifyResponseBody as OAuthVerifyResponseBody,
1080
+ type OptionalRefreshTokenInput as OptionalRefreshTokenInput,
1081
+ type PasskeyAuthenticateRequestBody as PasskeyAuthenticateRequestBody,
1082
+ type PasskeyInitAuthenticateResponseBody as PasskeyInitAuthenticateResponseBody,
1083
+ type PasskeyInitLinkResponseBody as PasskeyInitLinkResponseBody,
1084
+ type PasskeyInitRegisterResponseBody as PasskeyInitRegisterResponseBody,
1085
+ type PasskeyInitRequestBody as PasskeyInitRequestBody,
1086
+ type PasskeyLinkRequestBody as PasskeyLinkRequestBody,
1087
+ type PasskeyRegisterRequestBody as PasskeyRegisterRequestBody,
1088
+ type PasskeyUnlinkRequestBody as PasskeyUnlinkRequestBody,
1089
+ type PasswordlessAuthenticateRequestBody as PasswordlessAuthenticateRequestBody,
1090
+ type PasswordlessInitRequestBody as PasswordlessInitRequestBody,
1091
+ type PasswordlessLinkRequestBody as PasswordlessLinkRequestBody,
1092
+ type PasswordlessSMSAuthenticateRequestBody as PasswordlessSMSAuthenticateRequestBody,
1093
+ type PasswordlessSMSInitRequestBody as PasswordlessSMSInitRequestBody,
1094
+ type PasswordlessSMSLinkRequestBody as PasswordlessSMSLinkRequestBody,
1095
+ type PasswordlessSMSUnlinkRequestBody as PasswordlessSMSUnlinkRequestBody,
1096
+ type PasswordlessSMSUpdateRequestBody as PasswordlessSMSUpdateRequestBody,
1097
+ type PasswordlessUnlinkRequestBody as PasswordlessUnlinkRequestBody,
1098
+ type PasswordlessUpdateRequestBody as PasswordlessUpdateRequestBody,
1099
+ type SiweAuthenticateRequestBody as SiweAuthenticateRequestBody,
1100
+ type SiweInitRequestBody as SiweInitRequestBody,
1101
+ type SiweInitResponseBody as SiweInitResponseBody,
1102
+ type SiweLinkRequestBody as SiweLinkRequestBody,
1103
+ type SiweLinkSmartWalletRequestBody as SiweLinkSmartWalletRequestBody,
1104
+ type SiweUnlinkRequestBody as SiweUnlinkRequestBody,
1105
+ type SiwsAuthenticateRequestBody as SiwsAuthenticateRequestBody,
1106
+ type SiwsInitRequestBody as SiwsInitRequestBody,
1107
+ type SiwsInitResponseBody as SiwsInitResponseBody,
1108
+ type SiwsLinkRequestBody as SiwsLinkRequestBody,
1109
+ type SiwsUnlinkRequestBody as SiwsUnlinkRequestBody,
1110
+ type TelegramAuthenticateRequestBody as TelegramAuthenticateRequestBody,
1111
+ type TelegramLinkRequestBody as TelegramLinkRequestBody,
1112
+ type TelegramUnlinkRequestBody as TelegramUnlinkRequestBody,
1113
+ type ExternalOAuthProviderID as ExternalOAuthProviderID,
1114
+ type PrivyOAuthProviderID as PrivyOAuthProviderID,
1115
+ type CustomOAuthProviderID as CustomOAuthProviderID,
1116
+ type OAuthProviderID as OAuthProviderID,
1117
+ };
1118
+
1119
+ export { CrossApp as CrossApp, type CrossAppConnectionsResponse as CrossAppConnectionsResponse };
1120
+
1121
+ export {
1122
+ Funding as Funding,
1123
+ type CoinbaseOnRampInitInput as CoinbaseOnRampInitInput,
1124
+ type CoinbaseOnRampInitResponse as CoinbaseOnRampInitResponse,
1125
+ type CoinbaseOnRampStatusResponse as CoinbaseOnRampStatusResponse,
1126
+ type MoonpayOnRampSignInput as MoonpayOnRampSignInput,
1127
+ type MoonpayOnRampSignResponse as MoonpayOnRampSignResponse,
1128
+ };
1129
+
1130
+ export {
1131
+ Users as Users,
1132
+ type AuthenticatedUser as AuthenticatedUser,
1133
+ type LinkedAccount as LinkedAccount,
1134
+ type User as User,
1135
+ type UserWithIdentityToken as UserWithIdentityToken,
1136
+ type LinkedAccountEthereumEmbeddedWallet as LinkedAccountEthereumEmbeddedWallet,
1137
+ type LinkedAccountSolanaEmbeddedWallet as LinkedAccountSolanaEmbeddedWallet,
1138
+ type LinkedAccountBitcoinSegwitEmbeddedWallet as LinkedAccountBitcoinSegwitEmbeddedWallet,
1139
+ type LinkedAccountBitcoinTaprootEmbeddedWallet as LinkedAccountBitcoinTaprootEmbeddedWallet,
1140
+ type LinkedAccountCurveSigningEmbeddedWallet as LinkedAccountCurveSigningEmbeddedWallet,
1141
+ type LinkedAccountEmbeddedWallet as LinkedAccountEmbeddedWallet,
1142
+ type LinkedAccountEmbeddedWalletWithID as LinkedAccountEmbeddedWalletWithID,
1143
+ type SmartWalletType as SmartWalletType,
1144
+ type LinkedAccountSmartWallet as LinkedAccountSmartWallet,
1145
+ type UsersCursor as UsersCursor,
1146
+ type UserCreateParams as UserCreateParams,
1147
+ type UserListParams as UserListParams,
1148
+ type UserGetByCustomAuthIDParams as UserGetByCustomAuthIDParams,
1149
+ type UserGetByDiscordUsernameParams as UserGetByDiscordUsernameParams,
1150
+ type UserGetByEmailAddressParams as UserGetByEmailAddressParams,
1151
+ type UserGetByFarcasterIDParams as UserGetByFarcasterIDParams,
1152
+ type UserGetByGitHubUsernameParams as UserGetByGitHubUsernameParams,
1153
+ type UserGetByPhoneNumberParams as UserGetByPhoneNumberParams,
1154
+ type UserGetBySmartWalletAddressParams as UserGetBySmartWalletAddressParams,
1155
+ type UserGetByTelegramUserIDParams as UserGetByTelegramUserIDParams,
1156
+ type UserGetByTelegramUsernameParams as UserGetByTelegramUsernameParams,
1157
+ type UserGetByTwitterSubjectParams as UserGetByTwitterSubjectParams,
1158
+ type UserGetByTwitterUsernameParams as UserGetByTwitterUsernameParams,
1159
+ type UserGetByWalletAddressParams as UserGetByWalletAddressParams,
1160
+ type UserPregenerateWalletsParams as UserPregenerateWalletsParams,
1161
+ type UserSearchParams as UserSearchParams,
1162
+ type UserSetCustomMetadataParams as UserSetCustomMetadataParams,
1163
+ type UserUnlinkLinkedAccountParams as UserUnlinkLinkedAccountParams,
1164
+ };
1165
+
1166
+ export { Analytics as Analytics, type AnalyticsEventInput as AnalyticsEventInput };
1167
+
1168
+ export {
1169
+ Policies as Policies,
1170
+ type Policy as Policy,
1171
+ type PolicyCreateRuleResponse as PolicyCreateRuleResponse,
1172
+ type PolicyDeleteResponse as PolicyDeleteResponse,
1173
+ type PolicyDeleteRuleResponse as PolicyDeleteRuleResponse,
1174
+ type PolicyUpdateRuleResponse as PolicyUpdateRuleResponse,
1175
+ type PolicyGetRuleResponse as PolicyGetRuleResponse,
1176
+ type PolicyCreateParams as PolicyCreateParams,
1177
+ type PolicyCreateRuleParams as PolicyCreateRuleParams,
1178
+ type PolicyDeleteParams as PolicyDeleteParams,
1179
+ type PolicyDeleteRuleParams as PolicyDeleteRuleParams,
1180
+ type PolicyUpdateParams as PolicyUpdateParams,
1181
+ type PolicyUpdateRuleParams as PolicyUpdateRuleParams,
1182
+ type PolicyGetRuleParams as PolicyGetRuleParams,
1183
+ };
1184
+
1185
+ export {
1186
+ Transactions as Transactions,
1187
+ type TransactionScanningRequestBody as TransactionScanningRequestBody,
1188
+ type TransactionScanningResponseBody as TransactionScanningResponseBody,
1189
+ type TransactionGetResponse as TransactionGetResponse,
1190
+ };
1191
+
1192
+ export {
1193
+ KeyQuorums as KeyQuorums,
1194
+ type KeyQuorum as KeyQuorum,
1195
+ type KeyQuorumDeleteResponse as KeyQuorumDeleteResponse,
1196
+ type KeyQuorumCreateParams as KeyQuorumCreateParams,
1197
+ type KeyQuorumDeleteParams as KeyQuorumDeleteParams,
1198
+ type KeyQuorumUpdateParams as KeyQuorumUpdateParams,
1199
+ };
1200
+ }