@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.cjs.js
CHANGED
|
@@ -18838,37 +18838,6 @@ var instructions$8 = [
|
|
|
18838
18838
|
}
|
|
18839
18839
|
]
|
|
18840
18840
|
},
|
|
18841
|
-
{
|
|
18842
|
-
name: "cleanup_transfer_record",
|
|
18843
|
-
docs: [
|
|
18844
|
-
"Closes a finalized transfer record and returns its rent."
|
|
18845
|
-
],
|
|
18846
|
-
discriminator: [
|
|
18847
|
-
65,
|
|
18848
|
-
224,
|
|
18849
|
-
219,
|
|
18850
|
-
143,
|
|
18851
|
-
99,
|
|
18852
|
-
204,
|
|
18853
|
-
215,
|
|
18854
|
-
6
|
|
18855
|
-
],
|
|
18856
|
-
accounts: [
|
|
18857
|
-
{
|
|
18858
|
-
name: "glam_state"
|
|
18859
|
-
},
|
|
18860
|
-
{
|
|
18861
|
-
name: "glam_signer",
|
|
18862
|
-
writable: true,
|
|
18863
|
-
signer: true
|
|
18864
|
-
},
|
|
18865
|
-
{
|
|
18866
|
-
name: "transfer_record",
|
|
18867
|
-
writable: true
|
|
18868
|
-
}
|
|
18869
|
-
],
|
|
18870
|
-
args: []
|
|
18871
|
-
},
|
|
18872
18841
|
{
|
|
18873
18842
|
name: "commit_oft_transfer",
|
|
18874
18843
|
docs: [
|
|
@@ -18891,6 +18860,7 @@ var instructions$8 = [
|
|
|
18891
18860
|
},
|
|
18892
18861
|
{
|
|
18893
18862
|
name: "glam_vault",
|
|
18863
|
+
writable: true,
|
|
18894
18864
|
pda: {
|
|
18895
18865
|
seeds: [
|
|
18896
18866
|
{
|
|
@@ -18919,39 +18889,6 @@ var instructions$8 = [
|
|
|
18919
18889
|
writable: true,
|
|
18920
18890
|
signer: true
|
|
18921
18891
|
},
|
|
18922
|
-
{
|
|
18923
|
-
name: "integration_authority",
|
|
18924
|
-
pda: {
|
|
18925
|
-
seeds: [
|
|
18926
|
-
{
|
|
18927
|
-
kind: "const",
|
|
18928
|
-
value: [
|
|
18929
|
-
105,
|
|
18930
|
-
110,
|
|
18931
|
-
116,
|
|
18932
|
-
101,
|
|
18933
|
-
103,
|
|
18934
|
-
114,
|
|
18935
|
-
97,
|
|
18936
|
-
116,
|
|
18937
|
-
105,
|
|
18938
|
-
111,
|
|
18939
|
-
110,
|
|
18940
|
-
45,
|
|
18941
|
-
97,
|
|
18942
|
-
117,
|
|
18943
|
-
116,
|
|
18944
|
-
104,
|
|
18945
|
-
111,
|
|
18946
|
-
114,
|
|
18947
|
-
105,
|
|
18948
|
-
116,
|
|
18949
|
-
121
|
|
18950
|
-
]
|
|
18951
|
-
}
|
|
18952
|
-
]
|
|
18953
|
-
}
|
|
18954
|
-
},
|
|
18955
18892
|
{
|
|
18956
18893
|
name: "cpi_program"
|
|
18957
18894
|
},
|
|
@@ -18959,10 +18896,6 @@ var instructions$8 = [
|
|
|
18959
18896
|
name: "glam_protocol_program",
|
|
18960
18897
|
address: "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
|
|
18961
18898
|
},
|
|
18962
|
-
{
|
|
18963
|
-
name: "system_program",
|
|
18964
|
-
address: "11111111111111111111111111111111"
|
|
18965
|
-
},
|
|
18966
18899
|
{
|
|
18967
18900
|
name: "instructions",
|
|
18968
18901
|
address: "Sysvar1nstructions1111111111111111111111111"
|
|
@@ -19035,58 +18968,52 @@ var instructions$8 = [
|
|
|
19035
18968
|
}
|
|
19036
18969
|
},
|
|
19037
18970
|
{
|
|
19038
|
-
name: "
|
|
19039
|
-
writable: true
|
|
18971
|
+
name: "source_token_account",
|
|
18972
|
+
writable: true
|
|
18973
|
+
},
|
|
18974
|
+
{
|
|
18975
|
+
name: "source_mint"
|
|
18976
|
+
},
|
|
18977
|
+
{
|
|
18978
|
+
name: "auxiliary_token_account",
|
|
18979
|
+
writable: true
|
|
18980
|
+
},
|
|
18981
|
+
{
|
|
18982
|
+
name: "integration_authority",
|
|
19040
18983
|
pda: {
|
|
19041
18984
|
seeds: [
|
|
19042
18985
|
{
|
|
19043
18986
|
kind: "const",
|
|
19044
18987
|
value: [
|
|
19045
|
-
98,
|
|
19046
|
-
114,
|
|
19047
18988
|
105,
|
|
19048
|
-
|
|
19049
|
-
103,
|
|
19050
|
-
101,
|
|
19051
|
-
45,
|
|
18989
|
+
110,
|
|
19052
18990
|
116,
|
|
18991
|
+
101,
|
|
18992
|
+
103,
|
|
19053
18993
|
114,
|
|
19054
18994
|
97,
|
|
18995
|
+
116,
|
|
18996
|
+
105,
|
|
18997
|
+
111,
|
|
19055
18998
|
110,
|
|
19056
|
-
115,
|
|
19057
|
-
102,
|
|
19058
|
-
101,
|
|
19059
|
-
114,
|
|
19060
18999
|
45,
|
|
19061
|
-
|
|
19062
|
-
|
|
19063
|
-
|
|
19000
|
+
97,
|
|
19001
|
+
117,
|
|
19002
|
+
116,
|
|
19003
|
+
104,
|
|
19064
19004
|
111,
|
|
19065
19005
|
114,
|
|
19066
|
-
|
|
19006
|
+
105,
|
|
19007
|
+
116,
|
|
19008
|
+
121
|
|
19067
19009
|
]
|
|
19068
|
-
},
|
|
19069
|
-
{
|
|
19070
|
-
kind: "account",
|
|
19071
|
-
path: "glam_state"
|
|
19072
|
-
},
|
|
19073
|
-
{
|
|
19074
|
-
kind: "arg",
|
|
19075
|
-
path: "args.transfer_id"
|
|
19076
19010
|
}
|
|
19077
19011
|
]
|
|
19078
19012
|
}
|
|
19079
19013
|
},
|
|
19080
19014
|
{
|
|
19081
|
-
name: "
|
|
19082
|
-
|
|
19083
|
-
},
|
|
19084
|
-
{
|
|
19085
|
-
name: "source_mint"
|
|
19086
|
-
},
|
|
19087
|
-
{
|
|
19088
|
-
name: "auxiliary_token_account",
|
|
19089
|
-
writable: true
|
|
19015
|
+
name: "system_program",
|
|
19016
|
+
address: "11111111111111111111111111111111"
|
|
19090
19017
|
}
|
|
19091
19018
|
],
|
|
19092
19019
|
args: [
|
|
@@ -19138,140 +19065,6 @@ var instructions$8 = [
|
|
|
19138
19065
|
}
|
|
19139
19066
|
]
|
|
19140
19067
|
},
|
|
19141
|
-
{
|
|
19142
|
-
name: "fail_or_cancel_managed_transfer",
|
|
19143
|
-
docs: [
|
|
19144
|
-
"Marks a managed inflight transfer as failed or cancelled."
|
|
19145
|
-
],
|
|
19146
|
-
discriminator: [
|
|
19147
|
-
39,
|
|
19148
|
-
37,
|
|
19149
|
-
213,
|
|
19150
|
-
118,
|
|
19151
|
-
191,
|
|
19152
|
-
18,
|
|
19153
|
-
194,
|
|
19154
|
-
119
|
|
19155
|
-
],
|
|
19156
|
-
accounts: [
|
|
19157
|
-
{
|
|
19158
|
-
name: "glam_state",
|
|
19159
|
-
writable: true
|
|
19160
|
-
},
|
|
19161
|
-
{
|
|
19162
|
-
name: "glam_vault",
|
|
19163
|
-
pda: {
|
|
19164
|
-
seeds: [
|
|
19165
|
-
{
|
|
19166
|
-
kind: "const",
|
|
19167
|
-
value: [
|
|
19168
|
-
118,
|
|
19169
|
-
97,
|
|
19170
|
-
117,
|
|
19171
|
-
108,
|
|
19172
|
-
116
|
|
19173
|
-
]
|
|
19174
|
-
},
|
|
19175
|
-
{
|
|
19176
|
-
kind: "account",
|
|
19177
|
-
path: "glam_state"
|
|
19178
|
-
}
|
|
19179
|
-
],
|
|
19180
|
-
program: {
|
|
19181
|
-
kind: "account",
|
|
19182
|
-
path: "glam_protocol_program"
|
|
19183
|
-
}
|
|
19184
|
-
}
|
|
19185
|
-
},
|
|
19186
|
-
{
|
|
19187
|
-
name: "glam_signer",
|
|
19188
|
-
signer: true
|
|
19189
|
-
},
|
|
19190
|
-
{
|
|
19191
|
-
name: "integration_authority",
|
|
19192
|
-
pda: {
|
|
19193
|
-
seeds: [
|
|
19194
|
-
{
|
|
19195
|
-
kind: "const",
|
|
19196
|
-
value: [
|
|
19197
|
-
105,
|
|
19198
|
-
110,
|
|
19199
|
-
116,
|
|
19200
|
-
101,
|
|
19201
|
-
103,
|
|
19202
|
-
114,
|
|
19203
|
-
97,
|
|
19204
|
-
116,
|
|
19205
|
-
105,
|
|
19206
|
-
111,
|
|
19207
|
-
110,
|
|
19208
|
-
45,
|
|
19209
|
-
97,
|
|
19210
|
-
117,
|
|
19211
|
-
116,
|
|
19212
|
-
104,
|
|
19213
|
-
111,
|
|
19214
|
-
114,
|
|
19215
|
-
105,
|
|
19216
|
-
116,
|
|
19217
|
-
121
|
|
19218
|
-
]
|
|
19219
|
-
}
|
|
19220
|
-
]
|
|
19221
|
-
}
|
|
19222
|
-
},
|
|
19223
|
-
{
|
|
19224
|
-
name: "glam_protocol_program",
|
|
19225
|
-
address: "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
|
|
19226
|
-
},
|
|
19227
|
-
{
|
|
19228
|
-
name: "system_program",
|
|
19229
|
-
address: "11111111111111111111111111111111"
|
|
19230
|
-
},
|
|
19231
|
-
{
|
|
19232
|
-
name: "bridge_registry",
|
|
19233
|
-
writable: true,
|
|
19234
|
-
pda: {
|
|
19235
|
-
seeds: [
|
|
19236
|
-
{
|
|
19237
|
-
kind: "const",
|
|
19238
|
-
value: [
|
|
19239
|
-
98,
|
|
19240
|
-
114,
|
|
19241
|
-
105,
|
|
19242
|
-
100,
|
|
19243
|
-
103,
|
|
19244
|
-
101,
|
|
19245
|
-
45,
|
|
19246
|
-
114,
|
|
19247
|
-
101,
|
|
19248
|
-
103,
|
|
19249
|
-
105,
|
|
19250
|
-
115,
|
|
19251
|
-
116,
|
|
19252
|
-
114,
|
|
19253
|
-
121
|
|
19254
|
-
]
|
|
19255
|
-
},
|
|
19256
|
-
{
|
|
19257
|
-
kind: "account",
|
|
19258
|
-
path: "glam_state"
|
|
19259
|
-
}
|
|
19260
|
-
]
|
|
19261
|
-
}
|
|
19262
|
-
},
|
|
19263
|
-
{
|
|
19264
|
-
name: "transfer_record",
|
|
19265
|
-
writable: true
|
|
19266
|
-
}
|
|
19267
|
-
],
|
|
19268
|
-
args: [
|
|
19269
|
-
{
|
|
19270
|
-
name: "failure_reason",
|
|
19271
|
-
type: "u8"
|
|
19272
|
-
}
|
|
19273
|
-
]
|
|
19274
|
-
},
|
|
19275
19068
|
{
|
|
19276
19069
|
name: "prepare_oft_transfer",
|
|
19277
19070
|
docs: [
|
|
@@ -19462,19 +19255,19 @@ var instructions$8 = [
|
|
|
19462
19255
|
]
|
|
19463
19256
|
},
|
|
19464
19257
|
{
|
|
19465
|
-
name: "
|
|
19258
|
+
name: "price_managed_transfers",
|
|
19466
19259
|
docs: [
|
|
19467
|
-
"
|
|
19260
|
+
"Prices managed inflight transfers and publishes aggregated amount."
|
|
19468
19261
|
],
|
|
19469
19262
|
discriminator: [
|
|
19470
|
-
|
|
19471
|
-
|
|
19472
|
-
|
|
19473
|
-
|
|
19474
|
-
|
|
19475
|
-
|
|
19476
|
-
|
|
19477
|
-
|
|
19263
|
+
77,
|
|
19264
|
+
76,
|
|
19265
|
+
20,
|
|
19266
|
+
48,
|
|
19267
|
+
41,
|
|
19268
|
+
168,
|
|
19269
|
+
205,
|
|
19270
|
+
81
|
|
19478
19271
|
],
|
|
19479
19272
|
accounts: [
|
|
19480
19273
|
{
|
|
@@ -19482,35 +19275,36 @@ var instructions$8 = [
|
|
|
19482
19275
|
writable: true
|
|
19483
19276
|
},
|
|
19484
19277
|
{
|
|
19485
|
-
name: "
|
|
19486
|
-
writable: true,
|
|
19278
|
+
name: "bridge_registry",
|
|
19487
19279
|
pda: {
|
|
19488
19280
|
seeds: [
|
|
19489
19281
|
{
|
|
19490
19282
|
kind: "const",
|
|
19491
19283
|
value: [
|
|
19492
|
-
|
|
19493
|
-
|
|
19494
|
-
|
|
19495
|
-
|
|
19496
|
-
|
|
19284
|
+
98,
|
|
19285
|
+
114,
|
|
19286
|
+
105,
|
|
19287
|
+
100,
|
|
19288
|
+
103,
|
|
19289
|
+
101,
|
|
19290
|
+
45,
|
|
19291
|
+
114,
|
|
19292
|
+
101,
|
|
19293
|
+
103,
|
|
19294
|
+
105,
|
|
19295
|
+
115,
|
|
19296
|
+
116,
|
|
19297
|
+
114,
|
|
19298
|
+
121
|
|
19497
19299
|
]
|
|
19498
19300
|
},
|
|
19499
19301
|
{
|
|
19500
19302
|
kind: "account",
|
|
19501
19303
|
path: "glam_state"
|
|
19502
19304
|
}
|
|
19503
|
-
]
|
|
19504
|
-
program: {
|
|
19505
|
-
kind: "account",
|
|
19506
|
-
path: "glam_protocol_program"
|
|
19507
|
-
}
|
|
19305
|
+
]
|
|
19508
19306
|
}
|
|
19509
19307
|
},
|
|
19510
|
-
{
|
|
19511
|
-
name: "glam_signer",
|
|
19512
|
-
signer: true
|
|
19513
|
-
},
|
|
19514
19308
|
{
|
|
19515
19309
|
name: "integration_authority",
|
|
19516
19310
|
pda: {
|
|
@@ -19549,44 +19343,69 @@ var instructions$8 = [
|
|
|
19549
19343
|
address: "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
|
|
19550
19344
|
},
|
|
19551
19345
|
{
|
|
19552
|
-
name: "
|
|
19553
|
-
address: "11111111111111111111111111111111"
|
|
19554
|
-
},
|
|
19555
|
-
{
|
|
19556
|
-
name: "bridge_registry",
|
|
19557
|
-
writable: true,
|
|
19346
|
+
name: "glam_config",
|
|
19558
19347
|
pda: {
|
|
19559
19348
|
seeds: [
|
|
19560
19349
|
{
|
|
19561
19350
|
kind: "const",
|
|
19562
19351
|
value: [
|
|
19563
|
-
98,
|
|
19564
|
-
114,
|
|
19565
|
-
105,
|
|
19566
|
-
100,
|
|
19567
19352
|
103,
|
|
19568
|
-
|
|
19353
|
+
108,
|
|
19354
|
+
111,
|
|
19355
|
+
98,
|
|
19356
|
+
97,
|
|
19357
|
+
108,
|
|
19569
19358
|
45,
|
|
19570
|
-
|
|
19571
|
-
|
|
19572
|
-
|
|
19359
|
+
99,
|
|
19360
|
+
111,
|
|
19361
|
+
110,
|
|
19362
|
+
102,
|
|
19573
19363
|
105,
|
|
19574
|
-
|
|
19575
|
-
116,
|
|
19576
|
-
114,
|
|
19577
|
-
121
|
|
19364
|
+
103
|
|
19578
19365
|
]
|
|
19579
|
-
},
|
|
19580
|
-
{
|
|
19581
|
-
kind: "account",
|
|
19582
|
-
path: "glam_state"
|
|
19583
19366
|
}
|
|
19584
|
-
]
|
|
19367
|
+
],
|
|
19368
|
+
program: {
|
|
19369
|
+
kind: "const",
|
|
19370
|
+
value: [
|
|
19371
|
+
10,
|
|
19372
|
+
11,
|
|
19373
|
+
0,
|
|
19374
|
+
83,
|
|
19375
|
+
72,
|
|
19376
|
+
16,
|
|
19377
|
+
46,
|
|
19378
|
+
144,
|
|
19379
|
+
46,
|
|
19380
|
+
42,
|
|
19381
|
+
79,
|
|
19382
|
+
22,
|
|
19383
|
+
157,
|
|
19384
|
+
123,
|
|
19385
|
+
21,
|
|
19386
|
+
242,
|
|
19387
|
+
192,
|
|
19388
|
+
146,
|
|
19389
|
+
1,
|
|
19390
|
+
78,
|
|
19391
|
+
88,
|
|
19392
|
+
59,
|
|
19393
|
+
102,
|
|
19394
|
+
9,
|
|
19395
|
+
190,
|
|
19396
|
+
226,
|
|
19397
|
+
92,
|
|
19398
|
+
189,
|
|
19399
|
+
187,
|
|
19400
|
+
232,
|
|
19401
|
+
83,
|
|
19402
|
+
220
|
|
19403
|
+
]
|
|
19404
|
+
}
|
|
19585
19405
|
}
|
|
19586
19406
|
},
|
|
19587
19407
|
{
|
|
19588
|
-
name: "
|
|
19589
|
-
writable: true
|
|
19408
|
+
name: "base_asset_oracle"
|
|
19590
19409
|
}
|
|
19591
19410
|
],
|
|
19592
19411
|
args: []
|
|
@@ -19594,7 +19413,7 @@ var instructions$8 = [
|
|
|
19594
19413
|
{
|
|
19595
19414
|
name: "settle_managed_transfer",
|
|
19596
19415
|
docs: [
|
|
19597
|
-
"
|
|
19416
|
+
"Settles a managed inflight transfer and removes it from the registry."
|
|
19598
19417
|
],
|
|
19599
19418
|
discriminator: [
|
|
19600
19419
|
197,
|
|
@@ -19608,18 +19427,124 @@ var instructions$8 = [
|
|
|
19608
19427
|
],
|
|
19609
19428
|
accounts: [
|
|
19610
19429
|
{
|
|
19611
|
-
name: "glam_state"
|
|
19430
|
+
name: "glam_state",
|
|
19431
|
+
writable: true
|
|
19432
|
+
},
|
|
19433
|
+
{
|
|
19434
|
+
name: "glam_vault",
|
|
19435
|
+
writable: true,
|
|
19436
|
+
pda: {
|
|
19437
|
+
seeds: [
|
|
19438
|
+
{
|
|
19439
|
+
kind: "const",
|
|
19440
|
+
value: [
|
|
19441
|
+
118,
|
|
19442
|
+
97,
|
|
19443
|
+
117,
|
|
19444
|
+
108,
|
|
19445
|
+
116
|
|
19446
|
+
]
|
|
19447
|
+
},
|
|
19448
|
+
{
|
|
19449
|
+
kind: "account",
|
|
19450
|
+
path: "glam_state"
|
|
19451
|
+
}
|
|
19452
|
+
],
|
|
19453
|
+
program: {
|
|
19454
|
+
kind: "account",
|
|
19455
|
+
path: "glam_protocol_program"
|
|
19456
|
+
}
|
|
19457
|
+
}
|
|
19612
19458
|
},
|
|
19613
19459
|
{
|
|
19614
19460
|
name: "glam_signer",
|
|
19461
|
+
writable: true,
|
|
19615
19462
|
signer: true
|
|
19616
19463
|
},
|
|
19617
19464
|
{
|
|
19618
|
-
name: "
|
|
19619
|
-
|
|
19465
|
+
name: "glam_protocol_program",
|
|
19466
|
+
address: "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"
|
|
19467
|
+
},
|
|
19468
|
+
{
|
|
19469
|
+
name: "bridge_registry",
|
|
19470
|
+
writable: true,
|
|
19471
|
+
pda: {
|
|
19472
|
+
seeds: [
|
|
19473
|
+
{
|
|
19474
|
+
kind: "const",
|
|
19475
|
+
value: [
|
|
19476
|
+
98,
|
|
19477
|
+
114,
|
|
19478
|
+
105,
|
|
19479
|
+
100,
|
|
19480
|
+
103,
|
|
19481
|
+
101,
|
|
19482
|
+
45,
|
|
19483
|
+
114,
|
|
19484
|
+
101,
|
|
19485
|
+
103,
|
|
19486
|
+
105,
|
|
19487
|
+
115,
|
|
19488
|
+
116,
|
|
19489
|
+
114,
|
|
19490
|
+
121
|
|
19491
|
+
]
|
|
19492
|
+
},
|
|
19493
|
+
{
|
|
19494
|
+
kind: "account",
|
|
19495
|
+
path: "glam_state"
|
|
19496
|
+
}
|
|
19497
|
+
]
|
|
19498
|
+
}
|
|
19499
|
+
},
|
|
19500
|
+
{
|
|
19501
|
+
name: "integration_authority",
|
|
19502
|
+
pda: {
|
|
19503
|
+
seeds: [
|
|
19504
|
+
{
|
|
19505
|
+
kind: "const",
|
|
19506
|
+
value: [
|
|
19507
|
+
105,
|
|
19508
|
+
110,
|
|
19509
|
+
116,
|
|
19510
|
+
101,
|
|
19511
|
+
103,
|
|
19512
|
+
114,
|
|
19513
|
+
97,
|
|
19514
|
+
116,
|
|
19515
|
+
105,
|
|
19516
|
+
111,
|
|
19517
|
+
110,
|
|
19518
|
+
45,
|
|
19519
|
+
97,
|
|
19520
|
+
117,
|
|
19521
|
+
116,
|
|
19522
|
+
104,
|
|
19523
|
+
111,
|
|
19524
|
+
114,
|
|
19525
|
+
105,
|
|
19526
|
+
116,
|
|
19527
|
+
121
|
|
19528
|
+
]
|
|
19529
|
+
}
|
|
19530
|
+
]
|
|
19531
|
+
}
|
|
19532
|
+
},
|
|
19533
|
+
{
|
|
19534
|
+
name: "system_program",
|
|
19535
|
+
address: "11111111111111111111111111111111"
|
|
19620
19536
|
}
|
|
19621
19537
|
],
|
|
19622
|
-
args: [
|
|
19538
|
+
args: [
|
|
19539
|
+
{
|
|
19540
|
+
name: "args",
|
|
19541
|
+
type: {
|
|
19542
|
+
defined: {
|
|
19543
|
+
name: "SettleManagedTransferArgs"
|
|
19544
|
+
}
|
|
19545
|
+
}
|
|
19546
|
+
}
|
|
19547
|
+
]
|
|
19623
19548
|
},
|
|
19624
19549
|
{
|
|
19625
19550
|
name: "update_layerzero_oft_route",
|
|
@@ -19658,6 +19583,74 @@ var instructions$8 = [
|
|
|
19658
19583
|
}
|
|
19659
19584
|
}
|
|
19660
19585
|
]
|
|
19586
|
+
},
|
|
19587
|
+
{
|
|
19588
|
+
name: "validate_managed_transfer",
|
|
19589
|
+
docs: [
|
|
19590
|
+
"Validates a managed inflight transfer so that it becomes priceable."
|
|
19591
|
+
],
|
|
19592
|
+
discriminator: [
|
|
19593
|
+
47,
|
|
19594
|
+
86,
|
|
19595
|
+
129,
|
|
19596
|
+
235,
|
|
19597
|
+
30,
|
|
19598
|
+
249,
|
|
19599
|
+
248,
|
|
19600
|
+
42
|
|
19601
|
+
],
|
|
19602
|
+
accounts: [
|
|
19603
|
+
{
|
|
19604
|
+
name: "glam_state",
|
|
19605
|
+
writable: true
|
|
19606
|
+
},
|
|
19607
|
+
{
|
|
19608
|
+
name: "glam_signer",
|
|
19609
|
+
signer: true
|
|
19610
|
+
},
|
|
19611
|
+
{
|
|
19612
|
+
name: "bridge_registry",
|
|
19613
|
+
writable: true,
|
|
19614
|
+
pda: {
|
|
19615
|
+
seeds: [
|
|
19616
|
+
{
|
|
19617
|
+
kind: "const",
|
|
19618
|
+
value: [
|
|
19619
|
+
98,
|
|
19620
|
+
114,
|
|
19621
|
+
105,
|
|
19622
|
+
100,
|
|
19623
|
+
103,
|
|
19624
|
+
101,
|
|
19625
|
+
45,
|
|
19626
|
+
114,
|
|
19627
|
+
101,
|
|
19628
|
+
103,
|
|
19629
|
+
105,
|
|
19630
|
+
115,
|
|
19631
|
+
116,
|
|
19632
|
+
114,
|
|
19633
|
+
121
|
|
19634
|
+
]
|
|
19635
|
+
},
|
|
19636
|
+
{
|
|
19637
|
+
kind: "account",
|
|
19638
|
+
path: "glam_state"
|
|
19639
|
+
}
|
|
19640
|
+
]
|
|
19641
|
+
}
|
|
19642
|
+
}
|
|
19643
|
+
],
|
|
19644
|
+
args: [
|
|
19645
|
+
{
|
|
19646
|
+
name: "args",
|
|
19647
|
+
type: {
|
|
19648
|
+
defined: {
|
|
19649
|
+
name: "ValidateManagedTransferArgs"
|
|
19650
|
+
}
|
|
19651
|
+
}
|
|
19652
|
+
}
|
|
19653
|
+
]
|
|
19661
19654
|
}
|
|
19662
19655
|
];
|
|
19663
19656
|
var accounts$8 = [
|
|
@@ -19687,19 +19680,6 @@ var accounts$8 = [
|
|
|
19687
19680
|
184
|
|
19688
19681
|
]
|
|
19689
19682
|
},
|
|
19690
|
-
{
|
|
19691
|
-
name: "BridgeTransferRecord",
|
|
19692
|
-
discriminator: [
|
|
19693
|
-
46,
|
|
19694
|
-
131,
|
|
19695
|
-
253,
|
|
19696
|
-
32,
|
|
19697
|
-
218,
|
|
19698
|
-
137,
|
|
19699
|
-
45,
|
|
19700
|
-
96
|
|
19701
|
-
]
|
|
19702
|
-
},
|
|
19703
19683
|
{
|
|
19704
19684
|
name: "StateAccount",
|
|
19705
19685
|
discriminator: [
|
|
@@ -19819,6 +19799,26 @@ var errors$2 = [
|
|
|
19819
19799
|
code: 6020,
|
|
19820
19800
|
name: "InvalidOftAuxiliaryBalance",
|
|
19821
19801
|
msg: "The OFT auxiliary token balance did not change as expected"
|
|
19802
|
+
},
|
|
19803
|
+
{
|
|
19804
|
+
code: 6021,
|
|
19805
|
+
name: "InvalidRemainingAccounts",
|
|
19806
|
+
msg: "The remaining accounts are invalid"
|
|
19807
|
+
},
|
|
19808
|
+
{
|
|
19809
|
+
code: 6022,
|
|
19810
|
+
name: "DuplicateTransferRecord",
|
|
19811
|
+
msg: "Duplicate transfer record found"
|
|
19812
|
+
},
|
|
19813
|
+
{
|
|
19814
|
+
code: 6023,
|
|
19815
|
+
name: "TooManyManagedTransfers",
|
|
19816
|
+
msg: "Too many managed transfers are inflight for this vault"
|
|
19817
|
+
},
|
|
19818
|
+
{
|
|
19819
|
+
code: 6024,
|
|
19820
|
+
name: "InvalidBridgeRegistry",
|
|
19821
|
+
msg: "The bridge registry does not belong to this vault"
|
|
19822
19822
|
}
|
|
19823
19823
|
];
|
|
19824
19824
|
var types$8 = [
|
|
@@ -19883,27 +19883,88 @@ var types$8 = [
|
|
|
19883
19883
|
}
|
|
19884
19884
|
},
|
|
19885
19885
|
{
|
|
19886
|
-
name: "
|
|
19886
|
+
name: "BridgeManagedTransfer",
|
|
19887
|
+
serialization: "bytemuckunsafe",
|
|
19888
|
+
repr: {
|
|
19889
|
+
kind: "c"
|
|
19890
|
+
},
|
|
19887
19891
|
type: {
|
|
19888
19892
|
kind: "struct",
|
|
19889
19893
|
fields: [
|
|
19890
19894
|
{
|
|
19891
|
-
name: "
|
|
19895
|
+
name: "transfer_id",
|
|
19892
19896
|
type: "pubkey"
|
|
19893
19897
|
},
|
|
19894
19898
|
{
|
|
19895
|
-
name: "
|
|
19899
|
+
name: "source_mint",
|
|
19900
|
+
type: "pubkey"
|
|
19901
|
+
},
|
|
19902
|
+
{
|
|
19903
|
+
name: "destination_recipient",
|
|
19904
|
+
type: "pubkey"
|
|
19905
|
+
},
|
|
19906
|
+
{
|
|
19907
|
+
name: "provider_program",
|
|
19908
|
+
type: "pubkey"
|
|
19909
|
+
},
|
|
19910
|
+
{
|
|
19911
|
+
name: "provider_config",
|
|
19912
|
+
type: "pubkey"
|
|
19913
|
+
},
|
|
19914
|
+
{
|
|
19915
|
+
name: "provider_emitter",
|
|
19916
|
+
type: "pubkey"
|
|
19917
|
+
},
|
|
19918
|
+
{
|
|
19919
|
+
name: "source_amount",
|
|
19896
19920
|
type: "u64"
|
|
19897
19921
|
},
|
|
19898
19922
|
{
|
|
19899
|
-
name: "
|
|
19923
|
+
name: "quoted_out_amount",
|
|
19924
|
+
type: "u64"
|
|
19925
|
+
},
|
|
19926
|
+
{
|
|
19927
|
+
name: "provider_sequence",
|
|
19928
|
+
type: "u64"
|
|
19929
|
+
},
|
|
19930
|
+
{
|
|
19931
|
+
name: "committed_slot",
|
|
19932
|
+
type: "u64"
|
|
19933
|
+
},
|
|
19934
|
+
{
|
|
19935
|
+
name: "protocol",
|
|
19936
|
+
type: "u16"
|
|
19937
|
+
},
|
|
19938
|
+
{
|
|
19939
|
+
name: "destination_chain",
|
|
19940
|
+
type: "u16"
|
|
19941
|
+
},
|
|
19942
|
+
{
|
|
19943
|
+
name: "source_decimals",
|
|
19900
19944
|
type: "u8"
|
|
19945
|
+
},
|
|
19946
|
+
{
|
|
19947
|
+
name: "status",
|
|
19948
|
+
type: "u8"
|
|
19949
|
+
},
|
|
19950
|
+
{
|
|
19951
|
+
name: "reserved",
|
|
19952
|
+
type: {
|
|
19953
|
+
array: [
|
|
19954
|
+
"u8",
|
|
19955
|
+
2
|
|
19956
|
+
]
|
|
19957
|
+
}
|
|
19901
19958
|
}
|
|
19902
19959
|
]
|
|
19903
19960
|
}
|
|
19904
19961
|
},
|
|
19905
19962
|
{
|
|
19906
|
-
name: "
|
|
19963
|
+
name: "BridgeRegistry",
|
|
19964
|
+
serialization: "bytemuckunsafe",
|
|
19965
|
+
repr: {
|
|
19966
|
+
kind: "c"
|
|
19967
|
+
},
|
|
19907
19968
|
type: {
|
|
19908
19969
|
kind: "struct",
|
|
19909
19970
|
fields: [
|
|
@@ -19912,18 +19973,51 @@ var types$8 = [
|
|
|
19912
19973
|
type: "pubkey"
|
|
19913
19974
|
},
|
|
19914
19975
|
{
|
|
19915
|
-
name: "
|
|
19916
|
-
type: "
|
|
19976
|
+
name: "managed_transfer_count",
|
|
19977
|
+
type: "u8"
|
|
19917
19978
|
},
|
|
19918
19979
|
{
|
|
19919
|
-
name: "
|
|
19980
|
+
name: "reserved",
|
|
19920
19981
|
type: {
|
|
19921
19982
|
array: [
|
|
19922
19983
|
"u8",
|
|
19923
|
-
|
|
19984
|
+
7
|
|
19924
19985
|
]
|
|
19925
19986
|
}
|
|
19926
19987
|
},
|
|
19988
|
+
{
|
|
19989
|
+
name: "transfers",
|
|
19990
|
+
type: {
|
|
19991
|
+
array: [
|
|
19992
|
+
{
|
|
19993
|
+
defined: {
|
|
19994
|
+
name: "BridgeManagedTransfer"
|
|
19995
|
+
}
|
|
19996
|
+
},
|
|
19997
|
+
16
|
|
19998
|
+
]
|
|
19999
|
+
}
|
|
20000
|
+
}
|
|
20001
|
+
]
|
|
20002
|
+
}
|
|
20003
|
+
},
|
|
20004
|
+
{
|
|
20005
|
+
name: "BridgeSession",
|
|
20006
|
+
type: {
|
|
20007
|
+
kind: "struct",
|
|
20008
|
+
fields: [
|
|
20009
|
+
{
|
|
20010
|
+
name: "glam_state",
|
|
20011
|
+
type: "pubkey"
|
|
20012
|
+
},
|
|
20013
|
+
{
|
|
20014
|
+
name: "signer",
|
|
20015
|
+
type: "pubkey"
|
|
20016
|
+
},
|
|
20017
|
+
{
|
|
20018
|
+
name: "transfer_id",
|
|
20019
|
+
type: "pubkey"
|
|
20020
|
+
},
|
|
19927
20021
|
{
|
|
19928
20022
|
name: "protocol",
|
|
19929
20023
|
type: "u16"
|
|
@@ -19936,6 +20030,10 @@ var types$8 = [
|
|
|
19936
20030
|
name: "source_mint",
|
|
19937
20031
|
type: "pubkey"
|
|
19938
20032
|
},
|
|
20033
|
+
{
|
|
20034
|
+
name: "source_decimals",
|
|
20035
|
+
type: "u8"
|
|
20036
|
+
},
|
|
19939
20037
|
{
|
|
19940
20038
|
name: "source_token_account",
|
|
19941
20039
|
type: "pubkey"
|
|
@@ -20012,136 +20110,6 @@ var types$8 = [
|
|
|
20012
20110
|
]
|
|
20013
20111
|
}
|
|
20014
20112
|
},
|
|
20015
|
-
{
|
|
20016
|
-
name: "BridgeTransferRecord",
|
|
20017
|
-
type: {
|
|
20018
|
-
kind: "struct",
|
|
20019
|
-
fields: [
|
|
20020
|
-
{
|
|
20021
|
-
name: "glam_state",
|
|
20022
|
-
type: "pubkey"
|
|
20023
|
-
},
|
|
20024
|
-
{
|
|
20025
|
-
name: "transfer_id",
|
|
20026
|
-
type: {
|
|
20027
|
-
array: [
|
|
20028
|
-
"u8",
|
|
20029
|
-
32
|
|
20030
|
-
]
|
|
20031
|
-
}
|
|
20032
|
-
},
|
|
20033
|
-
{
|
|
20034
|
-
name: "protocol",
|
|
20035
|
-
type: "u16"
|
|
20036
|
-
},
|
|
20037
|
-
{
|
|
20038
|
-
name: "status",
|
|
20039
|
-
type: {
|
|
20040
|
-
defined: {
|
|
20041
|
-
name: "BridgeTransferStatus"
|
|
20042
|
-
}
|
|
20043
|
-
}
|
|
20044
|
-
},
|
|
20045
|
-
{
|
|
20046
|
-
name: "managed",
|
|
20047
|
-
type: "bool"
|
|
20048
|
-
},
|
|
20049
|
-
{
|
|
20050
|
-
name: "receipt_verified",
|
|
20051
|
-
type: "bool"
|
|
20052
|
-
},
|
|
20053
|
-
{
|
|
20054
|
-
name: "source_mint",
|
|
20055
|
-
type: "pubkey"
|
|
20056
|
-
},
|
|
20057
|
-
{
|
|
20058
|
-
name: "source_token_account",
|
|
20059
|
-
type: "pubkey"
|
|
20060
|
-
},
|
|
20061
|
-
{
|
|
20062
|
-
name: "provider_program",
|
|
20063
|
-
type: "pubkey"
|
|
20064
|
-
},
|
|
20065
|
-
{
|
|
20066
|
-
name: "provider_config",
|
|
20067
|
-
type: "pubkey"
|
|
20068
|
-
},
|
|
20069
|
-
{
|
|
20070
|
-
name: "source_amount",
|
|
20071
|
-
type: "u64"
|
|
20072
|
-
},
|
|
20073
|
-
{
|
|
20074
|
-
name: "quoted_out_amount",
|
|
20075
|
-
type: "u64"
|
|
20076
|
-
},
|
|
20077
|
-
{
|
|
20078
|
-
name: "destination_chain",
|
|
20079
|
-
type: "u16"
|
|
20080
|
-
},
|
|
20081
|
-
{
|
|
20082
|
-
name: "destination_recipient",
|
|
20083
|
-
type: "pubkey"
|
|
20084
|
-
},
|
|
20085
|
-
{
|
|
20086
|
-
name: "provider_transfer_id",
|
|
20087
|
-
type: {
|
|
20088
|
-
array: [
|
|
20089
|
-
"u8",
|
|
20090
|
-
32
|
|
20091
|
-
]
|
|
20092
|
-
}
|
|
20093
|
-
},
|
|
20094
|
-
{
|
|
20095
|
-
name: "provider_emitter",
|
|
20096
|
-
type: "pubkey"
|
|
20097
|
-
},
|
|
20098
|
-
{
|
|
20099
|
-
name: "provider_sequence",
|
|
20100
|
-
type: "u64"
|
|
20101
|
-
},
|
|
20102
|
-
{
|
|
20103
|
-
name: "committed_slot",
|
|
20104
|
-
type: "u64"
|
|
20105
|
-
},
|
|
20106
|
-
{
|
|
20107
|
-
name: "settled_slot",
|
|
20108
|
-
type: "u64"
|
|
20109
|
-
},
|
|
20110
|
-
{
|
|
20111
|
-
name: "reconciled_slot",
|
|
20112
|
-
type: "u64"
|
|
20113
|
-
},
|
|
20114
|
-
{
|
|
20115
|
-
name: "failure_reason",
|
|
20116
|
-
type: "u8"
|
|
20117
|
-
},
|
|
20118
|
-
{
|
|
20119
|
-
name: "bump",
|
|
20120
|
-
type: "u8"
|
|
20121
|
-
}
|
|
20122
|
-
]
|
|
20123
|
-
}
|
|
20124
|
-
},
|
|
20125
|
-
{
|
|
20126
|
-
name: "BridgeTransferStatus",
|
|
20127
|
-
type: {
|
|
20128
|
-
kind: "enum",
|
|
20129
|
-
variants: [
|
|
20130
|
-
{
|
|
20131
|
-
name: "Committed"
|
|
20132
|
-
},
|
|
20133
|
-
{
|
|
20134
|
-
name: "Settled"
|
|
20135
|
-
},
|
|
20136
|
-
{
|
|
20137
|
-
name: "Reconciled"
|
|
20138
|
-
},
|
|
20139
|
-
{
|
|
20140
|
-
name: "Failed"
|
|
20141
|
-
}
|
|
20142
|
-
]
|
|
20143
|
-
}
|
|
20144
|
-
},
|
|
20145
20113
|
{
|
|
20146
20114
|
name: "CommitOftTransferArgs",
|
|
20147
20115
|
type: {
|
|
@@ -20149,12 +20117,7 @@ var types$8 = [
|
|
|
20149
20117
|
fields: [
|
|
20150
20118
|
{
|
|
20151
20119
|
name: "transfer_id",
|
|
20152
|
-
type:
|
|
20153
|
-
array: [
|
|
20154
|
-
"u8",
|
|
20155
|
-
32
|
|
20156
|
-
]
|
|
20157
|
-
}
|
|
20120
|
+
type: "pubkey"
|
|
20158
20121
|
}
|
|
20159
20122
|
]
|
|
20160
20123
|
}
|
|
@@ -20858,12 +20821,7 @@ var types$8 = [
|
|
|
20858
20821
|
fields: [
|
|
20859
20822
|
{
|
|
20860
20823
|
name: "transfer_id",
|
|
20861
|
-
type:
|
|
20862
|
-
array: [
|
|
20863
|
-
"u8",
|
|
20864
|
-
32
|
|
20865
|
-
]
|
|
20866
|
-
}
|
|
20824
|
+
type: "pubkey"
|
|
20867
20825
|
},
|
|
20868
20826
|
{
|
|
20869
20827
|
name: "middle_instruction_hash",
|
|
@@ -20999,6 +20957,18 @@ var types$8 = [
|
|
|
20999
20957
|
]
|
|
21000
20958
|
}
|
|
21001
20959
|
},
|
|
20960
|
+
{
|
|
20961
|
+
name: "SettleManagedTransferArgs",
|
|
20962
|
+
type: {
|
|
20963
|
+
kind: "struct",
|
|
20964
|
+
fields: [
|
|
20965
|
+
{
|
|
20966
|
+
name: "transfer_id",
|
|
20967
|
+
type: "pubkey"
|
|
20968
|
+
}
|
|
20969
|
+
]
|
|
20970
|
+
}
|
|
20971
|
+
},
|
|
21002
20972
|
{
|
|
21003
20973
|
name: "StateAccount",
|
|
21004
20974
|
type: {
|
|
@@ -21145,6 +21115,18 @@ var types$8 = [
|
|
|
21145
21115
|
]
|
|
21146
21116
|
}
|
|
21147
21117
|
},
|
|
21118
|
+
{
|
|
21119
|
+
name: "ValidateManagedTransferArgs",
|
|
21120
|
+
type: {
|
|
21121
|
+
kind: "struct",
|
|
21122
|
+
fields: [
|
|
21123
|
+
{
|
|
21124
|
+
name: "transfer_id",
|
|
21125
|
+
type: "pubkey"
|
|
21126
|
+
}
|
|
21127
|
+
]
|
|
21128
|
+
}
|
|
21129
|
+
},
|
|
21148
21130
|
{
|
|
21149
21131
|
name: "ValuationModel",
|
|
21150
21132
|
type: {
|
|
@@ -21162,14 +21144,19 @@ var types$8 = [
|
|
|
21162
21144
|
];
|
|
21163
21145
|
var constants$8 = [
|
|
21164
21146
|
{
|
|
21165
|
-
name: "
|
|
21147
|
+
name: "PROTO_BRIDGE_PERM_SEND",
|
|
21166
21148
|
type: "u64",
|
|
21167
|
-
value: "
|
|
21149
|
+
value: "1"
|
|
21168
21150
|
},
|
|
21169
21151
|
{
|
|
21170
|
-
name: "
|
|
21152
|
+
name: "PROTO_BRIDGE_PERM_SETTLE",
|
|
21171
21153
|
type: "u64",
|
|
21172
|
-
value: "
|
|
21154
|
+
value: "4"
|
|
21155
|
+
},
|
|
21156
|
+
{
|
|
21157
|
+
name: "PROTO_BRIDGE_PERM_VALIDATE",
|
|
21158
|
+
type: "u64",
|
|
21159
|
+
value: "2"
|
|
21173
21160
|
},
|
|
21174
21161
|
{
|
|
21175
21162
|
name: "PROTO_LAYERZERO_OFT",
|
|
@@ -46265,6 +46252,7 @@ class JupiterApiClient {
|
|
|
46265
46252
|
this.name = data.name ?? null;
|
|
46266
46253
|
this.uri = data.uri ?? null;
|
|
46267
46254
|
this.enabled = data.enabled ?? null;
|
|
46255
|
+
this.oracleConfigs = data.oracleConfigs ?? null;
|
|
46268
46256
|
this.assets = data.assets ?? null;
|
|
46269
46257
|
this.created = data.created ?? null;
|
|
46270
46258
|
this.owner = data.owner ?? null;
|
|
@@ -47097,19 +47085,51 @@ class BaseClient {
|
|
|
47097
47085
|
this._assetMetasPromise = undefined;
|
|
47098
47086
|
}
|
|
47099
47087
|
const fetchPromise = this.fetchGlobalConfig(options).then(async (globalConfig)=>{
|
|
47100
|
-
|
|
47101
|
-
const
|
|
47102
|
-
|
|
47103
|
-
|
|
47104
|
-
|
|
47105
|
-
|
|
47106
|
-
|
|
47107
|
-
|
|
47108
|
-
|
|
47109
|
-
|
|
47110
|
-
|
|
47088
|
+
const assets = globalConfig.assetMetas.map((am)=>am.asset);
|
|
47089
|
+
const tokenProgramsByAsset = new Map();
|
|
47090
|
+
try {
|
|
47091
|
+
// Fast path when every global-config mint account is available.
|
|
47092
|
+
const mintInfos = await fetchMintsAndTokenPrograms(this.connection, assets);
|
|
47093
|
+
assets.forEach((asset, i)=>{
|
|
47094
|
+
tokenProgramsByAsset.set(asset.toBase58(), mintInfos[i].tokenProgram);
|
|
47095
|
+
});
|
|
47096
|
+
} catch {
|
|
47097
|
+
// Local validators may clone a newer global config than the set of
|
|
47098
|
+
// mint accounts they have available. Resolve what we can and let
|
|
47099
|
+
// downstream callers request only the assets they actually use.
|
|
47100
|
+
const accountsInfo = await this.connection.getMultipleAccountsInfo(assets, "confirmed");
|
|
47101
|
+
accountsInfo.forEach((accountInfo, i)=>{
|
|
47102
|
+
const asset = assets[i];
|
|
47103
|
+
const assetKey = asset.toBase58();
|
|
47104
|
+
if (accountInfo) {
|
|
47105
|
+
tokenProgramsByAsset.set(assetKey, parseMintAccountInfo(accountInfo, asset).tokenProgram);
|
|
47106
|
+
return;
|
|
47107
|
+
}
|
|
47108
|
+
const fallback = ASSETS_MAINNET.get(assetKey);
|
|
47109
|
+
if (fallback) {
|
|
47110
|
+
tokenProgramsByAsset.set(assetKey, fallback.programId);
|
|
47111
47111
|
}
|
|
47112
|
-
|
|
47112
|
+
});
|
|
47113
|
+
}
|
|
47114
|
+
// Transforms onchain asset meta to client asset meta
|
|
47115
|
+
const assetMetaMap = new Map(globalConfig.assetMetas.flatMap(({ asset, decimals, oracle, oracleSource })=>{
|
|
47116
|
+
const programId = tokenProgramsByAsset.get(asset.toBase58());
|
|
47117
|
+
if (!programId) {
|
|
47118
|
+
return [];
|
|
47119
|
+
}
|
|
47120
|
+
return [
|
|
47121
|
+
[
|
|
47122
|
+
asset.toBase58(),
|
|
47123
|
+
{
|
|
47124
|
+
asset,
|
|
47125
|
+
decimals,
|
|
47126
|
+
oracle,
|
|
47127
|
+
oracleSource,
|
|
47128
|
+
programId
|
|
47129
|
+
}
|
|
47130
|
+
]
|
|
47131
|
+
];
|
|
47132
|
+
}));
|
|
47113
47133
|
if (useCache) {
|
|
47114
47134
|
this._assetMetas = assetMetaMap;
|
|
47115
47135
|
}
|
|
@@ -51547,6 +51567,8 @@ class PriceClient {
|
|
|
51547
51567
|
}
|
|
51548
51568
|
const epiRefreshIx = await this.priceEpiValidatedPositionsIx();
|
|
51549
51569
|
if (epiRefreshIx) pricingIxs.push(epiRefreshIx);
|
|
51570
|
+
const priceBridgeIxs = await this.bridge.txBuilder.priceManagedTransfersIxs();
|
|
51571
|
+
if (priceBridgeIxs) pricingIxs.push(...priceBridgeIxs);
|
|
51550
51572
|
return pricingIxs.filter(Boolean);
|
|
51551
51573
|
}
|
|
51552
51574
|
async validateAumIx() {
|
|
@@ -51586,10 +51608,11 @@ class PriceClient {
|
|
|
51586
51608
|
kaminoReserves
|
|
51587
51609
|
];
|
|
51588
51610
|
}
|
|
51589
|
-
constructor(base, klend, kvaults, getJupiterApi){
|
|
51611
|
+
constructor(base, klend, kvaults, bridge, getJupiterApi){
|
|
51590
51612
|
this.base = base;
|
|
51591
51613
|
this.klend = klend;
|
|
51592
51614
|
this.kvaults = kvaults;
|
|
51615
|
+
this.bridge = bridge;
|
|
51593
51616
|
this.getJupiterApi = getJupiterApi;
|
|
51594
51617
|
this._stateModel = null;
|
|
51595
51618
|
this._lookupTables = new PkSet();
|
|
@@ -53275,13 +53298,6 @@ function resolveCanonicalLayerzeroOftRouteProfile(params) {
|
|
|
53275
53298
|
}
|
|
53276
53299
|
|
|
53277
53300
|
const LAYERZERO_OFT_PROTOCOL = 1 << 2;
|
|
53278
|
-
function toFixedArray32$1(value, label) {
|
|
53279
|
-
const bytes = Array.from(Buffer.from(value));
|
|
53280
|
-
if (bytes.length !== 32) {
|
|
53281
|
-
throw new Error(`${label} must be exactly 32 bytes`);
|
|
53282
|
-
}
|
|
53283
|
-
return bytes;
|
|
53284
|
-
}
|
|
53285
53301
|
function appendU16Le(parts, value) {
|
|
53286
53302
|
const out = Buffer.alloc(2);
|
|
53287
53303
|
out.writeUInt16LE(value, 0);
|
|
@@ -53380,15 +53396,53 @@ function getBridgeSessionPda(glamState, transferId, bridgeProgramId) {
|
|
|
53380
53396
|
return web3_js.PublicKey.findProgramAddressSync([
|
|
53381
53397
|
Buffer.from(SEED_BRIDGE_SESSION),
|
|
53382
53398
|
glamState.toBuffer(),
|
|
53383
|
-
|
|
53399
|
+
transferId.toBuffer()
|
|
53384
53400
|
], bridgeProgramId)[0];
|
|
53385
53401
|
}
|
|
53386
|
-
function
|
|
53387
|
-
return
|
|
53388
|
-
|
|
53389
|
-
|
|
53390
|
-
|
|
53391
|
-
|
|
53402
|
+
function toCount(value) {
|
|
53403
|
+
return anchor.BN.isBN(value) ? value.toNumber() : value;
|
|
53404
|
+
}
|
|
53405
|
+
function toBridgeTransferStatus(status) {
|
|
53406
|
+
switch(status){
|
|
53407
|
+
case 0:
|
|
53408
|
+
return {
|
|
53409
|
+
committed: {}
|
|
53410
|
+
};
|
|
53411
|
+
case 1:
|
|
53412
|
+
return {
|
|
53413
|
+
validated: {}
|
|
53414
|
+
};
|
|
53415
|
+
case 2:
|
|
53416
|
+
return {
|
|
53417
|
+
settled: {}
|
|
53418
|
+
};
|
|
53419
|
+
default:
|
|
53420
|
+
throw new Error(`Unsupported bridge transfer status: ${status}`);
|
|
53421
|
+
}
|
|
53422
|
+
}
|
|
53423
|
+
function getActiveRegistryTransfers(registry) {
|
|
53424
|
+
return registry.transfers.slice(0, toCount(registry.managedTransferCount));
|
|
53425
|
+
}
|
|
53426
|
+
function registryTransferToRecord(transfer, glamState) {
|
|
53427
|
+
return {
|
|
53428
|
+
glamState,
|
|
53429
|
+
transferId: transfer.transferId,
|
|
53430
|
+
protocol: transfer.protocol,
|
|
53431
|
+
status: toBridgeTransferStatus(transfer.status),
|
|
53432
|
+
managed: true,
|
|
53433
|
+
receiptVerified: true,
|
|
53434
|
+
sourceMint: transfer.sourceMint,
|
|
53435
|
+
sourceDecimals: transfer.sourceDecimals,
|
|
53436
|
+
providerProgram: transfer.providerProgram,
|
|
53437
|
+
providerConfig: transfer.providerConfig,
|
|
53438
|
+
sourceAmount: transfer.sourceAmount,
|
|
53439
|
+
quotedOutAmount: transfer.quotedOutAmount,
|
|
53440
|
+
destinationChain: transfer.destinationChain,
|
|
53441
|
+
destinationRecipient: transfer.destinationRecipient,
|
|
53442
|
+
providerEmitter: transfer.providerEmitter,
|
|
53443
|
+
providerSequence: transfer.providerSequence,
|
|
53444
|
+
committedSlot: transfer.committedSlot
|
|
53445
|
+
};
|
|
53392
53446
|
}
|
|
53393
53447
|
function toRouteManagementModeArg(managementMode) {
|
|
53394
53448
|
if (managementMode && typeof managementMode === "object" && ("unmanagedOnly" in managementMode || "managedOnly" in managementMode || "either" in managementMode)) {
|
|
@@ -53434,7 +53488,7 @@ async function deriveOftAuxiliaryAccountSeed(glamState, transferId) {
|
|
|
53434
53488
|
const digest = await sha256(Buffer.concat([
|
|
53435
53489
|
Buffer.from("oft-auxiliary-account"),
|
|
53436
53490
|
glamState.toBuffer(),
|
|
53437
|
-
|
|
53491
|
+
transferId.toBuffer()
|
|
53438
53492
|
]));
|
|
53439
53493
|
return digest.subarray(0, 16).toString("hex");
|
|
53440
53494
|
}
|
|
@@ -53498,20 +53552,18 @@ let TxBuilder$1 = class TxBuilder extends BaseTxBuilder {
|
|
|
53498
53552
|
}).instruction();
|
|
53499
53553
|
}
|
|
53500
53554
|
async deleteLayerzeroOftRouteIx(route, signer) {
|
|
53501
|
-
return await this.client.base.extBridgeProgram.methods.deleteLayerzeroOftRoute(normalizeRoute(route)).
|
|
53555
|
+
return await this.client.base.extBridgeProgram.methods.deleteLayerzeroOftRoute(normalizeRoute(route)).accounts({
|
|
53502
53556
|
glamState: this.client.base.statePda,
|
|
53503
|
-
glamSigner: signer || this.client.base.signer
|
|
53504
|
-
glamProtocolProgram: this.client.base.protocolProgram.programId
|
|
53557
|
+
glamSigner: signer || this.client.base.signer
|
|
53505
53558
|
}).instruction();
|
|
53506
53559
|
}
|
|
53507
53560
|
async buildOftTransferTx(params, txOptions = {}) {
|
|
53508
53561
|
if (params.providerInstructions.length !== 1) {
|
|
53509
53562
|
throw new Error("OFT transfers require exactly one provider instruction");
|
|
53510
53563
|
}
|
|
53511
|
-
const transferId =
|
|
53564
|
+
const transferId = params.transferId;
|
|
53512
53565
|
const registryPda = getBridgeRegistryPda(this.client.base.statePda, this.client.base.extBridgeProgram.programId);
|
|
53513
53566
|
const sessionPda = getBridgeSessionPda(this.client.base.statePda, transferId, this.client.base.extBridgeProgram.programId);
|
|
53514
|
-
const transferRecordPda = getBridgeTransferRecordPda(this.client.base.statePda, transferId, this.client.base.extBridgeProgram.programId);
|
|
53515
53567
|
const integrationAuthority = web3_js.PublicKey.findProgramAddressSync([
|
|
53516
53568
|
Buffer.from(SEED_INTEGRATION_AUTHORITY)
|
|
53517
53569
|
], this.client.base.extBridgeProgram.programId)[0];
|
|
@@ -53564,17 +53616,16 @@ let TxBuilder$1 = class TxBuilder extends BaseTxBuilder {
|
|
|
53564
53616
|
glamState: this.client.base.statePda,
|
|
53565
53617
|
glamVault: this.client.base.vaultPda,
|
|
53566
53618
|
glamSigner: txOptions.signer || this.client.base.signer,
|
|
53567
|
-
integrationAuthority,
|
|
53568
53619
|
cpiProgram: tokenProgram,
|
|
53569
53620
|
glamProtocolProgram: this.client.base.protocolProgram.programId,
|
|
53570
|
-
systemProgram: web3_js.SystemProgram.programId,
|
|
53571
53621
|
instructions: web3_js.SYSVAR_INSTRUCTIONS_PUBKEY,
|
|
53572
53622
|
bridgeRegistry: registryPda,
|
|
53573
53623
|
bridgeSession: sessionPda,
|
|
53574
|
-
transferRecord: transferRecordPda,
|
|
53575
53624
|
sourceTokenAccount,
|
|
53576
53625
|
sourceMint: params.sourceMint,
|
|
53577
|
-
auxiliaryTokenAccount
|
|
53626
|
+
auxiliaryTokenAccount,
|
|
53627
|
+
integrationAuthority,
|
|
53628
|
+
systemProgram: web3_js.SystemProgram.programId
|
|
53578
53629
|
});
|
|
53579
53630
|
commitMethod.remainingAccounts(commitRemainingAccounts);
|
|
53580
53631
|
const commitIx = await commitMethod.instruction();
|
|
@@ -53587,11 +53638,65 @@ let TxBuilder$1 = class TxBuilder extends BaseTxBuilder {
|
|
|
53587
53638
|
tx,
|
|
53588
53639
|
additionalSigners: params.providerSigners || [],
|
|
53589
53640
|
sessionPda,
|
|
53590
|
-
transferRecordPda,
|
|
53591
53641
|
auxiliaryTokenAccount,
|
|
53592
53642
|
sourceTokenAccount
|
|
53593
53643
|
};
|
|
53594
53644
|
}
|
|
53645
|
+
async priceManagedTransfersIxs() {
|
|
53646
|
+
const [stateAccount, registry] = await Promise.all([
|
|
53647
|
+
this.client.base.fetchStateAccount(),
|
|
53648
|
+
this.client.fetchRegistry()
|
|
53649
|
+
]);
|
|
53650
|
+
if (!registry) {
|
|
53651
|
+
throw new Error("Managed bridge registry not initialized");
|
|
53652
|
+
}
|
|
53653
|
+
const transfers = getActiveRegistryTransfers(registry);
|
|
53654
|
+
const [baseAssetMeta, assetMetas] = await Promise.all([
|
|
53655
|
+
this.client.base.getAssetMeta(stateAccount.baseAssetMint),
|
|
53656
|
+
Promise.all(transfers.map(async (transfer)=>({
|
|
53657
|
+
transfer,
|
|
53658
|
+
assetMeta: await this.client.base.getAssetMeta(transfer.sourceMint)
|
|
53659
|
+
})))
|
|
53660
|
+
]);
|
|
53661
|
+
const integrationAuthority = web3_js.PublicKey.findProgramAddressSync([
|
|
53662
|
+
Buffer.from(SEED_INTEGRATION_AUTHORITY)
|
|
53663
|
+
], this.client.base.extBridgeProgram.programId)[0];
|
|
53664
|
+
const ixs = [];
|
|
53665
|
+
const kaminoReserveKeys = new Map();
|
|
53666
|
+
[
|
|
53667
|
+
baseAssetMeta,
|
|
53668
|
+
...assetMetas.map(({ assetMeta })=>assetMeta)
|
|
53669
|
+
].forEach((assetMeta)=>{
|
|
53670
|
+
if (assetMeta.oracleSource === "KaminoReserve") {
|
|
53671
|
+
kaminoReserveKeys.set(assetMeta.oracle.toBase58(), assetMeta.oracle);
|
|
53672
|
+
}
|
|
53673
|
+
});
|
|
53674
|
+
if (kaminoReserveKeys.size > 0) {
|
|
53675
|
+
const klend = new KaminoLendingClient(this.client.base, new VaultClient(this.client.base));
|
|
53676
|
+
const reserves = await klend.fetchAndParseReserves(Array.from(kaminoReserveKeys.values()));
|
|
53677
|
+
ixs.push(klend.txBuilder.refreshReservesBatchIx(reserves, false));
|
|
53678
|
+
}
|
|
53679
|
+
const remainingAccounts = assetMetas.map(({ assetMeta })=>({
|
|
53680
|
+
pubkey: assetMeta.oracle,
|
|
53681
|
+
isSigner: false,
|
|
53682
|
+
isWritable: false
|
|
53683
|
+
}));
|
|
53684
|
+
const priceMethod = this.client.base.extBridgeProgram.methods.priceManagedTransfers().accountsPartial({
|
|
53685
|
+
glamState: this.client.base.statePda,
|
|
53686
|
+
bridgeRegistry: this.client.getRegistryPda(),
|
|
53687
|
+
integrationAuthority,
|
|
53688
|
+
glamProtocolProgram: this.client.base.protocolProgram.programId,
|
|
53689
|
+
glamConfig: getGlobalConfigPda(),
|
|
53690
|
+
baseAssetOracle: baseAssetMeta.oracle
|
|
53691
|
+
});
|
|
53692
|
+
priceMethod.remainingAccounts(remainingAccounts);
|
|
53693
|
+
ixs.push(await priceMethod.instruction());
|
|
53694
|
+
return ixs;
|
|
53695
|
+
}
|
|
53696
|
+
async priceManagedTransfersTx(txOptions = {}) {
|
|
53697
|
+
const ixs = await this.priceManagedTransfersIxs();
|
|
53698
|
+
return await this.buildVersionedTx(ixs, txOptions);
|
|
53699
|
+
}
|
|
53595
53700
|
};
|
|
53596
53701
|
let LayerzeroOftBridgeProtocolClient = class LayerzeroOftBridgeProtocolClient {
|
|
53597
53702
|
async buildSendTx(params, txOptions = {}) {
|
|
@@ -53612,9 +53717,6 @@ class BridgeClient {
|
|
|
53612
53717
|
getSessionPda(transferId) {
|
|
53613
53718
|
return getBridgeSessionPda(this.base.statePda, transferId, this.base.extBridgeProgram.programId);
|
|
53614
53719
|
}
|
|
53615
|
-
getTransferRecordPda(transferId) {
|
|
53616
|
-
return getBridgeTransferRecordPda(this.base.statePda, transferId, this.base.extBridgeProgram.programId);
|
|
53617
|
-
}
|
|
53618
53720
|
getLayerzeroNoncePda(endpointProgram, sender, destinationChain, destinationRecipient) {
|
|
53619
53721
|
return deriveLayerzeroNoncePda(endpointProgram, sender, destinationChain, destinationRecipient);
|
|
53620
53722
|
}
|
|
@@ -53762,7 +53864,19 @@ class BridgeClient {
|
|
|
53762
53864
|
return await this.base.extBridgeProgram.account.bridgeSession.fetchNullable(this.getSessionPda(transferId));
|
|
53763
53865
|
}
|
|
53764
53866
|
async fetchTransferRecord(transferId) {
|
|
53765
|
-
|
|
53867
|
+
const record = await this.fetchTransferRecordNullable(transferId);
|
|
53868
|
+
if (!record) {
|
|
53869
|
+
throw new Error(`Managed bridge transfer not found for transferId ${transferId.toBase58()}`);
|
|
53870
|
+
}
|
|
53871
|
+
return record;
|
|
53872
|
+
}
|
|
53873
|
+
async fetchTransferRecordNullable(transferId) {
|
|
53874
|
+
const registry = await this.fetchRegistry();
|
|
53875
|
+
if (!registry) {
|
|
53876
|
+
return null;
|
|
53877
|
+
}
|
|
53878
|
+
const transfer = getActiveRegistryTransfers(registry).find((candidate)=>candidate.transferId.equals(transferId));
|
|
53879
|
+
return transfer ? registryTransferToRecord(transfer, this.base.statePda) : null;
|
|
53766
53880
|
}
|
|
53767
53881
|
async addLayerzeroOftRoute(route, txOptions = {}) {
|
|
53768
53882
|
const glamSigner = txOptions.signer || this.base.signer;
|
|
@@ -53795,7 +53909,7 @@ class BridgeClient {
|
|
|
53795
53909
|
return await this.txBuilder.buildOftTransferTx(params, txOptions);
|
|
53796
53910
|
}
|
|
53797
53911
|
async buildLayerzeroOftSendTx(params, txOptions = {}) {
|
|
53798
|
-
const resolvedTransferId = params.transferId || web3_js.Keypair.generate().publicKey
|
|
53912
|
+
const resolvedTransferId = params.transferId || web3_js.Keypair.generate().publicKey;
|
|
53799
53913
|
const { tokenProgram } = await fetchMintAndTokenProgram(this.base.connection, params.sourceMint);
|
|
53800
53914
|
const signer = txOptions.signer || this.base.signer;
|
|
53801
53915
|
const sourceTokenAccount = params.sourceTokenAccount || this.base.getVaultAta(params.sourceMint, tokenProgram);
|
|
@@ -53868,56 +53982,39 @@ class BridgeClient {
|
|
|
53868
53982
|
};
|
|
53869
53983
|
}
|
|
53870
53984
|
async settleManagedTransfer(transferId, txOptions = {}) {
|
|
53871
|
-
const
|
|
53872
|
-
|
|
53873
|
-
|
|
53874
|
-
|
|
53875
|
-
|
|
53876
|
-
|
|
53877
|
-
ix
|
|
53878
|
-
], txOptions);
|
|
53879
|
-
return await this.base.sendAndConfirm(tx);
|
|
53880
|
-
}
|
|
53881
|
-
async reconcileManagedTransfer(transferId, txOptions = {}) {
|
|
53882
|
-
const ix = await this.base.extBridgeProgram.methods.reconcileManagedTransfer().accountsPartial({
|
|
53985
|
+
const integrationAuthority = web3_js.PublicKey.findProgramAddressSync([
|
|
53986
|
+
Buffer.from(SEED_INTEGRATION_AUTHORITY)
|
|
53987
|
+
], this.base.extBridgeProgram.programId)[0];
|
|
53988
|
+
const ix = await this.base.extBridgeProgram.methods.settleManagedTransfer({
|
|
53989
|
+
transferId
|
|
53990
|
+
}).accountsPartial({
|
|
53883
53991
|
glamState: this.base.statePda,
|
|
53992
|
+
glamVault: this.base.vaultPda,
|
|
53884
53993
|
glamSigner: txOptions.signer || this.base.signer,
|
|
53885
53994
|
glamProtocolProgram: this.base.protocolProgram.programId,
|
|
53886
|
-
|
|
53995
|
+
bridgeRegistry: this.getRegistryPda(),
|
|
53996
|
+
integrationAuthority,
|
|
53997
|
+
systemProgram: web3_js.SystemProgram.programId
|
|
53887
53998
|
}).instruction();
|
|
53888
53999
|
const tx = await this.txBuilder.buildVersionedTx([
|
|
53889
54000
|
ix
|
|
53890
54001
|
], txOptions);
|
|
53891
54002
|
return await this.base.sendAndConfirm(tx);
|
|
53892
54003
|
}
|
|
53893
|
-
async
|
|
53894
|
-
|
|
53895
|
-
|
|
53896
|
-
|
|
53897
|
-
const ix = await this.base.extBridgeProgram.methods.failOrCancelManagedTransfer(failureReason).accounts({
|
|
54004
|
+
async validateManagedTransfer(transferId, txOptions = {}) {
|
|
54005
|
+
const ix = await this.base.extBridgeProgram.methods.validateManagedTransfer({
|
|
54006
|
+
transferId
|
|
54007
|
+
}).accounts({
|
|
53898
54008
|
glamState: this.base.statePda,
|
|
53899
|
-
|
|
53900
|
-
glamSigner: txOptions.signer || this.base.signer,
|
|
53901
|
-
// integrationAuthority,
|
|
53902
|
-
// glamProtocolProgram: this.base.protocolProgram.programId,
|
|
53903
|
-
// systemProgram: SystemProgram.programId,
|
|
53904
|
-
// bridgeRegistry: this.getRegistryPda(),
|
|
53905
|
-
transferRecord: this.getTransferRecordPda(transferId)
|
|
54009
|
+
glamSigner: txOptions.signer || this.base.signer
|
|
53906
54010
|
}).instruction();
|
|
53907
54011
|
const tx = await this.txBuilder.buildVersionedTx([
|
|
53908
54012
|
ix
|
|
53909
54013
|
], txOptions);
|
|
53910
54014
|
return await this.base.sendAndConfirm(tx);
|
|
53911
54015
|
}
|
|
53912
|
-
async
|
|
53913
|
-
const
|
|
53914
|
-
glamState: this.base.statePda,
|
|
53915
|
-
glamSigner: txOptions.signer || this.base.signer,
|
|
53916
|
-
transferRecord: this.getTransferRecordPda(transferId)
|
|
53917
|
-
}).instruction();
|
|
53918
|
-
const tx = await this.txBuilder.buildVersionedTx([
|
|
53919
|
-
ix
|
|
53920
|
-
], txOptions);
|
|
54016
|
+
async priceManagedTransfers(txOptions = {}) {
|
|
54017
|
+
const tx = await this.txBuilder.priceManagedTransfersTx(txOptions);
|
|
53921
54018
|
return await this.base.sendAndConfirm(tx);
|
|
53922
54019
|
}
|
|
53923
54020
|
constructor(base){
|
|
@@ -54103,7 +54200,7 @@ class EpiClient {
|
|
|
54103
54200
|
}
|
|
54104
54201
|
get price() {
|
|
54105
54202
|
if (!this._price) {
|
|
54106
|
-
this._price = new PriceClient(this, this.kaminoLending, this.kaminoVaults, ()=>this.jupiterSwap.jupApi);
|
|
54203
|
+
this._price = new PriceClient(this, this.kaminoLending, this.kaminoVaults, this.bridge, ()=>this.jupiterSwap.jupApi);
|
|
54107
54204
|
}
|
|
54108
54205
|
return this._price;
|
|
54109
54206
|
}
|