@glamsystems/glam-sdk 1.0.8 → 1.0.10
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 +519 -36
- package/index.esm.js +519 -36
- package/package.json +1 -1
- package/src/assets.d.ts +1 -1
- package/src/client/cctp.d.ts +6 -6
- package/src/glamExports.d.ts +1 -5
- package/src/models/state.d.ts +5 -0
- package/src/react/glam.d.ts +1 -1
- package/target/idl/ext_cctp.json +3 -0
- package/target/idl/ext_drift-staging.json +3 -0
- package/target/idl/ext_drift.json +3 -0
- package/target/idl/ext_kamino-staging.json +3 -0
- package/target/idl/ext_kamino.json +3 -0
- package/target/idl/ext_marinade.json +3 -0
- package/target/idl/ext_spl-staging.json +3 -0
- package/target/idl/ext_spl.json +3 -0
- package/target/idl/ext_stake_pool-staging.json +3 -0
- package/target/idl/ext_stake_pool.json +3 -0
- package/target/idl/glam_config.json +81 -9
- package/target/idl/glam_mint-staging.json +178 -2
- package/target/idl/glam_mint.json +178 -2
- package/target/idl/glam_protocol-staging.json +4 -1
- package/target/idl/glam_protocol.json +4 -1
- package/target/types/ext_cctp.d.ts +3 -0
- package/target/types/ext_cctp.ts +3 -0
- package/target/types/ext_drift-staging.ts +3 -0
- package/target/types/ext_drift.d.ts +3 -0
- package/target/types/ext_drift.ts +3 -0
- package/target/types/ext_kamino-staging.ts +3 -0
- package/target/types/ext_kamino.d.ts +3 -0
- package/target/types/ext_kamino.ts +3 -0
- package/target/types/ext_marinade.d.ts +3 -0
- package/target/types/ext_marinade.ts +3 -0
- package/target/types/ext_spl-staging.ts +3 -0
- package/target/types/ext_spl.d.ts +3 -0
- package/target/types/ext_spl.ts +3 -0
- package/target/types/ext_stake_pool-staging.ts +3 -0
- package/target/types/ext_stake_pool.d.ts +3 -0
- package/target/types/ext_stake_pool.ts +3 -0
- package/target/types/glam_config.d.ts +81 -9
- package/target/types/glam_config.ts +81 -9
- package/target/types/glam_mint-staging.ts +178 -2
- package/target/types/glam_mint.d.ts +178 -2
- package/target/types/glam_mint.ts +178 -2
- package/target/types/glam_protocol-staging.ts +4 -1
- package/target/types/glam_protocol.d.ts +4 -1
- package/target/types/glam_protocol.ts +4 -1
package/index.cjs.js
CHANGED
|
@@ -36,7 +36,7 @@ var borsh__namespace = /*#__PURE__*/_interopNamespaceDefault(borsh);
|
|
|
36
36
|
var address$f = "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz";
|
|
37
37
|
var metadata$f = {
|
|
38
38
|
name: "glam_protocol",
|
|
39
|
-
version: "1.0.
|
|
39
|
+
version: "1.0.3",
|
|
40
40
|
spec: "0.1.0",
|
|
41
41
|
description: "Glam Protocol"
|
|
42
42
|
};
|
|
@@ -1807,6 +1807,9 @@ var types$f = [
|
|
|
1807
1807
|
},
|
|
1808
1808
|
{
|
|
1809
1809
|
name: "Mint"
|
|
1810
|
+
},
|
|
1811
|
+
{
|
|
1812
|
+
name: "SingleAssetVault"
|
|
1810
1813
|
}
|
|
1811
1814
|
]
|
|
1812
1815
|
}
|
|
@@ -3108,16 +3111,19 @@ var instructions$e = [
|
|
|
3108
3111
|
args: []
|
|
3109
3112
|
},
|
|
3110
3113
|
{
|
|
3111
|
-
name: "
|
|
3114
|
+
name: "deprecate_asset_meta",
|
|
3115
|
+
docs: [
|
|
3116
|
+
"Marks an asset meta as deprecated"
|
|
3117
|
+
],
|
|
3112
3118
|
discriminator: [
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
144,
|
|
3118
|
-
203,
|
|
3119
|
+
138,
|
|
3120
|
+
242,
|
|
3121
|
+
230,
|
|
3122
|
+
22,
|
|
3119
3123
|
21,
|
|
3120
|
-
|
|
3124
|
+
151,
|
|
3125
|
+
149,
|
|
3126
|
+
19
|
|
3121
3127
|
],
|
|
3122
3128
|
accounts: [
|
|
3123
3129
|
{
|
|
@@ -3295,6 +3301,57 @@ var instructions$e = [
|
|
|
3295
3301
|
}
|
|
3296
3302
|
]
|
|
3297
3303
|
},
|
|
3304
|
+
{
|
|
3305
|
+
name: "update_fee_authority",
|
|
3306
|
+
discriminator: [
|
|
3307
|
+
31,
|
|
3308
|
+
223,
|
|
3309
|
+
200,
|
|
3310
|
+
21,
|
|
3311
|
+
114,
|
|
3312
|
+
158,
|
|
3313
|
+
65,
|
|
3314
|
+
61
|
|
3315
|
+
],
|
|
3316
|
+
accounts: [
|
|
3317
|
+
{
|
|
3318
|
+
name: "global_config",
|
|
3319
|
+
writable: true,
|
|
3320
|
+
pda: {
|
|
3321
|
+
seeds: [
|
|
3322
|
+
{
|
|
3323
|
+
kind: "const",
|
|
3324
|
+
value: [
|
|
3325
|
+
103,
|
|
3326
|
+
108,
|
|
3327
|
+
111,
|
|
3328
|
+
98,
|
|
3329
|
+
97,
|
|
3330
|
+
108,
|
|
3331
|
+
45,
|
|
3332
|
+
99,
|
|
3333
|
+
111,
|
|
3334
|
+
110,
|
|
3335
|
+
102,
|
|
3336
|
+
105,
|
|
3337
|
+
103
|
|
3338
|
+
]
|
|
3339
|
+
}
|
|
3340
|
+
]
|
|
3341
|
+
}
|
|
3342
|
+
},
|
|
3343
|
+
{
|
|
3344
|
+
name: "fee_authority",
|
|
3345
|
+
signer: true
|
|
3346
|
+
}
|
|
3347
|
+
],
|
|
3348
|
+
args: [
|
|
3349
|
+
{
|
|
3350
|
+
name: "fee_authority",
|
|
3351
|
+
type: "pubkey"
|
|
3352
|
+
}
|
|
3353
|
+
]
|
|
3354
|
+
},
|
|
3298
3355
|
{
|
|
3299
3356
|
name: "update_protocol_fees",
|
|
3300
3357
|
discriminator: [
|
|
@@ -3445,6 +3502,12 @@ var instructions$e = [
|
|
|
3445
3502
|
writable: true,
|
|
3446
3503
|
signer: true
|
|
3447
3504
|
},
|
|
3505
|
+
{
|
|
3506
|
+
name: "asset"
|
|
3507
|
+
},
|
|
3508
|
+
{
|
|
3509
|
+
name: "oracle"
|
|
3510
|
+
},
|
|
3448
3511
|
{
|
|
3449
3512
|
name: "system_program",
|
|
3450
3513
|
address: "11111111111111111111111111111111"
|
|
@@ -3536,7 +3599,7 @@ var types$e = [
|
|
|
3536
3599
|
},
|
|
3537
3600
|
{
|
|
3538
3601
|
name: "priority",
|
|
3539
|
-
type: "
|
|
3602
|
+
type: "i8"
|
|
3540
3603
|
},
|
|
3541
3604
|
{
|
|
3542
3605
|
name: "padding",
|
|
@@ -3571,18 +3634,30 @@ var types$e = [
|
|
|
3571
3634
|
},
|
|
3572
3635
|
{
|
|
3573
3636
|
name: "referrer",
|
|
3637
|
+
docs: [
|
|
3638
|
+
"Default GLAM referrer"
|
|
3639
|
+
],
|
|
3574
3640
|
type: "pubkey"
|
|
3575
3641
|
},
|
|
3576
3642
|
{
|
|
3577
3643
|
name: "base_fee_bps",
|
|
3644
|
+
docs: [
|
|
3645
|
+
"Default protocol base fee applied to all vaults"
|
|
3646
|
+
],
|
|
3578
3647
|
type: "u16"
|
|
3579
3648
|
},
|
|
3580
3649
|
{
|
|
3581
3650
|
name: "flow_fee_bps",
|
|
3651
|
+
docs: [
|
|
3652
|
+
"Default protocol flow fee applied to all vaults"
|
|
3653
|
+
],
|
|
3582
3654
|
type: "u16"
|
|
3583
3655
|
},
|
|
3584
3656
|
{
|
|
3585
3657
|
name: "asset_metas",
|
|
3658
|
+
docs: [
|
|
3659
|
+
"List of assets and their oracle configs supported by the protocol"
|
|
3660
|
+
],
|
|
3586
3661
|
type: {
|
|
3587
3662
|
vec: {
|
|
3588
3663
|
defined: {
|
|
@@ -3678,7 +3753,7 @@ var GlamConfigIdlJson = {
|
|
|
3678
3753
|
var address$d = "GM1NtvvnSXUptTrMCqbogAdZJydZSNv98DoU5AZVLmGh";
|
|
3679
3754
|
var metadata$d = {
|
|
3680
3755
|
name: "glam_mint",
|
|
3681
|
-
version: "1.0.
|
|
3756
|
+
version: "1.0.2",
|
|
3682
3757
|
spec: "0.1.0",
|
|
3683
3758
|
description: "GLAM mint program"
|
|
3684
3759
|
};
|
|
@@ -6494,6 +6569,167 @@ var instructions$d = [
|
|
|
6494
6569
|
}
|
|
6495
6570
|
]
|
|
6496
6571
|
},
|
|
6572
|
+
{
|
|
6573
|
+
name: "price_single_asset_vault",
|
|
6574
|
+
docs: [
|
|
6575
|
+
"Prices a single asset vault."
|
|
6576
|
+
],
|
|
6577
|
+
discriminator: [
|
|
6578
|
+
93,
|
|
6579
|
+
213,
|
|
6580
|
+
219,
|
|
6581
|
+
25,
|
|
6582
|
+
38,
|
|
6583
|
+
74,
|
|
6584
|
+
9,
|
|
6585
|
+
167
|
|
6586
|
+
],
|
|
6587
|
+
accounts: [
|
|
6588
|
+
{
|
|
6589
|
+
name: "glam_state",
|
|
6590
|
+
writable: true
|
|
6591
|
+
},
|
|
6592
|
+
{
|
|
6593
|
+
name: "glam_vault",
|
|
6594
|
+
pda: {
|
|
6595
|
+
seeds: [
|
|
6596
|
+
{
|
|
6597
|
+
kind: "const",
|
|
6598
|
+
value: [
|
|
6599
|
+
118,
|
|
6600
|
+
97,
|
|
6601
|
+
117,
|
|
6602
|
+
108,
|
|
6603
|
+
116
|
|
6604
|
+
]
|
|
6605
|
+
},
|
|
6606
|
+
{
|
|
6607
|
+
kind: "account",
|
|
6608
|
+
path: "glam_state"
|
|
6609
|
+
}
|
|
6610
|
+
],
|
|
6611
|
+
program: {
|
|
6612
|
+
kind: "const",
|
|
6613
|
+
value: [
|
|
6614
|
+
227,
|
|
6615
|
+
199,
|
|
6616
|
+
235,
|
|
6617
|
+
230,
|
|
6618
|
+
176,
|
|
6619
|
+
132,
|
|
6620
|
+
243,
|
|
6621
|
+
117,
|
|
6622
|
+
43,
|
|
6623
|
+
131,
|
|
6624
|
+
173,
|
|
6625
|
+
18,
|
|
6626
|
+
78,
|
|
6627
|
+
255,
|
|
6628
|
+
26,
|
|
6629
|
+
50,
|
|
6630
|
+
209,
|
|
6631
|
+
135,
|
|
6632
|
+
86,
|
|
6633
|
+
219,
|
|
6634
|
+
140,
|
|
6635
|
+
126,
|
|
6636
|
+
61,
|
|
6637
|
+
255,
|
|
6638
|
+
0,
|
|
6639
|
+
218,
|
|
6640
|
+
252,
|
|
6641
|
+
224,
|
|
6642
|
+
172,
|
|
6643
|
+
8,
|
|
6644
|
+
223,
|
|
6645
|
+
207
|
|
6646
|
+
]
|
|
6647
|
+
}
|
|
6648
|
+
}
|
|
6649
|
+
},
|
|
6650
|
+
{
|
|
6651
|
+
name: "signer",
|
|
6652
|
+
writable: true,
|
|
6653
|
+
signer: true
|
|
6654
|
+
},
|
|
6655
|
+
{
|
|
6656
|
+
name: "base_asset_ata"
|
|
6657
|
+
},
|
|
6658
|
+
{
|
|
6659
|
+
name: "integration_authority",
|
|
6660
|
+
pda: {
|
|
6661
|
+
seeds: [
|
|
6662
|
+
{
|
|
6663
|
+
kind: "const",
|
|
6664
|
+
value: [
|
|
6665
|
+
105,
|
|
6666
|
+
110,
|
|
6667
|
+
116,
|
|
6668
|
+
101,
|
|
6669
|
+
103,
|
|
6670
|
+
114,
|
|
6671
|
+
97,
|
|
6672
|
+
116,
|
|
6673
|
+
105,
|
|
6674
|
+
111,
|
|
6675
|
+
110,
|
|
6676
|
+
45,
|
|
6677
|
+
97,
|
|
6678
|
+
117,
|
|
6679
|
+
116,
|
|
6680
|
+
104,
|
|
6681
|
+
111,
|
|
6682
|
+
114,
|
|
6683
|
+
105,
|
|
6684
|
+
116,
|
|
6685
|
+
121
|
|
6686
|
+
]
|
|
6687
|
+
}
|
|
6688
|
+
]
|
|
6689
|
+
}
|
|
6690
|
+
},
|
|
6691
|
+
{
|
|
6692
|
+
name: "glam_protocol",
|
|
6693
|
+
address: "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
|
|
6694
|
+
},
|
|
6695
|
+
{
|
|
6696
|
+
name: "event_authority",
|
|
6697
|
+
optional: true,
|
|
6698
|
+
pda: {
|
|
6699
|
+
seeds: [
|
|
6700
|
+
{
|
|
6701
|
+
kind: "const",
|
|
6702
|
+
value: [
|
|
6703
|
+
95,
|
|
6704
|
+
95,
|
|
6705
|
+
101,
|
|
6706
|
+
118,
|
|
6707
|
+
101,
|
|
6708
|
+
110,
|
|
6709
|
+
116,
|
|
6710
|
+
95,
|
|
6711
|
+
97,
|
|
6712
|
+
117,
|
|
6713
|
+
116,
|
|
6714
|
+
104,
|
|
6715
|
+
111,
|
|
6716
|
+
114,
|
|
6717
|
+
105,
|
|
6718
|
+
116,
|
|
6719
|
+
121
|
|
6720
|
+
]
|
|
6721
|
+
}
|
|
6722
|
+
]
|
|
6723
|
+
}
|
|
6724
|
+
},
|
|
6725
|
+
{
|
|
6726
|
+
name: "event_program",
|
|
6727
|
+
optional: true,
|
|
6728
|
+
address: "GM1NtvvnSXUptTrMCqbogAdZJydZSNv98DoU5AZVLmGh"
|
|
6729
|
+
}
|
|
6730
|
+
],
|
|
6731
|
+
args: []
|
|
6732
|
+
},
|
|
6497
6733
|
{
|
|
6498
6734
|
name: "price_stake_accounts",
|
|
6499
6735
|
discriminator: [
|
|
@@ -8306,6 +8542,9 @@ var types$d = [
|
|
|
8306
8542
|
},
|
|
8307
8543
|
{
|
|
8308
8544
|
name: "Mint"
|
|
8545
|
+
},
|
|
8546
|
+
{
|
|
8547
|
+
name: "SingleAssetVault"
|
|
8309
8548
|
}
|
|
8310
8549
|
]
|
|
8311
8550
|
}
|
|
@@ -8381,7 +8620,7 @@ var types$d = [
|
|
|
8381
8620
|
},
|
|
8382
8621
|
{
|
|
8383
8622
|
name: "priority",
|
|
8384
|
-
type: "
|
|
8623
|
+
type: "i8"
|
|
8385
8624
|
},
|
|
8386
8625
|
{
|
|
8387
8626
|
name: "padding",
|
|
@@ -8876,18 +9115,30 @@ var types$d = [
|
|
|
8876
9115
|
},
|
|
8877
9116
|
{
|
|
8878
9117
|
name: "referrer",
|
|
9118
|
+
docs: [
|
|
9119
|
+
"Default GLAM referrer"
|
|
9120
|
+
],
|
|
8879
9121
|
type: "pubkey"
|
|
8880
9122
|
},
|
|
8881
9123
|
{
|
|
8882
9124
|
name: "base_fee_bps",
|
|
9125
|
+
docs: [
|
|
9126
|
+
"Default protocol base fee applied to all vaults"
|
|
9127
|
+
],
|
|
8883
9128
|
type: "u16"
|
|
8884
9129
|
},
|
|
8885
9130
|
{
|
|
8886
9131
|
name: "flow_fee_bps",
|
|
9132
|
+
docs: [
|
|
9133
|
+
"Default protocol flow fee applied to all vaults"
|
|
9134
|
+
],
|
|
8887
9135
|
type: "u16"
|
|
8888
9136
|
},
|
|
8889
9137
|
{
|
|
8890
9138
|
name: "asset_metas",
|
|
9139
|
+
docs: [
|
|
9140
|
+
"List of assets and their oracle configs supported by the protocol"
|
|
9141
|
+
],
|
|
8891
9142
|
type: {
|
|
8892
9143
|
vec: {
|
|
8893
9144
|
defined: {
|
|
@@ -10066,6 +10317,9 @@ var types$c = [
|
|
|
10066
10317
|
},
|
|
10067
10318
|
{
|
|
10068
10319
|
name: "Mint"
|
|
10320
|
+
},
|
|
10321
|
+
{
|
|
10322
|
+
name: "SingleAssetVault"
|
|
10069
10323
|
}
|
|
10070
10324
|
]
|
|
10071
10325
|
}
|
|
@@ -13640,6 +13894,9 @@ var types$b = [
|
|
|
13640
13894
|
},
|
|
13641
13895
|
{
|
|
13642
13896
|
name: "Mint"
|
|
13897
|
+
},
|
|
13898
|
+
{
|
|
13899
|
+
name: "SingleAssetVault"
|
|
13643
13900
|
}
|
|
13644
13901
|
]
|
|
13645
13902
|
}
|
|
@@ -17098,6 +17355,9 @@ var types$a = [
|
|
|
17098
17355
|
},
|
|
17099
17356
|
{
|
|
17100
17357
|
name: "Mint"
|
|
17358
|
+
},
|
|
17359
|
+
{
|
|
17360
|
+
name: "SingleAssetVault"
|
|
17101
17361
|
}
|
|
17102
17362
|
]
|
|
17103
17363
|
}
|
|
@@ -18795,6 +19055,9 @@ var types$9 = [
|
|
|
18795
19055
|
},
|
|
18796
19056
|
{
|
|
18797
19057
|
name: "Mint"
|
|
19058
|
+
},
|
|
19059
|
+
{
|
|
19060
|
+
name: "SingleAssetVault"
|
|
18798
19061
|
}
|
|
18799
19062
|
]
|
|
18800
19063
|
}
|
|
@@ -20391,6 +20654,9 @@ var types$8 = [
|
|
|
20391
20654
|
},
|
|
20392
20655
|
{
|
|
20393
20656
|
name: "Mint"
|
|
20657
|
+
},
|
|
20658
|
+
{
|
|
20659
|
+
name: "SingleAssetVault"
|
|
20394
20660
|
}
|
|
20395
20661
|
]
|
|
20396
20662
|
}
|
|
@@ -21632,6 +21898,9 @@ var types$7 = [
|
|
|
21632
21898
|
},
|
|
21633
21899
|
{
|
|
21634
21900
|
name: "Mint"
|
|
21901
|
+
},
|
|
21902
|
+
{
|
|
21903
|
+
name: "SingleAssetVault"
|
|
21635
21904
|
}
|
|
21636
21905
|
]
|
|
21637
21906
|
}
|
|
@@ -22675,7 +22944,7 @@ var ExtCctpIdlJson = {
|
|
|
22675
22944
|
var address$6 = "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz";
|
|
22676
22945
|
var metadata$6 = {
|
|
22677
22946
|
name: "glam_protocol",
|
|
22678
|
-
version: "1.0.
|
|
22947
|
+
version: "1.0.3",
|
|
22679
22948
|
spec: "0.1.0",
|
|
22680
22949
|
description: "Glam Protocol"
|
|
22681
22950
|
};
|
|
@@ -24521,6 +24790,9 @@ var types$6 = [
|
|
|
24521
24790
|
},
|
|
24522
24791
|
{
|
|
24523
24792
|
name: "Mint"
|
|
24793
|
+
},
|
|
24794
|
+
{
|
|
24795
|
+
name: "SingleAssetVault"
|
|
24524
24796
|
}
|
|
24525
24797
|
]
|
|
24526
24798
|
}
|
|
@@ -25787,7 +26059,7 @@ var GlamProtocolIdlJsonStaging = {
|
|
|
25787
26059
|
var address$5 = "gstgm1M39mhgnvgyScGUDRwNn5kNVSd97hTtyow1Et5";
|
|
25788
26060
|
var metadata$5 = {
|
|
25789
26061
|
name: "glam_mint",
|
|
25790
|
-
version: "1.0.
|
|
26062
|
+
version: "1.0.2",
|
|
25791
26063
|
spec: "0.1.0",
|
|
25792
26064
|
description: "GLAM mint program"
|
|
25793
26065
|
};
|
|
@@ -28603,6 +28875,167 @@ var instructions$5 = [
|
|
|
28603
28875
|
}
|
|
28604
28876
|
]
|
|
28605
28877
|
},
|
|
28878
|
+
{
|
|
28879
|
+
name: "price_single_asset_vault",
|
|
28880
|
+
docs: [
|
|
28881
|
+
"Prices a single asset vault."
|
|
28882
|
+
],
|
|
28883
|
+
discriminator: [
|
|
28884
|
+
93,
|
|
28885
|
+
213,
|
|
28886
|
+
219,
|
|
28887
|
+
25,
|
|
28888
|
+
38,
|
|
28889
|
+
74,
|
|
28890
|
+
9,
|
|
28891
|
+
167
|
|
28892
|
+
],
|
|
28893
|
+
accounts: [
|
|
28894
|
+
{
|
|
28895
|
+
name: "glam_state",
|
|
28896
|
+
writable: true
|
|
28897
|
+
},
|
|
28898
|
+
{
|
|
28899
|
+
name: "glam_vault",
|
|
28900
|
+
pda: {
|
|
28901
|
+
seeds: [
|
|
28902
|
+
{
|
|
28903
|
+
kind: "const",
|
|
28904
|
+
value: [
|
|
28905
|
+
118,
|
|
28906
|
+
97,
|
|
28907
|
+
117,
|
|
28908
|
+
108,
|
|
28909
|
+
116
|
|
28910
|
+
]
|
|
28911
|
+
},
|
|
28912
|
+
{
|
|
28913
|
+
kind: "account",
|
|
28914
|
+
path: "glam_state"
|
|
28915
|
+
}
|
|
28916
|
+
],
|
|
28917
|
+
program: {
|
|
28918
|
+
kind: "const",
|
|
28919
|
+
value: [
|
|
28920
|
+
10,
|
|
28921
|
+
55,
|
|
28922
|
+
49,
|
|
28923
|
+
193,
|
|
28924
|
+
142,
|
|
28925
|
+
247,
|
|
28926
|
+
75,
|
|
28927
|
+
193,
|
|
28928
|
+
33,
|
|
28929
|
+
61,
|
|
28930
|
+
5,
|
|
28931
|
+
218,
|
|
28932
|
+
254,
|
|
28933
|
+
219,
|
|
28934
|
+
143,
|
|
28935
|
+
206,
|
|
28936
|
+
156,
|
|
28937
|
+
138,
|
|
28938
|
+
14,
|
|
28939
|
+
32,
|
|
28940
|
+
89,
|
|
28941
|
+
232,
|
|
28942
|
+
248,
|
|
28943
|
+
173,
|
|
28944
|
+
46,
|
|
28945
|
+
77,
|
|
28946
|
+
46,
|
|
28947
|
+
206,
|
|
28948
|
+
189,
|
|
28949
|
+
171,
|
|
28950
|
+
68,
|
|
28951
|
+
237
|
|
28952
|
+
]
|
|
28953
|
+
}
|
|
28954
|
+
}
|
|
28955
|
+
},
|
|
28956
|
+
{
|
|
28957
|
+
name: "signer",
|
|
28958
|
+
writable: true,
|
|
28959
|
+
signer: true
|
|
28960
|
+
},
|
|
28961
|
+
{
|
|
28962
|
+
name: "base_asset_ata"
|
|
28963
|
+
},
|
|
28964
|
+
{
|
|
28965
|
+
name: "integration_authority",
|
|
28966
|
+
pda: {
|
|
28967
|
+
seeds: [
|
|
28968
|
+
{
|
|
28969
|
+
kind: "const",
|
|
28970
|
+
value: [
|
|
28971
|
+
105,
|
|
28972
|
+
110,
|
|
28973
|
+
116,
|
|
28974
|
+
101,
|
|
28975
|
+
103,
|
|
28976
|
+
114,
|
|
28977
|
+
97,
|
|
28978
|
+
116,
|
|
28979
|
+
105,
|
|
28980
|
+
111,
|
|
28981
|
+
110,
|
|
28982
|
+
45,
|
|
28983
|
+
97,
|
|
28984
|
+
117,
|
|
28985
|
+
116,
|
|
28986
|
+
104,
|
|
28987
|
+
111,
|
|
28988
|
+
114,
|
|
28989
|
+
105,
|
|
28990
|
+
116,
|
|
28991
|
+
121
|
|
28992
|
+
]
|
|
28993
|
+
}
|
|
28994
|
+
]
|
|
28995
|
+
}
|
|
28996
|
+
},
|
|
28997
|
+
{
|
|
28998
|
+
name: "glam_protocol",
|
|
28999
|
+
address: "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"
|
|
29000
|
+
},
|
|
29001
|
+
{
|
|
29002
|
+
name: "event_authority",
|
|
29003
|
+
optional: true,
|
|
29004
|
+
pda: {
|
|
29005
|
+
seeds: [
|
|
29006
|
+
{
|
|
29007
|
+
kind: "const",
|
|
29008
|
+
value: [
|
|
29009
|
+
95,
|
|
29010
|
+
95,
|
|
29011
|
+
101,
|
|
29012
|
+
118,
|
|
29013
|
+
101,
|
|
29014
|
+
110,
|
|
29015
|
+
116,
|
|
29016
|
+
95,
|
|
29017
|
+
97,
|
|
29018
|
+
117,
|
|
29019
|
+
116,
|
|
29020
|
+
104,
|
|
29021
|
+
111,
|
|
29022
|
+
114,
|
|
29023
|
+
105,
|
|
29024
|
+
116,
|
|
29025
|
+
121
|
|
29026
|
+
]
|
|
29027
|
+
}
|
|
29028
|
+
]
|
|
29029
|
+
}
|
|
29030
|
+
},
|
|
29031
|
+
{
|
|
29032
|
+
name: "event_program",
|
|
29033
|
+
optional: true,
|
|
29034
|
+
address: "gstgm1M39mhgnvgyScGUDRwNn5kNVSd97hTtyow1Et5"
|
|
29035
|
+
}
|
|
29036
|
+
],
|
|
29037
|
+
args: []
|
|
29038
|
+
},
|
|
28606
29039
|
{
|
|
28607
29040
|
name: "price_stake_accounts",
|
|
28608
29041
|
discriminator: [
|
|
@@ -30415,6 +30848,9 @@ var types$5 = [
|
|
|
30415
30848
|
},
|
|
30416
30849
|
{
|
|
30417
30850
|
name: "Mint"
|
|
30851
|
+
},
|
|
30852
|
+
{
|
|
30853
|
+
name: "SingleAssetVault"
|
|
30418
30854
|
}
|
|
30419
30855
|
]
|
|
30420
30856
|
}
|
|
@@ -30490,7 +30926,7 @@ var types$5 = [
|
|
|
30490
30926
|
},
|
|
30491
30927
|
{
|
|
30492
30928
|
name: "priority",
|
|
30493
|
-
type: "
|
|
30929
|
+
type: "i8"
|
|
30494
30930
|
},
|
|
30495
30931
|
{
|
|
30496
30932
|
name: "padding",
|
|
@@ -30985,18 +31421,30 @@ var types$5 = [
|
|
|
30985
31421
|
},
|
|
30986
31422
|
{
|
|
30987
31423
|
name: "referrer",
|
|
31424
|
+
docs: [
|
|
31425
|
+
"Default GLAM referrer"
|
|
31426
|
+
],
|
|
30988
31427
|
type: "pubkey"
|
|
30989
31428
|
},
|
|
30990
31429
|
{
|
|
30991
31430
|
name: "base_fee_bps",
|
|
31431
|
+
docs: [
|
|
31432
|
+
"Default protocol base fee applied to all vaults"
|
|
31433
|
+
],
|
|
30992
31434
|
type: "u16"
|
|
30993
31435
|
},
|
|
30994
31436
|
{
|
|
30995
31437
|
name: "flow_fee_bps",
|
|
31438
|
+
docs: [
|
|
31439
|
+
"Default protocol flow fee applied to all vaults"
|
|
31440
|
+
],
|
|
30996
31441
|
type: "u16"
|
|
30997
31442
|
},
|
|
30998
31443
|
{
|
|
30999
31444
|
name: "asset_metas",
|
|
31445
|
+
docs: [
|
|
31446
|
+
"List of assets and their oracle configs supported by the protocol"
|
|
31447
|
+
],
|
|
31000
31448
|
type: {
|
|
31001
31449
|
vec: {
|
|
31002
31450
|
defined: {
|
|
@@ -32175,6 +32623,9 @@ var types$4 = [
|
|
|
32175
32623
|
},
|
|
32176
32624
|
{
|
|
32177
32625
|
name: "Mint"
|
|
32626
|
+
},
|
|
32627
|
+
{
|
|
32628
|
+
name: "SingleAssetVault"
|
|
32178
32629
|
}
|
|
32179
32630
|
]
|
|
32180
32631
|
}
|
|
@@ -35749,6 +36200,9 @@ var types$3 = [
|
|
|
35749
36200
|
},
|
|
35750
36201
|
{
|
|
35751
36202
|
name: "Mint"
|
|
36203
|
+
},
|
|
36204
|
+
{
|
|
36205
|
+
name: "SingleAssetVault"
|
|
35752
36206
|
}
|
|
35753
36207
|
]
|
|
35754
36208
|
}
|
|
@@ -39207,6 +39661,9 @@ var types$2 = [
|
|
|
39207
39661
|
},
|
|
39208
39662
|
{
|
|
39209
39663
|
name: "Mint"
|
|
39664
|
+
},
|
|
39665
|
+
{
|
|
39666
|
+
name: "SingleAssetVault"
|
|
39210
39667
|
}
|
|
39211
39668
|
]
|
|
39212
39669
|
}
|
|
@@ -40903,6 +41360,9 @@ var types$1 = [
|
|
|
40903
41360
|
},
|
|
40904
41361
|
{
|
|
40905
41362
|
name: "Mint"
|
|
41363
|
+
},
|
|
41364
|
+
{
|
|
41365
|
+
name: "SingleAssetVault"
|
|
40906
41366
|
}
|
|
40907
41367
|
]
|
|
40908
41368
|
}
|
|
@@ -45425,13 +45885,12 @@ const JUPITER_SWAP_ERRORS = {
|
|
|
45425
45885
|
*/ function parseProgramLogs(logs) {
|
|
45426
45886
|
// "Error Message:" indicates an anchor program error
|
|
45427
45887
|
// Other messages are manually sourced & handled
|
|
45428
|
-
const errorMsgLog = (logs || []).find((log)=>log.includes("Error Message:") || log.includes("Error: insufficient funds"));
|
|
45888
|
+
const errorMsgLog = (logs || []).find((log)=>log.includes("Error Message:") || log.includes("Error: insufficient funds") || log.includes("Transfer: insufficient lamports"));
|
|
45429
45889
|
if (errorMsgLog) {
|
|
45430
45890
|
if (errorMsgLog.includes("Error Message:")) {
|
|
45431
45891
|
return errorMsgLog.split("Error Message:")[1].trim();
|
|
45432
|
-
} else {
|
|
45433
|
-
return "Insufficient funds";
|
|
45434
45892
|
}
|
|
45893
|
+
return errorMsgLog;
|
|
45435
45894
|
}
|
|
45436
45895
|
// Match the following pattern to find Jupiter error code in logs
|
|
45437
45896
|
// "Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 failed: custom program error: 0x1788"
|
|
@@ -46403,7 +46862,7 @@ class JupiterApiClient {
|
|
|
46403
46862
|
return new Date(createdAt * 1000).toISOString().split("T")[0] || "Unknown";
|
|
46404
46863
|
}
|
|
46405
46864
|
get sparkleKey() {
|
|
46406
|
-
const pubkey = (this.mint
|
|
46865
|
+
const pubkey = (this.mint && !this.mint.equals(web3_js.PublicKey.default) ? this.mint : this.vault) || web3_js.PublicKey.default;
|
|
46407
46866
|
return pubkey.toBase58();
|
|
46408
46867
|
}
|
|
46409
46868
|
get baseAssetTokenProgramId() {
|
|
@@ -46561,6 +47020,9 @@ class StateAccountType {
|
|
|
46561
47020
|
if (s === "tokenizedVault") {
|
|
46562
47021
|
return StateAccountType.TOKENIZED_VAULT;
|
|
46563
47022
|
}
|
|
47023
|
+
if (s === "singleAssetVault") {
|
|
47024
|
+
return StateAccountType.SINGLE_ASSET_VAULT;
|
|
47025
|
+
}
|
|
46564
47026
|
if (s === "mint") {
|
|
46565
47027
|
return StateAccountType.MINT;
|
|
46566
47028
|
}
|
|
@@ -46576,6 +47038,9 @@ StateAccountType.TOKENIZED_VAULT = {
|
|
|
46576
47038
|
StateAccountType.MINT = {
|
|
46577
47039
|
mint: {}
|
|
46578
47040
|
};
|
|
47041
|
+
StateAccountType.SINGLE_ASSET_VAULT = {
|
|
47042
|
+
singleAssetVault: {}
|
|
47043
|
+
};
|
|
46579
47044
|
|
|
46580
47045
|
class IntegrationPermissions {
|
|
46581
47046
|
constructor(obj){
|
|
@@ -49038,12 +49503,13 @@ const USDC_ORACLE = ASSETS_MAINNET.get("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyT
|
|
|
49038
49503
|
* @param cluster The cluster network (defaults to mainnet)
|
|
49039
49504
|
* @returns Metadata of the asset
|
|
49040
49505
|
*/ function getAssetMeta(assetMint, cluster = exports.ClusterNetwork.Mainnet) {
|
|
49041
|
-
|
|
49506
|
+
const mint = assetMint instanceof web3_js.PublicKey ? assetMint.toBase58() : assetMint;
|
|
49507
|
+
let assetMeta = ASSETS_MAINNET.get(mint);
|
|
49042
49508
|
if (!assetMeta && cluster !== exports.ClusterNetwork.Mainnet) {
|
|
49043
|
-
assetMeta = ASSETS_TESTS.get(
|
|
49509
|
+
assetMeta = ASSETS_TESTS.get(mint);
|
|
49044
49510
|
}
|
|
49045
49511
|
if (!assetMeta) {
|
|
49046
|
-
throw new Error("
|
|
49512
|
+
throw new Error("Asset not supported: " + assetMint);
|
|
49047
49513
|
}
|
|
49048
49514
|
return assetMeta;
|
|
49049
49515
|
}
|
|
@@ -52374,6 +52840,16 @@ class PriceClient {
|
|
|
52374
52840
|
async priceVaultIxs() {
|
|
52375
52841
|
// Cache state model
|
|
52376
52842
|
this.cachedStateModel = await this.base.fetchStateModel();
|
|
52843
|
+
if (StateAccountType.equals(this.cachedStateModel.accountType, StateAccountType.SINGLE_ASSET_VAULT)) {
|
|
52844
|
+
const baseAssetAta = this.base.getVaultAta(this.cachedStateModel.baseAssetMint, this.cachedStateModel.baseAssetTokenProgramId);
|
|
52845
|
+
const ix = await this.base.mintProgram.methods.priceSingleAssetVault().accounts({
|
|
52846
|
+
glamState: this.base.statePda,
|
|
52847
|
+
baseAssetAta
|
|
52848
|
+
}).instruction();
|
|
52849
|
+
return [
|
|
52850
|
+
ix
|
|
52851
|
+
];
|
|
52852
|
+
}
|
|
52377
52853
|
const priceVaultIx = await this.priceVaultTokensIx();
|
|
52378
52854
|
// If there are no external assets, we don't need to price DeFi positions
|
|
52379
52855
|
if ((this.cachedStateModel.externalPositions || []).length === 0) {
|
|
@@ -52838,6 +53314,10 @@ let TxBuilder$5 = class TxBuilder extends BaseTxBuilder {
|
|
|
52838
53314
|
const mintProgram = this.client.base.mintProgram;
|
|
52839
53315
|
const mintPda = getMintPda(glamState, 0, mintProgram.programId);
|
|
52840
53316
|
const extraMetasPda = getExtraMetasPda(mintPda);
|
|
53317
|
+
// Use glam hosted metadata as a fallback if uri is not provided
|
|
53318
|
+
if (!initMintParams.uri) {
|
|
53319
|
+
initMintParams.uri = `https://static.glam.systems/v0/token/metadata?key=${mintPda}`;
|
|
53320
|
+
}
|
|
52841
53321
|
const ix = await mintProgram.methods.initializeMint(new MintIdlModel(initMintParams), stateInitKey, initMintParams.accountType, decimals).accounts({
|
|
52842
53322
|
glamState,
|
|
52843
53323
|
signer: glamSigner,
|
|
@@ -53716,13 +54196,13 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53716
54196
|
/**
|
|
53717
54197
|
* Returns a transaction that calls CCTP's `depositForBurn` instruction that bridges USDC to another chain.
|
|
53718
54198
|
* A keypair is generated for the message sent event account, which must be included as a transaction signer.
|
|
53719
|
-
*/ async bridgeUsdcIx(amount, domain,
|
|
54199
|
+
*/ async bridgeUsdcIx(amount, domain, destinationAddress, params, glamSigner) {
|
|
53720
54200
|
const usdcAddress = this.client.base.isMainnet ? USDC : USDC_DEVNET;
|
|
53721
54201
|
const pdas = this.client.getDepositForBurnPdas(MESSAGE_TRANSMITTER_V2, TOKEN_MESSENGER_MINTER_V2, usdcAddress, domain);
|
|
53722
54202
|
const depositForBurnParams = {
|
|
53723
54203
|
amount,
|
|
53724
54204
|
destinationDomain: domain,
|
|
53725
|
-
mintRecipient:
|
|
54205
|
+
mintRecipient: destinationAddress,
|
|
53726
54206
|
destinationCaller: params.destinationCaller || web3_js.PublicKey.default,
|
|
53727
54207
|
...params
|
|
53728
54208
|
};
|
|
@@ -53731,12 +54211,12 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53731
54211
|
this.client.base.vaultPda.toBuffer()
|
|
53732
54212
|
], TOKEN_MESSENGER_MINTER_V2)[0];
|
|
53733
54213
|
const messageSentEventAccountKeypair = web3_js.Keypair.generate();
|
|
53734
|
-
const
|
|
54214
|
+
const senderUsdcAta = this.client.base.getVaultAta(usdcAddress);
|
|
53735
54215
|
const ix = await this.client.base.extCctpProgram.methods.depositForBurn(depositForBurnParams).accounts({
|
|
53736
54216
|
glamState: this.client.base.statePda,
|
|
53737
54217
|
glamSigner,
|
|
53738
54218
|
senderAuthorityPda: pdas.authorityPda,
|
|
53739
|
-
burnTokenAccount,
|
|
54219
|
+
burnTokenAccount: senderUsdcAta,
|
|
53740
54220
|
denylistAccount,
|
|
53741
54221
|
messageTransmitter: pdas.messageTransmitterAccount,
|
|
53742
54222
|
tokenMessenger: pdas.tokenMessengerAccount,
|
|
@@ -53752,9 +54232,9 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53752
54232
|
messageSentEventAccountKeypair
|
|
53753
54233
|
];
|
|
53754
54234
|
}
|
|
53755
|
-
async bridgeUsdcTx(amount, domain,
|
|
54235
|
+
async bridgeUsdcTx(amount, domain, destinationAddress, params, txOptions) {
|
|
53756
54236
|
const signer = txOptions.signer || this.client.base.signer;
|
|
53757
|
-
const [ix, messageSentEventAccountKeypair] = await this.bridgeUsdcIx(amount, domain,
|
|
54237
|
+
const [ix, messageSentEventAccountKeypair] = await this.bridgeUsdcIx(amount, domain, destinationAddress, params, signer);
|
|
53758
54238
|
const tx = await this.buildVersionedTx([
|
|
53759
54239
|
ix
|
|
53760
54240
|
], txOptions);
|
|
@@ -53771,6 +54251,7 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53771
54251
|
if (!decodedMessage || !decodedMessage?.decodedMessageBody || !decodedMessage?.decodedMessageBody?.burnToken) {
|
|
53772
54252
|
throw new Error("Invalid message object: missing burnToken in decodedMessage");
|
|
53773
54253
|
}
|
|
54254
|
+
const recipientUsdcAta = this.client.base.getVaultAta(USDC);
|
|
53774
54255
|
// message, attestation, eventNonce, burnToken are hex strings
|
|
53775
54256
|
const pdas = await this.client.getReceiveMessagePdas(MESSAGE_TRANSMITTER_V2, TOKEN_MESSENGER_MINTER_V2, USDC, decodedMessage.decodedMessageBody.burnToken, sourceDomain.toString(), eventNonce);
|
|
53776
54257
|
// raw ix data: [discriminator][message][attestation]
|
|
@@ -53857,7 +54338,7 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53857
54338
|
{
|
|
53858
54339
|
isSigner: false,
|
|
53859
54340
|
isWritable: true,
|
|
53860
|
-
pubkey:
|
|
54341
|
+
pubkey: recipientUsdcAta
|
|
53861
54342
|
},
|
|
53862
54343
|
{
|
|
53863
54344
|
isSigner: false,
|
|
@@ -53905,7 +54386,9 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53905
54386
|
const ix = await this.receiveMessageIx(sourceDomain, message);
|
|
53906
54387
|
receiveMessageIxs.push(ix);
|
|
53907
54388
|
}
|
|
53908
|
-
const
|
|
54389
|
+
const recipientWallet = this.client.base.vaultPda;
|
|
54390
|
+
const recipientUsdcAta = this.client.base.getVaultAta(USDC);
|
|
54391
|
+
const createUsdcAtaIx = splToken.createAssociatedTokenAccountIdempotentInstruction(this.client.base.signer, recipientUsdcAta, recipientWallet, USDC);
|
|
53909
54392
|
return await this.buildVersionedTx([
|
|
53910
54393
|
createUsdcAtaIx,
|
|
53911
54394
|
...receiveMessageIxs
|
|
@@ -53918,11 +54401,11 @@ class CctpClient {
|
|
|
53918
54401
|
*
|
|
53919
54402
|
* @param amount Amount of USDC to bridge (in smallest units)
|
|
53920
54403
|
* @param domain Destination domain (e.g., 0 for Ethereum, 1 for Avalanche)
|
|
53921
|
-
* @param
|
|
54404
|
+
* @param destinationAddress Destination address on target chain (EVM address as PublicKey)
|
|
53922
54405
|
* @param params Additional parameters (maxFee, minFinalityThreshold)
|
|
53923
54406
|
* @param txOptions Transaction options
|
|
53924
|
-
*/ async bridgeUsdc(amount, domain,
|
|
53925
|
-
const [tx, keypair] = await this.txBuilder.bridgeUsdcTx(new anchor.BN(amount), domain,
|
|
54407
|
+
*/ async bridgeUsdc(amount, domain, destinationAddress, params, txOptions = {}) {
|
|
54408
|
+
const [tx, keypair] = await this.txBuilder.bridgeUsdcTx(new anchor.BN(amount), domain, destinationAddress, params, txOptions);
|
|
53926
54409
|
return await this.base.sendAndConfirm(tx, [
|
|
53927
54410
|
keypair
|
|
53928
54411
|
]);
|
|
@@ -54041,10 +54524,10 @@ class CctpClient {
|
|
|
54041
54524
|
};
|
|
54042
54525
|
}
|
|
54043
54526
|
/**
|
|
54044
|
-
* Find all message accounts onchain for a given sender
|
|
54527
|
+
* Find all message accounts onchain for a given sender wallet
|
|
54045
54528
|
*
|
|
54046
54529
|
* TODO: filter by burned token mint
|
|
54047
|
-
*/ async findV2Messages(
|
|
54530
|
+
*/ async findV2Messages(senderWallet, options) {
|
|
54048
54531
|
const accounts = await getProgramAccounts(this.base.connection, MESSAGE_TRANSMITTER_V2, {
|
|
54049
54532
|
...options.commitment ? {
|
|
54050
54533
|
commitment: options.commitment
|
|
@@ -54056,7 +54539,7 @@ class CctpClient {
|
|
|
54056
54539
|
{
|
|
54057
54540
|
memcmp: {
|
|
54058
54541
|
offset: 300,
|
|
54059
|
-
bytes:
|
|
54542
|
+
bytes: senderWallet.toBase58()
|
|
54060
54543
|
}
|
|
54061
54544
|
}
|
|
54062
54545
|
]
|