@florent-uzio/custody 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (383) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +280 -0
  3. package/dist/constants/defaults.d.ts +3 -0
  4. package/dist/constants/defaults.d.ts.map +1 -0
  5. package/dist/constants/defaults.js +3 -0
  6. package/dist/constants/defaults.js.map +1 -0
  7. package/dist/constants/index.d.ts +3 -0
  8. package/dist/constants/index.d.ts.map +1 -0
  9. package/dist/constants/index.js +3 -0
  10. package/dist/constants/index.js.map +1 -0
  11. package/dist/constants/urls.d.ts +86 -0
  12. package/dist/constants/urls.d.ts.map +1 -0
  13. package/dist/constants/urls.js +109 -0
  14. package/dist/constants/urls.js.map +1 -0
  15. package/dist/helpers/async/async.d.ts +6 -0
  16. package/dist/helpers/async/async.d.ts.map +1 -0
  17. package/dist/helpers/async/async.js +6 -0
  18. package/dist/helpers/async/async.js.map +1 -0
  19. package/dist/helpers/async/index.d.ts +2 -0
  20. package/dist/helpers/async/index.d.ts.map +1 -0
  21. package/dist/helpers/async/index.js +2 -0
  22. package/dist/helpers/async/index.js.map +1 -0
  23. package/dist/helpers/index.d.ts +4 -0
  24. package/dist/helpers/index.d.ts.map +1 -0
  25. package/dist/helpers/index.js +4 -0
  26. package/dist/helpers/index.js.map +1 -0
  27. package/dist/helpers/typeof-fns/index.d.ts +2 -0
  28. package/dist/helpers/typeof-fns/index.d.ts.map +1 -0
  29. package/dist/helpers/typeof-fns/index.js +2 -0
  30. package/dist/helpers/typeof-fns/index.js.map +1 -0
  31. package/dist/helpers/typeof-fns/typeof-fns.d.ts +18 -0
  32. package/dist/helpers/typeof-fns/typeof-fns.d.ts.map +1 -0
  33. package/dist/helpers/typeof-fns/typeof-fns.js +48 -0
  34. package/dist/helpers/typeof-fns/typeof-fns.js.map +1 -0
  35. package/dist/helpers/url/index.d.ts +2 -0
  36. package/dist/helpers/url/index.d.ts.map +1 -0
  37. package/dist/helpers/url/index.js +2 -0
  38. package/dist/helpers/url/index.js.map +1 -0
  39. package/dist/helpers/url/url.d.ts +39 -0
  40. package/dist/helpers/url/url.d.ts.map +1 -0
  41. package/dist/helpers/url/url.js +54 -0
  42. package/dist/helpers/url/url.js.map +1 -0
  43. package/dist/index.d.ts +27 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +9 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/main.d.ts +2 -0
  48. package/dist/main.d.ts.map +1 -0
  49. package/dist/main.helpers.d.ts +2 -0
  50. package/dist/main.helpers.d.ts.map +1 -0
  51. package/dist/main.helpers.js +99 -0
  52. package/dist/main.helpers.js.map +1 -0
  53. package/dist/main.js +41 -0
  54. package/dist/main.js.map +1 -0
  55. package/dist/models/custody-error.d.ts +22 -0
  56. package/dist/models/custody-error.d.ts.map +1 -0
  57. package/dist/models/custody-error.js +47 -0
  58. package/dist/models/custody-error.js.map +1 -0
  59. package/dist/models/custody-types.d.ts +14664 -0
  60. package/dist/models/custody-types.d.ts.map +1 -0
  61. package/dist/models/custody-types.js +6 -0
  62. package/dist/models/custody-types.js.map +1 -0
  63. package/dist/models/index.d.ts +4 -0
  64. package/dist/models/index.d.ts.map +1 -0
  65. package/dist/models/index.js +3 -0
  66. package/dist/models/index.js.map +1 -0
  67. package/dist/models/ledger-ids.d.ts +19 -0
  68. package/dist/models/ledger-ids.d.ts.map +1 -0
  69. package/dist/models/ledger-ids.js +2 -0
  70. package/dist/models/ledger-ids.js.map +1 -0
  71. package/dist/namespaces/accounts.d.ts +32 -0
  72. package/dist/namespaces/accounts.d.ts.map +1 -0
  73. package/dist/namespaces/accounts.js +66 -0
  74. package/dist/namespaces/accounts.js.map +1 -0
  75. package/dist/namespaces/channels.d.ts +14 -0
  76. package/dist/namespaces/channels.d.ts.map +1 -0
  77. package/dist/namespaces/channels.js +15 -0
  78. package/dist/namespaces/channels.js.map +1 -0
  79. package/dist/namespaces/domains.d.ts +7 -0
  80. package/dist/namespaces/domains.d.ts.map +1 -0
  81. package/dist/namespaces/domains.js +8 -0
  82. package/dist/namespaces/domains.js.map +1 -0
  83. package/dist/namespaces/endpoints.d.ts +7 -0
  84. package/dist/namespaces/endpoints.d.ts.map +1 -0
  85. package/dist/namespaces/endpoints.js +8 -0
  86. package/dist/namespaces/endpoints.js.map +1 -0
  87. package/dist/namespaces/events.d.ts +6 -0
  88. package/dist/namespaces/events.d.ts.map +1 -0
  89. package/dist/namespaces/events.js +7 -0
  90. package/dist/namespaces/events.js.map +1 -0
  91. package/dist/namespaces/genesis.d.ts +6 -0
  92. package/dist/namespaces/genesis.d.ts.map +1 -0
  93. package/dist/namespaces/genesis.js +7 -0
  94. package/dist/namespaces/genesis.js.map +1 -0
  95. package/dist/namespaces/index.d.ts +16 -0
  96. package/dist/namespaces/index.d.ts.map +1 -0
  97. package/dist/namespaces/index.js +16 -0
  98. package/dist/namespaces/index.js.map +1 -0
  99. package/dist/namespaces/intents.d.ts +13 -0
  100. package/dist/namespaces/intents.d.ts.map +1 -0
  101. package/dist/namespaces/intents.js +70 -0
  102. package/dist/namespaces/intents.js.map +1 -0
  103. package/dist/namespaces/ledgers.d.ts +11 -0
  104. package/dist/namespaces/ledgers.d.ts.map +1 -0
  105. package/dist/namespaces/ledgers.js +12 -0
  106. package/dist/namespaces/ledgers.js.map +1 -0
  107. package/dist/namespaces/policies.d.ts +7 -0
  108. package/dist/namespaces/policies.d.ts.map +1 -0
  109. package/dist/namespaces/policies.js +8 -0
  110. package/dist/namespaces/policies.js.map +1 -0
  111. package/dist/namespaces/requests.d.ts +8 -0
  112. package/dist/namespaces/requests.d.ts.map +1 -0
  113. package/dist/namespaces/requests.js +9 -0
  114. package/dist/namespaces/requests.js.map +1 -0
  115. package/dist/namespaces/tickers.d.ts +7 -0
  116. package/dist/namespaces/tickers.d.ts.map +1 -0
  117. package/dist/namespaces/tickers.js +8 -0
  118. package/dist/namespaces/tickers.js.map +1 -0
  119. package/dist/namespaces/transactions.d.ts +12 -0
  120. package/dist/namespaces/transactions.d.ts.map +1 -0
  121. package/dist/namespaces/transactions.js +13 -0
  122. package/dist/namespaces/transactions.js.map +1 -0
  123. package/dist/namespaces/user-invitations.d.ts +13 -0
  124. package/dist/namespaces/user-invitations.d.ts.map +1 -0
  125. package/dist/namespaces/user-invitations.js +14 -0
  126. package/dist/namespaces/user-invitations.js.map +1 -0
  127. package/dist/namespaces/users.d.ts +9 -0
  128. package/dist/namespaces/users.d.ts.map +1 -0
  129. package/dist/namespaces/users.js +10 -0
  130. package/dist/namespaces/users.js.map +1 -0
  131. package/dist/namespaces/vaults.d.ts +9 -0
  132. package/dist/namespaces/vaults.d.ts.map +1 -0
  133. package/dist/namespaces/vaults.js +12 -0
  134. package/dist/namespaces/vaults.js.map +1 -0
  135. package/dist/ripple-custody.d.ts +95 -0
  136. package/dist/ripple-custody.d.ts.map +1 -0
  137. package/dist/ripple-custody.js +138 -0
  138. package/dist/ripple-custody.js.map +1 -0
  139. package/dist/ripple-custody.types.d.ts +29 -0
  140. package/dist/ripple-custody.types.d.ts.map +1 -0
  141. package/dist/ripple-custody.types.js +2 -0
  142. package/dist/ripple-custody.types.js.map +1 -0
  143. package/dist/services/accounts/accounts.types.d.ts +48 -0
  144. package/dist/services/accounts/accounts.types.d.ts.map +1 -0
  145. package/dist/services/accounts/accounts.types.js +2 -0
  146. package/dist/services/accounts/accounts.types.js.map +1 -0
  147. package/dist/services/accounts/index.d.ts +2 -0
  148. package/dist/services/accounts/index.d.ts.map +1 -0
  149. package/dist/services/accounts/index.js +2 -0
  150. package/dist/services/accounts/index.js.map +1 -0
  151. package/dist/services/apis/api.service.d.ts +64 -0
  152. package/dist/services/apis/api.service.d.ts.map +1 -0
  153. package/dist/services/apis/api.service.js +235 -0
  154. package/dist/services/apis/api.service.js.map +1 -0
  155. package/dist/services/apis/api.service.types.d.ts +16 -0
  156. package/dist/services/apis/api.service.types.d.ts.map +1 -0
  157. package/dist/services/apis/api.service.types.js +3 -0
  158. package/dist/services/apis/api.service.types.js.map +1 -0
  159. package/dist/services/apis/index.d.ts +3 -0
  160. package/dist/services/apis/index.d.ts.map +1 -0
  161. package/dist/services/apis/index.js +3 -0
  162. package/dist/services/apis/index.js.map +1 -0
  163. package/dist/services/auth/auth.service.d.ts +56 -0
  164. package/dist/services/auth/auth.service.d.ts.map +1 -0
  165. package/dist/services/auth/auth.service.js +120 -0
  166. package/dist/services/auth/auth.service.js.map +1 -0
  167. package/dist/services/auth/auth.service.types.d.ts +9 -0
  168. package/dist/services/auth/auth.service.types.d.ts.map +1 -0
  169. package/dist/services/auth/auth.service.types.js +2 -0
  170. package/dist/services/auth/auth.service.types.js.map +1 -0
  171. package/dist/services/auth/index.d.ts +3 -0
  172. package/dist/services/auth/index.d.ts.map +1 -0
  173. package/dist/services/auth/index.js +3 -0
  174. package/dist/services/auth/index.js.map +1 -0
  175. package/dist/services/channels/channels.types.d.ts +37 -0
  176. package/dist/services/channels/channels.types.d.ts.map +1 -0
  177. package/dist/services/channels/channels.types.js +2 -0
  178. package/dist/services/channels/channels.types.js.map +1 -0
  179. package/dist/services/channels/index.d.ts +3 -0
  180. package/dist/services/channels/index.d.ts.map +1 -0
  181. package/dist/services/channels/index.js +3 -0
  182. package/dist/services/channels/index.js.map +1 -0
  183. package/dist/services/channels/parse-event-payload.d.ts +12 -0
  184. package/dist/services/channels/parse-event-payload.d.ts.map +1 -0
  185. package/dist/services/channels/parse-event-payload.js +37 -0
  186. package/dist/services/channels/parse-event-payload.js.map +1 -0
  187. package/dist/services/domain-resolver/domain-resolver.types.d.ts +18 -0
  188. package/dist/services/domain-resolver/domain-resolver.types.d.ts.map +1 -0
  189. package/dist/services/domain-resolver/domain-resolver.types.js +2 -0
  190. package/dist/services/domain-resolver/domain-resolver.types.js.map +1 -0
  191. package/dist/services/domain-resolver/index.d.ts +2 -0
  192. package/dist/services/domain-resolver/index.d.ts.map +1 -0
  193. package/dist/services/domain-resolver/index.js +2 -0
  194. package/dist/services/domain-resolver/index.js.map +1 -0
  195. package/dist/services/domains/domain.types.d.ts +6 -0
  196. package/dist/services/domains/domain.types.d.ts.map +1 -0
  197. package/dist/services/domains/domain.types.js +2 -0
  198. package/dist/services/domains/domain.types.js.map +1 -0
  199. package/dist/services/domains/index.d.ts +2 -0
  200. package/dist/services/domains/index.d.ts.map +1 -0
  201. package/dist/services/domains/index.js +2 -0
  202. package/dist/services/domains/index.js.map +1 -0
  203. package/dist/services/endpoints/endpoints.types.d.ts +7 -0
  204. package/dist/services/endpoints/endpoints.types.d.ts.map +1 -0
  205. package/dist/services/endpoints/endpoints.types.js +2 -0
  206. package/dist/services/endpoints/endpoints.types.js.map +1 -0
  207. package/dist/services/endpoints/index.d.ts +2 -0
  208. package/dist/services/endpoints/index.d.ts.map +1 -0
  209. package/dist/services/endpoints/index.js +2 -0
  210. package/dist/services/endpoints/index.js.map +1 -0
  211. package/dist/services/events/events.types.d.ts +8 -0
  212. package/dist/services/events/events.types.d.ts.map +1 -0
  213. package/dist/services/events/events.types.js +2 -0
  214. package/dist/services/events/events.types.js.map +1 -0
  215. package/dist/services/events/index.d.ts +2 -0
  216. package/dist/services/events/index.d.ts.map +1 -0
  217. package/dist/services/events/index.js +2 -0
  218. package/dist/services/events/index.js.map +1 -0
  219. package/dist/services/genesis/genesis.types.d.ts +7 -0
  220. package/dist/services/genesis/genesis.types.d.ts.map +1 -0
  221. package/dist/services/genesis/genesis.types.js +2 -0
  222. package/dist/services/genesis/genesis.types.js.map +1 -0
  223. package/dist/services/genesis/index.d.ts +2 -0
  224. package/dist/services/genesis/index.d.ts.map +1 -0
  225. package/dist/services/genesis/index.js +2 -0
  226. package/dist/services/genesis/index.js.map +1 -0
  227. package/dist/services/index.d.ts +19 -0
  228. package/dist/services/index.d.ts.map +1 -0
  229. package/dist/services/index.js +19 -0
  230. package/dist/services/index.js.map +1 -0
  231. package/dist/services/intents/index.d.ts +2 -0
  232. package/dist/services/intents/index.d.ts.map +1 -0
  233. package/dist/services/intents/index.js +2 -0
  234. package/dist/services/intents/index.js.map +1 -0
  235. package/dist/services/intents/intents.types.d.ts +66 -0
  236. package/dist/services/intents/intents.types.d.ts.map +1 -0
  237. package/dist/services/intents/intents.types.js +5 -0
  238. package/dist/services/intents/intents.types.js.map +1 -0
  239. package/dist/services/keypairs/ed25519.service.d.ts +25 -0
  240. package/dist/services/keypairs/ed25519.service.d.ts.map +1 -0
  241. package/dist/services/keypairs/ed25519.service.js +84 -0
  242. package/dist/services/keypairs/ed25519.service.js.map +1 -0
  243. package/dist/services/keypairs/index.d.ts +3 -0
  244. package/dist/services/keypairs/index.d.ts.map +1 -0
  245. package/dist/services/keypairs/index.js +3 -0
  246. package/dist/services/keypairs/index.js.map +1 -0
  247. package/dist/services/keypairs/keypair.service.d.ts +27 -0
  248. package/dist/services/keypairs/keypair.service.d.ts.map +1 -0
  249. package/dist/services/keypairs/keypair.service.js +69 -0
  250. package/dist/services/keypairs/keypair.service.js.map +1 -0
  251. package/dist/services/keypairs/keypairs.types.d.ts +10 -0
  252. package/dist/services/keypairs/keypairs.types.d.ts.map +1 -0
  253. package/dist/services/keypairs/keypairs.types.js +2 -0
  254. package/dist/services/keypairs/keypairs.types.js.map +1 -0
  255. package/dist/services/keypairs/secp256k1.service.d.ts +24 -0
  256. package/dist/services/keypairs/secp256k1.service.d.ts.map +1 -0
  257. package/dist/services/keypairs/secp256k1.service.js +101 -0
  258. package/dist/services/keypairs/secp256k1.service.js.map +1 -0
  259. package/dist/services/keypairs/secp256r1.service.d.ts +24 -0
  260. package/dist/services/keypairs/secp256r1.service.d.ts.map +1 -0
  261. package/dist/services/keypairs/secp256r1.service.js +101 -0
  262. package/dist/services/keypairs/secp256r1.service.js.map +1 -0
  263. package/dist/services/ledgers/index.d.ts +2 -0
  264. package/dist/services/ledgers/index.d.ts.map +1 -0
  265. package/dist/services/ledgers/index.js +2 -0
  266. package/dist/services/ledgers/index.js.map +1 -0
  267. package/dist/services/ledgers/ledgers.types.d.ts +13 -0
  268. package/dist/services/ledgers/ledgers.types.d.ts.map +1 -0
  269. package/dist/services/ledgers/ledgers.types.js +2 -0
  270. package/dist/services/ledgers/ledgers.types.js.map +1 -0
  271. package/dist/services/policies/index.d.ts +2 -0
  272. package/dist/services/policies/index.d.ts.map +1 -0
  273. package/dist/services/policies/index.js +2 -0
  274. package/dist/services/policies/index.js.map +1 -0
  275. package/dist/services/policies/policies.types.d.ts +13 -0
  276. package/dist/services/policies/policies.types.d.ts.map +1 -0
  277. package/dist/services/policies/policies.types.js +2 -0
  278. package/dist/services/policies/policies.types.js.map +1 -0
  279. package/dist/services/requests/index.d.ts +2 -0
  280. package/dist/services/requests/index.d.ts.map +1 -0
  281. package/dist/services/requests/index.js +2 -0
  282. package/dist/services/requests/index.js.map +1 -0
  283. package/dist/services/requests/requests.types.d.ts +8 -0
  284. package/dist/services/requests/requests.types.d.ts.map +1 -0
  285. package/dist/services/requests/requests.types.js +2 -0
  286. package/dist/services/requests/requests.types.js.map +1 -0
  287. package/dist/services/tickers/index.d.ts +2 -0
  288. package/dist/services/tickers/index.d.ts.map +1 -0
  289. package/dist/services/tickers/index.js +2 -0
  290. package/dist/services/tickers/index.js.map +1 -0
  291. package/dist/services/tickers/tickers.types.d.ts +6 -0
  292. package/dist/services/tickers/tickers.types.d.ts.map +1 -0
  293. package/dist/services/tickers/tickers.types.js +2 -0
  294. package/dist/services/tickers/tickers.types.js.map +1 -0
  295. package/dist/services/transactions/index.d.ts +2 -0
  296. package/dist/services/transactions/index.d.ts.map +1 -0
  297. package/dist/services/transactions/index.js +2 -0
  298. package/dist/services/transactions/index.js.map +1 -0
  299. package/dist/services/transactions/transactions.types.d.ts +21 -0
  300. package/dist/services/transactions/transactions.types.d.ts.map +1 -0
  301. package/dist/services/transactions/transactions.types.js +2 -0
  302. package/dist/services/transactions/transactions.types.js.map +1 -0
  303. package/dist/services/user-invitations/index.d.ts +2 -0
  304. package/dist/services/user-invitations/index.d.ts.map +1 -0
  305. package/dist/services/user-invitations/index.js +2 -0
  306. package/dist/services/user-invitations/index.js.map +1 -0
  307. package/dist/services/user-invitations/user-invitations.types.d.ts +15 -0
  308. package/dist/services/user-invitations/user-invitations.types.d.ts.map +1 -0
  309. package/dist/services/user-invitations/user-invitations.types.js +2 -0
  310. package/dist/services/user-invitations/user-invitations.types.js.map +1 -0
  311. package/dist/services/users/index.d.ts +2 -0
  312. package/dist/services/users/index.d.ts.map +1 -0
  313. package/dist/services/users/index.js +2 -0
  314. package/dist/services/users/index.js.map +1 -0
  315. package/dist/services/users/users.types.d.ts +10 -0
  316. package/dist/services/users/users.types.d.ts.map +1 -0
  317. package/dist/services/users/users.types.js +2 -0
  318. package/dist/services/users/users.types.js.map +1 -0
  319. package/dist/services/vaults/index.d.ts +2 -0
  320. package/dist/services/vaults/index.d.ts.map +1 -0
  321. package/dist/services/vaults/index.js +2 -0
  322. package/dist/services/vaults/index.js.map +1 -0
  323. package/dist/services/vaults/vaults.types.d.ts +14 -0
  324. package/dist/services/vaults/vaults.types.d.ts.map +1 -0
  325. package/dist/services/vaults/vaults.types.js +2 -0
  326. package/dist/services/vaults/vaults.types.js.map +1 -0
  327. package/dist/services/xrpl/index.d.ts +5 -0
  328. package/dist/services/xrpl/index.d.ts.map +1 -0
  329. package/dist/services/xrpl/index.js +8 -0
  330. package/dist/services/xrpl/index.js.map +1 -0
  331. package/dist/services/xrpl/xrpl.adapters.d.ts +13 -0
  332. package/dist/services/xrpl/xrpl.adapters.d.ts.map +1 -0
  333. package/dist/services/xrpl/xrpl.adapters.js +288 -0
  334. package/dist/services/xrpl/xrpl.adapters.js.map +1 -0
  335. package/dist/services/xrpl/xrpl.http-adapters.d.ts +14 -0
  336. package/dist/services/xrpl/xrpl.http-adapters.d.ts.map +1 -0
  337. package/dist/services/xrpl/xrpl.http-adapters.js +83 -0
  338. package/dist/services/xrpl/xrpl.http-adapters.js.map +1 -0
  339. package/dist/services/xrpl/xrpl.ports.d.ts +36 -0
  340. package/dist/services/xrpl/xrpl.ports.d.ts.map +1 -0
  341. package/dist/services/xrpl/xrpl.ports.js +2 -0
  342. package/dist/services/xrpl/xrpl.ports.js.map +1 -0
  343. package/dist/services/xrpl/xrpl.service.d.ts +124 -0
  344. package/dist/services/xrpl/xrpl.service.d.ts.map +1 -0
  345. package/dist/services/xrpl/xrpl.service.js +370 -0
  346. package/dist/services/xrpl/xrpl.service.js.map +1 -0
  347. package/dist/services/xrpl/xrpl.types.d.ts +131 -0
  348. package/dist/services/xrpl/xrpl.types.d.ts.map +1 -0
  349. package/dist/services/xrpl/xrpl.types.js +30 -0
  350. package/dist/services/xrpl/xrpl.types.js.map +1 -0
  351. package/dist/transport/index.d.ts +4 -0
  352. package/dist/transport/index.d.ts.map +1 -0
  353. package/dist/transport/index.js +3 -0
  354. package/dist/transport/index.js.map +1 -0
  355. package/dist/transport/split-params.d.ts +14 -0
  356. package/dist/transport/split-params.d.ts.map +1 -0
  357. package/dist/transport/split-params.js +28 -0
  358. package/dist/transport/split-params.js.map +1 -0
  359. package/dist/transport/transport.types.d.ts +11 -0
  360. package/dist/transport/transport.types.d.ts.map +1 -0
  361. package/dist/transport/transport.types.js +2 -0
  362. package/dist/transport/transport.types.js.map +1 -0
  363. package/dist/transport/typed-transport.d.ts +38 -0
  364. package/dist/transport/typed-transport.d.ts.map +1 -0
  365. package/dist/transport/typed-transport.js +78 -0
  366. package/dist/transport/typed-transport.js.map +1 -0
  367. package/dist/type-utils/index.d.ts +4 -0
  368. package/dist/type-utils/index.d.ts.map +1 -0
  369. package/dist/type-utils/index.js +4 -0
  370. package/dist/type-utils/index.js.map +1 -0
  371. package/dist/type-utils/optional-except-for.d.ts +2 -0
  372. package/dist/type-utils/optional-except-for.d.ts.map +1 -0
  373. package/dist/type-utils/optional-except-for.js +2 -0
  374. package/dist/type-utils/optional-except-for.js.map +1 -0
  375. package/dist/type-utils/prettify.d.ts +4 -0
  376. package/dist/type-utils/prettify.d.ts.map +1 -0
  377. package/dist/type-utils/prettify.js +2 -0
  378. package/dist/type-utils/prettify.js.map +1 -0
  379. package/dist/type-utils/required-except-for.d.ts +2 -0
  380. package/dist/type-utils/required-except-for.d.ts.map +1 -0
  381. package/dist/type-utils/required-except-for.js +2 -0
  382. package/dist/type-utils/required-except-for.js.map +1 -0
  383. package/package.json +72 -0
