@glamsystems/glam-sdk 1.0.14-alpha.2 → 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 +572 -515
- package/index.esm.js +572 -515
- 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 +427 -442
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: [
|
|
@@ -18900,39 +18869,6 @@ var instructions$8 = [
|
|
|
18900
18869
|
writable: true,
|
|
18901
18870
|
signer: true
|
|
18902
18871
|
},
|
|
18903
|
-
{
|
|
18904
|
-
name: "integration_authority",
|
|
18905
|
-
pda: {
|
|
18906
|
-
seeds: [
|
|
18907
|
-
{
|
|
18908
|
-
kind: "const",
|
|
18909
|
-
value: [
|
|
18910
|
-
105,
|
|
18911
|
-
110,
|
|
18912
|
-
116,
|
|
18913
|
-
101,
|
|
18914
|
-
103,
|
|
18915
|
-
114,
|
|
18916
|
-
97,
|
|
18917
|
-
116,
|
|
18918
|
-
105,
|
|
18919
|
-
111,
|
|
18920
|
-
110,
|
|
18921
|
-
45,
|
|
18922
|
-
97,
|
|
18923
|
-
117,
|
|
18924
|
-
116,
|
|
18925
|
-
104,
|
|
18926
|
-
111,
|
|
18927
|
-
114,
|
|
18928
|
-
105,
|
|
18929
|
-
116,
|
|
18930
|
-
121
|
|
18931
|
-
]
|
|
18932
|
-
}
|
|
18933
|
-
]
|
|
18934
|
-
}
|
|
18935
|
-
},
|
|
18936
18872
|
{
|
|
18937
18873
|
name: "cpi_program"
|
|
18938
18874
|
},
|
|
@@ -18940,10 +18876,6 @@ var instructions$8 = [
|
|
|
18940
18876
|
name: "glam_protocol_program",
|
|
18941
18877
|
address: "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
|
|
18942
18878
|
},
|
|
18943
|
-
{
|
|
18944
|
-
name: "system_program",
|
|
18945
|
-
address: "11111111111111111111111111111111"
|
|
18946
|
-
},
|
|
18947
18879
|
{
|
|
18948
18880
|
name: "instructions",
|
|
18949
18881
|
address: "Sysvar1nstructions1111111111111111111111111"
|
|
@@ -19016,58 +18948,52 @@ var instructions$8 = [
|
|
|
19016
18948
|
}
|
|
19017
18949
|
},
|
|
19018
18950
|
{
|
|
19019
|
-
name: "
|
|
19020
|
-
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",
|
|
19021
18963
|
pda: {
|
|
19022
18964
|
seeds: [
|
|
19023
18965
|
{
|
|
19024
18966
|
kind: "const",
|
|
19025
18967
|
value: [
|
|
19026
|
-
98,
|
|
19027
|
-
114,
|
|
19028
18968
|
105,
|
|
19029
|
-
|
|
19030
|
-
103,
|
|
19031
|
-
101,
|
|
19032
|
-
45,
|
|
18969
|
+
110,
|
|
19033
18970
|
116,
|
|
18971
|
+
101,
|
|
18972
|
+
103,
|
|
19034
18973
|
114,
|
|
19035
18974
|
97,
|
|
18975
|
+
116,
|
|
18976
|
+
105,
|
|
18977
|
+
111,
|
|
19036
18978
|
110,
|
|
19037
|
-
115,
|
|
19038
|
-
102,
|
|
19039
|
-
101,
|
|
19040
|
-
114,
|
|
19041
18979
|
45,
|
|
19042
|
-
|
|
19043
|
-
|
|
19044
|
-
|
|
18980
|
+
97,
|
|
18981
|
+
117,
|
|
18982
|
+
116,
|
|
18983
|
+
104,
|
|
19045
18984
|
111,
|
|
19046
18985
|
114,
|
|
19047
|
-
|
|
18986
|
+
105,
|
|
18987
|
+
116,
|
|
18988
|
+
121
|
|
19048
18989
|
]
|
|
19049
|
-
},
|
|
19050
|
-
{
|
|
19051
|
-
kind: "account",
|
|
19052
|
-
path: "glam_state"
|
|
19053
|
-
},
|
|
19054
|
-
{
|
|
19055
|
-
kind: "arg",
|
|
19056
|
-
path: "args.transfer_id"
|
|
19057
18990
|
}
|
|
19058
18991
|
]
|
|
19059
18992
|
}
|
|
19060
18993
|
},
|
|
19061
18994
|
{
|
|
19062
|
-
name: "
|
|
19063
|
-
|
|
19064
|
-
},
|
|
19065
|
-
{
|
|
19066
|
-
name: "source_mint"
|
|
19067
|
-
},
|
|
19068
|
-
{
|
|
19069
|
-
name: "auxiliary_token_account",
|
|
19070
|
-
writable: true
|
|
18995
|
+
name: "system_program",
|
|
18996
|
+
address: "11111111111111111111111111111111"
|
|
19071
18997
|
}
|
|
19072
18998
|
],
|
|
19073
18999
|
args: [
|
|
@@ -19119,141 +19045,6 @@ var instructions$8 = [
|
|
|
19119
19045
|
}
|
|
19120
19046
|
]
|
|
19121
19047
|
},
|
|
19122
|
-
{
|
|
19123
|
-
name: "fail_or_cancel_managed_transfer",
|
|
19124
|
-
docs: [
|
|
19125
|
-
"Marks a managed inflight transfer as failed or cancelled."
|
|
19126
|
-
],
|
|
19127
|
-
discriminator: [
|
|
19128
|
-
39,
|
|
19129
|
-
37,
|
|
19130
|
-
213,
|
|
19131
|
-
118,
|
|
19132
|
-
191,
|
|
19133
|
-
18,
|
|
19134
|
-
194,
|
|
19135
|
-
119
|
|
19136
|
-
],
|
|
19137
|
-
accounts: [
|
|
19138
|
-
{
|
|
19139
|
-
name: "glam_state",
|
|
19140
|
-
writable: true
|
|
19141
|
-
},
|
|
19142
|
-
{
|
|
19143
|
-
name: "glam_vault",
|
|
19144
|
-
writable: true,
|
|
19145
|
-
pda: {
|
|
19146
|
-
seeds: [
|
|
19147
|
-
{
|
|
19148
|
-
kind: "const",
|
|
19149
|
-
value: [
|
|
19150
|
-
118,
|
|
19151
|
-
97,
|
|
19152
|
-
117,
|
|
19153
|
-
108,
|
|
19154
|
-
116
|
|
19155
|
-
]
|
|
19156
|
-
},
|
|
19157
|
-
{
|
|
19158
|
-
kind: "account",
|
|
19159
|
-
path: "glam_state"
|
|
19160
|
-
}
|
|
19161
|
-
],
|
|
19162
|
-
program: {
|
|
19163
|
-
kind: "account",
|
|
19164
|
-
path: "glam_protocol_program"
|
|
19165
|
-
}
|
|
19166
|
-
}
|
|
19167
|
-
},
|
|
19168
|
-
{
|
|
19169
|
-
name: "glam_signer",
|
|
19170
|
-
signer: true
|
|
19171
|
-
},
|
|
19172
|
-
{
|
|
19173
|
-
name: "integration_authority",
|
|
19174
|
-
pda: {
|
|
19175
|
-
seeds: [
|
|
19176
|
-
{
|
|
19177
|
-
kind: "const",
|
|
19178
|
-
value: [
|
|
19179
|
-
105,
|
|
19180
|
-
110,
|
|
19181
|
-
116,
|
|
19182
|
-
101,
|
|
19183
|
-
103,
|
|
19184
|
-
114,
|
|
19185
|
-
97,
|
|
19186
|
-
116,
|
|
19187
|
-
105,
|
|
19188
|
-
111,
|
|
19189
|
-
110,
|
|
19190
|
-
45,
|
|
19191
|
-
97,
|
|
19192
|
-
117,
|
|
19193
|
-
116,
|
|
19194
|
-
104,
|
|
19195
|
-
111,
|
|
19196
|
-
114,
|
|
19197
|
-
105,
|
|
19198
|
-
116,
|
|
19199
|
-
121
|
|
19200
|
-
]
|
|
19201
|
-
}
|
|
19202
|
-
]
|
|
19203
|
-
}
|
|
19204
|
-
},
|
|
19205
|
-
{
|
|
19206
|
-
name: "glam_protocol_program",
|
|
19207
|
-
address: "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
|
|
19208
|
-
},
|
|
19209
|
-
{
|
|
19210
|
-
name: "system_program",
|
|
19211
|
-
address: "11111111111111111111111111111111"
|
|
19212
|
-
},
|
|
19213
|
-
{
|
|
19214
|
-
name: "bridge_registry",
|
|
19215
|
-
writable: true,
|
|
19216
|
-
pda: {
|
|
19217
|
-
seeds: [
|
|
19218
|
-
{
|
|
19219
|
-
kind: "const",
|
|
19220
|
-
value: [
|
|
19221
|
-
98,
|
|
19222
|
-
114,
|
|
19223
|
-
105,
|
|
19224
|
-
100,
|
|
19225
|
-
103,
|
|
19226
|
-
101,
|
|
19227
|
-
45,
|
|
19228
|
-
114,
|
|
19229
|
-
101,
|
|
19230
|
-
103,
|
|
19231
|
-
105,
|
|
19232
|
-
115,
|
|
19233
|
-
116,
|
|
19234
|
-
114,
|
|
19235
|
-
121
|
|
19236
|
-
]
|
|
19237
|
-
},
|
|
19238
|
-
{
|
|
19239
|
-
kind: "account",
|
|
19240
|
-
path: "glam_state"
|
|
19241
|
-
}
|
|
19242
|
-
]
|
|
19243
|
-
}
|
|
19244
|
-
},
|
|
19245
|
-
{
|
|
19246
|
-
name: "transfer_record",
|
|
19247
|
-
writable: true
|
|
19248
|
-
}
|
|
19249
|
-
],
|
|
19250
|
-
args: [
|
|
19251
|
-
{
|
|
19252
|
-
name: "failure_reason",
|
|
19253
|
-
type: "u8"
|
|
19254
|
-
}
|
|
19255
|
-
]
|
|
19256
|
-
},
|
|
19257
19048
|
{
|
|
19258
19049
|
name: "prepare_oft_transfer",
|
|
19259
19050
|
docs: [
|
|
@@ -19444,19 +19235,19 @@ var instructions$8 = [
|
|
|
19444
19235
|
]
|
|
19445
19236
|
},
|
|
19446
19237
|
{
|
|
19447
|
-
name: "
|
|
19238
|
+
name: "price_managed_transfers",
|
|
19448
19239
|
docs: [
|
|
19449
|
-
"
|
|
19240
|
+
"Prices managed inflight transfers and publishes aggregated amount."
|
|
19450
19241
|
],
|
|
19451
19242
|
discriminator: [
|
|
19452
|
-
|
|
19453
|
-
|
|
19454
|
-
|
|
19455
|
-
|
|
19456
|
-
|
|
19457
|
-
|
|
19458
|
-
|
|
19459
|
-
|
|
19243
|
+
77,
|
|
19244
|
+
76,
|
|
19245
|
+
20,
|
|
19246
|
+
48,
|
|
19247
|
+
41,
|
|
19248
|
+
168,
|
|
19249
|
+
205,
|
|
19250
|
+
81
|
|
19460
19251
|
],
|
|
19461
19252
|
accounts: [
|
|
19462
19253
|
{
|
|
@@ -19464,35 +19255,36 @@ var instructions$8 = [
|
|
|
19464
19255
|
writable: true
|
|
19465
19256
|
},
|
|
19466
19257
|
{
|
|
19467
|
-
name: "
|
|
19468
|
-
writable: true,
|
|
19258
|
+
name: "bridge_registry",
|
|
19469
19259
|
pda: {
|
|
19470
19260
|
seeds: [
|
|
19471
19261
|
{
|
|
19472
19262
|
kind: "const",
|
|
19473
19263
|
value: [
|
|
19474
|
-
|
|
19475
|
-
|
|
19476
|
-
|
|
19477
|
-
|
|
19478
|
-
|
|
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
|
|
19479
19279
|
]
|
|
19480
19280
|
},
|
|
19481
19281
|
{
|
|
19482
19282
|
kind: "account",
|
|
19483
19283
|
path: "glam_state"
|
|
19484
19284
|
}
|
|
19485
|
-
]
|
|
19486
|
-
program: {
|
|
19487
|
-
kind: "account",
|
|
19488
|
-
path: "glam_protocol_program"
|
|
19489
|
-
}
|
|
19285
|
+
]
|
|
19490
19286
|
}
|
|
19491
19287
|
},
|
|
19492
|
-
{
|
|
19493
|
-
name: "glam_signer",
|
|
19494
|
-
signer: true
|
|
19495
|
-
},
|
|
19496
19288
|
{
|
|
19497
19289
|
name: "integration_authority",
|
|
19498
19290
|
pda: {
|
|
@@ -19531,44 +19323,69 @@ var instructions$8 = [
|
|
|
19531
19323
|
address: "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
|
|
19532
19324
|
},
|
|
19533
19325
|
{
|
|
19534
|
-
name: "
|
|
19535
|
-
address: "11111111111111111111111111111111"
|
|
19536
|
-
},
|
|
19537
|
-
{
|
|
19538
|
-
name: "bridge_registry",
|
|
19539
|
-
writable: true,
|
|
19326
|
+
name: "glam_config",
|
|
19540
19327
|
pda: {
|
|
19541
19328
|
seeds: [
|
|
19542
19329
|
{
|
|
19543
19330
|
kind: "const",
|
|
19544
19331
|
value: [
|
|
19545
|
-
98,
|
|
19546
|
-
114,
|
|
19547
|
-
105,
|
|
19548
|
-
100,
|
|
19549
19332
|
103,
|
|
19550
|
-
|
|
19333
|
+
108,
|
|
19334
|
+
111,
|
|
19335
|
+
98,
|
|
19336
|
+
97,
|
|
19337
|
+
108,
|
|
19551
19338
|
45,
|
|
19552
|
-
|
|
19553
|
-
|
|
19554
|
-
|
|
19339
|
+
99,
|
|
19340
|
+
111,
|
|
19341
|
+
110,
|
|
19342
|
+
102,
|
|
19555
19343
|
105,
|
|
19556
|
-
|
|
19557
|
-
116,
|
|
19558
|
-
114,
|
|
19559
|
-
121
|
|
19344
|
+
103
|
|
19560
19345
|
]
|
|
19561
|
-
},
|
|
19562
|
-
{
|
|
19563
|
-
kind: "account",
|
|
19564
|
-
path: "glam_state"
|
|
19565
19346
|
}
|
|
19566
|
-
]
|
|
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
|
+
}
|
|
19567
19385
|
}
|
|
19568
19386
|
},
|
|
19569
19387
|
{
|
|
19570
|
-
name: "
|
|
19571
|
-
writable: true
|
|
19388
|
+
name: "base_asset_oracle"
|
|
19572
19389
|
}
|
|
19573
19390
|
],
|
|
19574
19391
|
args: []
|
|
@@ -19576,7 +19393,7 @@ var instructions$8 = [
|
|
|
19576
19393
|
{
|
|
19577
19394
|
name: "settle_managed_transfer",
|
|
19578
19395
|
docs: [
|
|
19579
|
-
"
|
|
19396
|
+
"Settles a managed inflight transfer and removes it from the registry."
|
|
19580
19397
|
],
|
|
19581
19398
|
discriminator: [
|
|
19582
19399
|
197,
|
|
@@ -19590,18 +19407,124 @@ var instructions$8 = [
|
|
|
19590
19407
|
],
|
|
19591
19408
|
accounts: [
|
|
19592
19409
|
{
|
|
19593
|
-
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
|
+
}
|
|
19594
19438
|
},
|
|
19595
19439
|
{
|
|
19596
19440
|
name: "glam_signer",
|
|
19441
|
+
writable: true,
|
|
19597
19442
|
signer: true
|
|
19598
19443
|
},
|
|
19599
19444
|
{
|
|
19600
|
-
name: "
|
|
19601
|
-
|
|
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"
|
|
19602
19516
|
}
|
|
19603
19517
|
],
|
|
19604
|
-
args: [
|
|
19518
|
+
args: [
|
|
19519
|
+
{
|
|
19520
|
+
name: "args",
|
|
19521
|
+
type: {
|
|
19522
|
+
defined: {
|
|
19523
|
+
name: "SettleManagedTransferArgs"
|
|
19524
|
+
}
|
|
19525
|
+
}
|
|
19526
|
+
}
|
|
19527
|
+
]
|
|
19605
19528
|
},
|
|
19606
19529
|
{
|
|
19607
19530
|
name: "update_layerzero_oft_route",
|
|
@@ -19640,6 +19563,74 @@ var instructions$8 = [
|
|
|
19640
19563
|
}
|
|
19641
19564
|
}
|
|
19642
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
|
+
]
|
|
19643
19634
|
}
|
|
19644
19635
|
];
|
|
19645
19636
|
var accounts$8 = [
|
|
@@ -19669,19 +19660,6 @@ var accounts$8 = [
|
|
|
19669
19660
|
184
|
|
19670
19661
|
]
|
|
19671
19662
|
},
|
|
19672
|
-
{
|
|
19673
|
-
name: "BridgeTransferRecord",
|
|
19674
|
-
discriminator: [
|
|
19675
|
-
46,
|
|
19676
|
-
131,
|
|
19677
|
-
253,
|
|
19678
|
-
32,
|
|
19679
|
-
218,
|
|
19680
|
-
137,
|
|
19681
|
-
45,
|
|
19682
|
-
96
|
|
19683
|
-
]
|
|
19684
|
-
},
|
|
19685
19663
|
{
|
|
19686
19664
|
name: "StateAccount",
|
|
19687
19665
|
discriminator: [
|
|
@@ -19801,6 +19779,26 @@ var errors$2 = [
|
|
|
19801
19779
|
code: 6020,
|
|
19802
19780
|
name: "InvalidOftAuxiliaryBalance",
|
|
19803
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"
|
|
19804
19802
|
}
|
|
19805
19803
|
];
|
|
19806
19804
|
var types$8 = [
|
|
@@ -19865,61 +19863,24 @@ var types$8 = [
|
|
|
19865
19863
|
}
|
|
19866
19864
|
},
|
|
19867
19865
|
{
|
|
19868
|
-
name: "
|
|
19869
|
-
|
|
19870
|
-
|
|
19871
|
-
|
|
19872
|
-
|
|
19873
|
-
name: "glam_state",
|
|
19874
|
-
type: "pubkey"
|
|
19875
|
-
},
|
|
19876
|
-
{
|
|
19877
|
-
name: "managed_transfer_count",
|
|
19878
|
-
type: "u64"
|
|
19879
|
-
},
|
|
19880
|
-
{
|
|
19881
|
-
name: "bump",
|
|
19882
|
-
type: "u8"
|
|
19883
|
-
}
|
|
19884
|
-
]
|
|
19885
|
-
}
|
|
19886
|
-
},
|
|
19887
|
-
{
|
|
19888
|
-
name: "BridgeSession",
|
|
19866
|
+
name: "BridgeManagedTransfer",
|
|
19867
|
+
serialization: "bytemuckunsafe",
|
|
19868
|
+
repr: {
|
|
19869
|
+
kind: "c"
|
|
19870
|
+
},
|
|
19889
19871
|
type: {
|
|
19890
19872
|
kind: "struct",
|
|
19891
19873
|
fields: [
|
|
19892
|
-
{
|
|
19893
|
-
name: "glam_state",
|
|
19894
|
-
type: "pubkey"
|
|
19895
|
-
},
|
|
19896
|
-
{
|
|
19897
|
-
name: "signer",
|
|
19898
|
-
type: "pubkey"
|
|
19899
|
-
},
|
|
19900
19874
|
{
|
|
19901
19875
|
name: "transfer_id",
|
|
19902
|
-
type:
|
|
19903
|
-
array: [
|
|
19904
|
-
"u8",
|
|
19905
|
-
32
|
|
19906
|
-
]
|
|
19907
|
-
}
|
|
19908
|
-
},
|
|
19909
|
-
{
|
|
19910
|
-
name: "protocol",
|
|
19911
|
-
type: "u16"
|
|
19912
|
-
},
|
|
19913
|
-
{
|
|
19914
|
-
name: "managed",
|
|
19915
|
-
type: "bool"
|
|
19876
|
+
type: "pubkey"
|
|
19916
19877
|
},
|
|
19917
19878
|
{
|
|
19918
19879
|
name: "source_mint",
|
|
19919
19880
|
type: "pubkey"
|
|
19920
19881
|
},
|
|
19921
19882
|
{
|
|
19922
|
-
name: "
|
|
19883
|
+
name: "destination_recipient",
|
|
19923
19884
|
type: "pubkey"
|
|
19924
19885
|
},
|
|
19925
19886
|
{
|
|
@@ -19931,30 +19892,9 @@ var types$8 = [
|
|
|
19931
19892
|
type: "pubkey"
|
|
19932
19893
|
},
|
|
19933
19894
|
{
|
|
19934
|
-
name: "
|
|
19935
|
-
type: "pubkey"
|
|
19936
|
-
},
|
|
19937
|
-
{
|
|
19938
|
-
name: "provider_delegate",
|
|
19939
|
-
type: "pubkey"
|
|
19940
|
-
},
|
|
19941
|
-
{
|
|
19942
|
-
name: "provider_receipt",
|
|
19895
|
+
name: "provider_emitter",
|
|
19943
19896
|
type: "pubkey"
|
|
19944
19897
|
},
|
|
19945
|
-
{
|
|
19946
|
-
name: "provider_instruction_hash",
|
|
19947
|
-
type: {
|
|
19948
|
-
array: [
|
|
19949
|
-
"u8",
|
|
19950
|
-
32
|
|
19951
|
-
]
|
|
19952
|
-
}
|
|
19953
|
-
},
|
|
19954
|
-
{
|
|
19955
|
-
name: "provider_instruction_count",
|
|
19956
|
-
type: "u16"
|
|
19957
|
-
},
|
|
19958
19898
|
{
|
|
19959
19899
|
name: "source_amount",
|
|
19960
19900
|
type: "u64"
|
|
@@ -19964,38 +19904,47 @@ var types$8 = [
|
|
|
19964
19904
|
type: "u64"
|
|
19965
19905
|
},
|
|
19966
19906
|
{
|
|
19967
|
-
name: "
|
|
19907
|
+
name: "provider_sequence",
|
|
19968
19908
|
type: "u64"
|
|
19969
19909
|
},
|
|
19970
19910
|
{
|
|
19971
|
-
name: "
|
|
19911
|
+
name: "committed_slot",
|
|
19972
19912
|
type: "u64"
|
|
19973
19913
|
},
|
|
19974
19914
|
{
|
|
19975
|
-
name: "
|
|
19915
|
+
name: "protocol",
|
|
19976
19916
|
type: "u16"
|
|
19977
19917
|
},
|
|
19978
19918
|
{
|
|
19979
|
-
name: "
|
|
19980
|
-
type: "
|
|
19919
|
+
name: "destination_chain",
|
|
19920
|
+
type: "u16"
|
|
19981
19921
|
},
|
|
19982
19922
|
{
|
|
19983
|
-
name: "
|
|
19984
|
-
type: "
|
|
19923
|
+
name: "source_decimals",
|
|
19924
|
+
type: "u8"
|
|
19985
19925
|
},
|
|
19986
19926
|
{
|
|
19987
|
-
name: "
|
|
19988
|
-
type: "
|
|
19927
|
+
name: "status",
|
|
19928
|
+
type: "u8"
|
|
19989
19929
|
},
|
|
19990
19930
|
{
|
|
19991
|
-
name: "
|
|
19992
|
-
type:
|
|
19931
|
+
name: "reserved",
|
|
19932
|
+
type: {
|
|
19933
|
+
array: [
|
|
19934
|
+
"u8",
|
|
19935
|
+
2
|
|
19936
|
+
]
|
|
19937
|
+
}
|
|
19993
19938
|
}
|
|
19994
19939
|
]
|
|
19995
19940
|
}
|
|
19996
19941
|
},
|
|
19997
19942
|
{
|
|
19998
|
-
name: "
|
|
19943
|
+
name: "BridgeRegistry",
|
|
19944
|
+
serialization: "bytemuckunsafe",
|
|
19945
|
+
repr: {
|
|
19946
|
+
kind: "c"
|
|
19947
|
+
},
|
|
19999
19948
|
type: {
|
|
20000
19949
|
kind: "struct",
|
|
20001
19950
|
fields: [
|
|
@@ -20004,38 +19953,67 @@ var types$8 = [
|
|
|
20004
19953
|
type: "pubkey"
|
|
20005
19954
|
},
|
|
20006
19955
|
{
|
|
20007
|
-
name: "
|
|
19956
|
+
name: "managed_transfer_count",
|
|
19957
|
+
type: "u8"
|
|
19958
|
+
},
|
|
19959
|
+
{
|
|
19960
|
+
name: "reserved",
|
|
20008
19961
|
type: {
|
|
20009
19962
|
array: [
|
|
20010
19963
|
"u8",
|
|
20011
|
-
|
|
19964
|
+
7
|
|
20012
19965
|
]
|
|
20013
19966
|
}
|
|
20014
19967
|
},
|
|
20015
19968
|
{
|
|
20016
|
-
name: "
|
|
20017
|
-
type: "u16"
|
|
20018
|
-
},
|
|
20019
|
-
{
|
|
20020
|
-
name: "status",
|
|
19969
|
+
name: "transfers",
|
|
20021
19970
|
type: {
|
|
20022
|
-
|
|
20023
|
-
|
|
20024
|
-
|
|
19971
|
+
array: [
|
|
19972
|
+
{
|
|
19973
|
+
defined: {
|
|
19974
|
+
name: "BridgeManagedTransfer"
|
|
19975
|
+
}
|
|
19976
|
+
},
|
|
19977
|
+
16
|
|
19978
|
+
]
|
|
20025
19979
|
}
|
|
19980
|
+
}
|
|
19981
|
+
]
|
|
19982
|
+
}
|
|
19983
|
+
},
|
|
19984
|
+
{
|
|
19985
|
+
name: "BridgeSession",
|
|
19986
|
+
type: {
|
|
19987
|
+
kind: "struct",
|
|
19988
|
+
fields: [
|
|
19989
|
+
{
|
|
19990
|
+
name: "glam_state",
|
|
19991
|
+
type: "pubkey"
|
|
20026
19992
|
},
|
|
20027
19993
|
{
|
|
20028
|
-
name: "
|
|
20029
|
-
type: "
|
|
19994
|
+
name: "signer",
|
|
19995
|
+
type: "pubkey"
|
|
20030
19996
|
},
|
|
20031
19997
|
{
|
|
20032
|
-
name: "
|
|
19998
|
+
name: "transfer_id",
|
|
19999
|
+
type: "pubkey"
|
|
20000
|
+
},
|
|
20001
|
+
{
|
|
20002
|
+
name: "protocol",
|
|
20003
|
+
type: "u16"
|
|
20004
|
+
},
|
|
20005
|
+
{
|
|
20006
|
+
name: "managed",
|
|
20033
20007
|
type: "bool"
|
|
20034
20008
|
},
|
|
20035
20009
|
{
|
|
20036
20010
|
name: "source_mint",
|
|
20037
20011
|
type: "pubkey"
|
|
20038
20012
|
},
|
|
20013
|
+
{
|
|
20014
|
+
name: "source_decimals",
|
|
20015
|
+
type: "u8"
|
|
20016
|
+
},
|
|
20039
20017
|
{
|
|
20040
20018
|
name: "source_token_account",
|
|
20041
20019
|
type: "pubkey"
|
|
@@ -20049,23 +20027,19 @@ var types$8 = [
|
|
|
20049
20027
|
type: "pubkey"
|
|
20050
20028
|
},
|
|
20051
20029
|
{
|
|
20052
|
-
name: "
|
|
20053
|
-
type: "
|
|
20054
|
-
},
|
|
20055
|
-
{
|
|
20056
|
-
name: "quoted_out_amount",
|
|
20057
|
-
type: "u64"
|
|
20030
|
+
name: "provider_sender",
|
|
20031
|
+
type: "pubkey"
|
|
20058
20032
|
},
|
|
20059
20033
|
{
|
|
20060
|
-
name: "
|
|
20061
|
-
type: "
|
|
20034
|
+
name: "provider_delegate",
|
|
20035
|
+
type: "pubkey"
|
|
20062
20036
|
},
|
|
20063
20037
|
{
|
|
20064
|
-
name: "
|
|
20038
|
+
name: "provider_receipt",
|
|
20065
20039
|
type: "pubkey"
|
|
20066
20040
|
},
|
|
20067
20041
|
{
|
|
20068
|
-
name: "
|
|
20042
|
+
name: "provider_instruction_hash",
|
|
20069
20043
|
type: {
|
|
20070
20044
|
array: [
|
|
20071
20045
|
"u8",
|
|
@@ -20074,52 +20048,44 @@ var types$8 = [
|
|
|
20074
20048
|
}
|
|
20075
20049
|
},
|
|
20076
20050
|
{
|
|
20077
|
-
name: "
|
|
20078
|
-
type: "
|
|
20051
|
+
name: "provider_instruction_count",
|
|
20052
|
+
type: "u16"
|
|
20079
20053
|
},
|
|
20080
20054
|
{
|
|
20081
|
-
name: "
|
|
20055
|
+
name: "source_amount",
|
|
20082
20056
|
type: "u64"
|
|
20083
20057
|
},
|
|
20084
20058
|
{
|
|
20085
|
-
name: "
|
|
20059
|
+
name: "quoted_out_amount",
|
|
20086
20060
|
type: "u64"
|
|
20087
20061
|
},
|
|
20088
20062
|
{
|
|
20089
|
-
name: "
|
|
20063
|
+
name: "initial_source_balance",
|
|
20090
20064
|
type: "u64"
|
|
20091
20065
|
},
|
|
20092
20066
|
{
|
|
20093
|
-
name: "
|
|
20067
|
+
name: "initial_provider_sequence",
|
|
20094
20068
|
type: "u64"
|
|
20095
20069
|
},
|
|
20096
20070
|
{
|
|
20097
|
-
name: "
|
|
20098
|
-
type: "
|
|
20071
|
+
name: "destination_chain",
|
|
20072
|
+
type: "u16"
|
|
20099
20073
|
},
|
|
20100
20074
|
{
|
|
20101
|
-
name: "
|
|
20102
|
-
type: "
|
|
20103
|
-
}
|
|
20104
|
-
]
|
|
20105
|
-
}
|
|
20106
|
-
},
|
|
20107
|
-
{
|
|
20108
|
-
name: "BridgeTransferStatus",
|
|
20109
|
-
type: {
|
|
20110
|
-
kind: "enum",
|
|
20111
|
-
variants: [
|
|
20112
|
-
{
|
|
20113
|
-
name: "Committed"
|
|
20075
|
+
name: "destination_recipient",
|
|
20076
|
+
type: "pubkey"
|
|
20114
20077
|
},
|
|
20115
20078
|
{
|
|
20116
|
-
name: "
|
|
20079
|
+
name: "quote_expires_at",
|
|
20080
|
+
type: "i64"
|
|
20117
20081
|
},
|
|
20118
20082
|
{
|
|
20119
|
-
name: "
|
|
20083
|
+
name: "prepared_slot",
|
|
20084
|
+
type: "u64"
|
|
20120
20085
|
},
|
|
20121
20086
|
{
|
|
20122
|
-
name: "
|
|
20087
|
+
name: "bump",
|
|
20088
|
+
type: "u8"
|
|
20123
20089
|
}
|
|
20124
20090
|
]
|
|
20125
20091
|
}
|
|
@@ -20131,12 +20097,7 @@ var types$8 = [
|
|
|
20131
20097
|
fields: [
|
|
20132
20098
|
{
|
|
20133
20099
|
name: "transfer_id",
|
|
20134
|
-
type:
|
|
20135
|
-
array: [
|
|
20136
|
-
"u8",
|
|
20137
|
-
32
|
|
20138
|
-
]
|
|
20139
|
-
}
|
|
20100
|
+
type: "pubkey"
|
|
20140
20101
|
}
|
|
20141
20102
|
]
|
|
20142
20103
|
}
|
|
@@ -20840,12 +20801,7 @@ var types$8 = [
|
|
|
20840
20801
|
fields: [
|
|
20841
20802
|
{
|
|
20842
20803
|
name: "transfer_id",
|
|
20843
|
-
type:
|
|
20844
|
-
array: [
|
|
20845
|
-
"u8",
|
|
20846
|
-
32
|
|
20847
|
-
]
|
|
20848
|
-
}
|
|
20804
|
+
type: "pubkey"
|
|
20849
20805
|
},
|
|
20850
20806
|
{
|
|
20851
20807
|
name: "middle_instruction_hash",
|
|
@@ -20981,6 +20937,18 @@ var types$8 = [
|
|
|
20981
20937
|
]
|
|
20982
20938
|
}
|
|
20983
20939
|
},
|
|
20940
|
+
{
|
|
20941
|
+
name: "SettleManagedTransferArgs",
|
|
20942
|
+
type: {
|
|
20943
|
+
kind: "struct",
|
|
20944
|
+
fields: [
|
|
20945
|
+
{
|
|
20946
|
+
name: "transfer_id",
|
|
20947
|
+
type: "pubkey"
|
|
20948
|
+
}
|
|
20949
|
+
]
|
|
20950
|
+
}
|
|
20951
|
+
},
|
|
20984
20952
|
{
|
|
20985
20953
|
name: "StateAccount",
|
|
20986
20954
|
type: {
|
|
@@ -21127,6 +21095,18 @@ var types$8 = [
|
|
|
21127
21095
|
]
|
|
21128
21096
|
}
|
|
21129
21097
|
},
|
|
21098
|
+
{
|
|
21099
|
+
name: "ValidateManagedTransferArgs",
|
|
21100
|
+
type: {
|
|
21101
|
+
kind: "struct",
|
|
21102
|
+
fields: [
|
|
21103
|
+
{
|
|
21104
|
+
name: "transfer_id",
|
|
21105
|
+
type: "pubkey"
|
|
21106
|
+
}
|
|
21107
|
+
]
|
|
21108
|
+
}
|
|
21109
|
+
},
|
|
21130
21110
|
{
|
|
21131
21111
|
name: "ValuationModel",
|
|
21132
21112
|
type: {
|
|
@@ -21144,14 +21124,19 @@ var types$8 = [
|
|
|
21144
21124
|
];
|
|
21145
21125
|
var constants$8 = [
|
|
21146
21126
|
{
|
|
21147
|
-
name: "
|
|
21127
|
+
name: "PROTO_BRIDGE_PERM_SEND",
|
|
21148
21128
|
type: "u64",
|
|
21149
|
-
value: "
|
|
21129
|
+
value: "1"
|
|
21150
21130
|
},
|
|
21151
21131
|
{
|
|
21152
|
-
name: "
|
|
21132
|
+
name: "PROTO_BRIDGE_PERM_SETTLE",
|
|
21153
21133
|
type: "u64",
|
|
21154
|
-
value: "
|
|
21134
|
+
value: "4"
|
|
21135
|
+
},
|
|
21136
|
+
{
|
|
21137
|
+
name: "PROTO_BRIDGE_PERM_VALIDATE",
|
|
21138
|
+
type: "u64",
|
|
21139
|
+
value: "2"
|
|
21155
21140
|
},
|
|
21156
21141
|
{
|
|
21157
21142
|
name: "PROTO_LAYERZERO_OFT",
|
|
@@ -46247,6 +46232,7 @@ class JupiterApiClient {
|
|
|
46247
46232
|
this.name = data.name ?? null;
|
|
46248
46233
|
this.uri = data.uri ?? null;
|
|
46249
46234
|
this.enabled = data.enabled ?? null;
|
|
46235
|
+
this.oracleConfigs = data.oracleConfigs ?? null;
|
|
46250
46236
|
this.assets = data.assets ?? null;
|
|
46251
46237
|
this.created = data.created ?? null;
|
|
46252
46238
|
this.owner = data.owner ?? null;
|
|
@@ -51561,6 +51547,8 @@ class PriceClient {
|
|
|
51561
51547
|
}
|
|
51562
51548
|
const epiRefreshIx = await this.priceEpiValidatedPositionsIx();
|
|
51563
51549
|
if (epiRefreshIx) pricingIxs.push(epiRefreshIx);
|
|
51550
|
+
const priceBridgeIxs = await this.bridge.txBuilder.priceManagedTransfersIxs();
|
|
51551
|
+
if (priceBridgeIxs) pricingIxs.push(...priceBridgeIxs);
|
|
51564
51552
|
return pricingIxs.filter(Boolean);
|
|
51565
51553
|
}
|
|
51566
51554
|
async validateAumIx() {
|
|
@@ -51600,10 +51588,11 @@ class PriceClient {
|
|
|
51600
51588
|
kaminoReserves
|
|
51601
51589
|
];
|
|
51602
51590
|
}
|
|
51603
|
-
constructor(base, klend, kvaults, getJupiterApi){
|
|
51591
|
+
constructor(base, klend, kvaults, bridge, getJupiterApi){
|
|
51604
51592
|
this.base = base;
|
|
51605
51593
|
this.klend = klend;
|
|
51606
51594
|
this.kvaults = kvaults;
|
|
51595
|
+
this.bridge = bridge;
|
|
51607
51596
|
this.getJupiterApi = getJupiterApi;
|
|
51608
51597
|
this._stateModel = null;
|
|
51609
51598
|
this._lookupTables = new PkSet();
|
|
@@ -53289,13 +53278,6 @@ function resolveCanonicalLayerzeroOftRouteProfile(params) {
|
|
|
53289
53278
|
}
|
|
53290
53279
|
|
|
53291
53280
|
const LAYERZERO_OFT_PROTOCOL = 1 << 2;
|
|
53292
|
-
function toFixedArray32$1(value, label) {
|
|
53293
|
-
const bytes = Array.from(Buffer.from(value));
|
|
53294
|
-
if (bytes.length !== 32) {
|
|
53295
|
-
throw new Error(`${label} must be exactly 32 bytes`);
|
|
53296
|
-
}
|
|
53297
|
-
return bytes;
|
|
53298
|
-
}
|
|
53299
53281
|
function appendU16Le(parts, value) {
|
|
53300
53282
|
const out = Buffer.alloc(2);
|
|
53301
53283
|
out.writeUInt16LE(value, 0);
|
|
@@ -53394,15 +53376,53 @@ function getBridgeSessionPda(glamState, transferId, bridgeProgramId) {
|
|
|
53394
53376
|
return PublicKey.findProgramAddressSync([
|
|
53395
53377
|
Buffer.from(SEED_BRIDGE_SESSION),
|
|
53396
53378
|
glamState.toBuffer(),
|
|
53397
|
-
|
|
53379
|
+
transferId.toBuffer()
|
|
53398
53380
|
], bridgeProgramId)[0];
|
|
53399
53381
|
}
|
|
53400
|
-
function
|
|
53401
|
-
return
|
|
53402
|
-
|
|
53403
|
-
|
|
53404
|
-
|
|
53405
|
-
|
|
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
|
+
};
|
|
53406
53426
|
}
|
|
53407
53427
|
function toRouteManagementModeArg(managementMode) {
|
|
53408
53428
|
if (managementMode && typeof managementMode === "object" && ("unmanagedOnly" in managementMode || "managedOnly" in managementMode || "either" in managementMode)) {
|
|
@@ -53448,7 +53468,7 @@ async function deriveOftAuxiliaryAccountSeed(glamState, transferId) {
|
|
|
53448
53468
|
const digest = await sha256(Buffer.concat([
|
|
53449
53469
|
Buffer.from("oft-auxiliary-account"),
|
|
53450
53470
|
glamState.toBuffer(),
|
|
53451
|
-
|
|
53471
|
+
transferId.toBuffer()
|
|
53452
53472
|
]));
|
|
53453
53473
|
return digest.subarray(0, 16).toString("hex");
|
|
53454
53474
|
}
|
|
@@ -53521,10 +53541,9 @@ let TxBuilder$1 = class TxBuilder extends BaseTxBuilder {
|
|
|
53521
53541
|
if (params.providerInstructions.length !== 1) {
|
|
53522
53542
|
throw new Error("OFT transfers require exactly one provider instruction");
|
|
53523
53543
|
}
|
|
53524
|
-
const transferId =
|
|
53544
|
+
const transferId = params.transferId;
|
|
53525
53545
|
const registryPda = getBridgeRegistryPda(this.client.base.statePda, this.client.base.extBridgeProgram.programId);
|
|
53526
53546
|
const sessionPda = getBridgeSessionPda(this.client.base.statePda, transferId, this.client.base.extBridgeProgram.programId);
|
|
53527
|
-
const transferRecordPda = getBridgeTransferRecordPda(this.client.base.statePda, transferId, this.client.base.extBridgeProgram.programId);
|
|
53528
53547
|
const integrationAuthority = PublicKey.findProgramAddressSync([
|
|
53529
53548
|
Buffer.from(SEED_INTEGRATION_AUTHORITY)
|
|
53530
53549
|
], this.client.base.extBridgeProgram.programId)[0];
|
|
@@ -53577,17 +53596,16 @@ let TxBuilder$1 = class TxBuilder extends BaseTxBuilder {
|
|
|
53577
53596
|
glamState: this.client.base.statePda,
|
|
53578
53597
|
glamVault: this.client.base.vaultPda,
|
|
53579
53598
|
glamSigner: txOptions.signer || this.client.base.signer,
|
|
53580
|
-
integrationAuthority,
|
|
53581
53599
|
cpiProgram: tokenProgram,
|
|
53582
53600
|
glamProtocolProgram: this.client.base.protocolProgram.programId,
|
|
53583
|
-
systemProgram: SystemProgram.programId,
|
|
53584
53601
|
instructions: SYSVAR_INSTRUCTIONS_PUBKEY,
|
|
53585
53602
|
bridgeRegistry: registryPda,
|
|
53586
53603
|
bridgeSession: sessionPda,
|
|
53587
|
-
transferRecord: transferRecordPda,
|
|
53588
53604
|
sourceTokenAccount,
|
|
53589
53605
|
sourceMint: params.sourceMint,
|
|
53590
|
-
auxiliaryTokenAccount
|
|
53606
|
+
auxiliaryTokenAccount,
|
|
53607
|
+
integrationAuthority,
|
|
53608
|
+
systemProgram: SystemProgram.programId
|
|
53591
53609
|
});
|
|
53592
53610
|
commitMethod.remainingAccounts(commitRemainingAccounts);
|
|
53593
53611
|
const commitIx = await commitMethod.instruction();
|
|
@@ -53600,11 +53618,65 @@ let TxBuilder$1 = class TxBuilder extends BaseTxBuilder {
|
|
|
53600
53618
|
tx,
|
|
53601
53619
|
additionalSigners: params.providerSigners || [],
|
|
53602
53620
|
sessionPda,
|
|
53603
|
-
transferRecordPda,
|
|
53604
53621
|
auxiliaryTokenAccount,
|
|
53605
53622
|
sourceTokenAccount
|
|
53606
53623
|
};
|
|
53607
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
|
+
}
|
|
53608
53680
|
};
|
|
53609
53681
|
let LayerzeroOftBridgeProtocolClient = class LayerzeroOftBridgeProtocolClient {
|
|
53610
53682
|
async buildSendTx(params, txOptions = {}) {
|
|
@@ -53625,9 +53697,6 @@ class BridgeClient {
|
|
|
53625
53697
|
getSessionPda(transferId) {
|
|
53626
53698
|
return getBridgeSessionPda(this.base.statePda, transferId, this.base.extBridgeProgram.programId);
|
|
53627
53699
|
}
|
|
53628
|
-
getTransferRecordPda(transferId) {
|
|
53629
|
-
return getBridgeTransferRecordPda(this.base.statePda, transferId, this.base.extBridgeProgram.programId);
|
|
53630
|
-
}
|
|
53631
53700
|
getLayerzeroNoncePda(endpointProgram, sender, destinationChain, destinationRecipient) {
|
|
53632
53701
|
return deriveLayerzeroNoncePda(endpointProgram, sender, destinationChain, destinationRecipient);
|
|
53633
53702
|
}
|
|
@@ -53775,7 +53844,19 @@ class BridgeClient {
|
|
|
53775
53844
|
return await this.base.extBridgeProgram.account.bridgeSession.fetchNullable(this.getSessionPda(transferId));
|
|
53776
53845
|
}
|
|
53777
53846
|
async fetchTransferRecord(transferId) {
|
|
53778
|
-
|
|
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;
|
|
53779
53860
|
}
|
|
53780
53861
|
async addLayerzeroOftRoute(route, txOptions = {}) {
|
|
53781
53862
|
const glamSigner = txOptions.signer || this.base.signer;
|
|
@@ -53808,7 +53889,7 @@ class BridgeClient {
|
|
|
53808
53889
|
return await this.txBuilder.buildOftTransferTx(params, txOptions);
|
|
53809
53890
|
}
|
|
53810
53891
|
async buildLayerzeroOftSendTx(params, txOptions = {}) {
|
|
53811
|
-
const resolvedTransferId = params.transferId || Keypair.generate().publicKey
|
|
53892
|
+
const resolvedTransferId = params.transferId || Keypair.generate().publicKey;
|
|
53812
53893
|
const { tokenProgram } = await fetchMintAndTokenProgram(this.base.connection, params.sourceMint);
|
|
53813
53894
|
const signer = txOptions.signer || this.base.signer;
|
|
53814
53895
|
const sourceTokenAccount = params.sourceTokenAccount || this.base.getVaultAta(params.sourceMint, tokenProgram);
|
|
@@ -53881,63 +53962,39 @@ class BridgeClient {
|
|
|
53881
53962
|
};
|
|
53882
53963
|
}
|
|
53883
53964
|
async settleManagedTransfer(transferId, txOptions = {}) {
|
|
53884
|
-
const
|
|
53885
|
-
glamState: this.base.statePda,
|
|
53886
|
-
glamSigner: txOptions.signer || this.base.signer,
|
|
53887
|
-
transferRecord: this.getTransferRecordPda(transferId)
|
|
53888
|
-
}).instruction();
|
|
53889
|
-
const tx = await this.txBuilder.buildVersionedTx([
|
|
53890
|
-
ix
|
|
53891
|
-
], txOptions);
|
|
53892
|
-
return await this.base.sendAndConfirm(tx);
|
|
53893
|
-
}
|
|
53894
|
-
async reconcileManagedTransfer(transferId, txOptions = {}) {
|
|
53895
|
-
PublicKey.findProgramAddressSync([
|
|
53965
|
+
const integrationAuthority = PublicKey.findProgramAddressSync([
|
|
53896
53966
|
Buffer.from(SEED_INTEGRATION_AUTHORITY)
|
|
53897
53967
|
], this.base.extBridgeProgram.programId)[0];
|
|
53898
|
-
const ix = await this.base.extBridgeProgram.methods.
|
|
53968
|
+
const ix = await this.base.extBridgeProgram.methods.settleManagedTransfer({
|
|
53969
|
+
transferId
|
|
53970
|
+
}).accountsPartial({
|
|
53899
53971
|
glamState: this.base.statePda,
|
|
53900
|
-
|
|
53972
|
+
glamVault: this.base.vaultPda,
|
|
53901
53973
|
glamSigner: txOptions.signer || this.base.signer,
|
|
53902
|
-
|
|
53903
|
-
|
|
53904
|
-
|
|
53905
|
-
|
|
53906
|
-
transferRecord: this.getTransferRecordPda(transferId)
|
|
53974
|
+
glamProtocolProgram: this.base.protocolProgram.programId,
|
|
53975
|
+
bridgeRegistry: this.getRegistryPda(),
|
|
53976
|
+
integrationAuthority,
|
|
53977
|
+
systemProgram: SystemProgram.programId
|
|
53907
53978
|
}).instruction();
|
|
53908
53979
|
const tx = await this.txBuilder.buildVersionedTx([
|
|
53909
53980
|
ix
|
|
53910
53981
|
], txOptions);
|
|
53911
53982
|
return await this.base.sendAndConfirm(tx);
|
|
53912
53983
|
}
|
|
53913
|
-
async
|
|
53914
|
-
|
|
53915
|
-
|
|
53916
|
-
|
|
53917
|
-
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({
|
|
53918
53988
|
glamState: this.base.statePda,
|
|
53919
|
-
|
|
53920
|
-
glamSigner: txOptions.signer || this.base.signer,
|
|
53921
|
-
// integrationAuthority,
|
|
53922
|
-
// glamProtocolProgram: this.base.protocolProgram.programId,
|
|
53923
|
-
// systemProgram: SystemProgram.programId,
|
|
53924
|
-
// bridgeRegistry: this.getRegistryPda(),
|
|
53925
|
-
transferRecord: this.getTransferRecordPda(transferId)
|
|
53989
|
+
glamSigner: txOptions.signer || this.base.signer
|
|
53926
53990
|
}).instruction();
|
|
53927
53991
|
const tx = await this.txBuilder.buildVersionedTx([
|
|
53928
53992
|
ix
|
|
53929
53993
|
], txOptions);
|
|
53930
53994
|
return await this.base.sendAndConfirm(tx);
|
|
53931
53995
|
}
|
|
53932
|
-
async
|
|
53933
|
-
const
|
|
53934
|
-
glamState: this.base.statePda,
|
|
53935
|
-
glamSigner: txOptions.signer || this.base.signer,
|
|
53936
|
-
transferRecord: this.getTransferRecordPda(transferId)
|
|
53937
|
-
}).instruction();
|
|
53938
|
-
const tx = await this.txBuilder.buildVersionedTx([
|
|
53939
|
-
ix
|
|
53940
|
-
], txOptions);
|
|
53996
|
+
async priceManagedTransfers(txOptions = {}) {
|
|
53997
|
+
const tx = await this.txBuilder.priceManagedTransfersTx(txOptions);
|
|
53941
53998
|
return await this.base.sendAndConfirm(tx);
|
|
53942
53999
|
}
|
|
53943
54000
|
constructor(base){
|
|
@@ -54123,7 +54180,7 @@ class EpiClient {
|
|
|
54123
54180
|
}
|
|
54124
54181
|
get price() {
|
|
54125
54182
|
if (!this._price) {
|
|
54126
|
-
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);
|
|
54127
54184
|
}
|
|
54128
54185
|
return this._price;
|
|
54129
54186
|
}
|