@glamsystems/glam-sdk 1.0.14-alpha.1 → 1.0.14-alpha.3
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 +634 -537
- package/index.esm.js +634 -537
- package/package.json +1 -1
- package/src/client/bridge.d.ts +45 -44
- package/src/client/price.d.ts +3 -1
- package/src/models/state.d.ts +2 -0
- package/target/types/ext_bridge.d.ts +428 -441
package/index.esm.js
CHANGED
|
@@ -18818,37 +18818,6 @@ var instructions$8 = [
|
|
|
18818
18818
|
}
|
|
18819
18819
|
]
|
|
18820
18820
|
},
|
|
18821
|
-
{
|
|
18822
|
-
name: "cleanup_transfer_record",
|
|
18823
|
-
docs: [
|
|
18824
|
-
"Closes a finalized transfer record and returns its rent."
|
|
18825
|
-
],
|
|
18826
|
-
discriminator: [
|
|
18827
|
-
65,
|
|
18828
|
-
224,
|
|
18829
|
-
219,
|
|
18830
|
-
143,
|
|
18831
|
-
99,
|
|
18832
|
-
204,
|
|
18833
|
-
215,
|
|
18834
|
-
6
|
|
18835
|
-
],
|
|
18836
|
-
accounts: [
|
|
18837
|
-
{
|
|
18838
|
-
name: "glam_state"
|
|
18839
|
-
},
|
|
18840
|
-
{
|
|
18841
|
-
name: "glam_signer",
|
|
18842
|
-
writable: true,
|
|
18843
|
-
signer: true
|
|
18844
|
-
},
|
|
18845
|
-
{
|
|
18846
|
-
name: "transfer_record",
|
|
18847
|
-
writable: true
|
|
18848
|
-
}
|
|
18849
|
-
],
|
|
18850
|
-
args: []
|
|
18851
|
-
},
|
|
18852
18821
|
{
|
|
18853
18822
|
name: "commit_oft_transfer",
|
|
18854
18823
|
docs: [
|
|
@@ -18871,6 +18840,7 @@ var instructions$8 = [
|
|
|
18871
18840
|
},
|
|
18872
18841
|
{
|
|
18873
18842
|
name: "glam_vault",
|
|
18843
|
+
writable: true,
|
|
18874
18844
|
pda: {
|
|
18875
18845
|
seeds: [
|
|
18876
18846
|
{
|
|
@@ -18899,39 +18869,6 @@ var instructions$8 = [
|
|
|
18899
18869
|
writable: true,
|
|
18900
18870
|
signer: true
|
|
18901
18871
|
},
|
|
18902
|
-
{
|
|
18903
|
-
name: "integration_authority",
|
|
18904
|
-
pda: {
|
|
18905
|
-
seeds: [
|
|
18906
|
-
{
|
|
18907
|
-
kind: "const",
|
|
18908
|
-
value: [
|
|
18909
|
-
105,
|
|
18910
|
-
110,
|
|
18911
|
-
116,
|
|
18912
|
-
101,
|
|
18913
|
-
103,
|
|
18914
|
-
114,
|
|
18915
|
-
97,
|
|
18916
|
-
116,
|
|
18917
|
-
105,
|
|
18918
|
-
111,
|
|
18919
|
-
110,
|
|
18920
|
-
45,
|
|
18921
|
-
97,
|
|
18922
|
-
117,
|
|
18923
|
-
116,
|
|
18924
|
-
104,
|
|
18925
|
-
111,
|
|
18926
|
-
114,
|
|
18927
|
-
105,
|
|
18928
|
-
116,
|
|
18929
|
-
121
|
|
18930
|
-
]
|
|
18931
|
-
}
|
|
18932
|
-
]
|
|
18933
|
-
}
|
|
18934
|
-
},
|
|
18935
18872
|
{
|
|
18936
18873
|
name: "cpi_program"
|
|
18937
18874
|
},
|
|
@@ -18939,10 +18876,6 @@ var instructions$8 = [
|
|
|
18939
18876
|
name: "glam_protocol_program",
|
|
18940
18877
|
address: "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
|
|
18941
18878
|
},
|
|
18942
|
-
{
|
|
18943
|
-
name: "system_program",
|
|
18944
|
-
address: "11111111111111111111111111111111"
|
|
18945
|
-
},
|
|
18946
18879
|
{
|
|
18947
18880
|
name: "instructions",
|
|
18948
18881
|
address: "Sysvar1nstructions1111111111111111111111111"
|
|
@@ -19015,58 +18948,52 @@ var instructions$8 = [
|
|
|
19015
18948
|
}
|
|
19016
18949
|
},
|
|
19017
18950
|
{
|
|
19018
|
-
name: "
|
|
19019
|
-
writable: true
|
|
18951
|
+
name: "source_token_account",
|
|
18952
|
+
writable: true
|
|
18953
|
+
},
|
|
18954
|
+
{
|
|
18955
|
+
name: "source_mint"
|
|
18956
|
+
},
|
|
18957
|
+
{
|
|
18958
|
+
name: "auxiliary_token_account",
|
|
18959
|
+
writable: true
|
|
18960
|
+
},
|
|
18961
|
+
{
|
|
18962
|
+
name: "integration_authority",
|
|
19020
18963
|
pda: {
|
|
19021
18964
|
seeds: [
|
|
19022
18965
|
{
|
|
19023
18966
|
kind: "const",
|
|
19024
18967
|
value: [
|
|
19025
|
-
98,
|
|
19026
|
-
114,
|
|
19027
18968
|
105,
|
|
19028
|
-
|
|
19029
|
-
103,
|
|
19030
|
-
101,
|
|
19031
|
-
45,
|
|
18969
|
+
110,
|
|
19032
18970
|
116,
|
|
18971
|
+
101,
|
|
18972
|
+
103,
|
|
19033
18973
|
114,
|
|
19034
18974
|
97,
|
|
18975
|
+
116,
|
|
18976
|
+
105,
|
|
18977
|
+
111,
|
|
19035
18978
|
110,
|
|
19036
|
-
115,
|
|
19037
|
-
102,
|
|
19038
|
-
101,
|
|
19039
|
-
114,
|
|
19040
18979
|
45,
|
|
19041
|
-
|
|
19042
|
-
|
|
19043
|
-
|
|
18980
|
+
97,
|
|
18981
|
+
117,
|
|
18982
|
+
116,
|
|
18983
|
+
104,
|
|
19044
18984
|
111,
|
|
19045
18985
|
114,
|
|
19046
|
-
|
|
18986
|
+
105,
|
|
18987
|
+
116,
|
|
18988
|
+
121
|
|
19047
18989
|
]
|
|
19048
|
-
},
|
|
19049
|
-
{
|
|
19050
|
-
kind: "account",
|
|
19051
|
-
path: "glam_state"
|
|
19052
|
-
},
|
|
19053
|
-
{
|
|
19054
|
-
kind: "arg",
|
|
19055
|
-
path: "args.transfer_id"
|
|
19056
18990
|
}
|
|
19057
18991
|
]
|
|
19058
18992
|
}
|
|
19059
18993
|
},
|
|
19060
18994
|
{
|
|
19061
|
-
name: "
|
|
19062
|
-
|
|
19063
|
-
},
|
|
19064
|
-
{
|
|
19065
|
-
name: "source_mint"
|
|
19066
|
-
},
|
|
19067
|
-
{
|
|
19068
|
-
name: "auxiliary_token_account",
|
|
19069
|
-
writable: true
|
|
18995
|
+
name: "system_program",
|
|
18996
|
+
address: "11111111111111111111111111111111"
|
|
19070
18997
|
}
|
|
19071
18998
|
],
|
|
19072
18999
|
args: [
|
|
@@ -19118,140 +19045,6 @@ var instructions$8 = [
|
|
|
19118
19045
|
}
|
|
19119
19046
|
]
|
|
19120
19047
|
},
|
|
19121
|
-
{
|
|
19122
|
-
name: "fail_or_cancel_managed_transfer",
|
|
19123
|
-
docs: [
|
|
19124
|
-
"Marks a managed inflight transfer as failed or cancelled."
|
|
19125
|
-
],
|
|
19126
|
-
discriminator: [
|
|
19127
|
-
39,
|
|
19128
|
-
37,
|
|
19129
|
-
213,
|
|
19130
|
-
118,
|
|
19131
|
-
191,
|
|
19132
|
-
18,
|
|
19133
|
-
194,
|
|
19134
|
-
119
|
|
19135
|
-
],
|
|
19136
|
-
accounts: [
|
|
19137
|
-
{
|
|
19138
|
-
name: "glam_state",
|
|
19139
|
-
writable: true
|
|
19140
|
-
},
|
|
19141
|
-
{
|
|
19142
|
-
name: "glam_vault",
|
|
19143
|
-
pda: {
|
|
19144
|
-
seeds: [
|
|
19145
|
-
{
|
|
19146
|
-
kind: "const",
|
|
19147
|
-
value: [
|
|
19148
|
-
118,
|
|
19149
|
-
97,
|
|
19150
|
-
117,
|
|
19151
|
-
108,
|
|
19152
|
-
116
|
|
19153
|
-
]
|
|
19154
|
-
},
|
|
19155
|
-
{
|
|
19156
|
-
kind: "account",
|
|
19157
|
-
path: "glam_state"
|
|
19158
|
-
}
|
|
19159
|
-
],
|
|
19160
|
-
program: {
|
|
19161
|
-
kind: "account",
|
|
19162
|
-
path: "glam_protocol_program"
|
|
19163
|
-
}
|
|
19164
|
-
}
|
|
19165
|
-
},
|
|
19166
|
-
{
|
|
19167
|
-
name: "glam_signer",
|
|
19168
|
-
signer: true
|
|
19169
|
-
},
|
|
19170
|
-
{
|
|
19171
|
-
name: "integration_authority",
|
|
19172
|
-
pda: {
|
|
19173
|
-
seeds: [
|
|
19174
|
-
{
|
|
19175
|
-
kind: "const",
|
|
19176
|
-
value: [
|
|
19177
|
-
105,
|
|
19178
|
-
110,
|
|
19179
|
-
116,
|
|
19180
|
-
101,
|
|
19181
|
-
103,
|
|
19182
|
-
114,
|
|
19183
|
-
97,
|
|
19184
|
-
116,
|
|
19185
|
-
105,
|
|
19186
|
-
111,
|
|
19187
|
-
110,
|
|
19188
|
-
45,
|
|
19189
|
-
97,
|
|
19190
|
-
117,
|
|
19191
|
-
116,
|
|
19192
|
-
104,
|
|
19193
|
-
111,
|
|
19194
|
-
114,
|
|
19195
|
-
105,
|
|
19196
|
-
116,
|
|
19197
|
-
121
|
|
19198
|
-
]
|
|
19199
|
-
}
|
|
19200
|
-
]
|
|
19201
|
-
}
|
|
19202
|
-
},
|
|
19203
|
-
{
|
|
19204
|
-
name: "glam_protocol_program",
|
|
19205
|
-
address: "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
|
|
19206
|
-
},
|
|
19207
|
-
{
|
|
19208
|
-
name: "system_program",
|
|
19209
|
-
address: "11111111111111111111111111111111"
|
|
19210
|
-
},
|
|
19211
|
-
{
|
|
19212
|
-
name: "bridge_registry",
|
|
19213
|
-
writable: true,
|
|
19214
|
-
pda: {
|
|
19215
|
-
seeds: [
|
|
19216
|
-
{
|
|
19217
|
-
kind: "const",
|
|
19218
|
-
value: [
|
|
19219
|
-
98,
|
|
19220
|
-
114,
|
|
19221
|
-
105,
|
|
19222
|
-
100,
|
|
19223
|
-
103,
|
|
19224
|
-
101,
|
|
19225
|
-
45,
|
|
19226
|
-
114,
|
|
19227
|
-
101,
|
|
19228
|
-
103,
|
|
19229
|
-
105,
|
|
19230
|
-
115,
|
|
19231
|
-
116,
|
|
19232
|
-
114,
|
|
19233
|
-
121
|
|
19234
|
-
]
|
|
19235
|
-
},
|
|
19236
|
-
{
|
|
19237
|
-
kind: "account",
|
|
19238
|
-
path: "glam_state"
|
|
19239
|
-
}
|
|
19240
|
-
]
|
|
19241
|
-
}
|
|
19242
|
-
},
|
|
19243
|
-
{
|
|
19244
|
-
name: "transfer_record",
|
|
19245
|
-
writable: true
|
|
19246
|
-
}
|
|
19247
|
-
],
|
|
19248
|
-
args: [
|
|
19249
|
-
{
|
|
19250
|
-
name: "failure_reason",
|
|
19251
|
-
type: "u8"
|
|
19252
|
-
}
|
|
19253
|
-
]
|
|
19254
|
-
},
|
|
19255
19048
|
{
|
|
19256
19049
|
name: "prepare_oft_transfer",
|
|
19257
19050
|
docs: [
|
|
@@ -19442,19 +19235,19 @@ var instructions$8 = [
|
|
|
19442
19235
|
]
|
|
19443
19236
|
},
|
|
19444
19237
|
{
|
|
19445
|
-
name: "
|
|
19238
|
+
name: "price_managed_transfers",
|
|
19446
19239
|
docs: [
|
|
19447
|
-
"
|
|
19240
|
+
"Prices managed inflight transfers and publishes aggregated amount."
|
|
19448
19241
|
],
|
|
19449
19242
|
discriminator: [
|
|
19450
|
-
|
|
19451
|
-
|
|
19452
|
-
|
|
19453
|
-
|
|
19454
|
-
|
|
19455
|
-
|
|
19456
|
-
|
|
19457
|
-
|
|
19243
|
+
77,
|
|
19244
|
+
76,
|
|
19245
|
+
20,
|
|
19246
|
+
48,
|
|
19247
|
+
41,
|
|
19248
|
+
168,
|
|
19249
|
+
205,
|
|
19250
|
+
81
|
|
19458
19251
|
],
|
|
19459
19252
|
accounts: [
|
|
19460
19253
|
{
|
|
@@ -19462,35 +19255,36 @@ var instructions$8 = [
|
|
|
19462
19255
|
writable: true
|
|
19463
19256
|
},
|
|
19464
19257
|
{
|
|
19465
|
-
name: "
|
|
19466
|
-
writable: true,
|
|
19258
|
+
name: "bridge_registry",
|
|
19467
19259
|
pda: {
|
|
19468
19260
|
seeds: [
|
|
19469
19261
|
{
|
|
19470
19262
|
kind: "const",
|
|
19471
19263
|
value: [
|
|
19472
|
-
|
|
19473
|
-
|
|
19474
|
-
|
|
19475
|
-
|
|
19476
|
-
|
|
19264
|
+
98,
|
|
19265
|
+
114,
|
|
19266
|
+
105,
|
|
19267
|
+
100,
|
|
19268
|
+
103,
|
|
19269
|
+
101,
|
|
19270
|
+
45,
|
|
19271
|
+
114,
|
|
19272
|
+
101,
|
|
19273
|
+
103,
|
|
19274
|
+
105,
|
|
19275
|
+
115,
|
|
19276
|
+
116,
|
|
19277
|
+
114,
|
|
19278
|
+
121
|
|
19477
19279
|
]
|
|
19478
19280
|
},
|
|
19479
19281
|
{
|
|
19480
19282
|
kind: "account",
|
|
19481
19283
|
path: "glam_state"
|
|
19482
19284
|
}
|
|
19483
|
-
]
|
|
19484
|
-
program: {
|
|
19485
|
-
kind: "account",
|
|
19486
|
-
path: "glam_protocol_program"
|
|
19487
|
-
}
|
|
19285
|
+
]
|
|
19488
19286
|
}
|
|
19489
19287
|
},
|
|
19490
|
-
{
|
|
19491
|
-
name: "glam_signer",
|
|
19492
|
-
signer: true
|
|
19493
|
-
},
|
|
19494
19288
|
{
|
|
19495
19289
|
name: "integration_authority",
|
|
19496
19290
|
pda: {
|
|
@@ -19529,44 +19323,69 @@ var instructions$8 = [
|
|
|
19529
19323
|
address: "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
|
|
19530
19324
|
},
|
|
19531
19325
|
{
|
|
19532
|
-
name: "
|
|
19533
|
-
address: "11111111111111111111111111111111"
|
|
19534
|
-
},
|
|
19535
|
-
{
|
|
19536
|
-
name: "bridge_registry",
|
|
19537
|
-
writable: true,
|
|
19326
|
+
name: "glam_config",
|
|
19538
19327
|
pda: {
|
|
19539
19328
|
seeds: [
|
|
19540
19329
|
{
|
|
19541
19330
|
kind: "const",
|
|
19542
19331
|
value: [
|
|
19543
|
-
98,
|
|
19544
|
-
114,
|
|
19545
|
-
105,
|
|
19546
|
-
100,
|
|
19547
19332
|
103,
|
|
19548
|
-
|
|
19333
|
+
108,
|
|
19334
|
+
111,
|
|
19335
|
+
98,
|
|
19336
|
+
97,
|
|
19337
|
+
108,
|
|
19549
19338
|
45,
|
|
19550
|
-
|
|
19551
|
-
|
|
19552
|
-
|
|
19339
|
+
99,
|
|
19340
|
+
111,
|
|
19341
|
+
110,
|
|
19342
|
+
102,
|
|
19553
19343
|
105,
|
|
19554
|
-
|
|
19555
|
-
116,
|
|
19556
|
-
114,
|
|
19557
|
-
121
|
|
19344
|
+
103
|
|
19558
19345
|
]
|
|
19559
|
-
},
|
|
19560
|
-
{
|
|
19561
|
-
kind: "account",
|
|
19562
|
-
path: "glam_state"
|
|
19563
19346
|
}
|
|
19564
|
-
]
|
|
19347
|
+
],
|
|
19348
|
+
program: {
|
|
19349
|
+
kind: "const",
|
|
19350
|
+
value: [
|
|
19351
|
+
10,
|
|
19352
|
+
11,
|
|
19353
|
+
0,
|
|
19354
|
+
83,
|
|
19355
|
+
72,
|
|
19356
|
+
16,
|
|
19357
|
+
46,
|
|
19358
|
+
144,
|
|
19359
|
+
46,
|
|
19360
|
+
42,
|
|
19361
|
+
79,
|
|
19362
|
+
22,
|
|
19363
|
+
157,
|
|
19364
|
+
123,
|
|
19365
|
+
21,
|
|
19366
|
+
242,
|
|
19367
|
+
192,
|
|
19368
|
+
146,
|
|
19369
|
+
1,
|
|
19370
|
+
78,
|
|
19371
|
+
88,
|
|
19372
|
+
59,
|
|
19373
|
+
102,
|
|
19374
|
+
9,
|
|
19375
|
+
190,
|
|
19376
|
+
226,
|
|
19377
|
+
92,
|
|
19378
|
+
189,
|
|
19379
|
+
187,
|
|
19380
|
+
232,
|
|
19381
|
+
83,
|
|
19382
|
+
220
|
|
19383
|
+
]
|
|
19384
|
+
}
|
|
19565
19385
|
}
|
|
19566
19386
|
},
|
|
19567
19387
|
{
|
|
19568
|
-
name: "
|
|
19569
|
-
writable: true
|
|
19388
|
+
name: "base_asset_oracle"
|
|
19570
19389
|
}
|
|
19571
19390
|
],
|
|
19572
19391
|
args: []
|
|
@@ -19574,7 +19393,7 @@ var instructions$8 = [
|
|
|
19574
19393
|
{
|
|
19575
19394
|
name: "settle_managed_transfer",
|
|
19576
19395
|
docs: [
|
|
19577
|
-
"
|
|
19396
|
+
"Settles a managed inflight transfer and removes it from the registry."
|
|
19578
19397
|
],
|
|
19579
19398
|
discriminator: [
|
|
19580
19399
|
197,
|
|
@@ -19588,18 +19407,124 @@ var instructions$8 = [
|
|
|
19588
19407
|
],
|
|
19589
19408
|
accounts: [
|
|
19590
19409
|
{
|
|
19591
|
-
name: "glam_state"
|
|
19410
|
+
name: "glam_state",
|
|
19411
|
+
writable: true
|
|
19412
|
+
},
|
|
19413
|
+
{
|
|
19414
|
+
name: "glam_vault",
|
|
19415
|
+
writable: true,
|
|
19416
|
+
pda: {
|
|
19417
|
+
seeds: [
|
|
19418
|
+
{
|
|
19419
|
+
kind: "const",
|
|
19420
|
+
value: [
|
|
19421
|
+
118,
|
|
19422
|
+
97,
|
|
19423
|
+
117,
|
|
19424
|
+
108,
|
|
19425
|
+
116
|
|
19426
|
+
]
|
|
19427
|
+
},
|
|
19428
|
+
{
|
|
19429
|
+
kind: "account",
|
|
19430
|
+
path: "glam_state"
|
|
19431
|
+
}
|
|
19432
|
+
],
|
|
19433
|
+
program: {
|
|
19434
|
+
kind: "account",
|
|
19435
|
+
path: "glam_protocol_program"
|
|
19436
|
+
}
|
|
19437
|
+
}
|
|
19592
19438
|
},
|
|
19593
19439
|
{
|
|
19594
19440
|
name: "glam_signer",
|
|
19441
|
+
writable: true,
|
|
19595
19442
|
signer: true
|
|
19596
19443
|
},
|
|
19597
19444
|
{
|
|
19598
|
-
name: "
|
|
19599
|
-
|
|
19445
|
+
name: "glam_protocol_program",
|
|
19446
|
+
address: "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
|
|
19447
|
+
},
|
|
19448
|
+
{
|
|
19449
|
+
name: "bridge_registry",
|
|
19450
|
+
writable: true,
|
|
19451
|
+
pda: {
|
|
19452
|
+
seeds: [
|
|
19453
|
+
{
|
|
19454
|
+
kind: "const",
|
|
19455
|
+
value: [
|
|
19456
|
+
98,
|
|
19457
|
+
114,
|
|
19458
|
+
105,
|
|
19459
|
+
100,
|
|
19460
|
+
103,
|
|
19461
|
+
101,
|
|
19462
|
+
45,
|
|
19463
|
+
114,
|
|
19464
|
+
101,
|
|
19465
|
+
103,
|
|
19466
|
+
105,
|
|
19467
|
+
115,
|
|
19468
|
+
116,
|
|
19469
|
+
114,
|
|
19470
|
+
121
|
|
19471
|
+
]
|
|
19472
|
+
},
|
|
19473
|
+
{
|
|
19474
|
+
kind: "account",
|
|
19475
|
+
path: "glam_state"
|
|
19476
|
+
}
|
|
19477
|
+
]
|
|
19478
|
+
}
|
|
19479
|
+
},
|
|
19480
|
+
{
|
|
19481
|
+
name: "integration_authority",
|
|
19482
|
+
pda: {
|
|
19483
|
+
seeds: [
|
|
19484
|
+
{
|
|
19485
|
+
kind: "const",
|
|
19486
|
+
value: [
|
|
19487
|
+
105,
|
|
19488
|
+
110,
|
|
19489
|
+
116,
|
|
19490
|
+
101,
|
|
19491
|
+
103,
|
|
19492
|
+
114,
|
|
19493
|
+
97,
|
|
19494
|
+
116,
|
|
19495
|
+
105,
|
|
19496
|
+
111,
|
|
19497
|
+
110,
|
|
19498
|
+
45,
|
|
19499
|
+
97,
|
|
19500
|
+
117,
|
|
19501
|
+
116,
|
|
19502
|
+
104,
|
|
19503
|
+
111,
|
|
19504
|
+
114,
|
|
19505
|
+
105,
|
|
19506
|
+
116,
|
|
19507
|
+
121
|
|
19508
|
+
]
|
|
19509
|
+
}
|
|
19510
|
+
]
|
|
19511
|
+
}
|
|
19512
|
+
},
|
|
19513
|
+
{
|
|
19514
|
+
name: "system_program",
|
|
19515
|
+
address: "11111111111111111111111111111111"
|
|
19600
19516
|
}
|
|
19601
19517
|
],
|
|
19602
|
-
args: [
|
|
19518
|
+
args: [
|
|
19519
|
+
{
|
|
19520
|
+
name: "args",
|
|
19521
|
+
type: {
|
|
19522
|
+
defined: {
|
|
19523
|
+
name: "SettleManagedTransferArgs"
|
|
19524
|
+
}
|
|
19525
|
+
}
|
|
19526
|
+
}
|
|
19527
|
+
]
|
|
19603
19528
|
},
|
|
19604
19529
|
{
|
|
19605
19530
|
name: "update_layerzero_oft_route",
|
|
@@ -19638,6 +19563,74 @@ var instructions$8 = [
|
|
|
19638
19563
|
}
|
|
19639
19564
|
}
|
|
19640
19565
|
]
|
|
19566
|
+
},
|
|
19567
|
+
{
|
|
19568
|
+
name: "validate_managed_transfer",
|
|
19569
|
+
docs: [
|
|
19570
|
+
"Validates a managed inflight transfer so that it becomes priceable."
|
|
19571
|
+
],
|
|
19572
|
+
discriminator: [
|
|
19573
|
+
47,
|
|
19574
|
+
86,
|
|
19575
|
+
129,
|
|
19576
|
+
235,
|
|
19577
|
+
30,
|
|
19578
|
+
249,
|
|
19579
|
+
248,
|
|
19580
|
+
42
|
|
19581
|
+
],
|
|
19582
|
+
accounts: [
|
|
19583
|
+
{
|
|
19584
|
+
name: "glam_state",
|
|
19585
|
+
writable: true
|
|
19586
|
+
},
|
|
19587
|
+
{
|
|
19588
|
+
name: "glam_signer",
|
|
19589
|
+
signer: true
|
|
19590
|
+
},
|
|
19591
|
+
{
|
|
19592
|
+
name: "bridge_registry",
|
|
19593
|
+
writable: true,
|
|
19594
|
+
pda: {
|
|
19595
|
+
seeds: [
|
|
19596
|
+
{
|
|
19597
|
+
kind: "const",
|
|
19598
|
+
value: [
|
|
19599
|
+
98,
|
|
19600
|
+
114,
|
|
19601
|
+
105,
|
|
19602
|
+
100,
|
|
19603
|
+
103,
|
|
19604
|
+
101,
|
|
19605
|
+
45,
|
|
19606
|
+
114,
|
|
19607
|
+
101,
|
|
19608
|
+
103,
|
|
19609
|
+
105,
|
|
19610
|
+
115,
|
|
19611
|
+
116,
|
|
19612
|
+
114,
|
|
19613
|
+
121
|
|
19614
|
+
]
|
|
19615
|
+
},
|
|
19616
|
+
{
|
|
19617
|
+
kind: "account",
|
|
19618
|
+
path: "glam_state"
|
|
19619
|
+
}
|
|
19620
|
+
]
|
|
19621
|
+
}
|
|
19622
|
+
}
|
|
19623
|
+
],
|
|
19624
|
+
args: [
|
|
19625
|
+
{
|
|
19626
|
+
name: "args",
|
|
19627
|
+
type: {
|
|
19628
|
+
defined: {
|
|
19629
|
+
name: "ValidateManagedTransferArgs"
|
|
19630
|
+
}
|
|
19631
|
+
}
|
|
19632
|
+
}
|
|
19633
|
+
]
|
|
19641
19634
|
}
|
|
19642
19635
|
];
|
|
19643
19636
|
var accounts$8 = [
|
|
@@ -19667,19 +19660,6 @@ var accounts$8 = [
|
|
|
19667
19660
|
184
|
|
19668
19661
|
]
|
|
19669
19662
|
},
|
|
19670
|
-
{
|
|
19671
|
-
name: "BridgeTransferRecord",
|
|
19672
|
-
discriminator: [
|
|
19673
|
-
46,
|
|
19674
|
-
131,
|
|
19675
|
-
253,
|
|
19676
|
-
32,
|
|
19677
|
-
218,
|
|
19678
|
-
137,
|
|
19679
|
-
45,
|
|
19680
|
-
96
|
|
19681
|
-
]
|
|
19682
|
-
},
|
|
19683
19663
|
{
|
|
19684
19664
|
name: "StateAccount",
|
|
19685
19665
|
discriminator: [
|
|
@@ -19799,6 +19779,26 @@ var errors$2 = [
|
|
|
19799
19779
|
code: 6020,
|
|
19800
19780
|
name: "InvalidOftAuxiliaryBalance",
|
|
19801
19781
|
msg: "The OFT auxiliary token balance did not change as expected"
|
|
19782
|
+
},
|
|
19783
|
+
{
|
|
19784
|
+
code: 6021,
|
|
19785
|
+
name: "InvalidRemainingAccounts",
|
|
19786
|
+
msg: "The remaining accounts are invalid"
|
|
19787
|
+
},
|
|
19788
|
+
{
|
|
19789
|
+
code: 6022,
|
|
19790
|
+
name: "DuplicateTransferRecord",
|
|
19791
|
+
msg: "Duplicate transfer record found"
|
|
19792
|
+
},
|
|
19793
|
+
{
|
|
19794
|
+
code: 6023,
|
|
19795
|
+
name: "TooManyManagedTransfers",
|
|
19796
|
+
msg: "Too many managed transfers are inflight for this vault"
|
|
19797
|
+
},
|
|
19798
|
+
{
|
|
19799
|
+
code: 6024,
|
|
19800
|
+
name: "InvalidBridgeRegistry",
|
|
19801
|
+
msg: "The bridge registry does not belong to this vault"
|
|
19802
19802
|
}
|
|
19803
19803
|
];
|
|
19804
19804
|
var types$8 = [
|
|
@@ -19863,27 +19863,88 @@ var types$8 = [
|
|
|
19863
19863
|
}
|
|
19864
19864
|
},
|
|
19865
19865
|
{
|
|
19866
|
-
name: "
|
|
19866
|
+
name: "BridgeManagedTransfer",
|
|
19867
|
+
serialization: "bytemuckunsafe",
|
|
19868
|
+
repr: {
|
|
19869
|
+
kind: "c"
|
|
19870
|
+
},
|
|
19867
19871
|
type: {
|
|
19868
19872
|
kind: "struct",
|
|
19869
19873
|
fields: [
|
|
19870
19874
|
{
|
|
19871
|
-
name: "
|
|
19875
|
+
name: "transfer_id",
|
|
19872
19876
|
type: "pubkey"
|
|
19873
19877
|
},
|
|
19874
19878
|
{
|
|
19875
|
-
name: "
|
|
19879
|
+
name: "source_mint",
|
|
19880
|
+
type: "pubkey"
|
|
19881
|
+
},
|
|
19882
|
+
{
|
|
19883
|
+
name: "destination_recipient",
|
|
19884
|
+
type: "pubkey"
|
|
19885
|
+
},
|
|
19886
|
+
{
|
|
19887
|
+
name: "provider_program",
|
|
19888
|
+
type: "pubkey"
|
|
19889
|
+
},
|
|
19890
|
+
{
|
|
19891
|
+
name: "provider_config",
|
|
19892
|
+
type: "pubkey"
|
|
19893
|
+
},
|
|
19894
|
+
{
|
|
19895
|
+
name: "provider_emitter",
|
|
19896
|
+
type: "pubkey"
|
|
19897
|
+
},
|
|
19898
|
+
{
|
|
19899
|
+
name: "source_amount",
|
|
19876
19900
|
type: "u64"
|
|
19877
19901
|
},
|
|
19878
19902
|
{
|
|
19879
|
-
name: "
|
|
19903
|
+
name: "quoted_out_amount",
|
|
19904
|
+
type: "u64"
|
|
19905
|
+
},
|
|
19906
|
+
{
|
|
19907
|
+
name: "provider_sequence",
|
|
19908
|
+
type: "u64"
|
|
19909
|
+
},
|
|
19910
|
+
{
|
|
19911
|
+
name: "committed_slot",
|
|
19912
|
+
type: "u64"
|
|
19913
|
+
},
|
|
19914
|
+
{
|
|
19915
|
+
name: "protocol",
|
|
19916
|
+
type: "u16"
|
|
19917
|
+
},
|
|
19918
|
+
{
|
|
19919
|
+
name: "destination_chain",
|
|
19920
|
+
type: "u16"
|
|
19921
|
+
},
|
|
19922
|
+
{
|
|
19923
|
+
name: "source_decimals",
|
|
19880
19924
|
type: "u8"
|
|
19925
|
+
},
|
|
19926
|
+
{
|
|
19927
|
+
name: "status",
|
|
19928
|
+
type: "u8"
|
|
19929
|
+
},
|
|
19930
|
+
{
|
|
19931
|
+
name: "reserved",
|
|
19932
|
+
type: {
|
|
19933
|
+
array: [
|
|
19934
|
+
"u8",
|
|
19935
|
+
2
|
|
19936
|
+
]
|
|
19937
|
+
}
|
|
19881
19938
|
}
|
|
19882
19939
|
]
|
|
19883
19940
|
}
|
|
19884
19941
|
},
|
|
19885
19942
|
{
|
|
19886
|
-
name: "
|
|
19943
|
+
name: "BridgeRegistry",
|
|
19944
|
+
serialization: "bytemuckunsafe",
|
|
19945
|
+
repr: {
|
|
19946
|
+
kind: "c"
|
|
19947
|
+
},
|
|
19887
19948
|
type: {
|
|
19888
19949
|
kind: "struct",
|
|
19889
19950
|
fields: [
|
|
@@ -19892,18 +19953,51 @@ var types$8 = [
|
|
|
19892
19953
|
type: "pubkey"
|
|
19893
19954
|
},
|
|
19894
19955
|
{
|
|
19895
|
-
name: "
|
|
19896
|
-
type: "
|
|
19956
|
+
name: "managed_transfer_count",
|
|
19957
|
+
type: "u8"
|
|
19897
19958
|
},
|
|
19898
19959
|
{
|
|
19899
|
-
name: "
|
|
19960
|
+
name: "reserved",
|
|
19900
19961
|
type: {
|
|
19901
19962
|
array: [
|
|
19902
19963
|
"u8",
|
|
19903
|
-
|
|
19964
|
+
7
|
|
19904
19965
|
]
|
|
19905
19966
|
}
|
|
19906
19967
|
},
|
|
19968
|
+
{
|
|
19969
|
+
name: "transfers",
|
|
19970
|
+
type: {
|
|
19971
|
+
array: [
|
|
19972
|
+
{
|
|
19973
|
+
defined: {
|
|
19974
|
+
name: "BridgeManagedTransfer"
|
|
19975
|
+
}
|
|
19976
|
+
},
|
|
19977
|
+
16
|
|
19978
|
+
]
|
|
19979
|
+
}
|
|
19980
|
+
}
|
|
19981
|
+
]
|
|
19982
|
+
}
|
|
19983
|
+
},
|
|
19984
|
+
{
|
|
19985
|
+
name: "BridgeSession",
|
|
19986
|
+
type: {
|
|
19987
|
+
kind: "struct",
|
|
19988
|
+
fields: [
|
|
19989
|
+
{
|
|
19990
|
+
name: "glam_state",
|
|
19991
|
+
type: "pubkey"
|
|
19992
|
+
},
|
|
19993
|
+
{
|
|
19994
|
+
name: "signer",
|
|
19995
|
+
type: "pubkey"
|
|
19996
|
+
},
|
|
19997
|
+
{
|
|
19998
|
+
name: "transfer_id",
|
|
19999
|
+
type: "pubkey"
|
|
20000
|
+
},
|
|
19907
20001
|
{
|
|
19908
20002
|
name: "protocol",
|
|
19909
20003
|
type: "u16"
|
|
@@ -19916,6 +20010,10 @@ var types$8 = [
|
|
|
19916
20010
|
name: "source_mint",
|
|
19917
20011
|
type: "pubkey"
|
|
19918
20012
|
},
|
|
20013
|
+
{
|
|
20014
|
+
name: "source_decimals",
|
|
20015
|
+
type: "u8"
|
|
20016
|
+
},
|
|
19919
20017
|
{
|
|
19920
20018
|
name: "source_token_account",
|
|
19921
20019
|
type: "pubkey"
|
|
@@ -19992,136 +20090,6 @@ var types$8 = [
|
|
|
19992
20090
|
]
|
|
19993
20091
|
}
|
|
19994
20092
|
},
|
|
19995
|
-
{
|
|
19996
|
-
name: "BridgeTransferRecord",
|
|
19997
|
-
type: {
|
|
19998
|
-
kind: "struct",
|
|
19999
|
-
fields: [
|
|
20000
|
-
{
|
|
20001
|
-
name: "glam_state",
|
|
20002
|
-
type: "pubkey"
|
|
20003
|
-
},
|
|
20004
|
-
{
|
|
20005
|
-
name: "transfer_id",
|
|
20006
|
-
type: {
|
|
20007
|
-
array: [
|
|
20008
|
-
"u8",
|
|
20009
|
-
32
|
|
20010
|
-
]
|
|
20011
|
-
}
|
|
20012
|
-
},
|
|
20013
|
-
{
|
|
20014
|
-
name: "protocol",
|
|
20015
|
-
type: "u16"
|
|
20016
|
-
},
|
|
20017
|
-
{
|
|
20018
|
-
name: "status",
|
|
20019
|
-
type: {
|
|
20020
|
-
defined: {
|
|
20021
|
-
name: "BridgeTransferStatus"
|
|
20022
|
-
}
|
|
20023
|
-
}
|
|
20024
|
-
},
|
|
20025
|
-
{
|
|
20026
|
-
name: "managed",
|
|
20027
|
-
type: "bool"
|
|
20028
|
-
},
|
|
20029
|
-
{
|
|
20030
|
-
name: "receipt_verified",
|
|
20031
|
-
type: "bool"
|
|
20032
|
-
},
|
|
20033
|
-
{
|
|
20034
|
-
name: "source_mint",
|
|
20035
|
-
type: "pubkey"
|
|
20036
|
-
},
|
|
20037
|
-
{
|
|
20038
|
-
name: "source_token_account",
|
|
20039
|
-
type: "pubkey"
|
|
20040
|
-
},
|
|
20041
|
-
{
|
|
20042
|
-
name: "provider_program",
|
|
20043
|
-
type: "pubkey"
|
|
20044
|
-
},
|
|
20045
|
-
{
|
|
20046
|
-
name: "provider_config",
|
|
20047
|
-
type: "pubkey"
|
|
20048
|
-
},
|
|
20049
|
-
{
|
|
20050
|
-
name: "source_amount",
|
|
20051
|
-
type: "u64"
|
|
20052
|
-
},
|
|
20053
|
-
{
|
|
20054
|
-
name: "quoted_out_amount",
|
|
20055
|
-
type: "u64"
|
|
20056
|
-
},
|
|
20057
|
-
{
|
|
20058
|
-
name: "destination_chain",
|
|
20059
|
-
type: "u16"
|
|
20060
|
-
},
|
|
20061
|
-
{
|
|
20062
|
-
name: "destination_recipient",
|
|
20063
|
-
type: "pubkey"
|
|
20064
|
-
},
|
|
20065
|
-
{
|
|
20066
|
-
name: "provider_transfer_id",
|
|
20067
|
-
type: {
|
|
20068
|
-
array: [
|
|
20069
|
-
"u8",
|
|
20070
|
-
32
|
|
20071
|
-
]
|
|
20072
|
-
}
|
|
20073
|
-
},
|
|
20074
|
-
{
|
|
20075
|
-
name: "provider_emitter",
|
|
20076
|
-
type: "pubkey"
|
|
20077
|
-
},
|
|
20078
|
-
{
|
|
20079
|
-
name: "provider_sequence",
|
|
20080
|
-
type: "u64"
|
|
20081
|
-
},
|
|
20082
|
-
{
|
|
20083
|
-
name: "committed_slot",
|
|
20084
|
-
type: "u64"
|
|
20085
|
-
},
|
|
20086
|
-
{
|
|
20087
|
-
name: "settled_slot",
|
|
20088
|
-
type: "u64"
|
|
20089
|
-
},
|
|
20090
|
-
{
|
|
20091
|
-
name: "reconciled_slot",
|
|
20092
|
-
type: "u64"
|
|
20093
|
-
},
|
|
20094
|
-
{
|
|
20095
|
-
name: "failure_reason",
|
|
20096
|
-
type: "u8"
|
|
20097
|
-
},
|
|
20098
|
-
{
|
|
20099
|
-
name: "bump",
|
|
20100
|
-
type: "u8"
|
|
20101
|
-
}
|
|
20102
|
-
]
|
|
20103
|
-
}
|
|
20104
|
-
},
|
|
20105
|
-
{
|
|
20106
|
-
name: "BridgeTransferStatus",
|
|
20107
|
-
type: {
|
|
20108
|
-
kind: "enum",
|
|
20109
|
-
variants: [
|
|
20110
|
-
{
|
|
20111
|
-
name: "Committed"
|
|
20112
|
-
},
|
|
20113
|
-
{
|
|
20114
|
-
name: "Settled"
|
|
20115
|
-
},
|
|
20116
|
-
{
|
|
20117
|
-
name: "Reconciled"
|
|
20118
|
-
},
|
|
20119
|
-
{
|
|
20120
|
-
name: "Failed"
|
|
20121
|
-
}
|
|
20122
|
-
]
|
|
20123
|
-
}
|
|
20124
|
-
},
|
|
20125
20093
|
{
|
|
20126
20094
|
name: "CommitOftTransferArgs",
|
|
20127
20095
|
type: {
|
|
@@ -20129,12 +20097,7 @@ var types$8 = [
|
|
|
20129
20097
|
fields: [
|
|
20130
20098
|
{
|
|
20131
20099
|
name: "transfer_id",
|
|
20132
|
-
type:
|
|
20133
|
-
array: [
|
|
20134
|
-
"u8",
|
|
20135
|
-
32
|
|
20136
|
-
]
|
|
20137
|
-
}
|
|
20100
|
+
type: "pubkey"
|
|
20138
20101
|
}
|
|
20139
20102
|
]
|
|
20140
20103
|
}
|
|
@@ -20838,12 +20801,7 @@ var types$8 = [
|
|
|
20838
20801
|
fields: [
|
|
20839
20802
|
{
|
|
20840
20803
|
name: "transfer_id",
|
|
20841
|
-
type:
|
|
20842
|
-
array: [
|
|
20843
|
-
"u8",
|
|
20844
|
-
32
|
|
20845
|
-
]
|
|
20846
|
-
}
|
|
20804
|
+
type: "pubkey"
|
|
20847
20805
|
},
|
|
20848
20806
|
{
|
|
20849
20807
|
name: "middle_instruction_hash",
|
|
@@ -20979,6 +20937,18 @@ var types$8 = [
|
|
|
20979
20937
|
]
|
|
20980
20938
|
}
|
|
20981
20939
|
},
|
|
20940
|
+
{
|
|
20941
|
+
name: "SettleManagedTransferArgs",
|
|
20942
|
+
type: {
|
|
20943
|
+
kind: "struct",
|
|
20944
|
+
fields: [
|
|
20945
|
+
{
|
|
20946
|
+
name: "transfer_id",
|
|
20947
|
+
type: "pubkey"
|
|
20948
|
+
}
|
|
20949
|
+
]
|
|
20950
|
+
}
|
|
20951
|
+
},
|
|
20982
20952
|
{
|
|
20983
20953
|
name: "StateAccount",
|
|
20984
20954
|
type: {
|
|
@@ -21125,6 +21095,18 @@ var types$8 = [
|
|
|
21125
21095
|
]
|
|
21126
21096
|
}
|
|
21127
21097
|
},
|
|
21098
|
+
{
|
|
21099
|
+
name: "ValidateManagedTransferArgs",
|
|
21100
|
+
type: {
|
|
21101
|
+
kind: "struct",
|
|
21102
|
+
fields: [
|
|
21103
|
+
{
|
|
21104
|
+
name: "transfer_id",
|
|
21105
|
+
type: "pubkey"
|
|
21106
|
+
}
|
|
21107
|
+
]
|
|
21108
|
+
}
|
|
21109
|
+
},
|
|
21128
21110
|
{
|
|
21129
21111
|
name: "ValuationModel",
|
|
21130
21112
|
type: {
|
|
@@ -21142,14 +21124,19 @@ var types$8 = [
|
|
|
21142
21124
|
];
|
|
21143
21125
|
var constants$8 = [
|
|
21144
21126
|
{
|
|
21145
|
-
name: "
|
|
21127
|
+
name: "PROTO_BRIDGE_PERM_SEND",
|
|
21146
21128
|
type: "u64",
|
|
21147
|
-
value: "
|
|
21129
|
+
value: "1"
|
|
21148
21130
|
},
|
|
21149
21131
|
{
|
|
21150
|
-
name: "
|
|
21132
|
+
name: "PROTO_BRIDGE_PERM_SETTLE",
|
|
21151
21133
|
type: "u64",
|
|
21152
|
-
value: "
|
|
21134
|
+
value: "4"
|
|
21135
|
+
},
|
|
21136
|
+
{
|
|
21137
|
+
name: "PROTO_BRIDGE_PERM_VALIDATE",
|
|
21138
|
+
type: "u64",
|
|
21139
|
+
value: "2"
|
|
21153
21140
|
},
|
|
21154
21141
|
{
|
|
21155
21142
|
name: "PROTO_LAYERZERO_OFT",
|
|
@@ -46245,6 +46232,7 @@ class JupiterApiClient {
|
|
|
46245
46232
|
this.name = data.name ?? null;
|
|
46246
46233
|
this.uri = data.uri ?? null;
|
|
46247
46234
|
this.enabled = data.enabled ?? null;
|
|
46235
|
+
this.oracleConfigs = data.oracleConfigs ?? null;
|
|
46248
46236
|
this.assets = data.assets ?? null;
|
|
46249
46237
|
this.created = data.created ?? null;
|
|
46250
46238
|
this.owner = data.owner ?? null;
|
|
@@ -47077,19 +47065,51 @@ class BaseClient {
|
|
|
47077
47065
|
this._assetMetasPromise = undefined;
|
|
47078
47066
|
}
|
|
47079
47067
|
const fetchPromise = this.fetchGlobalConfig(options).then(async (globalConfig)=>{
|
|
47080
|
-
|
|
47081
|
-
const
|
|
47082
|
-
|
|
47083
|
-
|
|
47084
|
-
|
|
47085
|
-
|
|
47086
|
-
|
|
47087
|
-
|
|
47088
|
-
|
|
47089
|
-
|
|
47090
|
-
|
|
47068
|
+
const assets = globalConfig.assetMetas.map((am)=>am.asset);
|
|
47069
|
+
const tokenProgramsByAsset = new Map();
|
|
47070
|
+
try {
|
|
47071
|
+
// Fast path when every global-config mint account is available.
|
|
47072
|
+
const mintInfos = await fetchMintsAndTokenPrograms(this.connection, assets);
|
|
47073
|
+
assets.forEach((asset, i)=>{
|
|
47074
|
+
tokenProgramsByAsset.set(asset.toBase58(), mintInfos[i].tokenProgram);
|
|
47075
|
+
});
|
|
47076
|
+
} catch {
|
|
47077
|
+
// Local validators may clone a newer global config than the set of
|
|
47078
|
+
// mint accounts they have available. Resolve what we can and let
|
|
47079
|
+
// downstream callers request only the assets they actually use.
|
|
47080
|
+
const accountsInfo = await this.connection.getMultipleAccountsInfo(assets, "confirmed");
|
|
47081
|
+
accountsInfo.forEach((accountInfo, i)=>{
|
|
47082
|
+
const asset = assets[i];
|
|
47083
|
+
const assetKey = asset.toBase58();
|
|
47084
|
+
if (accountInfo) {
|
|
47085
|
+
tokenProgramsByAsset.set(assetKey, parseMintAccountInfo(accountInfo, asset).tokenProgram);
|
|
47086
|
+
return;
|
|
47087
|
+
}
|
|
47088
|
+
const fallback = ASSETS_MAINNET.get(assetKey);
|
|
47089
|
+
if (fallback) {
|
|
47090
|
+
tokenProgramsByAsset.set(assetKey, fallback.programId);
|
|
47091
47091
|
}
|
|
47092
|
-
|
|
47092
|
+
});
|
|
47093
|
+
}
|
|
47094
|
+
// Transforms onchain asset meta to client asset meta
|
|
47095
|
+
const assetMetaMap = new Map(globalConfig.assetMetas.flatMap(({ asset, decimals, oracle, oracleSource })=>{
|
|
47096
|
+
const programId = tokenProgramsByAsset.get(asset.toBase58());
|
|
47097
|
+
if (!programId) {
|
|
47098
|
+
return [];
|
|
47099
|
+
}
|
|
47100
|
+
return [
|
|
47101
|
+
[
|
|
47102
|
+
asset.toBase58(),
|
|
47103
|
+
{
|
|
47104
|
+
asset,
|
|
47105
|
+
decimals,
|
|
47106
|
+
oracle,
|
|
47107
|
+
oracleSource,
|
|
47108
|
+
programId
|
|
47109
|
+
}
|
|
47110
|
+
]
|
|
47111
|
+
];
|
|
47112
|
+
}));
|
|
47093
47113
|
if (useCache) {
|
|
47094
47114
|
this._assetMetas = assetMetaMap;
|
|
47095
47115
|
}
|
|
@@ -51527,6 +51547,8 @@ class PriceClient {
|
|
|
51527
51547
|
}
|
|
51528
51548
|
const epiRefreshIx = await this.priceEpiValidatedPositionsIx();
|
|
51529
51549
|
if (epiRefreshIx) pricingIxs.push(epiRefreshIx);
|
|
51550
|
+
const priceBridgeIxs = await this.bridge.txBuilder.priceManagedTransfersIxs();
|
|
51551
|
+
if (priceBridgeIxs) pricingIxs.push(...priceBridgeIxs);
|
|
51530
51552
|
return pricingIxs.filter(Boolean);
|
|
51531
51553
|
}
|
|
51532
51554
|
async validateAumIx() {
|
|
@@ -51566,10 +51588,11 @@ class PriceClient {
|
|
|
51566
51588
|
kaminoReserves
|
|
51567
51589
|
];
|
|
51568
51590
|
}
|
|
51569
|
-
constructor(base, klend, kvaults, getJupiterApi){
|
|
51591
|
+
constructor(base, klend, kvaults, bridge, getJupiterApi){
|
|
51570
51592
|
this.base = base;
|
|
51571
51593
|
this.klend = klend;
|
|
51572
51594
|
this.kvaults = kvaults;
|
|
51595
|
+
this.bridge = bridge;
|
|
51573
51596
|
this.getJupiterApi = getJupiterApi;
|
|
51574
51597
|
this._stateModel = null;
|
|
51575
51598
|
this._lookupTables = new PkSet();
|
|
@@ -53255,13 +53278,6 @@ function resolveCanonicalLayerzeroOftRouteProfile(params) {
|
|
|
53255
53278
|
}
|
|
53256
53279
|
|
|
53257
53280
|
const LAYERZERO_OFT_PROTOCOL = 1 << 2;
|
|
53258
|
-
function toFixedArray32$1(value, label) {
|
|
53259
|
-
const bytes = Array.from(Buffer.from(value));
|
|
53260
|
-
if (bytes.length !== 32) {
|
|
53261
|
-
throw new Error(`${label} must be exactly 32 bytes`);
|
|
53262
|
-
}
|
|
53263
|
-
return bytes;
|
|
53264
|
-
}
|
|
53265
53281
|
function appendU16Le(parts, value) {
|
|
53266
53282
|
const out = Buffer.alloc(2);
|
|
53267
53283
|
out.writeUInt16LE(value, 0);
|
|
@@ -53360,15 +53376,53 @@ function getBridgeSessionPda(glamState, transferId, bridgeProgramId) {
|
|
|
53360
53376
|
return PublicKey.findProgramAddressSync([
|
|
53361
53377
|
Buffer.from(SEED_BRIDGE_SESSION),
|
|
53362
53378
|
glamState.toBuffer(),
|
|
53363
|
-
|
|
53379
|
+
transferId.toBuffer()
|
|
53364
53380
|
], bridgeProgramId)[0];
|
|
53365
53381
|
}
|
|
53366
|
-
function
|
|
53367
|
-
return
|
|
53368
|
-
|
|
53369
|
-
|
|
53370
|
-
|
|
53371
|
-
|
|
53382
|
+
function toCount(value) {
|
|
53383
|
+
return BN.isBN(value) ? value.toNumber() : value;
|
|
53384
|
+
}
|
|
53385
|
+
function toBridgeTransferStatus(status) {
|
|
53386
|
+
switch(status){
|
|
53387
|
+
case 0:
|
|
53388
|
+
return {
|
|
53389
|
+
committed: {}
|
|
53390
|
+
};
|
|
53391
|
+
case 1:
|
|
53392
|
+
return {
|
|
53393
|
+
validated: {}
|
|
53394
|
+
};
|
|
53395
|
+
case 2:
|
|
53396
|
+
return {
|
|
53397
|
+
settled: {}
|
|
53398
|
+
};
|
|
53399
|
+
default:
|
|
53400
|
+
throw new Error(`Unsupported bridge transfer status: ${status}`);
|
|
53401
|
+
}
|
|
53402
|
+
}
|
|
53403
|
+
function getActiveRegistryTransfers(registry) {
|
|
53404
|
+
return registry.transfers.slice(0, toCount(registry.managedTransferCount));
|
|
53405
|
+
}
|
|
53406
|
+
function registryTransferToRecord(transfer, glamState) {
|
|
53407
|
+
return {
|
|
53408
|
+
glamState,
|
|
53409
|
+
transferId: transfer.transferId,
|
|
53410
|
+
protocol: transfer.protocol,
|
|
53411
|
+
status: toBridgeTransferStatus(transfer.status),
|
|
53412
|
+
managed: true,
|
|
53413
|
+
receiptVerified: true,
|
|
53414
|
+
sourceMint: transfer.sourceMint,
|
|
53415
|
+
sourceDecimals: transfer.sourceDecimals,
|
|
53416
|
+
providerProgram: transfer.providerProgram,
|
|
53417
|
+
providerConfig: transfer.providerConfig,
|
|
53418
|
+
sourceAmount: transfer.sourceAmount,
|
|
53419
|
+
quotedOutAmount: transfer.quotedOutAmount,
|
|
53420
|
+
destinationChain: transfer.destinationChain,
|
|
53421
|
+
destinationRecipient: transfer.destinationRecipient,
|
|
53422
|
+
providerEmitter: transfer.providerEmitter,
|
|
53423
|
+
providerSequence: transfer.providerSequence,
|
|
53424
|
+
committedSlot: transfer.committedSlot
|
|
53425
|
+
};
|
|
53372
53426
|
}
|
|
53373
53427
|
function toRouteManagementModeArg(managementMode) {
|
|
53374
53428
|
if (managementMode && typeof managementMode === "object" && ("unmanagedOnly" in managementMode || "managedOnly" in managementMode || "either" in managementMode)) {
|
|
@@ -53414,7 +53468,7 @@ async function deriveOftAuxiliaryAccountSeed(glamState, transferId) {
|
|
|
53414
53468
|
const digest = await sha256(Buffer.concat([
|
|
53415
53469
|
Buffer.from("oft-auxiliary-account"),
|
|
53416
53470
|
glamState.toBuffer(),
|
|
53417
|
-
|
|
53471
|
+
transferId.toBuffer()
|
|
53418
53472
|
]));
|
|
53419
53473
|
return digest.subarray(0, 16).toString("hex");
|
|
53420
53474
|
}
|
|
@@ -53478,20 +53532,18 @@ let TxBuilder$1 = class TxBuilder extends BaseTxBuilder {
|
|
|
53478
53532
|
}).instruction();
|
|
53479
53533
|
}
|
|
53480
53534
|
async deleteLayerzeroOftRouteIx(route, signer) {
|
|
53481
|
-
return await this.client.base.extBridgeProgram.methods.deleteLayerzeroOftRoute(normalizeRoute(route)).
|
|
53535
|
+
return await this.client.base.extBridgeProgram.methods.deleteLayerzeroOftRoute(normalizeRoute(route)).accounts({
|
|
53482
53536
|
glamState: this.client.base.statePda,
|
|
53483
|
-
glamSigner: signer || this.client.base.signer
|
|
53484
|
-
glamProtocolProgram: this.client.base.protocolProgram.programId
|
|
53537
|
+
glamSigner: signer || this.client.base.signer
|
|
53485
53538
|
}).instruction();
|
|
53486
53539
|
}
|
|
53487
53540
|
async buildOftTransferTx(params, txOptions = {}) {
|
|
53488
53541
|
if (params.providerInstructions.length !== 1) {
|
|
53489
53542
|
throw new Error("OFT transfers require exactly one provider instruction");
|
|
53490
53543
|
}
|
|
53491
|
-
const transferId =
|
|
53544
|
+
const transferId = params.transferId;
|
|
53492
53545
|
const registryPda = getBridgeRegistryPda(this.client.base.statePda, this.client.base.extBridgeProgram.programId);
|
|
53493
53546
|
const sessionPda = getBridgeSessionPda(this.client.base.statePda, transferId, this.client.base.extBridgeProgram.programId);
|
|
53494
|
-
const transferRecordPda = getBridgeTransferRecordPda(this.client.base.statePda, transferId, this.client.base.extBridgeProgram.programId);
|
|
53495
53547
|
const integrationAuthority = PublicKey.findProgramAddressSync([
|
|
53496
53548
|
Buffer.from(SEED_INTEGRATION_AUTHORITY)
|
|
53497
53549
|
], this.client.base.extBridgeProgram.programId)[0];
|
|
@@ -53544,17 +53596,16 @@ let TxBuilder$1 = class TxBuilder extends BaseTxBuilder {
|
|
|
53544
53596
|
glamState: this.client.base.statePda,
|
|
53545
53597
|
glamVault: this.client.base.vaultPda,
|
|
53546
53598
|
glamSigner: txOptions.signer || this.client.base.signer,
|
|
53547
|
-
integrationAuthority,
|
|
53548
53599
|
cpiProgram: tokenProgram,
|
|
53549
53600
|
glamProtocolProgram: this.client.base.protocolProgram.programId,
|
|
53550
|
-
systemProgram: SystemProgram.programId,
|
|
53551
53601
|
instructions: SYSVAR_INSTRUCTIONS_PUBKEY,
|
|
53552
53602
|
bridgeRegistry: registryPda,
|
|
53553
53603
|
bridgeSession: sessionPda,
|
|
53554
|
-
transferRecord: transferRecordPda,
|
|
53555
53604
|
sourceTokenAccount,
|
|
53556
53605
|
sourceMint: params.sourceMint,
|
|
53557
|
-
auxiliaryTokenAccount
|
|
53606
|
+
auxiliaryTokenAccount,
|
|
53607
|
+
integrationAuthority,
|
|
53608
|
+
systemProgram: SystemProgram.programId
|
|
53558
53609
|
});
|
|
53559
53610
|
commitMethod.remainingAccounts(commitRemainingAccounts);
|
|
53560
53611
|
const commitIx = await commitMethod.instruction();
|
|
@@ -53567,11 +53618,65 @@ let TxBuilder$1 = class TxBuilder extends BaseTxBuilder {
|
|
|
53567
53618
|
tx,
|
|
53568
53619
|
additionalSigners: params.providerSigners || [],
|
|
53569
53620
|
sessionPda,
|
|
53570
|
-
transferRecordPda,
|
|
53571
53621
|
auxiliaryTokenAccount,
|
|
53572
53622
|
sourceTokenAccount
|
|
53573
53623
|
};
|
|
53574
53624
|
}
|
|
53625
|
+
async priceManagedTransfersIxs() {
|
|
53626
|
+
const [stateAccount, registry] = await Promise.all([
|
|
53627
|
+
this.client.base.fetchStateAccount(),
|
|
53628
|
+
this.client.fetchRegistry()
|
|
53629
|
+
]);
|
|
53630
|
+
if (!registry) {
|
|
53631
|
+
throw new Error("Managed bridge registry not initialized");
|
|
53632
|
+
}
|
|
53633
|
+
const transfers = getActiveRegistryTransfers(registry);
|
|
53634
|
+
const [baseAssetMeta, assetMetas] = await Promise.all([
|
|
53635
|
+
this.client.base.getAssetMeta(stateAccount.baseAssetMint),
|
|
53636
|
+
Promise.all(transfers.map(async (transfer)=>({
|
|
53637
|
+
transfer,
|
|
53638
|
+
assetMeta: await this.client.base.getAssetMeta(transfer.sourceMint)
|
|
53639
|
+
})))
|
|
53640
|
+
]);
|
|
53641
|
+
const integrationAuthority = PublicKey.findProgramAddressSync([
|
|
53642
|
+
Buffer.from(SEED_INTEGRATION_AUTHORITY)
|
|
53643
|
+
], this.client.base.extBridgeProgram.programId)[0];
|
|
53644
|
+
const ixs = [];
|
|
53645
|
+
const kaminoReserveKeys = new Map();
|
|
53646
|
+
[
|
|
53647
|
+
baseAssetMeta,
|
|
53648
|
+
...assetMetas.map(({ assetMeta })=>assetMeta)
|
|
53649
|
+
].forEach((assetMeta)=>{
|
|
53650
|
+
if (assetMeta.oracleSource === "KaminoReserve") {
|
|
53651
|
+
kaminoReserveKeys.set(assetMeta.oracle.toBase58(), assetMeta.oracle);
|
|
53652
|
+
}
|
|
53653
|
+
});
|
|
53654
|
+
if (kaminoReserveKeys.size > 0) {
|
|
53655
|
+
const klend = new KaminoLendingClient(this.client.base, new VaultClient(this.client.base));
|
|
53656
|
+
const reserves = await klend.fetchAndParseReserves(Array.from(kaminoReserveKeys.values()));
|
|
53657
|
+
ixs.push(klend.txBuilder.refreshReservesBatchIx(reserves, false));
|
|
53658
|
+
}
|
|
53659
|
+
const remainingAccounts = assetMetas.map(({ assetMeta })=>({
|
|
53660
|
+
pubkey: assetMeta.oracle,
|
|
53661
|
+
isSigner: false,
|
|
53662
|
+
isWritable: false
|
|
53663
|
+
}));
|
|
53664
|
+
const priceMethod = this.client.base.extBridgeProgram.methods.priceManagedTransfers().accountsPartial({
|
|
53665
|
+
glamState: this.client.base.statePda,
|
|
53666
|
+
bridgeRegistry: this.client.getRegistryPda(),
|
|
53667
|
+
integrationAuthority,
|
|
53668
|
+
glamProtocolProgram: this.client.base.protocolProgram.programId,
|
|
53669
|
+
glamConfig: getGlobalConfigPda(),
|
|
53670
|
+
baseAssetOracle: baseAssetMeta.oracle
|
|
53671
|
+
});
|
|
53672
|
+
priceMethod.remainingAccounts(remainingAccounts);
|
|
53673
|
+
ixs.push(await priceMethod.instruction());
|
|
53674
|
+
return ixs;
|
|
53675
|
+
}
|
|
53676
|
+
async priceManagedTransfersTx(txOptions = {}) {
|
|
53677
|
+
const ixs = await this.priceManagedTransfersIxs();
|
|
53678
|
+
return await this.buildVersionedTx(ixs, txOptions);
|
|
53679
|
+
}
|
|
53575
53680
|
};
|
|
53576
53681
|
let LayerzeroOftBridgeProtocolClient = class LayerzeroOftBridgeProtocolClient {
|
|
53577
53682
|
async buildSendTx(params, txOptions = {}) {
|
|
@@ -53592,9 +53697,6 @@ class BridgeClient {
|
|
|
53592
53697
|
getSessionPda(transferId) {
|
|
53593
53698
|
return getBridgeSessionPda(this.base.statePda, transferId, this.base.extBridgeProgram.programId);
|
|
53594
53699
|
}
|
|
53595
|
-
getTransferRecordPda(transferId) {
|
|
53596
|
-
return getBridgeTransferRecordPda(this.base.statePda, transferId, this.base.extBridgeProgram.programId);
|
|
53597
|
-
}
|
|
53598
53700
|
getLayerzeroNoncePda(endpointProgram, sender, destinationChain, destinationRecipient) {
|
|
53599
53701
|
return deriveLayerzeroNoncePda(endpointProgram, sender, destinationChain, destinationRecipient);
|
|
53600
53702
|
}
|
|
@@ -53742,7 +53844,19 @@ class BridgeClient {
|
|
|
53742
53844
|
return await this.base.extBridgeProgram.account.bridgeSession.fetchNullable(this.getSessionPda(transferId));
|
|
53743
53845
|
}
|
|
53744
53846
|
async fetchTransferRecord(transferId) {
|
|
53745
|
-
|
|
53847
|
+
const record = await this.fetchTransferRecordNullable(transferId);
|
|
53848
|
+
if (!record) {
|
|
53849
|
+
throw new Error(`Managed bridge transfer not found for transferId ${transferId.toBase58()}`);
|
|
53850
|
+
}
|
|
53851
|
+
return record;
|
|
53852
|
+
}
|
|
53853
|
+
async fetchTransferRecordNullable(transferId) {
|
|
53854
|
+
const registry = await this.fetchRegistry();
|
|
53855
|
+
if (!registry) {
|
|
53856
|
+
return null;
|
|
53857
|
+
}
|
|
53858
|
+
const transfer = getActiveRegistryTransfers(registry).find((candidate)=>candidate.transferId.equals(transferId));
|
|
53859
|
+
return transfer ? registryTransferToRecord(transfer, this.base.statePda) : null;
|
|
53746
53860
|
}
|
|
53747
53861
|
async addLayerzeroOftRoute(route, txOptions = {}) {
|
|
53748
53862
|
const glamSigner = txOptions.signer || this.base.signer;
|
|
@@ -53775,7 +53889,7 @@ class BridgeClient {
|
|
|
53775
53889
|
return await this.txBuilder.buildOftTransferTx(params, txOptions);
|
|
53776
53890
|
}
|
|
53777
53891
|
async buildLayerzeroOftSendTx(params, txOptions = {}) {
|
|
53778
|
-
const resolvedTransferId = params.transferId || Keypair.generate().publicKey
|
|
53892
|
+
const resolvedTransferId = params.transferId || Keypair.generate().publicKey;
|
|
53779
53893
|
const { tokenProgram } = await fetchMintAndTokenProgram(this.base.connection, params.sourceMint);
|
|
53780
53894
|
const signer = txOptions.signer || this.base.signer;
|
|
53781
53895
|
const sourceTokenAccount = params.sourceTokenAccount || this.base.getVaultAta(params.sourceMint, tokenProgram);
|
|
@@ -53848,56 +53962,39 @@ class BridgeClient {
|
|
|
53848
53962
|
};
|
|
53849
53963
|
}
|
|
53850
53964
|
async settleManagedTransfer(transferId, txOptions = {}) {
|
|
53851
|
-
const
|
|
53852
|
-
|
|
53853
|
-
|
|
53854
|
-
|
|
53855
|
-
|
|
53856
|
-
|
|
53857
|
-
ix
|
|
53858
|
-
], txOptions);
|
|
53859
|
-
return await this.base.sendAndConfirm(tx);
|
|
53860
|
-
}
|
|
53861
|
-
async reconcileManagedTransfer(transferId, txOptions = {}) {
|
|
53862
|
-
const ix = await this.base.extBridgeProgram.methods.reconcileManagedTransfer().accountsPartial({
|
|
53965
|
+
const integrationAuthority = PublicKey.findProgramAddressSync([
|
|
53966
|
+
Buffer.from(SEED_INTEGRATION_AUTHORITY)
|
|
53967
|
+
], this.base.extBridgeProgram.programId)[0];
|
|
53968
|
+
const ix = await this.base.extBridgeProgram.methods.settleManagedTransfer({
|
|
53969
|
+
transferId
|
|
53970
|
+
}).accountsPartial({
|
|
53863
53971
|
glamState: this.base.statePda,
|
|
53972
|
+
glamVault: this.base.vaultPda,
|
|
53864
53973
|
glamSigner: txOptions.signer || this.base.signer,
|
|
53865
53974
|
glamProtocolProgram: this.base.protocolProgram.programId,
|
|
53866
|
-
|
|
53975
|
+
bridgeRegistry: this.getRegistryPda(),
|
|
53976
|
+
integrationAuthority,
|
|
53977
|
+
systemProgram: SystemProgram.programId
|
|
53867
53978
|
}).instruction();
|
|
53868
53979
|
const tx = await this.txBuilder.buildVersionedTx([
|
|
53869
53980
|
ix
|
|
53870
53981
|
], txOptions);
|
|
53871
53982
|
return await this.base.sendAndConfirm(tx);
|
|
53872
53983
|
}
|
|
53873
|
-
async
|
|
53874
|
-
|
|
53875
|
-
|
|
53876
|
-
|
|
53877
|
-
const ix = await this.base.extBridgeProgram.methods.failOrCancelManagedTransfer(failureReason).accounts({
|
|
53984
|
+
async validateManagedTransfer(transferId, txOptions = {}) {
|
|
53985
|
+
const ix = await this.base.extBridgeProgram.methods.validateManagedTransfer({
|
|
53986
|
+
transferId
|
|
53987
|
+
}).accounts({
|
|
53878
53988
|
glamState: this.base.statePda,
|
|
53879
|
-
|
|
53880
|
-
glamSigner: txOptions.signer || this.base.signer,
|
|
53881
|
-
// integrationAuthority,
|
|
53882
|
-
// glamProtocolProgram: this.base.protocolProgram.programId,
|
|
53883
|
-
// systemProgram: SystemProgram.programId,
|
|
53884
|
-
// bridgeRegistry: this.getRegistryPda(),
|
|
53885
|
-
transferRecord: this.getTransferRecordPda(transferId)
|
|
53989
|
+
glamSigner: txOptions.signer || this.base.signer
|
|
53886
53990
|
}).instruction();
|
|
53887
53991
|
const tx = await this.txBuilder.buildVersionedTx([
|
|
53888
53992
|
ix
|
|
53889
53993
|
], txOptions);
|
|
53890
53994
|
return await this.base.sendAndConfirm(tx);
|
|
53891
53995
|
}
|
|
53892
|
-
async
|
|
53893
|
-
const
|
|
53894
|
-
glamState: this.base.statePda,
|
|
53895
|
-
glamSigner: txOptions.signer || this.base.signer,
|
|
53896
|
-
transferRecord: this.getTransferRecordPda(transferId)
|
|
53897
|
-
}).instruction();
|
|
53898
|
-
const tx = await this.txBuilder.buildVersionedTx([
|
|
53899
|
-
ix
|
|
53900
|
-
], txOptions);
|
|
53996
|
+
async priceManagedTransfers(txOptions = {}) {
|
|
53997
|
+
const tx = await this.txBuilder.priceManagedTransfersTx(txOptions);
|
|
53901
53998
|
return await this.base.sendAndConfirm(tx);
|
|
53902
53999
|
}
|
|
53903
54000
|
constructor(base){
|
|
@@ -54083,7 +54180,7 @@ class EpiClient {
|
|
|
54083
54180
|
}
|
|
54084
54181
|
get price() {
|
|
54085
54182
|
if (!this._price) {
|
|
54086
|
-
this._price = new PriceClient(this, this.kaminoLending, this.kaminoVaults, ()=>this.jupiterSwap.jupApi);
|
|
54183
|
+
this._price = new PriceClient(this, this.kaminoLending, this.kaminoVaults, this.bridge, ()=>this.jupiterSwap.jupApi);
|
|
54087
54184
|
}
|
|
54088
54185
|
return this._price;
|
|
54089
54186
|
}
|