@glamsystems/glam-sdk 1.0.8 → 1.0.9

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
@@ -3108,16 +3108,19 @@ var instructions$e = [
3108
3108
  args: []
3109
3109
  },
3110
3110
  {
3111
- name: "delete_asset_meta",
3111
+ name: "deprecate_asset_meta",
3112
+ docs: [
3113
+ "Marks an asset meta as deprecated"
3114
+ ],
3112
3115
  discriminator: [
3113
- 108,
3114
- 173,
3115
- 149,
3116
- 99,
3117
- 144,
3118
- 203,
3116
+ 138,
3117
+ 242,
3118
+ 230,
3119
+ 22,
3119
3120
  21,
3120
- 115
3121
+ 151,
3122
+ 149,
3123
+ 19
3121
3124
  ],
3122
3125
  accounts: [
3123
3126
  {
@@ -3445,6 +3448,12 @@ var instructions$e = [
3445
3448
  writable: true,
3446
3449
  signer: true
3447
3450
  },
3451
+ {
3452
+ name: "asset"
3453
+ },
3454
+ {
3455
+ name: "oracle"
3456
+ },
3448
3457
  {
3449
3458
  name: "system_program",
3450
3459
  address: "11111111111111111111111111111111"
@@ -3536,7 +3545,7 @@ var types$e = [
3536
3545
  },
3537
3546
  {
3538
3547
  name: "priority",
3539
- type: "u8"
3548
+ type: "i8"
3540
3549
  },
3541
3550
  {
3542
3551
  name: "padding",
@@ -49038,12 +49047,13 @@ const USDC_ORACLE = ASSETS_MAINNET.get("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyT
49038
49047
  * @param cluster The cluster network (defaults to mainnet)
49039
49048
  * @returns Metadata of the asset
49040
49049
  */ function getAssetMeta(assetMint, cluster = exports.ClusterNetwork.Mainnet) {
49041
- let assetMeta = ASSETS_MAINNET.get(assetMint);
49050
+ const mint = assetMint instanceof web3_js.PublicKey ? assetMint.toBase58() : assetMint;
49051
+ let assetMeta = ASSETS_MAINNET.get(mint);
49042
49052
  if (!assetMeta && cluster !== exports.ClusterNetwork.Mainnet) {
49043
- assetMeta = ASSETS_TESTS.get(assetMint);
49053
+ assetMeta = ASSETS_TESTS.get(mint);
49044
49054
  }
49045
49055
  if (!assetMeta) {
49046
- throw new Error("Invalid asset: " + assetMint);
49056
+ throw new Error("Asset not supported: " + assetMint);
49047
49057
  }
49048
49058
  return assetMeta;
49049
49059
  }
package/index.esm.js CHANGED
@@ -3088,16 +3088,19 @@ var instructions$e = [
3088
3088
  args: []
3089
3089
  },
3090
3090
  {
3091
- name: "delete_asset_meta",
3091
+ name: "deprecate_asset_meta",
3092
+ docs: [
3093
+ "Marks an asset meta as deprecated"
3094
+ ],
3092
3095
  discriminator: [
3093
- 108,
3094
- 173,
3095
- 149,
3096
- 99,
3097
- 144,
3098
- 203,
3096
+ 138,
3097
+ 242,
3098
+ 230,
3099
+ 22,
3099
3100
  21,
3100
- 115
3101
+ 151,
3102
+ 149,
3103
+ 19
3101
3104
  ],
3102
3105
  accounts: [
3103
3106
  {
@@ -3425,6 +3428,12 @@ var instructions$e = [
3425
3428
  writable: true,
3426
3429
  signer: true
3427
3430
  },
3431
+ {
3432
+ name: "asset"
3433
+ },
3434
+ {
3435
+ name: "oracle"
3436
+ },
3428
3437
  {
3429
3438
  name: "system_program",
3430
3439
  address: "11111111111111111111111111111111"
@@ -3516,7 +3525,7 @@ var types$e = [
3516
3525
  },
3517
3526
  {
3518
3527
  name: "priority",
3519
- type: "u8"
3528
+ type: "i8"
3520
3529
  },
3521
3530
  {
3522
3531
  name: "padding",
@@ -49018,12 +49027,13 @@ const USDC_ORACLE = ASSETS_MAINNET.get("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyT
49018
49027
  * @param cluster The cluster network (defaults to mainnet)
49019
49028
  * @returns Metadata of the asset
49020
49029
  */ function getAssetMeta(assetMint, cluster = ClusterNetwork.Mainnet) {
49021
- let assetMeta = ASSETS_MAINNET.get(assetMint);
49030
+ const mint = assetMint instanceof PublicKey ? assetMint.toBase58() : assetMint;
49031
+ let assetMeta = ASSETS_MAINNET.get(mint);
49022
49032
  if (!assetMeta && cluster !== ClusterNetwork.Mainnet) {
49023
- assetMeta = ASSETS_TESTS.get(assetMint);
49033
+ assetMeta = ASSETS_TESTS.get(mint);
49024
49034
  }
49025
49035
  if (!assetMeta) {
49026
- throw new Error("Invalid asset: " + assetMint);
49036
+ throw new Error("Asset not supported: " + assetMint);
49027
49037
  }
49028
49038
  return assetMeta;
49029
49039
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glamsystems/glam-sdk",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "TypeScript SDK for the GLAM Protocol",
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js",
package/src/assets.d.ts CHANGED
@@ -43,4 +43,4 @@ export declare const USDC_ORACLE: PublicKey;
43
43
  * @param cluster The cluster network (defaults to mainnet)
44
44
  * @returns Metadata of the asset
45
45
  */
46
- export declare function getAssetMeta(assetMint: string, cluster?: ClusterNetwork): AssetMeta;
46
+ export declare function getAssetMeta(assetMint: string | PublicKey, cluster?: ClusterNetwork): AssetMeta;
@@ -37,16 +37,19 @@
37
37
  "args": []
38
38
  },
39
39
  {
40
- "name": "delete_asset_meta",
40
+ "name": "deprecate_asset_meta",
41
+ "docs": [
42
+ "Marks an asset meta as deprecated"
43
+ ],
41
44
  "discriminator": [
42
- 108,
43
- 173,
44
- 149,
45
- 99,
46
- 144,
47
- 203,
45
+ 138,
46
+ 242,
47
+ 230,
48
+ 22,
48
49
  21,
49
- 115
50
+ 151,
51
+ 149,
52
+ 19
50
53
  ],
51
54
  "accounts": [
52
55
  {
@@ -374,6 +377,12 @@
374
377
  "writable": true,
375
378
  "signer": true
376
379
  },
380
+ {
381
+ "name": "asset"
382
+ },
383
+ {
384
+ "name": "oracle"
385
+ },
377
386
  {
378
387
  "name": "system_program",
379
388
  "address": "11111111111111111111111111111111"
@@ -465,7 +474,7 @@
465
474
  },
466
475
  {
467
476
  "name": "priority",
468
- "type": "u8"
477
+ "type": "i8"
469
478
  },
470
479
  {
471
480
  "name": "padding",
@@ -43,16 +43,19 @@ export type GlamConfig = {
43
43
  "args": [];
44
44
  },
45
45
  {
46
- "name": "deleteAssetMeta";
46
+ "name": "deprecateAssetMeta";
47
+ "docs": [
48
+ "Marks an asset meta as deprecated"
49
+ ];
47
50
  "discriminator": [
48
- 108,
49
- 173,
50
- 149,
51
- 99,
52
- 144,
53
- 203,
51
+ 138,
52
+ 242,
53
+ 230,
54
+ 22,
54
55
  21,
55
- 115
56
+ 151,
57
+ 149,
58
+ 19
56
59
  ];
57
60
  "accounts": [
58
61
  {
@@ -380,6 +383,12 @@ export type GlamConfig = {
380
383
  "writable": true;
381
384
  "signer": true;
382
385
  },
386
+ {
387
+ "name": "asset";
388
+ },
389
+ {
390
+ "name": "oracle";
391
+ },
383
392
  {
384
393
  "name": "systemProgram";
385
394
  "address": "11111111111111111111111111111111";
@@ -471,7 +480,7 @@ export type GlamConfig = {
471
480
  },
472
481
  {
473
482
  "name": "priority";
474
- "type": "u8";
483
+ "type": "i8";
475
484
  },
476
485
  {
477
486
  "name": "padding";
@@ -43,16 +43,19 @@ export type GlamConfig = {
43
43
  "args": []
44
44
  },
45
45
  {
46
- "name": "deleteAssetMeta",
46
+ "name": "deprecateAssetMeta",
47
+ "docs": [
48
+ "Marks an asset meta as deprecated"
49
+ ],
47
50
  "discriminator": [
48
- 108,
49
- 173,
50
- 149,
51
- 99,
52
- 144,
53
- 203,
51
+ 138,
52
+ 242,
53
+ 230,
54
+ 22,
54
55
  21,
55
- 115
56
+ 151,
57
+ 149,
58
+ 19
56
59
  ],
57
60
  "accounts": [
58
61
  {
@@ -380,6 +383,12 @@ export type GlamConfig = {
380
383
  "writable": true,
381
384
  "signer": true
382
385
  },
386
+ {
387
+ "name": "asset"
388
+ },
389
+ {
390
+ "name": "oracle"
391
+ },
383
392
  {
384
393
  "name": "systemProgram",
385
394
  "address": "11111111111111111111111111111111"
@@ -471,7 +480,7 @@ export type GlamConfig = {
471
480
  },
472
481
  {
473
482
  "name": "priority",
474
- "type": "u8"
483
+ "type": "i8"
475
484
  },
476
485
  {
477
486
  "name": "padding",