@bitgen/sdk 0.1.6 → 1.0.3

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 (328) hide show
  1. package/CHANGELOG.md +55 -2
  2. package/README.md +27 -106
  3. package/dist/cjs/client.d.ts +20 -8
  4. package/dist/cjs/client.d.ts.map +1 -1
  5. package/dist/cjs/client.js +33 -12
  6. package/dist/cjs/client.js.map +1 -1
  7. package/dist/cjs/constants.d.ts +256 -0
  8. package/dist/cjs/constants.d.ts.map +1 -0
  9. package/dist/cjs/constants.js +214 -0
  10. package/dist/cjs/constants.js.map +1 -0
  11. package/dist/cjs/error.d.ts +17 -10
  12. package/dist/cjs/error.d.ts.map +1 -1
  13. package/dist/cjs/error.js +25 -7
  14. package/dist/cjs/error.js.map +1 -1
  15. package/dist/cjs/http.d.ts +13 -8
  16. package/dist/cjs/http.d.ts.map +1 -1
  17. package/dist/cjs/http.js +135 -44
  18. package/dist/cjs/http.js.map +1 -1
  19. package/dist/cjs/index.d.ts +14 -1
  20. package/dist/cjs/index.d.ts.map +1 -1
  21. package/dist/cjs/index.js +30 -1
  22. package/dist/cjs/index.js.map +1 -1
  23. package/dist/cjs/resources/apikeys.d.ts +18 -0
  24. package/dist/cjs/resources/apikeys.d.ts.map +1 -0
  25. package/dist/cjs/resources/apikeys.js +31 -0
  26. package/dist/cjs/resources/apikeys.js.map +1 -0
  27. package/dist/cjs/resources/asset.d.ts +17 -5
  28. package/dist/cjs/resources/asset.d.ts.map +1 -1
  29. package/dist/cjs/resources/asset.js +17 -6
  30. package/dist/cjs/resources/asset.js.map +1 -1
  31. package/dist/cjs/resources/bank.d.ts +11 -6
  32. package/dist/cjs/resources/bank.d.ts.map +1 -1
  33. package/dist/cjs/resources/bank.js +17 -9
  34. package/dist/cjs/resources/bank.js.map +1 -1
  35. package/dist/cjs/resources/core.d.ts +12 -0
  36. package/dist/cjs/resources/core.d.ts.map +1 -0
  37. package/dist/cjs/resources/core.js +22 -0
  38. package/dist/cjs/resources/core.js.map +1 -0
  39. package/dist/cjs/resources/custody.d.ts +27 -0
  40. package/dist/cjs/resources/custody.d.ts.map +1 -0
  41. package/dist/cjs/resources/custody.js +38 -0
  42. package/dist/cjs/resources/custody.js.map +1 -0
  43. package/dist/cjs/resources/customer.d.ts +20 -0
  44. package/dist/cjs/resources/customer.d.ts.map +1 -0
  45. package/dist/cjs/resources/customer.js +38 -0
  46. package/dist/cjs/resources/customer.js.map +1 -0
  47. package/dist/cjs/resources/staking.d.ts +32 -0
  48. package/dist/cjs/resources/staking.d.ts.map +1 -0
  49. package/dist/cjs/resources/staking.js +69 -0
  50. package/dist/cjs/resources/staking.js.map +1 -0
  51. package/dist/cjs/resources/trading.d.ts +24 -0
  52. package/dist/cjs/resources/trading.d.ts.map +1 -0
  53. package/dist/cjs/resources/trading.js +41 -0
  54. package/dist/cjs/resources/trading.js.map +1 -0
  55. package/dist/cjs/resources/transaction.d.ts +6 -9
  56. package/dist/cjs/resources/transaction.d.ts.map +1 -1
  57. package/dist/cjs/resources/transaction.js +10 -15
  58. package/dist/cjs/resources/transaction.js.map +1 -1
  59. package/dist/cjs/resources/webhooks.d.ts +46 -0
  60. package/dist/cjs/resources/webhooks.d.ts.map +1 -0
  61. package/dist/cjs/resources/webhooks.js +142 -0
  62. package/dist/cjs/resources/webhooks.js.map +1 -0
  63. package/dist/cjs/types/apikeys.d.ts +43 -0
  64. package/dist/cjs/types/apikeys.d.ts.map +1 -0
  65. package/dist/cjs/types/apikeys.js +3 -0
  66. package/dist/cjs/types/apikeys.js.map +1 -0
  67. package/dist/cjs/types/asset.d.ts +57 -0
  68. package/dist/cjs/types/asset.d.ts.map +1 -0
  69. package/dist/cjs/types/asset.js +3 -0
  70. package/dist/cjs/types/asset.js.map +1 -0
  71. package/dist/cjs/types/bank.d.ts +58 -0
  72. package/dist/cjs/types/bank.d.ts.map +1 -0
  73. package/dist/cjs/types/bank.js +3 -0
  74. package/dist/cjs/types/bank.js.map +1 -0
  75. package/dist/cjs/types/core.d.ts +32 -0
  76. package/dist/cjs/types/core.d.ts.map +1 -0
  77. package/dist/cjs/types/core.js +3 -0
  78. package/dist/cjs/types/core.js.map +1 -0
  79. package/dist/cjs/types/custody.d.ts +50 -0
  80. package/dist/cjs/types/custody.d.ts.map +1 -0
  81. package/dist/cjs/types/custody.js +3 -0
  82. package/dist/cjs/types/custody.js.map +1 -0
  83. package/dist/cjs/types/customer.d.ts +190 -0
  84. package/dist/cjs/types/customer.d.ts.map +1 -0
  85. package/dist/cjs/types/customer.js +3 -0
  86. package/dist/cjs/types/customer.js.map +1 -0
  87. package/dist/cjs/types/index.d.ts +78 -194
  88. package/dist/cjs/types/index.d.ts.map +1 -1
  89. package/dist/cjs/types/index.js +0 -1
  90. package/dist/cjs/types/index.js.map +1 -1
  91. package/dist/cjs/types/staking.d.ts +88 -0
  92. package/dist/cjs/types/staking.d.ts.map +1 -0
  93. package/dist/cjs/types/staking.js +3 -0
  94. package/dist/cjs/types/staking.js.map +1 -0
  95. package/dist/cjs/types/trading.d.ts +51 -0
  96. package/dist/cjs/types/trading.d.ts.map +1 -0
  97. package/dist/cjs/types/trading.js +3 -0
  98. package/dist/cjs/types/trading.js.map +1 -0
  99. package/dist/cjs/types/transaction.d.ts +61 -0
  100. package/dist/cjs/types/transaction.d.ts.map +1 -0
  101. package/dist/cjs/types/transaction.js +3 -0
  102. package/dist/cjs/types/transaction.js.map +1 -0
  103. package/dist/cjs/types/webhooks.d.ts +55 -0
  104. package/dist/cjs/types/webhooks.d.ts.map +1 -0
  105. package/dist/cjs/types/webhooks.js +3 -0
  106. package/dist/cjs/types/webhooks.js.map +1 -0
  107. package/dist/cjs/utils.d.ts +21 -2
  108. package/dist/cjs/utils.d.ts.map +1 -1
  109. package/dist/cjs/utils.js +67 -4
  110. package/dist/cjs/utils.js.map +1 -1
  111. package/dist/cjs/version.d.ts +2 -0
  112. package/dist/cjs/version.d.ts.map +1 -0
  113. package/dist/cjs/version.js +6 -0
  114. package/dist/cjs/version.js.map +1 -0
  115. package/dist/esm/client.d.ts +20 -8
  116. package/dist/esm/client.d.ts.map +1 -1
  117. package/dist/esm/client.js +33 -12
  118. package/dist/esm/client.js.map +1 -1
  119. package/dist/esm/constants.d.ts +256 -0
  120. package/dist/esm/constants.d.ts.map +1 -0
  121. package/dist/esm/constants.js +211 -0
  122. package/dist/esm/constants.js.map +1 -0
  123. package/dist/esm/error.d.ts +17 -10
  124. package/dist/esm/error.d.ts.map +1 -1
  125. package/dist/esm/error.js +24 -6
  126. package/dist/esm/error.js.map +1 -1
  127. package/dist/esm/http.d.ts +13 -8
  128. package/dist/esm/http.d.ts.map +1 -1
  129. package/dist/esm/http.js +136 -45
  130. package/dist/esm/http.js.map +1 -1
  131. package/dist/esm/index.d.ts +14 -1
  132. package/dist/esm/index.d.ts.map +1 -1
  133. package/dist/esm/index.js +6 -0
  134. package/dist/esm/index.js.map +1 -1
  135. package/dist/esm/resources/apikeys.d.ts +18 -0
  136. package/dist/esm/resources/apikeys.d.ts.map +1 -0
  137. package/dist/esm/resources/apikeys.js +27 -0
  138. package/dist/esm/resources/apikeys.js.map +1 -0
  139. package/dist/esm/resources/asset.d.ts +17 -5
  140. package/dist/esm/resources/asset.d.ts.map +1 -1
  141. package/dist/esm/resources/asset.js +17 -6
  142. package/dist/esm/resources/asset.js.map +1 -1
  143. package/dist/esm/resources/bank.d.ts +11 -6
  144. package/dist/esm/resources/bank.d.ts.map +1 -1
  145. package/dist/esm/resources/bank.js +18 -10
  146. package/dist/esm/resources/bank.js.map +1 -1
  147. package/dist/esm/resources/core.d.ts +12 -0
  148. package/dist/esm/resources/core.d.ts.map +1 -0
  149. package/dist/esm/resources/core.js +18 -0
  150. package/dist/esm/resources/core.js.map +1 -0
  151. package/dist/esm/resources/custody.d.ts +27 -0
  152. package/dist/esm/resources/custody.d.ts.map +1 -0
  153. package/dist/esm/resources/custody.js +34 -0
  154. package/dist/esm/resources/custody.js.map +1 -0
  155. package/dist/esm/resources/customer.d.ts +20 -0
  156. package/dist/esm/resources/customer.d.ts.map +1 -0
  157. package/dist/esm/resources/customer.js +34 -0
  158. package/dist/esm/resources/customer.js.map +1 -0
  159. package/dist/esm/resources/staking.d.ts +32 -0
  160. package/dist/esm/resources/staking.d.ts.map +1 -0
  161. package/dist/esm/resources/staking.js +65 -0
  162. package/dist/esm/resources/staking.js.map +1 -0
  163. package/dist/esm/resources/trading.d.ts +24 -0
  164. package/dist/esm/resources/trading.d.ts.map +1 -0
  165. package/dist/esm/resources/trading.js +37 -0
  166. package/dist/esm/resources/trading.js.map +1 -0
  167. package/dist/esm/resources/transaction.d.ts +6 -9
  168. package/dist/esm/resources/transaction.d.ts.map +1 -1
  169. package/dist/esm/resources/transaction.js +11 -16
  170. package/dist/esm/resources/transaction.js.map +1 -1
  171. package/dist/esm/resources/webhooks.d.ts +46 -0
  172. package/dist/esm/resources/webhooks.d.ts.map +1 -0
  173. package/dist/esm/resources/webhooks.js +138 -0
  174. package/dist/esm/resources/webhooks.js.map +1 -0
  175. package/dist/esm/types/apikeys.d.ts +43 -0
  176. package/dist/esm/types/apikeys.d.ts.map +1 -0
  177. package/dist/esm/types/apikeys.js +2 -0
  178. package/dist/esm/types/apikeys.js.map +1 -0
  179. package/dist/esm/types/asset.d.ts +57 -0
  180. package/dist/esm/types/asset.d.ts.map +1 -0
  181. package/dist/esm/types/asset.js +2 -0
  182. package/dist/esm/types/asset.js.map +1 -0
  183. package/dist/esm/types/bank.d.ts +58 -0
  184. package/dist/esm/types/bank.d.ts.map +1 -0
  185. package/dist/esm/types/bank.js +2 -0
  186. package/dist/esm/types/bank.js.map +1 -0
  187. package/dist/esm/types/core.d.ts +32 -0
  188. package/dist/esm/types/core.d.ts.map +1 -0
  189. package/dist/esm/types/core.js +2 -0
  190. package/dist/esm/types/core.js.map +1 -0
  191. package/dist/esm/types/custody.d.ts +50 -0
  192. package/dist/esm/types/custody.d.ts.map +1 -0
  193. package/dist/esm/types/custody.js +2 -0
  194. package/dist/esm/types/custody.js.map +1 -0
  195. package/dist/esm/types/customer.d.ts +190 -0
  196. package/dist/esm/types/customer.d.ts.map +1 -0
  197. package/dist/esm/types/customer.js +2 -0
  198. package/dist/esm/types/customer.js.map +1 -0
  199. package/dist/esm/types/index.d.ts +78 -194
  200. package/dist/esm/types/index.d.ts.map +1 -1
  201. package/dist/esm/types/index.js +0 -1
  202. package/dist/esm/types/index.js.map +1 -1
  203. package/dist/esm/types/staking.d.ts +88 -0
  204. package/dist/esm/types/staking.d.ts.map +1 -0
  205. package/dist/esm/types/staking.js +2 -0
  206. package/dist/esm/types/staking.js.map +1 -0
  207. package/dist/esm/types/trading.d.ts +51 -0
  208. package/dist/esm/types/trading.d.ts.map +1 -0
  209. package/dist/esm/types/trading.js +2 -0
  210. package/dist/esm/types/trading.js.map +1 -0
  211. package/dist/esm/types/transaction.d.ts +61 -0
  212. package/dist/esm/types/transaction.d.ts.map +1 -0
  213. package/dist/esm/types/transaction.js +2 -0
  214. package/dist/esm/types/transaction.js.map +1 -0
  215. package/dist/esm/types/webhooks.d.ts +55 -0
  216. package/dist/esm/types/webhooks.d.ts.map +1 -0
  217. package/dist/esm/types/webhooks.js +2 -0
  218. package/dist/esm/types/webhooks.js.map +1 -0
  219. package/dist/esm/utils.d.ts +21 -2
  220. package/dist/esm/utils.d.ts.map +1 -1
  221. package/dist/esm/utils.js +62 -4
  222. package/dist/esm/utils.js.map +1 -1
  223. package/dist/esm/version.d.ts +2 -0
  224. package/dist/esm/version.d.ts.map +1 -0
  225. package/dist/esm/version.js +3 -0
  226. package/dist/esm/version.js.map +1 -0
  227. package/package.json +29 -12
  228. package/readme/concepts.md +104 -0
  229. package/readme/configuration.md +72 -0
  230. package/readme/errors.md +67 -0
  231. package/readme/installation.md +43 -0
  232. package/readme/quick-start.md +87 -0
  233. package/readme/resource/apikeys.md +103 -0
  234. package/readme/resource/asset.md +121 -0
  235. package/readme/resource/bank.md +156 -0
  236. package/readme/resource/core.md +91 -0
  237. package/readme/resource/custody.md +166 -0
  238. package/readme/resource/customer.md +208 -0
  239. package/readme/resource/staking.md +277 -0
  240. package/readme/resource/trading.md +166 -0
  241. package/readme/resource/transaction.md +106 -0
  242. package/readme/resource/webhooks.md +307 -0
  243. package/src/client.ts +46 -0
  244. package/src/constants.ts +281 -0
  245. package/src/error.ts +36 -0
  246. package/src/http.ts +201 -0
  247. package/src/index.ts +111 -0
  248. package/src/resources/apikeys.ts +30 -0
  249. package/src/resources/asset.ts +28 -0
  250. package/src/resources/bank.ts +39 -0
  251. package/src/resources/core.ts +19 -0
  252. package/src/resources/custody.ts +37 -0
  253. package/src/resources/customer.ts +46 -0
  254. package/src/resources/staking.ts +88 -0
  255. package/src/resources/trading.ts +41 -0
  256. package/src/resources/transaction.ts +20 -0
  257. package/src/resources/webhooks.ts +169 -0
  258. package/src/types/apikeys.ts +35 -0
  259. package/src/types/asset.ts +59 -0
  260. package/src/types/bank.ts +60 -0
  261. package/src/types/core.ts +32 -0
  262. package/src/types/custody.ts +40 -0
  263. package/src/types/customer.ts +189 -0
  264. package/src/types/index.ts +215 -0
  265. package/src/types/staking.ts +87 -0
  266. package/src/types/trading.ts +56 -0
  267. package/src/types/transaction.ts +62 -0
  268. package/src/types/webhooks.ts +60 -0
  269. package/src/utils.ts +74 -0
  270. package/src/version.ts +2 -0
  271. package/dist/cjs/resources/order.d.ts +0 -17
  272. package/dist/cjs/resources/order.d.ts.map +0 -1
  273. package/dist/cjs/resources/order.js +0 -30
  274. package/dist/cjs/resources/order.js.map +0 -1
  275. package/dist/cjs/resources/stats.d.ts +0 -11
  276. package/dist/cjs/resources/stats.d.ts.map +0 -1
  277. package/dist/cjs/resources/stats.js +0 -18
  278. package/dist/cjs/resources/stats.js.map +0 -1
  279. package/dist/cjs/resources/user.d.ts +0 -22
  280. package/dist/cjs/resources/user.d.ts.map +0 -1
  281. package/dist/cjs/resources/user.js +0 -37
  282. package/dist/cjs/resources/user.js.map +0 -1
  283. package/dist/cjs/resources/wallet.d.ts +0 -11
  284. package/dist/cjs/resources/wallet.d.ts.map +0 -1
  285. package/dist/cjs/resources/wallet.js +0 -19
  286. package/dist/cjs/resources/wallet.js.map +0 -1
  287. package/dist/esm/resources/order.d.ts +0 -17
  288. package/dist/esm/resources/order.d.ts.map +0 -1
  289. package/dist/esm/resources/order.js +0 -26
  290. package/dist/esm/resources/order.js.map +0 -1
  291. package/dist/esm/resources/stats.d.ts +0 -11
  292. package/dist/esm/resources/stats.d.ts.map +0 -1
  293. package/dist/esm/resources/stats.js +0 -14
  294. package/dist/esm/resources/stats.js.map +0 -1
  295. package/dist/esm/resources/user.d.ts +0 -22
  296. package/dist/esm/resources/user.d.ts.map +0 -1
  297. package/dist/esm/resources/user.js +0 -33
  298. package/dist/esm/resources/user.js.map +0 -1
  299. package/dist/esm/resources/wallet.d.ts +0 -11
  300. package/dist/esm/resources/wallet.d.ts.map +0 -1
  301. package/dist/esm/resources/wallet.js +0 -15
  302. package/dist/esm/resources/wallet.js.map +0 -1
  303. package/dist/types/client.d.ts +0 -19
  304. package/dist/types/client.d.ts.map +0 -1
  305. package/dist/types/error.d.ts +0 -15
  306. package/dist/types/error.d.ts.map +0 -1
  307. package/dist/types/http.d.ts +0 -21
  308. package/dist/types/http.d.ts.map +0 -1
  309. package/dist/types/index.d.ts +0 -4
  310. package/dist/types/index.d.ts.map +0 -1
  311. package/dist/types/resources/asset.d.ts +0 -11
  312. package/dist/types/resources/asset.d.ts.map +0 -1
  313. package/dist/types/resources/bank.d.ts +0 -13
  314. package/dist/types/resources/bank.d.ts.map +0 -1
  315. package/dist/types/resources/order.d.ts +0 -17
  316. package/dist/types/resources/order.d.ts.map +0 -1
  317. package/dist/types/resources/stats.d.ts +0 -11
  318. package/dist/types/resources/stats.d.ts.map +0 -1
  319. package/dist/types/resources/transaction.d.ts +0 -15
  320. package/dist/types/resources/transaction.d.ts.map +0 -1
  321. package/dist/types/resources/user.d.ts +0 -22
  322. package/dist/types/resources/user.d.ts.map +0 -1
  323. package/dist/types/resources/wallet.d.ts +0 -11
  324. package/dist/types/resources/wallet.d.ts.map +0 -1
  325. package/dist/types/types/index.d.ts +0 -213
  326. package/dist/types/types/index.d.ts.map +0 -1
  327. package/dist/types/utils.d.ts +0 -7
  328. package/dist/types/utils.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,YAAY,EAEV,YAAY,EACZ,SAAS,EACT,OAAO,EAEP,KAAK,EAEL,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,sBAAsB,EACtB,oBAAoB,EAEpB,SAAS,EACT,UAAU,EACV,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,KAAK,EACL,SAAS,EAET,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EACpB,wBAAwB,EACxB,sBAAsB,EAEtB,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,IAAI,EACJ,UAAU,EACV,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EAEZ,MAAM,EACN,WAAW,EAEX,WAAW,EACX,KAAK,EACL,SAAS,GACV,MAAM,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAuB,MAAM,gBAAgB,CAAA;AACzD,OAAO,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,GAAG,EAAE,CAAA;AAGd,OAAO,EACL,WAAW,EACX,UAAU,EACV,aAAa,EACb,SAAS,EACT,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,aAAa,EACb,MAAM,EACN,SAAS,EACT,UAAU,EACV,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,gBAAgB,GACjB,MAAM,gBAAgB,CAAA;AAEvB,sGAAsG;AACtG,eAAO,MAAM,KAAK;;;;;;EAAa,CAAA;AAC/B,MAAM,MAAM,KAAK,GAAG,SAAS,CAAA;AAE7B,YAAY,EACV,YAAY,EACZ,SAAS,EACT,OAAO,EACP,MAAM,EACN,UAAU,EACV,IAAI,EACJ,eAAe,EACf,OAAO,EACP,OAAO,EACP,QAAQ,EACR,UAAU,EACV,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,WAAW,EACX,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,QAAQ,EACR,eAAe,EACf,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,cAAc,EACd,OAAO,EACP,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,MAAM,EACN,gBAAgB,EAChB,UAAU,EACV,qBAAqB,EACrB,SAAS,EACT,iBAAiB,EACjB,KAAK,EACL,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,qBAAqB,EACrB,eAAe,EACf,IAAI,EACJ,cAAc,EACd,OAAO,EACP,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,UAAU,EACV,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,MAAM,EACN,SAAS,EACT,gBAAgB,GACjB,MAAM,kBAAkB,CAAA"}
