@bitgen/sdk 1.0.8 → 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.
- package/CHANGELOG.md +13 -0
- package/README.md +3 -1
- package/dist/cjs/client.d.ts +4 -0
- package/dist/cjs/client.d.ts.map +1 -1
- package/dist/cjs/client.js +6 -0
- package/dist/cjs/client.js.map +1 -1
- package/dist/cjs/constants.d.ts +118 -0
- package/dist/cjs/constants.d.ts.map +1 -1
- package/dist/cjs/constants.js +93 -1
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +14 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/resources/autotrading.d.ts +44 -0
- package/dist/cjs/resources/autotrading.d.ts.map +1 -0
- package/dist/cjs/resources/autotrading.js +116 -0
- package/dist/cjs/resources/autotrading.js.map +1 -0
- package/dist/cjs/resources/bot.d.ts +31 -0
- package/dist/cjs/resources/bot.d.ts.map +1 -0
- package/dist/cjs/resources/bot.js +54 -0
- package/dist/cjs/resources/bot.js.map +1 -0
- package/dist/cjs/types/autotrading.d.ts +196 -0
- package/dist/cjs/types/autotrading.d.ts.map +1 -0
- package/dist/cjs/types/autotrading.js +3 -0
- package/dist/cjs/types/autotrading.js.map +1 -0
- package/dist/cjs/types/bot.d.ts +45 -0
- package/dist/cjs/types/bot.d.ts.map +1 -0
- package/dist/cjs/types/bot.js +3 -0
- package/dist/cjs/types/bot.js.map +1 -0
- package/dist/cjs/types/index.d.ts +13 -3
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client.d.ts +4 -0
- package/dist/esm/client.d.ts.map +1 -1
- package/dist/esm/client.js +6 -0
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/constants.d.ts +118 -0
- package/dist/esm/constants.d.ts.map +1 -1
- package/dist/esm/constants.js +92 -0
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/resources/autotrading.d.ts +44 -0
- package/dist/esm/resources/autotrading.d.ts.map +1 -0
- package/dist/esm/resources/autotrading.js +112 -0
- package/dist/esm/resources/autotrading.js.map +1 -0
- package/dist/esm/resources/bot.d.ts +31 -0
- package/dist/esm/resources/bot.d.ts.map +1 -0
- package/dist/esm/resources/bot.js +50 -0
- package/dist/esm/resources/bot.js.map +1 -0
- package/dist/esm/types/autotrading.d.ts +196 -0
- package/dist/esm/types/autotrading.d.ts.map +1 -0
- package/dist/esm/types/autotrading.js +2 -0
- package/dist/esm/types/autotrading.js.map +1 -0
- package/dist/esm/types/bot.d.ts +45 -0
- package/dist/esm/types/bot.d.ts.map +1 -0
- package/dist/esm/types/bot.js +2 -0
- package/dist/esm/types/bot.js.map +1 -0
- package/dist/esm/types/index.d.ts +13 -3
- package/dist/esm/types/index.d.ts.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +1 -1
- package/readme/concepts.md +3 -3
- package/readme/errors.md +1 -1
- package/readme/resource/autotrading.md +304 -0
- package/readme/resource/bot.md +207 -0
- package/readme/resource/customer.md +1 -1
- package/readme/resource/transaction.md +1 -1
- package/readme/resource/webhooks.md +2 -0
- package/src/client.ts +6 -0
- package/src/constants.ts +131 -0
- package/src/index.ts +28 -0
- package/src/resources/autotrading.ts +132 -0
- package/src/resources/bot.ts +58 -0
- package/src/types/autotrading.ts +218 -0
- package/src/types/bot.ts +48 -0
- package/src/types/index.ts +45 -3
- package/src/version.ts +1 -1
package/src/types/index.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
2
|
+
export const VERSION = "1.1.0"
|