flash-sdk 12.0.0 → 12.0.1
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/CustodyAccount.d.ts +1 -1
- package/dist/MarketAccount.d.ts +2 -2
- package/dist/OraclePrice.d.ts +0 -1
- package/dist/OrderAccount.d.ts +0 -1
- package/dist/PerpetualsClient.d.ts +325 -4360
- package/dist/PerpetualsClient.js +1205 -558
- package/dist/PoolAccount.d.ts +0 -1
- package/dist/PoolConfig.d.ts +3 -1
- package/dist/PoolConfig.js +30 -2
- package/dist/PoolConfig.json +955 -133
- package/dist/PoolDataClient.d.ts +0 -1
- package/dist/PositionAccount.d.ts +3 -3
- package/dist/TokenStakeAccount.d.ts +0 -1
- package/dist/TokenVaultAccount.d.ts +0 -1
- package/dist/ViewHelper.d.ts +2 -1
- package/dist/ViewHelper.js +11 -8
- package/dist/backupOracle.js +27 -6
- package/dist/constants/index.d.ts +0 -1
- package/dist/idl/perpetuals.d.ts +26433 -13458
- package/dist/idl/perpetuals.js +0 -18010
- package/dist/idl/perpetuals.json +30985 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +6 -2
- package/dist/remoraTokensWithPriceIds.d.ts +13 -0
- package/dist/remoraTokensWithPriceIds.js +265 -0
- package/dist/testPublkey.d.ts +0 -0
- package/dist/testPublkey.js +0 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/generated.d.ts +2275 -0
- package/dist/types/generated.js +2 -0
- package/dist/types/index.d.ts +47 -160
- package/dist/types/index.js +22 -6
- package/dist/utils/IdlCoder.d.ts +3 -2
- package/dist/utils/IdlCoder.js +21 -9
- package/dist/utils/alt.js +5 -6
- package/dist/utils/anchorCpiEvents.d.ts +1 -2
- package/dist/utils/anchorCpiEvents.js +14 -10
- package/dist/utils/index.js +6 -6
- package/dist/utils/rpc.js +9 -9
- package/package.json +3 -3
- package/readme.md +37 -3
- package/dist/idl/fbnft_rewards.d.ts +0 -290
- package/dist/idl/fbnft_rewards.js +0 -292
- package/dist/idl/perp_composability.d.ts +0 -760
- package/dist/idl/perp_composability.js +0 -762
- package/dist/idl/reward_distribution.d.ts +0 -347
- package/dist/idl/reward_distribution.js +0 -349
package/dist/types/index.d.ts
CHANGED
|
@@ -1,208 +1,82 @@
|
|
|
1
|
-
|
|
2
|
-
import { MethodsNamespace, IdlTypes, IdlAccounts, BN, IdlEvents } from "@coral-xyz/anchor";
|
|
3
|
-
import { Perpetuals } from "../idl/perpetuals";
|
|
4
|
-
import { FbnftRewards } from "../idl/fbnft_rewards";
|
|
1
|
+
import { BN } from "@coral-xyz/anchor";
|
|
5
2
|
import { OraclePrice } from "../OraclePrice";
|
|
3
|
+
export * from "./generated";
|
|
4
|
+
import { Custody as GeneratedCustody, Market as GeneratedMarket, Pool as GeneratedPool, Position as GeneratedPosition, Order as GeneratedOrder, Perpetuals as GeneratedPerpetuals, Referral as GeneratedReferral, Whitelist as GeneratedWhitelist, FlpStake as GeneratedFlpStake, TokenVault as GeneratedTokenVault, TokenStake as GeneratedTokenStake, ProtocolVault as GeneratedProtocolVault } from "./generated";
|
|
6
5
|
export type PositionSide = "long" | "short";
|
|
7
|
-
export type
|
|
8
|
-
export type
|
|
9
|
-
export type
|
|
10
|
-
export type
|
|
11
|
-
export type
|
|
12
|
-
export type
|
|
13
|
-
export type
|
|
14
|
-
export type
|
|
15
|
-
export type
|
|
16
|
-
export type
|
|
17
|
-
export type
|
|
18
|
-
export type
|
|
19
|
-
export type
|
|
20
|
-
export type SetCustomOraclePriceParams = Types["SetCustomOraclePriceParams"];
|
|
21
|
-
export type AmountAndFee = Types["AmountAndFee"];
|
|
22
|
-
export type NewPositionPricesAndFee = Types["NewPositionPricesAndFee"];
|
|
23
|
-
export type PriceAndFee = Types["PriceAndFee"];
|
|
24
|
-
export type ProfitAndLoss = Types["ProfitAndLoss"];
|
|
25
|
-
export type SwapAmountAndFees = Types["SwapAmountAndFees"];
|
|
26
|
-
export type RatioFee = Types["RatioFees"];
|
|
27
|
-
export type PermissionlessPythCache = Types["PermissionlessPythCache"];
|
|
28
|
-
export type BackupOracle = Types["BackupOracle"];
|
|
29
|
-
export type MarketPermissions = Types["MarketPermissions"];
|
|
30
|
-
export type ContractOraclePrice = Types["OraclePrice"];
|
|
31
|
-
export type StakeStats = Types["StakeStats"];
|
|
32
|
-
export type CompoundingStats = Types["CompoundingStats"];
|
|
33
|
-
export type VoltageStats = Types["VoltageStats"];
|
|
34
|
-
export type LimitOrder = Types["LimitOrder"];
|
|
35
|
-
export type TriggerOrder = Types["TriggerOrder"];
|
|
36
|
-
export type Assets = Types["Assets"];
|
|
37
|
-
export type FeesStats = Types["FeesStats"];
|
|
38
|
-
export type PositionStats = Types["PositionStats"];
|
|
39
|
-
export type BorrowRateState = Types["BorrowRateState"];
|
|
40
|
-
export type TokenPermissions = Types["TokenPermissions"];
|
|
41
|
-
export type InternalPrice = Types["InternalPrice"];
|
|
42
|
-
export type InternalEmaPrice = Types["InternalEmaPrice"];
|
|
43
|
-
export type Custody = Accounts["custody"];
|
|
44
|
-
export type Market = Accounts["market"];
|
|
45
|
-
export type Pool = Accounts["pool"];
|
|
46
|
-
export type Position = Accounts["position"];
|
|
47
|
-
export type Order = Accounts["order"];
|
|
48
|
-
export type PerpetualsAccount = Accounts["perpetuals"];
|
|
49
|
-
export type Referral = Accounts["referral"];
|
|
50
|
-
export type Trading = Accounts["trading"];
|
|
51
|
-
export type FlpStake = Accounts["flpStake"];
|
|
52
|
-
export type TokenVault = Accounts["tokenVault"];
|
|
53
|
-
export type TokenStake = Accounts["tokenStake"];
|
|
54
|
-
export type ProtocolVault = Accounts["protocolVault"];
|
|
55
|
-
export type RewardRecord = FbnftRewardsAccounts["rewardRecord"];
|
|
56
|
-
export type RewardVault = FbnftRewardsAccounts["rewardVault"];
|
|
57
|
-
export type AddCollateralLog = Events["AddCollateralLog"];
|
|
58
|
-
export type AddLiquidityLog = Events["AddLiquidityLog"];
|
|
59
|
-
export type ClosePositionLog = Events["ClosePositionLog"];
|
|
60
|
-
export type DecreaseSizeLog = Events["DecreaseSizeLog"];
|
|
61
|
-
export type LiquidateLog = Events["LiquidateLog"];
|
|
62
|
-
export type IncreaseSizeLog = Events["IncreaseSizeLog"];
|
|
63
|
-
export type OpenPositionLog = Events["OpenPositionLog"];
|
|
64
|
-
export type RemoveCollateralLog = Events["RemoveCollateralLog"];
|
|
65
|
-
export type RemoveLiquidityLog = Events["RemoveLiquidityLog"];
|
|
66
|
-
export type SwapLog = Events["SwapLog"];
|
|
67
|
-
export type AddCollateralLogV2 = Events["AddCollateralLogV2"];
|
|
68
|
-
export type ClosePositionLogV2 = Events["ClosePositionLogV2"];
|
|
69
|
-
export type DecreaseSizeLogV2 = Events["DecreaseSizeLogV2"];
|
|
70
|
-
export type LiquidateLogV2 = Events["LiquidateLogV2"];
|
|
71
|
-
export type IncreaseSizeLogV2 = Events["IncreaseSizeLogV2"];
|
|
72
|
-
export type OpenPositionLogV2 = Events["OpenPositionLogV2"];
|
|
73
|
-
export type RemoveCollateralLogV2 = Events["RemoveCollateralLogV2"];
|
|
74
|
-
export type AddCollateralLogV3 = Events["AddCollateralLogV3"];
|
|
75
|
-
export type ClosePositionLogV3 = Events["ClosePositionLogV3"];
|
|
76
|
-
export type DecreaseSizeLogV3 = Events["DecreaseSizeLogV3"];
|
|
77
|
-
export type LiquidateLogV3 = Events["LiquidateLogV3"];
|
|
78
|
-
export type IncreaseSizeLogV3 = Events["IncreaseSizeLogV3"];
|
|
79
|
-
export type OpenPositionLogV3 = Events["OpenPositionLogV3"];
|
|
80
|
-
export type RemoveCollateralLogV3 = Events["RemoveCollateralLogV3"];
|
|
81
|
-
export type IncreaseSizeLogV4 = Events["IncreaseSizeLogV4"];
|
|
82
|
-
export type OpenPositionLogV4 = Events["OpenPositionLogV4"];
|
|
83
|
-
export type ExecuteLimitOrderLogV2 = Events["ExecuteLimitOrderLogV2"];
|
|
84
|
-
export type ExecuteLimitWithSwapLogV2 = Events["ExecuteLimitWithSwapLogV2"];
|
|
85
|
-
export type SwapAndOpenLogV2 = Events["SwapAndOpenLogV2"];
|
|
86
|
-
export type AddLiquidityLogV2 = Events["AddLiquidityLogV2"];
|
|
87
|
-
export type RemoveLiquidityLogV2 = Events["RemoveLiquidityLogV2"];
|
|
88
|
-
export type AddCompoundingLiquidityLog = Events["AddCompoundingLiquidityLog"];
|
|
89
|
-
export type AddLiquidityAndStakeLog = Events["AddLiquidityAndStakeLog"];
|
|
90
|
-
export type DepositStakeLog = Events["DepositStakeLog"];
|
|
91
|
-
export type MigrateStakeLog = Events["MigrateStakeLog"];
|
|
92
|
-
export type RefreshStakeLog = Events["RefreshStakeLog"];
|
|
93
|
-
export type RefreshStakeUserLog = Events["RefreshStakeUserLog"];
|
|
94
|
-
export type CompoundingFeesLog = Events["CompoundingFeesLog"];
|
|
95
|
-
export type RemoveCompoundingLiquidityLog = Events["RemoveCompoundingLiquidityLog"];
|
|
96
|
-
export type SwapFeeInternalLog = Events["SwapFeeInternalLog"];
|
|
97
|
-
export type UnstakeInstantLog = Events["UnstakeInstantLog"];
|
|
98
|
-
export type UnstakeRequestLog = Events["UnstakeRequestLog"];
|
|
99
|
-
export type WithdrawStakeLog = Events["WithdrawStakeLog"];
|
|
100
|
-
export type EditLimitOrderLog = Events["EditLimitOrderLog"];
|
|
101
|
-
export type EditTriggerOrderLog = Events["EditTriggerOrderLog"];
|
|
102
|
-
export type ExecuteLimitOrderLog = Events["ExecuteLimitOrderLog"];
|
|
103
|
-
export type ExecuteTriggerOrderLog = Events["ExecuteTriggerOrderLog"];
|
|
104
|
-
export type PlaceLimitOrderLog = Events["PlaceLimitOrderLog"];
|
|
105
|
-
export type PlaceTriggerOrderLog = Events["PlaceTriggerOrderLog"];
|
|
106
|
-
export type CancelLimitOrderLog = Events["CancelLimitOrderLog"];
|
|
107
|
-
export type CancelTriggerOrderLog = Events["CancelTriggerOrderLog"];
|
|
108
|
-
export type ExecuteLimitWithSwapLog = Events["ExecuteLimitWithSwapLog"];
|
|
109
|
-
export type ExecuteTriggerWithSwapLog = Events["ExecuteTriggerWithSwapLog"];
|
|
110
|
-
export type SwapAndOpenLog = Events["SwapAndOpenLog"];
|
|
111
|
-
export type CloseAndSwapLog = Events["CloseAndSwapLog"];
|
|
112
|
-
export type SwapAndAddCollateralLog = Events["SwapAndAddCollateralLog"];
|
|
113
|
-
export type RemoveCollateralAndSwapLog = Events["RemoveCollateralAndSwapLog"];
|
|
114
|
-
export type CancelUnstakeTokenRequestLog = Events["CancelUnstakeTokenRequestLog"];
|
|
115
|
-
export type DepositTokenStakeLog = Events["DepositTokenStakeLog"];
|
|
116
|
-
export type UnstakeTokenInstantLog = Events["UnstakeTokenInstantLog"];
|
|
117
|
-
export type UnstakeTokenRequestLog = Events["UnstakeTokenRequestLog"];
|
|
118
|
-
export type WithdrawTokenLog = Events["WithdrawTokenLog"];
|
|
119
|
-
export type DistributeTokenRewardLog = Events["DistributeTokenRewardLog"];
|
|
120
|
-
export type SetTokenRewardLog = Events["SetTokenRewardLog"];
|
|
121
|
-
export type CollectTokenRewardLog = Events["CollectTokenRewardLog"];
|
|
122
|
-
export type CollectRevenueLog = Events["CollectRevenueLog"];
|
|
123
|
-
export type MoveProtocolFeesLog = Events["MoveProtocolFeesLog"];
|
|
124
|
-
export type AddCollateralLogUSDv1 = Events["AddCollateralLogUSDv1"];
|
|
125
|
-
export type CloseAndSwapLogUSDv1 = Events["CloseAndSwapLogUSDv1"];
|
|
126
|
-
export type ClosePositionLogUSDv1 = Events["ClosePositionLogUSDv1"];
|
|
127
|
-
export type DecreaseSizeLogUSDv1 = Events["DecreaseSizeLogUSDv1"];
|
|
128
|
-
export type ExecuteLimitOrderLogUSDv1 = Events["ExecuteLimitOrderLogUSDv1"];
|
|
129
|
-
export type ExecuteLimitWithSwapLogUSDv1 = Events["ExecuteLimitWithSwapLogUSDv1"];
|
|
130
|
-
export type ExecuteTriggerOrderLogUSDv1 = Events["ExecuteTriggerOrderLogUSDv1"];
|
|
131
|
-
export type ExecuteTriggerWithSwapLogUSDv1 = Events["ExecuteTriggerWithSwapLogUSDv1"];
|
|
132
|
-
export type IncreaseSizeLogUSDv1 = Events["IncreaseSizeLogUSDv1"];
|
|
133
|
-
export type LiquidateLogUSDv1 = Events["LiquidateLogUSDv1"];
|
|
134
|
-
export type OpenPositionLogUSDv1 = Events["OpenPositionLogUSDv1"];
|
|
135
|
-
export type RemoveCollateralAndSwapLogUSDv1 = Events["RemoveCollateralAndSwapLogUSDv1"];
|
|
136
|
-
export type RemoveCollateralLogUSDv1 = Events["RemoveCollateralLogUSDv1"];
|
|
137
|
-
export type SwapAndAddCollateralLogUSDv1 = Events["SwapAndAddCollateralLogUSDv1"];
|
|
138
|
-
export type SwapAndOpenLogUSDv1 = Events["SwapAndOpenLogUSDv1"];
|
|
139
|
-
export type MigratePositionLog = Events["MigratePositionLog"];
|
|
140
|
-
export type SwapFeeInternalLogV3 = Events["SwapFeeInternalLogV3"];
|
|
141
|
-
export type SettleRebatesLog = Events["SettleRebatesLog"];
|
|
142
|
-
export type CollectRebateLog = Events["CollectRebateLog"];
|
|
143
|
-
export type VoltagePointsLog = Events["VoltagePointsLog"];
|
|
144
|
-
export type ReferralRebateLog = Events["ReferralRebateLog"];
|
|
6
|
+
export type Custody = GeneratedCustody;
|
|
7
|
+
export type Market = GeneratedMarket;
|
|
8
|
+
export type Pool = GeneratedPool;
|
|
9
|
+
export type Position = GeneratedPosition;
|
|
10
|
+
export type Order = GeneratedOrder;
|
|
11
|
+
export type PerpetualsAccount = GeneratedPerpetuals;
|
|
12
|
+
export type Referral = GeneratedReferral;
|
|
13
|
+
export type Whitelist = GeneratedWhitelist;
|
|
14
|
+
export type Trading = Record<string, never>;
|
|
15
|
+
export type FlpStake = GeneratedFlpStake;
|
|
16
|
+
export type TokenVault = GeneratedTokenVault;
|
|
17
|
+
export type TokenStake = GeneratedTokenStake;
|
|
18
|
+
export type ProtocolVault = GeneratedProtocolVault;
|
|
145
19
|
export declare function isVariant(object: any, type: string): any;
|
|
146
20
|
export declare function isOneOfVariant(object: any, types: string[]): any;
|
|
147
21
|
export declare class Privilege {
|
|
148
22
|
static None: {
|
|
149
|
-
none:
|
|
23
|
+
none: Record<string, never>;
|
|
150
24
|
};
|
|
151
25
|
static Stake: {
|
|
152
|
-
stake:
|
|
26
|
+
stake: Record<string, never>;
|
|
153
27
|
};
|
|
154
28
|
static Referral: {
|
|
155
|
-
referral:
|
|
29
|
+
referral: Record<string, never>;
|
|
156
30
|
};
|
|
157
31
|
}
|
|
158
32
|
export declare class Side {
|
|
159
33
|
static None: {
|
|
160
|
-
none:
|
|
34
|
+
none: Record<string, never>;
|
|
161
35
|
};
|
|
162
36
|
static Long: {
|
|
163
|
-
long:
|
|
37
|
+
long: Record<string, never>;
|
|
164
38
|
};
|
|
165
39
|
static Short: {
|
|
166
|
-
short:
|
|
40
|
+
short: Record<string, never>;
|
|
167
41
|
};
|
|
168
42
|
}
|
|
169
43
|
export declare class OracleType {
|
|
170
44
|
static None: {
|
|
171
|
-
none:
|
|
45
|
+
none: Record<string, never>;
|
|
172
46
|
};
|
|
173
|
-
static
|
|
174
|
-
|
|
47
|
+
static Custom: {
|
|
48
|
+
custom: Record<string, never>;
|
|
175
49
|
};
|
|
176
50
|
static Pyth: {
|
|
177
|
-
pyth:
|
|
51
|
+
pyth: Record<string, never>;
|
|
178
52
|
};
|
|
179
53
|
}
|
|
180
54
|
export declare class FeesMode {
|
|
181
55
|
static Fixed: {
|
|
182
|
-
fixed:
|
|
56
|
+
fixed: Record<string, never>;
|
|
183
57
|
};
|
|
184
58
|
static Linear: {
|
|
185
|
-
linear:
|
|
59
|
+
linear: Record<string, never>;
|
|
186
60
|
};
|
|
187
61
|
}
|
|
188
62
|
export declare class FeesAction {
|
|
189
63
|
static AddLiquidity: {
|
|
190
|
-
addLiquidity:
|
|
64
|
+
addLiquidity: Record<string, never>;
|
|
191
65
|
};
|
|
192
66
|
static RemoveLiquidity: {
|
|
193
|
-
removeLiquidity:
|
|
67
|
+
removeLiquidity: Record<string, never>;
|
|
194
68
|
};
|
|
195
69
|
static SwapIn: {
|
|
196
|
-
swapIn:
|
|
70
|
+
swapIn: Record<string, never>;
|
|
197
71
|
};
|
|
198
72
|
static SwapOut: {
|
|
199
|
-
swapOut:
|
|
73
|
+
swapOut: Record<string, never>;
|
|
200
74
|
};
|
|
201
75
|
static StableSwapIn: {
|
|
202
|
-
stableSwapIn:
|
|
76
|
+
stableSwapIn: Record<string, never>;
|
|
203
77
|
};
|
|
204
78
|
static StableSwapOut: {
|
|
205
|
-
stableSwapOut:
|
|
79
|
+
stableSwapOut: Record<string, never>;
|
|
206
80
|
};
|
|
207
81
|
}
|
|
208
82
|
export declare const DEFAULT_POSITION: Position;
|
|
@@ -258,3 +132,16 @@ export interface RemoveLiquidityAmountAndFee {
|
|
|
258
132
|
tokenAmountOut: BN;
|
|
259
133
|
fee: BN;
|
|
260
134
|
}
|
|
135
|
+
import { RatioFees } from "./generated";
|
|
136
|
+
export type RatioFee = RatioFees;
|
|
137
|
+
export interface BackupOracle {
|
|
138
|
+
price: BN;
|
|
139
|
+
expo: number;
|
|
140
|
+
conf: BN;
|
|
141
|
+
emaPrice: BN;
|
|
142
|
+
publishTime: BN;
|
|
143
|
+
}
|
|
144
|
+
export interface PermissionlessPythCache {
|
|
145
|
+
backupCache: BackupOracle[];
|
|
146
|
+
}
|
|
147
|
+
export type VoltageStats = Record<string, never>;
|
package/dist/types/index.js
CHANGED
|
@@ -1,18 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_POSITION = exports.FeesAction = exports.FeesMode = exports.OracleType = exports.Side = exports.Privilege =
|
|
17
|
+
exports.DEFAULT_POSITION = exports.FeesAction = exports.FeesMode = exports.OracleType = exports.Side = exports.Privilege = void 0;
|
|
18
|
+
exports.isVariant = isVariant;
|
|
19
|
+
exports.isOneOfVariant = isOneOfVariant;
|
|
4
20
|
var web3_js_1 = require("@solana/web3.js");
|
|
5
21
|
var constants_1 = require("../constants");
|
|
22
|
+
__exportStar(require("./generated"), exports);
|
|
6
23
|
function isVariant(object, type) {
|
|
7
24
|
return object.hasOwnProperty(type);
|
|
8
25
|
}
|
|
9
|
-
exports.isVariant = isVariant;
|
|
10
26
|
function isOneOfVariant(object, types) {
|
|
11
27
|
return types.reduce(function (result, type) {
|
|
12
28
|
return result || object.hasOwnProperty(type);
|
|
13
29
|
}, false);
|
|
14
30
|
}
|
|
15
|
-
exports.isOneOfVariant = isOneOfVariant;
|
|
16
31
|
var Privilege = (function () {
|
|
17
32
|
function Privilege() {
|
|
18
33
|
}
|
|
@@ -35,7 +50,7 @@ var OracleType = (function () {
|
|
|
35
50
|
function OracleType() {
|
|
36
51
|
}
|
|
37
52
|
OracleType.None = { none: {} };
|
|
38
|
-
OracleType.
|
|
53
|
+
OracleType.Custom = { custom: {} };
|
|
39
54
|
OracleType.Pyth = { pyth: {} };
|
|
40
55
|
return OracleType;
|
|
41
56
|
}());
|
|
@@ -71,14 +86,15 @@ exports.DEFAULT_POSITION = {
|
|
|
71
86
|
sizeUsd: constants_1.BN_ZERO,
|
|
72
87
|
lockedAmount: constants_1.BN_ZERO,
|
|
73
88
|
lockedUsd: constants_1.BN_ZERO,
|
|
74
|
-
|
|
89
|
+
priceImpactUsd: constants_1.BN_ZERO,
|
|
75
90
|
collateralUsd: constants_1.BN_ZERO,
|
|
76
91
|
unsettledValueUsd: constants_1.BN_ZERO,
|
|
77
92
|
unsettledFeesUsd: constants_1.BN_ZERO,
|
|
78
93
|
cumulativeLockFeeSnapshot: constants_1.BN_ZERO,
|
|
79
94
|
degenSizeUsd: constants_1.BN_ZERO,
|
|
80
95
|
referencePrice: { price: constants_1.BN_ZERO, exponent: 0 },
|
|
81
|
-
buffer: 0,
|
|
96
|
+
buffer: [0, 0, 0],
|
|
97
|
+
priceImpactSet: 0,
|
|
82
98
|
sizeDecimals: 0,
|
|
83
99
|
lockedDecimals: 0,
|
|
84
100
|
collateralDecimals: 0,
|
package/dist/utils/IdlCoder.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Layout } from 'buffer-layout';
|
|
2
|
-
import {
|
|
2
|
+
import { IdlTypeDef } from '@coral-xyz/anchor/dist/cjs/idl';
|
|
3
3
|
export declare class IdlCoder {
|
|
4
4
|
static fieldLayout(field: {
|
|
5
5
|
name?: string;
|
|
6
|
-
|
|
6
|
+
type: any;
|
|
7
|
+
}, types?: IdlTypeDef[]): Layout;
|
|
7
8
|
static typeDefLayout(typeDef: IdlTypeDef, types?: IdlTypeDef[], name?: string): Layout;
|
|
8
9
|
}
|
package/dist/utils/IdlCoder.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -87,7 +97,8 @@ var IdlCoder = (function () {
|
|
|
87
97
|
case 'string': {
|
|
88
98
|
return borsh.str(fieldName);
|
|
89
99
|
}
|
|
90
|
-
case 'publicKey':
|
|
100
|
+
case 'publicKey':
|
|
101
|
+
case 'pubkey': {
|
|
91
102
|
return borsh.publicKey(fieldName);
|
|
92
103
|
}
|
|
93
104
|
default: {
|
|
@@ -104,7 +115,8 @@ var IdlCoder = (function () {
|
|
|
104
115
|
}, types), fieldName);
|
|
105
116
|
}
|
|
106
117
|
else if ('defined' in field.type) {
|
|
107
|
-
var
|
|
118
|
+
var definedType = field.type.defined;
|
|
119
|
+
var defined_1 = typeof definedType === 'string' ? definedType : definedType.name;
|
|
108
120
|
if (types === undefined) {
|
|
109
121
|
throw new anchor_1.IdlError('User defined types not provided');
|
|
110
122
|
}
|
package/dist/utils/alt.js
CHANGED
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -36,7 +36,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
39
|
+
exports.createLookupTable = createLookupTable;
|
|
40
|
+
exports.addAddressesToTable = addAddressesToTable;
|
|
41
|
+
exports.getAddressesInTable = getAddressesInTable;
|
|
40
42
|
var web3_js_1 = require("@solana/web3.js");
|
|
41
43
|
function createLookupTable(authority, payer, connection) {
|
|
42
44
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -62,7 +64,6 @@ function createLookupTable(authority, payer, connection) {
|
|
|
62
64
|
});
|
|
63
65
|
});
|
|
64
66
|
}
|
|
65
|
-
exports.createLookupTable = createLookupTable;
|
|
66
67
|
function addAddressesToTable(authority, payer, lookUpTableAddress, addressesToAdd) {
|
|
67
68
|
return __awaiter(this, void 0, void 0, function () {
|
|
68
69
|
var addAddressesInstruction;
|
|
@@ -77,7 +78,6 @@ function addAddressesToTable(authority, payer, lookUpTableAddress, addressesToAd
|
|
|
77
78
|
});
|
|
78
79
|
});
|
|
79
80
|
}
|
|
80
|
-
exports.addAddressesToTable = addAddressesToTable;
|
|
81
81
|
function getAddressesInTable(connection, lookUpTableAddress) {
|
|
82
82
|
return __awaiter(this, void 0, void 0, function () {
|
|
83
83
|
var lookupTableAccount;
|
|
@@ -93,4 +93,3 @@ function getAddressesInTable(connection, lookUpTableAddress) {
|
|
|
93
93
|
});
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
-
exports.getAddressesInTable = getAddressesInTable;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Event, EventCoder, web3 } from "@coral-xyz/anchor";
|
|
3
|
-
export declare function getAndValidateEvent(previousProgram: web3.PublicKey, currentProgram: web3.PublicKey, eventAuthority: web3.PublicKey, eventCoder: EventCoder, ixData:
|
|
2
|
+
export declare function getAndValidateEvent(previousProgram: web3.PublicKey, currentProgram: web3.PublicKey, eventAuthority: web3.PublicKey, eventCoder: EventCoder, ixData: Uint8Array): Event;
|
|
4
3
|
export declare const getCpiEventsFromTransaction: (response: web3.VersionedTransactionResponse) => Promise<Event[]>;
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -35,27 +35,31 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
38
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.getCpiEventsFromTransaction =
|
|
42
|
+
exports.getCpiEventsFromTransaction = void 0;
|
|
43
|
+
exports.getAndValidateEvent = getAndValidateEvent;
|
|
40
44
|
var anchor_1 = require("@coral-xyz/anchor");
|
|
41
|
-
var
|
|
45
|
+
var perpetuals_json_1 = __importDefault(require("../idl/perpetuals.json"));
|
|
42
46
|
var bytes_1 = require("@coral-xyz/anchor/dist/cjs/utils/bytes");
|
|
43
47
|
function getAndValidateEvent(previousProgram, currentProgram, eventAuthority, eventCoder, ixData) {
|
|
44
|
-
var eventTag =
|
|
45
|
-
|
|
48
|
+
var eventTag = new Uint8Array([0x1d, 0x9a, 0xcb, 0x51, 0x2e, 0xa5, 0x45, 0xe4].reverse());
|
|
49
|
+
var ixTag = ixData.slice(0, 8);
|
|
50
|
+
if (ixTag.length !== eventTag.length || !ixTag.every(function (val, i) { return val === eventTag[i]; })) {
|
|
46
51
|
throw new Error("Invalid CPI Event: Event tag mismatch");
|
|
47
52
|
}
|
|
48
53
|
var expectedAuthority = anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from("__event_authority")], currentProgram)[0];
|
|
49
54
|
if (expectedAuthority.toString() !== eventAuthority.toString()) {
|
|
50
55
|
throw new Error("Invalid CPI Event: Event authority does not match");
|
|
51
56
|
}
|
|
52
|
-
var event = eventCoder.decode(bytes_1.base64.encode(ixData.slice(8)));
|
|
57
|
+
var event = eventCoder.decode(bytes_1.base64.encode(Buffer.from(ixData.slice(8))));
|
|
53
58
|
if (!event) {
|
|
54
59
|
throw new Error("Invalid CPI Event: Failed to decode event");
|
|
55
60
|
}
|
|
56
61
|
return event;
|
|
57
62
|
}
|
|
58
|
-
exports.getAndValidateEvent = getAndValidateEvent;
|
|
59
63
|
var getCpiEventsFromTransaction = function (response) { return __awaiter(void 0, void 0, void 0, function () {
|
|
60
64
|
var instructions, innerInstructions, accounts, eventCoder, events, _loop_1, _i, innerInstructions_1, packet;
|
|
61
65
|
var _a, _b;
|
|
@@ -65,12 +69,12 @@ var getCpiEventsFromTransaction = function (response) { return __awaiter(void 0,
|
|
|
65
69
|
accounts = response.transaction.message.staticAccountKeys
|
|
66
70
|
.concat((_a = response.meta.loadedAddresses.writable) !== null && _a !== void 0 ? _a : [])
|
|
67
71
|
.concat((_b = response.meta.loadedAddresses.readonly) !== null && _b !== void 0 ? _b : []);
|
|
68
|
-
eventCoder = new anchor_1.BorshEventCoder(
|
|
72
|
+
eventCoder = new anchor_1.BorshEventCoder(perpetuals_json_1.default);
|
|
69
73
|
events = [];
|
|
70
74
|
_loop_1 = function (packet) {
|
|
71
75
|
var previousProgram = accounts[instructions[packet.index].programIdIndex];
|
|
72
76
|
packet.instructions.forEach(function (instruction, indexofInnerIns) {
|
|
73
|
-
var bytes = bytes_1.bs58.decode(instruction.data);
|
|
77
|
+
var bytes = new Uint8Array(bytes_1.bs58.decode(instruction.data));
|
|
74
78
|
var currentProgram = accounts[instruction.programIdIndex];
|
|
75
79
|
var eventAuthority = accounts[instruction.accounts[0]];
|
|
76
80
|
try {
|
package/dist/utils/index.js
CHANGED
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -39,7 +39,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.checkedDecimalDiv = exports.checkedDecimalMul = exports.checkedDecimalCeilMul = exports.checkedCeilDiv = exports.scaleToExponent = exports.
|
|
42
|
+
exports.checkedDecimalDiv = exports.checkedDecimalMul = exports.checkedDecimalCeilMul = exports.checkedCeilDiv = exports.scaleToExponent = exports.validateNumberString = exports.uiDecimalsToNative = exports.getUnixTs = void 0;
|
|
43
|
+
exports.toUiDecimalsOldSDK = toUiDecimalsOldSDK;
|
|
44
|
+
exports.nativeToUiDecimals = nativeToUiDecimals;
|
|
45
|
+
exports.checkIfAccountExists = checkIfAccountExists;
|
|
43
46
|
var bn_js_1 = __importDefault(require("bn.js"));
|
|
44
47
|
var constants_1 = require("../constants");
|
|
45
48
|
var bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
@@ -89,7 +92,6 @@ function toUiDecimalsOldSDK(nativeAmount, decimals, precision, commaSeperated) {
|
|
|
89
92
|
return r;
|
|
90
93
|
}
|
|
91
94
|
}
|
|
92
|
-
exports.toUiDecimalsOldSDK = toUiDecimalsOldSDK;
|
|
93
95
|
var uiDecimalsToNative = function (amountUi, decimals) {
|
|
94
96
|
var valueBigNumber = (new bignumber_js_1.default(amountUi)).multipliedBy(new bignumber_js_1.default(Math.pow(10, decimals)));
|
|
95
97
|
return new bn_js_1.default(valueBigNumber.toFixed(0, bignumber_js_1.default.ROUND_DOWN));
|
|
@@ -137,7 +139,6 @@ function nativeToUiDecimals(nativeAmount, decimals, precision, commaSeperated) {
|
|
|
137
139
|
return r;
|
|
138
140
|
}
|
|
139
141
|
}
|
|
140
|
-
exports.nativeToUiDecimals = nativeToUiDecimals;
|
|
141
142
|
function checkIfAccountExists(account, connection) {
|
|
142
143
|
return __awaiter(this, void 0, void 0, function () {
|
|
143
144
|
var bal;
|
|
@@ -157,7 +158,6 @@ function checkIfAccountExists(account, connection) {
|
|
|
157
158
|
});
|
|
158
159
|
});
|
|
159
160
|
}
|
|
160
|
-
exports.checkIfAccountExists = checkIfAccountExists;
|
|
161
161
|
var scaleToExponent = function (arg, exponent, target_exponent) {
|
|
162
162
|
if (target_exponent.eq(exponent)) {
|
|
163
163
|
return arg;
|
package/dist/utils/rpc.js
CHANGED
|
@@ -24,8 +24,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g =
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
28
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
30
|
function step(op) {
|
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -63,7 +63,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
63
63
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
64
64
|
};
|
|
65
65
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
66
|
-
exports.TransactionFailError = exports.createComputeBudgetIx =
|
|
66
|
+
exports.TransactionFailError = exports.createComputeBudgetIx = void 0;
|
|
67
|
+
exports.sendTransaction = sendTransaction;
|
|
68
|
+
exports.confirmTransaction = confirmTransaction;
|
|
69
|
+
exports.sendTransactionV2 = sendTransactionV2;
|
|
70
|
+
exports.confirmTransactionV2 = confirmTransactionV2;
|
|
71
|
+
exports.sendTransactionV3 = sendTransactionV3;
|
|
72
|
+
exports.confirmTransactionV3 = confirmTransactionV3;
|
|
67
73
|
var nodewallet_1 = __importDefault(require("@coral-xyz/anchor/dist/cjs/nodewallet"));
|
|
68
74
|
var bytes_1 = require("@coral-xyz/anchor/dist/cjs/utils/bytes");
|
|
69
75
|
var web3_js_1 = require("@solana/web3.js");
|
|
@@ -118,7 +124,6 @@ function sendTransaction(provider_1, ixs_1) {
|
|
|
118
124
|
});
|
|
119
125
|
});
|
|
120
126
|
}
|
|
121
|
-
exports.sendTransaction = sendTransaction;
|
|
122
127
|
function confirmTransaction(provider_1, signature_1) {
|
|
123
128
|
return __awaiter(this, arguments, void 0, function (provider, signature, opts) {
|
|
124
129
|
var connection, latestBlockhash, _a, txConfirmationCommitment, status;
|
|
@@ -165,7 +170,6 @@ function confirmTransaction(provider_1, signature_1) {
|
|
|
165
170
|
});
|
|
166
171
|
});
|
|
167
172
|
}
|
|
168
|
-
exports.confirmTransaction = confirmTransaction;
|
|
169
173
|
function sendTransactionV2(provider_1, ixs_1) {
|
|
170
174
|
return __awaiter(this, arguments, void 0, function (provider, ixs, opts) {
|
|
171
175
|
var connection, latestBlockhash, _a, payer, message, vtx, signature;
|
|
@@ -217,7 +221,6 @@ function sendTransactionV2(provider_1, ixs_1) {
|
|
|
217
221
|
});
|
|
218
222
|
});
|
|
219
223
|
}
|
|
220
|
-
exports.sendTransactionV2 = sendTransactionV2;
|
|
221
224
|
var sleep = function (ms) { return new Promise(function (r) { return setTimeout(r, ms); }); };
|
|
222
225
|
function confirmTransactionV2(provider_1, versionedTransaction_1, signature_1) {
|
|
223
226
|
return __awaiter(this, arguments, void 0, function (provider, versionedTransaction, signature, opts) {
|
|
@@ -279,7 +282,6 @@ function confirmTransactionV2(provider_1, versionedTransaction_1, signature_1) {
|
|
|
279
282
|
});
|
|
280
283
|
});
|
|
281
284
|
}
|
|
282
|
-
exports.confirmTransactionV2 = confirmTransactionV2;
|
|
283
285
|
function sendTransactionV3(provider_1, ixs_1) {
|
|
284
286
|
return __awaiter(this, arguments, void 0, function (provider, ixs, opts) {
|
|
285
287
|
var connection, latestBlockhash, _a, payer, message, vtx, tx, signature;
|
|
@@ -332,7 +334,6 @@ function sendTransactionV3(provider_1, ixs_1) {
|
|
|
332
334
|
});
|
|
333
335
|
});
|
|
334
336
|
}
|
|
335
|
-
exports.sendTransactionV3 = sendTransactionV3;
|
|
336
337
|
function confirmTransactionV3(provider_1, versionedTransaction_1, signature_1) {
|
|
337
338
|
return __awaiter(this, arguments, void 0, function (provider, versionedTransaction, signature, opts) {
|
|
338
339
|
var connection, status, blockhashResponse, lastValidBlockHeight, blockheight, signatureStatuses, result, x;
|
|
@@ -399,7 +400,6 @@ function confirmTransactionV3(provider_1, versionedTransaction_1, signature_1) {
|
|
|
399
400
|
});
|
|
400
401
|
});
|
|
401
402
|
}
|
|
402
|
-
exports.confirmTransactionV3 = confirmTransactionV3;
|
|
403
403
|
var createComputeBudgetIx = function (microLamports) {
|
|
404
404
|
var computeBudgetIx = web3_js_1.ComputeBudgetProgram.setComputeUnitPrice({
|
|
405
405
|
microLamports: microLamports,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flash-sdk",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"scripts": {
|
|
18
18
|
"prebuild": "rimraf dist ",
|
|
19
19
|
"build": "tsc",
|
|
20
|
+
"generate-types": "ts-node scripts/generate-types.ts",
|
|
20
21
|
"pub": "git add . && git commit -m \"Updates\" && npm version patch && npm run build && npm publish",
|
|
21
22
|
"doc": "yarn typedoc --out docs src"
|
|
22
23
|
},
|
|
23
24
|
"dependencies": {
|
|
24
|
-
"@coral-xyz/anchor": "
|
|
25
|
-
"@pythnetwork/client": "^2.19.0",
|
|
25
|
+
"@coral-xyz/anchor": "^0.32.1",
|
|
26
26
|
"@pythnetwork/price-service-client": "^1.8.2",
|
|
27
27
|
"@solana/spl-token": "^0.4.13",
|
|
28
28
|
"@solana/web3.js": "=1.98.2",
|