@bulletxyz/bullet-sdk 0.49.1 → 0.49.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/bullet_wasm_bg.wasm +0 -0
- package/dist/browser/index.js +28 -11
- package/dist/browser/index.js.map +4 -4
- package/dist/node/bullet_wasm_bg.wasm +0 -0
- package/dist/node/index.js +28 -11
- package/dist/node/index.js.map +4 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/client.d.ts +4 -3
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/rollupTypes.d.ts +14 -0
- package/dist/types/rollupTypes.d.ts.map +1 -1
- package/dist/types/zod-types/rest.d.ts +16 -2
- package/dist/types/zod-types/rest.d.ts.map +1 -1
- package/package.json +1 -1
|
Binary file
|
package/dist/node/index.js
CHANGED
|
@@ -2312,6 +2312,11 @@ var StateResponseSchemas = {
|
|
|
2312
2312
|
UserAccountConfigV0: z3.object({
|
|
2313
2313
|
delegates: createJsonMap(Base58Address, z3.string())
|
|
2314
2314
|
}),
|
|
2315
|
+
DelegateContainer: z3.object({
|
|
2316
|
+
delegator: Base58Address,
|
|
2317
|
+
expires_at: UnixTimestampMicros.nullable(),
|
|
2318
|
+
flags: U32Schema
|
|
2319
|
+
}),
|
|
2315
2320
|
RiskEngineV0: z3.object({
|
|
2316
2321
|
pricing_engine: PricingEngine,
|
|
2317
2322
|
margin_config: MarginConfig
|
|
@@ -2369,12 +2374,16 @@ var StateResponseSchemas = {
|
|
|
2369
2374
|
found: createJsonMap(MarketId, Schemas.OrderbookL2),
|
|
2370
2375
|
not_found: z3.array(MarketId)
|
|
2371
2376
|
})),
|
|
2372
|
-
|
|
2377
|
+
UserAccount: createBaseResponse(z3.object({
|
|
2373
2378
|
address: Base58Address,
|
|
2374
2379
|
account: Schemas.UserAccount
|
|
2375
2380
|
})),
|
|
2381
|
+
Delegate: createBaseResponse(z3.object({
|
|
2382
|
+
address: Base58Address,
|
|
2383
|
+
container: Schemas.DelegateContainer
|
|
2384
|
+
})),
|
|
2376
2385
|
UserAccountConfig: StateResponseSchemas.StateMapElement(Base58Address, VersionedV0(Schemas.UserAccountConfigV0)),
|
|
2377
|
-
|
|
2386
|
+
UserAccountBulk: createBaseResponse(z3.object({
|
|
2378
2387
|
found: createJsonMap(Base58Address, Schemas.UserAccount),
|
|
2379
2388
|
not_found: z3.array(Base58Address)
|
|
2380
2389
|
})),
|
|
@@ -2597,18 +2606,22 @@ class ReadOnlyClient {
|
|
|
2597
2606
|
}
|
|
2598
2607
|
async getUserAccount(address) {
|
|
2599
2608
|
let path = `/modules/exchange/api/v1/account/${address}`, response = await this.fetchApiResource(path);
|
|
2600
|
-
return ResponseSchemas.
|
|
2609
|
+
return ResponseSchemas.UserAccount.parse(response).account;
|
|
2601
2610
|
}
|
|
2602
2611
|
async getUserAccounts(addresses) {
|
|
2603
2612
|
let response = await this.fetchBulkApiResource("/modules/exchange/api/v1/account/bulk", {
|
|
2604
2613
|
addresses
|
|
2605
2614
|
});
|
|
2606
|
-
return ResponseSchemas.
|
|
2615
|
+
return ResponseSchemas.UserAccountBulk.parse(response).found;
|
|
2607
2616
|
}
|
|
2608
2617
|
async getUserAccountConfig(address) {
|
|
2609
2618
|
let path = `/modules/exchange/state/user-account-configs/items/${address}`, response = await this.fetchApiResource(path);
|
|
2610
2619
|
return ResponseSchemas.UserAccountConfig.parse(response).value;
|
|
2611
2620
|
}
|
|
2621
|
+
async getDelegateContainer(delegate) {
|
|
2622
|
+
let path = `/modules/exchange/api/v1/delegate/${delegate}`, response = await this.fetchApiResource(path);
|
|
2623
|
+
return ResponseSchemas.Delegate.parse(response).container;
|
|
2624
|
+
}
|
|
2612
2625
|
async getExchangeAssets() {
|
|
2613
2626
|
let response = await this.fetchApiResource("/modules/exchange/state/exchange-assets");
|
|
2614
2627
|
return ResponseSchemas.ExchangeAssets.parse(response).value;
|
|
@@ -3766,14 +3779,16 @@ class AuthenticatedClient extends ReadOnlyClient {
|
|
|
3766
3779
|
}
|
|
3767
3780
|
});
|
|
3768
3781
|
}
|
|
3769
|
-
async delegateUser(delegate, name, subAccountIndex) {
|
|
3782
|
+
async delegateUser(delegate, name, flags, subAccountIndex = null, expiresAt = null) {
|
|
3770
3783
|
return await this.submitTransaction({
|
|
3771
3784
|
exchange: {
|
|
3772
3785
|
user: {
|
|
3773
|
-
|
|
3786
|
+
delegate_user_v_2: {
|
|
3774
3787
|
delegate,
|
|
3775
3788
|
name,
|
|
3776
|
-
sub_account_index: subAccountIndex
|
|
3789
|
+
sub_account_index: subAccountIndex,
|
|
3790
|
+
expires_at: expiresAt,
|
|
3791
|
+
flags
|
|
3777
3792
|
}
|
|
3778
3793
|
}
|
|
3779
3794
|
}
|
|
@@ -3791,14 +3806,16 @@ class AuthenticatedClient extends ReadOnlyClient {
|
|
|
3791
3806
|
}
|
|
3792
3807
|
});
|
|
3793
3808
|
}
|
|
3794
|
-
async vaultDelegateUser(vaultAddress, delegate, name) {
|
|
3809
|
+
async vaultDelegateUser(vaultAddress, delegate, name, flags, expiresAt = null) {
|
|
3795
3810
|
return await this.submitTransaction({
|
|
3796
3811
|
exchange: {
|
|
3797
3812
|
vault: {
|
|
3798
|
-
|
|
3813
|
+
delegate_vault_user_v_1: {
|
|
3799
3814
|
vault_address: vaultAddress,
|
|
3800
3815
|
delegate,
|
|
3801
|
-
name
|
|
3816
|
+
name,
|
|
3817
|
+
expires_at: expiresAt,
|
|
3818
|
+
flags
|
|
3802
3819
|
}
|
|
3803
3820
|
}
|
|
3804
3821
|
}
|
|
@@ -4416,4 +4433,4 @@ export {
|
|
|
4416
4433
|
AbortError
|
|
4417
4434
|
};
|
|
4418
4435
|
|
|
4419
|
-
//# debugId=
|
|
4436
|
+
//# debugId=3292D5FB9802B47E64756E2164756E21
|