@sonarwatch/portfolio-plugins 0.14.43 → 0.14.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1768 -1760
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/drift/perpHelpers/pyth.js +2 -2
- package/src/plugins/drift/perpHelpers/pyth.js.map +1 -1
- package/src/plugins/flash/index.js +5 -2
- package/src/plugins/flash/index.js.map +1 -1
- package/src/plugins/flash/perpetualFetcher.js +10 -4
- package/src/plugins/flash/perpetualFetcher.js.map +1 -1
- package/src/plugins/flash/structs.d.ts +9 -0
- package/src/plugins/flash/structs.js +9 -1
- package/src/plugins/flash/structs.js.map +1 -1
- package/src/plugins/jupiter/types.d.ts +1 -1
- package/src/plugins/pyth/index.js +2 -4
- package/src/plugins/pyth/index.js.map +1 -1
- package/src/plugins/pyth/pricingJob.js +142 -9
- package/src/plugins/pyth/pricingJob.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/symmetry/basketsJob.js +0 -15
- package/src/plugins/symmetry/basketsJob.js.map +1 -1
- package/src/plugins/symmetry/structs.d.ts +5 -2
- package/src/plugins/symmetry/structs.js +4 -1
- package/src/plugins/symmetry/structs.js.map +1 -1
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/plugins/zeta/airdropFetcher.js +14 -14
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
- package/src/utils/solana/pyth/helpers.d.ts +0 -11
- package/src/utils/solana/pyth/helpers.js +7 -232
- package/src/utils/solana/pyth/helpers.js.map +1 -1
- package/src/utils/solana/pyth/helpersOld.d.ts +3 -0
- package/src/utils/solana/pyth/helpersOld.js +154 -0
- package/src/utils/solana/pyth/helpersOld.js.map +1 -0
- package/src/utils/solana/pyth/structs.d.ts +26 -95
- package/src/utils/solana/pyth/structs.js +27 -32
- package/src/utils/solana/pyth/structs.js.map +1 -1
- package/src/utils/solana/pyth/structsOld.d.ts +97 -0
- package/src/utils/solana/pyth/structsOld.js +35 -0
- package/src/utils/solana/pyth/structsOld.js.map +1 -0
@@ -1,97 +1,28 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { BeetStruct } from '@metaplex-foundation/beet';
|
3
|
+
import BigNumber from 'bignumber.js';
|
1
4
|
import { PublicKey } from '@solana/web3.js';
|
2
|
-
export
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
Ignored = 4
|
8
|
-
}
|
9
|
-
export declare enum CorpAction {
|
10
|
-
NoCorpAct = 0
|
11
|
-
}
|
12
|
-
export declare enum PriceType {
|
13
|
-
Unknown = 0,
|
14
|
-
Price = 1
|
15
|
-
}
|
16
|
-
export declare enum DeriveType {
|
17
|
-
Unknown = 0,
|
18
|
-
Volatility = 1
|
19
|
-
}
|
20
|
-
export declare enum AccountType {
|
21
|
-
Unknown = 0,
|
22
|
-
Mapping = 1,
|
23
|
-
Product = 2,
|
24
|
-
Price = 3,
|
25
|
-
Test = 4,
|
26
|
-
Permission = 5
|
27
|
-
}
|
28
|
-
export type Base = {
|
29
|
-
magic: number;
|
30
|
-
version: number;
|
31
|
-
type: AccountType;
|
32
|
-
size: number;
|
33
|
-
};
|
34
|
-
export type MappingData = Base & {
|
35
|
-
nextMappingAccount: PublicKey | null;
|
36
|
-
productAccountKeys: PublicKey[];
|
37
|
-
};
|
38
|
-
export type Product = {
|
39
|
-
[index: string]: string;
|
40
|
-
};
|
41
|
-
export type ProductData = Base & {
|
42
|
-
priceAccountKey: PublicKey | null;
|
43
|
-
product: Product;
|
44
|
-
};
|
45
|
-
export type Price = {
|
46
|
-
priceComponent: bigint;
|
47
|
-
price: number;
|
48
|
-
confidenceComponent: bigint;
|
49
|
-
confidence: number;
|
50
|
-
status: PriceStatus;
|
51
|
-
corporateAction: CorpAction;
|
52
|
-
publishSlot: number;
|
53
|
-
};
|
54
|
-
export type PriceComponent = {
|
55
|
-
publisher: PublicKey;
|
56
|
-
aggregate: Price;
|
57
|
-
latest: Price;
|
58
|
-
};
|
59
|
-
export type Ema = {
|
60
|
-
valueComponent: bigint;
|
61
|
-
value: number;
|
62
|
-
numerator: bigint;
|
63
|
-
denominator: bigint;
|
64
|
-
};
|
65
|
-
export type PriceData = Base & {
|
66
|
-
priceType: PriceType;
|
5
|
+
export type PriceFeedMessage = {
|
6
|
+
buffer: Buffer;
|
7
|
+
feedId: number[];
|
8
|
+
price: BigNumber;
|
9
|
+
conf: BigNumber;
|
67
10
|
exponent: number;
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
previousTimestamp: bigint;
|
87
|
-
priceComponents: PriceComponent[];
|
88
|
-
aggregate: Price;
|
89
|
-
price: number | undefined;
|
90
|
-
confidence: number | undefined;
|
91
|
-
status: PriceStatus;
|
92
|
-
};
|
93
|
-
export type PermissionData = Base & {
|
94
|
-
masterAuthority: PublicKey;
|
95
|
-
dataCurationAuthority: PublicKey;
|
96
|
-
securityAuthority: PublicKey;
|
97
|
-
};
|
11
|
+
publishTime: BigNumber;
|
12
|
+
prevPublishTime: BigNumber;
|
13
|
+
emaPrice: BigNumber;
|
14
|
+
emaConf: BigNumber;
|
15
|
+
};
|
16
|
+
export declare const priceFeedMessageStruct: BeetStruct<PriceFeedMessage, Partial<PriceFeedMessage>>;
|
17
|
+
export declare enum VerificationLevel {
|
18
|
+
Partial = 0,
|
19
|
+
Full = 1
|
20
|
+
}
|
21
|
+
export type PriceUpdateV2 = {
|
22
|
+
writeAuthority: PublicKey;
|
23
|
+
verificationLevel: VerificationLevel;
|
24
|
+
priceMessage: PriceFeedMessage;
|
25
|
+
postedSlot: BigNumber;
|
26
|
+
overlapAmount: BigNumber;
|
27
|
+
};
|
28
|
+
export declare const priceUpdateV2Struct: BeetStruct<PriceUpdateV2, Partial<PriceUpdateV2>>;
|
@@ -1,35 +1,30 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
AccountType[AccountType["Product"] = 2] = "Product";
|
31
|
-
AccountType[AccountType["Price"] = 3] = "Price";
|
32
|
-
AccountType[AccountType["Test"] = 4] = "Test";
|
33
|
-
AccountType[AccountType["Permission"] = 5] = "Permission";
|
34
|
-
})(AccountType || (exports.AccountType = AccountType = {}));
|
3
|
+
exports.priceUpdateV2Struct = exports.VerificationLevel = exports.priceFeedMessageStruct = void 0;
|
4
|
+
const beet_1 = require("@metaplex-foundation/beet");
|
5
|
+
const beet_solana_1 = require("@metaplex-foundation/beet-solana");
|
6
|
+
const numbers_1 = require("../beets/numbers");
|
7
|
+
const buffers_1 = require("../beets/buffers");
|
8
|
+
exports.priceFeedMessageStruct = new beet_1.BeetStruct([
|
9
|
+
['buffer', (0, buffers_1.blob)(8)],
|
10
|
+
['feedId', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
|
11
|
+
['price', numbers_1.i64],
|
12
|
+
['conf', numbers_1.u64],
|
13
|
+
['exponent', beet_1.i32],
|
14
|
+
['publishTime', numbers_1.i64],
|
15
|
+
['prevPublishTime', numbers_1.i64],
|
16
|
+
['emaPrice', numbers_1.i64],
|
17
|
+
['emaConf', numbers_1.u64],
|
18
|
+
], (args) => args);
|
19
|
+
var VerificationLevel;
|
20
|
+
(function (VerificationLevel) {
|
21
|
+
VerificationLevel[VerificationLevel["Partial"] = 0] = "Partial";
|
22
|
+
VerificationLevel[VerificationLevel["Full"] = 1] = "Full";
|
23
|
+
})(VerificationLevel || (exports.VerificationLevel = VerificationLevel = {}));
|
24
|
+
exports.priceUpdateV2Struct = new beet_1.BeetStruct([
|
25
|
+
['writeAuthority', beet_solana_1.publicKey],
|
26
|
+
['verificationLevel', beet_1.u8],
|
27
|
+
['priceMessage', exports.priceFeedMessageStruct],
|
28
|
+
['postedSlot', numbers_1.u64],
|
29
|
+
], (args) => args);
|
35
30
|
//# sourceMappingURL=structs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/utils/solana/pyth/structs.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/utils/solana/pyth/structs.ts"],"names":[],"mappings":";;;AAAA,oDAKmC;AAGnC,kEAA6D;AAC7D,8CAA4C;AAC5C,8CAAwC;AAc3B,QAAA,sBAAsB,GAAG,IAAI,iBAAU,CAClD;IACE,CAAC,QAAQ,EAAE,IAAA,cAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,QAAQ,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;IACzC,CAAC,OAAO,EAAE,aAAG,CAAC;IACd,CAAC,MAAM,EAAE,aAAG,CAAC;IACb,CAAC,UAAU,EAAE,UAAG,CAAC;IACjB,CAAC,aAAa,EAAE,aAAG,CAAC;IACpB,CAAC,iBAAiB,EAAE,aAAG,CAAC;IACxB,CAAC,UAAU,EAAE,aAAG,CAAC;IACjB,CAAC,SAAS,EAAE,aAAG,CAAC;CACjB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAwB,CACnC,CAAC;AAEF,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,+DAAO,CAAA;IACP,yDAAI,CAAA;AACN,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B;AAUY,QAAA,mBAAmB,GAAG,IAAI,iBAAU,CAC/C;IACE,CAAC,gBAAgB,EAAE,uBAAS,CAAC;IAC7B,CAAC,mBAAmB,EAAE,SAAE,CAAC;IACzB,CAAC,cAAc,EAAE,8BAAsB,CAAC;IACxC,CAAC,YAAY,EAAE,aAAG,CAAC;CACpB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAqB,CAChC,CAAC"}
|
@@ -0,0 +1,97 @@
|
|
1
|
+
import { PublicKey } from '@solana/web3.js';
|
2
|
+
export declare enum PriceStatus {
|
3
|
+
Unknown = 0,
|
4
|
+
Trading = 1,
|
5
|
+
Halted = 2,
|
6
|
+
Auction = 3,
|
7
|
+
Ignored = 4
|
8
|
+
}
|
9
|
+
export declare enum CorpAction {
|
10
|
+
NoCorpAct = 0
|
11
|
+
}
|
12
|
+
export declare enum PriceType {
|
13
|
+
Unknown = 0,
|
14
|
+
Price = 1
|
15
|
+
}
|
16
|
+
export declare enum DeriveType {
|
17
|
+
Unknown = 0,
|
18
|
+
Volatility = 1
|
19
|
+
}
|
20
|
+
export declare enum AccountType {
|
21
|
+
Unknown = 0,
|
22
|
+
Mapping = 1,
|
23
|
+
Product = 2,
|
24
|
+
Price = 3,
|
25
|
+
Test = 4,
|
26
|
+
Permission = 5
|
27
|
+
}
|
28
|
+
export type Base = {
|
29
|
+
magic: number;
|
30
|
+
version: number;
|
31
|
+
type: AccountType;
|
32
|
+
size: number;
|
33
|
+
};
|
34
|
+
export type MappingData = Base & {
|
35
|
+
nextMappingAccount: PublicKey | null;
|
36
|
+
productAccountKeys: PublicKey[];
|
37
|
+
};
|
38
|
+
export type Product = {
|
39
|
+
[index: string]: string;
|
40
|
+
};
|
41
|
+
export type ProductData = Base & {
|
42
|
+
priceAccountKey: PublicKey | null;
|
43
|
+
product: Product;
|
44
|
+
};
|
45
|
+
export type Price = {
|
46
|
+
priceComponent: bigint;
|
47
|
+
price: number;
|
48
|
+
confidenceComponent: bigint;
|
49
|
+
confidence: number;
|
50
|
+
status: PriceStatus;
|
51
|
+
corporateAction: CorpAction;
|
52
|
+
publishSlot: number;
|
53
|
+
};
|
54
|
+
export type PriceComponent = {
|
55
|
+
publisher: PublicKey;
|
56
|
+
aggregate: Price;
|
57
|
+
latest: Price;
|
58
|
+
};
|
59
|
+
export type Ema = {
|
60
|
+
valueComponent: bigint;
|
61
|
+
value: number;
|
62
|
+
numerator: bigint;
|
63
|
+
denominator: bigint;
|
64
|
+
};
|
65
|
+
export type PriceData = Base & {
|
66
|
+
priceType: PriceType;
|
67
|
+
exponent: number;
|
68
|
+
numComponentPrices: number;
|
69
|
+
numQuoters: number;
|
70
|
+
lastSlot: bigint;
|
71
|
+
validSlot: bigint;
|
72
|
+
emaPrice: Ema;
|
73
|
+
emaConfidence: Ema;
|
74
|
+
timestamp: bigint;
|
75
|
+
minPublishers: number;
|
76
|
+
drv2: number;
|
77
|
+
drv3: number;
|
78
|
+
drv4: number;
|
79
|
+
productAccountKey: PublicKey;
|
80
|
+
nextPriceAccountKey: PublicKey | null;
|
81
|
+
previousSlot: bigint;
|
82
|
+
previousPriceComponent: bigint;
|
83
|
+
previousPrice: number;
|
84
|
+
previousConfidenceComponent: bigint;
|
85
|
+
previousConfidence: number;
|
86
|
+
previousTimestamp: bigint;
|
87
|
+
priceComponents: PriceComponent[];
|
88
|
+
aggregate: Price;
|
89
|
+
price: number | undefined;
|
90
|
+
confidence: number | undefined;
|
91
|
+
status: PriceStatus;
|
92
|
+
};
|
93
|
+
export type PermissionData = Base & {
|
94
|
+
masterAuthority: PublicKey;
|
95
|
+
dataCurationAuthority: PublicKey;
|
96
|
+
securityAuthority: PublicKey;
|
97
|
+
};
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.AccountType = exports.DeriveType = exports.PriceType = exports.CorpAction = exports.PriceStatus = void 0;
|
4
|
+
var PriceStatus;
|
5
|
+
(function (PriceStatus) {
|
6
|
+
PriceStatus[PriceStatus["Unknown"] = 0] = "Unknown";
|
7
|
+
PriceStatus[PriceStatus["Trading"] = 1] = "Trading";
|
8
|
+
PriceStatus[PriceStatus["Halted"] = 2] = "Halted";
|
9
|
+
PriceStatus[PriceStatus["Auction"] = 3] = "Auction";
|
10
|
+
PriceStatus[PriceStatus["Ignored"] = 4] = "Ignored";
|
11
|
+
})(PriceStatus || (exports.PriceStatus = PriceStatus = {}));
|
12
|
+
var CorpAction;
|
13
|
+
(function (CorpAction) {
|
14
|
+
CorpAction[CorpAction["NoCorpAct"] = 0] = "NoCorpAct";
|
15
|
+
})(CorpAction || (exports.CorpAction = CorpAction = {}));
|
16
|
+
var PriceType;
|
17
|
+
(function (PriceType) {
|
18
|
+
PriceType[PriceType["Unknown"] = 0] = "Unknown";
|
19
|
+
PriceType[PriceType["Price"] = 1] = "Price";
|
20
|
+
})(PriceType || (exports.PriceType = PriceType = {}));
|
21
|
+
var DeriveType;
|
22
|
+
(function (DeriveType) {
|
23
|
+
DeriveType[DeriveType["Unknown"] = 0] = "Unknown";
|
24
|
+
DeriveType[DeriveType["Volatility"] = 1] = "Volatility";
|
25
|
+
})(DeriveType || (exports.DeriveType = DeriveType = {}));
|
26
|
+
var AccountType;
|
27
|
+
(function (AccountType) {
|
28
|
+
AccountType[AccountType["Unknown"] = 0] = "Unknown";
|
29
|
+
AccountType[AccountType["Mapping"] = 1] = "Mapping";
|
30
|
+
AccountType[AccountType["Product"] = 2] = "Product";
|
31
|
+
AccountType[AccountType["Price"] = 3] = "Price";
|
32
|
+
AccountType[AccountType["Test"] = 4] = "Test";
|
33
|
+
AccountType[AccountType["Permission"] = 5] = "Permission";
|
34
|
+
})(AccountType || (exports.AccountType = AccountType = {}));
|
35
|
+
//# sourceMappingURL=structsOld.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structsOld.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/utils/solana/pyth/structsOld.ts"],"names":[],"mappings":";;;AAEA,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,mDAAO,CAAA;IACP,mDAAO,CAAA;IACP,iDAAM,CAAA;IACN,mDAAO,CAAA;IACP,mDAAO,CAAA;AACT,CAAC,EANW,WAAW,2BAAX,WAAW,QAMtB;AAED,IAAY,UAEX;AAFD,WAAY,UAAU;IACpB,qDAAS,CAAA;AACX,CAAC,EAFW,UAAU,0BAAV,UAAU,QAErB;AAED,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,+CAAO,CAAA;IACP,2CAAK,CAAA;AACP,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAED,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,iDAAO,CAAA;IACP,uDAAU,CAAA;AACZ,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AAED,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,mDAAO,CAAA;IACP,mDAAO,CAAA;IACP,mDAAO,CAAA;IACP,+CAAK,CAAA;IACL,6CAAI,CAAA;IACJ,yDAAU,CAAA;AACZ,CAAC,EAPW,WAAW,2BAAX,WAAW,QAOtB"}
|