@glamsystems/glam-sdk 0.1.31 → 0.1.32

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/index.cjs.js CHANGED
@@ -5,7 +5,7 @@ var web3_js = require('@solana/web3.js');
5
5
  var splToken = require('@solana/spl-token');
6
6
  var splTokenMetadata = require('@solana/spl-token-metadata');
7
7
  var DLMM = require('@meteora-ag/dlmm');
8
- var sanctumLstList = require('sanctum-lst-list');
8
+ var sanctumLstList = require('@glamsystems/sanctum-lst-list');
9
9
  var bytes = require('@coral-xyz/anchor/dist/cjs/utils/bytes');
10
10
  var borsh = require('@coral-xyz/borsh');
11
11
  var marinadeTsSdk = require('@marinade.finance/marinade-ts-sdk');
@@ -34,7 +34,7 @@ var borsh__namespace = /*#__PURE__*/_interopNamespaceDefault(borsh);
34
34
  var address = "GLAMbTqav9N9witRjswJ8enwp9vv5G8bsSJ2kPJ4rcyc";
35
35
  var metadata = {
36
36
  name: "glam_protocol",
37
- version: "0.4.35",
37
+ version: "0.4.36",
38
38
  spec: "0.1.0",
39
39
  description: "Glam Protocol"
40
40
  };
