@glamsystems/glam-sdk 1.0.9 → 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 +497 -24
- package/index.esm.js +497 -24
- package/package.json +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 +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
|
}
|
|
@@ -45434,13 +45885,12 @@ const JUPITER_SWAP_ERRORS = {
|
|
|
45434
45885
|
*/ function parseProgramLogs(logs) {
|
|
45435
45886
|
// "Error Message:" indicates an anchor program error
|
|
45436
45887
|
// Other messages are manually sourced & handled
|
|
45437
|
-
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"));
|
|
45438
45889
|
if (errorMsgLog) {
|
|
45439
45890
|
if (errorMsgLog.includes("Error Message:")) {
|
|
45440
45891
|
return errorMsgLog.split("Error Message:")[1].trim();
|
|
45441
|
-
} else {
|
|
45442
|
-
return "Insufficient funds";
|
|
45443
45892
|
}
|
|
45893
|
+
return errorMsgLog;
|
|
45444
45894
|
}
|
|
45445
45895
|
// Match the following pattern to find Jupiter error code in logs
|
|
45446
45896
|
// "Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 failed: custom program error: 0x1788"
|
|
@@ -46412,7 +46862,7 @@ class JupiterApiClient {
|
|
|
46412
46862
|
return new Date(createdAt * 1000).toISOString().split("T")[0] || "Unknown";
|
|
46413
46863
|
}
|
|
46414
46864
|
get sparkleKey() {
|
|
46415
|
-
const pubkey = (this.mint
|
|
46865
|
+
const pubkey = (this.mint && !this.mint.equals(web3_js.PublicKey.default) ? this.mint : this.vault) || web3_js.PublicKey.default;
|
|
46416
46866
|
return pubkey.toBase58();
|
|
46417
46867
|
}
|
|
46418
46868
|
get baseAssetTokenProgramId() {
|
|
@@ -46570,6 +47020,9 @@ class StateAccountType {
|
|
|
46570
47020
|
if (s === "tokenizedVault") {
|
|
46571
47021
|
return StateAccountType.TOKENIZED_VAULT;
|
|
46572
47022
|
}
|
|
47023
|
+
if (s === "singleAssetVault") {
|
|
47024
|
+
return StateAccountType.SINGLE_ASSET_VAULT;
|
|
47025
|
+
}
|
|
46573
47026
|
if (s === "mint") {
|
|
46574
47027
|
return StateAccountType.MINT;
|
|
46575
47028
|
}
|
|
@@ -46585,6 +47038,9 @@ StateAccountType.TOKENIZED_VAULT = {
|
|
|
46585
47038
|
StateAccountType.MINT = {
|
|
46586
47039
|
mint: {}
|
|
46587
47040
|
};
|
|
47041
|
+
StateAccountType.SINGLE_ASSET_VAULT = {
|
|
47042
|
+
singleAssetVault: {}
|
|
47043
|
+
};
|
|
46588
47044
|
|
|
46589
47045
|
class IntegrationPermissions {
|
|
46590
47046
|
constructor(obj){
|
|
@@ -52384,6 +52840,16 @@ class PriceClient {
|
|
|
52384
52840
|
async priceVaultIxs() {
|
|
52385
52841
|
// Cache state model
|
|
52386
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
|
+
}
|
|
52387
52853
|
const priceVaultIx = await this.priceVaultTokensIx();
|
|
52388
52854
|
// If there are no external assets, we don't need to price DeFi positions
|
|
52389
52855
|
if ((this.cachedStateModel.externalPositions || []).length === 0) {
|
|
@@ -52848,6 +53314,10 @@ let TxBuilder$5 = class TxBuilder extends BaseTxBuilder {
|
|
|
52848
53314
|
const mintProgram = this.client.base.mintProgram;
|
|
52849
53315
|
const mintPda = getMintPda(glamState, 0, mintProgram.programId);
|
|
52850
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
|
+
}
|
|
52851
53321
|
const ix = await mintProgram.methods.initializeMint(new MintIdlModel(initMintParams), stateInitKey, initMintParams.accountType, decimals).accounts({
|
|
52852
53322
|
glamState,
|
|
52853
53323
|
signer: glamSigner,
|
|
@@ -53726,13 +54196,13 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53726
54196
|
/**
|
|
53727
54197
|
* Returns a transaction that calls CCTP's `depositForBurn` instruction that bridges USDC to another chain.
|
|
53728
54198
|
* A keypair is generated for the message sent event account, which must be included as a transaction signer.
|
|
53729
|
-
*/ async bridgeUsdcIx(amount, domain,
|
|
54199
|
+
*/ async bridgeUsdcIx(amount, domain, destinationAddress, params, glamSigner) {
|
|
53730
54200
|
const usdcAddress = this.client.base.isMainnet ? USDC : USDC_DEVNET;
|
|
53731
54201
|
const pdas = this.client.getDepositForBurnPdas(MESSAGE_TRANSMITTER_V2, TOKEN_MESSENGER_MINTER_V2, usdcAddress, domain);
|
|
53732
54202
|
const depositForBurnParams = {
|
|
53733
54203
|
amount,
|
|
53734
54204
|
destinationDomain: domain,
|
|
53735
|
-
mintRecipient:
|
|
54205
|
+
mintRecipient: destinationAddress,
|
|
53736
54206
|
destinationCaller: params.destinationCaller || web3_js.PublicKey.default,
|
|
53737
54207
|
...params
|
|
53738
54208
|
};
|
|
@@ -53741,12 +54211,12 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53741
54211
|
this.client.base.vaultPda.toBuffer()
|
|
53742
54212
|
], TOKEN_MESSENGER_MINTER_V2)[0];
|
|
53743
54213
|
const messageSentEventAccountKeypair = web3_js.Keypair.generate();
|
|
53744
|
-
const
|
|
54214
|
+
const senderUsdcAta = this.client.base.getVaultAta(usdcAddress);
|
|
53745
54215
|
const ix = await this.client.base.extCctpProgram.methods.depositForBurn(depositForBurnParams).accounts({
|
|
53746
54216
|
glamState: this.client.base.statePda,
|
|
53747
54217
|
glamSigner,
|
|
53748
54218
|
senderAuthorityPda: pdas.authorityPda,
|
|
53749
|
-
burnTokenAccount,
|
|
54219
|
+
burnTokenAccount: senderUsdcAta,
|
|
53750
54220
|
denylistAccount,
|
|
53751
54221
|
messageTransmitter: pdas.messageTransmitterAccount,
|
|
53752
54222
|
tokenMessenger: pdas.tokenMessengerAccount,
|
|
@@ -53762,9 +54232,9 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53762
54232
|
messageSentEventAccountKeypair
|
|
53763
54233
|
];
|
|
53764
54234
|
}
|
|
53765
|
-
async bridgeUsdcTx(amount, domain,
|
|
54235
|
+
async bridgeUsdcTx(amount, domain, destinationAddress, params, txOptions) {
|
|
53766
54236
|
const signer = txOptions.signer || this.client.base.signer;
|
|
53767
|
-
const [ix, messageSentEventAccountKeypair] = await this.bridgeUsdcIx(amount, domain,
|
|
54237
|
+
const [ix, messageSentEventAccountKeypair] = await this.bridgeUsdcIx(amount, domain, destinationAddress, params, signer);
|
|
53768
54238
|
const tx = await this.buildVersionedTx([
|
|
53769
54239
|
ix
|
|
53770
54240
|
], txOptions);
|
|
@@ -53781,6 +54251,7 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53781
54251
|
if (!decodedMessage || !decodedMessage?.decodedMessageBody || !decodedMessage?.decodedMessageBody?.burnToken) {
|
|
53782
54252
|
throw new Error("Invalid message object: missing burnToken in decodedMessage");
|
|
53783
54253
|
}
|
|
54254
|
+
const recipientUsdcAta = this.client.base.getVaultAta(USDC);
|
|
53784
54255
|
// message, attestation, eventNonce, burnToken are hex strings
|
|
53785
54256
|
const pdas = await this.client.getReceiveMessagePdas(MESSAGE_TRANSMITTER_V2, TOKEN_MESSENGER_MINTER_V2, USDC, decodedMessage.decodedMessageBody.burnToken, sourceDomain.toString(), eventNonce);
|
|
53786
54257
|
// raw ix data: [discriminator][message][attestation]
|
|
@@ -53867,7 +54338,7 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53867
54338
|
{
|
|
53868
54339
|
isSigner: false,
|
|
53869
54340
|
isWritable: true,
|
|
53870
|
-
pubkey:
|
|
54341
|
+
pubkey: recipientUsdcAta
|
|
53871
54342
|
},
|
|
53872
54343
|
{
|
|
53873
54344
|
isSigner: false,
|
|
@@ -53915,7 +54386,9 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53915
54386
|
const ix = await this.receiveMessageIx(sourceDomain, message);
|
|
53916
54387
|
receiveMessageIxs.push(ix);
|
|
53917
54388
|
}
|
|
53918
|
-
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);
|
|
53919
54392
|
return await this.buildVersionedTx([
|
|
53920
54393
|
createUsdcAtaIx,
|
|
53921
54394
|
...receiveMessageIxs
|
|
@@ -53928,11 +54401,11 @@ class CctpClient {
|
|
|
53928
54401
|
*
|
|
53929
54402
|
* @param amount Amount of USDC to bridge (in smallest units)
|
|
53930
54403
|
* @param domain Destination domain (e.g., 0 for Ethereum, 1 for Avalanche)
|
|
53931
|
-
* @param
|
|
54404
|
+
* @param destinationAddress Destination address on target chain (EVM address as PublicKey)
|
|
53932
54405
|
* @param params Additional parameters (maxFee, minFinalityThreshold)
|
|
53933
54406
|
* @param txOptions Transaction options
|
|
53934
|
-
*/ async bridgeUsdc(amount, domain,
|
|
53935
|
-
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);
|
|
53936
54409
|
return await this.base.sendAndConfirm(tx, [
|
|
53937
54410
|
keypair
|
|
53938
54411
|
]);
|
|
@@ -54051,10 +54524,10 @@ class CctpClient {
|
|
|
54051
54524
|
};
|
|
54052
54525
|
}
|
|
54053
54526
|
/**
|
|
54054
|
-
* Find all message accounts onchain for a given sender
|
|
54527
|
+
* Find all message accounts onchain for a given sender wallet
|
|
54055
54528
|
*
|
|
54056
54529
|
* TODO: filter by burned token mint
|
|
54057
|
-
*/ async findV2Messages(
|
|
54530
|
+
*/ async findV2Messages(senderWallet, options) {
|
|
54058
54531
|
const accounts = await getProgramAccounts(this.base.connection, MESSAGE_TRANSMITTER_V2, {
|
|
54059
54532
|
...options.commitment ? {
|
|
54060
54533
|
commitment: options.commitment
|
|
@@ -54066,7 +54539,7 @@ class CctpClient {
|
|
|
54066
54539
|
{
|
|
54067
54540
|
memcmp: {
|
|
54068
54541
|
offset: 300,
|
|
54069
|
-
bytes:
|
|
54542
|
+
bytes: senderWallet.toBase58()
|
|
54070
54543
|
}
|
|
54071
54544
|
}
|
|
54072
54545
|
]
|