@bitgen/sdk 1.0.7 → 1.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 (86) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +5 -3
  3. package/dist/cjs/client.d.ts +4 -0
  4. package/dist/cjs/client.d.ts.map +1 -1
  5. package/dist/cjs/client.js +6 -0
  6. package/dist/cjs/client.js.map +1 -1
  7. package/dist/cjs/constants.d.ts +118 -0
  8. package/dist/cjs/constants.d.ts.map +1 -1
  9. package/dist/cjs/constants.js +93 -1
  10. package/dist/cjs/constants.js.map +1 -1
  11. package/dist/cjs/index.d.ts +2 -2
  12. package/dist/cjs/index.d.ts.map +1 -1
  13. package/dist/cjs/index.js +14 -1
  14. package/dist/cjs/index.js.map +1 -1
  15. package/dist/cjs/resources/autotrading.d.ts +44 -0
  16. package/dist/cjs/resources/autotrading.d.ts.map +1 -0
  17. package/dist/cjs/resources/autotrading.js +116 -0
  18. package/dist/cjs/resources/autotrading.js.map +1 -0
  19. package/dist/cjs/resources/bot.d.ts +31 -0
  20. package/dist/cjs/resources/bot.d.ts.map +1 -0
  21. package/dist/cjs/resources/bot.js +54 -0
  22. package/dist/cjs/resources/bot.js.map +1 -0
  23. package/dist/cjs/types/autotrading.d.ts +196 -0
  24. package/dist/cjs/types/autotrading.d.ts.map +1 -0
  25. package/dist/cjs/types/autotrading.js +3 -0
  26. package/dist/cjs/types/autotrading.js.map +1 -0
  27. package/dist/cjs/types/bot.d.ts +45 -0
  28. package/dist/cjs/types/bot.d.ts.map +1 -0
  29. package/dist/cjs/types/bot.js +3 -0
  30. package/dist/cjs/types/bot.js.map +1 -0
  31. package/dist/cjs/types/index.d.ts +13 -3
  32. package/dist/cjs/types/index.d.ts.map +1 -1
  33. package/dist/cjs/version.d.ts +1 -1
  34. package/dist/cjs/version.js +1 -1
  35. package/dist/esm/client.d.ts +4 -0
  36. package/dist/esm/client.d.ts.map +1 -1
  37. package/dist/esm/client.js +6 -0
  38. package/dist/esm/client.js.map +1 -1
  39. package/dist/esm/constants.d.ts +118 -0
  40. package/dist/esm/constants.d.ts.map +1 -1
  41. package/dist/esm/constants.js +92 -0
  42. package/dist/esm/constants.js.map +1 -1
  43. package/dist/esm/index.d.ts +2 -2
  44. package/dist/esm/index.d.ts.map +1 -1
  45. package/dist/esm/index.js +1 -1
  46. package/dist/esm/index.js.map +1 -1
  47. package/dist/esm/resources/autotrading.d.ts +44 -0
  48. package/dist/esm/resources/autotrading.d.ts.map +1 -0
  49. package/dist/esm/resources/autotrading.js +112 -0
  50. package/dist/esm/resources/autotrading.js.map +1 -0
  51. package/dist/esm/resources/bot.d.ts +31 -0
  52. package/dist/esm/resources/bot.d.ts.map +1 -0
  53. package/dist/esm/resources/bot.js +50 -0
  54. package/dist/esm/resources/bot.js.map +1 -0
  55. package/dist/esm/types/autotrading.d.ts +196 -0
  56. package/dist/esm/types/autotrading.d.ts.map +1 -0
  57. package/dist/esm/types/autotrading.js +2 -0
  58. package/dist/esm/types/autotrading.js.map +1 -0
  59. package/dist/esm/types/bot.d.ts +45 -0
  60. package/dist/esm/types/bot.d.ts.map +1 -0
  61. package/dist/esm/types/bot.js +2 -0
  62. package/dist/esm/types/bot.js.map +1 -0
  63. package/dist/esm/types/index.d.ts +13 -3
  64. package/dist/esm/types/index.d.ts.map +1 -1
  65. package/dist/esm/version.d.ts +1 -1
  66. package/dist/esm/version.js +1 -1
  67. package/package.json +1 -1
  68. package/readme/concepts.md +3 -3
  69. package/readme/configuration.md +2 -2
  70. package/readme/errors.md +1 -1
  71. package/readme/quick-start.md +2 -2
  72. package/readme/resource/autotrading.md +304 -0
  73. package/readme/resource/bot.md +207 -0
  74. package/readme/resource/custody.md +1 -1
  75. package/readme/resource/customer.md +1 -1
  76. package/readme/resource/transaction.md +1 -1
  77. package/readme/resource/webhooks.md +3 -1
  78. package/src/client.ts +6 -0
  79. package/src/constants.ts +131 -0
  80. package/src/index.ts +28 -0
  81. package/src/resources/autotrading.ts +132 -0
  82. package/src/resources/bot.ts +58 -0
  83. package/src/types/autotrading.ts +218 -0
  84. package/src/types/bot.ts +48 -0
  85. package/src/types/index.ts +45 -3
  86. package/src/version.ts +1 -1