package/dist/cjs/index.js CHANGED
@@ -1,8 +1,37 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BitgenError = exports.BitgenClient = void 0;
3
+ exports.Asset = exports.WebhookEventName = exports.WalletType = exports.WalletState = exports.TransactionState = exports.TransactionSource = exports.TransactionDirection = exports.TradingDirection = exports.SubscriberState = exports.StakingPositionState = exports.StakingMovementState = exports.StakingMovementKind = exports.OrganizationCategory = exports.OrderState = exports.OrderSide = exports.Locale = exports.IdentityState = exports.IdentityMode = exports.CustomerState = exports.CoreType = exports.CoreState = exports.BankDirection = exports.AssetState = exports.ApikeyState = exports.Env = exports.BitgenError = exports.BitgenClient = void 0;
4
+ const constants_js_1 = require("./constants.js");
5
+ Object.defineProperty(exports, "Env", { enumerable: true, get: function () { return constants_js_1.Env; } });
4
6
  var client_js_1 = require("./client.js");
5
7
  Object.defineProperty(exports, "BitgenClient", { enumerable: true, get: function () { return client_js_1.BitgenClient; } });
6
8
  var error_js_1 = require("./error.js");
7
9
  Object.defineProperty(exports, "BitgenError", { enumerable: true, get: function () { return error_js_1.BitgenError; } });
