@glamsystems/glam-sdk 1.1.0-alpha.0 → 1.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glamsystems/glam-sdk",
3
- "version": "1.1.0-alpha.0",
3
+ "version": "1.1.0-alpha.1",
4
4
  "description": "TypeScript SDK for the GLAM Protocol",
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js",
@@ -2,6 +2,8 @@ import { BN } from "@coral-xyz/anchor";
2
2
  import { PublicKey, TransactionInstruction, TransactionSignature, VersionedTransaction } from "@solana/web3.js";
3
3
  import { BaseClient, BaseTxBuilder, TxOptions } from "./base";
4
4
  import { NeutralPolicy } from "../deser/integrationPolicies";
5
+ import { NTBUNDLE_PROGRAM_ID } from "../constants";
6
+ export { NTBUNDLE_PROGRAM_ID };
5
7
  export declare const NEUTRAL_PROTOCOL = 1;
6
8
  export declare const NEUTRAL_BUNDLE_DISCRIMINATOR: Buffer<ArrayBuffer>;
7
9
  export type InitializeBundleDepositorAccounts = {
@@ -76,8 +78,6 @@ declare class TxBuilder extends BaseTxBuilder<NeutralClient> {
76
78
  setNeutralPolicyTx(policy: NeutralPolicy, txOptions?: TxOptions): Promise<VersionedTransaction>;
77
79
  initializeBundleDepositorIx(accounts: InitializeBundleDepositorAccounts, signer?: PublicKey): Promise<TransactionInstruction>;
78
80
  initializeBundleDepositorTx(accounts: InitializeBundleDepositorAccounts, txOptions?: TxOptions): Promise<VersionedTransaction>;
79
- initializePermissionedBundleDepositorIx(accounts: InitializeBundleDepositorAccounts, signer?: PublicKey): Promise<TransactionInstruction>;
80
- initializePermissionedBundleDepositorTx(accounts: InitializeBundleDepositorAccounts, txOptions?: TxOptions): Promise<VersionedTransaction>;
81
81
  requestDepositIx(accounts: RequestDepositAccounts, amount: BN | bigint | number | string, signer?: PublicKey): Promise<TransactionInstruction>;
82
82
  requestDepositTx(accounts: RequestDepositAccounts, amount: BN | bigint | number | string, txOptions?: TxOptions): Promise<VersionedTransaction>;
83
83
  }
@@ -104,8 +104,6 @@ export declare class NeutralClient {
104
104
  setPolicy(policy: NeutralPolicy, txOptions?: TxOptions): Promise<TransactionSignature>;
105
105
  allowlistBundle(bundle: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
106
106
  initializeBundleDepositor(bundle: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
107
- initializePermissionedBundleDepositor(bundle: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
108
107
  requestDeposit(bundle: PublicKey, amount: BN | bigint | number | string, txOptions?: TxOptions): Promise<TransactionSignature>;
109
108
  requestDepositUiAmount(bundle: PublicKey, amount: number | string, txOptions?: TxOptions): Promise<TransactionSignature>;
110
109
  }
111
- export {};
@@ -125,6 +125,7 @@ export declare class PriceClient {
125
125
  priceVaultIxs(): Promise<TransactionInstruction[]>;
126
126
  private enqueuePriceVaultIxs;
127
127
  private priceManagedTransfersIxs;
128
+ private priceNeutralBundleDepositorsIx;
128
129
  private priceEpiValidatedPositionsIx;
129
130
  private _priceVaultIxsImpl;
130
131
  validateAumIx(): Promise<TransactionInstruction>;
@@ -4147,6 +4147,239 @@
4147
4147
  ],
4148
4148
  "args": []
4149
4149
  },
4150
+ {
4151
+ "name": "price_neutral_bundle_depositors",
4152
+ "docs": [
4153
+ "Price neutral bundle depositors",
4154
+ "",
4155
+ "Remaining accounts:",
4156
+ "- 4 * N neutral bundle depositor account tuples:",
4157
+ "1. User bundle account",
4158
+ "2. Bundle account",
4159
+ "3. Bundle oracle data account",
4160
+ "4. Bundle asset oracle account"
4161
+ ],
4162
+ "discriminator": [
4163
+ 202,
4164
+ 93,
4165
+ 205,
4166
+ 29,
4167
+ 37,
4168
+ 180,
4169
+ 127,
4170
+ 102
4171
+ ],
4172
+ "accounts": [
4173
+ {
4174
+ "name": "glam_state",
4175
+ "writable": true
4176
+ },
4177
+ {
4178
+ "name": "glam_vault",
4179
+ "pda": {
4180
+ "seeds": [
4181
+ {
4182
+ "kind": "const",
4183
+ "value": [
4184
+ 118,
4185
+ 97,
4186
+ 117,
4187
+ 108,
4188
+ 116
4189
+ ]
4190
+ },
4191
+ {
4192
+ "kind": "account",
4193
+ "path": "glam_state"
4194
+ }
4195
+ ],
4196
+ "program": {
4197
+ "kind": "const",
4198
+ "value": [
4199
+ 10,
4200
+ 55,
4201
+ 49,
4202
+ 193,
4203
+ 142,
4204
+ 247,
4205
+ 75,
4206
+ 193,
4207
+ 33,
4208
+ 61,
4209
+ 5,
4210
+ 218,
4211
+ 254,
4212
+ 219,
4213
+ 143,
4214
+ 206,
4215
+ 156,
4216
+ 138,
4217
+ 14,
4218
+ 32,
4219
+ 89,
4220
+ 232,
4221
+ 248,
4222
+ 173,
4223
+ 46,
4224
+ 77,
4225
+ 46,
4226
+ 206,
4227
+ 189,
4228
+ 171,
4229
+ 68,
4230
+ 237
4231
+ ]
4232
+ }
4233
+ }
4234
+ },
4235
+ {
4236
+ "name": "signer",
4237
+ "writable": true,
4238
+ "signer": true
4239
+ },
4240
+ {
4241
+ "name": "sol_usd_oracle"
4242
+ },
4243
+ {
4244
+ "name": "base_asset_oracle"
4245
+ },
4246
+ {
4247
+ "name": "integration_authority",
4248
+ "pda": {
4249
+ "seeds": [
4250
+ {
4251
+ "kind": "const",
4252
+ "value": [
4253
+ 105,
4254
+ 110,
4255
+ 116,
4256
+ 101,
4257
+ 103,
4258
+ 114,
4259
+ 97,
4260
+ 116,
4261
+ 105,
4262
+ 111,
4263
+ 110,
4264
+ 45,
4265
+ 97,
4266
+ 117,
4267
+ 116,
4268
+ 104,
4269
+ 111,
4270
+ 114,
4271
+ 105,
4272
+ 116,
4273
+ 121
4274
+ ]
4275
+ }
4276
+ ]
4277
+ }
4278
+ },
4279
+ {
4280
+ "name": "glam_config",
4281
+ "pda": {
4282
+ "seeds": [
4283
+ {
4284
+ "kind": "const",
4285
+ "value": [
4286
+ 103,
4287
+ 108,
4288
+ 111,
4289
+ 98,
4290
+ 97,
4291
+ 108,
4292
+ 45,
4293
+ 99,
4294
+ 111,
4295
+ 110,
4296
+ 102,
4297
+ 105,
4298
+ 103
4299
+ ]
4300
+ }
4301
+ ],
4302
+ "program": {
4303
+ "kind": "const",
4304
+ "value": [
4305
+ 10,
4306
+ 11,
4307
+ 0,
4308
+ 83,
4309
+ 72,
4310
+ 16,
4311
+ 46,
4312
+ 144,
4313
+ 46,
4314
+ 42,
4315
+ 79,
4316
+ 22,
4317
+ 157,
4318
+ 123,
4319
+ 21,
4320
+ 242,
4321
+ 192,
4322
+ 146,
4323
+ 1,
4324
+ 78,
4325
+ 88,
4326
+ 59,
4327
+ 102,
4328
+ 9,
4329
+ 190,
4330
+ 226,
4331
+ 92,
4332
+ 189,
4333
+ 187,
4334
+ 232,
4335
+ 83,
4336
+ 220
4337
+ ]
4338
+ }
4339
+ }
4340
+ },
4341
+ {
4342
+ "name": "glam_protocol",
4343
+ "address": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"
4344
+ },
4345
+ {
4346
+ "name": "event_authority",
4347
+ "optional": true,
4348
+ "pda": {
4349
+ "seeds": [
4350
+ {
4351
+ "kind": "const",
4352
+ "value": [
4353
+ 95,
4354
+ 95,
4355
+ 101,
4356
+ 118,
4357
+ 101,
4358
+ 110,
4359
+ 116,
4360
+ 95,
4361
+ 97,
4362
+ 117,
4363
+ 116,
4364
+ 104,
4365
+ 111,
4366
+ 114,
4367
+ 105,
4368
+ 116,
4369
+ 121
4370
+ ]
4371
+ }
4372
+ ]
4373
+ }
4374
+ },
4375
+ {
4376
+ "name": "event_program",
4377
+ "optional": true,
4378
+ "address": "gstgm1M39mhgnvgyScGUDRwNn5kNVSd97hTtyow1Et5"
4379
+ }
4380
+ ],
4381
+ "args": []
4382
+ },
4150
4383
  {
4151
4384
  "name": "price_single_asset_vault",
4152
4385
  "docs": [
@@ -232,116 +232,6 @@ export type ExtNeutral = {
232
232
  ];
233
233
  "args": [];
234
234
  },
235
- {
236
- "name": "initializePermissionedBundleDepositor";
237
- "docs": [
238
- "Initialize a permissioned Neutral user bundle account for the GLAM vault.",
239
- "",
240
- "- Permission: `InitializePermissionedBundleDepositor`.",
241
- "- Policy: `bundle_account` must be present in `NeutralPolicy::bundles_allowlist`."
242
- ];
243
- "discriminator": [
244
- 157,
245
- 162,
246
- 213,
247
- 42,
248
- 205,
249
- 201,
250
- 37,
251
- 255
252
- ];
253
- "accounts": [
254
- {
255
- "name": "glamState";
256
- "writable": true;
257
- },
258
- {
259
- "name": "glamVault";
260
- "writable": true;
261
- "pda": {
262
- "seeds": [
263
- {
264
- "kind": "const";
265
- "value": [
266
- 118,
267
- 97,
268
- 117,
269
- 108,
270
- 116
271
- ];
272
- },
273
- {
274
- "kind": "account";
275
- "path": "glamState";
276
- }
277
- ];
278
- "program": {
279
- "kind": "account";
280
- "path": "glamProtocolProgram";
281
- };
282
- };
283
- },
284
- {
285
- "name": "glamSigner";
286
- "writable": true;
287
- "signer": true;
288
- },
289
- {
290
- "name": "integrationAuthority";
291
- "pda": {
292
- "seeds": [
293
- {
294
- "kind": "const";
295
- "value": [
296
- 105,
297
- 110,
298
- 116,
299
- 101,
300
- 103,
301
- 114,
302
- 97,
303
- 116,
304
- 105,
305
- 111,
306
- 110,
307
- 45,
308
- 97,
309
- 117,
310
- 116,
311
- 104,
312
- 111,
313
- 114,
314
- 105,
315
- 116,
316
- 121
317
- ];
318
- }
319
- ];
320
- };
321
- },
322
- {
323
- "name": "cpiProgram";
324
- "address": "BUNDDh4P5XviMm1f3gCvnq2qKx6TGosAGnoUK12e7cXU";
325
- },
326
- {
327
- "name": "glamProtocolProgram";
328
- "address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz";
329
- },
330
- {
331
- "name": "systemProgram";
332
- "address": "11111111111111111111111111111111";
333
- },
334
- {
335
- "name": "bundleAccount";
336
- "writable": true;
337
- },
338
- {
339
- "name": "userBundleAccount";
340
- "writable": true;
341
- }
342
- ];
343
- "args": [];
344
- },
345
235
  {
346
236
  "name": "requestDeposit";
347
237
  "docs": [
@@ -479,7 +369,6 @@ export type ExtNeutral = {
479
369
  },
480
370
  {
481
371
  "name": "tokenProgram";
482
- "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
483
372
  }
484
373
  ];
485
374
  "args": [
@@ -1760,27 +1649,22 @@ export type ExtNeutral = {
1760
1649
  {
1761
1650
  "name": "protoNeutralPermCloseUserBundleAccount";
1762
1651
  "type": "u64";
1763
- "value": "16";
1652
+ "value": "8";
1764
1653
  },
1765
1654
  {
1766
1655
  "name": "protoNeutralPermInitializeBundleDepositor";
1767
1656
  "type": "u64";
1768
1657
  "value": "1";
1769
1658
  },
1770
- {
1771
- "name": "protoNeutralPermInitializePermissionedBundleDepositor";
1772
- "type": "u64";
1773
- "value": "2";
1774
- },
1775
1659
  {
1776
1660
  "name": "protoNeutralPermRequestDeposit";
1777
1661
  "type": "u64";
1778
- "value": "4";
1662
+ "value": "2";
1779
1663
  },
1780
1664
  {
1781
1665
  "name": "protoNeutralPermRequestWithdrawal";
1782
1666
  "type": "u64";
1783
- "value": "8";
1667
+ "value": "4";
1784
1668
  }
1785
1669
  ];
1786
1670
  };
@@ -4153,6 +4153,239 @@ export type GlamMint = {
4153
4153
  ],
4154
4154
  "args": []
4155
4155
  },
4156
+ {
4157
+ "name": "priceNeutralBundleDepositors",
4158
+ "docs": [
4159
+ "Price neutral bundle depositors",
4160
+ "",
4161
+ "Remaining accounts:",
4162
+ "- 4 * N neutral bundle depositor account tuples:",
4163
+ "1. User bundle account",
4164
+ "2. Bundle account",
4165
+ "3. Bundle oracle data account",
4166
+ "4. Bundle asset oracle account"
4167
+ ],
4168
+ "discriminator": [
4169
+ 202,
4170
+ 93,
4171
+ 205,
4172
+ 29,
4173
+ 37,
4174
+ 180,
4175
+ 127,
4176
+ 102
4177
+ ],
4178
+ "accounts": [
4179
+ {
4180
+ "name": "glamState",
4181
+ "writable": true
4182
+ },
4183
+ {
4184
+ "name": "glamVault",
4185
+ "pda": {
4186
+ "seeds": [
4187
+ {
4188
+ "kind": "const",
4189
+ "value": [
4190
+ 118,
4191
+ 97,
4192
+ 117,
4193
+ 108,
4194
+ 116
4195
+ ]
4196
+ },
4197
+ {
4198
+ "kind": "account",
4199
+ "path": "glamState"
4200
+ }
4201
+ ],
4202
+ "program": {
4203
+ "kind": "const",
4204
+ "value": [
4205
+ 10,
4206
+ 55,
4207
+ 49,
4208
+ 193,
4209
+ 142,
4210
+ 247,
4211
+ 75,
4212
+ 193,
4213
+ 33,
4214
+ 61,
4215
+ 5,
4216
+ 218,
4217
+ 254,
4218
+ 219,
4219
+ 143,
4220
+ 206,
4221
+ 156,
4222
+ 138,
4223
+ 14,
4224
+ 32,
4225
+ 89,
4226
+ 232,
4227
+ 248,
4228
+ 173,
4229
+ 46,
4230
+ 77,
4231
+ 46,
4232
+ 206,
4233
+ 189,
4234
+ 171,
4235
+ 68,
4236
+ 237
4237
+ ]
4238
+ }
4239
+ }
4240
+ },
4241
+ {
4242
+ "name": "signer",
4243
+ "writable": true,
4244
+ "signer": true
4245
+ },
4246
+ {
4247
+ "name": "solUsdOracle"
4248
+ },
4249
+ {
4250
+ "name": "baseAssetOracle"
4251
+ },
4252
+ {
4253
+ "name": "integrationAuthority",
4254
+ "pda": {
4255
+ "seeds": [
4256
+ {
4257
+ "kind": "const",
4258
+ "value": [
4259
+ 105,
4260
+ 110,
4261
+ 116,
4262
+ 101,
4263
+ 103,
4264
+ 114,
4265
+ 97,
4266
+ 116,
4267
+ 105,
4268
+ 111,
4269
+ 110,
4270
+ 45,
4271
+ 97,
4272
+ 117,
4273
+ 116,
4274
+ 104,
4275
+ 111,
4276
+ 114,
4277
+ 105,
4278
+ 116,
4279
+ 121
4280
+ ]
4281
+ }
4282
+ ]
4283
+ }
4284
+ },
4285
+ {
4286
+ "name": "glamConfig",
4287
+ "pda": {
4288
+ "seeds": [
4289
+ {
4290
+ "kind": "const",
4291
+ "value": [
4292
+ 103,
4293
+ 108,
4294
+ 111,
4295
+ 98,
4296
+ 97,
4297
+ 108,
4298
+ 45,
4299
+ 99,
4300
+ 111,
4301
+ 110,
4302
+ 102,
4303
+ 105,
4304
+ 103
4305
+ ]
4306
+ }
4307
+ ],
4308
+ "program": {
4309
+ "kind": "const",
4310
+ "value": [
4311
+ 10,
4312
+ 11,
4313
+ 0,
4314
+ 83,
4315
+ 72,
4316
+ 16,
4317
+ 46,
4318
+ 144,
4319
+ 46,
4320
+ 42,
4321
+ 79,
4322
+ 22,
4323
+ 157,
4324
+ 123,
4325
+ 21,
4326
+ 242,
4327
+ 192,
4328
+ 146,
4329
+ 1,
4330
+ 78,
4331
+ 88,
4332
+ 59,
4333
+ 102,
4334
+ 9,
4335
+ 190,
4336
+ 226,
4337
+ 92,
4338
+ 189,
4339
+ 187,
4340
+ 232,
4341
+ 83,
4342
+ 220
4343
+ ]
4344
+ }
4345
+ }
4346
+ },
4347
+ {
4348
+ "name": "glamProtocol",
4349
+ "address": "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"
4350
+ },
4351
+ {
4352
+ "name": "eventAuthority",
4353
+ "optional": true,
4354
+ "pda": {
4355
+ "seeds": [
4356
+ {
4357
+ "kind": "const",
4358
+ "value": [
4359
+ 95,
4360
+ 95,
4361
+ 101,
4362
+ 118,
4363
+ 101,
4364
+ 110,
4365
+ 116,
4366
+ 95,
4367
+ 97,
4368
+ 117,
4369
+ 116,
4370
+ 104,
4371
+ 111,
4372
+ 114,
4373
+ 105,
4374
+ 116,
4375
+ 121
4376
+ ]
4377
+ }
4378
+ ]
4379
+ }
4380
+ },
4381
+ {
4382
+ "name": "eventProgram",
4383
+ "optional": true,
4384
+ "address": "gstgm1M39mhgnvgyScGUDRwNn5kNVSd97hTtyow1Et5"
4385
+ }
4386
+ ],
4387
+ "args": []
4388
+ },
4156
4389
  {
4157
4390
  "name": "priceSingleAssetVault",
4158
4391
  "docs": [