package/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Florent Uzio
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
12
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
13
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
14
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
15
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,280 @@
1
+ # Custody.js
2
+
3
+ A comprehensive JavaScript/Typescript SDK for interacting with the Ripple Custody API. This SDK provides a clean, type-safe interface for managing domains, intents, accounts, transactions, and cryptographic operations.
4
+
5
+ > **Do not use this SDK in production.** This is personal code that may contain bugs and is not regularly maintained. Fork it and update it as you wish.
6
+
7
+ ## Features
8
+
9
+ - **Cryptographic Support**: Ed25519, secp256k1, secp256r1 keypair generation and signing
10
+ - **Domain Management**: List and retrieve domain information
11
+ - **Endpoint Management**: List and retrieve endpoints within a domain
12
+ - **Intent Operations**: Propose, approve, reject, and manage intents with built-in polling
13
+ - **Account Management**: Manage accounts, addresses, and balances
14
+ - **Transaction Operations**: Handle transaction orders, transfers, and dry runs
15
+ - **User & Invitation Management**: Manage users, roles, and invitations
16
+ - **Vault Operations**: Export and import prepared operations
17
+ - **Type Safety**: Full TypeScript support with types derived from the OpenAPI specification
18
+ - **Ledger ID Autocomplete**: `LedgerId`, `XrplLedgerId`, and `NonXrplLedgerId` exports give IDE autocomplete for the supported ledgers (e.g. `"ethereum"`, `"xrpl"`, `"solana"`, …) while still accepting any string — so newly added ledgers never break the SDK
19
+ - **XRPL Intent Proposal**: Single `proposeIntent()` method for all XRPL transaction types (Payment, TrustSet, DepositPreauth, Clawback, OfferCreate, AccountSet, TicketCreate, Batch, MPToken operations) using a type-safe discriminated union
20
+ - **Raw Signing**: Sign arbitrary XRPL transactions and Batch inner transactions via Custody
21
+
22
+ ## Architecture
23
+
24
+ The SDK is built around a few key layers:
25
+
26
+ - **`TypedTransport`** — wraps the HTTP client with automatic URL template interpolation and path/query parameter splitting.
27
+ - **Namespace factories** (`createDomains`, `createAccounts`, etc.) — return plain objects that map method names to typed transport calls. Each factory is a thin, stateless function.
28
+ - **`RippleCustody`** — the public client class that assembles all namespaces in its constructor. Consumers interact exclusively through `client.domains.list()`, `client.accounts.get()`, etc.
29
+ - **`XrplService`** — builds XRPL transaction intents via a single `proposeIntent()` entry point, handles domain/account resolution through injected I/O ports (`XrplPorts`), and supports raw signing with manifest polling.
30
+
31
+ ## Installation
32
+
33
+ ### From npm
34
+
35
+ ```bash
36
+ npm install @florent-uzio/custody
37
+ ```
38
+
39
+ ### From GitHub
40
+
41
+ Alternatively, install directly from the GitHub repository:
42
+
43
+ ```bash
44
+ npm install github:florent-uzio/custody.js
45
+ ```
46
+
47
+ ## Quick Start
48
+
49
+ ### 1. Generate Keypairs
50
+
51
+ First, you'll need to generate cryptographic keypairs for authentication and signing:
52
+
53
+ ```typescript
54
+ import { KeypairService } from "@florent-uzio/custody"
55
+
56
+ // Generate Ed25519 keypair
57
+ const ed25519Service = new KeypairService("ed25519")
58
+ const ed25519Keypair = ed25519Service.generate()
59
+
60
+ console.log("Ed25519 Private Key:", ed25519Keypair.privateKey)
61
+ console.log("Ed25519 Public Key:", ed25519Keypair.publicKey)
62
+
63
+ // Generate secp256k1 keypair
64
+ const secp256k1Service = new KeypairService("secp256k1")
65
+ const secp256k1Keypair = secp256k1Service.generate()
66
+
67
+ // Generate secp256r1 keypair
68
+ const secp256r1Service = new KeypairService("secp256r1")
69
+ const secp256r1Keypair = secp256r1Service.generate()
70
+ ```
71
+
72
+ Use those keypairs in Ripple Custody when setting up your API user.
73
+ Use a `.env` file to store your public and private key.
74
+
75
+ **Note**: The SDK supports Ed25519, secp256k1, and secp256r1 algorithms.
76
+
77
+ ### 2. Initialize the RippleCustody Client
78
+
79
+ ```typescript
80
+ import { RippleCustody } from "@florent-uzio/custody"
81
+
82
+ const custody = new RippleCustody({
83
+ apiUrl: "https://api.ripple.com",
84
+ authUrl: "https://auth.api.ripple.com/token",
85
+ privateKey: ed25519Keypair.privateKey, // Your private key in PEM format
86
+ publicKey: ed25519Keypair.publicKey, // Your public key in base64 format
87
+ })
88
+ ```
89
+
90
+ ### 3. Use the SDK
91
+
92
+ The SDK provides a namespaced API for easy discovery and usage:
93
+
94
+ ```typescript
95
+ // Domain Operations
96
+ const domains = await custody.domains.list()
97
+ const domain = await custody.domains.get({ domainId: "your-domain-id" })
98
+
99
+ // Endpoint Operations
100
+ const endpoints = await custody.endpoints.list(
101
+ { domainId: "domain-id" },
102
+ { limit: 10, sortBy: "alias" },
103
+ )
104
+ const endpoint = await custody.endpoints.get({
105
+ domainId: "domain-id",
106
+ endpointId: "endpoint-id",
107
+ })
108
+
109
+ // Intent Operations
110
+ const intent = await custody.intents.propose({
111
+ request: {
112
+ author: { id: "user-id", domainId: "domain-id" },
113
+ type: "Propose",
114
+ // ... other intent parameters
115
+ },
116
+ // signature is optional — the SDK auto-signs if not provided
117
+ })
118
+
119
+ await custody.intents.approve({
120
+ request: {
121
+ author: { id: "user-id", domainId: "domain-id" },
122
+ type: "Approve",
123
+ // ... approval parameters
124
+ },
125
+ })
126
+
127
+ // Poll an intent until it reaches a terminal status
128
+ const result = await custody.intents.getAndWait(
129
+ { domainId: "domain-id", intentId: "intent-id" },
130
+ {
131
+ maxRetries: 20,
132
+ intervalMs: 3000,
133
+ onStatusCheck: (status, attempt) => console.log(`Attempt ${attempt}: ${status}`),
134
+ },
135
+ )
136
+
137
+ if (result.isSuccess) {
138
+ console.log("Intent executed successfully!")
139
+ }
140
+
141
+ // Account Operations
142
+ const accounts = await custody.accounts.list({ domainId: "domain-id" }, { limit: 10 })
143
+ const account = await custody.accounts.get({ domainId: "domain-id", accountId: "account-id" })
144
+ const balances = await custody.accounts.getAccountBalances({
145
+ domainId: "domain-id",
146
+ accountId: "account-id",
147
+ })
148
+ const newAddress = await custody.accounts.generateNewExternalAddress({
149
+ domainId: "domain-id",
150
+ accountId: "account-id",
151
+ ledgerId: "ledger-id",
152
+ })
153
+
154
+ // Find an account by its blockchain address (searches across all domains).
155
+ // Returns the full address reference, or undefined if not found.
156
+ // Use the options bag to disambiguate when the same address exists on
157
+ // multiple ledgers or in multiple domains.
158
+ const ref = await custody.accounts.findByAddress("rAddress...")
159
+ const refOnLedger = await custody.accounts.findByAddress("rAddress...", {
160
+ ledgerId: "xrpl",
161
+ })
162
+ const refInDomain = await custody.accounts.findByAddress("rAddress...", {
163
+ domainId: "domain-id",
164
+ })
165
+ // `findByAddressOrThrow` throws a `CustodyError` instead of returning undefined.
166
+ const account = await custody.accounts.findByAddressOrThrow("rAddress...", {
167
+ ledgerId: "xrpl",
168
+ })
169
+
170
+ // Transaction Operations
171
+ const orders = await custody.transactions.orders({ domainId: "domain-id" }, { limit: 10 })
172
+ const transfers = await custody.transactions.transfers({ domainId: "domain-id" })
173
+ const dryRun = await custody.transactions.dryRun(
174
+ { domainId: "domain-id" },
175
+ {
176
+ /* params */
177
+ },
178
+ )
179
+
180
+ // User Operations
181
+ const me = await custody.users.me()
182
+ const users = await custody.users.list({ domainId: "domain-id" })
183
+
184
+ // Ledger Operations
185
+ const ledgers = await custody.ledgers.list()
186
+ const fees = await custody.ledgers.fees({ ledgerId: "ledger-id" })
187
+
188
+ // Vault Operations
189
+ const vaults = await custody.vaults.list()
190
+ const exported = await custody.vaults.exportPreparedOperations({ vaultId: "vault-id" })
191
+
192
+ // Request State
193
+ const states = await custody.requests.userStates()
194
+ ```
195
+
196
+ ## XRPL Service
197
+
198
+ The XRPL service provides a simplified, high-level API for creating XRPL transaction intents. Instead of manually building complex intent payloads, use `proposeIntent()` with a discriminated union — it handles user validation, domain resolution, and account lookup automatically.
199
+
200
+ ### Usage
201
+
202
+ ```typescript
203
+ // Propose any XRPL transaction — the `type` field selects the operation.
204
+ // TypeScript autocomplete shows available types and their fields.
205
+ await custody.xrpl.proposeIntent({
206
+ Account: "rSenderAddress...",
207
+ operation: {
208
+ type: "Payment",
209
+ destination: { address: "rDestAddress...", type: "Address" },
210
+ amount: "1000000",
211
+ },
212
+ })
213
+
214
+ // TrustSet
215
+ await custody.xrpl.proposeIntent({
216
+ Account: "rSenderAddress...",
217
+ operation: {
218
+ type: "TrustSet",
219
+ limitAmount: {
220
+ currency: { code: "USD", type: "Currency", issuer: "rIssuer..." },
221
+ value: "10000",
222
+ },
223
+ flags: [],
224
+ },
225
+ })
226
+
227
+ // Raw sign and wait for signature
228
+ const { signature, signingPubKey } = await custody.xrpl.rawSignAndWait(autofilledTx)
229
+ ```
230
+
231
+ ### Examples
232
+
233
+ See the [`examples/xrpl/`](./examples/xrpl/) directory for working code:
234
+
235
+ - [XRP Payment](./examples/xrpl/payment-xrp/)
236
+ - [MPToken Payment](./examples/xrpl/payment-mpt/)
237
+ - [TrustSet](./examples/xrpl/trustset/)
238
+ - [MPToken Issuance Create](./examples/xrpl/mpt/create/)
239
+ - [MPToken Authorize](./examples/xrpl/mpt/authorize/)
240
+
241
+ ### Options
242
+
243
+ `proposeIntent()` and the raw-sign methods accept an optional second parameter with these options:
244
+
245
+ | Option | Type | Default | Description |
246
+ | ------------------------- | ----------------------------- | ------- | ---------------------------------------------------------------------------------------------------- |
247
+ | `domainId` | `string` | - | Domain ID (required if user has multiple domains) |
248
+ | `ledgerId` | `XrplLedgerId` | - | XRPL ledger to use (`"xrpl"` or `"xrpl-testnet-august-2024"`) — required when the address spans both |
249
+ | `feePriority` | `"Low" \| "Medium" \| "High"` | `"Low"` | Transaction fee priority |
250
+ | `expiryDays` | `number` | `1` | Days until the intent expires |
251
+ | `requestCustomProperties` | `Record<string, string>` | `{}` | Custom metadata on the request |
252
+ | `payloadCustomProperties` | `Record<string, string>` | `{}` | Custom metadata on the payload |
253
+ | `requestId` | `string` | auto | Override the auto-generated request ID |
254
+ | `payloadId` | `string` | auto | Override the auto-generated payload ID |
255
+
256
+ ## Error Handling
257
+
258
+ The SDK throws `CustodyError` instances for all API errors:
259
+
260
+ ```typescript
261
+ import { CustodyError } from "@florent-uzio/custody"
262
+
263
+ try {
264
+ const domains = await custody.domains.list()
265
+ } catch (error) {
266
+ if (error instanceof CustodyError) {
267
+ console.log(error.message) // Main error reason
268
+ console.log(error.statusCode) // HTTP status code (e.g., 400, 404)
269
+ console.log(error.errorMessage) // Optional additional details from API
270
+ console.log(error.cause) // Original error for debugging
271
+ console.log(error.toJSON()) // Structured object for logging/serialization
272
+ }
273
+ }
274
+ ```
275
+
276
+ `console.log(error)` outputs a clean, readable format. Access `error.cause` for full debugging details.
277
+
278
+ ## License
279
+
280
+ MIT License - see [LICENSE](./LICENSE) file for details.
@@ -0,0 +1,3 @@
1
+ /** Default request timeout in milliseconds (30 seconds) */
2
+ export declare const DEFAULT_TIMEOUT_MS = 30000;
3
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/constants/defaults.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,eAAO,MAAM,kBAAkB,QAAS,CAAA"}
@@ -0,0 +1,3 @@
1
+ /** Default request timeout in milliseconds (30 seconds) */
2
+ export const DEFAULT_TIMEOUT_MS = 30_000;
3
+ //# sourceMappingURL=defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/constants/defaults.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from "./defaults.js";
2
+ export * from "./urls.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from "./defaults.js";
2
+ export * from "./urls.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA"}
@@ -0,0 +1,86 @@
1
+ import type { paths } from "../models/custody-types.js";
2
+ export type PathKeys = keyof paths;
3
+ export declare const URLs: {
4
+ readonly domains: "/v1/domains";
5
+ readonly domain: "/v1/domains/{domainId}";
6
+ readonly users: "/v1/domains/{domainId}/users";
7
+ readonly userRoles: "/v1/domains/{domainId}/users/roles";
8
+ readonly user: "/v1/domains/{domainId}/users/{userId}";
9
+ readonly me: "/v1/me";
10
+ readonly meRequests: "/v1/me/requests";
11
+ readonly intents: "/v1/intents";
12
+ readonly intentsApprove: "/v1/intents/approve";
13
+ readonly intentsReject: "/v1/intents/reject";
14
+ readonly intentsDryRun: "/v1/intents/dry-run";
15
+ readonly domainIntents: "/v1/domains/{domainId}/intents";
16
+ readonly getIntent: "/v1/domains/{domainId}/intents/{intentId}";
17
+ readonly intentRemainingUsers: "/v1/domains/{domainId}/intents/{intentId}/remaining-users";
18
+ readonly vaults: "/v1/vaults";
19
+ readonly vault: "/v1/vaults/{vaultId}";
20
+ readonly vaultOperationsPrepared: "/v1/vaults/{vaultId}/operations/prepared";
21
+ readonly vaultOperationsSigned: "/v1/vaults/operations/signed";
22
+ readonly policies: "/v1/domains/{domainId}/policies";
23
+ readonly policy: "/v1/domains/{domainId}/policies/{policyId}";
24
+ readonly accounts: "/v1/domains/{domainId}/accounts";
25
+ readonly account: "/v1/domains/{domainId}/accounts/{accountId}";
26
+ readonly accountAddresses: "/v1/domains/{domainId}/accounts/{accountId}/addresses";
27
+ readonly accountAddressesByLedger: "/v1/domains/{domainId}/accounts/{accountId}/addresses/{ledgerId}";
28
+ readonly accountAddressesLatest: "/v1/domains/{domainId}/accounts/{accountId}/addresses/latest";
29
+ readonly accountAddress: "/v1/domains/{domainId}/accounts/{accountId}/addresses/{accountAddressId}";
30
+ readonly accountConfirmedBalance: "/v1/domains/{domainId}/accounts/{accountId}/confirmed-balance/{tickerId}";
31
+ readonly accountBalances: "/v1/domains/{domainId}/accounts/{accountId}/balances";
32
+ readonly accountBalancesRefresh: "/v1/domains/{domainId}/accounts/{accountId}/balances/refresh";
33
+ readonly accountManifests: "/v1/domains/{domainId}/accounts/{accountId}/manifests";
34
+ readonly accountManifest: "/v1/domains/{domainId}/accounts/{accountId}/manifests/{manifestId}";
35
+ readonly accountComplianceConfiguration: "/v1/domains/{domainId}/accounts/{accountId}/compliance-configuration";
36
+ readonly complianceConfigurations: "/v1/domains/{domainId}/compliance-configurations";
37
+ readonly addresses: "/v1/addresses";
38
+ readonly endpoints: "/v1/domains/{domainId}/endpoints";
39
+ readonly endpoint: "/v1/domains/{domainId}/endpoints/{endpointId}";
40
+ readonly transactionOrders: "/v1/domains/{domainId}/transactions/orders";
41
+ readonly transactionOrder: "/v1/domains/{domainId}/transactions/orders/{transactionOrderId}";
42
+ readonly transactionTransfers: "/v1/domains/{domainId}/transactions/transfers";
43
+ readonly transactionTransfer: "/v1/domains/{domainId}/transactions/transfers/{transferId}";
44
+ readonly transactions: "/v1/domains/{domainId}/transactions";
45
+ readonly transaction: "/v1/domains/{domainId}/transactions/{transactionId}";
46
+ readonly transactionsDryRun: "/v1/domains/{domainId}/transactions/dry-run";
47
+ readonly tickers: "/v1/tickers";
48
+ readonly ticker: "/v1/tickers/{tickerId}";
49
+ readonly ledgers: "/v1/ledgers";
50
+ readonly ledger: "/v1/ledgers/{ledgerId}";
51
+ readonly ledgerFees: "/v1/ledgers/{ledgerId}/fees";
52
+ readonly ledgerEthereumCall: "/v1/ledgers/{ledgerId}/ethereum/call";
53
+ readonly trustedLedgers: "/v1/trusted-ledgers";
54
+ readonly trustedLedger: "/v1/trusted-ledgers/{ledgerId}";
55
+ readonly requests: "/v1/domains/{domainId}/requests";
56
+ readonly request: "/v1/domains/{domainId}/requests/{requestId}";
57
+ readonly trustedPublicKeysCollection: "/v1/trusted-public-keys/trusted-collection";
58
+ readonly trustedPublicKeysApi: "/v1/trusted-public-keys/api";
59
+ readonly trustedPublicKeysMessages: "/v1/trusted-public-keys/messages";
60
+ readonly events: "/v1/domains/{domainId}/events";
61
+ readonly properties: "/v1/properties";
62
+ readonly userInvitations: "/v1/domains/{domainId}/users/invitations";
63
+ readonly userInvitation: "/v1/domains/{domainId}/users/invitations/{id}";
64
+ readonly userInvitationCancel: "/v1/domains/{domainId}/users/invitations/{id}/cancel";
65
+ readonly userInvitationRenew: "/v1/domains/{domainId}/users/invitations/{id}/renew";
66
+ readonly userInvitationComplete: "/v1/domains/{domainId}/users/invitations/{id}/complete";
67
+ readonly publicUserInvitation: "/v1/users/invitations/{idOrCode}";
68
+ readonly virtualLedgers: "/v1/domains/{domainId}/virtual-ledgers";
69
+ readonly virtualLedger: "/v1/domains/{domainId}/virtual-ledgers/{virtualLedgerId}";
70
+ readonly virtualLedgerBalances: "/v1/domains/{domainId}/virtual-ledgers/{virtualLedgerId}/balances";
71
+ readonly virtualLedgerAccounts: "/v1/domains/{domainId}/virtual-ledgers/{virtualLedgerId}/accounts";
72
+ readonly virtualLedgerAccount: "/v1/domains/{domainId}/virtual-ledgers/{virtualLedgerId}/accounts/{accountId}";
73
+ readonly virtualLedgerAccountBalances: "/v1/domains/{domainId}/virtual-ledgers/{virtualLedgerId}/accounts/{accountId}/balances";
74
+ readonly virtualLedgerAccountDepositIdentificationSources: "/v1/domains/{domainId}/virtual-ledgers/{virtualLedgerId}/accounts/{accountId}/deposit-identification-sources";
75
+ readonly virtualLedgerAccountAddresses: "/v1/domains/{domainId}/virtual-ledgers/{virtualLedgerId}/accounts/{accountId}/addresses";
76
+ readonly virtualLedgerOperations: "/v1/domains/{domainId}/virtual-ledgers/{virtualLedgerId}/operations";
77
+ readonly virtualLedgerTransfers: "/v1/domains/{domainId}/virtual-ledgers/{virtualLedgerId}/transfers";
78
+ readonly channels: "/v1/domains/{domainId}/channels";
79
+ readonly channel: "/v1/domains/{domainId}/channels/{channelId}";
80
+ readonly channelTest: "/v1/domains/{domainId}/channels/{channelId}/test";
81
+ readonly channelEvents: "/v1/domains/{domainId}/channels/{channelId}/events";
82
+ readonly channelEvent: "/v1/domains/{domainId}/channels/{channelId}/events/{eventId}";
83
+ readonly channelsEvents: "/v1/domains/{domainId}/channels/events";
84
+ readonly genesis: "/v1/genesis";
85
+ };
86
+ //# sourceMappingURL=urls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urls.d.ts","sourceRoot":"","sources":["../../src/constants/urls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAGvD,MAAM,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAA;AAOlC,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6HN,CAAA"}
@@ -0,0 +1,109 @@
1
+ // Helper function to ensure URLs are valid paths
2
+ function createURLs(urls) {
3
+ return urls;
4
+ }
5
+ export const URLs = createURLs({
6
+ // Domains
7
+ domains: "/v1/domains",
8
+ domain: "/v1/domains/{domainId}",
9
+ // Users
10
+ users: "/v1/domains/{domainId}/users",
11
+ userRoles: "/v1/domains/{domainId}/users/roles",
12
+ user: "/v1/domains/{domainId}/users/{userId}",
13
+ me: "/v1/me",
14
+ meRequests: "/v1/me/requests",
15
+ // Intents
16
+ intents: "/v1/intents",
17
+ intentsApprove: "/v1/intents/approve",
18
+ intentsReject: "/v1/intents/reject",
19
+ intentsDryRun: "/v1/intents/dry-run",
20
+ domainIntents: "/v1/domains/{domainId}/intents",
21
+ getIntent: "/v1/domains/{domainId}/intents/{intentId}",
22
+ intentRemainingUsers: "/v1/domains/{domainId}/intents/{intentId}/remaining-users",
23
+ // Vaults
24
+ vaults: "/v1/vaults",
25
+ vault: "/v1/vaults/{vaultId}",
26
+ vaultOperationsPrepared: "/v1/vaults/{vaultId}/operations/prepared",
27
+ vaultOperationsSigned: "/v1/vaults/operations/signed",
28
+ // Policies
29
+ policies: "/v1/domains/{domainId}/policies",
30
+ policy: "/v1/domains/{domainId}/policies/{policyId}",
31
+ // Accounts
32
+ accounts: "/v1/domains/{domainId}/accounts",
33
+ account: "/v1/domains/{domainId}/accounts/{accountId}",
34
+ accountAddresses: "/v1/domains/{domainId}/accounts/{accountId}/addresses",
35
+ accountAddressesByLedger: "/v1/domains/{domainId}/accounts/{accountId}/addresses/{ledgerId}",
36
+ accountAddressesLatest: "/v1/domains/{domainId}/accounts/{accountId}/addresses/latest",
37
+ accountAddress: "/v1/domains/{domainId}/accounts/{accountId}/addresses/{accountAddressId}",
38
+ accountConfirmedBalance: "/v1/domains/{domainId}/accounts/{accountId}/confirmed-balance/{tickerId}",
39
+ accountBalances: "/v1/domains/{domainId}/accounts/{accountId}/balances",
40
+ accountBalancesRefresh: "/v1/domains/{domainId}/accounts/{accountId}/balances/refresh",
41
+ accountManifests: "/v1/domains/{domainId}/accounts/{accountId}/manifests",
42
+ accountManifest: "/v1/domains/{domainId}/accounts/{accountId}/manifests/{manifestId}",
43
+ accountComplianceConfiguration: "/v1/domains/{domainId}/accounts/{accountId}/compliance-configuration",
44
+ complianceConfigurations: "/v1/domains/{domainId}/compliance-configurations",
45
+ // Addresses
46
+ addresses: "/v1/addresses",
47
+ // Endpoints
48
+ endpoints: "/v1/domains/{domainId}/endpoints",
49
+ endpoint: "/v1/domains/{domainId}/endpoints/{endpointId}",
50
+ // Transactions
51
+ transactionOrders: "/v1/domains/{domainId}/transactions/orders",
52
+ transactionOrder: "/v1/domains/{domainId}/transactions/orders/{transactionOrderId}",
53
+ transactionTransfers: "/v1/domains/{domainId}/transactions/transfers",
54
+ transactionTransfer: "/v1/domains/{domainId}/transactions/transfers/{transferId}",
55
+ transactions: "/v1/domains/{domainId}/transactions",
56
+ transaction: "/v1/domains/{domainId}/transactions/{transactionId}",
57
+ transactionsDryRun: "/v1/domains/{domainId}/transactions/dry-run",
58
+ // Tickers
59
+ tickers: "/v1/tickers",
60
+ ticker: "/v1/tickers/{tickerId}",
61
+ // Ledgers
62
+ ledgers: "/v1/ledgers",
63
+ ledger: "/v1/ledgers/{ledgerId}",
64
+ ledgerFees: "/v1/ledgers/{ledgerId}/fees",
65
+ ledgerEthereumCall: "/v1/ledgers/{ledgerId}/ethereum/call",
66
+ trustedLedgers: "/v1/trusted-ledgers",
67
+ trustedLedger: "/v1/trusted-ledgers/{ledgerId}",
68
+ // Requests
69
+ requests: "/v1/domains/{domainId}/requests",
70
+ request: "/v1/domains/{domainId}/requests/{requestId}",
71
+ // Trusted Public Keys
72
+ trustedPublicKeysCollection: "/v1/trusted-public-keys/trusted-collection",
73
+ trustedPublicKeysApi: "/v1/trusted-public-keys/api",
74
+ trustedPublicKeysMessages: "/v1/trusted-public-keys/messages",
75
+ // Events
76
+ events: "/v1/domains/{domainId}/events",
77
+ // Properties
78
+ properties: "/v1/properties",
79
+ // User Invitations
80
+ userInvitations: "/v1/domains/{domainId}/users/invitations",
81
+ userInvitation: "/v1/domains/{domainId}/users/invitations/{id}",
82
+ userInvitationCancel: "/v1/domains/{domainId}/users/invitations/{id}/cancel",
83
+ userInvitationRenew: "/v1/domains/{domainId}/users/invitations/{id}/renew",
84
+ userInvitationComplete: "/v1/domains/{domainId}/users/invitations/{id}/complete",
85
+ publicUserInvitation: "/v1/users/invitations/{idOrCode}",
86
+ // Virtual Ledgers
87
+ virtualLedgers: "/v1/domains/{domainId}/virtual-ledgers",
88
+ virtualLedger: "/v1/domains/{domainId}/virtual-ledgers/{virtualLedgerId}",
89
+ virtualLedgerBalances: "/v1/domains/{domainId}/virtual-ledgers/{virtualLedgerId}/balances",
90
+ virtualLedgerAccounts: "/v1/domains/{domainId}/virtual-ledgers/{virtualLedgerId}/accounts",
91
+ virtualLedgerAccount: "/v1/domains/{domainId}/virtual-ledgers/{virtualLedgerId}/accounts/{accountId}",
92
+ virtualLedgerAccountBalances: "/v1/domains/{domainId}/virtual-ledgers/{virtualLedgerId}/accounts/{accountId}/balances",
93
+ virtualLedgerAccountDepositIdentificationSources: "/v1/domains/{domainId}/virtual-ledgers/{virtualLedgerId}/accounts/{accountId}/deposit-identification-sources",
94
+ virtualLedgerAccountAddresses: "/v1/domains/{domainId}/virtual-ledgers/{virtualLedgerId}/accounts/{accountId}/addresses",
95
+ virtualLedgerOperations: "/v1/domains/{domainId}/virtual-ledgers/{virtualLedgerId}/operations",
96
+ virtualLedgerTransfers: "/v1/domains/{domainId}/virtual-ledgers/{virtualLedgerId}/transfers",
97
+ // Channels
98
+ channels: "/v1/domains/{domainId}/channels",
99
+ channel: "/v1/domains/{domainId}/channels/{channelId}",
100
+ channelTest: "/v1/domains/{domainId}/channels/{channelId}/test",
101
+ channelEvents: "/v1/domains/{domainId}/channels/{channelId}/events",
102
+ channelEvent: "/v1/domains/{domainId}/channels/{channelId}/events/{eventId}",
103
+ channelsEvents: "/v1/domains/{domainId}/channels/events",
104
+ // Genesis
105
+ genesis: "/v1/genesis",
106
+ });
107
+ // Type for the URLs object that ensures all values are valid paths
108
+ // export type URLs = typeof URLs
109
+ //# sourceMappingURL=urls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urls.js","sourceRoot":"","sources":["../../src/constants/urls.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Returns a promise that resolves after the specified time.
3
+ * @param ms - The number of milliseconds to wait
4
+ */
5
+ export declare const sleep: (ms: number) => Promise<void>;
6
+ //# sourceMappingURL=async.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../../src/helpers/async/async.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,IAAI,MAAM,KAAG,OAAO,CAAC,IAAI,CACI,CAAA"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Returns a promise that resolves after the specified time.
3
+ * @param ms - The number of milliseconds to wait
4
+ */
5
+ export const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
6
+ //# sourceMappingURL=async.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"async.js","sourceRoot":"","sources":["../../../src/helpers/async/async.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAAU,EAAiB,EAAE,CACjD,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from "./async.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/async/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from "./async.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/async/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
@@ -0,0 +1,4 @@
1
+ export * from "./async/index.js";
2
+ export * from "./typeof-fns/index.js";
3
+ export * from "./url/index.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1,4 @@
1
+ export * from "./async/index.js";
2
+ export * from "./typeof-fns/index.js";
3
+ export * from "./url/index.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from "./typeof-fns.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/typeof-fns/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from "./typeof-fns.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/typeof-fns/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
@@ -0,0 +1,18 @@
1
+ /** Determines if a value is a function type. */
2
+ export declare const isFunction: (thing: unknown) => thing is (...args: unknown[]) => unknown;
3
+ /** Determines if a value is a numeric type (int or float). */
4
+ export declare const isNumber: (thing: unknown) => thing is number;
5
+ /** Determins if a value is string type. */
6
+ export declare const isString: (thing: unknown) => thing is string;
7
+ /** Determines if a value is the special type `undefined`. */
8
+ export declare const isUndefined: (thing: unknown) => thing is undefined;
9
+ /** Determines if a value is an object (excluding arrays and functions). */
10
+ export declare const isObject: <T = Record<string, any>>(thing: unknown) => thing is T;
11
+ /** Determines if a value is boolean type. */
12
+ export declare const isBoolean: (thing: unknown) => thing is boolean;
13
+ export declare const isDate: (thing: unknown) => thing is Date;
14
+ /** Determines if a value is a UUID. */
15
+ export declare const isUUID: (str: string) => boolean;
16
+ /** Determines if a value is a stringified object. */
17
+ export declare const isStringifiedObject: (str: unknown) => boolean;
18
+ //# sourceMappingURL=typeof-fns.d.ts.map