@privy-io/node 0.1.0-alpha.2

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 (579) hide show
  1. package/CHANGELOG.md +146 -0
  2. package/LICENSE +201 -0
  3. package/README.md +48 -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 +215 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +215 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +499 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +495 -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 +13 -0
  69. package/index.d.mts.map +1 -0
  70. package/index.d.ts +13 -0
  71. package/index.d.ts.map +1 -0
  72. package/index.js +29 -0
  73. package/index.js.map +1 -0
  74. package/index.mjs +5 -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 +6 -0
  101. package/internal/headers.d.mts.map +1 -0
  102. package/internal/headers.d.ts +6 -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 +85 -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/lib/authorization.d.mts +87 -0
  279. package/lib/authorization.d.mts.map +1 -0
  280. package/lib/authorization.d.ts +87 -0
  281. package/lib/authorization.d.ts.map +1 -0
  282. package/lib/authorization.js +73 -0
  283. package/lib/authorization.js.map +1 -0
  284. package/lib/authorization.mjs +67 -0
  285. package/lib/authorization.mjs.map +1 -0
  286. package/lib/cryptography.d.mts +8 -0
  287. package/lib/cryptography.d.mts.map +1 -0
  288. package/lib/cryptography.d.ts +8 -0
  289. package/lib/cryptography.d.ts.map +1 -0
  290. package/lib/cryptography.js +72 -0
  291. package/lib/cryptography.js.map +1 -0
  292. package/lib/cryptography.mjs +67 -0
  293. package/lib/cryptography.mjs.map +1 -0
  294. package/lib/jwt-exchange.d.mts +9 -0
  295. package/lib/jwt-exchange.d.mts.map +1 -0
  296. package/lib/jwt-exchange.d.ts +9 -0
  297. package/lib/jwt-exchange.d.ts.map +1 -0
  298. package/lib/jwt-exchange.js +55 -0
  299. package/lib/jwt-exchange.js.map +1 -0
  300. package/lib/jwt-exchange.mjs +51 -0
  301. package/lib/jwt-exchange.mjs.map +1 -0
  302. package/lib/wallet-entropy.d.mts +7 -0
  303. package/lib/wallet-entropy.d.mts.map +1 -0
  304. package/lib/wallet-entropy.d.ts +7 -0
  305. package/lib/wallet-entropy.d.ts.map +1 -0
  306. package/lib/wallet-entropy.js +44 -0
  307. package/lib/wallet-entropy.js.map +1 -0
  308. package/lib/wallet-entropy.mjs +41 -0
  309. package/lib/wallet-entropy.mjs.map +1 -0
  310. package/package.json +46 -0
  311. package/pagination.d.mts +2 -0
  312. package/pagination.d.mts.map +1 -0
  313. package/pagination.d.ts +2 -0
  314. package/pagination.d.ts.map +1 -0
  315. package/pagination.js +6 -0
  316. package/pagination.js.map +1 -0
  317. package/pagination.mjs +2 -0
  318. package/pagination.mjs.map +1 -0
  319. package/public-api/PrivyClient.d.mts +33 -0
  320. package/public-api/PrivyClient.d.mts.map +1 -0
  321. package/public-api/PrivyClient.d.ts +33 -0
  322. package/public-api/PrivyClient.d.ts.map +1 -0
  323. package/public-api/PrivyClient.js +59 -0
  324. package/public-api/PrivyClient.js.map +1 -0
  325. package/public-api/PrivyClient.mjs +55 -0
  326. package/public-api/PrivyClient.mjs.map +1 -0
  327. package/public-api/services/ethereum.d.mts +39 -0
  328. package/public-api/services/ethereum.d.mts.map +1 -0
  329. package/public-api/services/ethereum.d.ts +39 -0
  330. package/public-api/services/ethereum.d.ts.map +1 -0
  331. package/public-api/services/ethereum.js +77 -0
  332. package/public-api/services/ethereum.js.map +1 -0
  333. package/public-api/services/ethereum.mjs +73 -0
  334. package/public-api/services/ethereum.mjs.map +1 -0
  335. package/public-api/services/key-quorums.d.mts +18 -0
  336. package/public-api/services/key-quorums.d.mts.map +1 -0
  337. package/public-api/services/key-quorums.d.ts +18 -0
  338. package/public-api/services/key-quorums.d.ts.map +1 -0
  339. package/public-api/services/key-quorums.js +51 -0
  340. package/public-api/services/key-quorums.js.map +1 -0
  341. package/public-api/services/key-quorums.mjs +47 -0
  342. package/public-api/services/key-quorums.mjs.map +1 -0
  343. package/public-api/services/policies.d.mts +27 -0
  344. package/public-api/services/policies.d.mts.map +1 -0
  345. package/public-api/services/policies.d.ts +27 -0
  346. package/public-api/services/policies.d.ts.map +1 -0
  347. package/public-api/services/policies.js +110 -0
  348. package/public-api/services/policies.js.map +1 -0
  349. package/public-api/services/policies.mjs +106 -0
  350. package/public-api/services/policies.mjs.map +1 -0
  351. package/public-api/services/solana.d.mts +42 -0
  352. package/public-api/services/solana.d.mts.map +1 -0
  353. package/public-api/services/solana.d.ts +42 -0
  354. package/public-api/services/solana.d.ts.map +1 -0
  355. package/public-api/services/solana.js +67 -0
  356. package/public-api/services/solana.js.map +1 -0
  357. package/public-api/services/solana.mjs +63 -0
  358. package/public-api/services/solana.mjs.map +1 -0
  359. package/public-api/services/transactions.d.mts +4 -0
  360. package/public-api/services/transactions.d.mts.map +1 -0
  361. package/public-api/services/transactions.d.ts +4 -0
  362. package/public-api/services/transactions.d.ts.map +1 -0
  363. package/public-api/services/transactions.js +8 -0
  364. package/public-api/services/transactions.js.map +1 -0
  365. package/public-api/services/transactions.mjs +4 -0
  366. package/public-api/services/transactions.mjs.map +1 -0
  367. package/public-api/services/types.d.mts +54 -0
  368. package/public-api/services/types.d.mts.map +1 -0
  369. package/public-api/services/types.d.ts +54 -0
  370. package/public-api/services/types.d.ts.map +1 -0
  371. package/public-api/services/types.js +3 -0
  372. package/public-api/services/types.js.map +1 -0
  373. package/public-api/services/types.mjs +2 -0
  374. package/public-api/services/types.mjs.map +1 -0
  375. package/public-api/services/users.d.mts +4 -0
  376. package/public-api/services/users.d.mts.map +1 -0
  377. package/public-api/services/users.d.ts +4 -0
  378. package/public-api/services/users.d.ts.map +1 -0
  379. package/public-api/services/users.js +8 -0
  380. package/public-api/services/users.js.map +1 -0
  381. package/public-api/services/users.mjs +4 -0
  382. package/public-api/services/users.mjs.map +1 -0
  383. package/public-api/services/utils.d.mts +26 -0
  384. package/public-api/services/utils.d.mts.map +1 -0
  385. package/public-api/services/utils.d.ts +26 -0
  386. package/public-api/services/utils.d.ts.map +1 -0
  387. package/public-api/services/utils.js +18 -0
  388. package/public-api/services/utils.js.map +1 -0
  389. package/public-api/services/utils.mjs +14 -0
  390. package/public-api/services/utils.mjs.map +1 -0
  391. package/public-api/services/wallets.d.mts +70 -0
  392. package/public-api/services/wallets.d.mts.map +1 -0
  393. package/public-api/services/wallets.d.ts +70 -0
  394. package/public-api/services/wallets.d.ts.map +1 -0
  395. package/public-api/services/wallets.js +145 -0
  396. package/public-api/services/wallets.js.map +1 -0
  397. package/public-api/services/wallets.mjs +141 -0
  398. package/public-api/services/wallets.mjs.map +1 -0
  399. package/resource.d.mts +2 -0
  400. package/resource.d.mts.map +1 -0
  401. package/resource.d.ts +2 -0
  402. package/resource.d.ts.map +1 -0
  403. package/resource.js +6 -0
  404. package/resource.js.map +1 -0
  405. package/resource.mjs +2 -0
  406. package/resource.mjs.map +1 -0
  407. package/resources/index.d.mts +6 -0
  408. package/resources/index.d.mts.map +1 -0
  409. package/resources/index.d.ts +6 -0
  410. package/resources/index.d.ts.map +1 -0
  411. package/resources/index.js +15 -0
  412. package/resources/index.js.map +1 -0
  413. package/resources/index.mjs +7 -0
  414. package/resources/index.mjs.map +1 -0
  415. package/resources/key-quorums.d.mts +106 -0
  416. package/resources/key-quorums.d.mts.map +1 -0
  417. package/resources/key-quorums.d.ts +106 -0
  418. package/resources/key-quorums.d.ts.map +1 -0
  419. package/resources/key-quorums.js +84 -0
  420. package/resources/key-quorums.js.map +1 -0
  421. package/resources/key-quorums.mjs +80 -0
  422. package/resources/key-quorums.mjs.map +1 -0
  423. package/resources/policies.d.mts +1283 -0
  424. package/resources/policies.d.mts.map +1 -0
  425. package/resources/policies.d.ts +1283 -0
  426. package/resources/policies.d.ts.map +1 -0
  427. package/resources/policies.js +228 -0
  428. package/resources/policies.js.map +1 -0
  429. package/resources/policies.mjs +224 -0
  430. package/resources/policies.mjs.map +1 -0
  431. package/resources/transactions.d.mts +29 -0
  432. package/resources/transactions.d.mts.map +1 -0
  433. package/resources/transactions.d.ts +29 -0
  434. package/resources/transactions.d.ts.map +1 -0
  435. package/resources/transactions.js +23 -0
  436. package/resources/transactions.js.map +1 -0
  437. package/resources/transactions.mjs +19 -0
  438. package/resources/transactions.mjs.map +1 -0
  439. package/resources/users.d.mts +766 -0
  440. package/resources/users.d.mts.map +1 -0
  441. package/resources/users.d.ts +766 -0
  442. package/resources/users.d.ts.map +1 -0
  443. package/resources/users.js +278 -0
  444. package/resources/users.js.map +1 -0
  445. package/resources/users.mjs +274 -0
  446. package/resources/users.mjs.map +1 -0
  447. package/resources/wallets/balance.d.mts +40 -0
  448. package/resources/wallets/balance.d.mts.map +1 -0
  449. package/resources/wallets/balance.d.ts +40 -0
  450. package/resources/wallets/balance.d.ts.map +1 -0
  451. package/resources/wallets/balance.js +24 -0
  452. package/resources/wallets/balance.js.map +1 -0
  453. package/resources/wallets/balance.mjs +20 -0
  454. package/resources/wallets/balance.mjs.map +1 -0
  455. package/resources/wallets/index.d.mts +4 -0
  456. package/resources/wallets/index.d.mts.map +1 -0
  457. package/resources/wallets/index.d.ts +4 -0
  458. package/resources/wallets/index.d.ts.map +1 -0
  459. package/resources/wallets/index.js +11 -0
  460. package/resources/wallets/index.js.map +1 -0
  461. package/resources/wallets/index.mjs +5 -0
  462. package/resources/wallets/index.mjs.map +1 -0
  463. package/resources/wallets/transactions.d.mts +73 -0
  464. package/resources/wallets/transactions.d.mts.map +1 -0
  465. package/resources/wallets/transactions.d.ts +73 -0
  466. package/resources/wallets/transactions.d.ts.map +1 -0
  467. package/resources/wallets/transactions.js +24 -0
  468. package/resources/wallets/transactions.js.map +1 -0
  469. package/resources/wallets/transactions.mjs +20 -0
  470. package/resources/wallets/transactions.mjs.map +1 -0
  471. package/resources/wallets/wallets.d.mts +1122 -0
  472. package/resources/wallets/wallets.d.mts.map +1 -0
  473. package/resources/wallets/wallets.d.ts +1122 -0
  474. package/resources/wallets/wallets.d.ts.map +1 -0
  475. package/resources/wallets/wallets.js +235 -0
  476. package/resources/wallets/wallets.js.map +1 -0
  477. package/resources/wallets/wallets.mjs +230 -0
  478. package/resources/wallets/wallets.mjs.map +1 -0
  479. package/resources/wallets.d.mts +2 -0
  480. package/resources/wallets.d.mts.map +1 -0
  481. package/resources/wallets.d.ts +2 -0
  482. package/resources/wallets.d.ts.map +1 -0
  483. package/resources/wallets.js +6 -0
  484. package/resources/wallets.js.map +1 -0
  485. package/resources/wallets.mjs +3 -0
  486. package/resources/wallets.mjs.map +1 -0
  487. package/resources.d.mts +2 -0
  488. package/resources.d.mts.map +1 -0
  489. package/resources.d.ts +2 -0
  490. package/resources.d.ts.map +1 -0
  491. package/resources.js +5 -0
  492. package/resources.js.map +1 -0
  493. package/resources.mjs +2 -0
  494. package/resources.mjs.map +1 -0
  495. package/src/api-promise.ts +2 -0
  496. package/src/client.ts +942 -0
  497. package/src/core/README.md +3 -0
  498. package/src/core/api-promise.ts +92 -0
  499. package/src/core/error.ts +130 -0
  500. package/src/core/pagination.ts +157 -0
  501. package/src/core/resource.ts +11 -0
  502. package/src/core/uploads.ts +2 -0
  503. package/src/error.ts +2 -0
  504. package/src/index.ts +34 -0
  505. package/src/internal/README.md +3 -0
  506. package/src/internal/builtin-types.ts +93 -0
  507. package/src/internal/detect-platform.ts +196 -0
  508. package/src/internal/errors.ts +33 -0
  509. package/src/internal/headers.ts +97 -0
  510. package/src/internal/parse.ts +50 -0
  511. package/src/internal/qs/LICENSE.md +13 -0
  512. package/src/internal/qs/README.md +3 -0
  513. package/src/internal/qs/formats.ts +10 -0
  514. package/src/internal/qs/index.ts +13 -0
  515. package/src/internal/qs/stringify.ts +385 -0
  516. package/src/internal/qs/types.ts +71 -0
  517. package/src/internal/qs/utils.ts +265 -0
  518. package/src/internal/request-options.ts +91 -0
  519. package/src/internal/shim-types.ts +26 -0
  520. package/src/internal/shims.ts +107 -0
  521. package/src/internal/to-file.ts +154 -0
  522. package/src/internal/types.ts +95 -0
  523. package/src/internal/uploads.ts +187 -0
  524. package/src/internal/utils/base64.ts +40 -0
  525. package/src/internal/utils/bytes.ts +32 -0
  526. package/src/internal/utils/env.ts +18 -0
  527. package/src/internal/utils/log.ts +126 -0
  528. package/src/internal/utils/path.ts +88 -0
  529. package/src/internal/utils/sleep.ts +3 -0
  530. package/src/internal/utils/uuid.ts +17 -0
  531. package/src/internal/utils/values.ts +105 -0
  532. package/src/internal/utils.ts +8 -0
  533. package/src/lib/.keep +4 -0
  534. package/src/lib/authorization.ts +153 -0
  535. package/src/lib/cryptography.ts +109 -0
  536. package/src/lib/jwt-exchange.ts +65 -0
  537. package/src/lib/wallet-entropy.ts +48 -0
  538. package/src/pagination.ts +2 -0
  539. package/src/public-api/PrivyClient.ts +91 -0
  540. package/src/public-api/services/ethereum.ts +134 -0
  541. package/src/public-api/services/key-quorums.ts +77 -0
  542. package/src/public-api/services/policies.ts +175 -0
  543. package/src/public-api/services/solana.ts +111 -0
  544. package/src/public-api/services/transactions.ts +3 -0
  545. package/src/public-api/services/types.ts +50 -0
  546. package/src/public-api/services/users.ts +3 -0
  547. package/src/public-api/services/utils.ts +40 -0
  548. package/src/public-api/services/wallets.ts +270 -0
  549. package/src/resource.ts +2 -0
  550. package/src/resources/index.ts +71 -0
  551. package/src/resources/key-quorums.ts +177 -0
  552. package/src/resources/policies.ts +1992 -0
  553. package/src/resources/transactions.ts +42 -0
  554. package/src/resources/users.ts +1312 -0
  555. package/src/resources/wallets/balance.ts +62 -0
  556. package/src/resources/wallets/index.ts +25 -0
  557. package/src/resources/wallets/transactions.ts +116 -0
  558. package/src/resources/wallets/wallets.ts +1609 -0
  559. package/src/resources/wallets.ts +3 -0
  560. package/src/resources.ts +1 -0
  561. package/src/tsconfig.json +11 -0
  562. package/src/uploads.ts +2 -0
  563. package/src/version.ts +1 -0
  564. package/uploads.d.mts +2 -0
  565. package/uploads.d.mts.map +1 -0
  566. package/uploads.d.ts +2 -0
  567. package/uploads.d.ts.map +1 -0
  568. package/uploads.js +6 -0
  569. package/uploads.js.map +1 -0
  570. package/uploads.mjs +2 -0
  571. package/uploads.mjs.map +1 -0
  572. package/version.d.mts +2 -0
  573. package/version.d.mts.map +1 -0
  574. package/version.d.ts +2 -0
  575. package/version.d.ts.map +1 -0
  576. package/version.js +5 -0
  577. package/version.js.map +1 -0
  578. package/version.mjs +2 -0
  579. package/version.mjs.map +1 -0
