@glamsystems/glam-sdk 1.0.9 → 1.0.11
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 +512 -24
- package/index.esm.js +512 -25
- package/package.json +1 -1
- package/src/client/cctp.d.ts +6 -6
- package/src/models/state.d.ts +5 -0
- package/src/react/glam.d.ts +1 -1
- package/src/utils/timelock.d.ts +7 -0
- 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 +63 -0
- 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 +63 -0
- package/target/types/glam_config.ts +63 -0
- 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
|
}
|
|
@@ -3298,6 +3301,57 @@ var instructions$e = [
|
|
|
3298
3301
|
}
|
|
3299
3302
|
]
|
|
3300
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
|
+
},
|
|
3301
3355
|
{
|
|
3302
3356
|
name: "update_protocol_fees",
|
|
3303
3357
|
discriminator: [
|
|
@@ -3580,18 +3634,30 @@ var types$e = [
|
|
|
3580
3634
|
},
|
|
3581
3635
|
{
|
|
3582
3636
|
name: "referrer",
|
|
3637
|
+
docs: [
|
|
3638
|
+
"Default GLAM referrer"
|
|
3639
|
+
],
|
|
3583
3640
|
type: "pubkey"
|
|
3584
3641
|
},
|
|
3585
3642
|
{
|
|
3586
3643
|
name: "base_fee_bps",
|
|
3644
|
+
docs: [
|
|
3645
|
+
"Default protocol base fee applied to all vaults"
|
|
3646
|
+
],
|
|
3587
3647
|
type: "u16"
|
|
3588
3648
|
},
|
|
3589
3649
|
{
|
|
3590
3650
|
name: "flow_fee_bps",
|
|
3651
|
+
docs: [
|
|
3652
|
+
"Default protocol flow fee applied to all vaults"
|
|
3653
|
+
],
|
|
3591
3654
|
type: "u16"
|
|
3592
3655
|
},
|
|
3593
3656
|
{
|
|
3594
3657
|
name: "asset_metas",
|
|
3658
|
+
docs: [
|
|
3659
|
+
"List of assets and their oracle configs supported by the protocol"
|
|
3660
|
+
],
|
|
3595
3661
|
type: {
|
|
3596
3662
|
vec: {
|
|
3597
3663
|
defined: {
|
|
@@ -3687,7 +3753,7 @@ var GlamConfigIdlJson = {
|
|
|
3687
3753
|
var address$d = "GM1NtvvnSXUptTrMCqbogAdZJydZSNv98DoU5AZVLmGh";
|
|
3688
3754
|
var metadata$d = {
|
|
3689
3755
|
name: "glam_mint",
|
|
3690
|
-
version: "1.0.
|
|
3756
|
+
version: "1.0.2",
|
|
3691
3757
|
spec: "0.1.0",
|
|
3692
3758
|
description: "GLAM mint program"
|
|
3693
3759
|
};
|
|
@@ -6503,6 +6569,167 @@ var instructions$d = [
|
|
|
6503
6569
|
}
|
|
6504
6570
|
]
|
|
6505
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
|
+
},
|
|
6506
6733
|
{
|
|
6507
6734
|
name: "price_stake_accounts",
|
|
6508
6735
|
discriminator: [
|
|
@@ -8315,6 +8542,9 @@ var types$d = [
|
|
|
8315
8542
|
},
|
|
8316
8543
|
{
|
|
8317
8544
|
name: "Mint"
|
|
8545
|
+
},
|
|
8546
|
+
{
|
|
8547
|
+
name: "SingleAssetVault"
|
|
8318
8548
|
}
|
|
8319
8549
|
]
|
|
8320
8550
|
}
|
|
@@ -8390,7 +8620,7 @@ var types$d = [
|
|
|
8390
8620
|
},
|
|
8391
8621
|
{
|
|
8392
8622
|
name: "priority",
|
|
8393
|
-
type: "
|
|
8623
|
+
type: "i8"
|
|
8394
8624
|
},
|
|
8395
8625
|
{
|
|
8396
8626
|
name: "padding",
|
|
@@ -8885,18 +9115,30 @@ var types$d = [
|
|
|
8885
9115
|
},
|
|
8886
9116
|
{
|
|
8887
9117
|
name: "referrer",
|
|
9118
|
+
docs: [
|
|
9119
|
+
"Default GLAM referrer"
|
|
9120
|
+
],
|
|
8888
9121
|
type: "pubkey"
|
|
8889
9122
|
},
|
|
8890
9123
|
{
|
|
8891
9124
|
name: "base_fee_bps",
|
|
9125
|
+
docs: [
|
|
9126
|
+
"Default protocol base fee applied to all vaults"
|
|
9127
|
+
],
|
|
8892
9128
|
type: "u16"
|
|
8893
9129
|
},
|
|
8894
9130
|
{
|
|
8895
9131
|
name: "flow_fee_bps",
|
|
9132
|
+
docs: [
|
|
9133
|
+
"Default protocol flow fee applied to all vaults"
|
|
9134
|
+
],
|
|
8896
9135
|
type: "u16"
|
|
8897
9136
|
},
|
|
8898
9137
|
{
|
|
8899
9138
|
name: "asset_metas",
|
|
9139
|
+
docs: [
|
|
9140
|
+
"List of assets and their oracle configs supported by the protocol"
|
|
9141
|
+
],
|
|
8900
9142
|
type: {
|
|
8901
9143
|
vec: {
|
|
8902
9144
|
defined: {
|
|
@@ -10075,6 +10317,9 @@ var types$c = [
|
|
|
10075
10317
|
},
|
|
10076
10318
|
{
|
|
10077
10319
|
name: "Mint"
|
|
10320
|
+
},
|
|
10321
|
+
{
|
|
10322
|
+
name: "SingleAssetVault"
|
|
10078
10323
|
}
|
|
10079
10324
|
]
|
|
10080
10325
|
}
|
|
@@ -13649,6 +13894,9 @@ var types$b = [
|
|
|
13649
13894
|
},
|
|
13650
13895
|
{
|
|
13651
13896
|
name: "Mint"
|
|
13897
|
+
},
|
|
13898
|
+
{
|
|
13899
|
+
name: "SingleAssetVault"
|
|
13652
13900
|
}
|
|
13653
13901
|
]
|
|
13654
13902
|
}
|
|
@@ -17107,6 +17355,9 @@ var types$a = [
|
|
|
17107
17355
|
},
|
|
17108
17356
|
{
|
|
17109
17357
|
name: "Mint"
|
|
17358
|
+
},
|
|
17359
|
+
{
|
|
17360
|
+
name: "SingleAssetVault"
|
|
17110
17361
|
}
|
|
17111
17362
|
]
|
|
17112
17363
|
}
|
|
@@ -18804,6 +19055,9 @@ var types$9 = [
|
|
|
18804
19055
|
},
|
|
18805
19056
|
{
|
|
18806
19057
|
name: "Mint"
|
|
19058
|
+
},
|
|
19059
|
+
{
|
|
19060
|
+
name: "SingleAssetVault"
|
|
18807
19061
|
}
|
|
18808
19062
|
]
|
|
18809
19063
|
}
|
|
@@ -20400,6 +20654,9 @@ var types$8 = [
|
|
|
20400
20654
|
},
|
|
20401
20655
|
{
|
|
20402
20656
|
name: "Mint"
|
|
20657
|
+
},
|
|
20658
|
+
{
|
|
20659
|
+
name: "SingleAssetVault"
|
|
20403
20660
|
}
|
|
20404
20661
|
]
|
|
20405
20662
|
}
|
|
@@ -21641,6 +21898,9 @@ var types$7 = [
|
|
|
21641
21898
|
},
|
|
21642
21899
|
{
|
|
21643
21900
|
name: "Mint"
|
|
21901
|
+
},
|
|
21902
|
+
{
|
|
21903
|
+
name: "SingleAssetVault"
|
|
21644
21904
|
}
|
|
21645
21905
|
]
|
|
21646
21906
|
}
|
|
@@ -22684,7 +22944,7 @@ var ExtCctpIdlJson = {
|
|
|
22684
22944
|
var address$6 = "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz";
|
|
22685
22945
|
var metadata$6 = {
|
|
22686
22946
|
name: "glam_protocol",
|
|
22687
|
-
version: "1.0.
|
|
22947
|
+
version: "1.0.3",
|
|
22688
22948
|
spec: "0.1.0",
|
|
22689
22949
|
description: "Glam Protocol"
|
|
22690
22950
|
};
|
|
@@ -24530,6 +24790,9 @@ var types$6 = [
|
|
|
24530
24790
|
},
|
|
24531
24791
|
{
|
|
24532
24792
|
name: "Mint"
|
|
24793
|
+
},
|
|
24794
|
+
{
|
|
24795
|
+
name: "SingleAssetVault"
|
|
24533
24796
|
}
|
|
24534
24797
|
]
|
|
24535
24798
|
}
|
|
@@ -25796,7 +26059,7 @@ var GlamProtocolIdlJsonStaging = {
|
|
|
25796
26059
|
var address$5 = "gstgm1M39mhgnvgyScGUDRwNn5kNVSd97hTtyow1Et5";
|
|
25797
26060
|
var metadata$5 = {
|
|
25798
26061
|
name: "glam_mint",
|
|
25799
|
-
version: "1.0.
|
|
26062
|
+
version: "1.0.2",
|
|
25800
26063
|
spec: "0.1.0",
|
|
25801
26064
|
description: "GLAM mint program"
|
|
25802
26065
|
};
|
|
@@ -28612,6 +28875,167 @@ var instructions$5 = [
|
|
|
28612
28875
|
}
|
|
28613
28876
|
]
|
|
28614
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
|
+
},
|
|
28615
29039
|
{
|
|
28616
29040
|
name: "price_stake_accounts",
|
|
28617
29041
|
discriminator: [
|
|
@@ -30424,6 +30848,9 @@ var types$5 = [
|
|
|
30424
30848
|
},
|
|
30425
30849
|
{
|
|
30426
30850
|
name: "Mint"
|
|
30851
|
+
},
|
|
30852
|
+
{
|
|
30853
|
+
name: "SingleAssetVault"
|
|
30427
30854
|
}
|
|
30428
30855
|
]
|
|
30429
30856
|
}
|
|
@@ -30499,7 +30926,7 @@ var types$5 = [
|
|
|
30499
30926
|
},
|
|
30500
30927
|
{
|
|
30501
30928
|
name: "priority",
|
|
30502
|
-
type: "
|
|
30929
|
+
type: "i8"
|
|
30503
30930
|
},
|
|
30504
30931
|
{
|
|
30505
30932
|
name: "padding",
|
|
@@ -30994,18 +31421,30 @@ var types$5 = [
|
|
|
30994
31421
|
},
|
|
30995
31422
|
{
|
|
30996
31423
|
name: "referrer",
|
|
31424
|
+
docs: [
|
|
31425
|
+
"Default GLAM referrer"
|
|
31426
|
+
],
|
|
30997
31427
|
type: "pubkey"
|
|
30998
31428
|
},
|
|
30999
31429
|
{
|
|
31000
31430
|
name: "base_fee_bps",
|
|
31431
|
+
docs: [
|
|
31432
|
+
"Default protocol base fee applied to all vaults"
|
|
31433
|
+
],
|
|
31001
31434
|
type: "u16"
|
|
31002
31435
|
},
|
|
31003
31436
|
{
|
|
31004
31437
|
name: "flow_fee_bps",
|
|
31438
|
+
docs: [
|
|
31439
|
+
"Default protocol flow fee applied to all vaults"
|
|
31440
|
+
],
|
|
31005
31441
|
type: "u16"
|
|
31006
31442
|
},
|
|
31007
31443
|
{
|
|
31008
31444
|
name: "asset_metas",
|
|
31445
|
+
docs: [
|
|
31446
|
+
"List of assets and their oracle configs supported by the protocol"
|
|
31447
|
+
],
|
|
31009
31448
|
type: {
|
|
31010
31449
|
vec: {
|
|
31011
31450
|
defined: {
|
|
@@ -32184,6 +32623,9 @@ var types$4 = [
|
|
|
32184
32623
|
},
|
|
32185
32624
|
{
|
|
32186
32625
|
name: "Mint"
|
|
32626
|
+
},
|
|
32627
|
+
{
|
|
32628
|
+
name: "SingleAssetVault"
|
|
32187
32629
|
}
|
|
32188
32630
|
]
|
|
32189
32631
|
}
|
|
@@ -35758,6 +36200,9 @@ var types$3 = [
|
|
|
35758
36200
|
},
|
|
35759
36201
|
{
|
|
35760
36202
|
name: "Mint"
|
|
36203
|
+
},
|
|
36204
|
+
{
|
|
36205
|
+
name: "SingleAssetVault"
|
|
35761
36206
|
}
|
|
35762
36207
|
]
|
|
35763
36208
|
}
|
|
@@ -39216,6 +39661,9 @@ var types$2 = [
|
|
|
39216
39661
|
},
|
|
39217
39662
|
{
|
|
39218
39663
|
name: "Mint"
|
|
39664
|
+
},
|
|
39665
|
+
{
|
|
39666
|
+
name: "SingleAssetVault"
|
|
39219
39667
|
}
|
|
39220
39668
|
]
|
|
39221
39669
|
}
|
|
@@ -40912,6 +41360,9 @@ var types$1 = [
|
|
|
40912
41360
|
},
|
|
40913
41361
|
{
|
|
40914
41362
|
name: "Mint"
|
|
41363
|
+
},
|
|
41364
|
+
{
|
|
41365
|
+
name: "SingleAssetVault"
|
|
40915
41366
|
}
|
|
40916
41367
|
]
|
|
40917
41368
|
}
|
|
@@ -45251,6 +45702,20 @@ function getGlobalConfigPda() {
|
|
|
45251
45702
|
const { permissions } = parseProtocolPermissionsBitmask(integrationProgram, protocolBitflag, permissionsBitmask);
|
|
45252
45703
|
return permissions.map((p)=>p.name);
|
|
45253
45704
|
}
|
|
45705
|
+
/**
|
|
45706
|
+
* Compare current and staged PublicKey arrays and return added/removed keys
|
|
45707
|
+
*/ function comparePublicKeyArrays(current, staged) {
|
|
45708
|
+
const currentSet = new PkSet(current || []);
|
|
45709
|
+
const stagedSet = new PkSet(staged);
|
|
45710
|
+
return {
|
|
45711
|
+
added: [
|
|
45712
|
+
...stagedSet
|
|
45713
|
+
].filter((pk)=>!currentSet.has(pk)),
|
|
45714
|
+
removed: [
|
|
45715
|
+
...currentSet
|
|
45716
|
+
].filter((pk)=>!stagedSet.has(pk))
|
|
45717
|
+
};
|
|
45718
|
+
}
|
|
45254
45719
|
/**
|
|
45255
45720
|
* Compare current and staged integrationAcls and return the differences
|
|
45256
45721
|
*/ function compareIntegrationAcls(current, staged) {
|
|
@@ -45434,13 +45899,12 @@ const JUPITER_SWAP_ERRORS = {
|
|
|
45434
45899
|
*/ function parseProgramLogs(logs) {
|
|
45435
45900
|
// "Error Message:" indicates an anchor program error
|
|
45436
45901
|
// Other messages are manually sourced & handled
|
|
45437
|
-
const errorMsgLog = (logs || []).find((log)=>log.includes("Error Message:") || log.includes("Error: insufficient funds"));
|
|
45902
|
+
const errorMsgLog = (logs || []).find((log)=>log.includes("Error Message:") || log.includes("Error: insufficient funds") || log.includes("Transfer: insufficient lamports"));
|
|
45438
45903
|
if (errorMsgLog) {
|
|
45439
45904
|
if (errorMsgLog.includes("Error Message:")) {
|
|
45440
45905
|
return errorMsgLog.split("Error Message:")[1].trim();
|
|
45441
|
-
} else {
|
|
45442
|
-
return "Insufficient funds";
|
|
45443
45906
|
}
|
|
45907
|
+
return errorMsgLog;
|
|
45444
45908
|
}
|
|
45445
45909
|
// Match the following pattern to find Jupiter error code in logs
|
|
45446
45910
|
// "Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 failed: custom program error: 0x1788"
|
|
@@ -46412,7 +46876,7 @@ class JupiterApiClient {
|
|
|
46412
46876
|
return new Date(createdAt * 1000).toISOString().split("T")[0] || "Unknown";
|
|
46413
46877
|
}
|
|
46414
46878
|
get sparkleKey() {
|
|
46415
|
-
const pubkey = (this.mint
|
|
46879
|
+
const pubkey = (this.mint && !this.mint.equals(web3_js.PublicKey.default) ? this.mint : this.vault) || web3_js.PublicKey.default;
|
|
46416
46880
|
return pubkey.toBase58();
|
|
46417
46881
|
}
|
|
46418
46882
|
get baseAssetTokenProgramId() {
|
|
@@ -46570,6 +47034,9 @@ class StateAccountType {
|
|
|
46570
47034
|
if (s === "tokenizedVault") {
|
|
46571
47035
|
return StateAccountType.TOKENIZED_VAULT;
|
|
46572
47036
|
}
|
|
47037
|
+
if (s === "singleAssetVault") {
|
|
47038
|
+
return StateAccountType.SINGLE_ASSET_VAULT;
|
|
47039
|
+
}
|
|
46573
47040
|
if (s === "mint") {
|
|
46574
47041
|
return StateAccountType.MINT;
|
|
46575
47042
|
}
|
|
@@ -46585,6 +47052,9 @@ StateAccountType.TOKENIZED_VAULT = {
|
|
|
46585
47052
|
StateAccountType.MINT = {
|
|
46586
47053
|
mint: {}
|
|
46587
47054
|
};
|
|
47055
|
+
StateAccountType.SINGLE_ASSET_VAULT = {
|
|
47056
|
+
singleAssetVault: {}
|
|
47057
|
+
};
|
|
46588
47058
|
|
|
46589
47059
|
class IntegrationPermissions {
|
|
46590
47060
|
constructor(obj){
|
|
@@ -52384,6 +52854,16 @@ class PriceClient {
|
|
|
52384
52854
|
async priceVaultIxs() {
|
|
52385
52855
|
// Cache state model
|
|
52386
52856
|
this.cachedStateModel = await this.base.fetchStateModel();
|
|
52857
|
+
if (StateAccountType.equals(this.cachedStateModel.accountType, StateAccountType.SINGLE_ASSET_VAULT)) {
|
|
52858
|
+
const baseAssetAta = this.base.getVaultAta(this.cachedStateModel.baseAssetMint, this.cachedStateModel.baseAssetTokenProgramId);
|
|
52859
|
+
const ix = await this.base.mintProgram.methods.priceSingleAssetVault().accounts({
|
|
52860
|
+
glamState: this.base.statePda,
|
|
52861
|
+
baseAssetAta
|
|
52862
|
+
}).instruction();
|
|
52863
|
+
return [
|
|
52864
|
+
ix
|
|
52865
|
+
];
|
|
52866
|
+
}
|
|
52387
52867
|
const priceVaultIx = await this.priceVaultTokensIx();
|
|
52388
52868
|
// If there are no external assets, we don't need to price DeFi positions
|
|
52389
52869
|
if ((this.cachedStateModel.externalPositions || []).length === 0) {
|
|
@@ -52848,6 +53328,10 @@ let TxBuilder$5 = class TxBuilder extends BaseTxBuilder {
|
|
|
52848
53328
|
const mintProgram = this.client.base.mintProgram;
|
|
52849
53329
|
const mintPda = getMintPda(glamState, 0, mintProgram.programId);
|
|
52850
53330
|
const extraMetasPda = getExtraMetasPda(mintPda);
|
|
53331
|
+
// Use glam hosted metadata as a fallback if uri is not provided
|
|
53332
|
+
if (!initMintParams.uri) {
|
|
53333
|
+
initMintParams.uri = `https://static.glam.systems/v0/token/metadata?key=${mintPda}`;
|
|
53334
|
+
}
|
|
52851
53335
|
const ix = await mintProgram.methods.initializeMint(new MintIdlModel(initMintParams), stateInitKey, initMintParams.accountType, decimals).accounts({
|
|
52852
53336
|
glamState,
|
|
52853
53337
|
signer: glamSigner,
|
|
@@ -53726,13 +54210,13 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53726
54210
|
/**
|
|
53727
54211
|
* Returns a transaction that calls CCTP's `depositForBurn` instruction that bridges USDC to another chain.
|
|
53728
54212
|
* A keypair is generated for the message sent event account, which must be included as a transaction signer.
|
|
53729
|
-
*/ async bridgeUsdcIx(amount, domain,
|
|
54213
|
+
*/ async bridgeUsdcIx(amount, domain, destinationAddress, params, glamSigner) {
|
|
53730
54214
|
const usdcAddress = this.client.base.isMainnet ? USDC : USDC_DEVNET;
|
|
53731
54215
|
const pdas = this.client.getDepositForBurnPdas(MESSAGE_TRANSMITTER_V2, TOKEN_MESSENGER_MINTER_V2, usdcAddress, domain);
|
|
53732
54216
|
const depositForBurnParams = {
|
|
53733
54217
|
amount,
|
|
53734
54218
|
destinationDomain: domain,
|
|
53735
|
-
mintRecipient:
|
|
54219
|
+
mintRecipient: destinationAddress,
|
|
53736
54220
|
destinationCaller: params.destinationCaller || web3_js.PublicKey.default,
|
|
53737
54221
|
...params
|
|
53738
54222
|
};
|
|
@@ -53741,12 +54225,12 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53741
54225
|
this.client.base.vaultPda.toBuffer()
|
|
53742
54226
|
], TOKEN_MESSENGER_MINTER_V2)[0];
|
|
53743
54227
|
const messageSentEventAccountKeypair = web3_js.Keypair.generate();
|
|
53744
|
-
const
|
|
54228
|
+
const senderUsdcAta = this.client.base.getVaultAta(usdcAddress);
|
|
53745
54229
|
const ix = await this.client.base.extCctpProgram.methods.depositForBurn(depositForBurnParams).accounts({
|
|
53746
54230
|
glamState: this.client.base.statePda,
|
|
53747
54231
|
glamSigner,
|
|
53748
54232
|
senderAuthorityPda: pdas.authorityPda,
|
|
53749
|
-
burnTokenAccount,
|
|
54233
|
+
burnTokenAccount: senderUsdcAta,
|
|
53750
54234
|
denylistAccount,
|
|
53751
54235
|
messageTransmitter: pdas.messageTransmitterAccount,
|
|
53752
54236
|
tokenMessenger: pdas.tokenMessengerAccount,
|
|
@@ -53762,9 +54246,9 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53762
54246
|
messageSentEventAccountKeypair
|
|
53763
54247
|
];
|
|
53764
54248
|
}
|
|
53765
|
-
async bridgeUsdcTx(amount, domain,
|
|
54249
|
+
async bridgeUsdcTx(amount, domain, destinationAddress, params, txOptions) {
|
|
53766
54250
|
const signer = txOptions.signer || this.client.base.signer;
|
|
53767
|
-
const [ix, messageSentEventAccountKeypair] = await this.bridgeUsdcIx(amount, domain,
|
|
54251
|
+
const [ix, messageSentEventAccountKeypair] = await this.bridgeUsdcIx(amount, domain, destinationAddress, params, signer);
|
|
53768
54252
|
const tx = await this.buildVersionedTx([
|
|
53769
54253
|
ix
|
|
53770
54254
|
], txOptions);
|
|
@@ -53781,6 +54265,7 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53781
54265
|
if (!decodedMessage || !decodedMessage?.decodedMessageBody || !decodedMessage?.decodedMessageBody?.burnToken) {
|
|
53782
54266
|
throw new Error("Invalid message object: missing burnToken in decodedMessage");
|
|
53783
54267
|
}
|
|
54268
|
+
const recipientUsdcAta = this.client.base.getVaultAta(USDC);
|
|
53784
54269
|
// message, attestation, eventNonce, burnToken are hex strings
|
|
53785
54270
|
const pdas = await this.client.getReceiveMessagePdas(MESSAGE_TRANSMITTER_V2, TOKEN_MESSENGER_MINTER_V2, USDC, decodedMessage.decodedMessageBody.burnToken, sourceDomain.toString(), eventNonce);
|
|
53786
54271
|
// raw ix data: [discriminator][message][attestation]
|
|
@@ -53867,7 +54352,7 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53867
54352
|
{
|
|
53868
54353
|
isSigner: false,
|
|
53869
54354
|
isWritable: true,
|
|
53870
|
-
pubkey:
|
|
54355
|
+
pubkey: recipientUsdcAta
|
|
53871
54356
|
},
|
|
53872
54357
|
{
|
|
53873
54358
|
isSigner: false,
|
|
@@ -53915,7 +54400,9 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53915
54400
|
const ix = await this.receiveMessageIx(sourceDomain, message);
|
|
53916
54401
|
receiveMessageIxs.push(ix);
|
|
53917
54402
|
}
|
|
53918
|
-
const
|
|
54403
|
+
const recipientWallet = this.client.base.vaultPda;
|
|
54404
|
+
const recipientUsdcAta = this.client.base.getVaultAta(USDC);
|
|
54405
|
+
const createUsdcAtaIx = splToken.createAssociatedTokenAccountIdempotentInstruction(this.client.base.signer, recipientUsdcAta, recipientWallet, USDC);
|
|
53919
54406
|
return await this.buildVersionedTx([
|
|
53920
54407
|
createUsdcAtaIx,
|
|
53921
54408
|
...receiveMessageIxs
|
|
@@ -53928,11 +54415,11 @@ class CctpClient {
|
|
|
53928
54415
|
*
|
|
53929
54416
|
* @param amount Amount of USDC to bridge (in smallest units)
|
|
53930
54417
|
* @param domain Destination domain (e.g., 0 for Ethereum, 1 for Avalanche)
|
|
53931
|
-
* @param
|
|
54418
|
+
* @param destinationAddress Destination address on target chain (EVM address as PublicKey)
|
|
53932
54419
|
* @param params Additional parameters (maxFee, minFinalityThreshold)
|
|
53933
54420
|
* @param txOptions Transaction options
|
|
53934
|
-
*/ async bridgeUsdc(amount, domain,
|
|
53935
|
-
const [tx, keypair] = await this.txBuilder.bridgeUsdcTx(new anchor.BN(amount), domain,
|
|
54421
|
+
*/ async bridgeUsdc(amount, domain, destinationAddress, params, txOptions = {}) {
|
|
54422
|
+
const [tx, keypair] = await this.txBuilder.bridgeUsdcTx(new anchor.BN(amount), domain, destinationAddress, params, txOptions);
|
|
53936
54423
|
return await this.base.sendAndConfirm(tx, [
|
|
53937
54424
|
keypair
|
|
53938
54425
|
]);
|
|
@@ -54051,10 +54538,10 @@ class CctpClient {
|
|
|
54051
54538
|
};
|
|
54052
54539
|
}
|
|
54053
54540
|
/**
|
|
54054
|
-
* Find all message accounts onchain for a given sender
|
|
54541
|
+
* Find all message accounts onchain for a given sender wallet
|
|
54055
54542
|
*
|
|
54056
54543
|
* TODO: filter by burned token mint
|
|
54057
|
-
*/ async findV2Messages(
|
|
54544
|
+
*/ async findV2Messages(senderWallet, options) {
|
|
54058
54545
|
const accounts = await getProgramAccounts(this.base.connection, MESSAGE_TRANSMITTER_V2, {
|
|
54059
54546
|
...options.commitment ? {
|
|
54060
54547
|
commitment: options.commitment
|
|
@@ -54066,7 +54553,7 @@ class CctpClient {
|
|
|
54066
54553
|
{
|
|
54067
54554
|
memcmp: {
|
|
54068
54555
|
offset: 300,
|
|
54069
|
-
bytes:
|
|
54556
|
+
bytes: senderWallet.toBase58()
|
|
54070
54557
|
}
|
|
54071
54558
|
}
|
|
54072
54559
|
]
|
|
@@ -54505,6 +54992,7 @@ exports.bytesToHex = bytesToHex;
|
|
|
54505
54992
|
exports.charsToString = charsToString;
|
|
54506
54993
|
exports.compareDelegateAcls = compareDelegateAcls;
|
|
54507
54994
|
exports.compareIntegrationAcls = compareIntegrationAcls;
|
|
54995
|
+
exports.comparePublicKeyArrays = comparePublicKeyArrays;
|
|
54508
54996
|
exports.evmAddressToBytes32 = evmAddressToBytes32;
|
|
54509
54997
|
exports.evmAddressToPublicKey = evmAddressToPublicKey;
|
|
54510
54998
|
exports.fetchAddressLookupTableAccounts = fetchAddressLookupTableAccounts;
|