@pear-protocol/core-sdk 1.17.4 → 1.19.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/dist/core/index.d.ts +76 -4
- package/dist/core/index.js +50 -1
- package/package.json +3 -3
package/dist/core/index.d.ts
CHANGED
|
@@ -187,7 +187,7 @@ declare class Core {
|
|
|
187
187
|
get: (query?: HttpTypes.QuoteFeeParamsInput, headers?: ClientHeaders) => Promise<{
|
|
188
188
|
baseBps: string;
|
|
189
189
|
discounts: {
|
|
190
|
-
scope: "
|
|
190
|
+
scope: "connector" | "all" | "user" | "client_id";
|
|
191
191
|
rate: string;
|
|
192
192
|
}[];
|
|
193
193
|
finalBps: string;
|
|
@@ -257,6 +257,7 @@ declare class Core {
|
|
|
257
257
|
price: string;
|
|
258
258
|
filledQuantity: string;
|
|
259
259
|
error?: string | undefined;
|
|
260
|
+
errorCode?: string | undefined;
|
|
260
261
|
filledPrice?: string | undefined;
|
|
261
262
|
}[] | undefined;
|
|
262
263
|
} | {
|
|
@@ -299,6 +300,7 @@ declare class Core {
|
|
|
299
300
|
price: string;
|
|
300
301
|
filledQuantity: string;
|
|
301
302
|
error?: string | undefined;
|
|
303
|
+
errorCode?: string | undefined;
|
|
302
304
|
filledPrice?: string | undefined;
|
|
303
305
|
}[] | undefined;
|
|
304
306
|
} | {
|
|
@@ -328,6 +330,7 @@ declare class Core {
|
|
|
328
330
|
price: string;
|
|
329
331
|
filledQuantity: string;
|
|
330
332
|
error?: string | undefined;
|
|
333
|
+
errorCode?: string | undefined;
|
|
331
334
|
filledPrice?: string | undefined;
|
|
332
335
|
}[] | undefined;
|
|
333
336
|
} | {
|
|
@@ -357,6 +360,7 @@ declare class Core {
|
|
|
357
360
|
price: string;
|
|
358
361
|
filledQuantity: string;
|
|
359
362
|
error?: string | undefined;
|
|
363
|
+
errorCode?: string | undefined;
|
|
360
364
|
filledPrice?: string | undefined;
|
|
361
365
|
}[] | undefined;
|
|
362
366
|
})[];
|
|
@@ -399,6 +403,7 @@ declare class Core {
|
|
|
399
403
|
price: string;
|
|
400
404
|
filledQuantity: string;
|
|
401
405
|
error?: string | undefined;
|
|
406
|
+
errorCode?: string | undefined;
|
|
402
407
|
filledPrice?: string | undefined;
|
|
403
408
|
}[] | undefined;
|
|
404
409
|
} | {
|
|
@@ -441,6 +446,7 @@ declare class Core {
|
|
|
441
446
|
price: string;
|
|
442
447
|
filledQuantity: string;
|
|
443
448
|
error?: string | undefined;
|
|
449
|
+
errorCode?: string | undefined;
|
|
444
450
|
filledPrice?: string | undefined;
|
|
445
451
|
}[] | undefined;
|
|
446
452
|
} | {
|
|
@@ -470,6 +476,7 @@ declare class Core {
|
|
|
470
476
|
price: string;
|
|
471
477
|
filledQuantity: string;
|
|
472
478
|
error?: string | undefined;
|
|
479
|
+
errorCode?: string | undefined;
|
|
473
480
|
filledPrice?: string | undefined;
|
|
474
481
|
}[] | undefined;
|
|
475
482
|
} | {
|
|
@@ -499,6 +506,7 @@ declare class Core {
|
|
|
499
506
|
price: string;
|
|
500
507
|
filledQuantity: string;
|
|
501
508
|
error?: string | undefined;
|
|
509
|
+
errorCode?: string | undefined;
|
|
502
510
|
filledPrice?: string | undefined;
|
|
503
511
|
}[] | undefined;
|
|
504
512
|
};
|
|
@@ -2785,11 +2793,16 @@ declare class Core {
|
|
|
2785
2793
|
referees: (query?: HttpTypes.ReferralRefereeListParamsInput, headers?: ClientHeaders) => Promise<{
|
|
2786
2794
|
limit: number;
|
|
2787
2795
|
count: number;
|
|
2788
|
-
|
|
2796
|
+
pendingCount: number;
|
|
2797
|
+
referees: ({
|
|
2798
|
+
status: "BOUND";
|
|
2789
2799
|
tradeCount: number;
|
|
2790
2800
|
address?: `0x${string}` | undefined;
|
|
2791
2801
|
referredAt?: number | undefined;
|
|
2792
|
-
}
|
|
2802
|
+
} | {
|
|
2803
|
+
status: "PENDING";
|
|
2804
|
+
address: `0x${string}`;
|
|
2805
|
+
})[];
|
|
2793
2806
|
nextCursor?: string | undefined;
|
|
2794
2807
|
}>;
|
|
2795
2808
|
};
|
|
@@ -3070,7 +3083,9 @@ declare class Core {
|
|
|
3070
3083
|
confirmedExchangeFillIds?: string[] | undefined;
|
|
3071
3084
|
}>;
|
|
3072
3085
|
reconcile: (body: HttpTypes.ReconcileFillsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
|
|
3086
|
+
reconcileBulk: (body: HttpTypes.ReconcileFillsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
|
|
3073
3087
|
confirm: (body: HttpTypes.ConfirmFillsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
|
|
3088
|
+
confirmBulk: (body: HttpTypes.ConfirmFillsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
|
|
3074
3089
|
create: (body: HttpTypes.CreateApplicablesRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
|
|
3075
3090
|
createBulk: (body: HttpTypes.CreateApplicablesRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
|
|
3076
3091
|
};
|
|
@@ -3120,6 +3135,7 @@ declare class Core {
|
|
|
3120
3135
|
price: string;
|
|
3121
3136
|
filledQuantity: string;
|
|
3122
3137
|
error?: string | undefined;
|
|
3138
|
+
errorCode?: string | undefined;
|
|
3123
3139
|
filledPrice?: string | undefined;
|
|
3124
3140
|
}[] | undefined;
|
|
3125
3141
|
} | {
|
|
@@ -3162,6 +3178,7 @@ declare class Core {
|
|
|
3162
3178
|
price: string;
|
|
3163
3179
|
filledQuantity: string;
|
|
3164
3180
|
error?: string | undefined;
|
|
3181
|
+
errorCode?: string | undefined;
|
|
3165
3182
|
filledPrice?: string | undefined;
|
|
3166
3183
|
}[] | undefined;
|
|
3167
3184
|
} | {
|
|
@@ -3191,6 +3208,7 @@ declare class Core {
|
|
|
3191
3208
|
price: string;
|
|
3192
3209
|
filledQuantity: string;
|
|
3193
3210
|
error?: string | undefined;
|
|
3211
|
+
errorCode?: string | undefined;
|
|
3194
3212
|
filledPrice?: string | undefined;
|
|
3195
3213
|
}[] | undefined;
|
|
3196
3214
|
} | {
|
|
@@ -3220,6 +3238,7 @@ declare class Core {
|
|
|
3220
3238
|
price: string;
|
|
3221
3239
|
filledQuantity: string;
|
|
3222
3240
|
error?: string | undefined;
|
|
3241
|
+
errorCode?: string | undefined;
|
|
3223
3242
|
filledPrice?: string | undefined;
|
|
3224
3243
|
}[] | undefined;
|
|
3225
3244
|
};
|
|
@@ -3261,6 +3280,7 @@ declare class Core {
|
|
|
3261
3280
|
price: string;
|
|
3262
3281
|
filledQuantity: string;
|
|
3263
3282
|
error?: string | undefined;
|
|
3283
|
+
errorCode?: string | undefined;
|
|
3264
3284
|
filledPrice?: string | undefined;
|
|
3265
3285
|
}[] | undefined;
|
|
3266
3286
|
} | {
|
|
@@ -3303,6 +3323,7 @@ declare class Core {
|
|
|
3303
3323
|
price: string;
|
|
3304
3324
|
filledQuantity: string;
|
|
3305
3325
|
error?: string | undefined;
|
|
3326
|
+
errorCode?: string | undefined;
|
|
3306
3327
|
filledPrice?: string | undefined;
|
|
3307
3328
|
}[] | undefined;
|
|
3308
3329
|
} | {
|
|
@@ -3332,6 +3353,7 @@ declare class Core {
|
|
|
3332
3353
|
price: string;
|
|
3333
3354
|
filledQuantity: string;
|
|
3334
3355
|
error?: string | undefined;
|
|
3356
|
+
errorCode?: string | undefined;
|
|
3335
3357
|
filledPrice?: string | undefined;
|
|
3336
3358
|
}[] | undefined;
|
|
3337
3359
|
} | {
|
|
@@ -3361,6 +3383,7 @@ declare class Core {
|
|
|
3361
3383
|
price: string;
|
|
3362
3384
|
filledQuantity: string;
|
|
3363
3385
|
error?: string | undefined;
|
|
3386
|
+
errorCode?: string | undefined;
|
|
3364
3387
|
filledPrice?: string | undefined;
|
|
3365
3388
|
}[] | undefined;
|
|
3366
3389
|
};
|
|
@@ -3402,6 +3425,7 @@ declare class Core {
|
|
|
3402
3425
|
price: string;
|
|
3403
3426
|
filledQuantity: string;
|
|
3404
3427
|
error?: string | undefined;
|
|
3428
|
+
errorCode?: string | undefined;
|
|
3405
3429
|
filledPrice?: string | undefined;
|
|
3406
3430
|
}[] | undefined;
|
|
3407
3431
|
} | {
|
|
@@ -3444,6 +3468,7 @@ declare class Core {
|
|
|
3444
3468
|
price: string;
|
|
3445
3469
|
filledQuantity: string;
|
|
3446
3470
|
error?: string | undefined;
|
|
3471
|
+
errorCode?: string | undefined;
|
|
3447
3472
|
filledPrice?: string | undefined;
|
|
3448
3473
|
}[] | undefined;
|
|
3449
3474
|
} | {
|
|
@@ -3473,6 +3498,7 @@ declare class Core {
|
|
|
3473
3498
|
price: string;
|
|
3474
3499
|
filledQuantity: string;
|
|
3475
3500
|
error?: string | undefined;
|
|
3501
|
+
errorCode?: string | undefined;
|
|
3476
3502
|
filledPrice?: string | undefined;
|
|
3477
3503
|
}[] | undefined;
|
|
3478
3504
|
} | {
|
|
@@ -3502,6 +3528,7 @@ declare class Core {
|
|
|
3502
3528
|
price: string;
|
|
3503
3529
|
filledQuantity: string;
|
|
3504
3530
|
error?: string | undefined;
|
|
3531
|
+
errorCode?: string | undefined;
|
|
3505
3532
|
filledPrice?: string | undefined;
|
|
3506
3533
|
}[] | undefined;
|
|
3507
3534
|
};
|
|
@@ -3543,6 +3570,7 @@ declare class Core {
|
|
|
3543
3570
|
price: string;
|
|
3544
3571
|
filledQuantity: string;
|
|
3545
3572
|
error?: string | undefined;
|
|
3573
|
+
errorCode?: string | undefined;
|
|
3546
3574
|
filledPrice?: string | undefined;
|
|
3547
3575
|
}[] | undefined;
|
|
3548
3576
|
} | {
|
|
@@ -3585,6 +3613,7 @@ declare class Core {
|
|
|
3585
3613
|
price: string;
|
|
3586
3614
|
filledQuantity: string;
|
|
3587
3615
|
error?: string | undefined;
|
|
3616
|
+
errorCode?: string | undefined;
|
|
3588
3617
|
filledPrice?: string | undefined;
|
|
3589
3618
|
}[] | undefined;
|
|
3590
3619
|
} | {
|
|
@@ -3614,6 +3643,7 @@ declare class Core {
|
|
|
3614
3643
|
price: string;
|
|
3615
3644
|
filledQuantity: string;
|
|
3616
3645
|
error?: string | undefined;
|
|
3646
|
+
errorCode?: string | undefined;
|
|
3617
3647
|
filledPrice?: string | undefined;
|
|
3618
3648
|
}[] | undefined;
|
|
3619
3649
|
} | {
|
|
@@ -3643,6 +3673,7 @@ declare class Core {
|
|
|
3643
3673
|
price: string;
|
|
3644
3674
|
filledQuantity: string;
|
|
3645
3675
|
error?: string | undefined;
|
|
3676
|
+
errorCode?: string | undefined;
|
|
3646
3677
|
filledPrice?: string | undefined;
|
|
3647
3678
|
}[] | undefined;
|
|
3648
3679
|
};
|
|
@@ -3684,6 +3715,7 @@ declare class Core {
|
|
|
3684
3715
|
price: string;
|
|
3685
3716
|
filledQuantity: string;
|
|
3686
3717
|
error?: string | undefined;
|
|
3718
|
+
errorCode?: string | undefined;
|
|
3687
3719
|
filledPrice?: string | undefined;
|
|
3688
3720
|
}[] | undefined;
|
|
3689
3721
|
} | {
|
|
@@ -3726,6 +3758,7 @@ declare class Core {
|
|
|
3726
3758
|
price: string;
|
|
3727
3759
|
filledQuantity: string;
|
|
3728
3760
|
error?: string | undefined;
|
|
3761
|
+
errorCode?: string | undefined;
|
|
3729
3762
|
filledPrice?: string | undefined;
|
|
3730
3763
|
}[] | undefined;
|
|
3731
3764
|
} | {
|
|
@@ -3755,6 +3788,7 @@ declare class Core {
|
|
|
3755
3788
|
price: string;
|
|
3756
3789
|
filledQuantity: string;
|
|
3757
3790
|
error?: string | undefined;
|
|
3791
|
+
errorCode?: string | undefined;
|
|
3758
3792
|
filledPrice?: string | undefined;
|
|
3759
3793
|
}[] | undefined;
|
|
3760
3794
|
} | {
|
|
@@ -3784,6 +3818,7 @@ declare class Core {
|
|
|
3784
3818
|
price: string;
|
|
3785
3819
|
filledQuantity: string;
|
|
3786
3820
|
error?: string | undefined;
|
|
3821
|
+
errorCode?: string | undefined;
|
|
3787
3822
|
filledPrice?: string | undefined;
|
|
3788
3823
|
}[] | undefined;
|
|
3789
3824
|
})[];
|
|
@@ -5138,6 +5173,43 @@ declare class Core {
|
|
|
5138
5173
|
submitFastWithdraw: (body: HttpTypes.SubmitLighterFastWithdrawParams, headers?: ClientHeaders) => Promise<{
|
|
5139
5174
|
txHash: string;
|
|
5140
5175
|
}>;
|
|
5176
|
+
/** Moves a Lighter account onto the standard, plus, or premium tier. */
|
|
5177
|
+
changeAccountTier: (body: HttpTypes.ChangeLighterAccountTierParams, headers?: ClientHeaders) => Promise<{
|
|
5178
|
+
tier: "standard" | "plus" | "premium";
|
|
5179
|
+
}>;
|
|
5180
|
+
/** Mints the Fun.xyz universal deposit addresses that credit a wallet's Lighter account. */
|
|
5181
|
+
createUda: (body: HttpTypes.CreateLighterUdaParams, headers?: ClientHeaders) => Promise<{
|
|
5182
|
+
uda: {
|
|
5183
|
+
status: "blocked";
|
|
5184
|
+
} | {
|
|
5185
|
+
status: "served";
|
|
5186
|
+
depositAddr: string;
|
|
5187
|
+
resolved: {
|
|
5188
|
+
toChainId: string;
|
|
5189
|
+
toTokenAddress: string;
|
|
5190
|
+
actionType: string;
|
|
5191
|
+
recipientAddr: string;
|
|
5192
|
+
userId: string;
|
|
5193
|
+
};
|
|
5194
|
+
solanaAddr?: string | undefined;
|
|
5195
|
+
tronAddr?: string | undefined;
|
|
5196
|
+
btcAddrSegwit?: string | undefined;
|
|
5197
|
+
};
|
|
5198
|
+
}>;
|
|
5199
|
+
/** Reads the deposits the Fun.xyz bridge has seen for one wallet. */
|
|
5200
|
+
listUdaDeposits: (walletAddress: string, headers?: ClientHeaders) => Promise<{
|
|
5201
|
+
transactions: {
|
|
5202
|
+
fromChainId: string;
|
|
5203
|
+
fromTokenAddress: string;
|
|
5204
|
+
fromAmountBaseUnit: string;
|
|
5205
|
+
toChainId: string;
|
|
5206
|
+
toTokenAddress: string;
|
|
5207
|
+
txHash: string;
|
|
5208
|
+
createdTimeMs: number;
|
|
5209
|
+
status: string;
|
|
5210
|
+
depositAddr: string;
|
|
5211
|
+
}[];
|
|
5212
|
+
}>;
|
|
5141
5213
|
};
|
|
5142
5214
|
};
|
|
5143
5215
|
statistics: {
|
|
@@ -5169,7 +5241,7 @@ declare class Core {
|
|
|
5169
5241
|
leaderboard: (query?: HttpTypes.LeaderboardQueryParamsInput, headers?: ClientHeaders) => Promise<{
|
|
5170
5242
|
data: {
|
|
5171
5243
|
tradeAccountId: string;
|
|
5172
|
-
|
|
5244
|
+
userId: string;
|
|
5173
5245
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
5174
5246
|
volume: string;
|
|
5175
5247
|
grossRealizedPnl: string;
|
package/dist/core/index.js
CHANGED
|
@@ -465,6 +465,19 @@ class Core {
|
|
|
465
465
|
body
|
|
466
466
|
});
|
|
467
467
|
}, "reconcile"),
|
|
468
|
+
reconcileBulk: /* @__PURE__ */ __name(async (body, headers) => {
|
|
469
|
+
const file = await gzipJson(body);
|
|
470
|
+
const formData = new FormData();
|
|
471
|
+
formData.append("file", file, "payload.json.gz");
|
|
472
|
+
return await this.client.fetch(`/sync/fills/reconcile/bulk`, {
|
|
473
|
+
method: "POST",
|
|
474
|
+
headers: {
|
|
475
|
+
...headers,
|
|
476
|
+
"content-type": null
|
|
477
|
+
},
|
|
478
|
+
body: formData
|
|
479
|
+
});
|
|
480
|
+
}, "reconcileBulk"),
|
|
468
481
|
confirm: /* @__PURE__ */ __name(async (body, headers) => {
|
|
469
482
|
return await this.client.fetch(`/sync/fills/confirm`, {
|
|
470
483
|
method: "POST",
|
|
@@ -472,6 +485,19 @@ class Core {
|
|
|
472
485
|
body
|
|
473
486
|
});
|
|
474
487
|
}, "confirm"),
|
|
488
|
+
confirmBulk: /* @__PURE__ */ __name(async (body, headers) => {
|
|
489
|
+
const file = await gzipJson(body);
|
|
490
|
+
const formData = new FormData();
|
|
491
|
+
formData.append("file", file, "payload.json.gz");
|
|
492
|
+
return await this.client.fetch(`/sync/fills/confirm/bulk`, {
|
|
493
|
+
method: "POST",
|
|
494
|
+
headers: {
|
|
495
|
+
...headers,
|
|
496
|
+
"content-type": null
|
|
497
|
+
},
|
|
498
|
+
body: formData
|
|
499
|
+
});
|
|
500
|
+
}, "confirmBulk"),
|
|
475
501
|
create: /* @__PURE__ */ __name(async (body, headers) => {
|
|
476
502
|
return await this.client.fetch(`/sync/fills/create`, {
|
|
477
503
|
method: "POST",
|
|
@@ -676,7 +702,30 @@ class Core {
|
|
|
676
702
|
headers,
|
|
677
703
|
body
|
|
678
704
|
});
|
|
679
|
-
}, "submitFastWithdraw")
|
|
705
|
+
}, "submitFastWithdraw"),
|
|
706
|
+
/** Moves a Lighter account onto the standard, plus, or premium tier. */
|
|
707
|
+
changeAccountTier: /* @__PURE__ */ __name(async (body, headers) => {
|
|
708
|
+
return await this.client.fetch(`/misc/lighter/change-account-tier`, {
|
|
709
|
+
method: "POST",
|
|
710
|
+
headers,
|
|
711
|
+
body
|
|
712
|
+
});
|
|
713
|
+
}, "changeAccountTier"),
|
|
714
|
+
/** Mints the Fun.xyz universal deposit addresses that credit a wallet's Lighter account. */
|
|
715
|
+
createUda: /* @__PURE__ */ __name(async (body, headers) => {
|
|
716
|
+
return await this.client.fetch(`/misc/lighter/uda`, {
|
|
717
|
+
method: "POST",
|
|
718
|
+
headers,
|
|
719
|
+
body
|
|
720
|
+
});
|
|
721
|
+
}, "createUda"),
|
|
722
|
+
/** Reads the deposits the Fun.xyz bridge has seen for one wallet. */
|
|
723
|
+
listUdaDeposits: /* @__PURE__ */ __name(async (walletAddress, headers) => {
|
|
724
|
+
return await this.client.fetch(`/misc/lighter/uda/${encodeURIComponent(walletAddress)}`, {
|
|
725
|
+
method: "GET",
|
|
726
|
+
headers
|
|
727
|
+
});
|
|
728
|
+
}, "listUdaDeposits")
|
|
680
729
|
}
|
|
681
730
|
};
|
|
682
731
|
statistics = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pear-protocol/core-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"description": "Pear Protocol Core SDK",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"typecheck": "tsc --noEmit"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@pear-protocol/types": "^1.
|
|
30
|
-
"@pear-protocol/utils": "^0.5.
|
|
29
|
+
"@pear-protocol/types": "^1.28.0",
|
|
30
|
+
"@pear-protocol/utils": "^0.5.3",
|
|
31
31
|
"qs": "^6.14.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|