@symmetry-hq/temp-v3-sdk 0.0.30 → 0.0.31
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/src/layouts/intents/intent.d.ts +2 -0
- package/dist/src/layouts/intents/intent.js +6 -6
- package/dist/src/states/basket.js +2 -0
- package/dist/src/states/intents/intent.js +2 -0
- package/dist/test.js +3 -1
- package/package.json +1 -1
- package/src/layouts/intents/intent.ts +8 -6
- package/src/states/basket.ts +3 -1
- package/src/states/intents/intent.ts +3 -1
- package/test.ts +5 -1
|
@@ -165,6 +165,8 @@ export interface EditMakeDirectSwapSettings {
|
|
|
165
165
|
}
|
|
166
166
|
export interface OracleInput {
|
|
167
167
|
oracle_type: FormattedOracleType;
|
|
168
|
+
account_lut_id: number;
|
|
169
|
+
account_lut_index: number;
|
|
168
170
|
account: string;
|
|
169
171
|
num_required_accounts: number;
|
|
170
172
|
weight: number;
|
|
@@ -60,12 +60,12 @@ function taskTypeFromU8(value) {
|
|
|
60
60
|
case 8: return TaskType.EditDepositsSettings;
|
|
61
61
|
case 9: return TaskType.EditForceRebalanceSettings;
|
|
62
62
|
case 10: return TaskType.EditCustomRebalanceSettings;
|
|
63
|
-
case
|
|
64
|
-
case
|
|
65
|
-
case
|
|
66
|
-
case
|
|
67
|
-
case
|
|
68
|
-
case
|
|
63
|
+
case 101: return TaskType.EditAddTokenDelay;
|
|
64
|
+
case 102: return TaskType.EditUpdateWeightsDelay;
|
|
65
|
+
case 103: return TaskType.EditMakeDirectSwapDelay;
|
|
66
|
+
case 201: return TaskType.AddToken;
|
|
67
|
+
case 202: return TaskType.UpdateWeights;
|
|
68
|
+
case 203: return TaskType.MakeDirectSwap;
|
|
69
69
|
default: return TaskType.Unknown;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -220,6 +220,8 @@ function addFieldsToBasket(basket) {
|
|
|
220
220
|
oracles: asset.oracleAggregator.oracles.map(oracle => ({
|
|
221
221
|
oracle_settings: {
|
|
222
222
|
oracle_type: oracle_1.ORACLE_TYPES_STRINGS[oracle.oracleSettings.oracleType],
|
|
223
|
+
account_lut_id: oracle.accountsToLoadLutIds[0],
|
|
224
|
+
account_lut_index: oracle.accountsToLoadLutIndices[0],
|
|
223
225
|
account: lookup_tables.active[oracle.accountsToLoadLutIds[0]].contents[oracle.accountsToLoadLutIndices[0]],
|
|
224
226
|
num_required_accounts: oracle.oracleSettings.numRequiredAccounts,
|
|
225
227
|
weight: oracle.oracleSettings.weight,
|
|
@@ -185,6 +185,8 @@ function decodeTaskDataForType(intent) {
|
|
|
185
185
|
conf_multiplier: (0, fraction_1.fractionToDecimal)(oracleAggregator.confMultiplier).toNumber(),
|
|
186
186
|
oracles: oracleAggregator.oracles.slice(0, oracleAggregator.numOracles).map(oracle => ({
|
|
187
187
|
oracle_type: oracle_1.ORACLE_TYPES_STRINGS[oracle.oracleSettings.oracleType],
|
|
188
|
+
account_lut_id: oracle.accountsToLoadLutIds[0],
|
|
189
|
+
account_lut_index: oracle.accountsToLoadLutIndices[0],
|
|
188
190
|
account: "",
|
|
189
191
|
num_required_accounts: oracle.oracleSettings.numRequiredAccounts,
|
|
190
192
|
weight: oracle.oracleSettings.weight,
|
package/dist/test.js
CHANGED
|
@@ -12,11 +12,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
const web3_js_1 = require("@solana/web3.js");
|
|
13
13
|
const anchor_1 = require("@coral-xyz/anchor");
|
|
14
14
|
const src_1 = require("./src");
|
|
15
|
+
let kp = Array.from(web3_js_1.Keypair.generate().secretKey);
|
|
15
16
|
let connection = new web3_js_1.Connection("https://api.devnet.solana.com");
|
|
16
17
|
function testStates() {
|
|
17
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
18
19
|
return;
|
|
19
|
-
let kp = Array.from(web3_js_1.Keypair.generate().secretKey);
|
|
20
20
|
let wallet = new anchor_1.Wallet(web3_js_1.Keypair.fromSecretKey(new Uint8Array(kp)));
|
|
21
21
|
console.log(wallet.publicKey.toBase58());
|
|
22
22
|
let sdk = new src_1.SymmetryCore({
|
|
@@ -248,6 +248,8 @@ function testStates() {
|
|
|
248
248
|
oracles: [
|
|
249
249
|
{
|
|
250
250
|
oracle_type: "pyth",
|
|
251
|
+
account_lut_id: 0,
|
|
252
|
+
account_lut_index: 0,
|
|
251
253
|
account: "So11111111111111111111111111111111111111112",
|
|
252
254
|
num_required_accounts: 1,
|
|
253
255
|
weight: 100,
|
package/package.json
CHANGED
|
@@ -106,13 +106,13 @@ export enum TaskType {
|
|
|
106
106
|
case 9: return TaskType.EditForceRebalanceSettings;
|
|
107
107
|
case 10: return TaskType.EditCustomRebalanceSettings;
|
|
108
108
|
|
|
109
|
-
case
|
|
110
|
-
case
|
|
111
|
-
case
|
|
109
|
+
case 101: return TaskType.EditAddTokenDelay;
|
|
110
|
+
case 102: return TaskType.EditUpdateWeightsDelay;
|
|
111
|
+
case 103: return TaskType.EditMakeDirectSwapDelay;
|
|
112
112
|
|
|
113
|
-
case
|
|
114
|
-
case
|
|
115
|
-
case
|
|
113
|
+
case 201: return TaskType.AddToken;
|
|
114
|
+
case 202: return TaskType.UpdateWeights;
|
|
115
|
+
case 203: return TaskType.MakeDirectSwap;
|
|
116
116
|
|
|
117
117
|
default: return TaskType.Unknown;
|
|
118
118
|
}
|
|
@@ -233,6 +233,8 @@ export interface EditMakeDirectSwapSettings {
|
|
|
233
233
|
|
|
234
234
|
export interface OracleInput {
|
|
235
235
|
oracle_type: FormattedOracleType,
|
|
236
|
+
account_lut_id: number,
|
|
237
|
+
account_lut_index: number,
|
|
236
238
|
account: string,
|
|
237
239
|
num_required_accounts: number,
|
|
238
240
|
weight: number,
|
package/src/states/basket.ts
CHANGED
|
@@ -219,7 +219,7 @@ export function addFieldsToBasket(basket: Basket): Basket {
|
|
|
219
219
|
},
|
|
220
220
|
],
|
|
221
221
|
};
|
|
222
|
-
let composition: FormattedAsset[] =basket.composition.map(asset => ({
|
|
222
|
+
let composition: FormattedAsset[] = basket.composition.map(asset => ({
|
|
223
223
|
mint: asset.mint.toBase58(),
|
|
224
224
|
amount: parseInt(asset.amount.toString()),
|
|
225
225
|
weight: asset.weight,
|
|
@@ -230,6 +230,8 @@ export function addFieldsToBasket(basket: Basket): Basket {
|
|
|
230
230
|
oracles: asset.oracleAggregator.oracles.map(oracle => ({
|
|
231
231
|
oracle_settings: {
|
|
232
232
|
oracle_type: ORACLE_TYPES_STRINGS[oracle.oracleSettings.oracleType],
|
|
233
|
+
account_lut_id: oracle.accountsToLoadLutIds[0],
|
|
234
|
+
account_lut_index: oracle.accountsToLoadLutIndices[0],
|
|
233
235
|
account: lookup_tables.active[oracle.accountsToLoadLutIds[0]].contents[oracle.accountsToLoadLutIndices[0]],
|
|
234
236
|
num_required_accounts: oracle.oracleSettings.numRequiredAccounts,
|
|
235
237
|
weight: oracle.oracleSettings.weight,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import { BASKETS_V3_PROGRAM_ID, MAX_MANAGERS_PER_BASKET } from '../../constants';
|
|
9
9
|
import { AddOrEditTokenInput, EditAddTokenSettings, EditAutomationSettings, EditCreatorSettings, EditCustomRebalanceSettings, EditDepositsSettings, EditFeeSettings, EditForceRebalanceSettings, EditLpSettings, EditMakeDirectSwapSettings, EditManagerSettings, EditMetadataSettings, EditScheduleSettings, EditUpdateWeightsSettings, FormattedIntent, Intent, INTENT_STATUS_STRINGS, IntentLayout, IntentStatus, MakeDirectSwapInput, Settings, TASK_TYPE_STRINGS, TaskType, taskTypeFromU8, UpdateWeightsInput } from '../../layouts/intents/intent';
|
|
10
10
|
import { getMultipleAccountsInfoBatched } from '../../txUtils';
|
|
11
|
-
import { AuthorityBitmasks, AuthorityBitmasksLayout, AutomationSettings, AutomationSettingsLayout, EditAddTokenDelay, EditAddTokenDelayLayout, EditCreator, EditCreatorLayout, EditMakeDirectSwapDelay, EditMakeDirectSwapDelayLayout, EditUpdateWeightsDelay, EditUpdateWeightsDelayLayout, FeeSettings, FeeSettingsLayout, LpSettings, LpSettingsLayout, MakeDirectSwap, MakeDirectSwapLayout, MetadataSettings, MetadataSettingsLayout, ScheduleSettings, ScheduleSettingsLayout, UpdateWeights, UpdateWeightsLayout } from '../../layouts/config';
|
|
11
|
+
import { AuthorityBitmasks, AuthorityBitmasksLayout, AutomationSettings, AutomationSettingsLayout, EditAddTokenDelay, EditAddTokenDelayLayout, EditCreator, EditCreatorLayout, EditMakeDirectSwapDelay, EditMakeDirectSwapDelayLayout, EditUpdateWeightsDelay, EditUpdateWeightsDelayLayout, FeeSettings, FeeSettingsLayout, LpSettings, LpSettingsLayout, MakeDirectSwap, MakeDirectSwapLayout, ManagerSettings, ManagerSettingsLayout, MetadataSettings, MetadataSettingsLayout, ScheduleSettings, ScheduleSettingsLayout, UpdateWeights, UpdateWeightsLayout } from '../../layouts/config';
|
|
12
12
|
import { BN } from '@coral-xyz/anchor';
|
|
13
13
|
import { ORACLE_TYPES_STRINGS, OracleAggregator, OracleAggregatorLayout } from '../../layouts/oracle';
|
|
14
14
|
import { fractionToDecimal } from '../../layouts/fraction';
|
|
@@ -177,6 +177,8 @@ function decodeTaskDataForType(intent: Intent): Settings {
|
|
|
177
177
|
conf_multiplier: fractionToDecimal(oracleAggregator.confMultiplier).toNumber(),
|
|
178
178
|
oracles: oracleAggregator.oracles.slice(0, oracleAggregator.numOracles).map(oracle => ({
|
|
179
179
|
oracle_type: ORACLE_TYPES_STRINGS[oracle.oracleSettings.oracleType],
|
|
180
|
+
account_lut_id: oracle.accountsToLoadLutIds[0],
|
|
181
|
+
account_lut_index: oracle.accountsToLoadLutIndices[0],
|
|
180
182
|
account: "",
|
|
181
183
|
num_required_accounts: oracle.oracleSettings.numRequiredAccounts,
|
|
182
184
|
weight: oracle.oracleSettings.weight,
|
package/test.ts
CHANGED
|
@@ -6,11 +6,13 @@ import { AddOrEditTokenInput, UpdateWeightsInput, MakeDirectSwapInput } from "./
|
|
|
6
6
|
import { EditCreatorSettings, EditManagerSettings, EditFeeSettings, EditScheduleSettings, EditAutomationSettings, EditLpSettings, EditMetadataSettings, EditDepositsSettings, EditForceRebalanceSettings, EditCustomRebalanceSettings, EditAddTokenSettings, EditUpdateWeightsSettings, EditMakeDirectSwapSettings } from "./src";
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
let kp = Array.from(Keypair.generate().secretKey);
|
|
10
|
+
|
|
9
11
|
let connection = new Connection("https://api.devnet.solana.com");
|
|
10
12
|
|
|
13
|
+
|
|
11
14
|
async function testStates() {
|
|
12
15
|
return;
|
|
13
|
-
let kp = Array.from(Keypair.generate().secretKey);
|
|
14
16
|
let wallet = new Wallet(Keypair.fromSecretKey(new Uint8Array(kp)));
|
|
15
17
|
console.log(wallet.publicKey.toBase58());
|
|
16
18
|
|
|
@@ -273,6 +275,8 @@ async function testStates() {
|
|
|
273
275
|
oracles: [
|
|
274
276
|
{
|
|
275
277
|
oracle_type: "pyth",
|
|
278
|
+
account_lut_id: 0,
|
|
279
|
+
account_lut_index: 0,
|
|
276
280
|
account: "So11111111111111111111111111111111111111112",
|
|
277
281
|
num_required_accounts: 1,
|
|
278
282
|
weight: 100,
|