@@ -0,0 +1,1283 @@
1
+ import { APIResource } from "../core/resource.js";
2
+ import { APIPromise } from "../core/api-promise.js";
3
+ import { RequestOptions } from "../internal/request-options.js";
4
+ export declare class Policies extends APIResource {
5
+ /**
6
+ * Create a new policy.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const policy = await client.policies.create({
11
+ * chain_type: 'ethereum',
12
+ * name: 'name',
13
+ * rules: [
14
+ * {
15
+ * action: 'ALLOW',
16
+ * conditions: [
17
+ * {
18
+ * field: 'to',
19
+ * field_source: 'ethereum_transaction',
20
+ * operator: 'eq',
21
+ * value: 'string',
22
+ * },
23
+ * ],
24
+ * method: 'eth_sendTransaction',
25
+ * name: 'name',
26
+ * },
27
+ * ],
28
+ * version: '1.0',
29
+ * });
30
+ * ```
31
+ */
32
+ create(params: PolicyCreateParams, options?: RequestOptions): APIPromise<Policy>;
33
+ /**
34
+ * Create a new rule for a policy.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const response = await client.policies._createRule(
39
+ * 'xxxxxxxxxxxxxxxxxxxxxxxx',
40
+ * {
41
+ * action: 'ALLOW',
42
+ * conditions: [
43
+ * {
44
+ * field: 'to',
45
+ * field_source: 'ethereum_transaction',
46
+ * operator: 'eq',
47
+ * value: 'string',
48
+ * },
49
+ * ],
50
+ * method: 'eth_sendTransaction',
51
+ * name: 'name',
52
+ * },
53
+ * );
54
+ * ```
55
+ */
56
+ _createRule(policyID: string, params: PolicyCreateRuleParams, options?: RequestOptions): APIPromise<PolicyCreateRuleResponse>;
57
+ /**
58
+ * Delete a policy by policy ID.
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * const response = await client.policies._delete(
63
+ * 'xxxxxxxxxxxxxxxxxxxxxxxx',
64
+ * );
65
+ * ```
66
+ */
67
+ _delete(policyID: string, params?: PolicyDeleteParams | null | undefined, options?: RequestOptions): APIPromise<PolicyDeleteResponse>;
68
+ /**
69
+ * Delete a rule by policy ID and rule ID.
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * const response = await client.policies._deleteRule(
74
+ * 'xxxxxxxxxxxxxxxxxxxxxxxx',
75
+ * { policy_id: 'xxxxxxxxxxxxxxxxxxxxxxxx' },
76
+ * );
77
+ * ```
78
+ */
79
+ _deleteRule(ruleID: string, params: PolicyDeleteRuleParams, options?: RequestOptions): APIPromise<PolicyDeleteRuleResponse>;
80
+ /**
81
+ * Update a policy by policy ID.
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * const policy = await client.policies._update(
86
+ * 'xxxxxxxxxxxxxxxxxxxxxxxx',
87
+ * );
88
+ * ```
89
+ */
90
+ _update(policyID: string, params: PolicyUpdateParams, options?: RequestOptions): APIPromise<Policy>;
91
+ /**
92
+ * Update a rule by policy ID and rule ID.
93
+ *
94
+ * @example
95
+ * ```ts
96
+ * const response = await client.policies._updateRule(
97
+ * 'xxxxxxxxxxxxxxxxxxxxxxxx',
98
+ * {
99
+ * policy_id: 'xxxxxxxxxxxxxxxxxxxxxxxx',
100
+ * action: 'ALLOW',
101
+ * conditions: [
102
+ * {
103
+ * field: 'to',
104
+ * field_source: 'ethereum_transaction',
105
+ * operator: 'eq',
106
+ * value: 'string',
107
+ * },
108
+ * ],
109
+ * method: 'eth_sendTransaction',
110
+ * name: 'name',
111
+ * },
112
+ * );
113
+ * ```
114
+ */
115
+ _updateRule(ruleID: string, params: PolicyUpdateRuleParams, options?: RequestOptions): APIPromise<PolicyUpdateRuleResponse>;
116
+ /**
117
+ * Get a policy by policy ID.
118
+ *
119
+ * @example
120
+ * ```ts
121
+ * const policy = await client.policies.get(
122
+ * 'xxxxxxxxxxxxxxxxxxxxxxxx',
123
+ * );
124
+ * ```
125
+ */
126
+ get(policyID: string, options?: RequestOptions): APIPromise<Policy>;
127
+ /**
128
+ * Get a rule by policy ID and rule ID.
129
+ *
130
+ * @example
131
+ * ```ts
132
+ * const response = await client.policies.getRule(
133
+ * 'xxxxxxxxxxxxxxxxxxxxxxxx',
134
+ * { policy_id: 'xxxxxxxxxxxxxxxxxxxxxxxx' },
135
+ * );
136
+ * ```
137
+ */
138
+ getRule(ruleID: string, params: PolicyGetRuleParams, options?: RequestOptions): APIPromise<PolicyGetRuleResponse>;
139
+ }
140
+ export interface Policy {
141
+ /**
142
+ * Unique ID of the created policy. This will be the primary identifier when using
143
+ * the policy in the future.
144
+ */
145
+ id: string;
146
+ /**
147
+ * The chain type the policy applies to.
148
+ */
149
+ chain_type: 'ethereum' | 'solana';
150
+ /**
151
+ * Unix timestamp of when the policy was created in milliseconds.
152
+ */
153
+ created_at: number;
154
+ /**
155
+ * Name to assign to policy.
156
+ */
157
+ name: string;
158
+ /**
159
+ * The key quorum ID of the owner of the policy.
160
+ */
161
+ owner_id: string | null;
162
+ rules: Array<Policy.Rule>;
163
+ /**
164
+ * Version of the policy. Currently, 1.0 is the only version.
165
+ */
166
+ version: '1.0';
167
+ }
168
+ export declare namespace Policy {
169
+ /**
170
+ * The rules that apply to each method the policy covers.
171
+ */
172
+ interface Rule {
173
+ id: string;
174
+ /**
175
+ * Action to take if the conditions are true.
176
+ */
177
+ action: 'ALLOW' | 'DENY';
178
+ conditions: Array<Rule.EthereumTransactionCondition | Rule.EthereumCalldataCondition | Rule.EthereumTypedDataDomainCondition | Rule.EthereumTypedDataMessageCondition | Rule.Ethereum7702AuthorizationCondition | Rule.SolanaProgramInstructionCondition | Rule.SolanaSystemProgramInstructionCondition | Rule.SolanaTokenProgramInstructionCondition | Rule.SystemCondition>;
179
+ /**
180
+ * Method the rule applies to.
181
+ */
182
+ method: 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_signTypedData_v4' | 'eth_sign7702Authorization' | 'signTransaction' | 'signAndSendTransaction' | 'exportPrivateKey' | '*';
183
+ name: string;
184
+ }
185
+ namespace Rule {
186
+ /**
187
+ * The verbatim Ethereum transaction object in an eth_signTransaction or
188
+ * eth_sendTransaction request.
189
+ */
190
+ interface EthereumTransactionCondition {
191
+ field: 'to' | 'value';
192
+ field_source: 'ethereum_transaction';
193
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
194
+ value: string | Array<string>;
195
+ }
196
+ /**
197
+ * The decoded calldata in a smart contract interaction as the smart contract
198
+ * method's parameters. Note that that 'ethereum_calldata' conditions must contain
199
+ * an abi parameter with the JSON ABI of the smart contract.
200
+ */
201
+ interface EthereumCalldataCondition {
202
+ abi: unknown;
203
+ field: string;
204
+ field_source: 'ethereum_calldata';
205
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
206
+ value: string | Array<string>;
207
+ }
208
+ /**
209
+ * Attributes from the signing domain that will verify the signature.
210
+ */
211
+ interface EthereumTypedDataDomainCondition {
212
+ field: 'chainId' | 'verifyingContract';
213
+ field_source: 'ethereum_typed_data_domain';
214
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
215
+ value: string | Array<string>;
216
+ }
217
+ /**
218
+ * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
219
+ * EIP-712.
220
+ */
221
+ interface EthereumTypedDataMessageCondition {
222
+ field: string;
223
+ field_source: 'ethereum_typed_data_message';
224
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
225
+ typed_data: EthereumTypedDataMessageCondition.TypedData;
226
+ value: string | Array<string>;
227
+ }
228
+ namespace EthereumTypedDataMessageCondition {
229
+ interface TypedData {
230
+ primary_type: string;
231
+ types: {
232
+ [key: string]: Array<TypedData.Type>;
233
+ };
234
+ }
235
+ namespace TypedData {
236
+ interface Type {
237
+ name: string;
238
+ type: string;
239
+ }
240
+ }
241
+ }
242
+ /**
243
+ * Allowed contract addresses for eth_signAuthorization requests.
244
+ */
245
+ interface Ethereum7702AuthorizationCondition {
246
+ field: 'contract';
247
+ field_source: 'ethereum_7702_authorization';
248
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
249
+ value: string | Array<string>;
250
+ }
251
+ /**
252
+ * Solana Program attributes, enables allowlisting Solana Programs.
253
+ */
254
+ interface SolanaProgramInstructionCondition {
255
+ field: 'programId';
256
+ field_source: 'solana_program_instruction';
257
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
258
+ value: string | Array<string>;
259
+ }
260
+ /**
261
+ * Solana System Program attributes, including more granular Transfer instruction
262
+ * fields.
263
+ */
264
+ interface SolanaSystemProgramInstructionCondition {
265
+ field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
266
+ field_source: 'solana_system_program_instruction';
267
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
268
+ value: string | Array<string>;
269
+ }
270
+ /**
271
+ * Solana Token Program attributes, including more granular TransferChecked
272
+ * instruction fields.
273
+ */
274
+ interface SolanaTokenProgramInstructionCondition {
275
+ field: 'instructionName' | 'TransferChecked.source' | 'TransferChecked.destination' | 'TransferChecked.authority' | 'TransferChecked.amount' | 'TransferChecked.mint';
276
+ field_source: 'solana_token_program_instruction';
277
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
278
+ value: string | Array<string>;
279
+ }
280
+ /**
281
+ * System attributes, including current unix timestamp (in seconds).
282
+ */
283
+ interface SystemCondition {
284
+ field: 'current_unix_timestamp';
285
+ field_source: 'system';
286
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
287
+ value: string | Array<string>;
288
+ }
289
+ }
290
+ }
291
+ /**
292
+ * A rule that defines the conditions and action to take if the conditions are
293
+ * true.
294
+ */
295
+ export interface PolicyCreateRuleResponse {
296
+ id: string;
297
+ /**
298
+ * Action to take if the conditions are true.
299
+ */
300
+ action: 'ALLOW' | 'DENY';
301
+ conditions: Array<PolicyCreateRuleResponse.EthereumTransactionCondition | PolicyCreateRuleResponse.EthereumCalldataCondition | PolicyCreateRuleResponse.EthereumTypedDataDomainCondition | PolicyCreateRuleResponse.EthereumTypedDataMessageCondition | PolicyCreateRuleResponse.Ethereum7702AuthorizationCondition | PolicyCreateRuleResponse.SolanaProgramInstructionCondition | PolicyCreateRuleResponse.SolanaSystemProgramInstructionCondition | PolicyCreateRuleResponse.SolanaTokenProgramInstructionCondition | PolicyCreateRuleResponse.SystemCondition>;
302
+ /**
303
+ * Method the rule applies to.
304
+ */
305
+ method: 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_signTypedData_v4' | 'eth_sign7702Authorization' | 'signTransaction' | 'signAndSendTransaction' | 'exportPrivateKey' | '*';
306
+ name: string;
307
+ }
308
+ export declare namespace PolicyCreateRuleResponse {
309
+ /**
310
+ * The verbatim Ethereum transaction object in an eth_signTransaction or
311
+ * eth_sendTransaction request.
312
+ */
313
+ interface EthereumTransactionCondition {
314
+ field: 'to' | 'value';
315
+ field_source: 'ethereum_transaction';
316
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
317
+ value: string | Array<string>;
318
+ }
319
+ /**
320
+ * The decoded calldata in a smart contract interaction as the smart contract
321
+ * method's parameters. Note that that 'ethereum_calldata' conditions must contain
322
+ * an abi parameter with the JSON ABI of the smart contract.
323
+ */
324
+ interface EthereumCalldataCondition {
325
+ abi: unknown;
326
+ field: string;
327
+ field_source: 'ethereum_calldata';
328
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
329
+ value: string | Array<string>;
330
+ }
331
+ /**
332
+ * Attributes from the signing domain that will verify the signature.
333
+ */
334
+ interface EthereumTypedDataDomainCondition {
335
+ field: 'chainId' | 'verifyingContract';
336
+ field_source: 'ethereum_typed_data_domain';
337
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
338
+ value: string | Array<string>;
339
+ }
340
+ /**
341
+ * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
342
+ * EIP-712.
343
+ */
344
+ interface EthereumTypedDataMessageCondition {
345
+ field: string;
346
+ field_source: 'ethereum_typed_data_message';
347
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
348
+ typed_data: EthereumTypedDataMessageCondition.TypedData;
349
+ value: string | Array<string>;
350
+ }
351
+ namespace EthereumTypedDataMessageCondition {
352
+ interface TypedData {
353
+ primary_type: string;
354
+ types: {
355
+ [key: string]: Array<TypedData.Type>;
356
+ };
357
+ }
358
+ namespace TypedData {
359
+ interface Type {
360
+ name: string;
361
+ type: string;
362
+ }
363
+ }
364
+ }
365
+ /**
366
+ * Allowed contract addresses for eth_signAuthorization requests.
367
+ */
368
+ interface Ethereum7702AuthorizationCondition {
369
+ field: 'contract';
370
+ field_source: 'ethereum_7702_authorization';
371
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
372
+ value: string | Array<string>;
373
+ }
374
+ /**
375
+ * Solana Program attributes, enables allowlisting Solana Programs.
376
+ */
377
+ interface SolanaProgramInstructionCondition {
378
+ field: 'programId';
379
+ field_source: 'solana_program_instruction';
380
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
381
+ value: string | Array<string>;
382
+ }
383
+ /**
384
+ * Solana System Program attributes, including more granular Transfer instruction
385
+ * fields.
386
+ */
387
+ interface SolanaSystemProgramInstructionCondition {
388
+ field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
389
+ field_source: 'solana_system_program_instruction';
390
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
391
+ value: string | Array<string>;
392
+ }
393
+ /**
394
+ * Solana Token Program attributes, including more granular TransferChecked
395
+ * instruction fields.
396
+ */
397
+ interface SolanaTokenProgramInstructionCondition {
398
+ field: 'instructionName' | 'TransferChecked.source' | 'TransferChecked.destination' | 'TransferChecked.authority' | 'TransferChecked.amount' | 'TransferChecked.mint';
399
+ field_source: 'solana_token_program_instruction';
400
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
401
+ value: string | Array<string>;
402
+ }
403
+ /**
404
+ * System attributes, including current unix timestamp (in seconds).
405
+ */
406
+ interface SystemCondition {
407
+ field: 'current_unix_timestamp';
408
+ field_source: 'system';
409
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
410
+ value: string | Array<string>;
411
+ }
412
+ }
413
+ export interface PolicyDeleteResponse {
414
+ /**
415
+ * Whether the policy was deleted successfully.
416
+ */
417
+ success: boolean;
418
+ }
419
+ export interface PolicyDeleteRuleResponse {
420
+ /**
421
+ * Whether the rule was deleted successfully.
422
+ */
423
+ success: boolean;
424
+ }
425
+ export interface PolicyUpdateRuleResponse {
426
+ id: string;
427
+ /**
428
+ * Action to take if the conditions are true.
429
+ */
430
+ action: 'ALLOW' | 'DENY';
431
+ conditions: Array<PolicyUpdateRuleResponse.EthereumTransactionCondition | PolicyUpdateRuleResponse.EthereumCalldataCondition | PolicyUpdateRuleResponse.EthereumTypedDataDomainCondition | PolicyUpdateRuleResponse.EthereumTypedDataMessageCondition | PolicyUpdateRuleResponse.Ethereum7702AuthorizationCondition | PolicyUpdateRuleResponse.SolanaProgramInstructionCondition | PolicyUpdateRuleResponse.SolanaSystemProgramInstructionCondition | PolicyUpdateRuleResponse.SolanaTokenProgramInstructionCondition | PolicyUpdateRuleResponse.SystemCondition>;
432
+ /**
433
+ * Method the rule applies to.
434
+ */
435
+ method: 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_signTypedData_v4' | 'eth_sign7702Authorization' | 'signTransaction' | 'signAndSendTransaction' | 'exportPrivateKey' | '*';
436
+ name: string;
437
+ }
438
+ export declare namespace PolicyUpdateRuleResponse {
439
+ /**
440
+ * The verbatim Ethereum transaction object in an eth_signTransaction or
441
+ * eth_sendTransaction request.
442
+ */
443
+ interface EthereumTransactionCondition {
444
+ field: 'to' | 'value';
445
+ field_source: 'ethereum_transaction';
446
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
447
+ value: string | Array<string>;
448
+ }
449
+ /**
450
+ * The decoded calldata in a smart contract interaction as the smart contract
451
+ * method's parameters. Note that that 'ethereum_calldata' conditions must contain
452
+ * an abi parameter with the JSON ABI of the smart contract.
453
+ */
454
+ interface EthereumCalldataCondition {
455
+ abi: unknown;
456
+ field: string;
457
+ field_source: 'ethereum_calldata';
458
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
459
+ value: string | Array<string>;
460
+ }
461
+ /**
462
+ * Attributes from the signing domain that will verify the signature.
463
+ */
464
+ interface EthereumTypedDataDomainCondition {
465
+ field: 'chainId' | 'verifyingContract';
466
+ field_source: 'ethereum_typed_data_domain';
467
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
468
+ value: string | Array<string>;
469
+ }
470
+ /**
471
+ * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
472
+ * EIP-712.
473
+ */
474
+ interface EthereumTypedDataMessageCondition {
475
+ field: string;
476
+ field_source: 'ethereum_typed_data_message';
477
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
478
+ typed_data: EthereumTypedDataMessageCondition.TypedData;
479
+ value: string | Array<string>;
480
+ }
481
+ namespace EthereumTypedDataMessageCondition {
482
+ interface TypedData {
483
+ primary_type: string;
484
+ types: {
485
+ [key: string]: Array<TypedData.Type>;
486
+ };
487
+ }
488
+ namespace TypedData {
489
+ interface Type {
490
+ name: string;
491
+ type: string;
492
+ }
493
+ }
494
+ }
495
+ /**
496
+ * Allowed contract addresses for eth_signAuthorization requests.
497
+ */
498
+ interface Ethereum7702AuthorizationCondition {
499
+ field: 'contract';
500
+ field_source: 'ethereum_7702_authorization';
501
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
502
+ value: string | Array<string>;
503
+ }
504
+ /**
505
+ * Solana Program attributes, enables allowlisting Solana Programs.
506
+ */
507
+ interface SolanaProgramInstructionCondition {
508
+ field: 'programId';
509
+ field_source: 'solana_program_instruction';
510
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
511
+ value: string | Array<string>;
512
+ }
513
+ /**
514
+ * Solana System Program attributes, including more granular Transfer instruction
515
+ * fields.
516
+ */
517
+ interface SolanaSystemProgramInstructionCondition {
518
+ field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
519
+ field_source: 'solana_system_program_instruction';
520
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
521
+ value: string | Array<string>;
522
+ }
523
+ /**
524
+ * Solana Token Program attributes, including more granular TransferChecked
525
+ * instruction fields.
526
+ */
527
+ interface SolanaTokenProgramInstructionCondition {
528
+ field: 'instructionName' | 'TransferChecked.source' | 'TransferChecked.destination' | 'TransferChecked.authority' | 'TransferChecked.amount' | 'TransferChecked.mint';
529
+ field_source: 'solana_token_program_instruction';
530
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
531
+ value: string | Array<string>;
532
+ }
533
+ /**
534
+ * System attributes, including current unix timestamp (in seconds).
535
+ */
536
+ interface SystemCondition {
537
+ field: 'current_unix_timestamp';
538
+ field_source: 'system';
539
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
540
+ value: string | Array<string>;
541
+ }
542
+ }
543
+ /**
544
+ * A rule that defines the conditions and action to take if the conditions are
545
+ * true.
546
+ */
547
+ export interface PolicyGetRuleResponse {
548
+ id: string;
549
+ /**
550
+ * Action to take if the conditions are true.
551
+ */
552
+ action: 'ALLOW' | 'DENY';
553
+ conditions: Array<PolicyGetRuleResponse.EthereumTransactionCondition | PolicyGetRuleResponse.EthereumCalldataCondition | PolicyGetRuleResponse.EthereumTypedDataDomainCondition | PolicyGetRuleResponse.EthereumTypedDataMessageCondition | PolicyGetRuleResponse.Ethereum7702AuthorizationCondition | PolicyGetRuleResponse.SolanaProgramInstructionCondition | PolicyGetRuleResponse.SolanaSystemProgramInstructionCondition | PolicyGetRuleResponse.SolanaTokenProgramInstructionCondition | PolicyGetRuleResponse.SystemCondition>;
554
+ /**
555
+ * Method the rule applies to.
556
+ */
557
+ method: 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_signTypedData_v4' | 'eth_sign7702Authorization' | 'signTransaction' | 'signAndSendTransaction' | 'exportPrivateKey' | '*';
558
+ name: string;
559
+ }
560
+ export declare namespace PolicyGetRuleResponse {
561
+ /**
562
+ * The verbatim Ethereum transaction object in an eth_signTransaction or
563
+ * eth_sendTransaction request.
564
+ */
565
+ interface EthereumTransactionCondition {
566
+ field: 'to' | 'value';
567
+ field_source: 'ethereum_transaction';
568
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
569
+ value: string | Array<string>;
570
+ }
571
+ /**
572
+ * The decoded calldata in a smart contract interaction as the smart contract
573
+ * method's parameters. Note that that 'ethereum_calldata' conditions must contain
574
+ * an abi parameter with the JSON ABI of the smart contract.
575
+ */
576
+ interface EthereumCalldataCondition {
577
+ abi: unknown;
578
+ field: string;
579
+ field_source: 'ethereum_calldata';
580
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
581
+ value: string | Array<string>;
582
+ }
583
+ /**
584
+ * Attributes from the signing domain that will verify the signature.
585
+ */
586
+ interface EthereumTypedDataDomainCondition {
587
+ field: 'chainId' | 'verifyingContract';
588
+ field_source: 'ethereum_typed_data_domain';
589
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
590
+ value: string | Array<string>;
591
+ }
592
+ /**
593
+ * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
594
+ * EIP-712.
595
+ */
596
+ interface EthereumTypedDataMessageCondition {
597
+ field: string;
598
+ field_source: 'ethereum_typed_data_message';
599
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
600
+ typed_data: EthereumTypedDataMessageCondition.TypedData;
601
+ value: string | Array<string>;
602
+ }
603
+ namespace EthereumTypedDataMessageCondition {
604
+ interface TypedData {
605
+ primary_type: string;
606
+ types: {
607
+ [key: string]: Array<TypedData.Type>;
608
+ };
609
+ }
610
+ namespace TypedData {
611
+ interface Type {
612
+ name: string;
613
+ type: string;
614
+ }
615
+ }
616
+ }
617
+ /**
618
+ * Allowed contract addresses for eth_signAuthorization requests.
619
+ */
620
+ interface Ethereum7702AuthorizationCondition {
621
+ field: 'contract';
622
+ field_source: 'ethereum_7702_authorization';
623
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
624
+ value: string | Array<string>;
625
+ }
626
+ /**
627
+ * Solana Program attributes, enables allowlisting Solana Programs.
628
+ */
629
+ interface SolanaProgramInstructionCondition {
630
+ field: 'programId';
631
+ field_source: 'solana_program_instruction';
632
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
633
+ value: string | Array<string>;
634
+ }
635
+ /**
636
+ * Solana System Program attributes, including more granular Transfer instruction
637
+ * fields.
638
+ */
639
+ interface SolanaSystemProgramInstructionCondition {
640
+ field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
641
+ field_source: 'solana_system_program_instruction';
642
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
643
+ value: string | Array<string>;
644
+ }
645
+ /**
646
+ * Solana Token Program attributes, including more granular TransferChecked
647
+ * instruction fields.
648
+ */
649
+ interface SolanaTokenProgramInstructionCondition {
650
+ field: 'instructionName' | 'TransferChecked.source' | 'TransferChecked.destination' | 'TransferChecked.authority' | 'TransferChecked.amount' | 'TransferChecked.mint';
651
+ field_source: 'solana_token_program_instruction';
652
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
653
+ value: string | Array<string>;
654
+ }
655
+ /**
656
+ * System attributes, including current unix timestamp (in seconds).
657
+ */
658
+ interface SystemCondition {
659
+ field: 'current_unix_timestamp';
660
+ field_source: 'system';
661
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
662
+ value: string | Array<string>;
663
+ }
664
+ }
665
+ export interface PolicyCreateParams {
666
+ /**
667
+ * Body param: The chain type the policy applies to.
668
+ */
669
+ chain_type: 'ethereum' | 'solana';
670
+ /**
671
+ * Body param: Name to assign to policy.
672
+ */
673
+ name: string;
674
+ /**
675
+ * Body param:
676
+ */
677
+ rules: Array<PolicyCreateParams.Rule>;
678
+ /**
679
+ * Body param: Version of the policy. Currently, 1.0 is the only version.
680
+ */
681
+ version: '1.0';
682
+ /**
683
+ * Body param: The owner of the resource. If you provide this, do not specify an
684
+ * owner_id as it will be generated automatically. When updating a wallet, you can
685
+ * set the owner to null to remove the owner.
686
+ */
687
+ owner?: PolicyCreateParams.PublicKeyOwner | PolicyCreateParams.UserOwner | null;
688
+ /**
689
+ * Body param: The key quorum ID to set as the owner of the resource. If you
690
+ * provide this, do not specify an owner.
691
+ */
692
+ owner_id?: string | null;
693
+ /**
694
+ * Header param: Idempotency keys ensure API requests are executed only once within
695
+ * a 24-hour window.
696
+ */
697
+ 'privy-idempotency-key'?: string;
698
+ }
699
+ export declare namespace PolicyCreateParams {
700
+ /**
701
+ * The rules that apply to each method the policy covers.
702
+ */
703
+ interface Rule {
704
+ /**
705
+ * Action to take if the conditions are true.
706
+ */
707
+ action: 'ALLOW' | 'DENY';
708
+ conditions: Array<Rule.EthereumTransactionCondition | Rule.EthereumCalldataCondition | Rule.EthereumTypedDataDomainCondition | Rule.EthereumTypedDataMessageCondition | Rule.Ethereum7702AuthorizationCondition | Rule.SolanaProgramInstructionCondition | Rule.SolanaSystemProgramInstructionCondition | Rule.SolanaTokenProgramInstructionCondition | Rule.SystemCondition>;
709
+ /**
710
+ * Method the rule applies to.
711
+ */
712
+ method: 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_signTypedData_v4' | 'eth_sign7702Authorization' | 'signTransaction' | 'signAndSendTransaction' | 'exportPrivateKey' | '*';
713
+ name: string;
714
+ }
715
+ namespace Rule {
716
+ /**
717
+ * The verbatim Ethereum transaction object in an eth_signTransaction or
718
+ * eth_sendTransaction request.
719
+ */
720
+ interface EthereumTransactionCondition {
721
+ field: 'to' | 'value';
722
+ field_source: 'ethereum_transaction';
723
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
724
+ value: string | Array<string>;
725
+ }
726
+ /**
727
+ * The decoded calldata in a smart contract interaction as the smart contract
728
+ * method's parameters. Note that that 'ethereum_calldata' conditions must contain
729
+ * an abi parameter with the JSON ABI of the smart contract.
730
+ */
731
+ interface EthereumCalldataCondition {
732
+ abi: unknown;
733
+ field: string;
734
+ field_source: 'ethereum_calldata';
735
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
736
+ value: string | Array<string>;
737
+ }
738
+ /**
739
+ * Attributes from the signing domain that will verify the signature.
740
+ */
741
+ interface EthereumTypedDataDomainCondition {
742
+ field: 'chainId' | 'verifyingContract';
743
+ field_source: 'ethereum_typed_data_domain';
744
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
745
+ value: string | Array<string>;
746
+ }
747
+ /**
748
+ * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
749
+ * EIP-712.
750
+ */
751
+ interface EthereumTypedDataMessageCondition {
752
+ field: string;
753
+ field_source: 'ethereum_typed_data_message';
754
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
755
+ typed_data: EthereumTypedDataMessageCondition.TypedData;
756
+ value: string | Array<string>;
757
+ }
758
+ namespace EthereumTypedDataMessageCondition {
759
+ interface TypedData {
760
+ primary_type: string;
761
+ types: {
762
+ [key: string]: Array<TypedData.Type>;
763
+ };
764
+ }
765
+ namespace TypedData {
766
+ interface Type {
767
+ name: string;
768
+ type: string;
769
+ }
770
+ }
771
+ }
772
+ /**
773
+ * Allowed contract addresses for eth_signAuthorization requests.
774
+ */
775
+ interface Ethereum7702AuthorizationCondition {
776
+ field: 'contract';
777
+ field_source: 'ethereum_7702_authorization';
778
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
779
+ value: string | Array<string>;
780
+ }
781
+ /**
782
+ * Solana Program attributes, enables allowlisting Solana Programs.
783
+ */
784
+ interface SolanaProgramInstructionCondition {
785
+ field: 'programId';
786
+ field_source: 'solana_program_instruction';
787
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
788
+ value: string | Array<string>;
789
+ }
790
+ /**
791
+ * Solana System Program attributes, including more granular Transfer instruction
792
+ * fields.
793
+ */
794
+ interface SolanaSystemProgramInstructionCondition {
795
+ field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
796
+ field_source: 'solana_system_program_instruction';
797
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
798
+ value: string | Array<string>;
799
+ }
800
+ /**
801
+ * Solana Token Program attributes, including more granular TransferChecked
802
+ * instruction fields.
803
+ */
804
+ interface SolanaTokenProgramInstructionCondition {
805
+ field: 'instructionName' | 'TransferChecked.source' | 'TransferChecked.destination' | 'TransferChecked.authority' | 'TransferChecked.amount' | 'TransferChecked.mint';
806
+ field_source: 'solana_token_program_instruction';
807
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
808
+ value: string | Array<string>;
809
+ }
810
+ /**
811
+ * System attributes, including current unix timestamp (in seconds).
812
+ */
813
+ interface SystemCondition {
814
+ field: 'current_unix_timestamp';
815
+ field_source: 'system';
816
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
817
+ value: string | Array<string>;
818
+ }
819
+ }
820
+ /**
821
+ * The P-256 public key of the owner of the resource. If you provide this, do not
822
+ * specify an owner_id as it will be generated automatically.
823
+ */
824
+ interface PublicKeyOwner {
825
+ public_key: string;
826
+ }
827
+ /**
828
+ * The user ID of the owner of the resource. The user must already exist, and this
829
+ * value must start with "did:privy:". If you provide this, do not specify an
830
+ * owner_id as it will be generated automatically.
831
+ */
832
+ interface UserOwner {
833
+ user_id: string;
834
+ }
835
+ }
836
+ export interface PolicyCreateRuleParams {
837
+ /**
838
+ * Body param: Action to take if the conditions are true.
839
+ */
840
+ action: 'ALLOW' | 'DENY';
841
+ /**
842
+ * Body param:
843
+ */
844
+ conditions: Array<PolicyCreateRuleParams.EthereumTransactionCondition | PolicyCreateRuleParams.EthereumCalldataCondition | PolicyCreateRuleParams.EthereumTypedDataDomainCondition | PolicyCreateRuleParams.EthereumTypedDataMessageCondition | PolicyCreateRuleParams.Ethereum7702AuthorizationCondition | PolicyCreateRuleParams.SolanaProgramInstructionCondition | PolicyCreateRuleParams.SolanaSystemProgramInstructionCondition | PolicyCreateRuleParams.SolanaTokenProgramInstructionCondition | PolicyCreateRuleParams.SystemCondition>;
845
+ /**
846
+ * Body param: Method the rule applies to.
847
+ */
848
+ method: 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_signTypedData_v4' | 'eth_sign7702Authorization' | 'signTransaction' | 'signAndSendTransaction' | 'exportPrivateKey' | '*';
849
+ /**
850
+ * Body param:
851
+ */
852
+ name: string;
853
+ /**
854
+ * Header param: Request authorization signature. If multiple signatures are
855
+ * required, they should be comma separated.
856
+ */
857
+ 'privy-authorization-signature'?: string;
858
+ }
859
+ export declare namespace PolicyCreateRuleParams {
860
+ /**
861
+ * The verbatim Ethereum transaction object in an eth_signTransaction or
862
+ * eth_sendTransaction request.
863
+ */
864
+ interface EthereumTransactionCondition {
865
+ field: 'to' | 'value';
866
+ field_source: 'ethereum_transaction';
867
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
868
+ value: string | Array<string>;
869
+ }
870
+ /**
871
+ * The decoded calldata in a smart contract interaction as the smart contract
872
+ * method's parameters. Note that that 'ethereum_calldata' conditions must contain
873
+ * an abi parameter with the JSON ABI of the smart contract.
874
+ */
875
+ interface EthereumCalldataCondition {
876
+ abi: unknown;
877
+ field: string;
878
+ field_source: 'ethereum_calldata';
879
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
880
+ value: string | Array<string>;
881
+ }
882
+ /**
883
+ * Attributes from the signing domain that will verify the signature.
884
+ */
885
+ interface EthereumTypedDataDomainCondition {
886
+ field: 'chainId' | 'verifyingContract';
887
+ field_source: 'ethereum_typed_data_domain';
888
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
889
+ value: string | Array<string>;
890
+ }
891
+ /**
892
+ * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
893
+ * EIP-712.
894
+ */
895
+ interface EthereumTypedDataMessageCondition {
896
+ field: string;
897
+ field_source: 'ethereum_typed_data_message';
898
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
899
+ typed_data: EthereumTypedDataMessageCondition.TypedData;
900
+ value: string | Array<string>;
901
+ }
902
+ namespace EthereumTypedDataMessageCondition {
903
+ interface TypedData {
904
+ primary_type: string;
905
+ types: {
906
+ [key: string]: Array<TypedData.Type>;
907
+ };
908
+ }
909
+ namespace TypedData {
910
+ interface Type {
911
+ name: string;
912
+ type: string;
913
+ }
914
+ }
915
+ }
916
+ /**
917
+ * Allowed contract addresses for eth_signAuthorization requests.
918
+ */
919
+ interface Ethereum7702AuthorizationCondition {
920
+ field: 'contract';
921
+ field_source: 'ethereum_7702_authorization';
922
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
923
+ value: string | Array<string>;
924
+ }
925
+ /**
926
+ * Solana Program attributes, enables allowlisting Solana Programs.
927
+ */
928
+ interface SolanaProgramInstructionCondition {
929
+ field: 'programId';
930
+ field_source: 'solana_program_instruction';
931
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
932
+ value: string | Array<string>;
933
+ }
934
+ /**
935
+ * Solana System Program attributes, including more granular Transfer instruction
936
+ * fields.
937
+ */
938
+ interface SolanaSystemProgramInstructionCondition {
939
+ field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
940
+ field_source: 'solana_system_program_instruction';
941
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
942
+ value: string | Array<string>;
943
+ }
944
+ /**
945
+ * Solana Token Program attributes, including more granular TransferChecked
946
+ * instruction fields.
947
+ */
948
+ interface SolanaTokenProgramInstructionCondition {
949
+ field: 'instructionName' | 'TransferChecked.source' | 'TransferChecked.destination' | 'TransferChecked.authority' | 'TransferChecked.amount' | 'TransferChecked.mint';
950
+ field_source: 'solana_token_program_instruction';
951
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
952
+ value: string | Array<string>;
953
+ }
954
+ /**
955
+ * System attributes, including current unix timestamp (in seconds).
956
+ */
957
+ interface SystemCondition {
958
+ field: 'current_unix_timestamp';
959
+ field_source: 'system';
960
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
961
+ value: string | Array<string>;
962
+ }
963
+ }
964
+ export interface PolicyDeleteParams {
965
+ /**
966
+ * Request authorization signature. If multiple signatures are required, they
967
+ * should be comma separated.
968
+ */
969
+ 'privy-authorization-signature'?: string;
970
+ }
971
+ export interface PolicyDeleteRuleParams {
972
+ /**
973
+ * Path param:
974
+ */
975
+ policy_id: string;
976
+ /**
977
+ * Header param: Request authorization signature. If multiple signatures are
978
+ * required, they should be comma separated.
979
+ */
980
+ 'privy-authorization-signature'?: string;
981
+ }
982
+ export interface PolicyUpdateParams {
983
+ /**
984
+ * Body param: Name to assign to policy.
985
+ */
986
+ name?: string;
987
+ /**
988
+ * Body param: The owner of the resource. If you provide this, do not specify an
989
+ * owner_id as it will be generated automatically. When updating a wallet, you can
990
+ * set the owner to null to remove the owner.
991
+ */
992
+ owner?: PolicyUpdateParams.PublicKeyOwner | PolicyUpdateParams.UserOwner | null;
993
+ /**
994
+ * Body param: The key quorum ID to set as the owner of the resource. If you
995
+ * provide this, do not specify an owner.
996
+ */
997
+ owner_id?: string | null;
998
+ /**
999
+ * Body param:
1000
+ */
1001
+ rules?: Array<PolicyUpdateParams.Rule>;
1002
+ /**
1003
+ * Header param: Request authorization signature. If multiple signatures are
1004
+ * required, they should be comma separated.
1005
+ */
1006
+ 'privy-authorization-signature'?: string;
1007
+ }
1008
+ export declare namespace PolicyUpdateParams {
1009
+ /**
1010
+ * The P-256 public key of the owner of the resource. If you provide this, do not
1011
+ * specify an owner_id as it will be generated automatically.
1012
+ */
1013
+ interface PublicKeyOwner {
1014
+ public_key: string;
1015
+ }
1016
+ /**
1017
+ * The user ID of the owner of the resource. The user must already exist, and this
1018
+ * value must start with "did:privy:". If you provide this, do not specify an
1019
+ * owner_id as it will be generated automatically.
1020
+ */
1021
+ interface UserOwner {
1022
+ user_id: string;
1023
+ }
1024
+ /**
1025
+ * The rules that apply to each method the policy covers.
1026
+ */
1027
+ interface Rule {
1028
+ /**
1029
+ * Action to take if the conditions are true.
1030
+ */
1031
+ action: 'ALLOW' | 'DENY';
1032
+ conditions: Array<Rule.EthereumTransactionCondition | Rule.EthereumCalldataCondition | Rule.EthereumTypedDataDomainCondition | Rule.EthereumTypedDataMessageCondition | Rule.Ethereum7702AuthorizationCondition | Rule.SolanaProgramInstructionCondition | Rule.SolanaSystemProgramInstructionCondition | Rule.SolanaTokenProgramInstructionCondition | Rule.SystemCondition>;
1033
+ /**
1034
+ * Method the rule applies to.
1035
+ */
1036
+ method: 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_signTypedData_v4' | 'eth_sign7702Authorization' | 'signTransaction' | 'signAndSendTransaction' | 'exportPrivateKey' | '*';
1037
+ name: string;
1038
+ }
1039
+ namespace Rule {
1040
+ /**
1041
+ * The verbatim Ethereum transaction object in an eth_signTransaction or
1042
+ * eth_sendTransaction request.
1043
+ */
1044
+ interface EthereumTransactionCondition {
1045
+ field: 'to' | 'value';
1046
+ field_source: 'ethereum_transaction';
1047
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
1048
+ value: string | Array<string>;
1049
+ }
1050
+ /**
1051
+ * The decoded calldata in a smart contract interaction as the smart contract
1052
+ * method's parameters. Note that that 'ethereum_calldata' conditions must contain
1053
+ * an abi parameter with the JSON ABI of the smart contract.
1054
+ */
1055
+ interface EthereumCalldataCondition {
1056
+ abi: unknown;
1057
+ field: string;
1058
+ field_source: 'ethereum_calldata';
1059
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
1060
+ value: string | Array<string>;
1061
+ }
1062
+ /**
1063
+ * Attributes from the signing domain that will verify the signature.
1064
+ */
1065
+ interface EthereumTypedDataDomainCondition {
1066
+ field: 'chainId' | 'verifyingContract';
1067
+ field_source: 'ethereum_typed_data_domain';
1068
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
1069
+ value: string | Array<string>;
1070
+ }
1071
+ /**
1072
+ * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
1073
+ * EIP-712.
1074
+ */
1075
+ interface EthereumTypedDataMessageCondition {
1076
+ field: string;
1077
+ field_source: 'ethereum_typed_data_message';
1078
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
1079
+ typed_data: EthereumTypedDataMessageCondition.TypedData;
1080
+ value: string | Array<string>;
1081
+ }
1082
+ namespace EthereumTypedDataMessageCondition {
1083
+ interface TypedData {
1084
+ primary_type: string;
1085
+ types: {
1086
+ [key: string]: Array<TypedData.Type>;
1087
+ };
1088
+ }
1089
+ namespace TypedData {
1090
+ interface Type {
1091
+ name: string;
1092
+ type: string;
1093
+ }
1094
+ }
1095
+ }
1096
+ /**
1097
+ * Allowed contract addresses for eth_signAuthorization requests.
1098
+ */
1099
+ interface Ethereum7702AuthorizationCondition {
1100
+ field: 'contract';
1101
+ field_source: 'ethereum_7702_authorization';
1102
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
1103
+ value: string | Array<string>;
1104
+ }
1105
+ /**
1106
+ * Solana Program attributes, enables allowlisting Solana Programs.
1107
+ */
1108
+ interface SolanaProgramInstructionCondition {
1109
+ field: 'programId';
1110
+ field_source: 'solana_program_instruction';
1111
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
1112
+ value: string | Array<string>;
1113
+ }
1114
+ /**
1115
+ * Solana System Program attributes, including more granular Transfer instruction
1116
+ * fields.
1117
+ */
1118
+ interface SolanaSystemProgramInstructionCondition {
1119
+ field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
1120
+ field_source: 'solana_system_program_instruction';
1121
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
1122
+ value: string | Array<string>;
1123
+ }
1124
+ /**
1125
+ * Solana Token Program attributes, including more granular TransferChecked
1126
+ * instruction fields.
1127
+ */
1128
+ interface SolanaTokenProgramInstructionCondition {
1129
+ field: 'instructionName' | 'TransferChecked.source' | 'TransferChecked.destination' | 'TransferChecked.authority' | 'TransferChecked.amount' | 'TransferChecked.mint';
1130
+ field_source: 'solana_token_program_instruction';
1131
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
1132
+ value: string | Array<string>;
1133
+ }
1134
+ /**
1135
+ * System attributes, including current unix timestamp (in seconds).
1136
+ */
1137
+ interface SystemCondition {
1138
+ field: 'current_unix_timestamp';
1139
+ field_source: 'system';
1140
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
1141
+ value: string | Array<string>;
1142
+ }
1143
+ }
1144
+ }
1145
+ export interface PolicyUpdateRuleParams {
1146
+ /**
1147
+ * Path param:
1148
+ */
1149
+ policy_id: string;
1150
+ /**
1151
+ * Body param: Action to take if the conditions are true.
1152
+ */
1153
+ action: 'ALLOW' | 'DENY';
1154
+ /**
1155
+ * Body param:
1156
+ */
1157
+ conditions: Array<PolicyUpdateRuleParams.EthereumTransactionCondition | PolicyUpdateRuleParams.EthereumCalldataCondition | PolicyUpdateRuleParams.EthereumTypedDataDomainCondition | PolicyUpdateRuleParams.EthereumTypedDataMessageCondition | PolicyUpdateRuleParams.Ethereum7702AuthorizationCondition | PolicyUpdateRuleParams.SolanaProgramInstructionCondition | PolicyUpdateRuleParams.SolanaSystemProgramInstructionCondition | PolicyUpdateRuleParams.SolanaTokenProgramInstructionCondition | PolicyUpdateRuleParams.SystemCondition>;
1158
+ /**
1159
+ * Body param: Method the rule applies to.
1160
+ */
1161
+ method: 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_signTypedData_v4' | 'eth_sign7702Authorization' | 'signTransaction' | 'signAndSendTransaction' | 'exportPrivateKey' | '*';
1162
+ /**
1163
+ * Body param:
1164
+ */
1165
+ name: string;
1166
+ /**
1167
+ * Header param: Request authorization signature. If multiple signatures are
1168
+ * required, they should be comma separated.
1169
+ */
1170
+ 'privy-authorization-signature'?: string;
1171
+ }
1172
+ export declare namespace PolicyUpdateRuleParams {
1173
+ /**
1174
+ * The verbatim Ethereum transaction object in an eth_signTransaction or
1175
+ * eth_sendTransaction request.
1176
+ */
1177
+ interface EthereumTransactionCondition {
1178
+ field: 'to' | 'value';
1179
+ field_source: 'ethereum_transaction';
1180
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
1181
+ value: string | Array<string>;
1182
+ }
1183
+ /**
1184
+ * The decoded calldata in a smart contract interaction as the smart contract
1185
+ * method's parameters. Note that that 'ethereum_calldata' conditions must contain
1186
+ * an abi parameter with the JSON ABI of the smart contract.
1187
+ */
1188
+ interface EthereumCalldataCondition {
1189
+ abi: unknown;
1190
+ field: string;
1191
+ field_source: 'ethereum_calldata';
1192
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
1193
+ value: string | Array<string>;
1194
+ }
1195
+ /**
1196
+ * Attributes from the signing domain that will verify the signature.
1197
+ */
1198
+ interface EthereumTypedDataDomainCondition {
1199
+ field: 'chainId' | 'verifyingContract';
1200
+ field_source: 'ethereum_typed_data_domain';
1201
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
1202
+ value: string | Array<string>;
1203
+ }
1204
+ /**
1205
+ * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
1206
+ * EIP-712.
1207
+ */
1208
+ interface EthereumTypedDataMessageCondition {
1209
+ field: string;
1210
+ field_source: 'ethereum_typed_data_message';
1211
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
1212
+ typed_data: EthereumTypedDataMessageCondition.TypedData;
1213
+ value: string | Array<string>;
1214
+ }
1215
+ namespace EthereumTypedDataMessageCondition {
1216
+ interface TypedData {
1217
+ primary_type: string;
1218
+ types: {
1219
+ [key: string]: Array<TypedData.Type>;
1220
+ };
1221
+ }
1222
+ namespace TypedData {
1223
+ interface Type {
1224
+ name: string;
1225
+ type: string;
1226
+ }
1227
+ }
1228
+ }
1229
+ /**
1230
+ * Allowed contract addresses for eth_signAuthorization requests.
1231
+ */
1232
+ interface Ethereum7702AuthorizationCondition {
1233
+ field: 'contract';
1234
+ field_source: 'ethereum_7702_authorization';
1235
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
1236
+ value: string | Array<string>;
1237
+ }
1238
+ /**
1239
+ * Solana Program attributes, enables allowlisting Solana Programs.
1240
+ */
1241
+ interface SolanaProgramInstructionCondition {
1242
+ field: 'programId';
1243
+ field_source: 'solana_program_instruction';
1244
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
1245
+ value: string | Array<string>;
1246
+ }
1247
+ /**
1248
+ * Solana System Program attributes, including more granular Transfer instruction
1249
+ * fields.
1250
+ */
1251
+ interface SolanaSystemProgramInstructionCondition {
1252
+ field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
1253
+ field_source: 'solana_system_program_instruction';
1254
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
1255
+ value: string | Array<string>;
1256
+ }
1257
+ /**
1258
+ * Solana Token Program attributes, including more granular TransferChecked
1259
+ * instruction fields.
1260
+ */
1261
+ interface SolanaTokenProgramInstructionCondition {
1262
+ field: 'instructionName' | 'TransferChecked.source' | 'TransferChecked.destination' | 'TransferChecked.authority' | 'TransferChecked.amount' | 'TransferChecked.mint';
1263
+ field_source: 'solana_token_program_instruction';
1264
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
1265
+ value: string | Array<string>;
1266
+ }
1267
+ /**
1268
+ * System attributes, including current unix timestamp (in seconds).
1269
+ */
1270
+ interface SystemCondition {
1271
+ field: 'current_unix_timestamp';
1272
+ field_source: 'system';
1273
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in';
1274
+ value: string | Array<string>;
1275
+ }
1276
+ }
1277
+ export interface PolicyGetRuleParams {
1278
+ policy_id: string;
1279
+ }
1280
+ export declare namespace Policies {
1281
+ export { type Policy as Policy, type PolicyCreateRuleResponse as PolicyCreateRuleResponse, type PolicyDeleteResponse as PolicyDeleteResponse, type PolicyDeleteRuleResponse as PolicyDeleteRuleResponse, type PolicyUpdateRuleResponse as PolicyUpdateRuleResponse, type PolicyGetRuleResponse as PolicyGetRuleResponse, type PolicyCreateParams as PolicyCreateParams, type PolicyCreateRuleParams as PolicyCreateRuleParams, type PolicyDeleteParams as PolicyDeleteParams, type PolicyDeleteRuleParams as PolicyDeleteRuleParams, type PolicyUpdateParams as PolicyUpdateParams, type PolicyUpdateRuleParams as PolicyUpdateRuleParams, type PolicyGetRuleParams as PolicyGetRuleParams, };
1282
+ }
1283
+ //# sourceMappingURL=policies.d.ts.map