10
+ // Enumerated values — each name is both the frozen object of constants and the type of its values (`CoreType.STAKING`)
11
+ var constants_js_2 = require("./constants.js");
12
+ Object.defineProperty(exports, "ApikeyState", { enumerable: true, get: function () { return constants_js_2.ApikeyState; } });
13
+ Object.defineProperty(exports, "AssetState", { enumerable: true, get: function () { return constants_js_2.AssetState; } });
14
+ Object.defineProperty(exports, "BankDirection", { enumerable: true, get: function () { return constants_js_2.BankDirection; } });
15
+ Object.defineProperty(exports, "CoreState", { enumerable: true, get: function () { return constants_js_2.CoreState; } });
16
+ Object.defineProperty(exports, "CoreType", { enumerable: true, get: function () { return constants_js_2.CoreType; } });
17
+ Object.defineProperty(exports, "CustomerState", { enumerable: true, get: function () { return constants_js_2.CustomerState; } });
18
+ Object.defineProperty(exports, "IdentityMode", { enumerable: true, get: function () { return constants_js_2.IdentityMode; } });
19
+ Object.defineProperty(exports, "IdentityState", { enumerable: true, get: function () { return constants_js_2.IdentityState; } });
20
+ Object.defineProperty(exports, "Locale", { enumerable: true, get: function () { return constants_js_2.Locale; } });
21
+ Object.defineProperty(exports, "OrderSide", { enumerable: true, get: function () { return constants_js_2.OrderSide; } });
22
+ Object.defineProperty(exports, "OrderState", { enumerable: true, get: function () { return constants_js_2.OrderState; } });
23
+ Object.defineProperty(exports, "OrganizationCategory", { enumerable: true, get: function () { return constants_js_2.OrganizationCategory; } });
24
+ Object.defineProperty(exports, "StakingMovementKind", { enumerable: true, get: function () { return constants_js_2.StakingMovementKind; } });
25
+ Object.defineProperty(exports, "StakingMovementState", { enumerable: true, get: function () { return constants_js_2.StakingMovementState; } });
26
+ Object.defineProperty(exports, "StakingPositionState", { enumerable: true, get: function () { return constants_js_2.StakingPositionState; } });
27
+ Object.defineProperty(exports, "SubscriberState", { enumerable: true, get: function () { return constants_js_2.SubscriberState; } });
28
+ Object.defineProperty(exports, "TradingDirection", { enumerable: true, get: function () { return constants_js_2.TradingDirection; } });
29
+ Object.defineProperty(exports, "TransactionDirection", { enumerable: true, get: function () { return constants_js_2.TransactionDirection; } });
30
+ Object.defineProperty(exports, "TransactionSource", { enumerable: true, get: function () { return constants_js_2.TransactionSource; } });
31
+ Object.defineProperty(exports, "TransactionState", { enumerable: true, get: function () { return constants_js_2.TransactionState; } });
32
+ Object.defineProperty(exports, "WalletState", { enumerable: true, get: function () { return constants_js_2.WalletState; } });
33
+ Object.defineProperty(exports, "WalletType", { enumerable: true, get: function () { return constants_js_2.WalletType; } });
34
+ Object.defineProperty(exports, "WebhookEventName", { enumerable: true, get: function () { return constants_js_2.WebhookEventName; } });
35
+ /** Asset ISO codes (`Asset.ETH`) — `Asset` is also the type of an asset returned by `client.asset` */
36
+ exports.Asset = constants_js_1.Asset;
8
37
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAA0C;AAAjC,yGAAA,YAAY,OAAA;AACrB,uCAAwC;AAA/B,uGAAA,WAAW,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAAyD;AAKhD,oFALA,kBAAG,OAKA;AAFZ,yCAA0C;AAAjC,yGAAA,YAAY,OAAA;AACrB,uCAAwC;AAA/B,uGAAA,WAAW,OAAA;AAGpB,uHAAuH;AACvH,+CAwBuB;AAvBrB,2GAAA,WAAW,OAAA;AACX,0GAAA,UAAU,OAAA;AACV,6GAAA,aAAa,OAAA;AACb,yGAAA,SAAS,OAAA;AACT,wGAAA,QAAQ,OAAA;AACR,6GAAA,aAAa,OAAA;AACb,4GAAA,YAAY,OAAA;AACZ,6GAAA,aAAa,OAAA;AACb,sGAAA,MAAM,OAAA;AACN,yGAAA,SAAS,OAAA;AACT,0GAAA,UAAU,OAAA;AACV,oHAAA,oBAAoB,OAAA;AACpB,mHAAA,mBAAmB,OAAA;AACnB,oHAAA,oBAAoB,OAAA;AACpB,oHAAA,oBAAoB,OAAA;AACpB,+GAAA,eAAe,OAAA;AACf,gHAAA,gBAAgB,OAAA;AAChB,oHAAA,oBAAoB,OAAA;AACpB,iHAAA,iBAAiB,OAAA;AACjB,gHAAA,gBAAgB,OAAA;AAChB,2GAAA,WAAW,OAAA;AACX,0GAAA,UAAU,OAAA;AACV,gHAAA,gBAAgB,OAAA;AAGlB,sGAAsG;AACzF,QAAA,KAAK,GAAG,oBAAU,CAAA"}
@@ -0,0 +1,18 @@
1
+ import type { HttpClient } from '../http.js';
2
+ import type { Apikey, ApikeyListParams, ApikeyLog, Page, PageParams } from '../types/index.js';
3
+ /**
4
+ * `/organization/{scope}/apikeys` — permission `apikey.read`, read-only: a key cannot be created
5
+ * through the API (and the SDK does not revoke). `{organization}` is always the key's scope.
6
+ */
7
+ export declare class ApikeysResource {
8
+ private readonly http;
9
+ constructor(http: HttpClient);
10
+ /** Keys of the organization — revoked ones with `includeRevoked` */
11
+ list(params?: ApikeyListParams): Promise<Page<Apikey>>;
12
+ /** One key by uuid, or by model */
13
+ get(apikey: string | Apikey): Promise<Apikey>;
14
+ /** Calls made with the key: path, inputs (PII masked), status, error */
15
+ logs(apikey: string | Apikey, params?: PageParams): Promise<Page<ApikeyLog>>;
16
+ private organization;
17
+ }
18
+ //# sourceMappingURL=apikeys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apikeys.d.ts","sourceRoot":"","sources":["../../../src/resources/apikeys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAG9F;;;GAGG;AACH,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,oEAAoE;IAC9D,IAAI,CAAC,MAAM,GAAE,gBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAIhE,mCAAmC;IAC7B,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAInD,wEAAwE;IAClE,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,GAAE,UAAe,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAItF,OAAO,CAAC,YAAY;CAGrB"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApikeysResource = void 0;
4
+ const utils_js_1 = require("../utils.js");
5
+ /**
6
+ * `/organization/{scope}/apikeys` — permission `apikey.read`, read-only: a key cannot be created
7
+ * through the API (and the SDK does not revoke). `{organization}` is always the key's scope.
8
+ */
9
+ class ApikeysResource {
10
+ http;
11
+ constructor(http) {
12
+ this.http = http;
13
+ }
14
+ /** Keys of the organization — revoked ones with `includeRevoked` */
15
+ async list(params = {}) {
16
+ return await this.http.get(`/organization/${this.organization()}/apikeys`, { ...params });
17
+ }
18
+ /** One key by uuid, or by model */
19
+ async get(apikey) {
20
+ return await this.http.get(`/organization/${this.organization()}/apikeys/${(0, utils_js_1.pathSegment)((0, utils_js_1.idOf)(apikey, 'apikey'), 'apikey')}`);
21
+ }
22
+ /** Calls made with the key: path, inputs (PII masked), status, error */
23
+ async logs(apikey, params = {}) {
24
+ return await this.http.get(`/organization/${this.organization()}/apikeys/${(0, utils_js_1.pathSegment)((0, utils_js_1.idOf)(apikey, 'apikey'), 'apikey')}/logs`, { ...params });
25
+ }
26
+ organization() {
27
+ return (0, utils_js_1.pathSegment)(this.http.scope, 'scope');
28
+ }
29
+ }
30
+ exports.ApikeysResource = ApikeysResource;
31
+ //# sourceMappingURL=apikeys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apikeys.js","sourceRoot":"","sources":["../../../src/resources/apikeys.ts"],"names":[],"mappings":";;;AAEA,0CAA+C;AAE/C;;;GAGG;AACH,MAAa,eAAe;IACG;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,oEAAoE;IACpE,KAAK,CAAC,IAAI,CAAC,SAA2B,EAAE;QACtC,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,IAAI,CAAC,YAAY,EAAE,UAAU,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC,CAAA;IAC3F,CAAC;IAED,mCAAmC;IACnC,KAAK,CAAC,GAAG,CAAC,MAAuB;QAC/B,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,IAAI,CAAC,YAAY,EAAE,YAAY,IAAA,sBAAW,EAAC,IAAA,eAAI,EAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAA;IAC7H,CAAC;IAED,wEAAwE;IACxE,KAAK,CAAC,IAAI,CAAC,MAAuB,EAAE,SAAqB,EAAE;QACzD,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,IAAI,CAAC,YAAY,EAAE,YAAY,IAAA,sBAAW,EAAC,IAAA,eAAI,EAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,OAAO,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC,CAAA;IACjJ,CAAC;IAEO,YAAY;QAClB,OAAO,IAAA,sBAAW,EAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAC9C,CAAC;CACF;AArBD,0CAqBC"}
@@ -1,11 +1,23 @@
1
1
  import type { HttpClient } from '../http.js';
