@crypticdot/defituna-api 1.1.55 → 1.2.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/index.d.mts +644 -3
- package/dist/index.d.ts +644 -3
- package/dist/index.js +104 -63
- package/dist/index.mjs +104 -63
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -23,6 +23,10 @@ declare const TunaPositionState: {
|
|
|
23
23
|
readonly CLOSED_BY_LIMIT_ORDER: "closed_by_limit_order";
|
|
24
24
|
readonly CLOSED: "closed";
|
|
25
25
|
};
|
|
26
|
+
declare const TunaSpotPositionState: {
|
|
27
|
+
readonly OPEN: "open";
|
|
28
|
+
readonly CLOSED: "closed";
|
|
29
|
+
};
|
|
26
30
|
declare const LimitOrderState: {
|
|
27
31
|
readonly OPEN: "open";
|
|
28
32
|
readonly PARTIALLY_FILLED: "partially_filled";
|
|
@@ -44,6 +48,7 @@ declare const PoolSubscriptionTopic: {
|
|
|
44
48
|
};
|
|
45
49
|
declare const WalletSubscriptionTopic: {
|
|
46
50
|
readonly TUNA_POSITIONS: "tuna_positions";
|
|
51
|
+
readonly TUNA_SPOT_POSITIONS: "tuna_spot_positions";
|
|
47
52
|
readonly LENDING_POSITIONS: "lending_positions";
|
|
48
53
|
readonly FUSION_LIMIT_ORDERS: "fusion_limit_orders";
|
|
49
54
|
readonly STAKING_POSITION: "staking_position";
|
|
@@ -52,10 +57,11 @@ declare const NotificationEntitySchema: z.ZodEnum<["pool_swap", ...("pool_swap"
|
|
|
52
57
|
declare const NotificationActionSchema: z.ZodEnum<["create", ...("create" | "update")[]]>;
|
|
53
58
|
declare const PoolProviderSchema: z.ZodEnum<["orca", ...("orca" | "fusion")[]]>;
|
|
54
59
|
declare const TunaPositionStateSchema: z.ZodEnum<["open", ...("open" | "liquidated" | "closed_by_limit_order" | "closed")[]]>;
|
|
60
|
+
declare const TunaSpotPositionStateSchema: z.ZodEnum<["open", ...("open" | "closed")[]]>;
|
|
55
61
|
declare const LimitOrderStateSchema: z.ZodEnum<["open", ...("open" | "partially_filled" | "filled" | "complete" | "cancelled")[]]>;
|
|
56
62
|
declare const StakingPositionHistoryActionTypeSchema: z.ZodEnum<["stake", ...("stake" | "unstake" | "withdraw" | "claim_rewards" | "compound_rewards")[]]>;
|
|
57
63
|
declare const PoolSubscriptionTopicSchema: z.ZodEnum<["order_book", ...("order_book" | "pool_prices" | "pool_swaps")[]]>;
|
|
58
|
-
declare const WalletSubscriptionTopicSchema: z.ZodEnum<["tuna_positions", ...("staking_position" | "tuna_positions" | "lending_positions" | "fusion_limit_orders")[]]>;
|
|
64
|
+
declare const WalletSubscriptionTopicSchema: z.ZodEnum<["tuna_positions", ...("staking_position" | "tuna_positions" | "tuna_spot_positions" | "lending_positions" | "fusion_limit_orders")[]]>;
|
|
59
65
|
declare const PaginationMeta$1: z.ZodObject<{
|
|
60
66
|
total: z.ZodNumber;
|
|
61
67
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1041,6 +1047,151 @@ declare const TunaPosition$1: z.ZodObject<{
|
|
|
1041
1047
|
updatedAtSlot: bigint;
|
|
1042
1048
|
closedAt: Date | null;
|
|
1043
1049
|
}>;
|
|
1050
|
+
declare const TunaSpotPosition$1: z.ZodObject<{
|
|
1051
|
+
address: z.ZodString;
|
|
1052
|
+
authority: z.ZodString;
|
|
1053
|
+
version: z.ZodNumber;
|
|
1054
|
+
state: z.ZodEnum<["open", ...("open" | "closed")[]]>;
|
|
1055
|
+
entrySqrtPrice: z.ZodBigInt;
|
|
1056
|
+
lowerLimitOrderSqrtPrice: z.ZodBigInt;
|
|
1057
|
+
upperLimitOrderSqrtPrice: z.ZodBigInt;
|
|
1058
|
+
flags: z.ZodNumber;
|
|
1059
|
+
pool: z.ZodString;
|
|
1060
|
+
poolSqrtPrice: z.ZodBigInt;
|
|
1061
|
+
collateralToken: z.ZodString;
|
|
1062
|
+
borrowToken: z.ZodString;
|
|
1063
|
+
positionToken: z.ZodString;
|
|
1064
|
+
collateral: z.ZodObject<{
|
|
1065
|
+
amount: z.ZodBigInt;
|
|
1066
|
+
usd: z.ZodNumber;
|
|
1067
|
+
}, "strip", z.ZodTypeAny, {
|
|
1068
|
+
amount: bigint;
|
|
1069
|
+
usd: number;
|
|
1070
|
+
}, {
|
|
1071
|
+
amount: bigint;
|
|
1072
|
+
usd: number;
|
|
1073
|
+
}>;
|
|
1074
|
+
loanFunds: z.ZodObject<{
|
|
1075
|
+
amount: z.ZodBigInt;
|
|
1076
|
+
usd: z.ZodNumber;
|
|
1077
|
+
}, "strip", z.ZodTypeAny, {
|
|
1078
|
+
amount: bigint;
|
|
1079
|
+
usd: number;
|
|
1080
|
+
}, {
|
|
1081
|
+
amount: bigint;
|
|
1082
|
+
usd: number;
|
|
1083
|
+
}>;
|
|
1084
|
+
currentLoan: z.ZodObject<{
|
|
1085
|
+
amount: z.ZodBigInt;
|
|
1086
|
+
usd: z.ZodNumber;
|
|
1087
|
+
}, "strip", z.ZodTypeAny, {
|
|
1088
|
+
amount: bigint;
|
|
1089
|
+
usd: number;
|
|
1090
|
+
}, {
|
|
1091
|
+
amount: bigint;
|
|
1092
|
+
usd: number;
|
|
1093
|
+
}>;
|
|
1094
|
+
total: z.ZodObject<{
|
|
1095
|
+
amount: z.ZodBigInt;
|
|
1096
|
+
usd: z.ZodNumber;
|
|
1097
|
+
}, "strip", z.ZodTypeAny, {
|
|
1098
|
+
amount: bigint;
|
|
1099
|
+
usd: number;
|
|
1100
|
+
}, {
|
|
1101
|
+
amount: bigint;
|
|
1102
|
+
usd: number;
|
|
1103
|
+
}>;
|
|
1104
|
+
pnlUsd: z.ZodObject<{
|
|
1105
|
+
amount: z.ZodNumber;
|
|
1106
|
+
bps: z.ZodNumber;
|
|
1107
|
+
}, "strip", z.ZodTypeAny, {
|
|
1108
|
+
amount: number;
|
|
1109
|
+
bps: number;
|
|
1110
|
+
}, {
|
|
1111
|
+
amount: number;
|
|
1112
|
+
bps: number;
|
|
1113
|
+
}>;
|
|
1114
|
+
openedAt: z.ZodDate;
|
|
1115
|
+
openedAtSlot: z.ZodBigInt;
|
|
1116
|
+
updatedAtSlot: z.ZodBigInt;
|
|
1117
|
+
closedAt: z.ZodNullable<z.ZodDate>;
|
|
1118
|
+
}, "strip", z.ZodTypeAny, {
|
|
1119
|
+
total: {
|
|
1120
|
+
amount: bigint;
|
|
1121
|
+
usd: number;
|
|
1122
|
+
};
|
|
1123
|
+
address: string;
|
|
1124
|
+
authority: string;
|
|
1125
|
+
version: number;
|
|
1126
|
+
state: "open" | "closed";
|
|
1127
|
+
entrySqrtPrice: bigint;
|
|
1128
|
+
lowerLimitOrderSqrtPrice: bigint;
|
|
1129
|
+
upperLimitOrderSqrtPrice: bigint;
|
|
1130
|
+
flags: number;
|
|
1131
|
+
pool: string;
|
|
1132
|
+
poolSqrtPrice: bigint;
|
|
1133
|
+
pnlUsd: {
|
|
1134
|
+
amount: number;
|
|
1135
|
+
bps: number;
|
|
1136
|
+
};
|
|
1137
|
+
openedAt: Date;
|
|
1138
|
+
updatedAtSlot: bigint;
|
|
1139
|
+
closedAt: Date | null;
|
|
1140
|
+
collateralToken: string;
|
|
1141
|
+
borrowToken: string;
|
|
1142
|
+
positionToken: string;
|
|
1143
|
+
collateral: {
|
|
1144
|
+
amount: bigint;
|
|
1145
|
+
usd: number;
|
|
1146
|
+
};
|
|
1147
|
+
loanFunds: {
|
|
1148
|
+
amount: bigint;
|
|
1149
|
+
usd: number;
|
|
1150
|
+
};
|
|
1151
|
+
currentLoan: {
|
|
1152
|
+
amount: bigint;
|
|
1153
|
+
usd: number;
|
|
1154
|
+
};
|
|
1155
|
+
openedAtSlot: bigint;
|
|
1156
|
+
}, {
|
|
1157
|
+
total: {
|
|
1158
|
+
amount: bigint;
|
|
1159
|
+
usd: number;
|
|
1160
|
+
};
|
|
1161
|
+
address: string;
|
|
1162
|
+
authority: string;
|
|
1163
|
+
version: number;
|
|
1164
|
+
state: "open" | "closed";
|
|
1165
|
+
entrySqrtPrice: bigint;
|
|
1166
|
+
lowerLimitOrderSqrtPrice: bigint;
|
|
1167
|
+
upperLimitOrderSqrtPrice: bigint;
|
|
1168
|
+
flags: number;
|
|
1169
|
+
pool: string;
|
|
1170
|
+
poolSqrtPrice: bigint;
|
|
1171
|
+
pnlUsd: {
|
|
1172
|
+
amount: number;
|
|
1173
|
+
bps: number;
|
|
1174
|
+
};
|
|
1175
|
+
openedAt: Date;
|
|
1176
|
+
updatedAtSlot: bigint;
|
|
1177
|
+
closedAt: Date | null;
|
|
1178
|
+
collateralToken: string;
|
|
1179
|
+
borrowToken: string;
|
|
1180
|
+
positionToken: string;
|
|
1181
|
+
collateral: {
|
|
1182
|
+
amount: bigint;
|
|
1183
|
+
usd: number;
|
|
1184
|
+
};
|
|
1185
|
+
loanFunds: {
|
|
1186
|
+
amount: bigint;
|
|
1187
|
+
usd: number;
|
|
1188
|
+
};
|
|
1189
|
+
currentLoan: {
|
|
1190
|
+
amount: bigint;
|
|
1191
|
+
usd: number;
|
|
1192
|
+
};
|
|
1193
|
+
openedAtSlot: bigint;
|
|
1194
|
+
}>;
|
|
1044
1195
|
declare const PoolSwap$1: z.ZodObject<{
|
|
1045
1196
|
id: z.ZodString;
|
|
1046
1197
|
amountIn: z.ZodBigInt;
|
|
@@ -3406,6 +3557,489 @@ declare const TunaPositionNotification: z.ZodObject<{
|
|
|
3406
3557
|
entity: "pool_swap" | "pool_price" | "order_book" | "tuna_position" | "lending_position" | "staking_position" | "fusion_limit_order";
|
|
3407
3558
|
meta?: any;
|
|
3408
3559
|
}>;
|
|
3560
|
+
declare const TunaSpotPositionNotification: z.ZodObject<{
|
|
3561
|
+
meta: z.ZodTypeAny;
|
|
3562
|
+
entity: z.ZodEnum<["pool_swap", ...("pool_swap" | "pool_price" | "order_book" | "tuna_position" | "lending_position" | "staking_position" | "fusion_limit_order")[]]>;
|
|
3563
|
+
action: z.ZodEnum<["create", ...("create" | "update")[]]>;
|
|
3564
|
+
data: z.ZodObject<{
|
|
3565
|
+
address: z.ZodString;
|
|
3566
|
+
authority: z.ZodString;
|
|
3567
|
+
version: z.ZodNumber;
|
|
3568
|
+
state: z.ZodEnum<["open", ...("open" | "closed")[]]>;
|
|
3569
|
+
entrySqrtPrice: z.ZodBigInt;
|
|
3570
|
+
lowerLimitOrderSqrtPrice: z.ZodBigInt;
|
|
3571
|
+
upperLimitOrderSqrtPrice: z.ZodBigInt;
|
|
3572
|
+
flags: z.ZodNumber;
|
|
3573
|
+
pool: z.ZodString;
|
|
3574
|
+
poolSqrtPrice: z.ZodBigInt;
|
|
3575
|
+
collateralToken: z.ZodString;
|
|
3576
|
+
borrowToken: z.ZodString;
|
|
3577
|
+
positionToken: z.ZodString;
|
|
3578
|
+
collateral: z.ZodObject<{
|
|
3579
|
+
amount: z.ZodBigInt;
|
|
3580
|
+
usd: z.ZodNumber;
|
|
3581
|
+
}, "strip", z.ZodTypeAny, {
|
|
3582
|
+
amount: bigint;
|
|
3583
|
+
usd: number;
|
|
3584
|
+
}, {
|
|
3585
|
+
amount: bigint;
|
|
3586
|
+
usd: number;
|
|
3587
|
+
}>;
|
|
3588
|
+
loanFunds: z.ZodObject<{
|
|
3589
|
+
amount: z.ZodBigInt;
|
|
3590
|
+
usd: z.ZodNumber;
|
|
3591
|
+
}, "strip", z.ZodTypeAny, {
|
|
3592
|
+
amount: bigint;
|
|
3593
|
+
usd: number;
|
|
3594
|
+
}, {
|
|
3595
|
+
amount: bigint;
|
|
3596
|
+
usd: number;
|
|
3597
|
+
}>;
|
|
3598
|
+
currentLoan: z.ZodObject<{
|
|
3599
|
+
amount: z.ZodBigInt;
|
|
3600
|
+
usd: z.ZodNumber;
|
|
3601
|
+
}, "strip", z.ZodTypeAny, {
|
|
3602
|
+
amount: bigint;
|
|
3603
|
+
usd: number;
|
|
3604
|
+
}, {
|
|
3605
|
+
amount: bigint;
|
|
3606
|
+
usd: number;
|
|
3607
|
+
}>;
|
|
3608
|
+
total: z.ZodObject<{
|
|
3609
|
+
amount: z.ZodBigInt;
|
|
3610
|
+
usd: z.ZodNumber;
|
|
3611
|
+
}, "strip", z.ZodTypeAny, {
|
|
3612
|
+
amount: bigint;
|
|
3613
|
+
usd: number;
|
|
3614
|
+
}, {
|
|
3615
|
+
amount: bigint;
|
|
3616
|
+
usd: number;
|
|
3617
|
+
}>;
|
|
3618
|
+
pnlUsd: z.ZodObject<{
|
|
3619
|
+
amount: z.ZodNumber;
|
|
3620
|
+
bps: z.ZodNumber;
|
|
3621
|
+
}, "strip", z.ZodTypeAny, {
|
|
3622
|
+
amount: number;
|
|
3623
|
+
bps: number;
|
|
3624
|
+
}, {
|
|
3625
|
+
amount: number;
|
|
3626
|
+
bps: number;
|
|
3627
|
+
}>;
|
|
3628
|
+
openedAt: z.ZodDate;
|
|
3629
|
+
openedAtSlot: z.ZodBigInt;
|
|
3630
|
+
updatedAtSlot: z.ZodBigInt;
|
|
3631
|
+
closedAt: z.ZodNullable<z.ZodDate>;
|
|
3632
|
+
}, "strip", z.ZodTypeAny, {
|
|
3633
|
+
total: {
|
|
3634
|
+
amount: bigint;
|
|
3635
|
+
usd: number;
|
|
3636
|
+
};
|
|
3637
|
+
address: string;
|
|
3638
|
+
authority: string;
|
|
3639
|
+
version: number;
|
|
3640
|
+
state: "open" | "closed";
|
|
3641
|
+
entrySqrtPrice: bigint;
|
|
3642
|
+
lowerLimitOrderSqrtPrice: bigint;
|
|
3643
|
+
upperLimitOrderSqrtPrice: bigint;
|
|
3644
|
+
flags: number;
|
|
3645
|
+
pool: string;
|
|
3646
|
+
poolSqrtPrice: bigint;
|
|
3647
|
+
pnlUsd: {
|
|
3648
|
+
amount: number;
|
|
3649
|
+
bps: number;
|
|
3650
|
+
};
|
|
3651
|
+
openedAt: Date;
|
|
3652
|
+
updatedAtSlot: bigint;
|
|
3653
|
+
closedAt: Date | null;
|
|
3654
|
+
collateralToken: string;
|
|
3655
|
+
borrowToken: string;
|
|
3656
|
+
positionToken: string;
|
|
3657
|
+
collateral: {
|
|
3658
|
+
amount: bigint;
|
|
3659
|
+
usd: number;
|
|
3660
|
+
};
|
|
3661
|
+
loanFunds: {
|
|
3662
|
+
amount: bigint;
|
|
3663
|
+
usd: number;
|
|
3664
|
+
};
|
|
3665
|
+
currentLoan: {
|
|
3666
|
+
amount: bigint;
|
|
3667
|
+
usd: number;
|
|
3668
|
+
};
|
|
3669
|
+
openedAtSlot: bigint;
|
|
3670
|
+
}, {
|
|
3671
|
+
total: {
|
|
3672
|
+
amount: bigint;
|
|
3673
|
+
usd: number;
|
|
3674
|
+
};
|
|
3675
|
+
address: string;
|
|
3676
|
+
authority: string;
|
|
3677
|
+
version: number;
|
|
3678
|
+
state: "open" | "closed";
|
|
3679
|
+
entrySqrtPrice: bigint;
|
|
3680
|
+
lowerLimitOrderSqrtPrice: bigint;
|
|
3681
|
+
upperLimitOrderSqrtPrice: bigint;
|
|
3682
|
+
flags: number;
|
|
3683
|
+
pool: string;
|
|
3684
|
+
poolSqrtPrice: bigint;
|
|
3685
|
+
pnlUsd: {
|
|
3686
|
+
amount: number;
|
|
3687
|
+
bps: number;
|
|
3688
|
+
};
|
|
3689
|
+
openedAt: Date;
|
|
3690
|
+
updatedAtSlot: bigint;
|
|
3691
|
+
closedAt: Date | null;
|
|
3692
|
+
collateralToken: string;
|
|
3693
|
+
borrowToken: string;
|
|
3694
|
+
positionToken: string;
|
|
3695
|
+
collateral: {
|
|
3696
|
+
amount: bigint;
|
|
3697
|
+
usd: number;
|
|
3698
|
+
};
|
|
3699
|
+
loanFunds: {
|
|
3700
|
+
amount: bigint;
|
|
3701
|
+
usd: number;
|
|
3702
|
+
};
|
|
3703
|
+
currentLoan: {
|
|
3704
|
+
amount: bigint;
|
|
3705
|
+
usd: number;
|
|
3706
|
+
};
|
|
3707
|
+
openedAtSlot: bigint;
|
|
3708
|
+
}>;
|
|
3709
|
+
id: z.ZodString;
|
|
3710
|
+
authority: z.ZodNullable<z.ZodString>;
|
|
3711
|
+
} | {
|
|
3712
|
+
meta: z.ZodNullable<z.ZodUndefined>;
|
|
3713
|
+
entity: z.ZodEnum<["pool_swap", ...("pool_swap" | "pool_price" | "order_book" | "tuna_position" | "lending_position" | "staking_position" | "fusion_limit_order")[]]>;
|
|
3714
|
+
action: z.ZodEnum<["create", ...("create" | "update")[]]>;
|
|
3715
|
+
data: z.ZodObject<{
|
|
3716
|
+
address: z.ZodString;
|
|
3717
|
+
authority: z.ZodString;
|
|
3718
|
+
version: z.ZodNumber;
|
|
3719
|
+
state: z.ZodEnum<["open", ...("open" | "closed")[]]>;
|
|
3720
|
+
entrySqrtPrice: z.ZodBigInt;
|
|
3721
|
+
lowerLimitOrderSqrtPrice: z.ZodBigInt;
|
|
3722
|
+
upperLimitOrderSqrtPrice: z.ZodBigInt;
|
|
3723
|
+
flags: z.ZodNumber;
|
|
3724
|
+
pool: z.ZodString;
|
|
3725
|
+
poolSqrtPrice: z.ZodBigInt;
|
|
3726
|
+
collateralToken: z.ZodString;
|
|
3727
|
+
borrowToken: z.ZodString;
|
|
3728
|
+
positionToken: z.ZodString;
|
|
3729
|
+
collateral: z.ZodObject<{
|
|
3730
|
+
amount: z.ZodBigInt;
|
|
3731
|
+
usd: z.ZodNumber;
|
|
3732
|
+
}, "strip", z.ZodTypeAny, {
|
|
3733
|
+
amount: bigint;
|
|
3734
|
+
usd: number;
|
|
3735
|
+
}, {
|
|
3736
|
+
amount: bigint;
|
|
3737
|
+
usd: number;
|
|
3738
|
+
}>;
|
|
3739
|
+
loanFunds: z.ZodObject<{
|
|
3740
|
+
amount: z.ZodBigInt;
|
|
3741
|
+
usd: z.ZodNumber;
|
|
3742
|
+
}, "strip", z.ZodTypeAny, {
|
|
3743
|
+
amount: bigint;
|
|
3744
|
+
usd: number;
|
|
3745
|
+
}, {
|
|
3746
|
+
amount: bigint;
|
|
3747
|
+
usd: number;
|
|
3748
|
+
}>;
|
|
3749
|
+
currentLoan: z.ZodObject<{
|
|
3750
|
+
amount: z.ZodBigInt;
|
|
3751
|
+
usd: z.ZodNumber;
|
|
3752
|
+
}, "strip", z.ZodTypeAny, {
|
|
3753
|
+
amount: bigint;
|
|
3754
|
+
usd: number;
|
|
3755
|
+
}, {
|
|
3756
|
+
amount: bigint;
|
|
3757
|
+
usd: number;
|
|
3758
|
+
}>;
|
|
3759
|
+
total: z.ZodObject<{
|
|
3760
|
+
amount: z.ZodBigInt;
|
|
3761
|
+
usd: z.ZodNumber;
|
|
3762
|
+
}, "strip", z.ZodTypeAny, {
|
|
3763
|
+
amount: bigint;
|
|
3764
|
+
usd: number;
|
|
3765
|
+
}, {
|
|
3766
|
+
amount: bigint;
|
|
3767
|
+
usd: number;
|
|
3768
|
+
}>;
|
|
3769
|
+
pnlUsd: z.ZodObject<{
|
|
3770
|
+
amount: z.ZodNumber;
|
|
3771
|
+
bps: z.ZodNumber;
|
|
3772
|
+
}, "strip", z.ZodTypeAny, {
|
|
3773
|
+
amount: number;
|
|
3774
|
+
bps: number;
|
|
3775
|
+
}, {
|
|
3776
|
+
amount: number;
|
|
3777
|
+
bps: number;
|
|
3778
|
+
}>;
|
|
3779
|
+
openedAt: z.ZodDate;
|
|
3780
|
+
openedAtSlot: z.ZodBigInt;
|
|
3781
|
+
updatedAtSlot: z.ZodBigInt;
|
|
3782
|
+
closedAt: z.ZodNullable<z.ZodDate>;
|
|
3783
|
+
}, "strip", z.ZodTypeAny, {
|
|
3784
|
+
total: {
|
|
3785
|
+
amount: bigint;
|
|
3786
|
+
usd: number;
|
|
3787
|
+
};
|
|
3788
|
+
address: string;
|
|
3789
|
+
authority: string;
|
|
3790
|
+
version: number;
|
|
3791
|
+
state: "open" | "closed";
|
|
3792
|
+
entrySqrtPrice: bigint;
|
|
3793
|
+
lowerLimitOrderSqrtPrice: bigint;
|
|
3794
|
+
upperLimitOrderSqrtPrice: bigint;
|
|
3795
|
+
flags: number;
|
|
3796
|
+
pool: string;
|
|
3797
|
+
poolSqrtPrice: bigint;
|
|
3798
|
+
pnlUsd: {
|
|
3799
|
+
amount: number;
|
|
3800
|
+
bps: number;
|
|
3801
|
+
};
|
|
3802
|
+
openedAt: Date;
|
|
3803
|
+
updatedAtSlot: bigint;
|
|
3804
|
+
closedAt: Date | null;
|
|
3805
|
+
collateralToken: string;
|
|
3806
|
+
borrowToken: string;
|
|
3807
|
+
positionToken: string;
|
|
3808
|
+
collateral: {
|
|
3809
|
+
amount: bigint;
|
|
3810
|
+
usd: number;
|
|
3811
|
+
};
|
|
3812
|
+
loanFunds: {
|
|
3813
|
+
amount: bigint;
|
|
3814
|
+
usd: number;
|
|
3815
|
+
};
|
|
3816
|
+
currentLoan: {
|
|
3817
|
+
amount: bigint;
|
|
3818
|
+
usd: number;
|
|
3819
|
+
};
|
|
3820
|
+
openedAtSlot: bigint;
|
|
3821
|
+
}, {
|
|
3822
|
+
total: {
|
|
3823
|
+
amount: bigint;
|
|
3824
|
+
usd: number;
|
|
3825
|
+
};
|
|
3826
|
+
address: string;
|
|
3827
|
+
authority: string;
|
|
3828
|
+
version: number;
|
|
3829
|
+
state: "open" | "closed";
|
|
3830
|
+
entrySqrtPrice: bigint;
|
|
3831
|
+
lowerLimitOrderSqrtPrice: bigint;
|
|
3832
|
+
upperLimitOrderSqrtPrice: bigint;
|
|
3833
|
+
flags: number;
|
|
3834
|
+
pool: string;
|
|
3835
|
+
poolSqrtPrice: bigint;
|
|
3836
|
+
pnlUsd: {
|
|
3837
|
+
amount: number;
|
|
3838
|
+
bps: number;
|
|
3839
|
+
};
|
|
3840
|
+
openedAt: Date;
|
|
3841
|
+
updatedAtSlot: bigint;
|
|
3842
|
+
closedAt: Date | null;
|
|
3843
|
+
collateralToken: string;
|
|
3844
|
+
borrowToken: string;
|
|
3845
|
+
positionToken: string;
|
|
3846
|
+
collateral: {
|
|
3847
|
+
amount: bigint;
|
|
3848
|
+
usd: number;
|
|
3849
|
+
};
|
|
3850
|
+
loanFunds: {
|
|
3851
|
+
amount: bigint;
|
|
3852
|
+
usd: number;
|
|
3853
|
+
};
|
|
3854
|
+
currentLoan: {
|
|
3855
|
+
amount: bigint;
|
|
3856
|
+
usd: number;
|
|
3857
|
+
};
|
|
3858
|
+
openedAtSlot: bigint;
|
|
3859
|
+
}>;
|
|
3860
|
+
id: z.ZodString;
|
|
3861
|
+
authority: z.ZodNullable<z.ZodString>;
|
|
3862
|
+
}, "strip", z.ZodTypeAny, {
|
|
3863
|
+
authority: string | null;
|
|
3864
|
+
id: string;
|
|
3865
|
+
data: {
|
|
3866
|
+
total: {
|
|
3867
|
+
amount: bigint;
|
|
3868
|
+
usd: number;
|
|
3869
|
+
};
|
|
3870
|
+
address: string;
|
|
3871
|
+
authority: string;
|
|
3872
|
+
version: number;
|
|
3873
|
+
state: "open" | "closed";
|
|
3874
|
+
entrySqrtPrice: bigint;
|
|
3875
|
+
lowerLimitOrderSqrtPrice: bigint;
|
|
3876
|
+
upperLimitOrderSqrtPrice: bigint;
|
|
3877
|
+
flags: number;
|
|
3878
|
+
pool: string;
|
|
3879
|
+
poolSqrtPrice: bigint;
|
|
3880
|
+
pnlUsd: {
|
|
3881
|
+
amount: number;
|
|
3882
|
+
bps: number;
|
|
3883
|
+
};
|
|
3884
|
+
openedAt: Date;
|
|
3885
|
+
updatedAtSlot: bigint;
|
|
3886
|
+
closedAt: Date | null;
|
|
3887
|
+
collateralToken: string;
|
|
3888
|
+
borrowToken: string;
|
|
3889
|
+
positionToken: string;
|
|
3890
|
+
collateral: {
|
|
3891
|
+
amount: bigint;
|
|
3892
|
+
usd: number;
|
|
3893
|
+
};
|
|
3894
|
+
loanFunds: {
|
|
3895
|
+
amount: bigint;
|
|
3896
|
+
usd: number;
|
|
3897
|
+
};
|
|
3898
|
+
currentLoan: {
|
|
3899
|
+
amount: bigint;
|
|
3900
|
+
usd: number;
|
|
3901
|
+
};
|
|
3902
|
+
openedAtSlot: bigint;
|
|
3903
|
+
};
|
|
3904
|
+
action: "create" | "update";
|
|
3905
|
+
entity: "pool_swap" | "pool_price" | "order_book" | "tuna_position" | "lending_position" | "staking_position" | "fusion_limit_order";
|
|
3906
|
+
meta?: any;
|
|
3907
|
+
} | {
|
|
3908
|
+
authority: string | null;
|
|
3909
|
+
id: string;
|
|
3910
|
+
data: {
|
|
3911
|
+
total: {
|
|
3912
|
+
amount: bigint;
|
|
3913
|
+
usd: number;
|
|
3914
|
+
};
|
|
3915
|
+
address: string;
|
|
3916
|
+
authority: string;
|
|
3917
|
+
version: number;
|
|
3918
|
+
state: "open" | "closed";
|
|
3919
|
+
entrySqrtPrice: bigint;
|
|
3920
|
+
lowerLimitOrderSqrtPrice: bigint;
|
|
3921
|
+
upperLimitOrderSqrtPrice: bigint;
|
|
3922
|
+
flags: number;
|
|
3923
|
+
pool: string;
|
|
3924
|
+
poolSqrtPrice: bigint;
|
|
3925
|
+
pnlUsd: {
|
|
3926
|
+
amount: number;
|
|
3927
|
+
bps: number;
|
|
3928
|
+
};
|
|
3929
|
+
openedAt: Date;
|
|
3930
|
+
updatedAtSlot: bigint;
|
|
3931
|
+
closedAt: Date | null;
|
|
3932
|
+
collateralToken: string;
|
|
3933
|
+
borrowToken: string;
|
|
3934
|
+
positionToken: string;
|
|
3935
|
+
collateral: {
|
|
3936
|
+
amount: bigint;
|
|
3937
|
+
usd: number;
|
|
3938
|
+
};
|
|
3939
|
+
loanFunds: {
|
|
3940
|
+
amount: bigint;
|
|
3941
|
+
usd: number;
|
|
3942
|
+
};
|
|
3943
|
+
currentLoan: {
|
|
3944
|
+
amount: bigint;
|
|
3945
|
+
usd: number;
|
|
3946
|
+
};
|
|
3947
|
+
openedAtSlot: bigint;
|
|
3948
|
+
};
|
|
3949
|
+
action: "create" | "update";
|
|
3950
|
+
entity: "pool_swap" | "pool_price" | "order_book" | "tuna_position" | "lending_position" | "staking_position" | "fusion_limit_order";
|
|
3951
|
+
meta?: any;
|
|
3952
|
+
}, {
|
|
3953
|
+
authority: string | null;
|
|
3954
|
+
id: string;
|
|
3955
|
+
data: {
|
|
3956
|
+
total: {
|
|
3957
|
+
amount: bigint;
|
|
3958
|
+
usd: number;
|
|
3959
|
+
};
|
|
3960
|
+
address: string;
|
|
3961
|
+
authority: string;
|
|
3962
|
+
version: number;
|
|
3963
|
+
state: "open" | "closed";
|
|
3964
|
+
entrySqrtPrice: bigint;
|
|
3965
|
+
lowerLimitOrderSqrtPrice: bigint;
|
|
3966
|
+
upperLimitOrderSqrtPrice: bigint;
|
|
3967
|
+
flags: number;
|
|
3968
|
+
pool: string;
|
|
3969
|
+
poolSqrtPrice: bigint;
|
|
3970
|
+
pnlUsd: {
|
|
3971
|
+
amount: number;
|
|
3972
|
+
bps: number;
|
|
3973
|
+
};
|
|
3974
|
+
openedAt: Date;
|
|
3975
|
+
updatedAtSlot: bigint;
|
|
3976
|
+
closedAt: Date | null;
|
|
3977
|
+
collateralToken: string;
|
|
3978
|
+
borrowToken: string;
|
|
3979
|
+
positionToken: string;
|
|
3980
|
+
collateral: {
|
|
3981
|
+
amount: bigint;
|
|
3982
|
+
usd: number;
|
|
3983
|
+
};
|
|
3984
|
+
loanFunds: {
|
|
3985
|
+
amount: bigint;
|
|
3986
|
+
usd: number;
|
|
3987
|
+
};
|
|
3988
|
+
currentLoan: {
|
|
3989
|
+
amount: bigint;
|
|
3990
|
+
usd: number;
|
|
3991
|
+
};
|
|
3992
|
+
openedAtSlot: bigint;
|
|
3993
|
+
};
|
|
3994
|
+
action: "create" | "update";
|
|
3995
|
+
entity: "pool_swap" | "pool_price" | "order_book" | "tuna_position" | "lending_position" | "staking_position" | "fusion_limit_order";
|
|
3996
|
+
meta?: any;
|
|
3997
|
+
} | {
|
|
3998
|
+
authority: string | null;
|
|
3999
|
+
id: string;
|
|
4000
|
+
data: {
|
|
4001
|
+
total: {
|
|
4002
|
+
amount: bigint;
|
|
4003
|
+
usd: number;
|
|
4004
|
+
};
|
|
4005
|
+
address: string;
|
|
4006
|
+
authority: string;
|
|
4007
|
+
version: number;
|
|
4008
|
+
state: "open" | "closed";
|
|
4009
|
+
entrySqrtPrice: bigint;
|
|
4010
|
+
lowerLimitOrderSqrtPrice: bigint;
|
|
4011
|
+
upperLimitOrderSqrtPrice: bigint;
|
|
4012
|
+
flags: number;
|
|
4013
|
+
pool: string;
|
|
4014
|
+
poolSqrtPrice: bigint;
|
|
4015
|
+
pnlUsd: {
|
|
4016
|
+
amount: number;
|
|
4017
|
+
bps: number;
|
|
4018
|
+
};
|
|
4019
|
+
openedAt: Date;
|
|
4020
|
+
updatedAtSlot: bigint;
|
|
4021
|
+
closedAt: Date | null;
|
|
4022
|
+
collateralToken: string;
|
|
4023
|
+
borrowToken: string;
|
|
4024
|
+
positionToken: string;
|
|
4025
|
+
collateral: {
|
|
4026
|
+
amount: bigint;
|
|
4027
|
+
usd: number;
|
|
4028
|
+
};
|
|
4029
|
+
loanFunds: {
|
|
4030
|
+
amount: bigint;
|
|
4031
|
+
usd: number;
|
|
4032
|
+
};
|
|
4033
|
+
currentLoan: {
|
|
4034
|
+
amount: bigint;
|
|
4035
|
+
usd: number;
|
|
4036
|
+
};
|
|
4037
|
+
openedAtSlot: bigint;
|
|
4038
|
+
};
|
|
4039
|
+
action: "create" | "update";
|
|
4040
|
+
entity: "pool_swap" | "pool_price" | "order_book" | "tuna_position" | "lending_position" | "staking_position" | "fusion_limit_order";
|
|
4041
|
+
meta?: any;
|
|
4042
|
+
}>;
|
|
3409
4043
|
declare const LendingPositionNotification: z.ZodObject<{
|
|
3410
4044
|
meta: z.ZodTypeAny;
|
|
3411
4045
|
entity: z.ZodEnum<["pool_swap", ...("pool_swap" | "pool_price" | "order_book" | "tuna_position" | "lending_position" | "staking_position" | "fusion_limit_order")[]]>;
|
|
@@ -4429,15 +5063,19 @@ declare const schemas_StakingPositionNotification: typeof StakingPositionNotific
|
|
|
4429
5063
|
declare const schemas_TunaPositionNotification: typeof TunaPositionNotification;
|
|
4430
5064
|
declare const schemas_TunaPositionState: typeof TunaPositionState;
|
|
4431
5065
|
declare const schemas_TunaPositionStateSchema: typeof TunaPositionStateSchema;
|
|
5066
|
+
declare const schemas_TunaSpotPositionNotification: typeof TunaSpotPositionNotification;
|
|
5067
|
+
declare const schemas_TunaSpotPositionState: typeof TunaSpotPositionState;
|
|
5068
|
+
declare const schemas_TunaSpotPositionStateSchema: typeof TunaSpotPositionStateSchema;
|
|
4432
5069
|
declare const schemas_UpdateStreamSubscriptionResult: typeof UpdateStreamSubscriptionResult;
|
|
4433
5070
|
declare const schemas_WalletSubscriptionTopic: typeof WalletSubscriptionTopic;
|
|
4434
5071
|
declare const schemas_WalletSubscriptionTopicSchema: typeof WalletSubscriptionTopicSchema;
|
|
4435
5072
|
declare namespace schemas {
|
|
4436
|
-
export { FeesStatsGroup$1 as FeesStatsGroup, LendingPosition$1 as LendingPosition, schemas_LendingPositionNotification as LendingPositionNotification, LimitOrder$1 as LimitOrder, schemas_LimitOrderNotification as LimitOrderNotification, schemas_LimitOrderState as LimitOrderState, schemas_LimitOrderStateSchema as LimitOrderStateSchema, Market$1 as Market, Mint$1 as Mint, schemas_NotificationAction as NotificationAction, schemas_NotificationActionSchema as NotificationActionSchema, schemas_NotificationEntity as NotificationEntity, schemas_NotificationEntitySchema as NotificationEntitySchema, OrderBook$1 as OrderBook, OrderBookEntry$1 as OrderBookEntry, schemas_OrderBookNotification as OrderBookNotification, schemas_OrderBookNotificationMeta as OrderBookNotificationMeta, PaginationMeta$1 as PaginationMeta, Pool$1 as Pool, PoolPriceCandle$1 as PoolPriceCandle, PoolPriceUpdate$1 as PoolPriceUpdate, schemas_PoolPriceUpdateNotification as PoolPriceUpdateNotification, schemas_PoolProvider as PoolProvider, schemas_PoolProviderSchema as PoolProviderSchema, schemas_PoolSubscriptionTopic as PoolSubscriptionTopic, schemas_PoolSubscriptionTopicSchema as PoolSubscriptionTopicSchema, PoolSwap$1 as PoolSwap, schemas_PoolSwapNotification as PoolSwapNotification, PoolTicks$1 as PoolTicks, StakingLeaderboardPage$1 as StakingLeaderboardPage, StakingLeaderboardPosition$1 as StakingLeaderboardPosition, StakingPosition$1 as StakingPosition, StakingPositionHistoryAction$1 as StakingPositionHistoryAction, StakingPositionHistoryActionType$1 as StakingPositionHistoryActionType, schemas_StakingPositionHistoryActionTypeSchema as StakingPositionHistoryActionTypeSchema, schemas_StakingPositionNotification as StakingPositionNotification, StakingRevenueStatsGroup$1 as StakingRevenueStatsGroup, StakingTreasury$1 as StakingTreasury, Tick$1 as Tick, TokenOraclePrice$1 as TokenOraclePrice, TunaPosition$1 as TunaPosition, schemas_TunaPositionNotification as TunaPositionNotification, schemas_TunaPositionState as TunaPositionState, schemas_TunaPositionStateSchema as TunaPositionStateSchema, schemas_UpdateStreamSubscriptionResult as UpdateStreamSubscriptionResult, Vault$1 as Vault, VaultHistoricalStats$1 as VaultHistoricalStats, schemas_WalletSubscriptionTopic as WalletSubscriptionTopic, schemas_WalletSubscriptionTopicSchema as WalletSubscriptionTopicSchema };
|
|
5073
|
+
export { FeesStatsGroup$1 as FeesStatsGroup, LendingPosition$1 as LendingPosition, schemas_LendingPositionNotification as LendingPositionNotification, LimitOrder$1 as LimitOrder, schemas_LimitOrderNotification as LimitOrderNotification, schemas_LimitOrderState as LimitOrderState, schemas_LimitOrderStateSchema as LimitOrderStateSchema, Market$1 as Market, Mint$1 as Mint, schemas_NotificationAction as NotificationAction, schemas_NotificationActionSchema as NotificationActionSchema, schemas_NotificationEntity as NotificationEntity, schemas_NotificationEntitySchema as NotificationEntitySchema, OrderBook$1 as OrderBook, OrderBookEntry$1 as OrderBookEntry, schemas_OrderBookNotification as OrderBookNotification, schemas_OrderBookNotificationMeta as OrderBookNotificationMeta, PaginationMeta$1 as PaginationMeta, Pool$1 as Pool, PoolPriceCandle$1 as PoolPriceCandle, PoolPriceUpdate$1 as PoolPriceUpdate, schemas_PoolPriceUpdateNotification as PoolPriceUpdateNotification, schemas_PoolProvider as PoolProvider, schemas_PoolProviderSchema as PoolProviderSchema, schemas_PoolSubscriptionTopic as PoolSubscriptionTopic, schemas_PoolSubscriptionTopicSchema as PoolSubscriptionTopicSchema, PoolSwap$1 as PoolSwap, schemas_PoolSwapNotification as PoolSwapNotification, PoolTicks$1 as PoolTicks, StakingLeaderboardPage$1 as StakingLeaderboardPage, StakingLeaderboardPosition$1 as StakingLeaderboardPosition, StakingPosition$1 as StakingPosition, StakingPositionHistoryAction$1 as StakingPositionHistoryAction, StakingPositionHistoryActionType$1 as StakingPositionHistoryActionType, schemas_StakingPositionHistoryActionTypeSchema as StakingPositionHistoryActionTypeSchema, schemas_StakingPositionNotification as StakingPositionNotification, StakingRevenueStatsGroup$1 as StakingRevenueStatsGroup, StakingTreasury$1 as StakingTreasury, Tick$1 as Tick, TokenOraclePrice$1 as TokenOraclePrice, TunaPosition$1 as TunaPosition, schemas_TunaPositionNotification as TunaPositionNotification, schemas_TunaPositionState as TunaPositionState, schemas_TunaPositionStateSchema as TunaPositionStateSchema, TunaSpotPosition$1 as TunaSpotPosition, schemas_TunaSpotPositionNotification as TunaSpotPositionNotification, schemas_TunaSpotPositionState as TunaSpotPositionState, schemas_TunaSpotPositionStateSchema as TunaSpotPositionStateSchema, schemas_UpdateStreamSubscriptionResult as UpdateStreamSubscriptionResult, Vault$1 as Vault, VaultHistoricalStats$1 as VaultHistoricalStats, schemas_WalletSubscriptionTopic as WalletSubscriptionTopic, schemas_WalletSubscriptionTopicSchema as WalletSubscriptionTopicSchema };
|
|
4437
5074
|
}
|
|
4438
5075
|
|
|
4439
5076
|
type PoolProviderType = z.infer<typeof PoolProviderSchema>;
|
|
4440
5077
|
type TunaPositionStateType = z.infer<typeof TunaPositionStateSchema>;
|
|
5078
|
+
type TunaSpotPositionStateType = z.infer<typeof TunaSpotPositionStateSchema>;
|
|
4441
5079
|
type LimitOrderStateType = z.infer<typeof LimitOrderStateSchema>;
|
|
4442
5080
|
type StakingPositionHistoryActionType = z.infer<typeof StakingPositionHistoryActionTypeSchema>;
|
|
4443
5081
|
type PoolSubscriptionTopicType = z.infer<typeof PoolSubscriptionTopicSchema>;
|
|
@@ -4456,6 +5094,7 @@ type OrderBookEntry = z.infer<typeof OrderBookEntry$1>;
|
|
|
4456
5094
|
type OrderBook = z.infer<typeof OrderBook$1>;
|
|
4457
5095
|
type LendingPosition = z.infer<typeof LendingPosition$1>;
|
|
4458
5096
|
type TunaPosition = z.infer<typeof TunaPosition$1>;
|
|
5097
|
+
type TunaSpotPosition = z.infer<typeof TunaSpotPosition$1>;
|
|
4459
5098
|
type LimitOrder = z.infer<typeof LimitOrder$1>;
|
|
4460
5099
|
type StakingPosition = z.infer<typeof StakingPosition$1>;
|
|
4461
5100
|
type StakingTreasury = z.infer<typeof StakingTreasury$1>;
|
|
@@ -4545,6 +5184,8 @@ declare class TunaApiClient {
|
|
|
4545
5184
|
getUserLendingPositionByAddress(userAddress: string, lendingPositionAddress: string): Promise<LendingPosition>;
|
|
4546
5185
|
getUserTunaPositions(userAddress: string): Promise<TunaPosition[]>;
|
|
4547
5186
|
getUserTunaPositionByAddress(userAddress: string, tunaPositionAddress: string): Promise<TunaPosition>;
|
|
5187
|
+
getUserTunaSpotPositions(userAddress: string): Promise<TunaSpotPosition[]>;
|
|
5188
|
+
getUserTunaSpotPositionByAddress(userAddress: string, tunaSpotPositionAddress: string): Promise<TunaSpotPosition>;
|
|
4548
5189
|
getUserLimitOrders(userAddress: string, poolFilter?: string): Promise<LimitOrder[]>;
|
|
4549
5190
|
getUserLimitOrderByAddress(userAddress: string, limitOrderAddress: string): Promise<LimitOrder>;
|
|
4550
5191
|
getUserStakingPosition(userAddress: string): Promise<StakingPosition>;
|
|
@@ -4557,4 +5198,4 @@ declare class TunaApiClient {
|
|
|
4557
5198
|
private appendUrlSearchParams;
|
|
4558
5199
|
}
|
|
4559
5200
|
|
|
4560
|
-
export { type DurationInMs, type FeesStatsGroup, type GetPoolPriceCandlesOptions, type LendingPosition, type LimitOrder, type LimitOrderStateType, type Market, type Mint, NotificationAction, NotificationEntity, type OrderBook, type OrderBookEntry, type PaginationMeta, type Pool, type PoolPriceCandle, type PoolPriceUpdate, PoolProvider, type PoolProviderType, type PoolSubscriptionTopicType, type PoolSwap, type PoolTicks, ProviderFilter, type StakingLeaderboardPage, type StakingLeaderboardPosition, type StakingPosition, type StakingPositionHistoryAction, type StakingPositionHistoryActionType, type StakingRevenueStatsGroup, type StakingTreasury, type SubscriptionPayload, type Tick, type TokenOraclePrice, TunaApiClient, type TunaApiClientConfig, type TunaPosition, TunaPositionState, type TunaPositionStateType, type Vault, type VaultHistoricalStats, type WalletSubscriptionTopicType, schemas };
|
|
5201
|
+
export { type DurationInMs, type FeesStatsGroup, type GetPoolPriceCandlesOptions, type LendingPosition, type LimitOrder, type LimitOrderStateType, type Market, type Mint, NotificationAction, NotificationEntity, type OrderBook, type OrderBookEntry, type PaginationMeta, type Pool, type PoolPriceCandle, type PoolPriceUpdate, PoolProvider, type PoolProviderType, type PoolSubscriptionTopicType, type PoolSwap, type PoolTicks, ProviderFilter, type StakingLeaderboardPage, type StakingLeaderboardPosition, type StakingPosition, type StakingPositionHistoryAction, type StakingPositionHistoryActionType, type StakingRevenueStatsGroup, type StakingTreasury, type SubscriptionPayload, type Tick, type TokenOraclePrice, TunaApiClient, type TunaApiClientConfig, type TunaPosition, TunaPositionState, type TunaPositionStateType, type TunaSpotPosition, type TunaSpotPositionStateType, type Vault, type VaultHistoricalStats, type WalletSubscriptionTopicType, schemas };
|