@@ -1,5 +1,7 @@
1
1
  import type { Env } from '../constants.js'
2
2
  import type { Asset as AssetModel } from './asset.js'
3
+ import type { Bot, BotApplication } from './bot.js'
4
+ import type { Strategy } from './autotrading.js'
3
5
  import type { Account, Customer } from './customer.js'
4
6
  import type { OrderUser } from './trading.js'
5
7
 
@@ -21,7 +23,7 @@ export interface BitgenConfig {
21
23
 
22
24
  // ─── Shared ───────────────────────────────────────────────────────────────────
23
25
 
24
- /** `{ uuid }` — what a creation answers (`customer.create`, `bank.credit`, `staking.stake`, `webhooks.subscribe`); carries a customer's uuid where it is one */
26
+ /** `{ uuid }` — what a creation answers (`customer.create`, `bank.credit`, `staking.stake`, `webhooks.subscribe`, `bot.create`, `autotrading.create`); carries a customer's uuid where it is one */
25
27
  export interface Created {
26
28
  uuid: string
27
29
  }
@@ -37,7 +39,7 @@ export interface AssetRef {
37
39
  export type AssetInput = string | AssetModel | AssetRef
38
40
 
39
41
  /**
40
- * A user as a transaction or a staking movement references them — `{ uuid, state, login, account: { firstname, lastname, fin } }`:
42
+ * A user as a transaction, a staking movement or a strategy references them — `{ uuid, state, login, account: { firstname, lastname, fin } }`:
41
43
  * the customer (`owner`) or the compliance officer in charge (`assignee`). An `owner` carries the customer's uuid.
42
44
  */
43
45
  export interface UserSummary {
@@ -54,7 +56,7 @@ export interface OrganizationHub {
54
56
  name: string
55
57
  }
56
58
 
57
- /** An organization as a transaction or a staking movement references it — `hub` is only given on a transaction */
59
+ /** An organization as a transaction, a staking movement or a strategy references it — `hub` is only given on a transaction */
58
60
  export interface OrganizationSummary {
59
61
  uuid: string
60
62
  state: string
@@ -69,6 +71,15 @@ export interface OrganizationSummary {
69
71
  */
70
72
  export type UserRef = string | Created | Customer | Account | UserSummary | OrderUser
71
73
 
74
+ /** A bot as accepted by every method expecting one: its uuid, or one of the models that carry it — the `Created` of `bot.create`, or a `Bot` */
75
+ export type BotRef = string | Created | Bot
76
+
77
+ /** A module as accepted by every method expecting one: its uuid, or a `BotApplication` returned by the SDK */
78
+ export type BotModuleRef = string | BotApplication
79
+
80
+ /** A strategy as accepted by every method expecting one: its uuid, or one of the models that carry it — the `Created` of `autotrading.create`, or a `Strategy` */
81
+ export type StrategyRef = string | Created | Strategy
82
+
72
83
  /** An amount as accepted by the SDK — always sent to the API as a string; prefer strings, a `number` only keeps ~15 significant digits */
73
84
  export type Amount = string | number
74
85
 
@@ -213,3 +224,34 @@ export type {
213
224
  ApikeyLog,
214
225
  ApikeyListParams,
215
226
  } from './apikeys.js'
227
+
228
+ export type {
229
+ BotState,
230
+ BotApplicationState,
231
+ ExtensionState,
232
+ ExtensionCategory,
233
+ BotExtension,
234
+ BotApplication,
235
+ Bot,
236
+ BotListParams,
237
+ } from './bot.js'
238
+
239
+ export type {
240
+ StrategyState,
241
+ StrategyRisk,
242
+ StrategyFrequency,
243
+ StrategyAllocation,
244
+ StrategyClosing,
245
+ StrategyNotifyMode,
246
+ StrategyJournalEvent,
247
+ StrategyExitReason,
248
+ StrategyIdleReason,
249
+ StrategyGuards,
250
+ Strategy,
251
+ StrategyInput,
252
+ StrategyListParams,
253
+ StrategyRatios,
254
+ StrategyHistory,
255
+ StrategyJournalEntry,
256
+ AutotradingPortfolio,
257
+ } from './autotrading.js'
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by scripts/prebuild.js from package.json — do not edit
2
- export const VERSION = "1.0.7"
2
+ export const VERSION = "1.1.0"