@@ -1007,7 +1007,7 @@ var instructions = [
1007
1007
  98,
1008
1008
  97,
1009
1009
  108,
1010
- 95,
1010
+ 45,
1011
1011
  99,
1012
1012
  111,
1013
1013
  110,
@@ -6830,7 +6830,7 @@ var instructions = [
6830
6830
  98,
6831
6831
  97,
6832
6832
  108,
6833
- 95,
6833
+ 45,
6834
6834
  99,
6835
6835
  111,
6836
6836
  110,
@@ -6961,7 +6961,7 @@ var instructions = [
6961
6961
  98,
6962
6962
  97,
6963
6963
  108,
6964
- 95,
6964
+ 45,
6965
6965
  99,
6966
6966
  111,
6967
6967
  110,
@@ -7097,7 +7097,7 @@ var instructions = [
7097
7097
  98,
7098
7098
  97,
7099
7099
  108,
7100
- 95,
7100
+ 45,
7101
7101
  99,
7102
7102
  111,
7103
7103
  110,
@@ -7243,7 +7243,7 @@ var instructions = [
7243
7243
  98,
7244
7244
  97,
7245
7245
  108,
7246
- 95,
7246
+ 45,
7247
7247
  99,
7248
7248
  111,
7249
7249
  110,
@@ -7367,7 +7367,7 @@ var instructions = [
7367
7367
  98,
7368
7368
  97,
7369
7369
  108,
7370
- 95,
7370
+ 45,
7371
7371
  99,
7372
7372
  111,
7373
7373
  110,
@@ -7487,7 +7487,7 @@ var instructions = [
7487
7487
  98,
7488
7488
  97,
7489
7489
  108,
7490
- 95,
7490
+ 45,
7491
7491
  99,
7492
7492
  111,
7493
7493
  110,
@@ -7553,8 +7553,11 @@ var instructions = [
7553
7553
  docs: [
7554
7554
  "Price vault SOL balance and tokens it holds.",
7555
7555
  "",
7556
+ "If aggregation oracle is used for token #`i`, `agg_indexes[i]` must be set to its index in the oracle mapping account.",
7557
+ "",
7556
7558
  "Extra accounts for pricing N tokens:",
7557
- "- (ata, mint, oracle) x N"
7559
+ "- (ata, mint, oracle) x N",
7560
+ "- optional oracle mapping (only add it if any token uses an agg oracle)"
7558
7561
  ],
7559
7562
  discriminator: [
7560
7563
  54,
@@ -7613,7 +7616,7 @@ var instructions = [
7613
7616
  98,
7614
7617
  97,
7615
7618
  108,
7616
- 95,
7619
+ 45,
7617
7620
  99,
7618
7621
  111,
7619
7622
  110,
@@ -7671,6 +7674,12 @@ var instructions = [
7671
7674
  name: "PriceDenom"
7672
7675
  }
7673
7676
  }
7677
+ },
7678
+ {
7679
+ name: "agg_indexes",
7680
+ type: {
7681
+ vec: "i16"
7682
+ }
7674
7683
  }
7675
7684
  ]
7676
7685
  },
@@ -8079,7 +8088,7 @@ var instructions = [
8079
8088
  98,
8080
8089
  97,
8081
8090
  108,
8082
- 95,
8091
+ 45,
8083
8092
  99,
8084
8093
  111,
8085
8094
  110,
@@ -11226,6 +11235,23 @@ var types = [
11226
11235
  name: "OracleSource"
11227
11236
  }
11228
11237
  }
11238
+ },
11239
+ {
11240
+ name: "max_age_seconds",
11241
+ type: "u16"
11242
+ },
11243
+ {
11244
+ name: "priority",
11245
+ type: "u8"
11246
+ },
11247
+ {
11248
+ name: "padding",
11249
+ type: {
11250
+ array: [
11251
+ "u8",
11252
+ 3
11253
+ ]
11254
+ }
11229
11255
  }
11230
11256
  ]
11231
11257
  }
@@ -12326,8 +12352,7 @@ var types = [
12326
12352
  {
12327
12353
  name: "fee_authority",
12328
12354
  docs: [
12329
- "The authority that can modify fee structure of individual glam state",
12330
- "and claim protocol fees"
12355
+ "The authority that can modify fee structure of individual glam state and claim protocol fees"
12331
12356
  ],
12332
12357
  type: "pubkey"
12333
12358
  },
@@ -13238,6 +13263,9 @@ var types = [
13238
13263
  {
13239
13264
  name: "PythLazerStableCoin"
13240
13265
  },
13266
+ {
13267
+ name: "NotSet"
13268
+ },
13241
13269
  {
13242
13270
  name: "LstPoolState"
13243
13271
  },
@@ -13246,6 +13274,9 @@ var types = [
13246
13274
  },
13247
13275
  {
13248
13276
  name: "BaseAsset"
13277
+ },
13278
+ {
13279
+ name: "ChainlinkRWA"
13249
13280
  }
13250
13281
  ]
13251
13282
  }
@@ -15255,7 +15286,7 @@ const setsAreEqual = (a, b)=>{
15255
15286
  return true;
15256
15287
  };
15257
15288
 
15258
- const STAKE_POOLS = sanctumLstList.LstList.filter((lst)=>!lst.name.includes("Sanctum Automated") && (lst.pool.program === "Spl" || lst.pool.program === "Marinade" || lst.pool.program === "SanctumSpl" || lst.pool.program === "SanctumSplMulti")).map((lst)=>{
15289
+ const STAKE_POOLS = sanctumLstList.LstList.filter((lst)=>lst.pool.program === "Spl" || lst.pool.program === "Marinade" || lst.pool.program === "SanctumSpl" || lst.pool.program === "SanctumSplMulti").map((lst)=>{
15259
15290
  const { pool, program } = lst.pool;
15260
15291
  const poolState = program === "Marinade" ? "8szGkuLTAux9XMgZ2vtY39jVSowEcpBfFfD8hXSEqdGC" : pool;
15261
15292
  if (!poolState) {
@@ -15271,15 +15302,6 @@ const STAKE_POOLS = sanctumLstList.LstList.filter((lst)=>!lst.name.includes("San
15271
15302
  poolState: new web3_js.PublicKey(poolState)
15272
15303
  };
15273
15304
  });
15274
- STAKE_POOLS.push({
15275
- name: "Phantom Staked SOL",
15276
- symbol: "PSOL",
15277
- mint: "pSo1f9nQXWgXibFtKf7NWYxb5enAM4qfP6UJSiXRQfL",
15278
- decimals: 9,
15279
- logoURI: "https://coin-images.coingecko.com/coins/images/55849/large/PSOL.png",
15280
- tokenProgram: splToken.TOKEN_PROGRAM_ID,
15281
- poolState: new web3_js.PublicKey("pSPcvR8GmG9aKDUbn9nbKYjkxt9hxMS7kF1qqKJaPqJ")
15282
- });
15283
15305
  const STAKE_POOLS_MAP = new Map(STAKE_POOLS.map((p)=>[
15284
15306
  p.mint,
15285
15307
  p
@@ -15433,6 +15455,46 @@ const ASSETS_MAINNET = new Map([
15433
15455
  oracle: new web3_js.PublicKey("9mhGNSPArRMHpLDMSmxAvuoizBqtBGqYdT8WGuqgxNdn"),
15434
15456
  isLst: true
15435
15457
  }
15458
+ ],
15459
+ [
15460
+ // GOOGLx
15461
+ "XsCPL9dNWBMvFtTmwcCA5v3xWPSMEBCszbQdiLLq6aN",
15462
+ {
15463
+ decimals: 8,
15464
+ oracle: new web3_js.PublicKey("3NJYftD5sjVfxSnUdZ1wVML8f3aC6mp1CXCL6L7TnU8C"),
15465
+ programId: splToken.TOKEN_2022_PROGRAM_ID,
15466
+ aggIndex: 342
15467
+ }
15468
+ ],
15469
+ [
15470
+ // AAPLx
15471
+ "XsbEhLAtcf6HdfpFZ5xEMdqW8nfAvcsP5bdudRLJzJp",
15472
+ {
15473
+ decimals: 8,
15474
+ oracle: new web3_js.PublicKey("3NJYftD5sjVfxSnUdZ1wVML8f3aC6mp1CXCL6L7TnU8C"),
15475
+ programId: splToken.TOKEN_2022_PROGRAM_ID,
15476
+ aggIndex: 343
15477
+ }
15478
+ ],
15479
+ [
15480
+ // TSLAx
15481
+ "XsDoVfqeBukxuZHWhdvWHBhgEHjGNst4MLodqsJHzoB",
15482
+ {
15483
+ decimals: 8,
15484
+ oracle: new web3_js.PublicKey("3NJYftD5sjVfxSnUdZ1wVML8f3aC6mp1CXCL6L7TnU8C"),
15485
+ programId: splToken.TOKEN_2022_PROGRAM_ID,
15486
+ aggIndex: 335
15487
+ }
15488
+ ],
15489
+ [
15490
+ // NVDAx
15491
+ "Xsc9qvGR1efVDFGLrVsmkzv3qi45LTBjeUKSPmx9qEh",
15492
+ {
15493
+ decimals: 8,
15494
+ oracle: new web3_js.PublicKey("3NJYftD5sjVfxSnUdZ1wVML8f3aC6mp1CXCL6L7TnU8C"),
15495
+ programId: splToken.TOKEN_2022_PROGRAM_ID,
15496
+ aggIndex: 341
15497
+ }
15436
15498
  ]
15437
15499
  ]);
15438
15500
  const ASSETS_TESTS = new Map([]);
@@ -21719,7 +21781,23 @@ class PriceClient {
21719
21781
  * Returns an instruction that prices vault balance and tokens the vault holds
21720
21782
  */ async priceVaultIx(priceDenom) {
21721
21783
  const remainingAccounts = await this.remainingAccountsForPricingVaultAssets(priceDenom == PriceDenom.ASSET);
21722
- const priceVaultIx = await this.base.program.methods.priceVaultTokens(priceDenom).accounts({
21784
+ const aggIndexes = [];
21785
+ const chunkSize = 3;
21786
+ for(let i = 0; i < remainingAccounts.length; i += chunkSize){
21787
+ const chunk = remainingAccounts.slice(i, i + chunkSize);
21788
+ const mint = chunk[1].pubkey;
21789
+ const aggIndex = ASSETS_MAINNET.get(mint.toBase58())?.aggIndex || -1;
21790
+ aggIndexes.push(aggIndex);
21791
+ }
21792
+ // Add oracle mapping if agg oracle is used for any token
21793
+ if (aggIndexes.find((i)=>i >= 0)) {
21794
+ remainingAccounts.push({
21795
+ pubkey: new web3_js.PublicKey("Chpu5ZgfWX5ZzVpUx9Xvv4WPM75Xd7zPJNDPsFnCpLpk"),
21796
+ isSigner: false,
21797
+ isWritable: false
21798
+ });
21799
+ }
21800
+ const priceVaultIx = await this.base.program.methods.priceVaultTokens(priceDenom, aggIndexes).accounts({
21723
21801
  glamState: this.base.statePda,
21724
21802
  solOracle: SOL_ORACLE
21725
21803
  }).remainingAccounts(remainingAccounts).instruction();
package/index.esm.js CHANGED
@@ -4,7 +4,7 @@ import { PublicKey, StakeProgram, ComputeBudgetProgram, VersionedTransaction, Tr
4
4
  import { getExtensionData, ExtensionType, TOKEN_PROGRAM_ID, TOKEN_2022_PROGRAM_ID, unpackMint, AccountLayout, getAssociatedTokenAddressSync, getAccount, TokenAccountNotFoundError, createAssociatedTokenAccountIdempotentInstruction, createSyncNativeInstruction, createTransferCheckedInstruction, unpackAccount, createCloseAccountInstruction } from '@solana/spl-token';
5
5
  import { unpack } from '@solana/spl-token-metadata';
6
6
  import DLMM, { binIdToBinArrayIndex, deriveBinArray, Strategy } from '@meteora-ag/dlmm';
7
- import { LstList } from 'sanctum-lst-list';
7
+ import { LstList } from '@glamsystems/sanctum-lst-list';
8
8
  import { bs58 } from '@coral-xyz/anchor/dist/cjs/utils/bytes';
9
9
  import * as borsh from '@coral-xyz/borsh';
10
10
  import { struct, array, publicKey, u128, i64, u64, u32, u16, u8, bool } from '@coral-xyz/borsh';
@@ -14,7 +14,7 @@ import { getStakePoolAccount } from '@solana/spl-stake-pool';
14
14
  var address = "GLAMbTqav9N9witRjswJ8enwp9vv5G8bsSJ2kPJ4rcyc";
15
15
  var metadata = {
16
16
  name: "glam_protocol",
17
- version: "0.4.35",
17
+ version: "0.4.36",
18
18
  spec: "0.1.0",
19
19
  description: "Glam Protocol"
20
20
  };
@@ -987,7 +987,7 @@ var instructions = [
987
987
  98,
988
988
  97,
989
989
  108,
990
- 95,
990
+ 45,
991
991
  99,
992
992
  111,
993
993
  110,
@@ -6810,7 +6810,7 @@ var instructions = [
6810
6810
  98,
6811
6811
  97,
6812
6812
  108,
6813
- 95,
6813
+ 45,
6814
6814
  99,
6815
6815
  111,
6816
6816
  110,
@@ -6941,7 +6941,7 @@ var instructions = [
6941
6941
  98,
6942
6942
  97,
6943
6943
  108,
6944
- 95,
6944
+ 45,
6945
6945
  99,
6946
6946
  111,
6947
6947
  110,
@@ -7077,7 +7077,7 @@ var instructions = [
7077
7077
  98,
7078
7078
  97,
7079
7079
  108,
7080
- 95,
7080
+ 45,
7081
7081
  99,
7082
7082
  111,
7083
7083
  110,
@@ -7223,7 +7223,7 @@ var instructions = [
7223
7223
  98,
7224
7224
  97,
7225
7225
  108,
7226
- 95,
7226
+ 45,
7227
7227
  99,
7228
7228
  111,
7229
7229
  110,
@@ -7347,7 +7347,7 @@ var instructions = [
7347
7347
  98,
7348
7348
  97,
7349
7349
  108,
7350
- 95,
7350
+ 45,
7351
7351
  99,
7352
7352
  111,
7353
7353
  110,
@@ -7467,7 +7467,7 @@ var instructions = [
7467
7467
  98,
7468
7468
  97,
7469
7469
  108,
7470
- 95,
7470
+ 45,
7471
7471
  99,
7472
7472
  111,
7473
7473
  110,
@@ -7533,8 +7533,11 @@ var instructions = [
7533
7533
  docs: [
7534
7534
  "Price vault SOL balance and tokens it holds.",
7535
7535
  "",
7536
+ "If aggregation oracle is used for token #`i`, `agg_indexes[i]` must be set to its index in the oracle mapping account.",
7537
+ "",
7536
7538
  "Extra accounts for pricing N tokens:",
7537
- "- (ata, mint, oracle) x N"
7539
+ "- (ata, mint, oracle) x N",
7540
+ "- optional oracle mapping (only add it if any token uses an agg oracle)"
7538
7541
  ],
7539
7542
  discriminator: [
7540
7543
  54,
@@ -7593,7 +7596,7 @@ var instructions = [
7593
7596
  98,
7594
7597
  97,
7595
7598
  108,
7596
- 95,
7599
+ 45,
7597
7600
  99,
7598
7601
  111,
7599
7602
  110,
@@ -7651,6 +7654,12 @@ var instructions = [
7651
7654
  name: "PriceDenom"
7652
7655
  }
7653
7656
  }
7657
+ },
7658
+ {
7659
+ name: "agg_indexes",
7660
+ type: {
7661
+ vec: "i16"
7662
+ }
7654
7663
  }
7655
7664
  ]
7656
7665
  },
@@ -8059,7 +8068,7 @@ var instructions = [
8059
8068
  98,
8060
8069
  97,
8061
8070
  108,
8062
- 95,
8071
+ 45,
8063
8072
  99,
8064
8073
  111,
8065
8074
  110,
@@ -11206,6 +11215,23 @@ var types = [
11206
11215
  name: "OracleSource"
11207
11216
  }
11208
11217
  }
11218
+ },
11219
+ {
11220
+ name: "max_age_seconds",
11221
+ type: "u16"
11222
+ },
11223
+ {
11224
+ name: "priority",
11225
+ type: "u8"
11226
+ },
11227
+ {
11228
+ name: "padding",
11229
+ type: {
11230
+ array: [
11231
+ "u8",
11232
+ 3
11233
+ ]
11234
+ }
11209
11235
  }
11210
11236
  ]
11211
11237
  }
@@ -12306,8 +12332,7 @@ var types = [
12306
12332
  {
12307
12333
  name: "fee_authority",
12308
12334
  docs: [
12309
- "The authority that can modify fee structure of individual glam state",
12310
- "and claim protocol fees"
12335
+ "The authority that can modify fee structure of individual glam state and claim protocol fees"
12311
12336
  ],
12312
12337
  type: "pubkey"
12313
12338
  },
@@ -13218,6 +13243,9 @@ var types = [
13218
13243
  {
13219
13244
  name: "PythLazerStableCoin"
13220
13245
  },
13246
+ {
13247
+ name: "NotSet"
13248
+ },
13221
13249
  {
13222
13250
  name: "LstPoolState"
13223
13251
  },
@@ -13226,6 +13254,9 @@ var types = [
13226
13254
  },
13227
13255
  {
13228
13256
  name: "BaseAsset"
13257
+ },
13258
+ {
13259
+ name: "ChainlinkRWA"
13229
13260
  }
13230
13261
  ]
13231
13262
  }
@@ -15235,7 +15266,7 @@ const setsAreEqual = (a, b)=>{
15235
15266
  return true;
15236
15267
  };
15237
15268
 
15238
- const STAKE_POOLS = LstList.filter((lst)=>!lst.name.includes("Sanctum Automated") && (lst.pool.program === "Spl" || lst.pool.program === "Marinade" || lst.pool.program === "SanctumSpl" || lst.pool.program === "SanctumSplMulti")).map((lst)=>{
15269
+ const STAKE_POOLS = LstList.filter((lst)=>lst.pool.program === "Spl" || lst.pool.program === "Marinade" || lst.pool.program === "SanctumSpl" || lst.pool.program === "SanctumSplMulti").map((lst)=>{
15239
15270
  const { pool, program } = lst.pool;
15240
15271
  const poolState = program === "Marinade" ? "8szGkuLTAux9XMgZ2vtY39jVSowEcpBfFfD8hXSEqdGC" : pool;
15241
15272
  if (!poolState) {
@@ -15251,15 +15282,6 @@ const STAKE_POOLS = LstList.filter((lst)=>!lst.name.includes("Sanctum Automated"
15251
15282
  poolState: new PublicKey(poolState)
15252
15283
  };
15253
15284
  });
15254
- STAKE_POOLS.push({
15255
- name: "Phantom Staked SOL",
15256
- symbol: "PSOL",
15257
- mint: "pSo1f9nQXWgXibFtKf7NWYxb5enAM4qfP6UJSiXRQfL",
15258
- decimals: 9,
15259
- logoURI: "https://coin-images.coingecko.com/coins/images/55849/large/PSOL.png",
15260
- tokenProgram: TOKEN_PROGRAM_ID,
15261
- poolState: new PublicKey("pSPcvR8GmG9aKDUbn9nbKYjkxt9hxMS7kF1qqKJaPqJ")
15262
- });
15263
15285
  const STAKE_POOLS_MAP = new Map(STAKE_POOLS.map((p)=>[
15264
15286
  p.mint,
15265
15287
  p
@@ -15413,6 +15435,46 @@ const ASSETS_MAINNET = new Map([
15413
15435
  oracle: new PublicKey("9mhGNSPArRMHpLDMSmxAvuoizBqtBGqYdT8WGuqgxNdn"),
15414
15436
  isLst: true
15415
15437
  }
15438
+ ],
15439
+ [
15440
+ // GOOGLx
15441
+ "XsCPL9dNWBMvFtTmwcCA5v3xWPSMEBCszbQdiLLq6aN",
15442
+ {
15443
+ decimals: 8,
15444
+ oracle: new PublicKey("3NJYftD5sjVfxSnUdZ1wVML8f3aC6mp1CXCL6L7TnU8C"),
15445
+ programId: TOKEN_2022_PROGRAM_ID,
15446
+ aggIndex: 342
15447
+ }
15448
+ ],
15449
+ [
15450
+ // AAPLx
15451
+ "XsbEhLAtcf6HdfpFZ5xEMdqW8nfAvcsP5bdudRLJzJp",
15452
+ {
15453
+ decimals: 8,
15454
+ oracle: new PublicKey("3NJYftD5sjVfxSnUdZ1wVML8f3aC6mp1CXCL6L7TnU8C"),
15455
+ programId: TOKEN_2022_PROGRAM_ID,
15456
+ aggIndex: 343
15457
+ }
15458
+ ],
15459
+ [
15460
+ // TSLAx
15461
+ "XsDoVfqeBukxuZHWhdvWHBhgEHjGNst4MLodqsJHzoB",
15462
+ {
15463
+ decimals: 8,
15464
+ oracle: new PublicKey("3NJYftD5sjVfxSnUdZ1wVML8f3aC6mp1CXCL6L7TnU8C"),
15465
+ programId: TOKEN_2022_PROGRAM_ID,
15466
+ aggIndex: 335
15467
+ }
15468
+ ],
15469
+ [
15470
+ // NVDAx
15471
+ "Xsc9qvGR1efVDFGLrVsmkzv3qi45LTBjeUKSPmx9qEh",
15472
+ {
15473
+ decimals: 8,
15474
+ oracle: new PublicKey("3NJYftD5sjVfxSnUdZ1wVML8f3aC6mp1CXCL6L7TnU8C"),
15475
+ programId: TOKEN_2022_PROGRAM_ID,
15476
+ aggIndex: 341
15477
+ }
15416
15478
  ]
15417
15479
  ]);
15418
15480
  const ASSETS_TESTS = new Map([]);
@@ -21699,7 +21761,23 @@ class PriceClient {
21699
21761
  * Returns an instruction that prices vault balance and tokens the vault holds
21700
21762
  */ async priceVaultIx(priceDenom) {
21701
21763
  const remainingAccounts = await this.remainingAccountsForPricingVaultAssets(priceDenom == PriceDenom.ASSET);
21702
- const priceVaultIx = await this.base.program.methods.priceVaultTokens(priceDenom).accounts({
21764
+ const aggIndexes = [];
21765
+ const chunkSize = 3;
21766
+ for(let i = 0; i < remainingAccounts.length; i += chunkSize){
21767
+ const chunk = remainingAccounts.slice(i, i + chunkSize);
21768
+ const mint = chunk[1].pubkey;
21769
+ const aggIndex = ASSETS_MAINNET.get(mint.toBase58())?.aggIndex || -1;
21770
+ aggIndexes.push(aggIndex);
21771
+ }
21772
+ // Add oracle mapping if agg oracle is used for any token
21773
+ if (aggIndexes.find((i)=>i >= 0)) {
21774
+ remainingAccounts.push({
21775
+ pubkey: new PublicKey("Chpu5ZgfWX5ZzVpUx9Xvv4WPM75Xd7zPJNDPsFnCpLpk"),
21776
+ isSigner: false,
21777
+ isWritable: false
21778
+ });
21779
+ }
21780
+ const priceVaultIx = await this.base.program.methods.priceVaultTokens(priceDenom, aggIndexes).accounts({
21703
21781
  glamState: this.base.statePda,
21704
21782
  solOracle: SOL_ORACLE
21705
21783
  }).remainingAccounts(remainingAccounts).instruction();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glamsystems/glam-sdk",
3
- "version": "0.1.31",
3
+ "version": "0.1.32",
4
4
  "description": "TypeScript SDK for the GLAM Protocol",
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js",
@@ -26,7 +26,7 @@
26
26
  "@solana/spl-token": "^0.4.9",
27
27
  "@solana/spl-token-metadata": "^0.1.4",
28
28
  "@solana/web3.js": "^1.98.0",
29
- "sanctum-lst-list": "^0.2.53",
29
+ "@glamsystems/sanctum-lst-list": "^0.2.54",
30
30
  "bs58": "^5.0.0",
31
31
  "buffer": "^6.0.3"
32
32
  },
@@ -25,6 +25,7 @@ export interface AssetMeta {
25
25
  oracle: PublicKey;
26
26
  programId?: PublicKey;
27
27
  isLst?: boolean;
28
+ aggIndex?: number;
28
29
  }
29
30
  export declare const ASSETS_MAINNET: Map<string, AssetMeta>;
30
31
  export declare const ASSETS_TESTS: Map<string, AssetMeta>;
@@ -2,7 +2,7 @@
2
2
  "address": "GLAMbTqav9N9witRjswJ8enwp9vv5G8bsSJ2kPJ4rcyc",
3
3
  "metadata": {
4
4
  "name": "glam_protocol",
5
- "version": "0.4.35",
5
+ "version": "0.4.36",
6
6
  "spec": "0.1.0",
7
7
  "description": "Glam Protocol"
8
8
  },
@@ -975,7 +975,7 @@
975
975
  98,
976
976
  97,
977
977
  108,
978
- 95,
978
+ 45,
979
979
  99,
980
980
  111,
981
981
  110,
@@ -6798,7 +6798,7 @@
6798
6798
  98,
6799
6799
  97,
6800
6800
  108,
6801
- 95,
6801
+ 45,
6802
6802
  99,
6803
6803
  111,
6804
6804
  110,
@@ -6929,7 +6929,7 @@
6929
6929
  98,
6930
6930
  97,
6931
6931
  108,
6932
- 95,
6932
+ 45,
6933
6933
  99,
6934
6934
  111,
6935
6935
  110,
@@ -7065,7 +7065,7 @@
7065
7065
  98,
7066
7066
  97,
7067
7067
  108,
7068
- 95,
7068
+ 45,
7069
7069
  99,
7070
7070
  111,
7071
7071
  110,
@@ -7211,7 +7211,7 @@
7211
7211
  98,
7212
7212
  97,
7213
7213
  108,
7214
- 95,
7214
+ 45,
7215
7215
  99,
7216
7216
  111,
7217
7217
  110,
@@ -7335,7 +7335,7 @@
7335
7335
  98,
7336
7336
  97,
7337
7337
  108,
7338
- 95,
7338
+ 45,
7339
7339
  99,
7340
7340
  111,
7341
7341
  110,
@@ -7455,7 +7455,7 @@
7455
7455
  98,
7456
7456
  97,
7457
7457
  108,
7458
- 95,
7458
+ 45,
7459
7459
  99,
7460
7460
  111,
7461
7461
  110,
@@ -7521,8 +7521,11 @@
7521
7521
  "docs": [
7522
7522
  "Price vault SOL balance and tokens it holds.",
7523
7523
  "",
7524
+ "If aggregation oracle is used for token #`i`, `agg_indexes[i]` must be set to its index in the oracle mapping account.",
7525
+ "",
7524
7526
  "Extra accounts for pricing N tokens:",
7525
- "- (ata, mint, oracle) x N"
7527
+ "- (ata, mint, oracle) x N",
7528
+ "- optional oracle mapping (only add it if any token uses an agg oracle)"
7526
7529
  ],
7527
7530
  "discriminator": [
7528
7531
  54,
@@ -7581,7 +7584,7 @@
7581
7584
  98,
7582
7585
  97,
7583
7586
  108,
7584
- 95,
7587
+ 45,
7585
7588
  99,
7586
7589
  111,
7587
7590
  110,
@@ -7639,6 +7642,12 @@
7639
7642
  "name": "PriceDenom"
7640
7643
  }
7641
7644
  }
7645
+ },
7646
+ {
7647
+ "name": "agg_indexes",
7648
+ "type": {
7649
+ "vec": "i16"
7650
+ }
7642
7651
  }
7643
7652
  ]
7644
7653
  },
@@ -8047,7 +8056,7 @@
8047
8056
  98,
8048
8057
  97,
8049
8058
  108,
8050
- 95,
8059
+ 45,
8051
8060
  99,
8052
8061
  111,
8053
8062
  110,
@@ -11194,6 +11203,23 @@
11194
11203
  "name": "OracleSource"
11195
11204
  }
11196
11205
  }
11206
+ },
11207
+ {
11208
+ "name": "max_age_seconds",
11209
+ "type": "u16"
11210
+ },
11211
+ {
11212
+ "name": "priority",
11213
+ "type": "u8"
11214
+ },
11215
+ {
11216
+ "name": "padding",
11217
+ "type": {
11218
+ "array": [
11219
+ "u8",
11220
+ 3
11221
+ ]
11222
+ }
11197
11223
  }
11198
11224
  ]
11199
11225
  }
@@ -12294,8 +12320,7 @@
12294
12320
  {
12295
12321
  "name": "fee_authority",
12296
12322
  "docs": [
12297
- "The authority that can modify fee structure of individual glam state",
12298
- "and claim protocol fees"
12323
+ "The authority that can modify fee structure of individual glam state and claim protocol fees"
12299
12324
  ],
12300
12325
  "type": "pubkey"
12301
12326
  },
@@ -13206,6 +13231,9 @@
13206
13231
  {
13207
13232
  "name": "PythLazerStableCoin"
13208
13233
  },
13234
+ {
13235
+ "name": "NotSet"
13236
+ },
13209
13237
  {
13210
13238
  "name": "LstPoolState"
13211
13239
  },
@@ -13214,6 +13242,9 @@
13214
13242
  },
13215
13243
  {
13216
13244
  "name": "BaseAsset"
13245
+ },
13246
+ {
13247
+ "name": "ChainlinkRWA"
13217
13248
  }
13218
13249
  ]
13219
13250
  }
@@ -8,7 +8,7 @@ export type GlamProtocol = {
8
8
  "address": "GLAMbTqav9N9witRjswJ8enwp9vv5G8bsSJ2kPJ4rcyc";
9
9
  "metadata": {
10
10
  "name": "glamProtocol";
11
- "version": "0.4.35";
11
+ "version": "0.4.36";
12
12
  "spec": "0.1.0";
13
13
  "description": "Glam Protocol";
14
14
  };
@@ -981,7 +981,7 @@ export type GlamProtocol = {
981
981
  98,
982
982
  97,
983
983
  108,
984
- 95,
984
+ 45,
985
985
  99,
986
986
  111,
987
987
  110,
@@ -6804,7 +6804,7 @@ export type GlamProtocol = {
6804
6804
  98,
6805
6805
  97,
6806
6806
  108,
6807
- 95,
6807
+ 45,
6808
6808
  99,
6809
6809
  111,
6810
6810
  110,
@@ -6935,7 +6935,7 @@ export type GlamProtocol = {
6935
6935
  98,
6936
6936
  97,
6937
6937
  108,
6938
- 95,
6938
+ 45,
6939
6939
  99,
6940
6940
  111,
6941
6941
  110,
@@ -7071,7 +7071,7 @@ export type GlamProtocol = {
7071
7071
  98,
7072
7072
  97,
7073
7073
  108,
7074
- 95,
7074
+ 45,
7075
7075
  99,
7076
7076
  111,
7077
7077
  110,
@@ -7217,7 +7217,7 @@ export type GlamProtocol = {
7217
7217
  98,
7218
7218
  97,
7219
7219
  108,
7220
- 95,
7220
+ 45,
7221
7221
  99,
7222
7222
  111,
7223
7223
  110,
@@ -7341,7 +7341,7 @@ export type GlamProtocol = {
7341
7341
  98,
7342
7342
  97,
7343
7343
  108,
7344
- 95,
7344
+ 45,
7345
7345
  99,
7346
7346
  111,
7347
7347
  110,
@@ -7461,7 +7461,7 @@ export type GlamProtocol = {
7461
7461
  98,
7462
7462
  97,
7463
7463
  108,
7464
- 95,
7464
+ 45,
7465
7465
  99,
7466
7466
  111,
7467
7467
  110,
@@ -7527,8 +7527,11 @@ export type GlamProtocol = {
7527
7527
  "docs": [
7528
7528
  "Price vault SOL balance and tokens it holds.",
7529
7529
  "",
7530
+ "If aggregation oracle is used for token #`i`, `agg_indexes[i]` must be set to its index in the oracle mapping account.",
7531
+ "",
7530
7532
  "Extra accounts for pricing N tokens:",
7531
- "- (ata, mint, oracle) x N"
7533
+ "- (ata, mint, oracle) x N",
7534
+ "- optional oracle mapping (only add it if any token uses an agg oracle)"
7532
7535
  ];
7533
7536
  "discriminator": [
7534
7537
  54,
@@ -7587,7 +7590,7 @@ export type GlamProtocol = {
7587
7590
  98,
7588
7591
  97,
7589
7592
  108,
7590
- 95,
7593
+ 45,
7591
7594
  99,
7592
7595
  111,
7593
7596
  110,
@@ -7645,6 +7648,12 @@ export type GlamProtocol = {
7645
7648
  "name": "priceDenom";
7646
7649
  };
7647
7650
  };
7651
+ },
7652
+ {
7653
+ "name": "aggIndexes";
7654
+ "type": {
7655
+ "vec": "i16";
7656
+ };
7648
7657
  }
7649
7658
  ];
7650
7659
  },
@@ -8053,7 +8062,7 @@ export type GlamProtocol = {
8053
8062
  98,
8054
8063
  97,
8055
8064
  108,
8056
- 95,
8065
+ 45,
8057
8066
  99,
8058
8067
  111,
8059
8068
  110,
@@ -11200,6 +11209,23 @@ export type GlamProtocol = {
11200
11209
  "name": "oracleSource";
11201
11210
  };
11202
11211
  };
11212
+ },
11213
+ {
11214
+ "name": "maxAgeSeconds";
11215
+ "type": "u16";
11216
+ },
11217
+ {
11218
+ "name": "priority";
11219
+ "type": "u8";
11220
+ },
11221
+ {
11222
+ "name": "padding";
11223
+ "type": {
11224
+ "array": [
11225
+ "u8",
11226
+ 3
11227
+ ];
11228
+ };
11203
11229
  }
11204
11230
  ];
11205
11231
  };
@@ -12300,8 +12326,7 @@ export type GlamProtocol = {
12300
12326
  {
12301
12327
  "name": "feeAuthority";
12302
12328
  "docs": [
12303
- "The authority that can modify fee structure of individual glam state",
12304
- "and claim protocol fees"
12329
+ "The authority that can modify fee structure of individual glam state and claim protocol fees"
12305
12330
  ];
12306
12331
  "type": "pubkey";
12307
12332
  },
@@ -13212,6 +13237,9 @@ export type GlamProtocol = {
13212
13237
  {
13213
13238
  "name": "pythLazerStableCoin";
13214
13239
  },
13240
+ {
13241
+ "name": "notSet";
13242
+ },
13215
13243
  {
13216
13244
  "name": "lstPoolState";
13217
13245
  },
@@ -13220,6 +13248,9 @@ export type GlamProtocol = {
13220
13248
  },
13221
13249
  {
13222
13250
  "name": "baseAsset";
13251
+ },
13252
+ {
13253
+ "name": "chainlinkRwa";
13223
13254
  }
13224
13255
  ];
13225
13256
  };
@@ -8,7 +8,7 @@ export type GlamProtocol = {
8
8
  "address": "GLAMbTqav9N9witRjswJ8enwp9vv5G8bsSJ2kPJ4rcyc",
9
9
  "metadata": {
10
10
  "name": "glamProtocol",
11
- "version": "0.4.35",
11
+ "version": "0.4.36",
12
12
  "spec": "0.1.0",
13
13
  "description": "Glam Protocol"
14
14
  },
@@ -981,7 +981,7 @@ export type GlamProtocol = {
981
981
  98,
982
982
  97,
983
983
  108,
984
- 95,
984
+ 45,
985
985
  99,
986
986
  111,
987
987
  110,
@@ -6804,7 +6804,7 @@ export type GlamProtocol = {
6804
6804
  98,
6805
6805
  97,
6806
6806
  108,
6807
- 95,
6807
+ 45,
6808
6808
  99,
6809
6809
  111,
6810
6810
  110,
@@ -6935,7 +6935,7 @@ export type GlamProtocol = {
6935
6935
  98,
6936
6936
  97,
6937
6937
  108,
6938
- 95,
6938
+ 45,
6939
6939
  99,
6940
6940
  111,
6941
6941
  110,
@@ -7071,7 +7071,7 @@ export type GlamProtocol = {
7071
7071
  98,
7072
7072
  97,
7073
7073
  108,
7074
- 95,
7074
+ 45,
7075
7075
  99,
7076
7076
  111,
7077
7077
  110,
@@ -7217,7 +7217,7 @@ export type GlamProtocol = {
7217
7217
  98,
7218
7218
  97,
7219
7219
  108,
7220
- 95,
7220
+ 45,
7221
7221
  99,
7222
7222
  111,
7223
7223
  110,
@@ -7341,7 +7341,7 @@ export type GlamProtocol = {
7341
7341
  98,
7342
7342
  97,
7343
7343
  108,
7344
- 95,
7344
+ 45,
7345
7345
  99,
7346
7346
  111,
7347
7347
  110,
@@ -7461,7 +7461,7 @@ export type GlamProtocol = {
7461
7461
  98,
7462
7462
  97,
7463
7463
  108,
7464
- 95,
7464
+ 45,
7465
7465
  99,
7466
7466
  111,
7467
7467
  110,
@@ -7527,8 +7527,11 @@ export type GlamProtocol = {
7527
7527
  "docs": [
7528
7528
  "Price vault SOL balance and tokens it holds.",
7529
7529
  "",
7530
+ "If aggregation oracle is used for token #`i`, `agg_indexes[i]` must be set to its index in the oracle mapping account.",
7531
+ "",
7530
7532
  "Extra accounts for pricing N tokens:",
7531
- "- (ata, mint, oracle) x N"
7533
+ "- (ata, mint, oracle) x N",
7534
+ "- optional oracle mapping (only add it if any token uses an agg oracle)"
7532
7535
  ],
7533
7536
  "discriminator": [
7534
7537
  54,
@@ -7587,7 +7590,7 @@ export type GlamProtocol = {
7587
7590
  98,
7588
7591
  97,
7589
7592
  108,
7590
- 95,
7593
+ 45,
7591
7594
  99,
7592
7595
  111,
7593
7596
  110,
@@ -7645,6 +7648,12 @@ export type GlamProtocol = {
7645
7648
  "name": "priceDenom"
7646
7649
  }
7647
7650
  }
7651
+ },
7652
+ {
7653
+ "name": "aggIndexes",
7654
+ "type": {
7655
+ "vec": "i16"
7656
+ }
7648
7657
  }
7649
7658
  ]
7650
7659
  },
@@ -8053,7 +8062,7 @@ export type GlamProtocol = {
8053
8062
  98,
8054
8063
  97,
8055
8064
  108,
8056
- 95,
8065
+ 45,
8057
8066
  99,
8058
8067
  111,
8059
8068
  110,
@@ -11200,6 +11209,23 @@ export type GlamProtocol = {
11200
11209
  "name": "oracleSource"
11201
11210
  }
11202
11211
  }
11212
+ },
11213
+ {
11214
+ "name": "maxAgeSeconds",
11215
+ "type": "u16"
11216
+ },
11217
+ {
11218
+ "name": "priority",
11219
+ "type": "u8"
11220
+ },
11221
+ {
11222
+ "name": "padding",
11223
+ "type": {
11224
+ "array": [
11225
+ "u8",
11226
+ 3
11227
+ ]
11228
+ }
11203
11229
  }
11204
11230
  ]
11205
11231
  }
@@ -12300,8 +12326,7 @@ export type GlamProtocol = {
12300
12326
  {
12301
12327
  "name": "feeAuthority",
12302
12328
  "docs": [
12303
- "The authority that can modify fee structure of individual glam state",
12304
- "and claim protocol fees"
12329
+ "The authority that can modify fee structure of individual glam state and claim protocol fees"
12305
12330
  ],
12306
12331
  "type": "pubkey"
12307
12332
  },
@@ -13212,6 +13237,9 @@ export type GlamProtocol = {
13212
13237
  {
13213
13238
  "name": "pythLazerStableCoin"
13214
13239
  },
13240
+ {
13241
+ "name": "notSet"
13242
+ },
13215
13243
  {
13216
13244
  "name": "lstPoolState"
13217
13245
  },
@@ -13220,6 +13248,9 @@ export type GlamProtocol = {
13220
13248
  },
13221
13249
  {
13222
13250
  "name": "baseAsset"
13251
+ },
13252
+ {
13253
+ "name": "chainlinkRwa"
13223
13254
  }
13224
13255
  ]
13225
13256
  }