@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
@@ -0,0 +1,1993 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { buildHeaders } from '../internal/headers';
6
+ import { RequestOptions } from '../internal/request-options';
7
+ import { path } from '../internal/utils/path';
8
+
9
+ export class Policies extends APIResource {
10
+ /**
11
+ * Create a new policy.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const policy = await client.policies.create({
16
+ * chain_type: 'ethereum',
17
+ * name: 'x',
18
+ * rules: [
19
+ * {
20
+ * action: 'ALLOW',
21
+ * conditions: [
22
+ * {
23
+ * field: 'to',
24
+ * field_source: 'ethereum_transaction',
25
+ * operator: 'eq',
26
+ * value: 'string',
27
+ * },
28
+ * ],
29
+ * method: 'eth_sendTransaction',
30
+ * name: 'x',
31
+ * },
32
+ * ],
33
+ * version: '1.0',
34
+ * });
35
+ * ```
36
+ */
37
+ create(params: PolicyCreateParams, options?: RequestOptions): APIPromise<Policy> {
38
+ const { 'privy-idempotency-key': privyIdempotencyKey, ...body } = params;
39
+ return this._client.post('/v1/policies', {
40
+ body,
41
+ ...options,
42
+ headers: buildHeaders([
43
+ { ...(privyIdempotencyKey != null ? { 'privy-idempotency-key': privyIdempotencyKey } : undefined) },
44
+ options?.headers,
45
+ ]),
46
+ });
47
+ }
48
+
49
+ /**
50
+ * Create a new rule for a policy.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * const response = await client.policies._createRule(
55
+ * 'xxxxxxxxxxxxxxxxxxxxxxxx',
56
+ * {
57
+ * action: 'ALLOW',
58
+ * conditions: [
59
+ * {
60
+ * field: 'to',
61
+ * field_source: 'ethereum_transaction',
62
+ * operator: 'eq',
63
+ * value: 'string',
64
+ * },
65
+ * ],
66
+ * method: 'eth_sendTransaction',
67
+ * name: 'x',
68
+ * },
69
+ * );
70
+ * ```
71
+ */
72
+ _createRule(
73
+ policyID: string,
74
+ params: PolicyCreateRuleParams,
75
+ options?: RequestOptions,
76
+ ): APIPromise<PolicyCreateRuleResponse> {
77
+ const { 'privy-authorization-signature': privyAuthorizationSignature, ...body } = params;
78
+ return this._client.post(path`/v1/policies/${policyID}/rules`, {
79
+ body,
80
+ ...options,
81
+ headers: buildHeaders([
82
+ {
83
+ ...(privyAuthorizationSignature != null ?
84
+ { 'privy-authorization-signature': privyAuthorizationSignature }
85
+ : undefined),
86
+ },
87
+ options?.headers,
88
+ ]),
89
+ });
90
+ }
91
+
92
+ /**
93
+ * Delete a policy by policy ID.
94
+ *
95
+ * @example
96
+ * ```ts
97
+ * const response = await client.policies._delete(
98
+ * 'xxxxxxxxxxxxxxxxxxxxxxxx',
99
+ * );
100
+ * ```
101
+ */
102
+ _delete(
103
+ policyID: string,
104
+ params: PolicyDeleteParams | null | undefined = {},
105
+ options?: RequestOptions,
106
+ ): APIPromise<PolicyDeleteResponse> {
107
+ const { 'privy-authorization-signature': privyAuthorizationSignature } = params ?? {};
108
+ return this._client.delete(path`/v1/policies/${policyID}`, {
109
+ ...options,
110
+ headers: buildHeaders([
111
+ {
112
+ ...(privyAuthorizationSignature != null ?
113
+ { 'privy-authorization-signature': privyAuthorizationSignature }
114
+ : undefined),
115
+ },
116
+ options?.headers,
117
+ ]),
118
+ });
119
+ }
120
+
121
+ /**
122
+ * Delete a rule by policy ID and rule ID.
123
+ *
124
+ * @example
125
+ * ```ts
126
+ * const response = await client.policies._deleteRule(
127
+ * 'xxxxxxxxxxxxxxxxxxxxxxxx',
128
+ * { policy_id: 'xxxxxxxxxxxxxxxxxxxxxxxx' },
129
+ * );
130
+ * ```
131
+ */
132
+ _deleteRule(
133
+ ruleID: string,
134
+ params: PolicyDeleteRuleParams,
135
+ options?: RequestOptions,
136
+ ): APIPromise<PolicyDeleteRuleResponse> {
137
+ const { policy_id, 'privy-authorization-signature': privyAuthorizationSignature } = params;
138
+ return this._client.delete(path`/v1/policies/${policy_id}/rules/${ruleID}`, {
139
+ ...options,
140
+ headers: buildHeaders([
141
+ {
142
+ ...(privyAuthorizationSignature != null ?
143
+ { 'privy-authorization-signature': privyAuthorizationSignature }
144
+ : undefined),
145
+ },
146
+ options?.headers,
147
+ ]),
148
+ });
149
+ }
150
+
151
+ /**
152
+ * Update a policy by policy ID.
153
+ *
154
+ * @example
155
+ * ```ts
156
+ * const policy = await client.policies._update(
157
+ * 'xxxxxxxxxxxxxxxxxxxxxxxx',
158
+ * );
159
+ * ```
160
+ */
161
+ _update(policyID: string, params: PolicyUpdateParams, options?: RequestOptions): APIPromise<Policy> {
162
+ const { 'privy-authorization-signature': privyAuthorizationSignature, ...body } = params;
163
+ return this._client.patch(path`/v1/policies/${policyID}`, {
164
+ body,
165
+ ...options,
166
+ headers: buildHeaders([
167
+ {
168
+ ...(privyAuthorizationSignature != null ?
169
+ { 'privy-authorization-signature': privyAuthorizationSignature }
170
+ : undefined),
171
+ },
172
+ options?.headers,
173
+ ]),
174
+ });
175
+ }
176
+
177
+ /**
178
+ * Update a rule by policy ID and rule ID.
179
+ *
180
+ * @example
181
+ * ```ts
182
+ * const response = await client.policies._updateRule(
183
+ * 'xxxxxxxxxxxxxxxxxxxxxxxx',
184
+ * {
185
+ * policy_id: 'xxxxxxxxxxxxxxxxxxxxxxxx',
186
+ * action: 'ALLOW',
187
+ * conditions: [
188
+ * {
189
+ * field: 'to',
190
+ * field_source: 'ethereum_transaction',
191
+ * operator: 'eq',
192
+ * value: 'string',
193
+ * },
194
+ * ],
195
+ * method: 'eth_sendTransaction',
196
+ * name: 'x',
197
+ * },
198
+ * );
199
+ * ```
200
+ */
201
+ _updateRule(
202
+ ruleID: string,
203
+ params: PolicyUpdateRuleParams,
204
+ options?: RequestOptions,
205
+ ): APIPromise<PolicyUpdateRuleResponse> {
206
+ const { policy_id, 'privy-authorization-signature': privyAuthorizationSignature, ...body } = params;
207
+ return this._client.patch(path`/v1/policies/${policy_id}/rules/${ruleID}`, {
208
+ body,
209
+ ...options,
210
+ headers: buildHeaders([
211
+ {
212
+ ...(privyAuthorizationSignature != null ?
213
+ { 'privy-authorization-signature': privyAuthorizationSignature }
214
+ : undefined),
215
+ },
216
+ options?.headers,
217
+ ]),
218
+ });
219
+ }
220
+
221
+ /**
222
+ * Get a policy by policy ID.
223
+ *
224
+ * @example
225
+ * ```ts
226
+ * const policy = await client.policies.get(
227
+ * 'xxxxxxxxxxxxxxxxxxxxxxxx',
228
+ * );
229
+ * ```
230
+ */
231
+ get(policyID: string, options?: RequestOptions): APIPromise<Policy> {
232
+ return this._client.get(path`/v1/policies/${policyID}`, options);
233
+ }
234
+
235
+ /**
236
+ * Get a rule by policy ID and rule ID.
237
+ *
238
+ * @example
239
+ * ```ts
240
+ * const response = await client.policies.getRule(
241
+ * 'xxxxxxxxxxxxxxxxxxxxxxxx',
242
+ * { policy_id: 'xxxxxxxxxxxxxxxxxxxxxxxx' },
243
+ * );
244
+ * ```
245
+ */
246
+ getRule(
247
+ ruleID: string,
248
+ params: PolicyGetRuleParams,
249
+ options?: RequestOptions,
250
+ ): APIPromise<PolicyGetRuleResponse> {
251
+ const { policy_id } = params;
252
+ return this._client.get(path`/v1/policies/${policy_id}/rules/${ruleID}`, options);
253
+ }
254
+ }
255
+
256
+ export interface Policy {
257
+ /**
258
+ * Unique ID of the created policy. This will be the primary identifier when using
259
+ * the policy in the future.
260
+ */
261
+ id: string;
262
+
263
+ /**
264
+ * The chain type the policy applies to.
265
+ */
266
+ chain_type: 'ethereum' | 'solana';
267
+
268
+ /**
269
+ * Unix timestamp of when the policy was created in milliseconds.
270
+ */
271
+ created_at: number;
272
+
273
+ /**
274
+ * Name to assign to policy.
275
+ */
276
+ name: string;
277
+
278
+ /**
279
+ * The key quorum ID of the owner of the policy.
280
+ */
281
+ owner_id: string | null;
282
+
283
+ rules: Array<Policy.Rule>;
284
+
285
+ /**
286
+ * Version of the policy. Currently, 1.0 is the only version.
287
+ */
288
+ version: '1.0';
289
+ }
290
+
291
+ export namespace Policy {
292
+ /**
293
+ * A rule that defines the conditions and action to take if the conditions are
294
+ * true.
295
+ */
296
+ export interface Rule {
297
+ id: string;
298
+
299
+ /**
300
+ * Action to take if the conditions are true.
301
+ */
302
+ action: 'ALLOW' | 'DENY';
303
+
304
+ conditions: Array<
305
+ | Rule.EthereumTransactionCondition
306
+ | Rule.EthereumCalldataCondition
307
+ | Rule.EthereumTypedDataDomainCondition
308
+ | Rule.EthereumTypedDataMessageCondition
309
+ | Rule.Ethereum7702AuthorizationCondition
310
+ | Rule.SolanaProgramInstructionCondition
311
+ | Rule.SolanaSystemProgramInstructionCondition
312
+ | Rule.SolanaTokenProgramInstructionCondition
313
+ | Rule.SystemCondition
314
+ >;
315
+
316
+ /**
317
+ * Method the rule applies to.
318
+ */
319
+ method:
320
+ | 'eth_sendTransaction'
321
+ | 'eth_signTransaction'
322
+ | 'eth_signTypedData_v4'
323
+ | 'eth_sign7702Authorization'
324
+ | 'signTransaction'
325
+ | 'signAndSendTransaction'
326
+ | 'exportPrivateKey'
327
+ | '*';
328
+
329
+ name: string;
330
+ }
331
+
332
+ export namespace Rule {
333
+ /**
334
+ * The verbatim Ethereum transaction object in an eth_signTransaction or
335
+ * eth_sendTransaction request.
336
+ */
337
+ export interface EthereumTransactionCondition {
338
+ field: 'to' | 'value';
339
+
340
+ field_source: 'ethereum_transaction';
341
+
342
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
343
+
344
+ value: string | Array<string>;
345
+ }
346
+
347
+ /**
348
+ * The decoded calldata in a smart contract interaction as the smart contract
349
+ * method's parameters. Note that that 'ethereum_calldata' conditions must contain
350
+ * an abi parameter with the JSON ABI of the smart contract.
351
+ */
352
+ export interface EthereumCalldataCondition {
353
+ abi: unknown;
354
+
355
+ field: string;
356
+
357
+ field_source: 'ethereum_calldata';
358
+
359
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
360
+
361
+ value: string | Array<string>;
362
+ }
363
+
364
+ /**
365
+ * Attributes from the signing domain that will verify the signature.
366
+ */
367
+ export interface EthereumTypedDataDomainCondition {
368
+ field: 'chainId' | 'verifyingContract';
369
+
370
+ field_source: 'ethereum_typed_data_domain';
371
+
372
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
373
+
374
+ value: string | Array<string>;
375
+ }
376
+
377
+ /**
378
+ * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
379
+ * EIP-712.
380
+ */
381
+ export interface EthereumTypedDataMessageCondition {
382
+ field: string;
383
+
384
+ field_source: 'ethereum_typed_data_message';
385
+
386
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
387
+
388
+ typed_data: EthereumTypedDataMessageCondition.TypedData;
389
+
390
+ value: string | Array<string>;
391
+ }
392
+
393
+ export namespace EthereumTypedDataMessageCondition {
394
+ export interface TypedData {
395
+ primary_type: string;
396
+
397
+ types: { [key: string]: Array<TypedData.Type> };
398
+ }
399
+
400
+ export namespace TypedData {
401
+ export interface Type {
402
+ name: string;
403
+
404
+ type: string;
405
+ }
406
+ }
407
+ }
408
+
409
+ /**
410
+ * Allowed contract addresses for eth_signAuthorization requests.
411
+ */
412
+ export interface Ethereum7702AuthorizationCondition {
413
+ field: 'contract';
414
+
415
+ field_source: 'ethereum_7702_authorization';
416
+
417
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
418
+
419
+ value: string | Array<string>;
420
+ }
421
+
422
+ /**
423
+ * Solana Program attributes, enables allowlisting Solana Programs.
424
+ */
425
+ export interface SolanaProgramInstructionCondition {
426
+ field: 'programId';
427
+
428
+ field_source: 'solana_program_instruction';
429
+
430
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
431
+
432
+ value: string | Array<string>;
433
+ }
434
+
435
+ /**
436
+ * Solana System Program attributes, including more granular Transfer instruction
437
+ * fields.
438
+ */
439
+ export interface SolanaSystemProgramInstructionCondition {
440
+ field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
441
+
442
+ field_source: 'solana_system_program_instruction';
443
+
444
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
445
+
446
+ value: string | Array<string>;
447
+ }
448
+
449
+ /**
450
+ * Solana Token Program attributes, including more granular TransferChecked
451
+ * instruction fields.
452
+ */
453
+ export interface SolanaTokenProgramInstructionCondition {
454
+ field:
455
+ | 'instructionName'
456
+ | 'TransferChecked.source'
457
+ | 'TransferChecked.destination'
458
+ | 'TransferChecked.authority'
459
+ | 'TransferChecked.amount'
460
+ | 'TransferChecked.mint';
461
+
462
+ field_source: 'solana_token_program_instruction';
463
+
464
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
465
+
466
+ value: string | Array<string>;
467
+ }
468
+
469
+ /**
470
+ * System attributes, including current unix timestamp (in seconds).
471
+ */
472
+ export interface SystemCondition {
473
+ field: 'current_unix_timestamp';
474
+
475
+ field_source: 'system';
476
+
477
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
478
+
479
+ value: string | Array<string>;
480
+ }
481
+ }
482
+ }
483
+
484
+ /**
485
+ * A rule that defines the conditions and action to take if the conditions are
486
+ * true.
487
+ */
488
+ export interface PolicyCreateRuleResponse {
489
+ id: string;
490
+
491
+ /**
492
+ * Action to take if the conditions are true.
493
+ */
494
+ action: 'ALLOW' | 'DENY';
495
+
496
+ conditions: Array<
497
+ | PolicyCreateRuleResponse.EthereumTransactionCondition
498
+ | PolicyCreateRuleResponse.EthereumCalldataCondition
499
+ | PolicyCreateRuleResponse.EthereumTypedDataDomainCondition
500
+ | PolicyCreateRuleResponse.EthereumTypedDataMessageCondition
501
+ | PolicyCreateRuleResponse.Ethereum7702AuthorizationCondition
502
+ | PolicyCreateRuleResponse.SolanaProgramInstructionCondition
503
+ | PolicyCreateRuleResponse.SolanaSystemProgramInstructionCondition
504
+ | PolicyCreateRuleResponse.SolanaTokenProgramInstructionCondition
505
+ | PolicyCreateRuleResponse.SystemCondition
506
+ >;
507
+
508
+ /**
509
+ * Method the rule applies to.
510
+ */
511
+ method:
512
+ | 'eth_sendTransaction'
513
+ | 'eth_signTransaction'
514
+ | 'eth_signTypedData_v4'
515
+ | 'eth_sign7702Authorization'
516
+ | 'signTransaction'
517
+ | 'signAndSendTransaction'
518
+ | 'exportPrivateKey'
519
+ | '*';
520
+
521
+ name: string;
522
+ }
523
+
524
+ export namespace PolicyCreateRuleResponse {
525
+ /**
526
+ * The verbatim Ethereum transaction object in an eth_signTransaction or
527
+ * eth_sendTransaction request.
528
+ */
529
+ export interface EthereumTransactionCondition {
530
+ field: 'to' | 'value';
531
+
532
+ field_source: 'ethereum_transaction';
533
+
534
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
535
+
536
+ value: string | Array<string>;
537
+ }
538
+
539
+ /**
540
+ * The decoded calldata in a smart contract interaction as the smart contract
541
+ * method's parameters. Note that that 'ethereum_calldata' conditions must contain
542
+ * an abi parameter with the JSON ABI of the smart contract.
543
+ */
544
+ export interface EthereumCalldataCondition {
545
+ abi: unknown;
546
+
547
+ field: string;
548
+
549
+ field_source: 'ethereum_calldata';
550
+
551
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
552
+
553
+ value: string | Array<string>;
554
+ }
555
+
556
+ /**
557
+ * Attributes from the signing domain that will verify the signature.
558
+ */
559
+ export interface EthereumTypedDataDomainCondition {
560
+ field: 'chainId' | 'verifyingContract';
561
+
562
+ field_source: 'ethereum_typed_data_domain';
563
+
564
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
565
+
566
+ value: string | Array<string>;
567
+ }
568
+
569
+ /**
570
+ * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
571
+ * EIP-712.
572
+ */
573
+ export interface EthereumTypedDataMessageCondition {
574
+ field: string;
575
+
576
+ field_source: 'ethereum_typed_data_message';
577
+
578
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
579
+
580
+ typed_data: EthereumTypedDataMessageCondition.TypedData;
581
+
582
+ value: string | Array<string>;
583
+ }
584
+
585
+ export namespace EthereumTypedDataMessageCondition {
586
+ export interface TypedData {
587
+ primary_type: string;
588
+
589
+ types: { [key: string]: Array<TypedData.Type> };
590
+ }
591
+
592
+ export namespace TypedData {
593
+ export interface Type {
594
+ name: string;
595
+
596
+ type: string;
597
+ }
598
+ }
599
+ }
600
+
601
+ /**
602
+ * Allowed contract addresses for eth_signAuthorization requests.
603
+ */
604
+ export interface Ethereum7702AuthorizationCondition {
605
+ field: 'contract';
606
+
607
+ field_source: 'ethereum_7702_authorization';
608
+
609
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
610
+
611
+ value: string | Array<string>;
612
+ }
613
+
614
+ /**
615
+ * Solana Program attributes, enables allowlisting Solana Programs.
616
+ */
617
+ export interface SolanaProgramInstructionCondition {
618
+ field: 'programId';
619
+
620
+ field_source: 'solana_program_instruction';
621
+
622
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
623
+
624
+ value: string | Array<string>;
625
+ }
626
+
627
+ /**
628
+ * Solana System Program attributes, including more granular Transfer instruction
629
+ * fields.
630
+ */
631
+ export interface SolanaSystemProgramInstructionCondition {
632
+ field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
633
+
634
+ field_source: 'solana_system_program_instruction';
635
+
636
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
637
+
638
+ value: string | Array<string>;
639
+ }
640
+
641
+ /**
642
+ * Solana Token Program attributes, including more granular TransferChecked
643
+ * instruction fields.
644
+ */
645
+ export interface SolanaTokenProgramInstructionCondition {
646
+ field:
647
+ | 'instructionName'
648
+ | 'TransferChecked.source'
649
+ | 'TransferChecked.destination'
650
+ | 'TransferChecked.authority'
651
+ | 'TransferChecked.amount'
652
+ | 'TransferChecked.mint';
653
+
654
+ field_source: 'solana_token_program_instruction';
655
+
656
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
657
+
658
+ value: string | Array<string>;
659
+ }
660
+
661
+ /**
662
+ * System attributes, including current unix timestamp (in seconds).
663
+ */
664
+ export interface SystemCondition {
665
+ field: 'current_unix_timestamp';
666
+
667
+ field_source: 'system';
668
+
669
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
670
+
671
+ value: string | Array<string>;
672
+ }
673
+ }
674
+
675
+ export interface PolicyDeleteResponse {
676
+ /**
677
+ * Whether the policy was deleted successfully.
678
+ */
679
+ success: boolean;
680
+ }
681
+
682
+ export interface PolicyDeleteRuleResponse {
683
+ /**
684
+ * Whether the rule was deleted successfully.
685
+ */
686
+ success: boolean;
687
+ }
688
+
689
+ export interface PolicyUpdateRuleResponse {
690
+ id: string;
691
+
692
+ /**
693
+ * Action to take if the conditions are true.
694
+ */
695
+ action: 'ALLOW' | 'DENY';
696
+
697
+ conditions: Array<
698
+ | PolicyUpdateRuleResponse.EthereumTransactionCondition
699
+ | PolicyUpdateRuleResponse.EthereumCalldataCondition
700
+ | PolicyUpdateRuleResponse.EthereumTypedDataDomainCondition
701
+ | PolicyUpdateRuleResponse.EthereumTypedDataMessageCondition
702
+ | PolicyUpdateRuleResponse.Ethereum7702AuthorizationCondition
703
+ | PolicyUpdateRuleResponse.SolanaProgramInstructionCondition
704
+ | PolicyUpdateRuleResponse.SolanaSystemProgramInstructionCondition
705
+ | PolicyUpdateRuleResponse.SolanaTokenProgramInstructionCondition
706
+ | PolicyUpdateRuleResponse.SystemCondition
707
+ >;
708
+
709
+ /**
710
+ * Method the rule applies to.
711
+ */
712
+ method:
713
+ | 'eth_sendTransaction'
714
+ | 'eth_signTransaction'
715
+ | 'eth_signTypedData_v4'
716
+ | 'eth_sign7702Authorization'
717
+ | 'signTransaction'
718
+ | 'signAndSendTransaction'
719
+ | 'exportPrivateKey'
720
+ | '*';
721
+
722
+ name: string;
723
+ }
724
+
725
+ export namespace PolicyUpdateRuleResponse {
726
+ /**
727
+ * The verbatim Ethereum transaction object in an eth_signTransaction or
728
+ * eth_sendTransaction request.
729
+ */
730
+ export interface EthereumTransactionCondition {
731
+ field: 'to' | 'value';
732
+
733
+ field_source: 'ethereum_transaction';
734
+
735
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
736
+
737
+ value: string | Array<string>;
738
+ }
739
+
740
+ /**
741
+ * The decoded calldata in a smart contract interaction as the smart contract
742
+ * method's parameters. Note that that 'ethereum_calldata' conditions must contain
743
+ * an abi parameter with the JSON ABI of the smart contract.
744
+ */
745
+ export interface EthereumCalldataCondition {
746
+ abi: unknown;
747
+
748
+ field: string;
749
+
750
+ field_source: 'ethereum_calldata';
751
+
752
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
753
+
754
+ value: string | Array<string>;
755
+ }
756
+
757
+ /**
758
+ * Attributes from the signing domain that will verify the signature.
759
+ */
760
+ export interface EthereumTypedDataDomainCondition {
761
+ field: 'chainId' | 'verifyingContract';
762
+
763
+ field_source: 'ethereum_typed_data_domain';
764
+
765
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
766
+
767
+ value: string | Array<string>;
768
+ }
769
+
770
+ /**
771
+ * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
772
+ * EIP-712.
773
+ */
774
+ export interface EthereumTypedDataMessageCondition {
775
+ field: string;
776
+
777
+ field_source: 'ethereum_typed_data_message';
778
+
779
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
780
+
781
+ typed_data: EthereumTypedDataMessageCondition.TypedData;
782
+
783
+ value: string | Array<string>;
784
+ }
785
+
786
+ export namespace EthereumTypedDataMessageCondition {
787
+ export interface TypedData {
788
+ primary_type: string;
789
+
790
+ types: { [key: string]: Array<TypedData.Type> };
791
+ }
792
+
793
+ export namespace TypedData {
794
+ export interface Type {
795
+ name: string;
796
+
797
+ type: string;
798
+ }
799
+ }
800
+ }
801
+
802
+ /**
803
+ * Allowed contract addresses for eth_signAuthorization requests.
804
+ */
805
+ export interface Ethereum7702AuthorizationCondition {
806
+ field: 'contract';
807
+
808
+ field_source: 'ethereum_7702_authorization';
809
+
810
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
811
+
812
+ value: string | Array<string>;
813
+ }
814
+
815
+ /**
816
+ * Solana Program attributes, enables allowlisting Solana Programs.
817
+ */
818
+ export interface SolanaProgramInstructionCondition {
819
+ field: 'programId';
820
+
821
+ field_source: 'solana_program_instruction';
822
+
823
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
824
+
825
+ value: string | Array<string>;
826
+ }
827
+
828
+ /**
829
+ * Solana System Program attributes, including more granular Transfer instruction
830
+ * fields.
831
+ */
832
+ export interface SolanaSystemProgramInstructionCondition {
833
+ field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
834
+
835
+ field_source: 'solana_system_program_instruction';
836
+
837
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
838
+
839
+ value: string | Array<string>;
840
+ }
841
+
842
+ /**
843
+ * Solana Token Program attributes, including more granular TransferChecked
844
+ * instruction fields.
845
+ */
846
+ export interface SolanaTokenProgramInstructionCondition {
847
+ field:
848
+ | 'instructionName'
849
+ | 'TransferChecked.source'
850
+ | 'TransferChecked.destination'
851
+ | 'TransferChecked.authority'
852
+ | 'TransferChecked.amount'
853
+ | 'TransferChecked.mint';
854
+
855
+ field_source: 'solana_token_program_instruction';
856
+
857
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
858
+
859
+ value: string | Array<string>;
860
+ }
861
+
862
+ /**
863
+ * System attributes, including current unix timestamp (in seconds).
864
+ */
865
+ export interface SystemCondition {
866
+ field: 'current_unix_timestamp';
867
+
868
+ field_source: 'system';
869
+
870
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
871
+
872
+ value: string | Array<string>;
873
+ }
874
+ }
875
+
876
+ /**
877
+ * A rule that defines the conditions and action to take if the conditions are
878
+ * true.
879
+ */
880
+ export interface PolicyGetRuleResponse {
881
+ id: string;
882
+
883
+ /**
884
+ * Action to take if the conditions are true.
885
+ */
886
+ action: 'ALLOW' | 'DENY';
887
+
888
+ conditions: Array<
889
+ | PolicyGetRuleResponse.EthereumTransactionCondition
890
+ | PolicyGetRuleResponse.EthereumCalldataCondition
891
+ | PolicyGetRuleResponse.EthereumTypedDataDomainCondition
892
+ | PolicyGetRuleResponse.EthereumTypedDataMessageCondition
893
+ | PolicyGetRuleResponse.Ethereum7702AuthorizationCondition
894
+ | PolicyGetRuleResponse.SolanaProgramInstructionCondition
895
+ | PolicyGetRuleResponse.SolanaSystemProgramInstructionCondition
896
+ | PolicyGetRuleResponse.SolanaTokenProgramInstructionCondition
897
+ | PolicyGetRuleResponse.SystemCondition
898
+ >;
899
+
900
+ /**
901
+ * Method the rule applies to.
902
+ */
903
+ method:
904
+ | 'eth_sendTransaction'
905
+ | 'eth_signTransaction'
906
+ | 'eth_signTypedData_v4'
907
+ | 'eth_sign7702Authorization'
908
+ | 'signTransaction'
909
+ | 'signAndSendTransaction'
910
+ | 'exportPrivateKey'
911
+ | '*';
912
+
913
+ name: string;
914
+ }
915
+
916
+ export namespace PolicyGetRuleResponse {
917
+ /**
918
+ * The verbatim Ethereum transaction object in an eth_signTransaction or
919
+ * eth_sendTransaction request.
920
+ */
921
+ export interface EthereumTransactionCondition {
922
+ field: 'to' | 'value';
923
+
924
+ field_source: 'ethereum_transaction';
925
+
926
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
927
+
928
+ value: string | Array<string>;
929
+ }
930
+
931
+ /**
932
+ * The decoded calldata in a smart contract interaction as the smart contract
933
+ * method's parameters. Note that that 'ethereum_calldata' conditions must contain
934
+ * an abi parameter with the JSON ABI of the smart contract.
935
+ */
936
+ export interface EthereumCalldataCondition {
937
+ abi: unknown;
938
+
939
+ field: string;
940
+
941
+ field_source: 'ethereum_calldata';
942
+
943
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
944
+
945
+ value: string | Array<string>;
946
+ }
947
+
948
+ /**
949
+ * Attributes from the signing domain that will verify the signature.
950
+ */
951
+ export interface EthereumTypedDataDomainCondition {
952
+ field: 'chainId' | 'verifyingContract';
953
+
954
+ field_source: 'ethereum_typed_data_domain';
955
+
956
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
957
+
958
+ value: string | Array<string>;
959
+ }
960
+
961
+ /**
962
+ * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
963
+ * EIP-712.
964
+ */
965
+ export interface EthereumTypedDataMessageCondition {
966
+ field: string;
967
+
968
+ field_source: 'ethereum_typed_data_message';
969
+
970
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
971
+
972
+ typed_data: EthereumTypedDataMessageCondition.TypedData;
973
+
974
+ value: string | Array<string>;
975
+ }
976
+
977
+ export namespace EthereumTypedDataMessageCondition {
978
+ export interface TypedData {
979
+ primary_type: string;
980
+
981
+ types: { [key: string]: Array<TypedData.Type> };
982
+ }
983
+
984
+ export namespace TypedData {
985
+ export interface Type {
986
+ name: string;
987
+
988
+ type: string;
989
+ }
990
+ }
991
+ }
992
+
993
+ /**
994
+ * Allowed contract addresses for eth_signAuthorization requests.
995
+ */
996
+ export interface Ethereum7702AuthorizationCondition {
997
+ field: 'contract';
998
+
999
+ field_source: 'ethereum_7702_authorization';
1000
+
1001
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1002
+
1003
+ value: string | Array<string>;
1004
+ }
1005
+
1006
+ /**
1007
+ * Solana Program attributes, enables allowlisting Solana Programs.
1008
+ */
1009
+ export interface SolanaProgramInstructionCondition {
1010
+ field: 'programId';
1011
+
1012
+ field_source: 'solana_program_instruction';
1013
+
1014
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1015
+
1016
+ value: string | Array<string>;
1017
+ }
1018
+
1019
+ /**
1020
+ * Solana System Program attributes, including more granular Transfer instruction
1021
+ * fields.
1022
+ */
1023
+ export interface SolanaSystemProgramInstructionCondition {
1024
+ field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
1025
+
1026
+ field_source: 'solana_system_program_instruction';
1027
+
1028
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1029
+
1030
+ value: string | Array<string>;
1031
+ }
1032
+
1033
+ /**
1034
+ * Solana Token Program attributes, including more granular TransferChecked
1035
+ * instruction fields.
1036
+ */
1037
+ export interface SolanaTokenProgramInstructionCondition {
1038
+ field:
1039
+ | 'instructionName'
1040
+ | 'TransferChecked.source'
1041
+ | 'TransferChecked.destination'
1042
+ | 'TransferChecked.authority'
1043
+ | 'TransferChecked.amount'
1044
+ | 'TransferChecked.mint';
1045
+
1046
+ field_source: 'solana_token_program_instruction';
1047
+
1048
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1049
+
1050
+ value: string | Array<string>;
1051
+ }
1052
+
1053
+ /**
1054
+ * System attributes, including current unix timestamp (in seconds).
1055
+ */
1056
+ export interface SystemCondition {
1057
+ field: 'current_unix_timestamp';
1058
+
1059
+ field_source: 'system';
1060
+
1061
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1062
+
1063
+ value: string | Array<string>;
1064
+ }
1065
+ }
1066
+
1067
+ export interface PolicyCreateParams {
1068
+ /**
1069
+ * Body param: The chain type the policy applies to.
1070
+ */
1071
+ chain_type: 'ethereum' | 'solana';
1072
+
1073
+ /**
1074
+ * Body param: Name to assign to policy.
1075
+ */
1076
+ name: string;
1077
+
1078
+ /**
1079
+ * Body param:
1080
+ */
1081
+ rules: Array<PolicyCreateParams.Rule>;
1082
+
1083
+ /**
1084
+ * Body param: Version of the policy. Currently, 1.0 is the only version.
1085
+ */
1086
+ version: '1.0';
1087
+
1088
+ /**
1089
+ * Body param: The owner of the resource. If you provide this, do not specify an
1090
+ * owner_id as it will be generated automatically. When updating a wallet, you can
1091
+ * set the owner to null to remove the owner.
1092
+ */
1093
+ owner?: PolicyCreateParams.PublicKeyOwner | PolicyCreateParams.UserOwner | null;
1094
+
1095
+ /**
1096
+ * Body param: The key quorum ID to set as the owner of the resource. If you
1097
+ * provide this, do not specify an owner.
1098
+ */
1099
+ owner_id?: string | null;
1100
+
1101
+ /**
1102
+ * Header param: Idempotency keys ensure API requests are executed only once within
1103
+ * a 24-hour window.
1104
+ */
1105
+ 'privy-idempotency-key'?: string;
1106
+ }
1107
+
1108
+ export namespace PolicyCreateParams {
1109
+ /**
1110
+ * The rules that apply to each method the policy covers.
1111
+ */
1112
+ export interface Rule {
1113
+ /**
1114
+ * Action to take if the conditions are true.
1115
+ */
1116
+ action: 'ALLOW' | 'DENY';
1117
+
1118
+ conditions: Array<
1119
+ | Rule.EthereumTransactionCondition
1120
+ | Rule.EthereumCalldataCondition
1121
+ | Rule.EthereumTypedDataDomainCondition
1122
+ | Rule.EthereumTypedDataMessageCondition
1123
+ | Rule.Ethereum7702AuthorizationCondition
1124
+ | Rule.SolanaProgramInstructionCondition
1125
+ | Rule.SolanaSystemProgramInstructionCondition
1126
+ | Rule.SolanaTokenProgramInstructionCondition
1127
+ | Rule.SystemCondition
1128
+ >;
1129
+
1130
+ /**
1131
+ * Method the rule applies to.
1132
+ */
1133
+ method:
1134
+ | 'eth_sendTransaction'
1135
+ | 'eth_signTransaction'
1136
+ | 'eth_signTypedData_v4'
1137
+ | 'eth_sign7702Authorization'
1138
+ | 'signTransaction'
1139
+ | 'signAndSendTransaction'
1140
+ | 'exportPrivateKey'
1141
+ | '*';
1142
+
1143
+ name: string;
1144
+ }
1145
+
1146
+ export namespace Rule {
1147
+ /**
1148
+ * The verbatim Ethereum transaction object in an eth_signTransaction or
1149
+ * eth_sendTransaction request.
1150
+ */
1151
+ export interface EthereumTransactionCondition {
1152
+ field: 'to' | 'value';
1153
+
1154
+ field_source: 'ethereum_transaction';
1155
+
1156
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1157
+
1158
+ value: string | Array<string>;
1159
+ }
1160
+
1161
+ /**
1162
+ * The decoded calldata in a smart contract interaction as the smart contract
1163
+ * method's parameters. Note that that 'ethereum_calldata' conditions must contain
1164
+ * an abi parameter with the JSON ABI of the smart contract.
1165
+ */
1166
+ export interface EthereumCalldataCondition {
1167
+ abi: unknown;
1168
+
1169
+ field: string;
1170
+
1171
+ field_source: 'ethereum_calldata';
1172
+
1173
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1174
+
1175
+ value: string | Array<string>;
1176
+ }
1177
+
1178
+ /**
1179
+ * Attributes from the signing domain that will verify the signature.
1180
+ */
1181
+ export interface EthereumTypedDataDomainCondition {
1182
+ field: 'chainId' | 'verifyingContract';
1183
+
1184
+ field_source: 'ethereum_typed_data_domain';
1185
+
1186
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1187
+
1188
+ value: string | Array<string>;
1189
+ }
1190
+
1191
+ /**
1192
+ * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
1193
+ * EIP-712.
1194
+ */
1195
+ export interface EthereumTypedDataMessageCondition {
1196
+ field: string;
1197
+
1198
+ field_source: 'ethereum_typed_data_message';
1199
+
1200
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1201
+
1202
+ typed_data: EthereumTypedDataMessageCondition.TypedData;
1203
+
1204
+ value: string | Array<string>;
1205
+ }
1206
+
1207
+ export namespace EthereumTypedDataMessageCondition {
1208
+ export interface TypedData {
1209
+ primary_type: string;
1210
+
1211
+ types: { [key: string]: Array<TypedData.Type> };
1212
+ }
1213
+
1214
+ export namespace TypedData {
1215
+ export interface Type {
1216
+ name: string;
1217
+
1218
+ type: string;
1219
+ }
1220
+ }
1221
+ }
1222
+
1223
+ /**
1224
+ * Allowed contract addresses for eth_signAuthorization requests.
1225
+ */
1226
+ export interface Ethereum7702AuthorizationCondition {
1227
+ field: 'contract';
1228
+
1229
+ field_source: 'ethereum_7702_authorization';
1230
+
1231
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1232
+
1233
+ value: string | Array<string>;
1234
+ }
1235
+
1236
+ /**
1237
+ * Solana Program attributes, enables allowlisting Solana Programs.
1238
+ */
1239
+ export interface SolanaProgramInstructionCondition {
1240
+ field: 'programId';
1241
+
1242
+ field_source: 'solana_program_instruction';
1243
+
1244
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1245
+
1246
+ value: string | Array<string>;
1247
+ }
1248
+
1249
+ /**
1250
+ * Solana System Program attributes, including more granular Transfer instruction
1251
+ * fields.
1252
+ */
1253
+ export interface SolanaSystemProgramInstructionCondition {
1254
+ field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
1255
+
1256
+ field_source: 'solana_system_program_instruction';
1257
+
1258
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1259
+
1260
+ value: string | Array<string>;
1261
+ }
1262
+
1263
+ /**
1264
+ * Solana Token Program attributes, including more granular TransferChecked
1265
+ * instruction fields.
1266
+ */
1267
+ export interface SolanaTokenProgramInstructionCondition {
1268
+ field:
1269
+ | 'instructionName'
1270
+ | 'TransferChecked.source'
1271
+ | 'TransferChecked.destination'
1272
+ | 'TransferChecked.authority'
1273
+ | 'TransferChecked.amount'
1274
+ | 'TransferChecked.mint';
1275
+
1276
+ field_source: 'solana_token_program_instruction';
1277
+
1278
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1279
+
1280
+ value: string | Array<string>;
1281
+ }
1282
+
1283
+ /**
1284
+ * System attributes, including current unix timestamp (in seconds).
1285
+ */
1286
+ export interface SystemCondition {
1287
+ field: 'current_unix_timestamp';
1288
+
1289
+ field_source: 'system';
1290
+
1291
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1292
+
1293
+ value: string | Array<string>;
1294
+ }
1295
+ }
1296
+
1297
+ /**
1298
+ * The P-256 public key of the owner of the resource. If you provide this, do not
1299
+ * specify an owner_id as it will be generated automatically.
1300
+ */
1301
+ export interface PublicKeyOwner {
1302
+ public_key: string;
1303
+ }
1304
+
1305
+ /**
1306
+ * The user ID of the owner of the resource. The user must already exist, and this
1307
+ * value must start with "did:privy:". If you provide this, do not specify an
1308
+ * owner_id as it will be generated automatically.
1309
+ */
1310
+ export interface UserOwner {
1311
+ user_id: string;
1312
+ }
1313
+ }
1314
+
1315
+ export interface PolicyCreateRuleParams {
1316
+ /**
1317
+ * Body param: Action to take if the conditions are true.
1318
+ */
1319
+ action: 'ALLOW' | 'DENY';
1320
+
1321
+ /**
1322
+ * Body param:
1323
+ */
1324
+ conditions: Array<
1325
+ | PolicyCreateRuleParams.EthereumTransactionCondition
1326
+ | PolicyCreateRuleParams.EthereumCalldataCondition
1327
+ | PolicyCreateRuleParams.EthereumTypedDataDomainCondition
1328
+ | PolicyCreateRuleParams.EthereumTypedDataMessageCondition
1329
+ | PolicyCreateRuleParams.Ethereum7702AuthorizationCondition
1330
+ | PolicyCreateRuleParams.SolanaProgramInstructionCondition
1331
+ | PolicyCreateRuleParams.SolanaSystemProgramInstructionCondition
1332
+ | PolicyCreateRuleParams.SolanaTokenProgramInstructionCondition
1333
+ | PolicyCreateRuleParams.SystemCondition
1334
+ >;
1335
+
1336
+ /**
1337
+ * Body param: Method the rule applies to.
1338
+ */
1339
+ method:
1340
+ | 'eth_sendTransaction'
1341
+ | 'eth_signTransaction'
1342
+ | 'eth_signTypedData_v4'
1343
+ | 'eth_sign7702Authorization'
1344
+ | 'signTransaction'
1345
+ | 'signAndSendTransaction'
1346
+ | 'exportPrivateKey'
1347
+ | '*';
1348
+
1349
+ /**
1350
+ * Body param:
1351
+ */
1352
+ name: string;
1353
+
1354
+ /**
1355
+ * Header param: Request authorization signature. If multiple signatures are
1356
+ * required, they should be comma separated.
1357
+ */
1358
+ 'privy-authorization-signature'?: string;
1359
+ }
1360
+
1361
+ export namespace PolicyCreateRuleParams {
1362
+ /**
1363
+ * The verbatim Ethereum transaction object in an eth_signTransaction or
1364
+ * eth_sendTransaction request.
1365
+ */
1366
+ export interface EthereumTransactionCondition {
1367
+ field: 'to' | 'value';
1368
+
1369
+ field_source: 'ethereum_transaction';
1370
+
1371
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1372
+
1373
+ value: string | Array<string>;
1374
+ }
1375
+
1376
+ /**
1377
+ * The decoded calldata in a smart contract interaction as the smart contract
1378
+ * method's parameters. Note that that 'ethereum_calldata' conditions must contain
1379
+ * an abi parameter with the JSON ABI of the smart contract.
1380
+ */
1381
+ export interface EthereumCalldataCondition {
1382
+ abi: unknown;
1383
+
1384
+ field: string;
1385
+
1386
+ field_source: 'ethereum_calldata';
1387
+
1388
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1389
+
1390
+ value: string | Array<string>;
1391
+ }
1392
+
1393
+ /**
1394
+ * Attributes from the signing domain that will verify the signature.
1395
+ */
1396
+ export interface EthereumTypedDataDomainCondition {
1397
+ field: 'chainId' | 'verifyingContract';
1398
+
1399
+ field_source: 'ethereum_typed_data_domain';
1400
+
1401
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1402
+
1403
+ value: string | Array<string>;
1404
+ }
1405
+
1406
+ /**
1407
+ * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
1408
+ * EIP-712.
1409
+ */
1410
+ export interface EthereumTypedDataMessageCondition {
1411
+ field: string;
1412
+
1413
+ field_source: 'ethereum_typed_data_message';
1414
+
1415
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1416
+
1417
+ typed_data: EthereumTypedDataMessageCondition.TypedData;
1418
+
1419
+ value: string | Array<string>;
1420
+ }
1421
+
1422
+ export namespace EthereumTypedDataMessageCondition {
1423
+ export interface TypedData {
1424
+ primary_type: string;
1425
+
1426
+ types: { [key: string]: Array<TypedData.Type> };
1427
+ }
1428
+
1429
+ export namespace TypedData {
1430
+ export interface Type {
1431
+ name: string;
1432
+
1433
+ type: string;
1434
+ }
1435
+ }
1436
+ }
1437
+
1438
+ /**
1439
+ * Allowed contract addresses for eth_signAuthorization requests.
1440
+ */
1441
+ export interface Ethereum7702AuthorizationCondition {
1442
+ field: 'contract';
1443
+
1444
+ field_source: 'ethereum_7702_authorization';
1445
+
1446
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1447
+
1448
+ value: string | Array<string>;
1449
+ }
1450
+
1451
+ /**
1452
+ * Solana Program attributes, enables allowlisting Solana Programs.
1453
+ */
1454
+ export interface SolanaProgramInstructionCondition {
1455
+ field: 'programId';
1456
+
1457
+ field_source: 'solana_program_instruction';
1458
+
1459
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1460
+
1461
+ value: string | Array<string>;
1462
+ }
1463
+
1464
+ /**
1465
+ * Solana System Program attributes, including more granular Transfer instruction
1466
+ * fields.
1467
+ */
1468
+ export interface SolanaSystemProgramInstructionCondition {
1469
+ field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
1470
+
1471
+ field_source: 'solana_system_program_instruction';
1472
+
1473
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1474
+
1475
+ value: string | Array<string>;
1476
+ }
1477
+
1478
+ /**
1479
+ * Solana Token Program attributes, including more granular TransferChecked
1480
+ * instruction fields.
1481
+ */
1482
+ export interface SolanaTokenProgramInstructionCondition {
1483
+ field:
1484
+ | 'instructionName'
1485
+ | 'TransferChecked.source'
1486
+ | 'TransferChecked.destination'
1487
+ | 'TransferChecked.authority'
1488
+ | 'TransferChecked.amount'
1489
+ | 'TransferChecked.mint';
1490
+
1491
+ field_source: 'solana_token_program_instruction';
1492
+
1493
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1494
+
1495
+ value: string | Array<string>;
1496
+ }
1497
+
1498
+ /**
1499
+ * System attributes, including current unix timestamp (in seconds).
1500
+ */
1501
+ export interface SystemCondition {
1502
+ field: 'current_unix_timestamp';
1503
+
1504
+ field_source: 'system';
1505
+
1506
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1507
+
1508
+ value: string | Array<string>;
1509
+ }
1510
+ }
1511
+
1512
+ export interface PolicyDeleteParams {
1513
+ /**
1514
+ * Request authorization signature. If multiple signatures are required, they
1515
+ * should be comma separated.
1516
+ */
1517
+ 'privy-authorization-signature'?: string;
1518
+ }
1519
+
1520
+ export interface PolicyDeleteRuleParams {
1521
+ /**
1522
+ * Path param:
1523
+ */
1524
+ policy_id: string;
1525
+
1526
+ /**
1527
+ * Header param: Request authorization signature. If multiple signatures are
1528
+ * required, they should be comma separated.
1529
+ */
1530
+ 'privy-authorization-signature'?: string;
1531
+ }
1532
+
1533
+ export interface PolicyUpdateParams {
1534
+ /**
1535
+ * Body param: Name to assign to policy.
1536
+ */
1537
+ name?: string;
1538
+
1539
+ /**
1540
+ * Body param: The owner of the resource. If you provide this, do not specify an
1541
+ * owner_id as it will be generated automatically. When updating a wallet, you can
1542
+ * set the owner to null to remove the owner.
1543
+ */
1544
+ owner?: PolicyUpdateParams.PublicKeyOwner | PolicyUpdateParams.UserOwner | null;
1545
+
1546
+ /**
1547
+ * Body param: The key quorum ID to set as the owner of the resource. If you
1548
+ * provide this, do not specify an owner.
1549
+ */
1550
+ owner_id?: string | null;
1551
+
1552
+ /**
1553
+ * Body param:
1554
+ */
1555
+ rules?: Array<PolicyUpdateParams.Rule>;
1556
+
1557
+ /**
1558
+ * Header param: Request authorization signature. If multiple signatures are
1559
+ * required, they should be comma separated.
1560
+ */
1561
+ 'privy-authorization-signature'?: string;
1562
+ }
1563
+
1564
+ export namespace PolicyUpdateParams {
1565
+ /**
1566
+ * The P-256 public key of the owner of the resource. If you provide this, do not
1567
+ * specify an owner_id as it will be generated automatically.
1568
+ */
1569
+ export interface PublicKeyOwner {
1570
+ public_key: string;
1571
+ }
1572
+
1573
+ /**
1574
+ * The user ID of the owner of the resource. The user must already exist, and this
1575
+ * value must start with "did:privy:". If you provide this, do not specify an
1576
+ * owner_id as it will be generated automatically.
1577
+ */
1578
+ export interface UserOwner {
1579
+ user_id: string;
1580
+ }
1581
+
1582
+ /**
1583
+ * The rules that apply to each method the policy covers.
1584
+ */
1585
+ export interface Rule {
1586
+ /**
1587
+ * Action to take if the conditions are true.
1588
+ */
1589
+ action: 'ALLOW' | 'DENY';
1590
+
1591
+ conditions: Array<
1592
+ | Rule.EthereumTransactionCondition
1593
+ | Rule.EthereumCalldataCondition
1594
+ | Rule.EthereumTypedDataDomainCondition
1595
+ | Rule.EthereumTypedDataMessageCondition
1596
+ | Rule.Ethereum7702AuthorizationCondition
1597
+ | Rule.SolanaProgramInstructionCondition
1598
+ | Rule.SolanaSystemProgramInstructionCondition
1599
+ | Rule.SolanaTokenProgramInstructionCondition
1600
+ | Rule.SystemCondition
1601
+ >;
1602
+
1603
+ /**
1604
+ * Method the rule applies to.
1605
+ */
1606
+ method:
1607
+ | 'eth_sendTransaction'
1608
+ | 'eth_signTransaction'
1609
+ | 'eth_signTypedData_v4'
1610
+ | 'eth_sign7702Authorization'
1611
+ | 'signTransaction'
1612
+ | 'signAndSendTransaction'
1613
+ | 'exportPrivateKey'
1614
+ | '*';
1615
+
1616
+ name: string;
1617
+ }
1618
+
1619
+ export namespace Rule {
1620
+ /**
1621
+ * The verbatim Ethereum transaction object in an eth_signTransaction or
1622
+ * eth_sendTransaction request.
1623
+ */
1624
+ export interface EthereumTransactionCondition {
1625
+ field: 'to' | 'value';
1626
+
1627
+ field_source: 'ethereum_transaction';
1628
+
1629
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1630
+
1631
+ value: string | Array<string>;
1632
+ }
1633
+
1634
+ /**
1635
+ * The decoded calldata in a smart contract interaction as the smart contract
1636
+ * method's parameters. Note that that 'ethereum_calldata' conditions must contain
1637
+ * an abi parameter with the JSON ABI of the smart contract.
1638
+ */
1639
+ export interface EthereumCalldataCondition {
1640
+ abi: unknown;
1641
+
1642
+ field: string;
1643
+
1644
+ field_source: 'ethereum_calldata';
1645
+
1646
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1647
+
1648
+ value: string | Array<string>;
1649
+ }
1650
+
1651
+ /**
1652
+ * Attributes from the signing domain that will verify the signature.
1653
+ */
1654
+ export interface EthereumTypedDataDomainCondition {
1655
+ field: 'chainId' | 'verifyingContract';
1656
+
1657
+ field_source: 'ethereum_typed_data_domain';
1658
+
1659
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1660
+
1661
+ value: string | Array<string>;
1662
+ }
1663
+
1664
+ /**
1665
+ * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
1666
+ * EIP-712.
1667
+ */
1668
+ export interface EthereumTypedDataMessageCondition {
1669
+ field: string;
1670
+
1671
+ field_source: 'ethereum_typed_data_message';
1672
+
1673
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1674
+
1675
+ typed_data: EthereumTypedDataMessageCondition.TypedData;
1676
+
1677
+ value: string | Array<string>;
1678
+ }
1679
+
1680
+ export namespace EthereumTypedDataMessageCondition {
1681
+ export interface TypedData {
1682
+ primary_type: string;
1683
+
1684
+ types: { [key: string]: Array<TypedData.Type> };
1685
+ }
1686
+
1687
+ export namespace TypedData {
1688
+ export interface Type {
1689
+ name: string;
1690
+
1691
+ type: string;
1692
+ }
1693
+ }
1694
+ }
1695
+
1696
+ /**
1697
+ * Allowed contract addresses for eth_signAuthorization requests.
1698
+ */
1699
+ export interface Ethereum7702AuthorizationCondition {
1700
+ field: 'contract';
1701
+
1702
+ field_source: 'ethereum_7702_authorization';
1703
+
1704
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1705
+
1706
+ value: string | Array<string>;
1707
+ }
1708
+
1709
+ /**
1710
+ * Solana Program attributes, enables allowlisting Solana Programs.
1711
+ */
1712
+ export interface SolanaProgramInstructionCondition {
1713
+ field: 'programId';
1714
+
1715
+ field_source: 'solana_program_instruction';
1716
+
1717
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1718
+
1719
+ value: string | Array<string>;
1720
+ }
1721
+
1722
+ /**
1723
+ * Solana System Program attributes, including more granular Transfer instruction
1724
+ * fields.
1725
+ */
1726
+ export interface SolanaSystemProgramInstructionCondition {
1727
+ field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
1728
+
1729
+ field_source: 'solana_system_program_instruction';
1730
+
1731
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1732
+
1733
+ value: string | Array<string>;
1734
+ }
1735
+
1736
+ /**
1737
+ * Solana Token Program attributes, including more granular TransferChecked
1738
+ * instruction fields.
1739
+ */
1740
+ export interface SolanaTokenProgramInstructionCondition {
1741
+ field:
1742
+ | 'instructionName'
1743
+ | 'TransferChecked.source'
1744
+ | 'TransferChecked.destination'
1745
+ | 'TransferChecked.authority'
1746
+ | 'TransferChecked.amount'
1747
+ | 'TransferChecked.mint';
1748
+
1749
+ field_source: 'solana_token_program_instruction';
1750
+
1751
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1752
+
1753
+ value: string | Array<string>;
1754
+ }
1755
+
1756
+ /**
1757
+ * System attributes, including current unix timestamp (in seconds).
1758
+ */
1759
+ export interface SystemCondition {
1760
+ field: 'current_unix_timestamp';
1761
+
1762
+ field_source: 'system';
1763
+
1764
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1765
+
1766
+ value: string | Array<string>;
1767
+ }
1768
+ }
1769
+ }
1770
+
1771
+ export interface PolicyUpdateRuleParams {
1772
+ /**
1773
+ * Path param:
1774
+ */
1775
+ policy_id: string;
1776
+
1777
+ /**
1778
+ * Body param: Action to take if the conditions are true.
1779
+ */
1780
+ action: 'ALLOW' | 'DENY';
1781
+
1782
+ /**
1783
+ * Body param:
1784
+ */
1785
+ conditions: Array<
1786
+ | PolicyUpdateRuleParams.EthereumTransactionCondition
1787
+ | PolicyUpdateRuleParams.EthereumCalldataCondition
1788
+ | PolicyUpdateRuleParams.EthereumTypedDataDomainCondition
1789
+ | PolicyUpdateRuleParams.EthereumTypedDataMessageCondition
1790
+ | PolicyUpdateRuleParams.Ethereum7702AuthorizationCondition
1791
+ | PolicyUpdateRuleParams.SolanaProgramInstructionCondition
1792
+ | PolicyUpdateRuleParams.SolanaSystemProgramInstructionCondition
1793
+ | PolicyUpdateRuleParams.SolanaTokenProgramInstructionCondition
1794
+ | PolicyUpdateRuleParams.SystemCondition
1795
+ >;
1796
+
1797
+ /**
1798
+ * Body param: Method the rule applies to.
1799
+ */
1800
+ method:
1801
+ | 'eth_sendTransaction'
1802
+ | 'eth_signTransaction'
1803
+ | 'eth_signTypedData_v4'
1804
+ | 'eth_sign7702Authorization'
1805
+ | 'signTransaction'
1806
+ | 'signAndSendTransaction'
1807
+ | 'exportPrivateKey'
1808
+ | '*';
1809
+
1810
+ /**
1811
+ * Body param:
1812
+ */
1813
+ name: string;
1814
+
1815
+ /**
1816
+ * Header param: Request authorization signature. If multiple signatures are
1817
+ * required, they should be comma separated.
1818
+ */
1819
+ 'privy-authorization-signature'?: string;
1820
+ }
1821
+
1822
+ export namespace PolicyUpdateRuleParams {
1823
+ /**
1824
+ * The verbatim Ethereum transaction object in an eth_signTransaction or
1825
+ * eth_sendTransaction request.
1826
+ */
1827
+ export interface EthereumTransactionCondition {
1828
+ field: 'to' | 'value';
1829
+
1830
+ field_source: 'ethereum_transaction';
1831
+
1832
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1833
+
1834
+ value: string | Array<string>;
1835
+ }
1836
+
1837
+ /**
1838
+ * The decoded calldata in a smart contract interaction as the smart contract
1839
+ * method's parameters. Note that that 'ethereum_calldata' conditions must contain
1840
+ * an abi parameter with the JSON ABI of the smart contract.
1841
+ */
1842
+ export interface EthereumCalldataCondition {
1843
+ abi: unknown;
1844
+
1845
+ field: string;
1846
+
1847
+ field_source: 'ethereum_calldata';
1848
+
1849
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1850
+
1851
+ value: string | Array<string>;
1852
+ }
1853
+
1854
+ /**
1855
+ * Attributes from the signing domain that will verify the signature.
1856
+ */
1857
+ export interface EthereumTypedDataDomainCondition {
1858
+ field: 'chainId' | 'verifyingContract';
1859
+
1860
+ field_source: 'ethereum_typed_data_domain';
1861
+
1862
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1863
+
1864
+ value: string | Array<string>;
1865
+ }
1866
+
1867
+ /**
1868
+ * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
1869
+ * EIP-712.
1870
+ */
1871
+ export interface EthereumTypedDataMessageCondition {
1872
+ field: string;
1873
+
1874
+ field_source: 'ethereum_typed_data_message';
1875
+
1876
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1877
+
1878
+ typed_data: EthereumTypedDataMessageCondition.TypedData;
1879
+
1880
+ value: string | Array<string>;
1881
+ }
1882
+
1883
+ export namespace EthereumTypedDataMessageCondition {
1884
+ export interface TypedData {
1885
+ primary_type: string;
1886
+
1887
+ types: { [key: string]: Array<TypedData.Type> };
1888
+ }
1889
+
1890
+ export namespace TypedData {
1891
+ export interface Type {
1892
+ name: string;
1893
+
1894
+ type: string;
1895
+ }
1896
+ }
1897
+ }
1898
+
1899
+ /**
1900
+ * Allowed contract addresses for eth_signAuthorization requests.
1901
+ */
1902
+ export interface Ethereum7702AuthorizationCondition {
1903
+ field: 'contract';
1904
+
1905
+ field_source: 'ethereum_7702_authorization';
1906
+
1907
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1908
+
1909
+ value: string | Array<string>;
1910
+ }
1911
+
1912
+ /**
1913
+ * Solana Program attributes, enables allowlisting Solana Programs.
1914
+ */
1915
+ export interface SolanaProgramInstructionCondition {
1916
+ field: 'programId';
1917
+
1918
+ field_source: 'solana_program_instruction';
1919
+
1920
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1921
+
1922
+ value: string | Array<string>;
1923
+ }
1924
+
1925
+ /**
1926
+ * Solana System Program attributes, including more granular Transfer instruction
1927
+ * fields.
1928
+ */
1929
+ export interface SolanaSystemProgramInstructionCondition {
1930
+ field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
1931
+
1932
+ field_source: 'solana_system_program_instruction';
1933
+
1934
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1935
+
1936
+ value: string | Array<string>;
1937
+ }
1938
+
1939
+ /**
1940
+ * Solana Token Program attributes, including more granular TransferChecked
1941
+ * instruction fields.
1942
+ */
1943
+ export interface SolanaTokenProgramInstructionCondition {
1944
+ field:
1945
+ | 'instructionName'
1946
+ | 'TransferChecked.source'
1947
+ | 'TransferChecked.destination'
1948
+ | 'TransferChecked.authority'
1949
+ | 'TransferChecked.amount'
1950
+ | 'TransferChecked.mint';
1951
+
1952
+ field_source: 'solana_token_program_instruction';
1953
+
1954
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1955
+
1956
+ value: string | Array<string>;
1957
+ }
1958
+
1959
+ /**
1960
+ * System attributes, including current unix timestamp (in seconds).
1961
+ */
1962
+ export interface SystemCondition {
1963
+ field: 'current_unix_timestamp';
1964
+
1965
+ field_source: 'system';
1966
+
1967
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1968
+
1969
+ value: string | Array<string>;
1970
+ }
1971
+ }
1972
+
1973
+ export interface PolicyGetRuleParams {
1974
+ policy_id: string;
1975
+ }
1976
+
1977
+ export declare namespace Policies {
1978
+ export {
1979
+ type Policy as Policy,
1980
+ type PolicyCreateRuleResponse as PolicyCreateRuleResponse,
1981
+ type PolicyDeleteResponse as PolicyDeleteResponse,
1982
+ type PolicyDeleteRuleResponse as PolicyDeleteRuleResponse,
1983
+ type PolicyUpdateRuleResponse as PolicyUpdateRuleResponse,
1984
+ type PolicyGetRuleResponse as PolicyGetRuleResponse,
1985
+ type PolicyCreateParams as PolicyCreateParams,
1986
+ type PolicyCreateRuleParams as PolicyCreateRuleParams,
1987
+ type PolicyDeleteParams as PolicyDeleteParams,
1988
+ type PolicyDeleteRuleParams as PolicyDeleteRuleParams,
1989
+ type PolicyUpdateParams as PolicyUpdateParams,
1990
+ type PolicyUpdateRuleParams as PolicyUpdateRuleParams,
1991
+ type PolicyGetRuleParams as PolicyGetRuleParams,
1992
+ };
1993
+ }