2
- import type { Asset } from '../types/index.js';
2
+ import type { Asset, AssetInput, AssetTicker, History, Page } from '../types/index.js';
3
+ /** `/asset`, `/ticker` — permission `asset.read` */
3
4
  export declare class AssetResource {
4
5
  private readonly http;
5
6
  constructor(http: HttpClient);
6
- /** Get a single asset by ISO code (e.g. 'BTC', 'ETH') */
7
- get(iso: string): Promise<Asset>;
8
- /** List all available assets */
9
- list(): Promise<Asset[]>;
7
+ /** List all assets */
8
+ list(): Promise<Page<Asset>>;
9
+ /** Get one asset by uuid or ISO code (any case, sent as is — `Asset.ETH`), or by model (its uuid is sent) */
10
+ get(asset: AssetInput): Promise<Asset>;
11
+ /** Tickers of all assets */
12
+ tickers(): Promise<Page<{
13
+ iso: string;
14
+ ticker: AssetTicker;
15
+ }>>;
16
+ /** Ticker and EUR price history of one asset, by ISO code */
17
+ ticker(iso: string): Promise<{
18
+ iso: string;
19
+ ticker: AssetTicker;
20
+ history: History;
21
+ }>;
10
22
  }
11
23
  //# sourceMappingURL=asset.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../../src/resources/asset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE9C,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,yDAAyD;IACzD,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAIhC,gCAAgC;IAChC,IAAI,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;CAGzB"}
