@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.esm.js
CHANGED
|
@@ -16,7 +16,7 @@ import { getStakePoolAccount } from '@solana/spl-stake-pool';
|
|
|
16
16
|
var address$f = "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz";
|
|
17
17
|
var metadata$f = {
|
|
18
18
|
name: "glam_protocol",
|
|
19
|
-
version: "1.0.
|
|
19
|
+
version: "1.0.3",
|
|
20
20
|
spec: "0.1.0",
|
|
21
21
|
description: "Glam Protocol"
|
|
22
22
|
};
|
|
@@ -1787,6 +1787,9 @@ var types$f = [
|
|
|
1787
1787
|
},
|
|
1788
1788
|
{
|
|
1789
1789
|
name: "Mint"
|
|
1790
|
+
},
|
|
1791
|
+
{
|
|
1792
|
+
name: "SingleAssetVault"
|
|
1790
1793
|
}
|
|
1791
1794
|
]
|
|
1792
1795
|
}
|
|
@@ -3278,6 +3281,57 @@ var instructions$e = [
|
|
|
3278
3281
|
}
|
|
3279
3282
|
]
|
|
3280
3283
|
},
|
|
3284
|
+
{
|
|
3285
|
+
name: "update_fee_authority",
|
|
3286
|
+
discriminator: [
|
|
3287
|
+
31,
|
|
3288
|
+
223,
|
|
3289
|
+
200,
|
|
3290
|
+
21,
|
|
3291
|
+
114,
|
|
3292
|
+
158,
|
|
3293
|
+
65,
|
|
3294
|
+
61
|
|
3295
|
+
],
|
|
3296
|
+
accounts: [
|
|
3297
|
+
{
|
|
3298
|
+
name: "global_config",
|
|
3299
|
+
writable: true,
|
|
3300
|
+
pda: {
|
|
3301
|
+
seeds: [
|
|
3302
|
+
{
|
|
3303
|
+
kind: "const",
|
|
3304
|
+
value: [
|
|
3305
|
+
103,
|
|
3306
|
+
108,
|
|
3307
|
+
111,
|
|
3308
|
+
98,
|
|
3309
|
+
97,
|
|
3310
|
+
108,
|
|
3311
|
+
45,
|
|
3312
|
+
99,
|
|
3313
|
+
111,
|
|
3314
|
+
110,
|
|
3315
|
+
102,
|
|
3316
|
+
105,
|
|
3317
|
+
103
|
|
3318
|
+
]
|
|
3319
|
+
}
|
|
3320
|
+
]
|
|
3321
|
+
}
|
|
3322
|
+
},
|
|
3323
|
+
{
|
|
3324
|
+
name: "fee_authority",
|
|
3325
|
+
signer: true
|
|
3326
|
+
}
|
|
3327
|
+
],
|
|
3328
|
+
args: [
|
|
3329
|
+
{
|
|
3330
|
+
name: "fee_authority",
|
|
3331
|
+
type: "pubkey"
|
|
3332
|
+
}
|
|
3333
|
+
]
|
|
3334
|
+
},
|
|
3281
3335
|
{
|
|
3282
3336
|
name: "update_protocol_fees",
|
|
3283
3337
|
discriminator: [
|
|
@@ -3560,18 +3614,30 @@ var types$e = [
|
|
|
3560
3614
|
},
|
|
3561
3615
|
{
|
|
3562
3616
|
name: "referrer",
|
|
3617
|
+
docs: [
|
|
3618
|
+
"Default GLAM referrer"
|
|
3619
|
+
],
|
|
3563
3620
|
type: "pubkey"
|
|
3564
3621
|
},
|
|
3565
3622
|
{
|
|
3566
3623
|
name: "base_fee_bps",
|
|
3624
|
+
docs: [
|
|
3625
|
+
"Default protocol base fee applied to all vaults"
|
|
3626
|
+
],
|
|
3567
3627
|
type: "u16"
|
|
3568
3628
|
},
|
|
3569
3629
|
{
|
|
3570
3630
|
name: "flow_fee_bps",
|
|
3631
|
+
docs: [
|
|
3632
|
+
"Default protocol flow fee applied to all vaults"
|
|
3633
|
+
],
|
|
3571
3634
|
type: "u16"
|
|
3572
3635
|
},
|
|
3573
3636
|
{
|
|
3574
3637
|
name: "asset_metas",
|
|
3638
|
+
docs: [
|
|
3639
|
+
"List of assets and their oracle configs supported by the protocol"
|
|
3640
|
+
],
|
|
3575
3641
|
type: {
|
|
3576
3642
|
vec: {
|
|
3577
3643
|
defined: {
|
|
@@ -3667,7 +3733,7 @@ var GlamConfigIdlJson = {
|
|
|
3667
3733
|
var address$d = "GM1NtvvnSXUptTrMCqbogAdZJydZSNv98DoU5AZVLmGh";
|
|
3668
3734
|
var metadata$d = {
|
|
3669
3735
|
name: "glam_mint",
|
|
3670
|
-
version: "1.0.
|
|
3736
|
+
version: "1.0.2",
|
|
3671
3737
|
spec: "0.1.0",
|
|
3672
3738
|
description: "GLAM mint program"
|
|
3673
3739
|
};
|
|
@@ -6483,6 +6549,167 @@ var instructions$d = [
|
|
|
6483
6549
|
}
|
|
6484
6550
|
]
|
|
6485
6551
|
},
|
|
6552
|
+
{
|
|
6553
|
+
name: "price_single_asset_vault",
|
|
6554
|
+
docs: [
|
|
6555
|
+
"Prices a single asset vault."
|
|
6556
|
+
],
|
|
6557
|
+
discriminator: [
|
|
6558
|
+
93,
|
|
6559
|
+
213,
|
|
6560
|
+
219,
|
|
6561
|
+
25,
|
|
6562
|
+
38,
|
|
6563
|
+
74,
|
|
6564
|
+
9,
|
|
6565
|
+
167
|
|
6566
|
+
],
|
|
6567
|
+
accounts: [
|
|
6568
|
+
{
|
|
6569
|
+
name: "glam_state",
|
|
6570
|
+
writable: true
|
|
6571
|
+
},
|
|
6572
|
+
{
|
|
6573
|
+
name: "glam_vault",
|
|
6574
|
+
pda: {
|
|
6575
|
+
seeds: [
|
|
6576
|
+
{
|
|
6577
|
+
kind: "const",
|
|
6578
|
+
value: [
|
|
6579
|
+
118,
|
|
6580
|
+
97,
|
|
6581
|
+
117,
|
|
6582
|
+
108,
|
|
6583
|
+
116
|
|
6584
|
+
]
|
|
6585
|
+
},
|
|
6586
|
+
{
|
|
6587
|
+
kind: "account",
|
|
6588
|
+
path: "glam_state"
|
|
6589
|
+
}
|
|
6590
|
+
],
|
|
6591
|
+
program: {
|
|
6592
|
+
kind: "const",
|
|
6593
|
+
value: [
|
|
6594
|
+
227,
|
|
6595
|
+
199,
|
|
6596
|
+
235,
|
|
6597
|
+
230,
|
|
6598
|
+
176,
|
|
6599
|
+
132,
|
|
6600
|
+
243,
|
|
6601
|
+
117,
|
|
6602
|
+
43,
|
|
6603
|
+
131,
|
|
6604
|
+
173,
|
|
6605
|
+
18,
|
|
6606
|
+
78,
|
|
6607
|
+
255,
|
|
6608
|
+
26,
|
|
6609
|
+
50,
|
|
6610
|
+
209,
|
|
6611
|
+
135,
|
|
6612
|
+
86,
|
|
6613
|
+
219,
|
|
6614
|
+
140,
|
|
6615
|
+
126,
|
|
6616
|
+
61,
|
|
6617
|
+
255,
|
|
6618
|
+
0,
|
|
6619
|
+
218,
|
|
6620
|
+
252,
|
|
6621
|
+
224,
|
|
6622
|
+
172,
|
|
6623
|
+
8,
|
|
6624
|
+
223,
|
|
6625
|
+
207
|
|
6626
|
+
]
|
|
6627
|
+
}
|
|
6628
|
+
}
|
|
6629
|
+
},
|
|
6630
|
+
{
|
|
6631
|
+
name: "signer",
|
|
6632
|
+
writable: true,
|
|
6633
|
+
signer: true
|
|
6634
|
+
},
|
|
6635
|
+
{
|
|
6636
|
+
name: "base_asset_ata"
|
|
6637
|
+
},
|
|
6638
|
+
{
|
|
6639
|
+
name: "integration_authority",
|
|
6640
|
+
pda: {
|
|
6641
|
+
seeds: [
|
|
6642
|
+
{
|
|
6643
|
+
kind: "const",
|
|
6644
|
+
value: [
|
|
6645
|
+
105,
|
|
6646
|
+
110,
|
|
6647
|
+
116,
|
|
6648
|
+
101,
|
|
6649
|
+
103,
|
|
6650
|
+
114,
|
|
6651
|
+
97,
|
|
6652
|
+
116,
|
|
6653
|
+
105,
|
|
6654
|
+
111,
|
|
6655
|
+
110,
|
|
6656
|
+
45,
|
|
6657
|
+
97,
|
|
6658
|
+
117,
|
|
6659
|
+
116,
|
|
6660
|
+
104,
|
|
6661
|
+
111,
|
|
6662
|
+
114,
|
|
6663
|
+
105,
|
|
6664
|
+
116,
|
|
6665
|
+
121
|
|
6666
|
+
]
|
|
6667
|
+
}
|
|
6668
|
+
]
|
|
6669
|
+
}
|
|
6670
|
+
},
|
|
6671
|
+
{
|
|
6672
|
+
name: "glam_protocol",
|
|
6673
|
+
address: "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
|
|
6674
|
+
},
|
|
6675
|
+
{
|
|
6676
|
+
name: "event_authority",
|
|
6677
|
+
optional: true,
|
|
6678
|
+
pda: {
|
|
6679
|
+
seeds: [
|
|
6680
|
+
{
|
|
6681
|
+
kind: "const",
|
|
6682
|
+
value: [
|
|
6683
|
+
95,
|
|
6684
|
+
95,
|
|
6685
|
+
101,
|
|
6686
|
+
118,
|
|
6687
|
+
101,
|
|
6688
|
+
110,
|
|
6689
|
+
116,
|
|
6690
|
+
95,
|
|
6691
|
+
97,
|
|
6692
|
+
117,
|
|
6693
|
+
116,
|
|
6694
|
+
104,
|
|
6695
|
+
111,
|
|
6696
|
+
114,
|
|
6697
|
+
105,
|
|
6698
|
+
116,
|
|
6699
|
+
121
|
|
6700
|
+
]
|
|
6701
|
+
}
|
|
6702
|
+
]
|
|
6703
|
+
}
|
|
6704
|
+
},
|
|
6705
|
+
{
|
|
6706
|
+
name: "event_program",
|
|
6707
|
+
optional: true,
|
|
6708
|
+
address: "GM1NtvvnSXUptTrMCqbogAdZJydZSNv98DoU5AZVLmGh"
|
|
6709
|
+
}
|
|
6710
|
+
],
|
|
6711
|
+
args: []
|
|
6712
|
+
},
|
|
6486
6713
|
{
|
|
6487
6714
|
name: "price_stake_accounts",
|
|
6488
6715
|
discriminator: [
|
|
@@ -8295,6 +8522,9 @@ var types$d = [
|
|
|
8295
8522
|
},
|
|
8296
8523
|
{
|
|
8297
8524
|
name: "Mint"
|
|
8525
|
+
},
|
|
8526
|
+
{
|
|
8527
|
+
name: "SingleAssetVault"
|
|
8298
8528
|
}
|
|
8299
8529
|
]
|
|
8300
8530
|
}
|
|
@@ -8370,7 +8600,7 @@ var types$d = [
|
|
|
8370
8600
|
},
|
|
8371
8601
|
{
|
|
8372
8602
|
name: "priority",
|
|
8373
|
-
type: "
|
|
8603
|
+
type: "i8"
|
|
8374
8604
|
},
|
|
8375
8605
|
{
|
|
8376
8606
|
name: "padding",
|
|
@@ -8865,18 +9095,30 @@ var types$d = [
|
|
|
8865
9095
|
},
|
|
8866
9096
|
{
|
|
8867
9097
|
name: "referrer",
|
|
9098
|
+
docs: [
|
|
9099
|
+
"Default GLAM referrer"
|
|
9100
|
+
],
|
|
8868
9101
|
type: "pubkey"
|
|
8869
9102
|
},
|
|
8870
9103
|
{
|
|
8871
9104
|
name: "base_fee_bps",
|
|
9105
|
+
docs: [
|
|
9106
|
+
"Default protocol base fee applied to all vaults"
|
|
9107
|
+
],
|
|
8872
9108
|
type: "u16"
|
|
8873
9109
|
},
|
|
8874
9110
|
{
|
|
8875
9111
|
name: "flow_fee_bps",
|
|
9112
|
+
docs: [
|
|
9113
|
+
"Default protocol flow fee applied to all vaults"
|
|
9114
|
+
],
|
|
8876
9115
|
type: "u16"
|
|
8877
9116
|
},
|
|
8878
9117
|
{
|
|
8879
9118
|
name: "asset_metas",
|
|
9119
|
+
docs: [
|
|
9120
|
+
"List of assets and their oracle configs supported by the protocol"
|
|
9121
|
+
],
|
|
8880
9122
|
type: {
|
|
8881
9123
|
vec: {
|
|
8882
9124
|
defined: {
|
|
@@ -10055,6 +10297,9 @@ var types$c = [
|
|
|
10055
10297
|
},
|
|
10056
10298
|
{
|
|
10057
10299
|
name: "Mint"
|
|
10300
|
+
},
|
|
10301
|
+
{
|
|
10302
|
+
name: "SingleAssetVault"
|
|
10058
10303
|
}
|
|
10059
10304
|
]
|
|
10060
10305
|
}
|
|
@@ -13629,6 +13874,9 @@ var types$b = [
|
|
|
13629
13874
|
},
|
|
13630
13875
|
{
|
|
13631
13876
|
name: "Mint"
|
|
13877
|
+
},
|
|
13878
|
+
{
|
|
13879
|
+
name: "SingleAssetVault"
|
|
13632
13880
|
}
|
|
13633
13881
|
]
|
|
13634
13882
|
}
|
|
@@ -17087,6 +17335,9 @@ var types$a = [
|
|
|
17087
17335
|
},
|
|
17088
17336
|
{
|
|
17089
17337
|
name: "Mint"
|
|
17338
|
+
},
|
|
17339
|
+
{
|
|
17340
|
+
name: "SingleAssetVault"
|
|
17090
17341
|
}
|
|
17091
17342
|
]
|
|
17092
17343
|
}
|
|
@@ -18784,6 +19035,9 @@ var types$9 = [
|
|
|
18784
19035
|
},
|
|
18785
19036
|
{
|
|
18786
19037
|
name: "Mint"
|
|
19038
|
+
},
|
|
19039
|
+
{
|
|
19040
|
+
name: "SingleAssetVault"
|
|
18787
19041
|
}
|
|
18788
19042
|
]
|
|
18789
19043
|
}
|
|
@@ -20380,6 +20634,9 @@ var types$8 = [
|
|
|
20380
20634
|
},
|
|
20381
20635
|
{
|
|
20382
20636
|
name: "Mint"
|
|
20637
|
+
},
|
|
20638
|
+
{
|
|
20639
|
+
name: "SingleAssetVault"
|
|
20383
20640
|
}
|
|
20384
20641
|
]
|
|
20385
20642
|
}
|
|
@@ -21621,6 +21878,9 @@ var types$7 = [
|
|
|
21621
21878
|
},
|
|
21622
21879
|
{
|
|
21623
21880
|
name: "Mint"
|
|
21881
|
+
},
|
|
21882
|
+
{
|
|
21883
|
+
name: "SingleAssetVault"
|
|
21624
21884
|
}
|
|
21625
21885
|
]
|
|
21626
21886
|
}
|
|
@@ -22664,7 +22924,7 @@ var ExtCctpIdlJson = {
|
|
|
22664
22924
|
var address$6 = "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz";
|
|
22665
22925
|
var metadata$6 = {
|
|
22666
22926
|
name: "glam_protocol",
|
|
22667
|
-
version: "1.0.
|
|
22927
|
+
version: "1.0.3",
|
|
22668
22928
|
spec: "0.1.0",
|
|
22669
22929
|
description: "Glam Protocol"
|
|
22670
22930
|
};
|
|
@@ -24510,6 +24770,9 @@ var types$6 = [
|
|
|
24510
24770
|
},
|
|
24511
24771
|
{
|
|
24512
24772
|
name: "Mint"
|
|
24773
|
+
},
|
|
24774
|
+
{
|
|
24775
|
+
name: "SingleAssetVault"
|
|
24513
24776
|
}
|
|
24514
24777
|
]
|
|
24515
24778
|
}
|
|
@@ -25776,7 +26039,7 @@ var GlamProtocolIdlJsonStaging = {
|
|
|
25776
26039
|
var address$5 = "gstgm1M39mhgnvgyScGUDRwNn5kNVSd97hTtyow1Et5";
|
|
25777
26040
|
var metadata$5 = {
|
|
25778
26041
|
name: "glam_mint",
|
|
25779
|
-
version: "1.0.
|
|
26042
|
+
version: "1.0.2",
|
|
25780
26043
|
spec: "0.1.0",
|
|
25781
26044
|
description: "GLAM mint program"
|
|
25782
26045
|
};
|
|
@@ -28592,6 +28855,167 @@ var instructions$5 = [
|
|
|
28592
28855
|
}
|
|
28593
28856
|
]
|
|
28594
28857
|
},
|
|
28858
|
+
{
|
|
28859
|
+
name: "price_single_asset_vault",
|
|
28860
|
+
docs: [
|
|
28861
|
+
"Prices a single asset vault."
|
|
28862
|
+
],
|
|
28863
|
+
discriminator: [
|
|
28864
|
+
93,
|
|
28865
|
+
213,
|
|
28866
|
+
219,
|
|
28867
|
+
25,
|
|
28868
|
+
38,
|
|
28869
|
+
74,
|
|
28870
|
+
9,
|
|
28871
|
+
167
|
|
28872
|
+
],
|
|
28873
|
+
accounts: [
|
|
28874
|
+
{
|
|
28875
|
+
name: "glam_state",
|
|
28876
|
+
writable: true
|
|
28877
|
+
},
|
|
28878
|
+
{
|
|
28879
|
+
name: "glam_vault",
|
|
28880
|
+
pda: {
|
|
28881
|
+
seeds: [
|
|
28882
|
+
{
|
|
28883
|
+
kind: "const",
|
|
28884
|
+
value: [
|
|
28885
|
+
118,
|
|
28886
|
+
97,
|
|
28887
|
+
117,
|
|
28888
|
+
108,
|
|
28889
|
+
116
|
|
28890
|
+
]
|
|
28891
|
+
},
|
|
28892
|
+
{
|
|
28893
|
+
kind: "account",
|
|
28894
|
+
path: "glam_state"
|
|
28895
|
+
}
|
|
28896
|
+
],
|
|
28897
|
+
program: {
|
|
28898
|
+
kind: "const",
|
|
28899
|
+
value: [
|
|
28900
|
+
10,
|
|
28901
|
+
55,
|
|
28902
|
+
49,
|
|
28903
|
+
193,
|
|
28904
|
+
142,
|
|
28905
|
+
247,
|
|
28906
|
+
75,
|
|
28907
|
+
193,
|
|
28908
|
+
33,
|
|
28909
|
+
61,
|
|
28910
|
+
5,
|
|
28911
|
+
218,
|
|
28912
|
+
254,
|
|
28913
|
+
219,
|
|
28914
|
+
143,
|
|
28915
|
+
206,
|
|
28916
|
+
156,
|
|
28917
|
+
138,
|
|
28918
|
+
14,
|
|
28919
|
+
32,
|
|
28920
|
+
89,
|
|
28921
|
+
232,
|
|
28922
|
+
248,
|
|
28923
|
+
173,
|
|
28924
|
+
46,
|
|
28925
|
+
77,
|
|
28926
|
+
46,
|
|
28927
|
+
206,
|
|
28928
|
+
189,
|
|
28929
|
+
171,
|
|
28930
|
+
68,
|
|
28931
|
+
237
|
|
28932
|
+
]
|
|
28933
|
+
}
|
|
28934
|
+
}
|
|
28935
|
+
},
|
|
28936
|
+
{
|
|
28937
|
+
name: "signer",
|
|
28938
|
+
writable: true,
|
|
28939
|
+
signer: true
|
|
28940
|
+
},
|
|
28941
|
+
{
|
|
28942
|
+
name: "base_asset_ata"
|
|
28943
|
+
},
|
|
28944
|
+
{
|
|
28945
|
+
name: "integration_authority",
|
|
28946
|
+
pda: {
|
|
28947
|
+
seeds: [
|
|
28948
|
+
{
|
|
28949
|
+
kind: "const",
|
|
28950
|
+
value: [
|
|
28951
|
+
105,
|
|
28952
|
+
110,
|
|
28953
|
+
116,
|
|
28954
|
+
101,
|
|
28955
|
+
103,
|
|
28956
|
+
114,
|
|
28957
|
+
97,
|
|
28958
|
+
116,
|
|
28959
|
+
105,
|
|
28960
|
+
111,
|
|
28961
|
+
110,
|
|
28962
|
+
45,
|
|
28963
|
+
97,
|
|
28964
|
+
117,
|
|
28965
|
+
116,
|
|
28966
|
+
104,
|
|
28967
|
+
111,
|
|
28968
|
+
114,
|
|
28969
|
+
105,
|
|
28970
|
+
116,
|
|
28971
|
+
121
|
|
28972
|
+
]
|
|
28973
|
+
}
|
|
28974
|
+
]
|
|
28975
|
+
}
|
|
28976
|
+
},
|
|
28977
|
+
{
|
|
28978
|
+
name: "glam_protocol",
|
|
28979
|
+
address: "gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"
|
|
28980
|
+
},
|
|
28981
|
+
{
|
|
28982
|
+
name: "event_authority",
|
|
28983
|
+
optional: true,
|
|
28984
|
+
pda: {
|
|
28985
|
+
seeds: [
|
|
28986
|
+
{
|
|
28987
|
+
kind: "const",
|
|
28988
|
+
value: [
|
|
28989
|
+
95,
|
|
28990
|
+
95,
|
|
28991
|
+
101,
|
|
28992
|
+
118,
|
|
28993
|
+
101,
|
|
28994
|
+
110,
|
|
28995
|
+
116,
|
|
28996
|
+
95,
|
|
28997
|
+
97,
|
|
28998
|
+
117,
|
|
28999
|
+
116,
|
|
29000
|
+
104,
|
|
29001
|
+
111,
|
|
29002
|
+
114,
|
|
29003
|
+
105,
|
|
29004
|
+
116,
|
|
29005
|
+
121
|
|
29006
|
+
]
|
|
29007
|
+
}
|
|
29008
|
+
]
|
|
29009
|
+
}
|
|
29010
|
+
},
|
|
29011
|
+
{
|
|
29012
|
+
name: "event_program",
|
|
29013
|
+
optional: true,
|
|
29014
|
+
address: "gstgm1M39mhgnvgyScGUDRwNn5kNVSd97hTtyow1Et5"
|
|
29015
|
+
}
|
|
29016
|
+
],
|
|
29017
|
+
args: []
|
|
29018
|
+
},
|
|
28595
29019
|
{
|
|
28596
29020
|
name: "price_stake_accounts",
|
|
28597
29021
|
discriminator: [
|
|
@@ -30404,6 +30828,9 @@ var types$5 = [
|
|
|
30404
30828
|
},
|
|
30405
30829
|
{
|
|
30406
30830
|
name: "Mint"
|
|
30831
|
+
},
|
|
30832
|
+
{
|
|
30833
|
+
name: "SingleAssetVault"
|
|
30407
30834
|
}
|
|
30408
30835
|
]
|
|
30409
30836
|
}
|
|
@@ -30479,7 +30906,7 @@ var types$5 = [
|
|
|
30479
30906
|
},
|
|
30480
30907
|
{
|
|
30481
30908
|
name: "priority",
|
|
30482
|
-
type: "
|
|
30909
|
+
type: "i8"
|
|
30483
30910
|
},
|
|
30484
30911
|
{
|
|
30485
30912
|
name: "padding",
|
|
@@ -30974,18 +31401,30 @@ var types$5 = [
|
|
|
30974
31401
|
},
|
|
30975
31402
|
{
|
|
30976
31403
|
name: "referrer",
|
|
31404
|
+
docs: [
|
|
31405
|
+
"Default GLAM referrer"
|
|
31406
|
+
],
|
|
30977
31407
|
type: "pubkey"
|
|
30978
31408
|
},
|
|
30979
31409
|
{
|
|
30980
31410
|
name: "base_fee_bps",
|
|
31411
|
+
docs: [
|
|
31412
|
+
"Default protocol base fee applied to all vaults"
|
|
31413
|
+
],
|
|
30981
31414
|
type: "u16"
|
|
30982
31415
|
},
|
|
30983
31416
|
{
|
|
30984
31417
|
name: "flow_fee_bps",
|
|
31418
|
+
docs: [
|
|
31419
|
+
"Default protocol flow fee applied to all vaults"
|
|
31420
|
+
],
|
|
30985
31421
|
type: "u16"
|
|
30986
31422
|
},
|
|
30987
31423
|
{
|
|
30988
31424
|
name: "asset_metas",
|
|
31425
|
+
docs: [
|
|
31426
|
+
"List of assets and their oracle configs supported by the protocol"
|
|
31427
|
+
],
|
|
30989
31428
|
type: {
|
|
30990
31429
|
vec: {
|
|
30991
31430
|
defined: {
|
|
@@ -32164,6 +32603,9 @@ var types$4 = [
|
|
|
32164
32603
|
},
|
|
32165
32604
|
{
|
|
32166
32605
|
name: "Mint"
|
|
32606
|
+
},
|
|
32607
|
+
{
|
|
32608
|
+
name: "SingleAssetVault"
|
|
32167
32609
|
}
|
|
32168
32610
|
]
|
|
32169
32611
|
}
|
|
@@ -35738,6 +36180,9 @@ var types$3 = [
|
|
|
35738
36180
|
},
|
|
35739
36181
|
{
|
|
35740
36182
|
name: "Mint"
|
|
36183
|
+
},
|
|
36184
|
+
{
|
|
36185
|
+
name: "SingleAssetVault"
|
|
35741
36186
|
}
|
|
35742
36187
|
]
|
|
35743
36188
|
}
|
|
@@ -39196,6 +39641,9 @@ var types$2 = [
|
|
|
39196
39641
|
},
|
|
39197
39642
|
{
|
|
39198
39643
|
name: "Mint"
|
|
39644
|
+
},
|
|
39645
|
+
{
|
|
39646
|
+
name: "SingleAssetVault"
|
|
39199
39647
|
}
|
|
39200
39648
|
]
|
|
39201
39649
|
}
|
|
@@ -40892,6 +41340,9 @@ var types$1 = [
|
|
|
40892
41340
|
},
|
|
40893
41341
|
{
|
|
40894
41342
|
name: "Mint"
|
|
41343
|
+
},
|
|
41344
|
+
{
|
|
41345
|
+
name: "SingleAssetVault"
|
|
40895
41346
|
}
|
|
40896
41347
|
]
|
|
40897
41348
|
}
|
|
@@ -45414,13 +45865,12 @@ const JUPITER_SWAP_ERRORS = {
|
|
|
45414
45865
|
*/ function parseProgramLogs(logs) {
|
|
45415
45866
|
// "Error Message:" indicates an anchor program error
|
|
45416
45867
|
// Other messages are manually sourced & handled
|
|
45417
|
-
const errorMsgLog = (logs || []).find((log)=>log.includes("Error Message:") || log.includes("Error: insufficient funds"));
|
|
45868
|
+
const errorMsgLog = (logs || []).find((log)=>log.includes("Error Message:") || log.includes("Error: insufficient funds") || log.includes("Transfer: insufficient lamports"));
|
|
45418
45869
|
if (errorMsgLog) {
|
|
45419
45870
|
if (errorMsgLog.includes("Error Message:")) {
|
|
45420
45871
|
return errorMsgLog.split("Error Message:")[1].trim();
|
|
45421
|
-
} else {
|
|
45422
|
-
return "Insufficient funds";
|
|
45423
45872
|
}
|
|
45873
|
+
return errorMsgLog;
|
|
45424
45874
|
}
|
|
45425
45875
|
// Match the following pattern to find Jupiter error code in logs
|
|
45426
45876
|
// "Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 failed: custom program error: 0x1788"
|
|
@@ -46392,7 +46842,7 @@ class JupiterApiClient {
|
|
|
46392
46842
|
return new Date(createdAt * 1000).toISOString().split("T")[0] || "Unknown";
|
|
46393
46843
|
}
|
|
46394
46844
|
get sparkleKey() {
|
|
46395
|
-
const pubkey = (this.mint
|
|
46845
|
+
const pubkey = (this.mint && !this.mint.equals(PublicKey.default) ? this.mint : this.vault) || PublicKey.default;
|
|
46396
46846
|
return pubkey.toBase58();
|
|
46397
46847
|
}
|
|
46398
46848
|
get baseAssetTokenProgramId() {
|
|
@@ -46550,6 +47000,9 @@ class StateAccountType {
|
|
|
46550
47000
|
if (s === "tokenizedVault") {
|
|
46551
47001
|
return StateAccountType.TOKENIZED_VAULT;
|
|
46552
47002
|
}
|
|
47003
|
+
if (s === "singleAssetVault") {
|
|
47004
|
+
return StateAccountType.SINGLE_ASSET_VAULT;
|
|
47005
|
+
}
|
|
46553
47006
|
if (s === "mint") {
|
|
46554
47007
|
return StateAccountType.MINT;
|
|
46555
47008
|
}
|
|
@@ -46565,6 +47018,9 @@ StateAccountType.TOKENIZED_VAULT = {
|
|
|
46565
47018
|
StateAccountType.MINT = {
|
|
46566
47019
|
mint: {}
|
|
46567
47020
|
};
|
|
47021
|
+
StateAccountType.SINGLE_ASSET_VAULT = {
|
|
47022
|
+
singleAssetVault: {}
|
|
47023
|
+
};
|
|
46568
47024
|
|
|
46569
47025
|
class IntegrationPermissions {
|
|
46570
47026
|
constructor(obj){
|
|
@@ -52364,6 +52820,16 @@ class PriceClient {
|
|
|
52364
52820
|
async priceVaultIxs() {
|
|
52365
52821
|
// Cache state model
|
|
52366
52822
|
this.cachedStateModel = await this.base.fetchStateModel();
|
|
52823
|
+
if (StateAccountType.equals(this.cachedStateModel.accountType, StateAccountType.SINGLE_ASSET_VAULT)) {
|
|
52824
|
+
const baseAssetAta = this.base.getVaultAta(this.cachedStateModel.baseAssetMint, this.cachedStateModel.baseAssetTokenProgramId);
|
|
52825
|
+
const ix = await this.base.mintProgram.methods.priceSingleAssetVault().accounts({
|
|
52826
|
+
glamState: this.base.statePda,
|
|
52827
|
+
baseAssetAta
|
|
52828
|
+
}).instruction();
|
|
52829
|
+
return [
|
|
52830
|
+
ix
|
|
52831
|
+
];
|
|
52832
|
+
}
|
|
52367
52833
|
const priceVaultIx = await this.priceVaultTokensIx();
|
|
52368
52834
|
// If there are no external assets, we don't need to price DeFi positions
|
|
52369
52835
|
if ((this.cachedStateModel.externalPositions || []).length === 0) {
|
|
@@ -52828,6 +53294,10 @@ let TxBuilder$5 = class TxBuilder extends BaseTxBuilder {
|
|
|
52828
53294
|
const mintProgram = this.client.base.mintProgram;
|
|
52829
53295
|
const mintPda = getMintPda(glamState, 0, mintProgram.programId);
|
|
52830
53296
|
const extraMetasPda = getExtraMetasPda(mintPda);
|
|
53297
|
+
// Use glam hosted metadata as a fallback if uri is not provided
|
|
53298
|
+
if (!initMintParams.uri) {
|
|
53299
|
+
initMintParams.uri = `https://static.glam.systems/v0/token/metadata?key=${mintPda}`;
|
|
53300
|
+
}
|
|
52831
53301
|
const ix = await mintProgram.methods.initializeMint(new MintIdlModel(initMintParams), stateInitKey, initMintParams.accountType, decimals).accounts({
|
|
52832
53302
|
glamState,
|
|
52833
53303
|
signer: glamSigner,
|
|
@@ -53706,13 +54176,13 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53706
54176
|
/**
|
|
53707
54177
|
* Returns a transaction that calls CCTP's `depositForBurn` instruction that bridges USDC to another chain.
|
|
53708
54178
|
* A keypair is generated for the message sent event account, which must be included as a transaction signer.
|
|
53709
|
-
*/ async bridgeUsdcIx(amount, domain,
|
|
54179
|
+
*/ async bridgeUsdcIx(amount, domain, destinationAddress, params, glamSigner) {
|
|
53710
54180
|
const usdcAddress = this.client.base.isMainnet ? USDC : USDC_DEVNET;
|
|
53711
54181
|
const pdas = this.client.getDepositForBurnPdas(MESSAGE_TRANSMITTER_V2, TOKEN_MESSENGER_MINTER_V2, usdcAddress, domain);
|
|
53712
54182
|
const depositForBurnParams = {
|
|
53713
54183
|
amount,
|
|
53714
54184
|
destinationDomain: domain,
|
|
53715
|
-
mintRecipient:
|
|
54185
|
+
mintRecipient: destinationAddress,
|
|
53716
54186
|
destinationCaller: params.destinationCaller || PublicKey.default,
|
|
53717
54187
|
...params
|
|
53718
54188
|
};
|
|
@@ -53721,12 +54191,12 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53721
54191
|
this.client.base.vaultPda.toBuffer()
|
|
53722
54192
|
], TOKEN_MESSENGER_MINTER_V2)[0];
|
|
53723
54193
|
const messageSentEventAccountKeypair = Keypair.generate();
|
|
53724
|
-
const
|
|
54194
|
+
const senderUsdcAta = this.client.base.getVaultAta(usdcAddress);
|
|
53725
54195
|
const ix = await this.client.base.extCctpProgram.methods.depositForBurn(depositForBurnParams).accounts({
|
|
53726
54196
|
glamState: this.client.base.statePda,
|
|
53727
54197
|
glamSigner,
|
|
53728
54198
|
senderAuthorityPda: pdas.authorityPda,
|
|
53729
|
-
burnTokenAccount,
|
|
54199
|
+
burnTokenAccount: senderUsdcAta,
|
|
53730
54200
|
denylistAccount,
|
|
53731
54201
|
messageTransmitter: pdas.messageTransmitterAccount,
|
|
53732
54202
|
tokenMessenger: pdas.tokenMessengerAccount,
|
|
@@ -53742,9 +54212,9 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53742
54212
|
messageSentEventAccountKeypair
|
|
53743
54213
|
];
|
|
53744
54214
|
}
|
|
53745
|
-
async bridgeUsdcTx(amount, domain,
|
|
54215
|
+
async bridgeUsdcTx(amount, domain, destinationAddress, params, txOptions) {
|
|
53746
54216
|
const signer = txOptions.signer || this.client.base.signer;
|
|
53747
|
-
const [ix, messageSentEventAccountKeypair] = await this.bridgeUsdcIx(amount, domain,
|
|
54217
|
+
const [ix, messageSentEventAccountKeypair] = await this.bridgeUsdcIx(amount, domain, destinationAddress, params, signer);
|
|
53748
54218
|
const tx = await this.buildVersionedTx([
|
|
53749
54219
|
ix
|
|
53750
54220
|
], txOptions);
|
|
@@ -53761,6 +54231,7 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53761
54231
|
if (!decodedMessage || !decodedMessage?.decodedMessageBody || !decodedMessage?.decodedMessageBody?.burnToken) {
|
|
53762
54232
|
throw new Error("Invalid message object: missing burnToken in decodedMessage");
|
|
53763
54233
|
}
|
|
54234
|
+
const recipientUsdcAta = this.client.base.getVaultAta(USDC);
|
|
53764
54235
|
// message, attestation, eventNonce, burnToken are hex strings
|
|
53765
54236
|
const pdas = await this.client.getReceiveMessagePdas(MESSAGE_TRANSMITTER_V2, TOKEN_MESSENGER_MINTER_V2, USDC, decodedMessage.decodedMessageBody.burnToken, sourceDomain.toString(), eventNonce);
|
|
53766
54237
|
// raw ix data: [discriminator][message][attestation]
|
|
@@ -53847,7 +54318,7 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53847
54318
|
{
|
|
53848
54319
|
isSigner: false,
|
|
53849
54320
|
isWritable: true,
|
|
53850
|
-
pubkey:
|
|
54321
|
+
pubkey: recipientUsdcAta
|
|
53851
54322
|
},
|
|
53852
54323
|
{
|
|
53853
54324
|
isSigner: false,
|
|
@@ -53895,7 +54366,9 @@ let TxBuilder = class TxBuilder extends BaseTxBuilder {
|
|
|
53895
54366
|
const ix = await this.receiveMessageIx(sourceDomain, message);
|
|
53896
54367
|
receiveMessageIxs.push(ix);
|
|
53897
54368
|
}
|
|
53898
|
-
const
|
|
54369
|
+
const recipientWallet = this.client.base.vaultPda;
|
|
54370
|
+
const recipientUsdcAta = this.client.base.getVaultAta(USDC);
|
|
54371
|
+
const createUsdcAtaIx = createAssociatedTokenAccountIdempotentInstruction(this.client.base.signer, recipientUsdcAta, recipientWallet, USDC);
|
|
53899
54372
|
return await this.buildVersionedTx([
|
|
53900
54373
|
createUsdcAtaIx,
|
|
53901
54374
|
...receiveMessageIxs
|
|
@@ -53908,11 +54381,11 @@ class CctpClient {
|
|
|
53908
54381
|
*
|
|
53909
54382
|
* @param amount Amount of USDC to bridge (in smallest units)
|
|
53910
54383
|
* @param domain Destination domain (e.g., 0 for Ethereum, 1 for Avalanche)
|
|
53911
|
-
* @param
|
|
54384
|
+
* @param destinationAddress Destination address on target chain (EVM address as PublicKey)
|
|
53912
54385
|
* @param params Additional parameters (maxFee, minFinalityThreshold)
|
|
53913
54386
|
* @param txOptions Transaction options
|
|
53914
|
-
*/ async bridgeUsdc(amount, domain,
|
|
53915
|
-
const [tx, keypair] = await this.txBuilder.bridgeUsdcTx(new BN(amount), domain,
|
|
54387
|
+
*/ async bridgeUsdc(amount, domain, destinationAddress, params, txOptions = {}) {
|
|
54388
|
+
const [tx, keypair] = await this.txBuilder.bridgeUsdcTx(new BN(amount), domain, destinationAddress, params, txOptions);
|
|
53916
54389
|
return await this.base.sendAndConfirm(tx, [
|
|
53917
54390
|
keypair
|
|
53918
54391
|
]);
|
|
@@ -54031,10 +54504,10 @@ class CctpClient {
|
|
|
54031
54504
|
};
|
|
54032
54505
|
}
|
|
54033
54506
|
/**
|
|
54034
|
-
* Find all message accounts onchain for a given sender
|
|
54507
|
+
* Find all message accounts onchain for a given sender wallet
|
|
54035
54508
|
*
|
|
54036
54509
|
* TODO: filter by burned token mint
|
|
54037
|
-
*/ async findV2Messages(
|
|
54510
|
+
*/ async findV2Messages(senderWallet, options) {
|
|
54038
54511
|
const accounts = await getProgramAccounts(this.base.connection, MESSAGE_TRANSMITTER_V2, {
|
|
54039
54512
|
...options.commitment ? {
|
|
54040
54513
|
commitment: options.commitment
|
|
@@ -54046,7 +54519,7 @@ class CctpClient {
|
|
|
54046
54519
|
{
|
|
54047
54520
|
memcmp: {
|
|
54048
54521
|
offset: 300,
|
|
54049
|
-
bytes:
|
|
54522
|
+
bytes: senderWallet.toBase58()
|
|
54050
54523
|
}
|
|
54051
54524
|
}
|
|
54052
54525
|
]
|