@sonarwatch/portfolio-plugins 0.12.80 → 0.12.82
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/index.js +4 -0
- package/src/index.js.map +1 -1
- package/src/plugins/drift/perpHelpers/getOraclePrice.js +14 -1
- package/src/plugins/drift/perpHelpers/getOraclePrice.js.map +1 -1
- package/src/plugins/drift/perpHelpers/idls.d.ts +180 -0
- package/src/plugins/drift/perpHelpers/idls.js +625 -0
- package/src/plugins/drift/perpHelpers/idls.js.map +1 -0
- package/src/plugins/drift/perpHelpers/pythPull.d.ts +5 -0
- package/src/plugins/drift/perpHelpers/pythPull.js +51 -0
- package/src/plugins/drift/perpHelpers/pythPull.js.map +1 -0
- package/src/plugins/foo/constants.js +1 -1
- package/src/plugins/foo/constants.js.map +1 -1
- package/src/plugins/solayer/constants.d.ts +9 -0
- package/src/plugins/solayer/constants.js +20 -0
- package/src/plugins/solayer/constants.js.map +1 -0
- package/src/plugins/solayer/index.d.ts +6 -0
- package/src/plugins/solayer/index.js +12 -0
- package/src/plugins/solayer/index.js.map +1 -0
- package/src/plugins/solayer/poolsJob.d.ts +3 -0
- package/src/plugins/solayer/poolsJob.js +105 -0
- package/src/plugins/solayer/poolsJob.js.map +1 -0
- package/src/plugins/solayer/structs.d.ts +33 -0
- package/src/plugins/solayer/structs.js +35 -0
- package/src/plugins/solayer/structs.js.map +1 -0
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
+
## [0.12.82](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.81...plugins-0.12.82) (2024-07-19)
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
## [0.12.81](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.80...plugins-0.12.81) (2024-07-19)
|
10
|
+
|
11
|
+
|
12
|
+
|
5
13
|
## [0.12.80](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.79...plugins-0.12.80) (2024-07-19)
|
6
14
|
|
7
15
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
@@ -128,6 +128,7 @@ const allbridge_1 = require("./plugins/allbridge");
|
|
128
128
|
const famousfoxfederation_1 = require("./plugins/famousfoxfederation");
|
129
129
|
const nxfinance_1 = require("./plugins/nxfinance");
|
130
130
|
const echelon_1 = require("./plugins/echelon");
|
131
|
+
const solayer_1 = require("./plugins/solayer");
|
131
132
|
var constants_1 = require("./plugins/tokens/constants");
|
132
133
|
Object.defineProperty(exports, "walletTokensPlatform", { enumerable: true, get: function () { return constants_1.walletTokensPlatform; } });
|
133
134
|
Object.defineProperty(exports, "walletNftsPlatform", { enumerable: true, get: function () { return constants_1.walletNftsPlatform; } });
|
@@ -249,6 +250,7 @@ exports.platforms = [
|
|
249
250
|
...famousfoxfederation_1.platforms,
|
250
251
|
...nxfinance_1.platforms,
|
251
252
|
...echelon_1.platforms,
|
253
|
+
...solayer_1.platforms,
|
252
254
|
];
|
253
255
|
// JOBS //
|
254
256
|
exports.jobs = [
|
@@ -353,6 +355,7 @@ exports.jobs = [
|
|
353
355
|
...famousfoxfederation_1.jobs,
|
354
356
|
...nxfinance_1.jobs,
|
355
357
|
...echelon_1.jobs,
|
358
|
+
...solayer_1.jobs,
|
356
359
|
];
|
357
360
|
// FETCHERS //
|
358
361
|
exports.fetchers = [
|
@@ -459,6 +462,7 @@ exports.fetchers = [
|
|
459
462
|
...famousfoxfederation_1.fetchers,
|
460
463
|
...nxfinance_1.fetchers,
|
461
464
|
...echelon_1.fetchers,
|
465
|
+
...solayer_1.fetchers,
|
462
466
|
];
|
463
467
|
exports.fetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.fetchers);
|
464
468
|
exports.airdropFetchers = [
|
package/src/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],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AAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,kBAAe;IAClB,GAAG,cAAW;IACd,GAAG,mBAAgB;IACnB,GAAG,eAAY;IACf,GAAG,iBAAc;IACjB,GAAG,eAAY;IACf,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,kBAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,uBAAoB;IACvB,GAAG,mBAAgB;IACnB,GAAG,iBAAc;IACjB,GAAG,mBAAgB;IACnB,GAAG,kBAAe;IAClB,GAAG,iBAAc;IACjB,GAAG,iBAAc;IACjB,GAAG,kBAAe;IAClB,GAAG,oBAAiB;IACpB,GAAG,8BAA2B;IAC9B,GAAG,oBAAiB;IACpB,GAAG,kBAAe;CACnB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC;AAE/D,QAAA,eAAe,GAAqB;IAC/C,GAAG,yBAAsB;IACzB,sBAAmB;IACnB,sBAAmB;IACnB,wBAAqB;CACtB,CAAC;AACW,QAAA,8BAA8B,GACzC,IAAA,uDAA0B,EAAC,uBAAe,CAAC,CAAC"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,wFAAqF;AACrF,sEAA8C;AAC9C,6CAI0B;AAC1B,yDAIgC;AAChC,uDAAgE;AAChE,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AACzB,6CAI0B;AAC1B,+CAI2B;AAC3B,yCAIwB;AACxB,+CAI2B;AAC3B,2CAIyB;AACzB,6CAI0B;AAC1B,2CAIyB;AACzB,6CAG0B;AAC1B,6CAI0B;AAC1B,yCAIwB;AACxB,2DAGiC;AACjC,6C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GAAG,eAAY;IACf,GAAG,kBAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,uBAAoB;IACvB,GAAG,mBAAgB;IACnB,GAAG,iBAAc;IACjB,GAAG,mBAAgB;IACnB,GAAG,kBAAe;IAClB,GAAG,iBAAc;IACjB,GAAG,iBAAc;IACjB,GAAG,kBAAe;IAClB,GAAG,oBAAiB;IACpB,GAAG,8BAA2B;IAC9B,GAAG,oBAAiB;IACpB,GAAG,kBAAe;IAClB,GAAG,kBAAe;CACnB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC;AAE/D,QAAA,eAAe,GAAqB;IAC/C,GAAG,yBAAsB;IACzB,sBAAmB;IACnB,sBAAmB;IACnB,wBAAqB;CACtB,CAAC;AACW,QAAA,8BAA8B,GACzC,IAAA,uDAA0B,EAAC,uBAAe,CAAC,CAAC"}
|
@@ -16,6 +16,7 @@ const struct_1 = require("../struct");
|
|
16
16
|
const pyth_1 = require("./pyth");
|
17
17
|
const switchboard_1 = require("./switchboard");
|
18
18
|
const prelaunchOracle_1 = require("./prelaunchOracle");
|
19
|
+
const pythPull_1 = require("./pythPull");
|
19
20
|
const oraclePrices = new Map();
|
20
21
|
const lastUpdates = new Map();
|
21
22
|
const oraclePriceTtl = 90000;
|
@@ -47,8 +48,20 @@ function getOraclePrice(oracle, oracleSource, connection) {
|
|
47
48
|
case struct_1.OracleSource.Prelaunch:
|
48
49
|
coPriceData = (0, prelaunchOracle_1.getPreLaunchOraclePriceDataFromBuffer)(acc.data);
|
49
50
|
break;
|
51
|
+
case struct_1.OracleSource.PythPull:
|
52
|
+
coPriceData = (0, pythPull_1.getPythPullOraclePriceDataFromBuffer)(acc.data, new bn_js_1.BN(1), false);
|
53
|
+
break;
|
54
|
+
case struct_1.OracleSource.Pyth1KPull:
|
55
|
+
coPriceData = (0, pythPull_1.getPythPullOraclePriceDataFromBuffer)(acc.data, new bn_js_1.BN(1000), false);
|
56
|
+
break;
|
57
|
+
case struct_1.OracleSource.Pyth1MPull:
|
58
|
+
coPriceData = (0, pythPull_1.getPythPullOraclePriceDataFromBuffer)(acc.data, new bn_js_1.BN(1000000), false);
|
59
|
+
break;
|
60
|
+
case struct_1.OracleSource.PythStableCoinPull:
|
61
|
+
coPriceData = (0, pythPull_1.getPythPullOraclePriceDataFromBuffer)(acc.data, new bn_js_1.BN(1), true);
|
62
|
+
break;
|
50
63
|
default:
|
51
|
-
throw new Error(
|
64
|
+
throw new Error(`Unsupported OracleSource: ${oracleSource}`);
|
52
65
|
}
|
53
66
|
oraclePrices.set(oracle, coPriceData);
|
54
67
|
lastUpdates.set(oracle, Date.now());
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getOraclePrice.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/drift/perpHelpers/getOraclePrice.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA4C;AAC5C,iCAA2B;AAE3B,sCAAyC;AAEzC,iCAA0D;AAC1D,+CAAwE;AACxE,uDAA0E;
|
1
|
+
{"version":3,"file":"getOraclePrice.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/drift/perpHelpers/getOraclePrice.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA4C;AAC5C,iCAA2B;AAE3B,sCAAyC;AAEzC,iCAA0D;AAC1D,+CAAwE;AACxE,uDAA0E;AAC1E,yCAAkE;AAElE,MAAM,YAAY,GAAiC,IAAI,GAAG,EAAE,CAAC;AAC7D,MAAM,WAAW,GAAwB,IAAI,GAAG,EAAE,CAAC;AACnD,MAAM,cAAc,GAAG,KAAK,CAAC;AAE7B,SAAsB,cAAc,CAClC,MAAc,EACd,YAA0B,EAC1B,UAAwB;;QAExB,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC3C,MAAM,UAAU,GAAG,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,C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Y,CAAC,QAAQ;oBACxB,WAAW,GAAG,IAAA,+CAAoC,EAChD,GAAG,CAAC,IAAI,EACR,IAAI,UAAE,CAAC,CAAC,CAAC,EACT,KAAK,CACN,CAAC;oBACF,MAAM;gBACR,KAAK,qBAAY,CAAC,UAAU;oBAC1B,WAAW,GAAG,IAAA,+CAAoC,EAChD,GAAG,CAAC,IAAI,EACR,IAAI,UAAE,CAAC,IAAI,CAAC,EACZ,KAAK,CACN,CAAC;oBACF,MAAM;gBACR,KAAK,qBAAY,CAAC,UAAU;oBAC1B,WAAW,GAAG,IAAA,+CAAoC,EAChD,GAAG,CAAC,IAAI,EACR,IAAI,UAAE,CAAC,OAAO,CAAC,EACf,KAAK,CACN,CAAC;oBACF,MAAM;gBACR,KAAK,qBAAY,CAAC,kBAAkB;oBAClC,WAAW,GAAG,IAAA,+CAAoC,EAChD,GAAG,CAAC,IAAI,EACR,IAAI,UAAE,CAAC,CAAC,CAAC,EACT,IAAI,CACL,CAAC;oBACF,MAAM;gBACR;oBACE,MAAM,IAAI,KAAK,CAAC,6BAA6B,YAAY,EAAE,CAAC,CAAC;YACjE,CAAC;YAED,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;YACtC,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;YACpC,OAAO,WAAW,CAAC;QACrB,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;CAAA;AAnFD,wCAmFC"}
|
@@ -0,0 +1,180 @@
|
|
1
|
+
import { IdlItem } from '@solanafm/explorer-kit-idls';
|
2
|
+
export declare const pythSolanaReceiverIdl: {
|
3
|
+
version: string;
|
4
|
+
name: string;
|
5
|
+
instructions: ({
|
6
|
+
name: string;
|
7
|
+
accounts: {
|
8
|
+
name: string;
|
9
|
+
isMut: boolean;
|
10
|
+
isSigner: boolean;
|
11
|
+
}[];
|
12
|
+
args: {
|
13
|
+
name: string;
|
14
|
+
type: {
|
15
|
+
defined: string;
|
16
|
+
};
|
17
|
+
}[];
|
18
|
+
docs?: undefined;
|
19
|
+
} | {
|
20
|
+
name: string;
|
21
|
+
accounts: {
|
22
|
+
name: string;
|
23
|
+
isMut: boolean;
|
24
|
+
isSigner: boolean;
|
25
|
+
}[];
|
26
|
+
args: {
|
27
|
+
name: string;
|
28
|
+
type: string;
|
29
|
+
}[];
|
30
|
+
docs?: undefined;
|
31
|
+
} | {
|
32
|
+
name: string;
|
33
|
+
accounts: {
|
34
|
+
name: string;
|
35
|
+
isMut: boolean;
|
36
|
+
isSigner: boolean;
|
37
|
+
}[];
|
38
|
+
args: {
|
39
|
+
name: string;
|
40
|
+
type: {
|
41
|
+
vec: {
|
42
|
+
defined: string;
|
43
|
+
};
|
44
|
+
};
|
45
|
+
}[];
|
46
|
+
docs?: undefined;
|
47
|
+
} | {
|
48
|
+
name: string;
|
49
|
+
docs: string[];
|
50
|
+
accounts: ({
|
51
|
+
name: string;
|
52
|
+
isMut: boolean;
|
53
|
+
isSigner: boolean;
|
54
|
+
docs?: undefined;
|
55
|
+
} | {
|
56
|
+
name: string;
|
57
|
+
isMut: boolean;
|
58
|
+
isSigner: boolean;
|
59
|
+
docs: string[];
|
60
|
+
})[];
|
61
|
+
args: {
|
62
|
+
name: string;
|
63
|
+
type: {
|
64
|
+
defined: string;
|
65
|
+
};
|
66
|
+
}[];
|
67
|
+
})[];
|
68
|
+
accounts: ({
|
69
|
+
name: string;
|
70
|
+
type: {
|
71
|
+
kind: string;
|
72
|
+
fields: ({
|
73
|
+
name: string;
|
74
|
+
type: string;
|
75
|
+
} | {
|
76
|
+
name: string;
|
77
|
+
type: {
|
78
|
+
option: string;
|
79
|
+
vec?: undefined;
|
80
|
+
};
|
81
|
+
} | {
|
82
|
+
name: string;
|
83
|
+
type: {
|
84
|
+
vec: {
|
85
|
+
defined: string;
|
86
|
+
};
|
87
|
+
option?: undefined;
|
88
|
+
};
|
89
|
+
})[];
|
90
|
+
};
|
91
|
+
} | {
|
92
|
+
name: string;
|
93
|
+
type: {
|
94
|
+
kind: string;
|
95
|
+
fields: ({
|
96
|
+
name: string;
|
97
|
+
type: string;
|
98
|
+
} | {
|
99
|
+
name: string;
|
100
|
+
type: {
|
101
|
+
defined: string;
|
102
|
+
};
|
103
|
+
})[];
|
104
|
+
};
|
105
|
+
})[];
|
106
|
+
types: ({
|
107
|
+
name: string;
|
108
|
+
type: {
|
109
|
+
kind: string;
|
110
|
+
fields: ({
|
111
|
+
name: string;
|
112
|
+
type: {
|
113
|
+
array: (string | number)[];
|
114
|
+
};
|
115
|
+
} | {
|
116
|
+
name: string;
|
117
|
+
type: string;
|
118
|
+
})[];
|
119
|
+
variants?: undefined;
|
120
|
+
};
|
121
|
+
docs?: undefined;
|
122
|
+
} | {
|
123
|
+
name: string;
|
124
|
+
type: {
|
125
|
+
kind: string;
|
126
|
+
fields: ({
|
127
|
+
name: string;
|
128
|
+
type: string;
|
129
|
+
} | {
|
130
|
+
name: string;
|
131
|
+
type: {
|
132
|
+
vec: {
|
133
|
+
array: (string | number)[];
|
134
|
+
};
|
135
|
+
};
|
136
|
+
})[];
|
137
|
+
variants?: undefined;
|
138
|
+
};
|
139
|
+
docs?: undefined;
|
140
|
+
} | {
|
141
|
+
name: string;
|
142
|
+
type: {
|
143
|
+
kind: string;
|
144
|
+
fields: ({
|
145
|
+
name: string;
|
146
|
+
type: string;
|
147
|
+
} | {
|
148
|
+
name: string;
|
149
|
+
type: {
|
150
|
+
defined: string;
|
151
|
+
};
|
152
|
+
})[];
|
153
|
+
variants?: undefined;
|
154
|
+
};
|
155
|
+
docs?: undefined;
|
156
|
+
} | {
|
157
|
+
name: string;
|
158
|
+
docs: string[];
|
159
|
+
type: {
|
160
|
+
kind: string;
|
161
|
+
variants: ({
|
162
|
+
name: string;
|
163
|
+
fields: {
|
164
|
+
name: string;
|
165
|
+
type: string;
|
166
|
+
}[];
|
167
|
+
} | {
|
168
|
+
name: string;
|
169
|
+
fields?: undefined;
|
170
|
+
})[];
|
171
|
+
fields?: undefined;
|
172
|
+
};
|
173
|
+
})[];
|
174
|
+
errors: {
|
175
|
+
code: number;
|
176
|
+
name: string;
|
177
|
+
msg: string;
|
178
|
+
}[];
|
179
|
+
};
|
180
|
+
export declare const pythSolanaReceiverIdlItem: IdlItem;
|
@@ -0,0 +1,625 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.pythSolanaReceiverIdlItem = exports.pythSolanaReceiverIdl = void 0;
|
4
|
+
exports.pythSolanaReceiverIdl = {
|
5
|
+
version: '0.1.0',
|
6
|
+
name: 'pyth_solana_receiver',
|
7
|
+
instructions: [
|
8
|
+
{
|
9
|
+
name: 'initialize',
|
10
|
+
accounts: [
|
11
|
+
{
|
12
|
+
name: 'payer',
|
13
|
+
isMut: true,
|
14
|
+
isSigner: true,
|
15
|
+
},
|
16
|
+
{
|
17
|
+
name: 'config',
|
18
|
+
isMut: true,
|
19
|
+
isSigner: false,
|
20
|
+
},
|
21
|
+
{
|
22
|
+
name: 'systemProgram',
|
23
|
+
isMut: false,
|
24
|
+
isSigner: false,
|
25
|
+
},
|
26
|
+
],
|
27
|
+
args: [
|
28
|
+
{
|
29
|
+
name: 'initialConfig',
|
30
|
+
type: {
|
31
|
+
defined: 'Config',
|
32
|
+
},
|
33
|
+
},
|
34
|
+
],
|
35
|
+
},
|
36
|
+
{
|
37
|
+
name: 'requestGovernanceAuthorityTransfer',
|
38
|
+
accounts: [
|
39
|
+
{
|
40
|
+
name: 'payer',
|
41
|
+
isMut: false,
|
42
|
+
isSigner: true,
|
43
|
+
},
|
44
|
+
{
|
45
|
+
name: 'config',
|
46
|
+
isMut: true,
|
47
|
+
isSigner: false,
|
48
|
+
},
|
49
|
+
],
|
50
|
+
args: [
|
51
|
+
{
|
52
|
+
name: 'targetGovernanceAuthority',
|
53
|
+
type: 'publicKey',
|
54
|
+
},
|
55
|
+
],
|
56
|
+
},
|
57
|
+
{
|
58
|
+
name: 'acceptGovernanceAuthorityTransfer',
|
59
|
+
accounts: [
|
60
|
+
{
|
61
|
+
name: 'payer',
|
62
|
+
isMut: false,
|
63
|
+
isSigner: true,
|
64
|
+
},
|
65
|
+
{
|
66
|
+
name: 'config',
|
67
|
+
isMut: true,
|
68
|
+
isSigner: false,
|
69
|
+
},
|
70
|
+
],
|
71
|
+
args: [],
|
72
|
+
},
|
73
|
+
{
|
74
|
+
name: 'setDataSources',
|
75
|
+
accounts: [
|
76
|
+
{
|
77
|
+
name: 'payer',
|
78
|
+
isMut: false,
|
79
|
+
isSigner: true,
|
80
|
+
},
|
81
|
+
{
|
82
|
+
name: 'config',
|
83
|
+
isMut: true,
|
84
|
+
isSigner: false,
|
85
|
+
},
|
86
|
+
],
|
87
|
+
args: [
|
88
|
+
{
|
89
|
+
name: 'validDataSources',
|
90
|
+
type: {
|
91
|
+
vec: {
|
92
|
+
defined: 'DataSource',
|
93
|
+
},
|
94
|
+
},
|
95
|
+
},
|
96
|
+
],
|
97
|
+
},
|
98
|
+
{
|
99
|
+
name: 'setFee',
|
100
|
+
accounts: [
|
101
|
+
{
|
102
|
+
name: 'payer',
|
103
|
+
isMut: false,
|
104
|
+
isSigner: true,
|
105
|
+
},
|
106
|
+
{
|
107
|
+
name: 'config',
|
108
|
+
isMut: true,
|
109
|
+
isSigner: false,
|
110
|
+
},
|
111
|
+
],
|
112
|
+
args: [
|
113
|
+
{
|
114
|
+
name: 'singleUpdateFeeInLamports',
|
115
|
+
type: 'u64',
|
116
|
+
},
|
117
|
+
],
|
118
|
+
},
|
119
|
+
{
|
120
|
+
name: 'setWormholeAddress',
|
121
|
+
accounts: [
|
122
|
+
{
|
123
|
+
name: 'payer',
|
124
|
+
isMut: false,
|
125
|
+
isSigner: true,
|
126
|
+
},
|
127
|
+
{
|
128
|
+
name: 'config',
|
129
|
+
isMut: true,
|
130
|
+
isSigner: false,
|
131
|
+
},
|
132
|
+
],
|
133
|
+
args: [
|
134
|
+
{
|
135
|
+
name: 'wormhole',
|
136
|
+
type: 'publicKey',
|
137
|
+
},
|
138
|
+
],
|
139
|
+
},
|
140
|
+
{
|
141
|
+
name: 'setMinimumSignatures',
|
142
|
+
accounts: [
|
143
|
+
{
|
144
|
+
name: 'payer',
|
145
|
+
isMut: false,
|
146
|
+
isSigner: true,
|
147
|
+
},
|
148
|
+
{
|
149
|
+
name: 'config',
|
150
|
+
isMut: true,
|
151
|
+
isSigner: false,
|
152
|
+
},
|
153
|
+
],
|
154
|
+
args: [
|
155
|
+
{
|
156
|
+
name: 'minimumSignatures',
|
157
|
+
type: 'u8',
|
158
|
+
},
|
159
|
+
],
|
160
|
+
},
|
161
|
+
{
|
162
|
+
name: 'postUpdateAtomic',
|
163
|
+
docs: [
|
164
|
+
'Post a price update using a VAA and a MerklePriceUpdate.',
|
165
|
+
'This function allows you to post a price update in a single transaction.',
|
166
|
+
"Compared to post_update, it is less secure since you won't be able to verify all guardian signatures if you use this function because of transaction size limitations.",
|
167
|
+
'Typically, you can fit 5 guardian signatures in a transaction that uses this.',
|
168
|
+
],
|
169
|
+
accounts: [
|
170
|
+
{
|
171
|
+
name: 'payer',
|
172
|
+
isMut: true,
|
173
|
+
isSigner: true,
|
174
|
+
},
|
175
|
+
{
|
176
|
+
name: 'guardianSet',
|
177
|
+
isMut: false,
|
178
|
+
isSigner: false,
|
179
|
+
docs: [
|
180
|
+
'Instead we do the same steps in deserialize_guardian_set_checked.',
|
181
|
+
],
|
182
|
+
},
|
183
|
+
{
|
184
|
+
name: 'config',
|
185
|
+
isMut: false,
|
186
|
+
isSigner: false,
|
187
|
+
},
|
188
|
+
{
|
189
|
+
name: 'treasury',
|
190
|
+
isMut: true,
|
191
|
+
isSigner: false,
|
192
|
+
},
|
193
|
+
{
|
194
|
+
name: 'priceUpdateAccount',
|
195
|
+
isMut: true,
|
196
|
+
isSigner: true,
|
197
|
+
docs: [
|
198
|
+
'The contraint is such that either the price_update_account is uninitialized or the payer is the write_authority.',
|
199
|
+
"Pubkey::default() is the SystemProgram on Solana and it can't sign so it's impossible that price_update_account.write_authority == Pubkey::default() once the account is initialized",
|
200
|
+
],
|
201
|
+
},
|
202
|
+
{
|
203
|
+
name: 'systemProgram',
|
204
|
+
isMut: false,
|
205
|
+
isSigner: false,
|
206
|
+
},
|
207
|
+
{
|
208
|
+
name: 'writeAuthority',
|
209
|
+
isMut: false,
|
210
|
+
isSigner: true,
|
211
|
+
},
|
212
|
+
],
|
213
|
+
args: [
|
214
|
+
{
|
215
|
+
name: 'params',
|
216
|
+
type: {
|
217
|
+
defined: 'PostUpdateAtomicParams',
|
218
|
+
},
|
219
|
+
},
|
220
|
+
],
|
221
|
+
},
|
222
|
+
{
|
223
|
+
name: 'postUpdate',
|
224
|
+
docs: [
|
225
|
+
'Post a price update using an encoded_vaa account and a MerklePriceUpdate calldata.',
|
226
|
+
'This should be called after the client has already verified the Vaa via the Wormhole contract.',
|
227
|
+
'Check out target_chains/solana/cli/src/main.rs for an example of how to do this.',
|
228
|
+
],
|
229
|
+
accounts: [
|
230
|
+
{
|
231
|
+
name: 'payer',
|
232
|
+
isMut: true,
|
233
|
+
isSigner: true,
|
234
|
+
},
|
235
|
+
{
|
236
|
+
name: 'encodedVaa',
|
237
|
+
isMut: false,
|
238
|
+
isSigner: false,
|
239
|
+
},
|
240
|
+
{
|
241
|
+
name: 'config',
|
242
|
+
isMut: false,
|
243
|
+
isSigner: false,
|
244
|
+
},
|
245
|
+
{
|
246
|
+
name: 'treasury',
|
247
|
+
isMut: true,
|
248
|
+
isSigner: false,
|
249
|
+
},
|
250
|
+
{
|
251
|
+
name: 'priceUpdateAccount',
|
252
|
+
isMut: true,
|
253
|
+
isSigner: true,
|
254
|
+
docs: [
|
255
|
+
'The contraint is such that either the price_update_account is uninitialized or the payer is the write_authority.',
|
256
|
+
"Pubkey::default() is the SystemProgram on Solana and it can't sign so it's impossible that price_update_account.write_authority == Pubkey::default() once the account is initialized",
|
257
|
+
],
|
258
|
+
},
|
259
|
+
{
|
260
|
+
name: 'systemProgram',
|
261
|
+
isMut: false,
|
262
|
+
isSigner: false,
|
263
|
+
},
|
264
|
+
{
|
265
|
+
name: 'writeAuthority',
|
266
|
+
isMut: false,
|
267
|
+
isSigner: true,
|
268
|
+
},
|
269
|
+
],
|
270
|
+
args: [
|
271
|
+
{
|
272
|
+
name: 'params',
|
273
|
+
type: {
|
274
|
+
defined: 'PostUpdateParams',
|
275
|
+
},
|
276
|
+
},
|
277
|
+
],
|
278
|
+
},
|
279
|
+
{
|
280
|
+
name: 'reclaimRent',
|
281
|
+
accounts: [
|
282
|
+
{
|
283
|
+
name: 'payer',
|
284
|
+
isMut: true,
|
285
|
+
isSigner: true,
|
286
|
+
},
|
287
|
+
{
|
288
|
+
name: 'priceUpdateAccount',
|
289
|
+
isMut: true,
|
290
|
+
isSigner: false,
|
291
|
+
},
|
292
|
+
],
|
293
|
+
args: [],
|
294
|
+
},
|
295
|
+
],
|
296
|
+
accounts: [
|
297
|
+
{
|
298
|
+
name: 'Config',
|
299
|
+
type: {
|
300
|
+
kind: 'struct',
|
301
|
+
fields: [
|
302
|
+
{
|
303
|
+
name: 'governanceAuthority',
|
304
|
+
type: 'publicKey',
|
305
|
+
},
|
306
|
+
{
|
307
|
+
name: 'targetGovernanceAuthority',
|
308
|
+
type: {
|
309
|
+
option: 'publicKey',
|
310
|
+
},
|
311
|
+
},
|
312
|
+
{
|
313
|
+
name: 'wormhole',
|
314
|
+
type: 'publicKey',
|
315
|
+
},
|
316
|
+
{
|
317
|
+
name: 'validDataSources',
|
318
|
+
type: {
|
319
|
+
vec: {
|
320
|
+
defined: 'DataSource',
|
321
|
+
},
|
322
|
+
},
|
323
|
+
},
|
324
|
+
{
|
325
|
+
name: 'singleUpdateFeeInLamports',
|
326
|
+
type: 'u64',
|
327
|
+
},
|
328
|
+
{
|
329
|
+
name: 'minimumSignatures',
|
330
|
+
type: 'u8',
|
331
|
+
},
|
332
|
+
],
|
333
|
+
},
|
334
|
+
},
|
335
|
+
{
|
336
|
+
name: 'priceUpdateV2',
|
337
|
+
type: {
|
338
|
+
kind: 'struct',
|
339
|
+
fields: [
|
340
|
+
{
|
341
|
+
name: 'writeAuthority',
|
342
|
+
type: 'publicKey',
|
343
|
+
},
|
344
|
+
{
|
345
|
+
name: 'verificationLevel',
|
346
|
+
type: {
|
347
|
+
defined: 'VerificationLevel',
|
348
|
+
},
|
349
|
+
},
|
350
|
+
{
|
351
|
+
name: 'priceMessage',
|
352
|
+
type: {
|
353
|
+
defined: 'PriceFeedMessage',
|
354
|
+
},
|
355
|
+
},
|
356
|
+
{
|
357
|
+
name: 'postedSlot',
|
358
|
+
type: 'u64',
|
359
|
+
},
|
360
|
+
],
|
361
|
+
},
|
362
|
+
},
|
363
|
+
],
|
364
|
+
types: [
|
365
|
+
{
|
366
|
+
name: 'PriceFeedMessage',
|
367
|
+
type: {
|
368
|
+
kind: 'struct',
|
369
|
+
fields: [
|
370
|
+
{
|
371
|
+
name: 'feedId',
|
372
|
+
type: {
|
373
|
+
array: ['u8', 32],
|
374
|
+
},
|
375
|
+
},
|
376
|
+
{
|
377
|
+
name: 'price',
|
378
|
+
type: 'i64',
|
379
|
+
},
|
380
|
+
{
|
381
|
+
name: 'conf',
|
382
|
+
type: 'u64',
|
383
|
+
},
|
384
|
+
{
|
385
|
+
name: 'exponent',
|
386
|
+
type: 'i32',
|
387
|
+
},
|
388
|
+
{
|
389
|
+
name: 'publishTime',
|
390
|
+
type: 'i64',
|
391
|
+
},
|
392
|
+
{
|
393
|
+
name: 'prevPublishTime',
|
394
|
+
type: 'i64',
|
395
|
+
},
|
396
|
+
{
|
397
|
+
name: 'emaPrice',
|
398
|
+
type: 'i64',
|
399
|
+
},
|
400
|
+
{
|
401
|
+
name: 'emaConf',
|
402
|
+
type: 'u64',
|
403
|
+
},
|
404
|
+
],
|
405
|
+
},
|
406
|
+
},
|
407
|
+
{
|
408
|
+
name: 'MerklePriceUpdate',
|
409
|
+
type: {
|
410
|
+
kind: 'struct',
|
411
|
+
fields: [
|
412
|
+
{
|
413
|
+
name: 'message',
|
414
|
+
type: 'bytes',
|
415
|
+
},
|
416
|
+
{
|
417
|
+
name: 'proof',
|
418
|
+
type: {
|
419
|
+
vec: {
|
420
|
+
array: ['u8', 20],
|
421
|
+
},
|
422
|
+
},
|
423
|
+
},
|
424
|
+
],
|
425
|
+
},
|
426
|
+
},
|
427
|
+
{
|
428
|
+
name: 'DataSource',
|
429
|
+
type: {
|
430
|
+
kind: 'struct',
|
431
|
+
fields: [
|
432
|
+
{
|
433
|
+
name: 'chain',
|
434
|
+
type: 'u16',
|
435
|
+
},
|
436
|
+
{
|
437
|
+
name: 'emitter',
|
438
|
+
type: 'publicKey',
|
439
|
+
},
|
440
|
+
],
|
441
|
+
},
|
442
|
+
},
|
443
|
+
{
|
444
|
+
name: 'PostUpdateAtomicParams',
|
445
|
+
type: {
|
446
|
+
kind: 'struct',
|
447
|
+
fields: [
|
448
|
+
{
|
449
|
+
name: 'vaa',
|
450
|
+
type: 'bytes',
|
451
|
+
},
|
452
|
+
{
|
453
|
+
name: 'merklePriceUpdate',
|
454
|
+
type: {
|
455
|
+
defined: 'MerklePriceUpdate',
|
456
|
+
},
|
457
|
+
},
|
458
|
+
{
|
459
|
+
name: 'treasuryId',
|
460
|
+
type: 'u8',
|
461
|
+
},
|
462
|
+
],
|
463
|
+
},
|
464
|
+
},
|
465
|
+
{
|
466
|
+
name: 'PostUpdateParams',
|
467
|
+
type: {
|
468
|
+
kind: 'struct',
|
469
|
+
fields: [
|
470
|
+
{
|
471
|
+
name: 'merklePriceUpdate',
|
472
|
+
type: {
|
473
|
+
defined: 'MerklePriceUpdate',
|
474
|
+
},
|
475
|
+
},
|
476
|
+
{
|
477
|
+
name: 'treasuryId',
|
478
|
+
type: 'u8',
|
479
|
+
},
|
480
|
+
],
|
481
|
+
},
|
482
|
+
},
|
483
|
+
{
|
484
|
+
name: 'VerificationLevel',
|
485
|
+
docs: [
|
486
|
+
'* This enum represents how many guardian signatures were checked for a Pythnet price update\n * If full, guardian quorum has been attained\n * If partial, at least config.minimum signatures have been verified, but in the case config.minimum_signatures changes in the future we also include the number of signatures that were checked',
|
487
|
+
],
|
488
|
+
type: {
|
489
|
+
kind: 'enum',
|
490
|
+
variants: [
|
491
|
+
{
|
492
|
+
name: 'Partial',
|
493
|
+
fields: [
|
494
|
+
{
|
495
|
+
name: 'numSignatures',
|
496
|
+
type: 'u8',
|
497
|
+
},
|
498
|
+
],
|
499
|
+
},
|
500
|
+
{
|
501
|
+
name: 'Full',
|
502
|
+
},
|
503
|
+
],
|
504
|
+
},
|
505
|
+
},
|
506
|
+
],
|
507
|
+
errors: [
|
508
|
+
{
|
509
|
+
code: 6000,
|
510
|
+
name: 'InvalidWormholeMessage',
|
511
|
+
msg: 'Received an invalid wormhole message',
|
512
|
+
},
|
513
|
+
{
|
514
|
+
code: 6001,
|
515
|
+
name: 'DeserializeMessageFailed',
|
516
|
+
msg: 'An error occurred when deserializing the message',
|
517
|
+
},
|
518
|
+
{
|
519
|
+
code: 6002,
|
520
|
+
name: 'InvalidPriceUpdate',
|
521
|
+
msg: 'Received an invalid price update',
|
522
|
+
},
|
523
|
+
{
|
524
|
+
code: 6003,
|
525
|
+
name: 'UnsupportedMessageType',
|
526
|
+
msg: 'This type of message is not supported currently',
|
527
|
+
},
|
528
|
+
{
|
529
|
+
code: 6004,
|
530
|
+
name: 'InvalidDataSource',
|
531
|
+
msg: "The tuple emitter chain, emitter doesn't match one of the valid data sources.",
|
532
|
+
},
|
533
|
+
{
|
534
|
+
code: 6005,
|
535
|
+
name: 'InsufficientFunds',
|
536
|
+
msg: 'Funds are insufficient to pay the receiving fee',
|
537
|
+
},
|
538
|
+
{
|
539
|
+
code: 6006,
|
540
|
+
name: 'WrongWriteAuthority',
|
541
|
+
msg: "This signer can't write to price update account",
|
542
|
+
},
|
543
|
+
{
|
544
|
+
code: 6007,
|
545
|
+
name: 'WrongVaaOwner',
|
546
|
+
msg: 'The posted VAA account has the wrong owner.',
|
547
|
+
},
|
548
|
+
{
|
549
|
+
code: 6008,
|
550
|
+
name: 'DeserializeVaaFailed',
|
551
|
+
msg: 'An error occurred when deserializing the VAA.',
|
552
|
+
},
|
553
|
+
{
|
554
|
+
code: 6009,
|
555
|
+
name: 'InsufficientGuardianSignatures',
|
556
|
+
msg: 'The number of guardian signatures is below the minimum',
|
557
|
+
},
|
558
|
+
{
|
559
|
+
code: 6010,
|
560
|
+
name: 'InvalidVaaVersion',
|
561
|
+
msg: 'Invalid VAA version',
|
562
|
+
},
|
563
|
+
{
|
564
|
+
code: 6011,
|
565
|
+
name: 'GuardianSetMismatch',
|
566
|
+
msg: "Guardian set version in the VAA doesn't match the guardian set passed",
|
567
|
+
},
|
568
|
+
{
|
569
|
+
code: 6012,
|
570
|
+
name: 'InvalidGuardianOrder',
|
571
|
+
msg: 'Guardian signature indices must be increasing',
|
572
|
+
},
|
573
|
+
{
|
574
|
+
code: 6013,
|
575
|
+
name: 'InvalidGuardianIndex',
|
576
|
+
msg: 'Guardian index exceeds the number of guardians in the set',
|
577
|
+
},
|
578
|
+
{
|
579
|
+
code: 6014,
|
580
|
+
name: 'InvalidSignature',
|
581
|
+
msg: 'A VAA signature is invalid',
|
582
|
+
},
|
583
|
+
{
|
584
|
+
code: 6015,
|
585
|
+
name: 'InvalidGuardianKeyRecovery',
|
586
|
+
msg: "The recovered guardian public key doesn't match the guardian set",
|
587
|
+
},
|
588
|
+
{
|
589
|
+
code: 6016,
|
590
|
+
name: 'WrongGuardianSetOwner',
|
591
|
+
msg: 'The guardian set account is owned by the wrong program',
|
592
|
+
},
|
593
|
+
{
|
594
|
+
code: 6017,
|
595
|
+
name: 'InvalidGuardianSetPda',
|
596
|
+
msg: "The Guardian Set account doesn't match the PDA derivation",
|
597
|
+
},
|
598
|
+
{
|
599
|
+
code: 6018,
|
600
|
+
name: 'GuardianSetExpired',
|
601
|
+
msg: 'The Guardian Set is expired',
|
602
|
+
},
|
603
|
+
{
|
604
|
+
code: 6019,
|
605
|
+
name: 'GovernanceAuthorityMismatch',
|
606
|
+
msg: 'The signer is not authorized to perform this governance action',
|
607
|
+
},
|
608
|
+
{
|
609
|
+
code: 6020,
|
610
|
+
name: 'TargetGovernanceAuthorityMismatch',
|
611
|
+
msg: 'The signer is not authorized to accept the governance authority',
|
612
|
+
},
|
613
|
+
{
|
614
|
+
code: 6021,
|
615
|
+
name: 'NonexistentGovernanceAuthorityTransferRequest',
|
616
|
+
msg: 'The governance authority needs to request a transfer first',
|
617
|
+
},
|
618
|
+
],
|
619
|
+
};
|
620
|
+
exports.pythSolanaReceiverIdlItem = {
|
621
|
+
programId: 'G6EoTTTgpkNBtVXo96EQp2m6uwwVh2Kt6YidjkmQqoha',
|
622
|
+
idl: exports.pythSolanaReceiverIdl,
|
623
|
+
idlType: 'anchor',
|
624
|
+
};
|
625
|
+
//# sourceMappingURL=idls.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"idls.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/drift/perpHelpers/idls.ts"],"names":[],"mappings":";;;AAEa,QAAA,qBAAqB,GAAG;IACnC,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,sBAAsB;IAC5B,YAAY,EAAE;QACZ;YACE,IAAI,EAAE,YAAY;YAClB,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,IAAI;oBACX,QAAQ,EAAE,IAAI;iBACf;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,IAAI;oBACX,QAAQ,EAAE,KAAK;iBAChB;gBACD;oBACE,IAAI,EAAE,eAAe;oBACrB,KAAK,EAAE,KAAK;oBACZ,QAAQ,EAAE,KAAK;iBAChB;aACF;YACD,IAAI,EAAE;gBACJ;oBACE,IAAI,EAAE,eAAe;oBACrB,IAAI,EAAE;wBACJ,OAAO,EAAE,QAAQ;qBAClB;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,oCAAoC;YAC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SAC9D;QACD;YACE,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,uBAAuB;YAC7B,GAAG,EAAE,2DAA2D;SACjE;QACD;YACE,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,oBAAoB;YAC1B,GAAG,EAAE,6BAA6B;SACnC;QACD;YACE,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,6BAA6B;YACnC,GAAG,EAAE,gEAAgE;SACtE;QACD;YACE,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,mCAAmC;YACzC,GAAG,EAAE,iEAAiE;SACvE;QACD;YACE,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,+CAA+C;YACrD,GAAG,EAAE,4DAA4D;SAClE;KACF;CACF,CAAC;AAEW,QAAA,yBAAyB,GAAG;IACvC,SAAS,EAAE,8CAA8C;IACzD,GAAG,EAAE,6BAAqB;IAC1B,OAAO,EAAE,QAAQ;CACP,CAAC"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import BN from 'bn.js';
|
3
|
+
import { OraclePriceData } from './types';
|
4
|
+
export declare function getPythPullOraclePriceDataFromBuffer(buffer: Buffer, multiple: BN, stableCoin: boolean): OraclePriceData;
|
5
|
+
export declare function convertPythPrice(price: BN, exponent: number, multiple: BN): BN;
|
@@ -0,0 +1,51 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.convertPythPrice = exports.getPythPullOraclePriceDataFromBuffer = void 0;
|
7
|
+
/* eslint-disable no-param-reassign */
|
8
|
+
const bn_js_1 = __importDefault(require("bn.js"));
|
9
|
+
const explorer_kit_1 = require("@solanafm/explorer-kit");
|
10
|
+
const constants_1 = require("./constants");
|
11
|
+
const idls_1 = require("./idls");
|
12
|
+
const parser = new explorer_kit_1.SolanaFMParser(idls_1.pythSolanaReceiverIdlItem, idls_1.pythSolanaReceiverIdlItem.programId.toString());
|
13
|
+
function getPythPullOraclePriceDataFromBuffer(buffer, multiple, stableCoin) {
|
14
|
+
var _a, _b;
|
15
|
+
const eventParser = parser.createParser(explorer_kit_1.ParserType.ACCOUNT);
|
16
|
+
if (!eventParser || !(0, explorer_kit_1.checkIfAccountParser)(eventParser))
|
17
|
+
throw new Error('Failed to create event parser Pyth pull');
|
18
|
+
const parsedAccount = eventParser.parseAccount(buffer.toString('base64'));
|
19
|
+
const priceData = (_a = parsedAccount === null || parsedAccount === void 0 ? void 0 : parsedAccount.data) === null || _a === void 0 ? void 0 : _a.priceMessage;
|
20
|
+
const postedSlot = (_b = parsedAccount === null || parsedAccount === void 0 ? void 0 : parsedAccount.data) === null || _b === void 0 ? void 0 : _b.postedSlot;
|
21
|
+
if (!priceData || !postedSlot)
|
22
|
+
throw new Error('Failed to parseAccount Pyth pull');
|
23
|
+
const confidence = convertPythPrice(new bn_js_1.default(priceData.conf), priceData.exponent, multiple);
|
24
|
+
let price = convertPythPrice(new bn_js_1.default(priceData.price), priceData.exponent, multiple);
|
25
|
+
if (stableCoin) {
|
26
|
+
price = getStableCoinPrice(price, confidence);
|
27
|
+
}
|
28
|
+
return {
|
29
|
+
price,
|
30
|
+
slot: postedSlot,
|
31
|
+
confidence,
|
32
|
+
twap: convertPythPrice(new bn_js_1.default(priceData.price), priceData.exponent, multiple),
|
33
|
+
twapConfidence: convertPythPrice(new bn_js_1.default(priceData.price), priceData.exponent, multiple),
|
34
|
+
hasSufficientNumberOfDataPoints: true,
|
35
|
+
};
|
36
|
+
}
|
37
|
+
exports.getPythPullOraclePriceDataFromBuffer = getPythPullOraclePriceDataFromBuffer;
|
38
|
+
function convertPythPrice(price, exponent, multiple) {
|
39
|
+
exponent = Math.abs(exponent);
|
40
|
+
const pythPrecision = constants_1.TEN.pow(new bn_js_1.default(exponent).abs()).div(multiple);
|
41
|
+
return price.mul(constants_1.PRICE_PRECISION).div(pythPrecision);
|
42
|
+
}
|
43
|
+
exports.convertPythPrice = convertPythPrice;
|
44
|
+
const fiveBPS = new bn_js_1.default(500);
|
45
|
+
function getStableCoinPrice(price, confidence) {
|
46
|
+
if (price.sub(constants_1.QUOTE_PRECISION).abs().lt(bn_js_1.default.min(confidence, fiveBPS))) {
|
47
|
+
return constants_1.QUOTE_PRECISION;
|
48
|
+
}
|
49
|
+
return price;
|
50
|
+
}
|
51
|
+
//# sourceMappingURL=pythPull.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"pythPull.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/drift/perpHelpers/pythPull.ts"],"names":[],"mappings":";;;;;;AAAA,sCAAsC;AACtC,kDAAuB;AACvB,yDAIgC;AAChC,2CAAoE;AAEpE,iCAAmD;AAanD,MAAM,MAAM,GAAG,IAAI,6BAAc,CAC/B,gCAAyB,EACzB,gCAAyB,CAAC,SAAS,CAAC,QAAQ,EAAE,CAC/C,CAAC;AAEF,SAAgB,oCAAoC,CAClD,MAAc,EACd,QAAY,EACZ,UAAmB;;IAEnB,MAAM,WAAW,GAAG,MAAM,CAAC,YAAY,CAAC,yBAAU,CAAC,OAAO,CAAC,CAAC;IAC5D,IAAI,CAAC,WAAW,IAAI,CAAC,IAAA,mCAAoB,EAAC,WAAW,CAAC;QACpD,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,MAAM,aAAa,GAAG,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1E,MAAM,SAAS,GAAG,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,0CAAE,YAAgC,CAAC;IACxE,MAAM,UAAU,GAAG,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,0CAAE,UAAgB,CAAC;IACzD,IAAI,CAAC,SAAS,IAAI,CAAC,UAAU;QAC3B,MAAM,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c;IACnD,IAAI,KAAK,CAAC,GAAG,CAAC,2BAAe,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,eAAE,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;QACrE,OAAO,2BAAe,CAAC;IACzB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
@@ -7,7 +7,7 @@ exports.platform = {
|
|
7
7
|
name: 'Foo Finance',
|
8
8
|
image: 'https://sonar.watch/img/platforms/foo.webp',
|
9
9
|
website: 'https://foo.com/',
|
10
|
-
twitter: 'https://
|
10
|
+
twitter: 'https://x.com/foo_finance',
|
11
11
|
defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
|
12
12
|
};
|
13
13
|
exports.marketsCachePrefix = `${exports.platformId}-markets`;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/foo/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,KAAK,CAAC;AACnB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,4CAA4C;IACnD,OAAO,EAAE,kBAAkB;IAC3B,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/foo/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,KAAK,CAAC;AACnB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,4CAA4C;IACnD,OAAO,EAAE,kBAAkB;IAC3B,OAAO,EAAE,2BAA2B;IACpC,WAAW,EAAE,aAAa,EAAE,sCAAsC;CACnE,CAAC;AACW,QAAA,kBAAkB,GAAG,GAAG,kBAAU,UAAU,CAAC"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { PublicKey } from '@solana/web3.js';
|
2
|
+
import { Platform } from '@sonarwatch/portfolio-core';
|
3
|
+
export declare const platformId = "solayer";
|
4
|
+
export declare const platform: Platform;
|
5
|
+
export declare const programId: PublicKey;
|
6
|
+
export declare const solayerLstPool = "po1osKDWYF9oiVEGmzKA4eTs8eMveFRMox3bUKazGN2";
|
7
|
+
export declare const solayerLstMint = "sSo1wxKKr6zW2hqf5hZrp2CawLibcwi1pMBqk5bg2G4";
|
8
|
+
export declare const solayerRstMint = "sSo14endRuUbvQaJS3dq36Q829a3A6BEfoeeRGJywEh";
|
9
|
+
export declare const solayerLstDecimals = 9;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.solayerLstDecimals = exports.solayerRstMint = exports.solayerLstMint = exports.solayerLstPool = exports.programId = exports.platform = exports.platformId = void 0;
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
5
|
+
exports.platformId = 'solayer';
|
6
|
+
exports.platform = {
|
7
|
+
id: exports.platformId,
|
8
|
+
name: 'Solayer',
|
9
|
+
image: 'https://sonar.watch/img/platforms/solayer.webp',
|
10
|
+
website: 'https://solayer.org/',
|
11
|
+
twitter: 'https://x.com/solayer_labs',
|
12
|
+
defiLlamaId: 'solayer',
|
13
|
+
};
|
14
|
+
exports.programId = new web3_js_1.PublicKey('sSo1iU21jBrU9VaJ8PJib1MtorefUV4fzC9GURa2KNn');
|
15
|
+
// export const stakePoolProgramId = 'SPoo1Ku8WFXoNDMHPsrGSTSG1Y47rzgn41SLUNakuHy'
|
16
|
+
exports.solayerLstPool = 'po1osKDWYF9oiVEGmzKA4eTs8eMveFRMox3bUKazGN2';
|
17
|
+
exports.solayerLstMint = 'sSo1wxKKr6zW2hqf5hZrp2CawLibcwi1pMBqk5bg2G4';
|
18
|
+
exports.solayerRstMint = 'sSo14endRuUbvQaJS3dq36Q829a3A6BEfoeeRGJywEh';
|
19
|
+
exports.solayerLstDecimals = 9;
|
20
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/solayer/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,gDAAgD;IACvD,OAAO,EAAE,sBAAsB;IAC/B,OAAO,EAAE,4BAA4B;IACrC,WAAW,EAAE,SAAS;CACvB,CAAC;AAEW,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,6CAA6C,CAC9C,CAAC;AAEF,kFAAkF;AACrE,QAAA,cAAc,GAAG,6CAA6C,CAAC;AAC/D,QAAA,cAAc,GAAG,6CAA6C,CAAC;AAC/D,QAAA,cAAc,GAAG,6CAA6C,CAAC;AAC/D,QAAA,kBAAkB,GAAG,CAAC,CAAC"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
|
+
const constants_1 = require("./constants");
|
8
|
+
const poolsJob_1 = __importDefault(require("./poolsJob"));
|
9
|
+
exports.platforms = [constants_1.platform];
|
10
|
+
exports.jobs = [poolsJob_1.default];
|
11
|
+
exports.fetchers = [];
|
12
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/solayer/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,0DAAkC;AAErB,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,kBAAQ,CAAC,CAAC;AACzB,QAAA,QAAQ,GAAc,EAAE,CAAC"}
|
@@ -0,0 +1,105 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
+
const web3_js_1 = require("@solana/web3.js");
|
14
|
+
const constants_1 = require("./constants");
|
15
|
+
const clients_1 = require("../../utils/clients");
|
16
|
+
const solana_1 = require("../../utils/solana");
|
17
|
+
const structs_1 = require("./structs");
|
18
|
+
const constants_2 = require("../tokens/constants");
|
19
|
+
const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo");
|
20
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
21
|
+
const connection = (0, clients_1.getClientSolana)();
|
22
|
+
// Solayer LST pricing
|
23
|
+
const solTokenPrice = yield cache.getTokenPrice(portfolio_core_1.solanaNativeAddress, portfolio_core_1.NetworkId.solana);
|
24
|
+
const stakePool = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(connection, structs_1.stakePoolStruct, new web3_js_1.PublicKey(constants_1.solayerLstPool));
|
25
|
+
if (solTokenPrice && stakePool) {
|
26
|
+
const ratio = stakePool.totalLamports
|
27
|
+
.div(stakePool.poolTokenSupply)
|
28
|
+
.toNumber();
|
29
|
+
const lstSource = {
|
30
|
+
address: constants_1.solayerLstMint,
|
31
|
+
decimals: constants_1.solayerLstDecimals,
|
32
|
+
id: constants_1.platformId,
|
33
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
34
|
+
platformId: constants_2.walletTokensPlatform.id,
|
35
|
+
price: solTokenPrice.price * ratio,
|
36
|
+
timestamp: Date.now(),
|
37
|
+
weight: 1,
|
38
|
+
underlyings: [
|
39
|
+
{
|
40
|
+
address: portfolio_core_1.solanaNativeAddress,
|
41
|
+
amountPerLp: ratio,
|
42
|
+
decimals: portfolio_core_1.solanaNativeDecimals,
|
43
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
44
|
+
price: solTokenPrice.price,
|
45
|
+
},
|
46
|
+
],
|
47
|
+
};
|
48
|
+
const rstSource = Object.assign(Object.assign({}, lstSource), { address: constants_1.solayerRstMint, platformId: constants_1.platformId, elementName: 'Restaking', underlyings: [
|
49
|
+
{
|
50
|
+
address: portfolio_core_1.solanaNativeAddress,
|
51
|
+
amountPerLp: ratio,
|
52
|
+
decimals: portfolio_core_1.solanaNativeDecimals,
|
53
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
54
|
+
price: solTokenPrice.price,
|
55
|
+
},
|
56
|
+
] });
|
57
|
+
yield cache.setTokenPriceSources([lstSource, rstSource]);
|
58
|
+
}
|
59
|
+
// Solayer restaking pools
|
60
|
+
const accounts = yield (0, solana_1.getParsedProgramAccounts)(connection, structs_1.restakingPoolStruct, constants_1.programId, [
|
61
|
+
{
|
62
|
+
dataSize: structs_1.restakingPoolStruct.byteSize,
|
63
|
+
},
|
64
|
+
]);
|
65
|
+
const prices = yield cache.getTokenPricesAsMap(accounts.map((a) => a.lstMint.toString()), portfolio_core_1.NetworkId.solana);
|
66
|
+
const sources = [];
|
67
|
+
accounts.forEach((acc) => {
|
68
|
+
const rstMint = acc.rstMint.toString();
|
69
|
+
const lstMint = acc.lstMint.toString();
|
70
|
+
// Ignore Solayer custom RST, already supported above
|
71
|
+
if (rstMint === constants_1.solayerRstMint)
|
72
|
+
return;
|
73
|
+
const tp = prices.get(lstMint);
|
74
|
+
if (!tp)
|
75
|
+
return;
|
76
|
+
sources.push({
|
77
|
+
address: rstMint,
|
78
|
+
decimals: tp.decimals,
|
79
|
+
id: constants_1.platformId,
|
80
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
81
|
+
platformId: constants_1.platformId,
|
82
|
+
price: tp.price,
|
83
|
+
timestamp: Date.now(),
|
84
|
+
weight: 1,
|
85
|
+
elementName: 'Restaking',
|
86
|
+
underlyings: [
|
87
|
+
{
|
88
|
+
address: lstMint,
|
89
|
+
decimals: tp.decimals,
|
90
|
+
amountPerLp: 1,
|
91
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
92
|
+
price: tp.price,
|
93
|
+
},
|
94
|
+
],
|
95
|
+
});
|
96
|
+
});
|
97
|
+
yield cache.setTokenPriceSources(sources);
|
98
|
+
});
|
99
|
+
const job = {
|
100
|
+
id: `${constants_1.platformId}-pools`,
|
101
|
+
executor,
|
102
|
+
label: 'normal',
|
103
|
+
};
|
104
|
+
exports.default = job;
|
105
|
+
//# sourceMappingURL=poolsJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/solayer/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAKoC;AACpC,6CAA4C;AAG5C,2CAOqB;AACrB,iDAAsD;AACtD,+CAA8D;AAC9D,uCAAiE;AACjE,mDAA2D;AAC3D,kFAA+E;AAE/E,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,sBAAsB;IACtB,MAAM,aAAa,GAAG,MAAM,KAAK,CAAC,aAAa,CAC7C,oCAAmB,EACnB,0BAAS,CAAC,MAAM,CACjB,CAAC;IACF,MAAM,SAAS,GAAG,M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AAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { BeetStruct } from '@metaplex-foundation/beet';
|
3
|
+
import { PublicKey } from '@solana/web3.js';
|
4
|
+
import BigNumber from 'bignumber.js';
|
5
|
+
export declare enum AccountType {
|
6
|
+
Uninitialized = 0,
|
7
|
+
StakePool = 1,
|
8
|
+
ValidatorList = 2
|
9
|
+
}
|
10
|
+
export type RestakingPool = {
|
11
|
+
buffer: Buffer;
|
12
|
+
lstMint: PublicKey;
|
13
|
+
rstMint: PublicKey;
|
14
|
+
bump: number;
|
15
|
+
bump2: number;
|
16
|
+
};
|
17
|
+
export declare const restakingPoolStruct: BeetStruct<RestakingPool, Partial<RestakingPool>>;
|
18
|
+
export type StakePool = {
|
19
|
+
accountType: number;
|
20
|
+
manager: PublicKey;
|
21
|
+
staker: PublicKey;
|
22
|
+
stakeDepositAuthority: PublicKey;
|
23
|
+
stakeWithdrawBumpSeed: number;
|
24
|
+
validatorList: PublicKey;
|
25
|
+
reserveStake: PublicKey;
|
26
|
+
poolMint: PublicKey;
|
27
|
+
managerFeeAccount: PublicKey;
|
28
|
+
tokenProgramId: PublicKey;
|
29
|
+
totalLamports: BigNumber;
|
30
|
+
poolTokenSupply: BigNumber;
|
31
|
+
lastUpdateEpoch: BigNumber;
|
32
|
+
};
|
33
|
+
export declare const stakePoolStruct: BeetStruct<StakePool, Partial<StakePool>>;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.stakePoolStruct = exports.restakingPoolStruct = exports.AccountType = void 0;
|
4
|
+
const beet_1 = require("@metaplex-foundation/beet");
|
5
|
+
const beet_solana_1 = require("@metaplex-foundation/beet-solana");
|
6
|
+
const solana_1 = require("../../utils/solana");
|
7
|
+
var AccountType;
|
8
|
+
(function (AccountType) {
|
9
|
+
AccountType[AccountType["Uninitialized"] = 0] = "Uninitialized";
|
10
|
+
AccountType[AccountType["StakePool"] = 1] = "StakePool";
|
11
|
+
AccountType[AccountType["ValidatorList"] = 2] = "ValidatorList";
|
12
|
+
})(AccountType || (exports.AccountType = AccountType = {}));
|
13
|
+
exports.restakingPoolStruct = new beet_1.BeetStruct([
|
14
|
+
['buffer', (0, solana_1.blob)(8)],
|
15
|
+
['lstMint', beet_solana_1.publicKey],
|
16
|
+
['rstMint', beet_solana_1.publicKey],
|
17
|
+
['bump', beet_1.u8],
|
18
|
+
['bump2', beet_1.u8],
|
19
|
+
], (args) => args);
|
20
|
+
exports.stakePoolStruct = new beet_1.BeetStruct([
|
21
|
+
['accountType', beet_1.u8],
|
22
|
+
['manager', beet_solana_1.publicKey],
|
23
|
+
['staker', beet_solana_1.publicKey],
|
24
|
+
['stakeDepositAuthority', beet_solana_1.publicKey],
|
25
|
+
['stakeWithdrawBumpSeed', beet_1.u8],
|
26
|
+
['validatorList', beet_solana_1.publicKey],
|
27
|
+
['reserveStake', beet_solana_1.publicKey],
|
28
|
+
['poolMint', beet_solana_1.publicKey],
|
29
|
+
['managerFeeAccount', beet_solana_1.publicKey],
|
30
|
+
['tokenProgramId', beet_solana_1.publicKey],
|
31
|
+
['totalLamports', solana_1.u64],
|
32
|
+
['poolTokenSupply', solana_1.u64],
|
33
|
+
['lastUpdateEpoch', solana_1.u64],
|
34
|
+
], (args) => args);
|
35
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/solayer/structs.ts"],"names":[],"mappings":";;;AAAA,oDAA2D;AAC3D,kEAA6D;AAG7D,+CAA+C;AAE/C,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,+DAAa,CAAA;IACb,uDAAS,CAAA;IACT,+DAAa,CAAA;AACf,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAUY,QAAA,mBAAmB,GAAG,IAAI,iBAAU,CAC/C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,OAAO,EAAE,SAAE,CAAC;CACd,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAqB,CAChC,CAAC;AAkBW,QAAA,eAAe,GAAG,IAAI,iBAAU,CAC3C;IACE,CAAC,aAAa,EAAE,SAAE,CAAC;IACnB,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CAAC,QAAQ,EAAE,uBAAS,CAAC;IACrB,CAAC,uBAAuB,EAAE,uBAAS,CAAC;IACpC,CAAC,uBAAuB,EAAE,SAAE,CAAC;IAC7B,CAAC,eAAe,EAAE,uBAAS,CAAC;IAC5B,CAAC,cAAc,EAAE,uBAAS,CAAC;IAC3B,CAAC,UAAU,EAAE,uBAAS,CAAC;IACvB,CAAC,mBAAmB,EAAE,uBAAS,CAAC;IAChC,CAAC,gBAAgB,EAAE,uBAAS,CAAC;IAC7B,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,iBAAiB,EAAE,YAAG,CAAC;CACzB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAiB,CAC5B,CAAC"}
|