1
+ {"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../../src/resources/asset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAGtF,oDAAoD;AACpD,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,sBAAsB;IAChB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAIlC,6GAA6G;IACvG,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC;IAI5C,4BAA4B;IACtB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,WAAW,CAAA;KAAE,CAAC,CAAC;IAIpE,6DAA6D;IACvD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,WAAW,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CAG3F"}
@@ -1,17 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AssetResource = void 0;
4
+ const utils_js_1 = require("../utils.js");
5
+ /** `/asset`, `/ticker` — permission `asset.read` */
4
6
  class AssetResource {
7
+ http;
5
8
  constructor(http) {
6
9
  this.http = http;
7
10
  }
8
- /** Get a single asset by ISO code (e.g. 'BTC', 'ETH') */
9
- get(iso) {
10
- return this.http.get(`/api/v3/asset/${iso}`);
11
+ /** List all assets */
12
+ async list() {
13
+ return await this.http.get('/asset');
11
14
  }
12
- /** List all available assets */
13
- list() {
14
- return this.http.get('/api/v3/assets');
15
+ /** Get one asset by uuid or ISO code (any case, sent as is — `Asset.ETH`), or by model (its uuid is sent) */
16
+ async get(asset) {
17
+ return await this.http.get(`/asset/${(0, utils_js_1.pathSegment)((0, utils_js_1.assetId)(asset), 'asset')}`);
18
+ }
19
+ /** Tickers of all assets */
20
+ async tickers() {
21
+ return await this.http.get('/ticker');
22
+ }
23
+ /** Ticker and EUR price history of one asset, by ISO code */
24
+ async ticker(iso) {
25
+ return await this.http.get(`/ticker/${(0, utils_js_1.pathSegment)(iso, 'iso')}`);
15
26
  }
16
27
  }
17
28
  exports.AssetResource = AssetResource;
@@ -1 +1 @@
1
- {"version":3,"file":"asset.js","sourceRoot":"","sources":["../../../src/resources/asset.ts"],"names":[],"mappings":";;;AAGA,MAAa,aAAa;IACxB,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,yDAAyD;IACzD,GAAG,CAAC,GAAW;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAQ,iBAAiB,GAAG,EAAE,CAAC,CAAA;IACrD,CAAC;IAED,gCAAgC;IAChC,IAAI;QACF,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAU,gBAAgB,CAAC,CAAA;IACjD,CAAC;CACF;AAZD,sCAYC"}
1
+ {"version":3,"file":"asset.js","sourceRoot":"","sources":["../../../src/resources/asset.ts"],"names":[],"mappings":";;;AAEA,0CAAkD;AAElD,oDAAoD;AACpD,MAAa,aAAa;IACK;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,sBAAsB;IACtB,KAAK,CAAC,IAAI;QACR,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IACtC,CAAC;IAED,6GAA6G;IAC7G,KAAK,CAAC,GAAG,CAAC,KAAiB;QACzB,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,IAAA,sBAAW,EAAC,IAAA,kBAAO,EAAC,KAAK,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;IAC9E,CAAC;IAED,4BAA4B;IAC5B,KAAK,CAAC,OAAO;QACX,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IACvC,CAAC;IAED,6DAA6D;IAC7D,KAAK,CAAC,MAAM,CAAC,GAAW;QACtB,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,IAAA,sBAAW,EAAC,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;IAClE,CAAC;CACF;AAtBD,sCAsBC"}
@@ -1,13 +1,18 @@
1
1
  import type { HttpClient } from '../http.js';
2
- import type { BankAccount, BankWithdrawResult, BankOperation, BankOperationsFilter, UserRef } from '../types/index.js';
2
+ import type { BankAccount, BankCreditParams, BankOperation, BankOperationsParams, BankWithdrawParams, Created, Page, UserRef } from '../types/index.js';
3
+ /** `/bank` — permissions `bank.read`, `bank.write`. EUR ledger per customer; `{user}` = uuid or email. */
3
4
  export declare class BankResource {
4
5
  private readonly http;
5
6
  constructor(http: HttpClient);
6
- /** Get a user's EUR bank account balance and reference */
7
+ /** EUR account of a customer — created on first read (requires a validated KYC or KYB) */
7
8
  get(user: UserRef): Promise<BankAccount>;
8
- /** Withdraw EUR from a user's bank account */
9
- withdraw(user: UserRef, amount: number): Promise<BankWithdrawResult>;
10
- /** Get bank operation history for a user */
11
- operations(user: UserRef, filters?: BankOperationsFilter): Promise<BankOperation[]>;
9
+ /** EUR operations of a customer */
10
+ operations(user: UserRef, params?: BankOperationsParams): Promise<Page<BankOperation>>;
11
+ /** EUR withdrawal to the customer's IBAN — `iban` / `bank` / `bic` update the bank details first */
12
+ withdraw(user: UserRef, params: BankWithdrawParams): Promise<{
13
+ transaction: string;
14
+ }>;
15
+ /** Inject an EUR deposit (logical credit) — targets `user` or the wire `message`; `reference` makes it idempotent */
16
+ credit(params: BankCreditParams): Promise<Created>;
12
17
  }
13
18
  //# sourceMappingURL=bank.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bank.d.ts","sourceRoot":"","sources":["../../../src/resources/bank.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,OAAO,EACR,MAAM,mBAAmB,CAAA;AAG1B,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,0DAA0D;IAC1D,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC;IAIxC,8CAA8C;IAC9C,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIpE,4CAA4C;IAC5C,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAMpF"}
1
+ {"version":3,"file":"bank.d.ts","sourceRoot":"","sources":["../../../src/resources/bank.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,OAAO,EACP,IAAI,EACJ,OAAO,EACR,MAAM,mBAAmB,CAAA;AAG1B,0GAA0G;AAC1G,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,0FAA0F;IACpF,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC;IAI9C,mCAAmC;IAC7B,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,GAAE,oBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAIhG,oGAAoG;IAC9F,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IAI3F,qHAAqH;IAC/G,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;CAKzD"}
@@ -2,21 +2,29 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BankResource = void 0;
4
4
  const utils_js_1 = require("../utils.js");
5
+ /** `/bank` — permissions `bank.read`, `bank.write`. EUR ledger per customer; `{user}` = uuid or email. */
5
6
  class BankResource {
7
+ http;
6
8
  constructor(http) {
7
9
  this.http = http;
8
10
  }
9
- /** Get a user's EUR bank account balance and reference */
10
- get(user) {
11
- return this.http.get(`/api/v3/bank/${(0, utils_js_1.resolveUuid)(user)}`);
11
+ /** EUR account of a customer — created on first read (requires a validated KYC or KYB) */
12
+ async get(user) {
13
+ return await this.http.get(`/bank/${(0, utils_js_1.pathSegment)((0, utils_js_1.resolveUuid)(user), 'user')}`);
12
14
  }
13
- /** Withdraw EUR from a user's bank account */
14
- withdraw(user, amount) {
15
- return this.http.put(`/api/v3/bank/${(0, utils_js_1.resolveUuid)(user)}`, { amount });
15
+ /** EUR operations of a customer */
16
+ async operations(user, params = {}) {
17
+ return await this.http.get(`/bank/${(0, utils_js_1.pathSegment)((0, utils_js_1.resolveUuid)(user), 'user')}/operations`, { ...params });
16
18
  }
17
- /** Get bank operation history for a user */
18
- operations(user, filters) {
19
- return this.http.get(`/api/v3/bank/${(0, utils_js_1.resolveUuid)(user)}/operations`, filters);
19
+ /** EUR withdrawal to the customer's IBAN — `iban` / `bank` / `bic` update the bank details first */
20
+ async withdraw(user, params) {
21
+ return await this.http.put(`/bank/${(0, utils_js_1.pathSegment)((0, utils_js_1.resolveUuid)(user), 'user')}`, { ...params, amount: (0, utils_js_1.amount)(params.amount) });
22
+ }
23
+ /** Inject an EUR deposit (logical credit) — targets `user` or the wire `message`; `reference` makes it idempotent */
24
+ async credit(params) {
25
+ const { user, ...rest } = params;
26
+ // `user` is optional (`message` is the alternative): absent or null → key omitted
27
+ return await this.http.post('/bank', { ...rest, amount: (0, utils_js_1.amount)(params.amount), user: user === undefined || user === null ? undefined : (0, utils_js_1.resolveUuid)(user) });
20
28
  }
21
29
  }
22
30
  exports.BankResource = BankResource;
@@ -1 +1 @@
1
- {"version":3,"file":"bank.js","sourceRoot":"","sources":["../../../src/resources/bank.ts"],"names":[],"mappings":";;;AAQA,0CAAyC;AAEzC,MAAa,YAAY;IACvB,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,0DAA0D;IAC1D,GAAG,CAAC,IAAa;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAc,gBAAgB,IAAA,sBAAW,EAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACxE,CAAC;IAED,8CAA8C;IAC9C,QAAQ,CAAC,IAAa,EAAE,MAAc;QACpC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAqB,gBAAgB,IAAA,sBAAW,EAAC,IAAI,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;IAC3F,CAAC;IAED,4CAA4C;IAC5C,UAAU,CAAC,IAAa,EAAE,OAA8B;QACtD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,gBAAgB,IAAA,sBAAW,EAAC,IAAI,CAAC,aAAa,EAC9C,OAAsD,CACvD,CAAA;IACH,CAAC;CACF;AApBD,oCAoBC"}
1
+ {"version":3,"file":"bank.js","sourceRoot":"","sources":["../../../src/resources/bank.ts"],"names":[],"mappings":";;;AAWA,0CAA8D;AAE9D,0GAA0G;AAC1G,MAAa,YAAY;IACM;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,0FAA0F;IAC1F,KAAK,CAAC,GAAG,CAAC,IAAa;QACrB,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,IAAA,sBAAW,EAAC,IAAA,sBAAW,EAAC,IAAI,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;IAC/E,CAAC;IAED,mCAAmC;IACnC,KAAK,CAAC,UAAU,CAAC,IAAa,EAAE,SAA+B,EAAE;QAC/D,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,IAAA,sBAAW,EAAC,IAAA,sBAAW,EAAC,IAAI,CAAC,EAAE,MAAM,CAAC,aAAa,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC,CAAA;IACzG,CAAC;IAED,oGAAoG;IACpG,KAAK,CAAC,QAAQ,CAAC,IAAa,EAAE,MAA0B;QACtD,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,IAAA,sBAAW,EAAC,IAAA,sBAAW,EAAC,IAAI,CAAC,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,IAAA,iBAAM,EAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IAC7H,CAAC;IAED,qHAAqH;IACrH,KAAK,CAAC,MAAM,CAAC,MAAwB;QACnC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAA;QAChC,kFAAkF;QAClF,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,IAAA,iBAAM,EAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAA,sBAAW,EAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAC7J,CAAC;CACF;AAxBD,oCAwBC"}
@@ -0,0 +1,12 @@
1
+ import type { HttpClient } from '../http.js';
2
+ import type { Core, CoreListParams, Page } from '../types/index.js';
3
+ /** `/applications/core` — permission `core.read`. Platform catalogue of connectors, read-only. */
4
+ export declare class CoreResource {
5
+ private readonly http;
6
+ constructor(http: HttpClient);
7
+ /** Connectors matching the filters — not paginated, `count` is everything that matches */
8
+ list(params?: CoreListParams): Promise<Page<Core>>;
9
+ /** One connector by uuid or by model */
10
+ get(core: string | Core): Promise<Core>;
11
+ }
12
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/resources/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAGnE,kGAAkG;AAClG,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,0FAA0F;IACpF,IAAI,CAAC,MAAM,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAK5D,wCAAwC;IAClC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAG9C"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CoreResource = void 0;
4
+ const utils_js_1 = require("../utils.js");
5
+ /** `/applications/core` — permission `core.read`. Platform catalogue of connectors, read-only. */
6
+ class CoreResource {
7
+ http;
8
+ constructor(http) {
9
+ this.http = http;
10
+ }
11
+ /** Connectors matching the filters — not paginated, `count` is everything that matches */
12
+ async list(params = {}) {
13
+ // spread first: the query keeps the order of the params, `asset` is replaced in place (absent or null = no filter)
14
+ return await this.http.get('/applications/core', { ...params, asset: (0, utils_js_1.assetFilter)(params.asset) });
15
+ }
16
+ /** One connector by uuid or by model */
17
+ async get(core) {
18
+ return await this.http.get(`/applications/core/${(0, utils_js_1.pathSegment)((0, utils_js_1.idOf)(core, 'core'), 'core')}`);
19
+ }
20
+ }
21
+ exports.CoreResource = CoreResource;
22
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/resources/core.ts"],"names":[],"mappings":";;;AAEA,0CAA4D;AAE5D,kGAAkG;AAClG,MAAa,YAAY;IACM;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,0FAA0F;IAC1F,KAAK,CAAC,IAAI,CAAC,SAAyB,EAAE;QACpC,mHAAmH;QACnH,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,oBAAoB,EAAE,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,IAAA,sBAAW,EAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IACnG,CAAC;IAED,wCAAwC;IACxC,KAAK,CAAC,GAAG,CAAC,IAAmB;QAC3B,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,sBAAsB,IAAA,sBAAW,EAAC,IAAA,eAAI,EAAC,IAAI,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;IAC7F,CAAC;CACF;AAbD,oCAaC"}
@@ -0,0 +1,27 @@
1
+ import type { HttpClient } from '../http.js';
2
+ import type { AssetInput, CustodyPortfolio, CustodyWithdrawParams, UserRef, Wallet } from '../types/index.js';
3
+ /**
4
+ * `/custody` — permissions `custody.read`, `custody.write`. Crypto wallets per customer and asset.
5
+ * `{user}` = customer uuid — or the organization uuid (the scope) for its treasury wallets, read-only.
6
+ */
7
+ export declare class CustodyResource {
8
+ private readonly http;
9
+ constructor(http: HttpClient);
10
+ /** Wallets of a customer (or of the organization), without `history` */
11
+ wallets(user: UserRef): Promise<Wallet[]>;
12
+ /**
13
+ * One wallet by asset uuid or iso, with `history`. A missing wallet is provisioned on first read
14
+ * (deposit address created at the custodian): the key then needs `custody.write`.
15
+ */
16
+ wallet(user: UserRef, asset: AssetInput): Promise<Wallet>;
17
+ /** EUR value curve of the customer's custody (customers only) */
18
+ portfolio(user: UserRef): Promise<CustodyPortfolio>;
19
+ /**
20
+ * On-chain withdrawal (customers only). The amount string goes to the API untouched — never
21
+ * rounded or reformatted. `transaction` is null while the analysis has not created the line yet.
22
+ */
23
+ withdraw(user: UserRef, params: CustodyWithdrawParams): Promise<{
24
+ transaction: string | null;
25
+ }>;
26
+ }
27
+ //# sourceMappingURL=custody.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custody.d.ts","sourceRoot":"","sources":["../../../src/resources/custody.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAG7G;;;GAGG;AACH,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,wEAAwE;IAClE,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAI/C;;;OAGG;IACG,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAI/D,iEAAiE;IAC3D,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAIzD;;;OAGG;IACG,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;CAGtG"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustodyResource = void 0;
4
+ const utils_js_1 = require("../utils.js");
5
+ /**
6
+ * `/custody` — permissions `custody.read`, `custody.write`. Crypto wallets per customer and asset.
7
+ * `{user}` = customer uuid — or the organization uuid (the scope) for its treasury wallets, read-only.
8
+ */
9
+ class CustodyResource {
10
+ http;
11
+ constructor(http) {
12
+ this.http = http;
13
+ }
14
+ /** Wallets of a customer (or of the organization), without `history` */
15
+ async wallets(user) {
16
+ return await this.http.get(`/custody/${(0, utils_js_1.pathSegment)((0, utils_js_1.resolveUuid)(user), 'user')}`);
17
+ }
18
+ /**
19
+ * One wallet by asset uuid or iso, with `history`. A missing wallet is provisioned on first read
20
+ * (deposit address created at the custodian): the key then needs `custody.write`.
21
+ */
22
+ async wallet(user, asset) {
23
+ return await this.http.get(`/custody/${(0, utils_js_1.pathSegment)((0, utils_js_1.resolveUuid)(user), 'user')}/${(0, utils_js_1.pathSegment)((0, utils_js_1.assetId)(asset), 'asset')}`);
24
+ }
25
+ /** EUR value curve of the customer's custody (customers only) */
26
+ async portfolio(user) {
27
+ return await this.http.get(`/custody/${(0, utils_js_1.pathSegment)((0, utils_js_1.resolveUuid)(user), 'user')}/portfolio`);
28
+ }
29
+ /**
30
+ * On-chain withdrawal (customers only). The amount string goes to the API untouched — never
31
+ * rounded or reformatted. `transaction` is null while the analysis has not created the line yet.
32
+ */
33
+ async withdraw(user, params) {
34
+ return await this.http.put(`/custody/${(0, utils_js_1.pathSegment)((0, utils_js_1.resolveUuid)(user), 'user')}`, { ...params, asset: (0, utils_js_1.assetId)(params.asset), amount: (0, utils_js_1.amount)(params.amount) });
35
+ }
36
+ }
37
+ exports.CustodyResource = CustodyResource;
38
+ //# sourceMappingURL=custody.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custody.js","sourceRoot":"","sources":["../../../src/resources/custody.ts"],"names":[],"mappings":";;;AAEA,0CAAuE;AAEvE;;;GAGG;AACH,MAAa,eAAe;IACG;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,wEAAwE;IACxE,KAAK,CAAC,OAAO,CAAC,IAAa;QACzB,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,IAAA,sBAAW,EAAC,IAAA,sBAAW,EAAC,IAAI,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;IAClF,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,MAAM,CAAC,IAAa,EAAE,KAAiB;QAC3C,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,IAAA,sBAAW,EAAC,IAAA,sBAAW,EAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,IAAA,sBAAW,EAAC,IAAA,kBAAO,EAAC,KAAK,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;IAC1H,CAAC;IAED,iEAAiE;IACjE,KAAK,CAAC,SAAS,CAAC,IAAa;QAC3B,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,IAAA,sBAAW,EAAC,IAAA,sBAAW,EAAC,IAAI,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAA;IAC5F,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,QAAQ,CAAC,IAAa,EAAE,MAA6B;QACzD,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,IAAA,sBAAW,EAAC,IAAA,sBAAW,EAAC,IAAI,CAAC,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,IAAA,kBAAO,EAAC,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,IAAA,iBAAM,EAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IAC9J,CAAC;CACF;AA5BD,0CA4BC"}
@@ -0,0 +1,20 @@
1
+ import type { HttpClient } from '../http.js';
2
+ import type { Account, CreateCustomerParams, Created, Customer, CustomerListParams, Page, UpdateCustomerParams, UserRef } from '../types/index.js';
3
+ /** `/customer`, `/account` — permissions `customer.write`, `customer.read`, `account.read`, `account.write` */
4
+ export declare class CustomerResource {
5
+ private readonly http;
6
+ constructor(http: HttpClient);
7
+ /**
8
+ * Create a customer of the key's organization — or attach an existing, KYC-validated account to it.
9
+ * By default an activation email is sent: the customer stays `CREATED` and invisible to the financial
10
+ * routes (bank, custody, trading, staking) until they activate (`account.needActivation: false` skips it).
11
+ */
12
+ create(params: CreateCustomerParams): Promise<Created>;
13
+ /** List the organization's customers (a freshly created one appears as `CREATED`) */
14
+ list(params?: CustomerListParams): Promise<Page<Customer>>;
15
+ /** Get an account by uuid, email (login) or model (`Created`, `Customer`…) */
16
+ get(user: UserRef): Promise<Account>;
17
+ /** Update the settings a key may write: theme, locale, notifications — nothing else is sent */
18
+ update(user: UserRef, params: UpdateCustomerParams): Promise<void>;
19
+ }
20
+ //# sourceMappingURL=customer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customer.d.ts","sourceRoot":"","sources":["../../../src/resources/customer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EACV,OAAO,EACP,oBAAoB,EACpB,OAAO,EACP,QAAQ,EACR,kBAAkB,EAClB,IAAI,EACJ,oBAAoB,EACpB,OAAO,EACR,MAAM,mBAAmB,CAAA;AAG1B,+GAA+G;AAC/G,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;;OAIG;IACG,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;IAM5D,qFAAqF;IAC/E,IAAI,CAAC,MAAM,GAAE,kBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAIpE,8EAA8E;IACxE,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAI1C,+FAA+F;IACzF,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;CAMzE"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomerResource = void 0;
4
+ const utils_js_1 = require("../utils.js");
5
+ /** `/customer`, `/account` — permissions `customer.write`, `customer.read`, `account.read`, `account.write` */
6
+ class CustomerResource {
7
+ http;
8
+ constructor(http) {
9
+ this.http = http;
10
+ }
11
+ /**
12
+ * Create a customer of the key's organization — or attach an existing, KYC-validated account to it.
13
+ * By default an activation email is sent: the customer stays `CREATED` and invisible to the financial
14
+ * routes (bank, custody, trading, staking) until they activate (`account.needActivation: false` skips it).
15
+ */
16
+ async create(params) {
17
+ const { group, ...rest } = params;
18
+ // Only `manager` is taken from the caller: the organization is always the scope, and no role is ever sent (the API takes ROLE_USER)
19
+ return await this.http.post('/customer', { ...rest, group: { manager: group?.manager, organization: this.http.scope } });
20
+ }
21
+ /** List the organization's customers (a freshly created one appears as `CREATED`) */
22
+ async list(params = {}) {
23
+ return await this.http.get('/customer', { ...params });
24
+ }
25
+ /** Get an account by uuid, email (login) or model (`Created`, `Customer`…) */
26
+ async get(user) {
27
+ return await this.http.get(`/account/${(0, utils_js_1.pathSegment)((0, utils_js_1.resolveUuid)(user), 'user')}`);
28
+ }
29
+ /** Update the settings a key may write: theme, locale, notifications — nothing else is sent */
30
+ async update(user, params) {
31
+ await this.http.put(`/account/${(0, utils_js_1.pathSegment)((0, utils_js_1.resolveUuid)(user), 'user')}`, {
32
+ action: { theme: params.theme, locale: params.locale },
33
+ notifications: params.notifications,
34
+ });
35
+ }
36
+ }
37
+ exports.CustomerResource = CustomerResource;
38
+ //# sourceMappingURL=customer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customer.js","sourceRoot":"","sources":["../../../src/resources/customer.ts"],"names":[],"mappings":";;;AAWA,0CAAsD;AAEtD,+GAA+G;AAC/G,MAAa,gBAAgB;IACE;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,MAA4B;QACvC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAA;QACjC,oIAAoI;QACpI,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IAC1H,CAAC;IAED,qFAAqF;IACrF,KAAK,CAAC,IAAI,CAAC,SAA6B,EAAE;QACxC,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC,CAAA;IACxD,CAAC;IAED,8EAA8E;IAC9E,KAAK,CAAC,GAAG,CAAC,IAAa;QACrB,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,IAAA,sBAAW,EAAC,IAAA,sBAAW,EAAC,IAAI,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;IAClF,CAAC;IAED,+FAA+F;IAC/F,KAAK,CAAC,MAAM,CAAC,IAAa,EAAE,MAA4B;QACtD,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,IAAA,sBAAW,EAAC,IAAA,sBAAW,EAAC,IAAI,CAAC,EAAE,MAAM,CAAC,EAAE,EAAE;YACxE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;YACtD,aAAa,EAAE,MAAM,CAAC,aAAa;SACpC,CAAC,CAAA;IACJ,CAAC;CACF;AA/BD,4CA+BC"}
@@ -0,0 +1,32 @@
1
+ import type { HttpClient } from '../http.js';
2
+ import type { AssetInput, Core, Created, Page, PageParams, StakeParams, StakingAmountParams, StakingListParams, StakingMovement, StakingOperation, StakingPortfolio, StakingPosition, UserRef } from '../types/index.js';
3
+ import type { CoreResource } from './core.js';
4
+ /**
5
+ * `/staking` — permissions `staking.write`, `staking.read` (`core.read` for `providers`).
6
+ * Two distinct ids: the **movement** uuid (returned by `stake`, handled by `get` / `list` / `movements`)
7
+ * and the **position** uuid (`movement.staking.uuid`, taken by `rewards` / `unstake`).
8
+ */
9
+ export declare class StakingResource {
10
+ private readonly http;
11
+ private readonly core;
12
+ constructor(http: HttpClient, core: CoreResource);
13
+ /** Staking providers = the `STAKING` cores, optionally for one asset — their `uuid` or `name` is the `provider` of `stake` */
14
+ providers(asset?: AssetInput): Promise<Page<Core>>;
15
+ /** Open a staking position — the amount is moved from the customer's custody to the provider's deposit address */
16
+ stake(user: UserRef, params: StakeParams): Promise<Created>;
17
+ /** Movements of the organization, all states */
18
+ list(params?: StakingListParams): Promise<Page<StakingMovement>>;
19
+ /** Movements still in progress: `REQUESTED`, `PENDING`, `FAILED` */
20
+ movements(params?: StakingListParams): Promise<Page<StakingMovement>>;
21
+ /** One movement by its uuid, or by model */
22
+ get(movement: string | StakingMovement): Promise<StakingMovement>;
23
+ /** Claim the rewards of a position — `amount` absent = all of them. Deducted immediately, the transfer is executed by compliance. */
24
+ rewards(position: string | StakingPosition, params?: StakingAmountParams): Promise<void>;
25
+ /** Leave a position — `amount` absent = the whole position (a full exit ignores the minimums). Deducted immediately, the transfer is executed by compliance. */
26
+ unstake(position: string | StakingPosition, params?: StakingAmountParams): Promise<void>;
27
+ /** Staking operations of a customer */
28
+ operations(user: UserRef, params?: PageParams): Promise<Page<StakingOperation>>;
29
+ /** EUR balances and curves (capital, revenues) of a customer's staking */
30
+ portfolio(user: UserRef): Promise<StakingPortfolio>;
31
+ }
32
+ //# sourceMappingURL=staking.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staking.d.ts","sourceRoot":"","sources":["../../../src/resources/staking.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EACV,UAAU,EACV,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,OAAO,EACR,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAG7C;;;;GAIG;AACH,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,IAAI;IAAc,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAvC,IAAI,EAAE,UAAU,EAAmB,IAAI,EAAE,YAAY;IAElF,8HAA8H;IACxH,SAAS,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAIxD,kHAAkH;IAC5G,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IASjE,gDAAgD;IAC1C,IAAI,CAAC,MAAM,GAAE,iBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAI1E,oEAAoE;IAC9D,SAAS,CAAC,MAAM,GAAE,iBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAI/E,4CAA4C;IACtC,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAIvE,qIAAqI;IAC/H,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,EAAE,MAAM,GAAE,mBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlG,gKAAgK;IAC1J,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,EAAE,MAAM,GAAE,mBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlG,uCAAuC;IACjC,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,GAAE,UAAe,GAAG,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAIzF,0EAA0E;IACpE,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAG1D"}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StakingResource = void 0;
4
+ const constants_js_1 = require("../constants.js");
5
+ const utils_js_1 = require("../utils.js");
6
+ /**
7
+ * `/staking` — permissions `staking.write`, `staking.read` (`core.read` for `providers`).
8
+ * Two distinct ids: the **movement** uuid (returned by `stake`, handled by `get` / `list` / `movements`)
9
+ * and the **position** uuid (`movement.staking.uuid`, taken by `rewards` / `unstake`).
10
+ */
11
+ class StakingResource {
12
+ http;
13
+ core;
14
+ constructor(http, core) {
15
+ this.http = http;
16
+ this.core = core;
17
+ }
18
+ /** Staking providers = the `STAKING` cores, optionally for one asset — their `uuid` or `name` is the `provider` of `stake` */
19
+ async providers(asset) {
20
+ return await this.core.list(asset === undefined ? { type: constants_js_1.CoreType.STAKING } : { type: constants_js_1.CoreType.STAKING, asset });
21
+ }
22
+ /** Open a staking position — the amount is moved from the customer's custody to the provider's deposit address */
23
+ async stake(user, params) {
24
+ return await this.http.post('/staking', {
25
+ user: (0, utils_js_1.resolveUuid)(user),
26
+ asset: (0, utils_js_1.assetId)(params.asset),
27
+ amount: (0, utils_js_1.amount)(params.amount),
28
+ provider: params.provider,
29
+ });
30
+ }
31
+ /** Movements of the organization, all states */
32
+ async list(params = {}) {
33
+ return await this.http.get('/staking', movementsQuery(params));
34
+ }
35
+ /** Movements still in progress: `REQUESTED`, `PENDING`, `FAILED` */
36
+ async movements(params = {}) {
37
+ return await this.http.get('/staking/movements', movementsQuery(params));
38
+ }
39
+ /** One movement by its uuid, or by model */
40
+ async get(movement) {
41
+ return await this.http.get(`/staking/${(0, utils_js_1.pathSegment)((0, utils_js_1.idOf)(movement, 'movement'), 'movement')}`);
42
+ }
43
+ /** Claim the rewards of a position — `amount` absent = all of them. Deducted immediately, the transfer is executed by compliance. */
44
+ async rewards(position, params = {}) {
45
+ await this.http.put(`/staking/${(0, utils_js_1.pathSegment)((0, utils_js_1.idOf)(position, 'position'), 'position')}/rewards`, amountBody(params));
46
+ }
47
+ /** Leave a position — `amount` absent = the whole position (a full exit ignores the minimums). Deducted immediately, the transfer is executed by compliance. */
48
+ async unstake(position, params = {}) {
49
+ await this.http.put(`/staking/${(0, utils_js_1.pathSegment)((0, utils_js_1.idOf)(position, 'position'), 'position')}/unstake`, amountBody(params));
50
+ }
51
+ /** Staking operations of a customer */
52
+ async operations(user, params = {}) {
53
+ return await this.http.get(`/staking/${(0, utils_js_1.pathSegment)((0, utils_js_1.resolveUuid)(user), 'user')}/operations`, { ...params });
54
+ }
55
+ /** EUR balances and curves (capital, revenues) of a customer's staking */
56
+ async portfolio(user) {
57
+ return await this.http.get(`/staking/${(0, utils_js_1.pathSegment)((0, utils_js_1.resolveUuid)(user), 'user')}/portfolio`);
58
+ }
59
+ }
60
+ exports.StakingResource = StakingResource;
61
+ function movementsQuery(params) {
62
+ const { user, ...rest } = params;
63
+ return { user: user === undefined || user === null ? undefined : (0, utils_js_1.resolveUuid)(user), ...rest };
64
+ }
65
+ /** `{ amount }` when given, `{}` otherwise — the API reads an absent amount as "everything" */
66
+ function amountBody(params) {
67
+ return params.amount === undefined ? {} : { amount: (0, utils_js_1.amount)(params.amount) };
68
+ }
69
+ //# sourceMappingURL=staking.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staking.js","sourceRoot":"","sources":["../../../src/resources/staking.ts"],"names":[],"mappings":";;;AAAA,kDAA0C;AAkB1C,0CAA6E;AAE7E;;;;GAIG;AACH,MAAa,eAAe;IACG;IAAmC;IAAhE,YAA6B,IAAgB,EAAmB,IAAkB;QAArD,SAAI,GAAJ,IAAI,CAAY;QAAmB,SAAI,GAAJ,IAAI,CAAc;IAAG,CAAC;IAEtF,8HAA8H;IAC9H,KAAK,CAAC,SAAS,CAAC,KAAkB;QAChC,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,uBAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,uBAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAA;IACnH,CAAC;IAED,kHAAkH;IAClH,KAAK,CAAC,KAAK,CAAC,IAAa,EAAE,MAAmB;QAC5C,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YACtC,IAAI,EAAE,IAAA,sBAAW,EAAC,IAAI,CAAC;YACvB,KAAK,EAAE,IAAA,kBAAO,EAAC,MAAM,CAAC,KAAK,CAAC;YAC5B,MAAM,EAAE,IAAA,iBAAM,EAAC,MAAM,CAAC,MAAM,CAAC;YAC7B,QAAQ,EAAE,MAAM,CAAC,QAAQ;SAC1B,CAAC,CAAA;IACJ,CAAC;IAED,gDAAgD;IAChD,KAAK,CAAC,IAAI,CAAC,SAA4B,EAAE;QACvC,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAA;IAChE,CAAC;IAED,oEAAoE;IACpE,KAAK,CAAC,SAAS,CAAC,SAA4B,EAAE;QAC5C,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,oBAAoB,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAA;IAC1E,CAAC;IAED,4CAA4C;IAC5C,KAAK,CAAC,GAAG,CAAC,QAAkC;QAC1C,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,IAAA,sBAAW,EAAC,IAAA,eAAI,EAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,UAAU,CAAC,EAAE,CAAC,CAAA;IAC/F,CAAC;IAED,qIAAqI;IACrI,KAAK,CAAC,OAAO,CAAC,QAAkC,EAAE,SAA8B,EAAE;QAChF,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,IAAA,sBAAW,EAAC,IAAA,eAAI,EAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAA;IACpH,CAAC;IAED,gKAAgK;IAChK,KAAK,CAAC,OAAO,CAAC,QAAkC,EAAE,SAA8B,EAAE;QAChF,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,IAAA,sBAAW,EAAC,IAAA,eAAI,EAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAA;IACpH,CAAC;IAED,uCAAuC;IACvC,KAAK,CAAC,UAAU,CAAC,IAAa,EAAE,SAAqB,EAAE;QACrD,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,IAAA,sBAAW,EAAC,IAAA,sBAAW,EAAC,IAAI,CAAC,EAAE,MAAM,CAAC,aAAa,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC,CAAA;IAC5G,CAAC;IAED,0EAA0E;IAC1E,KAAK,CAAC,SAAS,CAAC,IAAa;QAC3B,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,IAAA,sBAAW,EAAC,IAAA,sBAAW,EAAC,IAAI,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAA;IAC5F,CAAC;CACF;AApDD,0CAoDC;AAED,SAAS,cAAc,CAAC,MAAyB;IAC/C,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAA;IAChC,OAAO,EAAE,IAAI,EAAE,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAA,sBAAW,EAAC,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,CAAA;AAC/F,CAAC;AAED,+FAA+F;AAC/F,SAAS,UAAU,CAAC,MAA2B;IAC7C,OAAO,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAA,iBAAM,EAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAA;AAC7E,CAAC"}