@keel-fi/svm-alm-controller 1.0.0-rc.1 → 1.0.1-rc.1
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/dist/generated/accounts/oracle.d.ts +2 -2
- package/dist/generated/accounts/oracle.d.ts.map +1 -1
- package/dist/generated/instructions/atomicSwapBorrow.d.ts +2 -2
- package/dist/generated/instructions/atomicSwapRepay.d.ts +1 -1
- package/dist/generated/instructions/claimRent.d.ts +45 -0
- package/dist/generated/instructions/claimRent.d.ts.map +1 -0
- package/dist/generated/instructions/index.d.ts +1 -0
- package/dist/generated/instructions/index.d.ts.map +1 -1
- package/dist/generated/instructions/initializeController.d.ts +1 -1
- package/dist/generated/instructions/initializeIntegration.d.ts +1 -1
- package/dist/generated/instructions/initializeReserve.d.ts +1 -1
- package/dist/generated/instructions/manageController.d.ts +1 -1
- package/dist/generated/instructions/manageIntegration.d.ts +1 -1
- package/dist/generated/instructions/managePermission.d.ts +1 -1
- package/dist/generated/instructions/manageReserve.d.ts +1 -1
- package/dist/generated/instructions/pull.d.ts +6 -9
- package/dist/generated/instructions/pull.d.ts.map +1 -1
- package/dist/generated/instructions/push.d.ts +6 -9
- package/dist/generated/instructions/push.d.ts.map +1 -1
- package/dist/generated/instructions/sync.d.ts +13 -7
- package/dist/generated/instructions/sync.d.ts.map +1 -1
- package/dist/generated/instructions/updateOracle.d.ts +5 -5
- package/dist/generated/instructions/updateOracle.d.ts.map +1 -1
- package/dist/generated/programs/svmAlmController.d.ts +8 -5
- package/dist/generated/programs/svmAlmController.d.ts.map +1 -1
- package/dist/generated/types/controllerStatus.d.ts +2 -1
- package/dist/generated/types/controllerStatus.d.ts.map +1 -1
- package/dist/generated/types/controllerUpdateEvent.d.ts +1 -1
- package/dist/generated/types/controllerUpdateEvent.d.ts.map +1 -1
- package/dist/generated/types/driftConfig.d.ts +12 -0
- package/dist/generated/types/driftConfig.d.ts.map +1 -0
- package/dist/generated/types/feed.d.ts +3 -2
- package/dist/generated/types/feed.d.ts.map +1 -1
- package/dist/generated/types/index.d.ts +4 -7
- package/dist/generated/types/index.d.ts.map +1 -1
- package/dist/generated/types/initializeArgs.d.ts +16 -5
- package/dist/generated/types/initializeArgs.d.ts.map +1 -1
- package/dist/generated/types/integrationConfig.d.ts +15 -8
- package/dist/generated/types/integrationConfig.d.ts.map +1 -1
- package/dist/generated/types/integrationState.d.ts +15 -8
- package/dist/generated/types/integrationState.d.ts.map +1 -1
- package/dist/generated/types/integrationType.d.ts +5 -4
- package/dist/generated/types/integrationType.d.ts.map +1 -1
- package/dist/generated/types/integrationUpdateEvent.d.ts +1 -1
- package/dist/generated/types/integrationUpdateEvent.d.ts.map +1 -1
- package/dist/generated/types/kaminoConfig.d.ts +14 -0
- package/dist/generated/types/kaminoConfig.d.ts.map +1 -0
- package/dist/generated/types/lendingState.d.ts +13 -0
- package/dist/generated/types/lendingState.d.ts.map +1 -0
- package/dist/generated/types/oracleUpdateEvent.d.ts +1 -1
- package/dist/generated/types/oracleUpdateEvent.d.ts.map +1 -1
- package/dist/generated/types/permissionUpdateEvent.d.ts +1 -1
- package/dist/generated/types/permissionUpdateEvent.d.ts.map +1 -1
- package/dist/generated/types/pullArgs.d.ts +16 -13
- package/dist/generated/types/pullArgs.d.ts.map +1 -1
- package/dist/generated/types/pushArgs.d.ts +16 -13
- package/dist/generated/types/pushArgs.d.ts.map +1 -1
- package/dist/generated/types/reserveUpdateEvent.d.ts +1 -1
- package/dist/generated/types/reserveUpdateEvent.d.ts.map +1 -1
- package/dist/index.es.js +587 -556
- package/dist/index.js +601 -573
- package/dist/pdas.d.ts +0 -1
- package/dist/pdas.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/generated/types/depositForBurnArgs.d.ts +0 -15
- package/dist/generated/types/depositForBurnArgs.d.ts.map +0 -1
- package/dist/generated/types/depositSingleTokenTypeExactAmountInArgs.d.ts +0 -13
- package/dist/generated/types/depositSingleTokenTypeExactAmountInArgs.d.ts.map +0 -1
- package/dist/generated/types/splTokenSwapConfig.d.ts +0 -15
- package/dist/generated/types/splTokenSwapConfig.d.ts.map +0 -1
- package/dist/generated/types/splTokenSwapState.d.ts +0 -17
- package/dist/generated/types/splTokenSwapState.d.ts.map +0 -1
- package/dist/generated/types/swapV1Subset.d.ts +0 -17
- package/dist/generated/types/swapV1Subset.d.ts.map +0 -1
- package/dist/generated/types/withdrawSingleTokenTypeExactAmountOutArgs.d.ts +0 -13
- package/dist/generated/types/withdrawSingleTokenTypeExactAmountOutArgs.d.ts.map +0 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getEnumEncoder, getEnumDecoder, combineCodec, getStructEncoder, getAddressEncoder, getOptionEncoder, getU64Encoder, getStructDecoder, getAddressDecoder, getOptionDecoder, getU64Decoder, getI64Encoder, getU16Encoder, getU8Encoder, getBooleanEncoder, fixEncoderSize, getBytesEncoder, getI64Decoder, getU16Decoder, getU8Decoder, getBooleanDecoder, fixDecoderSize, getBytesDecoder, getU32Encoder, getU32Decoder, getDiscriminatedUnionEncoder, getUnitEncoder, getDiscriminatedUnionDecoder, getUnitDecoder, getTupleEncoder, getTupleDecoder,
|
|
1
|
+
import { getEnumEncoder, getEnumDecoder, combineCodec, getStructEncoder, getAddressEncoder, getOptionEncoder, getU64Encoder, getStructDecoder, getAddressDecoder, getOptionDecoder, getU64Decoder, getI64Encoder, getU16Encoder, getU8Encoder, getBooleanEncoder, fixEncoderSize, getBytesEncoder, getI64Decoder, getU16Decoder, getU8Decoder, getBooleanDecoder, fixDecoderSize, getBytesDecoder, getU32Encoder, getU32Decoder, getDiscriminatedUnionEncoder, getUnitEncoder, getDiscriminatedUnionDecoder, getUnitDecoder, getTupleEncoder, getTupleDecoder, decodeAccount, assertAccountExists, fetchEncodedAccount, assertAccountsExist, fetchEncodedAccounts, getU128Encoder, getU128Decoder, getI128Encoder, getArrayEncoder, getI128Decoder, getArrayDecoder, containsBytes, AccountRole, upgradeRoleToSigner, isTransactionSigner as isTransactionSigner$1, transformEncoder, addEncoderSizePrefix, addDecoderSizePrefix } from '@solana/kit';
|
|
2
2
|
import { getAddressEncoder as getAddressEncoder$1, getProgramDerivedAddress, address } from '@solana/addresses';
|
|
3
3
|
|
|
4
4
|
var AccountDiscriminators;
|
|
@@ -175,6 +175,7 @@ var ControllerStatus;
|
|
|
175
175
|
ControllerStatus[ControllerStatus["Frozen"] = 0] = "Frozen";
|
|
176
176
|
ControllerStatus[ControllerStatus["Active"] = 1] = "Active";
|
|
177
177
|
ControllerStatus[ControllerStatus["PushPullFrozen"] = 2] = "PushPullFrozen";
|
|
178
|
+
ControllerStatus[ControllerStatus["AtomicSwapLock"] = 3] = "AtomicSwapLock";
|
|
178
179
|
})(ControllerStatus || (ControllerStatus = {}));
|
|
179
180
|
function getControllerStatusEncoder() {
|
|
180
181
|
return getEnumEncoder(ControllerStatus);
|
|
@@ -206,38 +207,24 @@ function getControllerUpdateEventCodec() {
|
|
|
206
207
|
return combineCodec(getControllerUpdateEventEncoder(), getControllerUpdateEventDecoder());
|
|
207
208
|
}
|
|
208
209
|
|
|
209
|
-
function
|
|
210
|
+
function getDriftConfigEncoder() {
|
|
210
211
|
return getStructEncoder([
|
|
211
|
-
['
|
|
212
|
-
['
|
|
213
|
-
['
|
|
214
|
-
|
|
215
|
-
}
|
|
216
|
-
function getDepositForBurnArgsDecoder() {
|
|
217
|
-
return getStructDecoder([
|
|
218
|
-
['amount', getU64Decoder()],
|
|
219
|
-
['destinationDomain', getU32Decoder()],
|
|
220
|
-
['mintRecipient', getAddressDecoder()],
|
|
221
|
-
]);
|
|
222
|
-
}
|
|
223
|
-
function getDepositForBurnArgsCodec() {
|
|
224
|
-
return combineCodec(getDepositForBurnArgsEncoder(), getDepositForBurnArgsDecoder());
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
function getDepositSingleTokenTypeExactAmountInArgsEncoder() {
|
|
228
|
-
return getStructEncoder([
|
|
229
|
-
['sourceTokenAmount', getU64Encoder()],
|
|
230
|
-
['minimumPoolTokenAmount', getU64Encoder()],
|
|
212
|
+
['subAccountId', getU16Encoder()],
|
|
213
|
+
['spotMarketIndex', getU16Encoder()],
|
|
214
|
+
['poolId', getU8Encoder()],
|
|
215
|
+
['padding', fixEncoderSize(getBytesEncoder(), 219)],
|
|
231
216
|
]);
|
|
232
217
|
}
|
|
233
|
-
function
|
|
218
|
+
function getDriftConfigDecoder() {
|
|
234
219
|
return getStructDecoder([
|
|
235
|
-
['
|
|
236
|
-
['
|
|
220
|
+
['subAccountId', getU16Decoder()],
|
|
221
|
+
['spotMarketIndex', getU16Decoder()],
|
|
222
|
+
['poolId', getU8Decoder()],
|
|
223
|
+
['padding', fixDecoderSize(getBytesDecoder(), 219)],
|
|
237
224
|
]);
|
|
238
225
|
}
|
|
239
|
-
function
|
|
240
|
-
return combineCodec(
|
|
226
|
+
function getDriftConfigCodec() {
|
|
227
|
+
return combineCodec(getDriftConfigEncoder(), getDriftConfigDecoder());
|
|
241
228
|
}
|
|
242
229
|
|
|
243
230
|
function getFeedEncoder() {
|
|
@@ -271,7 +258,6 @@ function getFeedArgsCodec() {
|
|
|
271
258
|
function getInitializeArgsEncoder() {
|
|
272
259
|
return getDiscriminatedUnionEncoder([
|
|
273
260
|
['SplTokenExternal', getUnitEncoder()],
|
|
274
|
-
['SplTokenSwap', getUnitEncoder()],
|
|
275
261
|
[
|
|
276
262
|
'CctpBridge',
|
|
277
263
|
getStructEncoder([
|
|
@@ -295,12 +281,19 @@ function getInitializeArgsEncoder() {
|
|
|
295
281
|
['oraclePriceInverted', getBooleanEncoder()],
|
|
296
282
|
]),
|
|
297
283
|
],
|
|
284
|
+
[
|
|
285
|
+
'Drift',
|
|
286
|
+
getStructEncoder([
|
|
287
|
+
['subAccountId', getU16Encoder()],
|
|
288
|
+
['spotMarketIndex', getU16Encoder()],
|
|
289
|
+
]),
|
|
290
|
+
],
|
|
291
|
+
['KaminoIntegration', getStructEncoder([['obligationId', getU8Encoder()]])],
|
|
298
292
|
]);
|
|
299
293
|
}
|
|
300
294
|
function getInitializeArgsDecoder() {
|
|
301
295
|
return getDiscriminatedUnionDecoder([
|
|
302
296
|
['SplTokenExternal', getUnitDecoder()],
|
|
303
|
-
['SplTokenSwap', getUnitDecoder()],
|
|
304
297
|
[
|
|
305
298
|
'CctpBridge',
|
|
306
299
|
getStructDecoder([
|
|
@@ -324,6 +317,14 @@ function getInitializeArgsDecoder() {
|
|
|
324
317
|
['oraclePriceInverted', getBooleanDecoder()],
|
|
325
318
|
]),
|
|
326
319
|
],
|
|
320
|
+
[
|
|
321
|
+
'Drift',
|
|
322
|
+
getStructDecoder([
|
|
323
|
+
['subAccountId', getU16Decoder()],
|
|
324
|
+
['spotMarketIndex', getU16Decoder()],
|
|
325
|
+
]),
|
|
326
|
+
],
|
|
327
|
+
['KaminoIntegration', getStructDecoder([['obligationId', getU8Decoder()]])],
|
|
327
328
|
]);
|
|
328
329
|
}
|
|
329
330
|
function getInitializeArgsCodec() {
|
|
@@ -350,12 +351,6 @@ function getIntegrationConfigEncoder() {
|
|
|
350
351
|
['fields', getTupleEncoder([getSplTokenExternalConfigEncoder()])],
|
|
351
352
|
]),
|
|
352
353
|
],
|
|
353
|
-
[
|
|
354
|
-
'SplTokenSwap',
|
|
355
|
-
getStructEncoder([
|
|
356
|
-
['fields', getTupleEncoder([getSplTokenSwapConfigEncoder()])],
|
|
357
|
-
]),
|
|
358
|
-
],
|
|
359
354
|
[
|
|
360
355
|
'CctpBridge',
|
|
361
356
|
getStructEncoder([
|
|
@@ -374,6 +369,18 @@ function getIntegrationConfigEncoder() {
|
|
|
374
369
|
['fields', getTupleEncoder([getAtomicSwapConfigEncoder()])],
|
|
375
370
|
]),
|
|
376
371
|
],
|
|
372
|
+
[
|
|
373
|
+
'Drift',
|
|
374
|
+
getStructEncoder([
|
|
375
|
+
['fields', getTupleEncoder([getDriftConfigEncoder()])],
|
|
376
|
+
]),
|
|
377
|
+
],
|
|
378
|
+
[
|
|
379
|
+
'Kamino',
|
|
380
|
+
getStructEncoder([
|
|
381
|
+
['fields', getTupleEncoder([getKaminoConfigEncoder()])],
|
|
382
|
+
]),
|
|
383
|
+
],
|
|
377
384
|
]);
|
|
378
385
|
}
|
|
379
386
|
function getIntegrationConfigDecoder() {
|
|
@@ -388,12 +395,6 @@ function getIntegrationConfigDecoder() {
|
|
|
388
395
|
['fields', getTupleDecoder([getSplTokenExternalConfigDecoder()])],
|
|
389
396
|
]),
|
|
390
397
|
],
|
|
391
|
-
[
|
|
392
|
-
'SplTokenSwap',
|
|
393
|
-
getStructDecoder([
|
|
394
|
-
['fields', getTupleDecoder([getSplTokenSwapConfigDecoder()])],
|
|
395
|
-
]),
|
|
396
|
-
],
|
|
397
398
|
[
|
|
398
399
|
'CctpBridge',
|
|
399
400
|
getStructDecoder([
|
|
@@ -412,6 +413,18 @@ function getIntegrationConfigDecoder() {
|
|
|
412
413
|
['fields', getTupleDecoder([getAtomicSwapConfigDecoder()])],
|
|
413
414
|
]),
|
|
414
415
|
],
|
|
416
|
+
[
|
|
417
|
+
'Drift',
|
|
418
|
+
getStructDecoder([
|
|
419
|
+
['fields', getTupleDecoder([getDriftConfigDecoder()])],
|
|
420
|
+
]),
|
|
421
|
+
],
|
|
422
|
+
[
|
|
423
|
+
'Kamino',
|
|
424
|
+
getStructDecoder([
|
|
425
|
+
['fields', getTupleDecoder([getKaminoConfigDecoder()])],
|
|
426
|
+
]),
|
|
427
|
+
],
|
|
415
428
|
]);
|
|
416
429
|
}
|
|
417
430
|
function getIntegrationConfigCodec() {
|
|
@@ -438,12 +451,6 @@ function getIntegrationStateEncoder() {
|
|
|
438
451
|
['fields', getTupleEncoder([getSplTokenExternalStateEncoder()])],
|
|
439
452
|
]),
|
|
440
453
|
],
|
|
441
|
-
[
|
|
442
|
-
'SplTokenSwap',
|
|
443
|
-
getStructEncoder([
|
|
444
|
-
['fields', getTupleEncoder([getSplTokenSwapStateEncoder()])],
|
|
445
|
-
]),
|
|
446
|
-
],
|
|
447
454
|
[
|
|
448
455
|
'CctpBridge',
|
|
449
456
|
getStructEncoder([
|
|
@@ -462,6 +469,18 @@ function getIntegrationStateEncoder() {
|
|
|
462
469
|
['fields', getTupleEncoder([getAtomicSwapStateEncoder()])],
|
|
463
470
|
]),
|
|
464
471
|
],
|
|
472
|
+
[
|
|
473
|
+
'Drift',
|
|
474
|
+
getStructEncoder([
|
|
475
|
+
['fields', getTupleEncoder([getLendingStateEncoder()])],
|
|
476
|
+
]),
|
|
477
|
+
],
|
|
478
|
+
[
|
|
479
|
+
'Kamino',
|
|
480
|
+
getStructEncoder([
|
|
481
|
+
['fields', getTupleEncoder([getLendingStateEncoder()])],
|
|
482
|
+
]),
|
|
483
|
+
],
|
|
465
484
|
]);
|
|
466
485
|
}
|
|
467
486
|
function getIntegrationStateDecoder() {
|
|
@@ -476,12 +495,6 @@ function getIntegrationStateDecoder() {
|
|
|
476
495
|
['fields', getTupleDecoder([getSplTokenExternalStateDecoder()])],
|
|
477
496
|
]),
|
|
478
497
|
],
|
|
479
|
-
[
|
|
480
|
-
'SplTokenSwap',
|
|
481
|
-
getStructDecoder([
|
|
482
|
-
['fields', getTupleDecoder([getSplTokenSwapStateDecoder()])],
|
|
483
|
-
]),
|
|
484
|
-
],
|
|
485
498
|
[
|
|
486
499
|
'CctpBridge',
|
|
487
500
|
getStructDecoder([
|
|
@@ -500,6 +513,18 @@ function getIntegrationStateDecoder() {
|
|
|
500
513
|
['fields', getTupleDecoder([getAtomicSwapStateDecoder()])],
|
|
501
514
|
]),
|
|
502
515
|
],
|
|
516
|
+
[
|
|
517
|
+
'Drift',
|
|
518
|
+
getStructDecoder([
|
|
519
|
+
['fields', getTupleDecoder([getLendingStateDecoder()])],
|
|
520
|
+
]),
|
|
521
|
+
],
|
|
522
|
+
[
|
|
523
|
+
'Kamino',
|
|
524
|
+
getStructDecoder([
|
|
525
|
+
['fields', getTupleDecoder([getLendingStateDecoder()])],
|
|
526
|
+
]),
|
|
527
|
+
],
|
|
503
528
|
]);
|
|
504
529
|
}
|
|
505
530
|
function getIntegrationStateCodec() {
|
|
@@ -532,10 +557,11 @@ function getIntegrationStatusCodec() {
|
|
|
532
557
|
var IntegrationType;
|
|
533
558
|
(function (IntegrationType) {
|
|
534
559
|
IntegrationType[IntegrationType["SplTokenExternal"] = 0] = "SplTokenExternal";
|
|
535
|
-
IntegrationType[IntegrationType["
|
|
536
|
-
IntegrationType[IntegrationType["
|
|
537
|
-
IntegrationType[IntegrationType["
|
|
538
|
-
IntegrationType[IntegrationType["
|
|
560
|
+
IntegrationType[IntegrationType["CctpBridge"] = 1] = "CctpBridge";
|
|
561
|
+
IntegrationType[IntegrationType["LzBridge"] = 2] = "LzBridge";
|
|
562
|
+
IntegrationType[IntegrationType["AtomicSwap"] = 3] = "AtomicSwap";
|
|
563
|
+
IntegrationType[IntegrationType["Drift"] = 4] = "Drift";
|
|
564
|
+
IntegrationType[IntegrationType["Kamino"] = 5] = "Kamino";
|
|
539
565
|
})(IntegrationType || (IntegrationType = {}));
|
|
540
566
|
function getIntegrationTypeEncoder() {
|
|
541
567
|
return getEnumEncoder(IntegrationType);
|
|
@@ -547,6 +573,70 @@ function getIntegrationTypeCodec() {
|
|
|
547
573
|
return combineCodec(getIntegrationTypeEncoder(), getIntegrationTypeDecoder());
|
|
548
574
|
}
|
|
549
575
|
|
|
576
|
+
function getIntegrationEncoder() {
|
|
577
|
+
return getStructEncoder([
|
|
578
|
+
['controller', getAddressEncoder()],
|
|
579
|
+
['description', fixEncoderSize(getBytesEncoder(), 32)],
|
|
580
|
+
['hash', fixEncoderSize(getBytesEncoder(), 32)],
|
|
581
|
+
['status', getIntegrationStatusEncoder()],
|
|
582
|
+
['rateLimitSlope', getU64Encoder()],
|
|
583
|
+
['rateLimitMaxOutflow', getU64Encoder()],
|
|
584
|
+
['rateLimitOutflowAmountAvailable', getU64Encoder()],
|
|
585
|
+
['rateLimitRemainder', getU64Encoder()],
|
|
586
|
+
['lastRefreshTimestamp', getI64Encoder()],
|
|
587
|
+
['lastRefreshSlot', getU64Encoder()],
|
|
588
|
+
['config', getIntegrationConfigEncoder()],
|
|
589
|
+
['state', getIntegrationStateEncoder()],
|
|
590
|
+
['permitLiquidation', getBooleanEncoder()],
|
|
591
|
+
['padding', fixEncoderSize(getBytesEncoder(), 87)],
|
|
592
|
+
]);
|
|
593
|
+
}
|
|
594
|
+
function getIntegrationDecoder() {
|
|
595
|
+
return getStructDecoder([
|
|
596
|
+
['controller', getAddressDecoder()],
|
|
597
|
+
['description', fixDecoderSize(getBytesDecoder(), 32)],
|
|
598
|
+
['hash', fixDecoderSize(getBytesDecoder(), 32)],
|
|
599
|
+
['status', getIntegrationStatusDecoder()],
|
|
600
|
+
['rateLimitSlope', getU64Decoder()],
|
|
601
|
+
['rateLimitMaxOutflow', getU64Decoder()],
|
|
602
|
+
['rateLimitOutflowAmountAvailable', getU64Decoder()],
|
|
603
|
+
['rateLimitRemainder', getU64Decoder()],
|
|
604
|
+
['lastRefreshTimestamp', getI64Decoder()],
|
|
605
|
+
['lastRefreshSlot', getU64Decoder()],
|
|
606
|
+
['config', getIntegrationConfigDecoder()],
|
|
607
|
+
['state', getIntegrationStateDecoder()],
|
|
608
|
+
['permitLiquidation', getBooleanDecoder()],
|
|
609
|
+
['padding', fixDecoderSize(getBytesDecoder(), 87)],
|
|
610
|
+
]);
|
|
611
|
+
}
|
|
612
|
+
function getIntegrationCodec() {
|
|
613
|
+
return combineCodec(getIntegrationEncoder(), getIntegrationDecoder());
|
|
614
|
+
}
|
|
615
|
+
function decodeIntegration(encodedAccount) {
|
|
616
|
+
return decodeAccount(encodedAccount, getIntegrationDecoder());
|
|
617
|
+
}
|
|
618
|
+
async function fetchIntegration(rpc, address, config) {
|
|
619
|
+
const maybeAccount = await fetchMaybeIntegration(rpc, address, config);
|
|
620
|
+
assertAccountExists(maybeAccount);
|
|
621
|
+
return maybeAccount;
|
|
622
|
+
}
|
|
623
|
+
async function fetchMaybeIntegration(rpc, address, config) {
|
|
624
|
+
const maybeAccount = await fetchEncodedAccount(rpc, address, config);
|
|
625
|
+
return decodeIntegration(maybeAccount);
|
|
626
|
+
}
|
|
627
|
+
async function fetchAllIntegration(rpc, addresses, config) {
|
|
628
|
+
const maybeAccounts = await fetchAllMaybeIntegration(rpc, addresses, config);
|
|
629
|
+
assertAccountsExist(maybeAccounts);
|
|
630
|
+
return maybeAccounts;
|
|
631
|
+
}
|
|
632
|
+
async function fetchAllMaybeIntegration(rpc, addresses, config) {
|
|
633
|
+
const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
|
|
634
|
+
return maybeAccounts.map((maybeAccount) => decodeIntegration(maybeAccount));
|
|
635
|
+
}
|
|
636
|
+
function getIntegrationSize() {
|
|
637
|
+
return 507;
|
|
638
|
+
}
|
|
639
|
+
|
|
550
640
|
function getIntegrationUpdateEventEncoder() {
|
|
551
641
|
return getStructEncoder([
|
|
552
642
|
['authority', getAddressEncoder()],
|
|
@@ -569,6 +659,46 @@ function getIntegrationUpdateEventCodec() {
|
|
|
569
659
|
return combineCodec(getIntegrationUpdateEventEncoder(), getIntegrationUpdateEventDecoder());
|
|
570
660
|
}
|
|
571
661
|
|
|
662
|
+
function getKaminoConfigEncoder() {
|
|
663
|
+
return getStructEncoder([
|
|
664
|
+
['market', getAddressEncoder()],
|
|
665
|
+
['reserve', getAddressEncoder()],
|
|
666
|
+
['reserveLiquidityMint', getAddressEncoder()],
|
|
667
|
+
['obligation', getAddressEncoder()],
|
|
668
|
+
['obligationId', getU8Encoder()],
|
|
669
|
+
['padding', fixEncoderSize(getBytesEncoder(), 95)],
|
|
670
|
+
]);
|
|
671
|
+
}
|
|
672
|
+
function getKaminoConfigDecoder() {
|
|
673
|
+
return getStructDecoder([
|
|
674
|
+
['market', getAddressDecoder()],
|
|
675
|
+
['reserve', getAddressDecoder()],
|
|
676
|
+
['reserveLiquidityMint', getAddressDecoder()],
|
|
677
|
+
['obligation', getAddressDecoder()],
|
|
678
|
+
['obligationId', getU8Decoder()],
|
|
679
|
+
['padding', fixDecoderSize(getBytesDecoder(), 95)],
|
|
680
|
+
]);
|
|
681
|
+
}
|
|
682
|
+
function getKaminoConfigCodec() {
|
|
683
|
+
return combineCodec(getKaminoConfigEncoder(), getKaminoConfigDecoder());
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
function getLendingStateEncoder() {
|
|
687
|
+
return getStructEncoder([
|
|
688
|
+
['balance', getU64Encoder()],
|
|
689
|
+
['padding', fixEncoderSize(getBytesEncoder(), 40)],
|
|
690
|
+
]);
|
|
691
|
+
}
|
|
692
|
+
function getLendingStateDecoder() {
|
|
693
|
+
return getStructDecoder([
|
|
694
|
+
['balance', getU64Decoder()],
|
|
695
|
+
['padding', fixDecoderSize(getBytesDecoder(), 40)],
|
|
696
|
+
]);
|
|
697
|
+
}
|
|
698
|
+
function getLendingStateCodec() {
|
|
699
|
+
return combineCodec(getLendingStateEncoder(), getLendingStateDecoder());
|
|
700
|
+
}
|
|
701
|
+
|
|
572
702
|
function getLocalTokenEncoder() {
|
|
573
703
|
return getStructEncoder([
|
|
574
704
|
['custody', getAddressEncoder()],
|
|
@@ -693,6 +823,64 @@ function getOFTStoreCodec() {
|
|
|
693
823
|
return combineCodec(getOFTStoreEncoder(), getOFTStoreDecoder());
|
|
694
824
|
}
|
|
695
825
|
|
|
826
|
+
function getOracleEncoder() {
|
|
827
|
+
return getStructEncoder([
|
|
828
|
+
['version', getU8Encoder()],
|
|
829
|
+
['authority', getAddressEncoder()],
|
|
830
|
+
['nonce', getAddressEncoder()],
|
|
831
|
+
['value', getI128Encoder()],
|
|
832
|
+
['precision', getU32Encoder()],
|
|
833
|
+
['lastUpdateSlot', getU64Encoder()],
|
|
834
|
+
['controller', getAddressEncoder()],
|
|
835
|
+
['baseMint', getAddressEncoder()],
|
|
836
|
+
['quoteMint', getAddressEncoder()],
|
|
837
|
+
['reserved', fixEncoderSize(getBytesEncoder(), 64)],
|
|
838
|
+
['feeds', getArrayEncoder(getFeedEncoder(), { size: 1 })],
|
|
839
|
+
]);
|
|
840
|
+
}
|
|
841
|
+
function getOracleDecoder() {
|
|
842
|
+
return getStructDecoder([
|
|
843
|
+
['version', getU8Decoder()],
|
|
844
|
+
['authority', getAddressDecoder()],
|
|
845
|
+
['nonce', getAddressDecoder()],
|
|
846
|
+
['value', getI128Decoder()],
|
|
847
|
+
['precision', getU32Decoder()],
|
|
848
|
+
['lastUpdateSlot', getU64Decoder()],
|
|
849
|
+
['controller', getAddressDecoder()],
|
|
850
|
+
['baseMint', getAddressDecoder()],
|
|
851
|
+
['quoteMint', getAddressDecoder()],
|
|
852
|
+
['reserved', fixDecoderSize(getBytesDecoder(), 64)],
|
|
853
|
+
['feeds', getArrayDecoder(getFeedDecoder(), { size: 1 })],
|
|
854
|
+
]);
|
|
855
|
+
}
|
|
856
|
+
function getOracleCodec() {
|
|
857
|
+
return combineCodec(getOracleEncoder(), getOracleDecoder());
|
|
858
|
+
}
|
|
859
|
+
function decodeOracle(encodedAccount) {
|
|
860
|
+
return decodeAccount(encodedAccount, getOracleDecoder());
|
|
861
|
+
}
|
|
862
|
+
async function fetchOracle(rpc, address, config) {
|
|
863
|
+
const maybeAccount = await fetchMaybeOracle(rpc, address, config);
|
|
864
|
+
assertAccountExists(maybeAccount);
|
|
865
|
+
return maybeAccount;
|
|
866
|
+
}
|
|
867
|
+
async function fetchMaybeOracle(rpc, address, config) {
|
|
868
|
+
const maybeAccount = await fetchEncodedAccount(rpc, address, config);
|
|
869
|
+
return decodeOracle(maybeAccount);
|
|
870
|
+
}
|
|
871
|
+
async function fetchAllOracle(rpc, addresses, config) {
|
|
872
|
+
const maybeAccounts = await fetchAllMaybeOracle(rpc, addresses, config);
|
|
873
|
+
assertAccountsExist(maybeAccounts);
|
|
874
|
+
return maybeAccounts;
|
|
875
|
+
}
|
|
876
|
+
async function fetchAllMaybeOracle(rpc, addresses, config) {
|
|
877
|
+
const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
|
|
878
|
+
return maybeAccounts.map((maybeAccount) => decodeOracle(maybeAccount));
|
|
879
|
+
}
|
|
880
|
+
function getOracleSize() {
|
|
881
|
+
return 349;
|
|
882
|
+
}
|
|
883
|
+
|
|
696
884
|
function getOracleUpdateEventEncoder() {
|
|
697
885
|
return getStructEncoder([
|
|
698
886
|
['authority', getAddressEncoder()],
|
|
@@ -744,58 +932,118 @@ function getPermissionStatusCodec() {
|
|
|
744
932
|
return combineCodec(getPermissionStatusEncoder(), getPermissionStatusDecoder());
|
|
745
933
|
}
|
|
746
934
|
|
|
747
|
-
function
|
|
935
|
+
function getPermissionEncoder() {
|
|
748
936
|
return getStructEncoder([
|
|
749
|
-
['authority', getAddressEncoder()],
|
|
750
937
|
['controller', getAddressEncoder()],
|
|
751
|
-
['
|
|
752
|
-
['
|
|
753
|
-
['
|
|
938
|
+
['authority', getAddressEncoder()],
|
|
939
|
+
['status', getPermissionStatusEncoder()],
|
|
940
|
+
['canManagePermissions', getBooleanEncoder()],
|
|
941
|
+
['canInvokeExternalTransfer', getBooleanEncoder()],
|
|
942
|
+
['canExecuteSwap', getBooleanEncoder()],
|
|
943
|
+
['canReallocate', getBooleanEncoder()],
|
|
944
|
+
['canFreezeController', getBooleanEncoder()],
|
|
945
|
+
['canUnfreezeController', getBooleanEncoder()],
|
|
946
|
+
['canManageReservesAndIntegrations', getBooleanEncoder()],
|
|
947
|
+
['canSuspendPermissions', getBooleanEncoder()],
|
|
948
|
+
['canLiquidate', getBooleanEncoder()],
|
|
949
|
+
['padding', fixEncoderSize(getBytesEncoder(), 30)],
|
|
754
950
|
]);
|
|
755
951
|
}
|
|
756
|
-
function
|
|
952
|
+
function getPermissionDecoder() {
|
|
757
953
|
return getStructDecoder([
|
|
758
|
-
['authority', getAddressDecoder()],
|
|
759
954
|
['controller', getAddressDecoder()],
|
|
760
|
-
['
|
|
761
|
-
['
|
|
762
|
-
['
|
|
955
|
+
['authority', getAddressDecoder()],
|
|
956
|
+
['status', getPermissionStatusDecoder()],
|
|
957
|
+
['canManagePermissions', getBooleanDecoder()],
|
|
958
|
+
['canInvokeExternalTransfer', getBooleanDecoder()],
|
|
959
|
+
['canExecuteSwap', getBooleanDecoder()],
|
|
960
|
+
['canReallocate', getBooleanDecoder()],
|
|
961
|
+
['canFreezeController', getBooleanDecoder()],
|
|
962
|
+
['canUnfreezeController', getBooleanDecoder()],
|
|
963
|
+
['canManageReservesAndIntegrations', getBooleanDecoder()],
|
|
964
|
+
['canSuspendPermissions', getBooleanDecoder()],
|
|
965
|
+
['canLiquidate', getBooleanDecoder()],
|
|
966
|
+
['padding', fixDecoderSize(getBytesDecoder(), 30)],
|
|
763
967
|
]);
|
|
764
968
|
}
|
|
765
|
-
function
|
|
766
|
-
return combineCodec(
|
|
969
|
+
function getPermissionCodec() {
|
|
970
|
+
return combineCodec(getPermissionEncoder(), getPermissionDecoder());
|
|
767
971
|
}
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
972
|
+
function decodePermission(encodedAccount) {
|
|
973
|
+
return decodeAccount(encodedAccount, getPermissionDecoder());
|
|
974
|
+
}
|
|
975
|
+
async function fetchPermission(rpc, address, config) {
|
|
976
|
+
const maybeAccount = await fetchMaybePermission(rpc, address, config);
|
|
977
|
+
assertAccountExists(maybeAccount);
|
|
978
|
+
return maybeAccount;
|
|
979
|
+
}
|
|
980
|
+
async function fetchMaybePermission(rpc, address, config) {
|
|
981
|
+
const maybeAccount = await fetchEncodedAccount(rpc, address, config);
|
|
982
|
+
return decodePermission(maybeAccount);
|
|
983
|
+
}
|
|
984
|
+
async function fetchAllPermission(rpc, addresses, config) {
|
|
985
|
+
const maybeAccounts = await fetchAllMaybePermission(rpc, addresses, config);
|
|
986
|
+
assertAccountsExist(maybeAccounts);
|
|
987
|
+
return maybeAccounts;
|
|
988
|
+
}
|
|
989
|
+
async function fetchAllMaybePermission(rpc, addresses, config) {
|
|
990
|
+
const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
|
|
991
|
+
return maybeAccounts.map((maybeAccount) => decodePermission(maybeAccount));
|
|
992
|
+
}
|
|
993
|
+
function getPermissionSize() {
|
|
994
|
+
return 104;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
function getPermissionUpdateEventEncoder() {
|
|
998
|
+
return getStructEncoder([
|
|
999
|
+
['authority', getAddressEncoder()],
|
|
1000
|
+
['controller', getAddressEncoder()],
|
|
1001
|
+
['permission', getAddressEncoder()],
|
|
1002
|
+
['oldState', getOptionEncoder(getPermissionEncoder())],
|
|
1003
|
+
['newState', getOptionEncoder(getPermissionEncoder())],
|
|
1004
|
+
]);
|
|
1005
|
+
}
|
|
1006
|
+
function getPermissionUpdateEventDecoder() {
|
|
1007
|
+
return getStructDecoder([
|
|
1008
|
+
['authority', getAddressDecoder()],
|
|
1009
|
+
['controller', getAddressDecoder()],
|
|
1010
|
+
['permission', getAddressDecoder()],
|
|
1011
|
+
['oldState', getOptionDecoder(getPermissionDecoder())],
|
|
1012
|
+
['newState', getOptionDecoder(getPermissionDecoder())],
|
|
1013
|
+
]);
|
|
1014
|
+
}
|
|
1015
|
+
function getPermissionUpdateEventCodec() {
|
|
1016
|
+
return combineCodec(getPermissionUpdateEventEncoder(), getPermissionUpdateEventDecoder());
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
function getPullArgsEncoder() {
|
|
1020
|
+
return getDiscriminatedUnionEncoder([
|
|
1021
|
+
['SplTokenExternal', getUnitEncoder()],
|
|
781
1022
|
['CctpBridge', getUnitEncoder()],
|
|
782
1023
|
['LzBridge', getUnitEncoder()],
|
|
1024
|
+
['Kamino', getStructEncoder([['amount', getU64Encoder()]])],
|
|
1025
|
+
[
|
|
1026
|
+
'Drift',
|
|
1027
|
+
getStructEncoder([
|
|
1028
|
+
['spotMarketIndex', getU16Encoder()],
|
|
1029
|
+
['amount', getU64Encoder()],
|
|
1030
|
+
]),
|
|
1031
|
+
],
|
|
783
1032
|
]);
|
|
784
1033
|
}
|
|
785
1034
|
function getPullArgsDecoder() {
|
|
786
1035
|
return getDiscriminatedUnionDecoder([
|
|
787
1036
|
['SplTokenExternal', getUnitDecoder()],
|
|
1037
|
+
['CctpBridge', getUnitDecoder()],
|
|
1038
|
+
['LzBridge', getUnitDecoder()],
|
|
1039
|
+
['Kamino', getStructDecoder([['amount', getU64Decoder()]])],
|
|
788
1040
|
[
|
|
789
|
-
'
|
|
1041
|
+
'Drift',
|
|
790
1042
|
getStructDecoder([
|
|
791
|
-
['
|
|
792
|
-
['
|
|
793
|
-
['maximumPoolTokenAmountA', getU64Decoder()],
|
|
794
|
-
['maximumPoolTokenAmountB', getU64Decoder()],
|
|
1043
|
+
['spotMarketIndex', getU16Decoder()],
|
|
1044
|
+
['amount', getU64Decoder()],
|
|
795
1045
|
]),
|
|
796
1046
|
],
|
|
797
|
-
['CctpBridge', getUnitDecoder()],
|
|
798
|
-
['LzBridge', getUnitDecoder()],
|
|
799
1047
|
]);
|
|
800
1048
|
}
|
|
801
1049
|
function getPullArgsCodec() {
|
|
@@ -813,33 +1061,31 @@ function isPullArgs(kind, value) {
|
|
|
813
1061
|
function getPushArgsEncoder() {
|
|
814
1062
|
return getDiscriminatedUnionEncoder([
|
|
815
1063
|
['SplTokenExternal', getStructEncoder([['amount', getU64Encoder()]])],
|
|
1064
|
+
['CctpBridge', getStructEncoder([['amount', getU64Encoder()]])],
|
|
1065
|
+
['LzBridge', getStructEncoder([['amount', getU64Encoder()]])],
|
|
816
1066
|
[
|
|
817
|
-
'
|
|
1067
|
+
'Drift',
|
|
818
1068
|
getStructEncoder([
|
|
819
|
-
['
|
|
820
|
-
['
|
|
821
|
-
['minimumPoolTokenAmountA', getU64Encoder()],
|
|
822
|
-
['minimumPoolTokenAmountB', getU64Encoder()],
|
|
1069
|
+
['spotMarketIndex', getU16Encoder()],
|
|
1070
|
+
['amount', getU64Encoder()],
|
|
823
1071
|
]),
|
|
824
1072
|
],
|
|
825
|
-
['
|
|
826
|
-
['LzBridge', getStructEncoder([['amount', getU64Encoder()]])],
|
|
1073
|
+
['Kamino', getStructEncoder([['amount', getU64Encoder()]])],
|
|
827
1074
|
]);
|
|
828
1075
|
}
|
|
829
1076
|
function getPushArgsDecoder() {
|
|
830
1077
|
return getDiscriminatedUnionDecoder([
|
|
831
1078
|
['SplTokenExternal', getStructDecoder([['amount', getU64Decoder()]])],
|
|
1079
|
+
['CctpBridge', getStructDecoder([['amount', getU64Decoder()]])],
|
|
1080
|
+
['LzBridge', getStructDecoder([['amount', getU64Decoder()]])],
|
|
832
1081
|
[
|
|
833
|
-
'
|
|
1082
|
+
'Drift',
|
|
834
1083
|
getStructDecoder([
|
|
835
|
-
['
|
|
836
|
-
['
|
|
837
|
-
['minimumPoolTokenAmountA', getU64Decoder()],
|
|
838
|
-
['minimumPoolTokenAmountB', getU64Decoder()],
|
|
1084
|
+
['spotMarketIndex', getU16Decoder()],
|
|
1085
|
+
['amount', getU64Decoder()],
|
|
839
1086
|
]),
|
|
840
1087
|
],
|
|
841
|
-
['
|
|
842
|
-
['LzBridge', getStructDecoder([['amount', getU64Decoder()]])],
|
|
1088
|
+
['Kamino', getStructDecoder([['amount', getU64Decoder()]])],
|
|
843
1089
|
]);
|
|
844
1090
|
}
|
|
845
1091
|
function getPushArgsCodec() {
|
|
@@ -885,6 +1131,66 @@ function getReserveStatusCodec() {
|
|
|
885
1131
|
return combineCodec(getReserveStatusEncoder(), getReserveStatusDecoder());
|
|
886
1132
|
}
|
|
887
1133
|
|
|
1134
|
+
function getReserveEncoder() {
|
|
1135
|
+
return getStructEncoder([
|
|
1136
|
+
['controller', getAddressEncoder()],
|
|
1137
|
+
['mint', getAddressEncoder()],
|
|
1138
|
+
['vault', getAddressEncoder()],
|
|
1139
|
+
['status', getReserveStatusEncoder()],
|
|
1140
|
+
['rateLimitSlope', getU64Encoder()],
|
|
1141
|
+
['rateLimitMaxOutflow', getU64Encoder()],
|
|
1142
|
+
['rateLimitOutflowAmountAvailable', getU64Encoder()],
|
|
1143
|
+
['rateLimitRemainder', getU64Encoder()],
|
|
1144
|
+
['lastBalance', getU64Encoder()],
|
|
1145
|
+
['lastRefreshTimestamp', getI64Encoder()],
|
|
1146
|
+
['lastRefreshSlot', getU64Encoder()],
|
|
1147
|
+
['padding', fixEncoderSize(getBytesEncoder(), 120)],
|
|
1148
|
+
]);
|
|
1149
|
+
}
|
|
1150
|
+
function getReserveDecoder() {
|
|
1151
|
+
return getStructDecoder([
|
|
1152
|
+
['controller', getAddressDecoder()],
|
|
1153
|
+
['mint', getAddressDecoder()],
|
|
1154
|
+
['vault', getAddressDecoder()],
|
|
1155
|
+
['status', getReserveStatusDecoder()],
|
|
1156
|
+
['rateLimitSlope', getU64Decoder()],
|
|
1157
|
+
['rateLimitMaxOutflow', getU64Decoder()],
|
|
1158
|
+
['rateLimitOutflowAmountAvailable', getU64Decoder()],
|
|
1159
|
+
['rateLimitRemainder', getU64Decoder()],
|
|
1160
|
+
['lastBalance', getU64Decoder()],
|
|
1161
|
+
['lastRefreshTimestamp', getI64Decoder()],
|
|
1162
|
+
['lastRefreshSlot', getU64Decoder()],
|
|
1163
|
+
['padding', fixDecoderSize(getBytesDecoder(), 120)],
|
|
1164
|
+
]);
|
|
1165
|
+
}
|
|
1166
|
+
function getReserveCodec() {
|
|
1167
|
+
return combineCodec(getReserveEncoder(), getReserveDecoder());
|
|
1168
|
+
}
|
|
1169
|
+
function decodeReserve(encodedAccount) {
|
|
1170
|
+
return decodeAccount(encodedAccount, getReserveDecoder());
|
|
1171
|
+
}
|
|
1172
|
+
async function fetchReserve(rpc, address, config) {
|
|
1173
|
+
const maybeAccount = await fetchMaybeReserve(rpc, address, config);
|
|
1174
|
+
assertAccountExists(maybeAccount);
|
|
1175
|
+
return maybeAccount;
|
|
1176
|
+
}
|
|
1177
|
+
async function fetchMaybeReserve(rpc, address, config) {
|
|
1178
|
+
const maybeAccount = await fetchEncodedAccount(rpc, address, config);
|
|
1179
|
+
return decodeReserve(maybeAccount);
|
|
1180
|
+
}
|
|
1181
|
+
async function fetchAllReserve(rpc, addresses, config) {
|
|
1182
|
+
const maybeAccounts = await fetchAllMaybeReserve(rpc, addresses, config);
|
|
1183
|
+
assertAccountsExist(maybeAccounts);
|
|
1184
|
+
return maybeAccounts;
|
|
1185
|
+
}
|
|
1186
|
+
async function fetchAllMaybeReserve(rpc, addresses, config) {
|
|
1187
|
+
const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
|
|
1188
|
+
return maybeAccounts.map((maybeAccount) => decodeReserve(maybeAccount));
|
|
1189
|
+
}
|
|
1190
|
+
function getReserveSize() {
|
|
1191
|
+
return 273;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
888
1194
|
function getReserveUpdateEventEncoder() {
|
|
889
1195
|
return getStructEncoder([
|
|
890
1196
|
['authority', getAddressEncoder()],
|
|
@@ -939,52 +1245,6 @@ function getSplTokenExternalStateCodec() {
|
|
|
939
1245
|
return combineCodec(getSplTokenExternalStateEncoder(), getSplTokenExternalStateDecoder());
|
|
940
1246
|
}
|
|
941
1247
|
|
|
942
|
-
function getSplTokenSwapConfigEncoder() {
|
|
943
|
-
return getStructEncoder([
|
|
944
|
-
['program', getAddressEncoder()],
|
|
945
|
-
['swap', getAddressEncoder()],
|
|
946
|
-
['mintA', getAddressEncoder()],
|
|
947
|
-
['mintB', getAddressEncoder()],
|
|
948
|
-
['lpMint', getAddressEncoder()],
|
|
949
|
-
['lpTokenAccount', getAddressEncoder()],
|
|
950
|
-
['padding', fixEncoderSize(getBytesEncoder(), 32)],
|
|
951
|
-
]);
|
|
952
|
-
}
|
|
953
|
-
function getSplTokenSwapConfigDecoder() {
|
|
954
|
-
return getStructDecoder([
|
|
955
|
-
['program', getAddressDecoder()],
|
|
956
|
-
['swap', getAddressDecoder()],
|
|
957
|
-
['mintA', getAddressDecoder()],
|
|
958
|
-
['mintB', getAddressDecoder()],
|
|
959
|
-
['lpMint', getAddressDecoder()],
|
|
960
|
-
['lpTokenAccount', getAddressDecoder()],
|
|
961
|
-
['padding', fixDecoderSize(getBytesDecoder(), 32)],
|
|
962
|
-
]);
|
|
963
|
-
}
|
|
964
|
-
function getSplTokenSwapConfigCodec() {
|
|
965
|
-
return combineCodec(getSplTokenSwapConfigEncoder(), getSplTokenSwapConfigDecoder());
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
function getSplTokenSwapStateEncoder() {
|
|
969
|
-
return getStructEncoder([
|
|
970
|
-
['lastBalanceA', getU64Encoder()],
|
|
971
|
-
['lastBalanceB', getU64Encoder()],
|
|
972
|
-
['lastBalanceLp', getU64Encoder()],
|
|
973
|
-
['padding', fixEncoderSize(getBytesEncoder(), 24)],
|
|
974
|
-
]);
|
|
975
|
-
}
|
|
976
|
-
function getSplTokenSwapStateDecoder() {
|
|
977
|
-
return getStructDecoder([
|
|
978
|
-
['lastBalanceA', getU64Decoder()],
|
|
979
|
-
['lastBalanceB', getU64Decoder()],
|
|
980
|
-
['lastBalanceLp', getU64Decoder()],
|
|
981
|
-
['padding', fixDecoderSize(getBytesDecoder(), 24)],
|
|
982
|
-
]);
|
|
983
|
-
}
|
|
984
|
-
function getSplTokenSwapStateCodec() {
|
|
985
|
-
return combineCodec(getSplTokenSwapStateEncoder(), getSplTokenSwapStateDecoder());
|
|
986
|
-
}
|
|
987
|
-
|
|
988
1248
|
function getSvmAlmControllerEventEncoder() {
|
|
989
1249
|
return getDiscriminatedUnionEncoder([
|
|
990
1250
|
[
|
|
@@ -1010,412 +1270,122 @@ function getSvmAlmControllerEventEncoder() {
|
|
|
1010
1270
|
getStructEncoder([
|
|
1011
1271
|
['fields', getTupleEncoder([getIntegrationUpdateEventEncoder()])],
|
|
1012
1272
|
]),
|
|
1013
|
-
],
|
|
1014
|
-
[
|
|
1015
|
-
'AccountingEvent',
|
|
1016
|
-
getStructEncoder([
|
|
1017
|
-
['fields', getTupleEncoder([getAccountingEventEncoder()])],
|
|
1018
|
-
]),
|
|
1019
|
-
],
|
|
1020
|
-
[
|
|
1021
|
-
'OracleUpdate',
|
|
1022
|
-
getStructEncoder([
|
|
1023
|
-
['fields', getTupleEncoder([getOracleUpdateEventEncoder()])],
|
|
1024
|
-
]),
|
|
1025
|
-
],
|
|
1026
|
-
]);
|
|
1027
|
-
}
|
|
1028
|
-
function getSvmAlmControllerEventDecoder() {
|
|
1029
|
-
return getDiscriminatedUnionDecoder([
|
|
1030
|
-
[
|
|
1031
|
-
'ControllerUpdate',
|
|
1032
|
-
getStructDecoder([
|
|
1033
|
-
['fields', getTupleDecoder([getControllerUpdateEventDecoder()])],
|
|
1034
|
-
]),
|
|
1035
|
-
],
|
|
1036
|
-
[
|
|
1037
|
-
'PermissionUpdate',
|
|
1038
|
-
getStructDecoder([
|
|
1039
|
-
['fields', getTupleDecoder([getPermissionUpdateEventDecoder()])],
|
|
1040
|
-
]),
|
|
1041
|
-
],
|
|
1042
|
-
[
|
|
1043
|
-
'ReserveUpdate',
|
|
1044
|
-
getStructDecoder([
|
|
1045
|
-
['fields', getTupleDecoder([getReserveUpdateEventDecoder()])],
|
|
1046
|
-
]),
|
|
1047
|
-
],
|
|
1048
|
-
[
|
|
1049
|
-
'IntegrationUpdate',
|
|
1050
|
-
getStructDecoder([
|
|
1051
|
-
['fields', getTupleDecoder([getIntegrationUpdateEventDecoder()])],
|
|
1052
|
-
]),
|
|
1053
|
-
],
|
|
1054
|
-
[
|
|
1055
|
-
'AccountingEvent',
|
|
1056
|
-
getStructDecoder([
|
|
1057
|
-
['fields', getTupleDecoder([getAccountingEventDecoder()])],
|
|
1058
|
-
]),
|
|
1059
|
-
],
|
|
1060
|
-
[
|
|
1061
|
-
'OracleUpdate',
|
|
1062
|
-
getStructDecoder([
|
|
1063
|
-
['fields', getTupleDecoder([getOracleUpdateEventDecoder()])],
|
|
1064
|
-
]),
|
|
1065
|
-
],
|
|
1066
|
-
]);
|
|
1067
|
-
}
|
|
1068
|
-
function getSvmAlmControllerEventCodec() {
|
|
1069
|
-
return combineCodec(getSvmAlmControllerEventEncoder(), getSvmAlmControllerEventDecoder());
|
|
1070
|
-
}
|
|
1071
|
-
function svmAlmControllerEvent(kind, data) {
|
|
1072
|
-
return Array.isArray(data)
|
|
1073
|
-
? { __kind: kind, fields: data }
|
|
1074
|
-
: { __kind: kind, ...(data ?? {}) };
|
|
1075
|
-
}
|
|
1076
|
-
function isSvmAlmControllerEvent(kind, value) {
|
|
1077
|
-
return value.__kind === kind;
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
function getSwapV1SubsetEncoder() {
|
|
1081
|
-
return getStructEncoder([
|
|
1082
|
-
['isInitialized', getBooleanEncoder()],
|
|
1083
|
-
['bumpSeed', getU8Encoder()],
|
|
1084
|
-
['tokenProgramId', getAddressEncoder()],
|
|
1085
|
-
['tokenA', getAddressEncoder()],
|
|
1086
|
-
['tokenB', getAddressEncoder()],
|
|
1087
|
-
['poolMint', getAddressEncoder()],
|
|
1088
|
-
['tokenAMint', getAddressEncoder()],
|
|
1089
|
-
['tokenBMint', getAddressEncoder()],
|
|
1090
|
-
['poolFeeAccount', getAddressEncoder()],
|
|
1091
|
-
]);
|
|
1092
|
-
}
|
|
1093
|
-
function getSwapV1SubsetDecoder() {
|
|
1094
|
-
return getStructDecoder([
|
|
1095
|
-
['isInitialized', getBooleanDecoder()],
|
|
1096
|
-
['bumpSeed', getU8Decoder()],
|
|
1097
|
-
['tokenProgramId', getAddressDecoder()],
|
|
1098
|
-
['tokenA', getAddressDecoder()],
|
|
1099
|
-
['tokenB', getAddressDecoder()],
|
|
1100
|
-
['poolMint', getAddressDecoder()],
|
|
1101
|
-
['tokenAMint', getAddressDecoder()],
|
|
1102
|
-
['tokenBMint', getAddressDecoder()],
|
|
1103
|
-
['poolFeeAccount', getAddressDecoder()],
|
|
1104
|
-
]);
|
|
1105
|
-
}
|
|
1106
|
-
function getSwapV1SubsetCodec() {
|
|
1107
|
-
return combineCodec(getSwapV1SubsetEncoder(), getSwapV1SubsetDecoder());
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
function getWithdrawSingleTokenTypeExactAmountOutArgsEncoder() {
|
|
1111
|
-
return getStructEncoder([
|
|
1112
|
-
['destinationTokenAmount', getU64Encoder()],
|
|
1113
|
-
['maximumPoolTokenAmount', getU64Encoder()],
|
|
1114
|
-
]);
|
|
1115
|
-
}
|
|
1116
|
-
function getWithdrawSingleTokenTypeExactAmountOutArgsDecoder() {
|
|
1117
|
-
return getStructDecoder([
|
|
1118
|
-
['destinationTokenAmount', getU64Decoder()],
|
|
1119
|
-
['maximumPoolTokenAmount', getU64Decoder()],
|
|
1120
|
-
]);
|
|
1121
|
-
}
|
|
1122
|
-
function getWithdrawSingleTokenTypeExactAmountOutArgsCodec() {
|
|
1123
|
-
return combineCodec(getWithdrawSingleTokenTypeExactAmountOutArgsEncoder(), getWithdrawSingleTokenTypeExactAmountOutArgsDecoder());
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
function getControllerEncoder() {
|
|
1127
|
-
return getStructEncoder([
|
|
1128
|
-
['id', getU16Encoder()],
|
|
1129
|
-
['bump', getU8Encoder()],
|
|
1130
|
-
['status', getControllerStatusEncoder()],
|
|
1131
|
-
['authority', getAddressEncoder()],
|
|
1132
|
-
['authorityBump', getU8Encoder()],
|
|
1133
|
-
['padding', fixEncoderSize(getBytesEncoder(), 128)],
|
|
1134
|
-
]);
|
|
1135
|
-
}
|
|
1136
|
-
function getControllerDecoder() {
|
|
1137
|
-
return getStructDecoder([
|
|
1138
|
-
['id', getU16Decoder()],
|
|
1139
|
-
['bump', getU8Decoder()],
|
|
1140
|
-
['status', getControllerStatusDecoder()],
|
|
1141
|
-
['authority', getAddressDecoder()],
|
|
1142
|
-
['authorityBump', getU8Decoder()],
|
|
1143
|
-
['padding', fixDecoderSize(getBytesDecoder(), 128)],
|
|
1144
|
-
]);
|
|
1145
|
-
}
|
|
1146
|
-
function getControllerCodec() {
|
|
1147
|
-
return combineCodec(getControllerEncoder(), getControllerDecoder());
|
|
1148
|
-
}
|
|
1149
|
-
function decodeController(encodedAccount) {
|
|
1150
|
-
return decodeAccount(encodedAccount, getControllerDecoder());
|
|
1151
|
-
}
|
|
1152
|
-
async function fetchController(rpc, address, config) {
|
|
1153
|
-
const maybeAccount = await fetchMaybeController(rpc, address, config);
|
|
1154
|
-
assertAccountExists(maybeAccount);
|
|
1155
|
-
return maybeAccount;
|
|
1156
|
-
}
|
|
1157
|
-
async function fetchMaybeController(rpc, address, config) {
|
|
1158
|
-
const maybeAccount = await fetchEncodedAccount(rpc, address, config);
|
|
1159
|
-
return decodeController(maybeAccount);
|
|
1160
|
-
}
|
|
1161
|
-
async function fetchAllController(rpc, addresses, config) {
|
|
1162
|
-
const maybeAccounts = await fetchAllMaybeController(rpc, addresses, config);
|
|
1163
|
-
assertAccountsExist(maybeAccounts);
|
|
1164
|
-
return maybeAccounts;
|
|
1165
|
-
}
|
|
1166
|
-
async function fetchAllMaybeController(rpc, addresses, config) {
|
|
1167
|
-
const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
|
|
1168
|
-
return maybeAccounts.map((maybeAccount) => decodeController(maybeAccount));
|
|
1169
|
-
}
|
|
1170
|
-
function getControllerSize() {
|
|
1171
|
-
return 165;
|
|
1172
|
-
}
|
|
1173
|
-
|
|
1174
|
-
function getIntegrationEncoder() {
|
|
1175
|
-
return getStructEncoder([
|
|
1176
|
-
['controller', getAddressEncoder()],
|
|
1177
|
-
['description', fixEncoderSize(getBytesEncoder(), 32)],
|
|
1178
|
-
['hash', fixEncoderSize(getBytesEncoder(), 32)],
|
|
1179
|
-
['status', getIntegrationStatusEncoder()],
|
|
1180
|
-
['rateLimitSlope', getU64Encoder()],
|
|
1181
|
-
['rateLimitMaxOutflow', getU64Encoder()],
|
|
1182
|
-
['rateLimitOutflowAmountAvailable', getU64Encoder()],
|
|
1183
|
-
['rateLimitRemainder', getU64Encoder()],
|
|
1184
|
-
['lastRefreshTimestamp', getI64Encoder()],
|
|
1185
|
-
['lastRefreshSlot', getU64Encoder()],
|
|
1186
|
-
['config', getIntegrationConfigEncoder()],
|
|
1187
|
-
['state', getIntegrationStateEncoder()],
|
|
1188
|
-
['permitLiquidation', getBooleanEncoder()],
|
|
1189
|
-
['padding', fixEncoderSize(getBytesEncoder(), 87)],
|
|
1190
|
-
]);
|
|
1191
|
-
}
|
|
1192
|
-
function getIntegrationDecoder() {
|
|
1193
|
-
return getStructDecoder([
|
|
1194
|
-
['controller', getAddressDecoder()],
|
|
1195
|
-
['description', fixDecoderSize(getBytesDecoder(), 32)],
|
|
1196
|
-
['hash', fixDecoderSize(getBytesDecoder(), 32)],
|
|
1197
|
-
['status', getIntegrationStatusDecoder()],
|
|
1198
|
-
['rateLimitSlope', getU64Decoder()],
|
|
1199
|
-
['rateLimitMaxOutflow', getU64Decoder()],
|
|
1200
|
-
['rateLimitOutflowAmountAvailable', getU64Decoder()],
|
|
1201
|
-
['rateLimitRemainder', getU64Decoder()],
|
|
1202
|
-
['lastRefreshTimestamp', getI64Decoder()],
|
|
1203
|
-
['lastRefreshSlot', getU64Decoder()],
|
|
1204
|
-
['config', getIntegrationConfigDecoder()],
|
|
1205
|
-
['state', getIntegrationStateDecoder()],
|
|
1206
|
-
['permitLiquidation', getBooleanDecoder()],
|
|
1207
|
-
['padding', fixDecoderSize(getBytesDecoder(), 87)],
|
|
1208
|
-
]);
|
|
1209
|
-
}
|
|
1210
|
-
function getIntegrationCodec() {
|
|
1211
|
-
return combineCodec(getIntegrationEncoder(), getIntegrationDecoder());
|
|
1212
|
-
}
|
|
1213
|
-
function decodeIntegration(encodedAccount) {
|
|
1214
|
-
return decodeAccount(encodedAccount, getIntegrationDecoder());
|
|
1215
|
-
}
|
|
1216
|
-
async function fetchIntegration(rpc, address, config) {
|
|
1217
|
-
const maybeAccount = await fetchMaybeIntegration(rpc, address, config);
|
|
1218
|
-
assertAccountExists(maybeAccount);
|
|
1219
|
-
return maybeAccount;
|
|
1220
|
-
}
|
|
1221
|
-
async function fetchMaybeIntegration(rpc, address, config) {
|
|
1222
|
-
const maybeAccount = await fetchEncodedAccount(rpc, address, config);
|
|
1223
|
-
return decodeIntegration(maybeAccount);
|
|
1224
|
-
}
|
|
1225
|
-
async function fetchAllIntegration(rpc, addresses, config) {
|
|
1226
|
-
const maybeAccounts = await fetchAllMaybeIntegration(rpc, addresses, config);
|
|
1227
|
-
assertAccountsExist(maybeAccounts);
|
|
1228
|
-
return maybeAccounts;
|
|
1229
|
-
}
|
|
1230
|
-
async function fetchAllMaybeIntegration(rpc, addresses, config) {
|
|
1231
|
-
const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
|
|
1232
|
-
return maybeAccounts.map((maybeAccount) => decodeIntegration(maybeAccount));
|
|
1233
|
-
}
|
|
1234
|
-
function getIntegrationSize() {
|
|
1235
|
-
return 507;
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
function getOracleEncoder() {
|
|
1239
|
-
return getStructEncoder([
|
|
1240
|
-
['version', getU8Encoder()],
|
|
1241
|
-
['authority', getAddressEncoder()],
|
|
1242
|
-
['nonce', getAddressEncoder()],
|
|
1243
|
-
['value', getI128Encoder()],
|
|
1244
|
-
['precision', getU32Encoder()],
|
|
1245
|
-
['lastUpdateSlot', getU64Encoder()],
|
|
1246
|
-
['controller', getAddressEncoder()],
|
|
1247
|
-
['baseMint', getAddressEncoder()],
|
|
1248
|
-
['quoteMint', getAddressEncoder()],
|
|
1249
|
-
['reserved', fixEncoderSize(getBytesEncoder(), 64)],
|
|
1250
|
-
['feeds', getArrayEncoder(getFeedEncoder(), { size: 1 })],
|
|
1251
|
-
]);
|
|
1252
|
-
}
|
|
1253
|
-
function getOracleDecoder() {
|
|
1254
|
-
return getStructDecoder([
|
|
1255
|
-
['version', getU8Decoder()],
|
|
1256
|
-
['authority', getAddressDecoder()],
|
|
1257
|
-
['nonce', getAddressDecoder()],
|
|
1258
|
-
['value', getI128Decoder()],
|
|
1259
|
-
['precision', getU32Decoder()],
|
|
1260
|
-
['lastUpdateSlot', getU64Decoder()],
|
|
1261
|
-
['controller', getAddressDecoder()],
|
|
1262
|
-
['baseMint', getAddressDecoder()],
|
|
1263
|
-
['quoteMint', getAddressDecoder()],
|
|
1264
|
-
['reserved', fixDecoderSize(getBytesDecoder(), 64)],
|
|
1265
|
-
['feeds', getArrayDecoder(getFeedDecoder(), { size: 1 })],
|
|
1266
|
-
]);
|
|
1267
|
-
}
|
|
1268
|
-
function getOracleCodec() {
|
|
1269
|
-
return combineCodec(getOracleEncoder(), getOracleDecoder());
|
|
1270
|
-
}
|
|
1271
|
-
function decodeOracle(encodedAccount) {
|
|
1272
|
-
return decodeAccount(encodedAccount, getOracleDecoder());
|
|
1273
|
-
}
|
|
1274
|
-
async function fetchOracle(rpc, address, config) {
|
|
1275
|
-
const maybeAccount = await fetchMaybeOracle(rpc, address, config);
|
|
1276
|
-
assertAccountExists(maybeAccount);
|
|
1277
|
-
return maybeAccount;
|
|
1278
|
-
}
|
|
1279
|
-
async function fetchMaybeOracle(rpc, address, config) {
|
|
1280
|
-
const maybeAccount = await fetchEncodedAccount(rpc, address, config);
|
|
1281
|
-
return decodeOracle(maybeAccount);
|
|
1282
|
-
}
|
|
1283
|
-
async function fetchAllOracle(rpc, addresses, config) {
|
|
1284
|
-
const maybeAccounts = await fetchAllMaybeOracle(rpc, addresses, config);
|
|
1285
|
-
assertAccountsExist(maybeAccounts);
|
|
1286
|
-
return maybeAccounts;
|
|
1287
|
-
}
|
|
1288
|
-
async function fetchAllMaybeOracle(rpc, addresses, config) {
|
|
1289
|
-
const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
|
|
1290
|
-
return maybeAccounts.map((maybeAccount) => decodeOracle(maybeAccount));
|
|
1291
|
-
}
|
|
1292
|
-
function getOracleSize() {
|
|
1293
|
-
return 349;
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
|
-
function getPermissionEncoder() {
|
|
1297
|
-
return getStructEncoder([
|
|
1298
|
-
['controller', getAddressEncoder()],
|
|
1299
|
-
['authority', getAddressEncoder()],
|
|
1300
|
-
['status', getPermissionStatusEncoder()],
|
|
1301
|
-
['canManagePermissions', getBooleanEncoder()],
|
|
1302
|
-
['canInvokeExternalTransfer', getBooleanEncoder()],
|
|
1303
|
-
['canExecuteSwap', getBooleanEncoder()],
|
|
1304
|
-
['canReallocate', getBooleanEncoder()],
|
|
1305
|
-
['canFreezeController', getBooleanEncoder()],
|
|
1306
|
-
['canUnfreezeController', getBooleanEncoder()],
|
|
1307
|
-
['canManageReservesAndIntegrations', getBooleanEncoder()],
|
|
1308
|
-
['canSuspendPermissions', getBooleanEncoder()],
|
|
1309
|
-
['canLiquidate', getBooleanEncoder()],
|
|
1310
|
-
['padding', fixEncoderSize(getBytesEncoder(), 30)],
|
|
1273
|
+
],
|
|
1274
|
+
[
|
|
1275
|
+
'AccountingEvent',
|
|
1276
|
+
getStructEncoder([
|
|
1277
|
+
['fields', getTupleEncoder([getAccountingEventEncoder()])],
|
|
1278
|
+
]),
|
|
1279
|
+
],
|
|
1280
|
+
[
|
|
1281
|
+
'OracleUpdate',
|
|
1282
|
+
getStructEncoder([
|
|
1283
|
+
['fields', getTupleEncoder([getOracleUpdateEventEncoder()])],
|
|
1284
|
+
]),
|
|
1285
|
+
],
|
|
1311
1286
|
]);
|
|
1312
1287
|
}
|
|
1313
|
-
function
|
|
1314
|
-
return
|
|
1315
|
-
[
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
[
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
[
|
|
1288
|
+
function getSvmAlmControllerEventDecoder() {
|
|
1289
|
+
return getDiscriminatedUnionDecoder([
|
|
1290
|
+
[
|
|
1291
|
+
'ControllerUpdate',
|
|
1292
|
+
getStructDecoder([
|
|
1293
|
+
['fields', getTupleDecoder([getControllerUpdateEventDecoder()])],
|
|
1294
|
+
]),
|
|
1295
|
+
],
|
|
1296
|
+
[
|
|
1297
|
+
'PermissionUpdate',
|
|
1298
|
+
getStructDecoder([
|
|
1299
|
+
['fields', getTupleDecoder([getPermissionUpdateEventDecoder()])],
|
|
1300
|
+
]),
|
|
1301
|
+
],
|
|
1302
|
+
[
|
|
1303
|
+
'ReserveUpdate',
|
|
1304
|
+
getStructDecoder([
|
|
1305
|
+
['fields', getTupleDecoder([getReserveUpdateEventDecoder()])],
|
|
1306
|
+
]),
|
|
1307
|
+
],
|
|
1308
|
+
[
|
|
1309
|
+
'IntegrationUpdate',
|
|
1310
|
+
getStructDecoder([
|
|
1311
|
+
['fields', getTupleDecoder([getIntegrationUpdateEventDecoder()])],
|
|
1312
|
+
]),
|
|
1313
|
+
],
|
|
1314
|
+
[
|
|
1315
|
+
'AccountingEvent',
|
|
1316
|
+
getStructDecoder([
|
|
1317
|
+
['fields', getTupleDecoder([getAccountingEventDecoder()])],
|
|
1318
|
+
]),
|
|
1319
|
+
],
|
|
1320
|
+
[
|
|
1321
|
+
'OracleUpdate',
|
|
1322
|
+
getStructDecoder([
|
|
1323
|
+
['fields', getTupleDecoder([getOracleUpdateEventDecoder()])],
|
|
1324
|
+
]),
|
|
1325
|
+
],
|
|
1328
1326
|
]);
|
|
1329
1327
|
}
|
|
1330
|
-
function
|
|
1331
|
-
return combineCodec(
|
|
1332
|
-
}
|
|
1333
|
-
function decodePermission(encodedAccount) {
|
|
1334
|
-
return decodeAccount(encodedAccount, getPermissionDecoder());
|
|
1335
|
-
}
|
|
1336
|
-
async function fetchPermission(rpc, address, config) {
|
|
1337
|
-
const maybeAccount = await fetchMaybePermission(rpc, address, config);
|
|
1338
|
-
assertAccountExists(maybeAccount);
|
|
1339
|
-
return maybeAccount;
|
|
1340
|
-
}
|
|
1341
|
-
async function fetchMaybePermission(rpc, address, config) {
|
|
1342
|
-
const maybeAccount = await fetchEncodedAccount(rpc, address, config);
|
|
1343
|
-
return decodePermission(maybeAccount);
|
|
1344
|
-
}
|
|
1345
|
-
async function fetchAllPermission(rpc, addresses, config) {
|
|
1346
|
-
const maybeAccounts = await fetchAllMaybePermission(rpc, addresses, config);
|
|
1347
|
-
assertAccountsExist(maybeAccounts);
|
|
1348
|
-
return maybeAccounts;
|
|
1328
|
+
function getSvmAlmControllerEventCodec() {
|
|
1329
|
+
return combineCodec(getSvmAlmControllerEventEncoder(), getSvmAlmControllerEventDecoder());
|
|
1349
1330
|
}
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1331
|
+
function svmAlmControllerEvent(kind, data) {
|
|
1332
|
+
return Array.isArray(data)
|
|
1333
|
+
? { __kind: kind, fields: data }
|
|
1334
|
+
: { __kind: kind, ...(data ?? {}) };
|
|
1353
1335
|
}
|
|
1354
|
-
function
|
|
1355
|
-
return
|
|
1336
|
+
function isSvmAlmControllerEvent(kind, value) {
|
|
1337
|
+
return value.__kind === kind;
|
|
1356
1338
|
}
|
|
1357
1339
|
|
|
1358
|
-
function
|
|
1340
|
+
function getControllerEncoder() {
|
|
1359
1341
|
return getStructEncoder([
|
|
1360
|
-
['
|
|
1361
|
-
['
|
|
1362
|
-
['
|
|
1363
|
-
['
|
|
1364
|
-
['
|
|
1365
|
-
['
|
|
1366
|
-
['rateLimitOutflowAmountAvailable', getU64Encoder()],
|
|
1367
|
-
['rateLimitRemainder', getU64Encoder()],
|
|
1368
|
-
['lastBalance', getU64Encoder()],
|
|
1369
|
-
['lastRefreshTimestamp', getI64Encoder()],
|
|
1370
|
-
['lastRefreshSlot', getU64Encoder()],
|
|
1371
|
-
['padding', fixEncoderSize(getBytesEncoder(), 120)],
|
|
1342
|
+
['id', getU16Encoder()],
|
|
1343
|
+
['bump', getU8Encoder()],
|
|
1344
|
+
['status', getControllerStatusEncoder()],
|
|
1345
|
+
['authority', getAddressEncoder()],
|
|
1346
|
+
['authorityBump', getU8Encoder()],
|
|
1347
|
+
['padding', fixEncoderSize(getBytesEncoder(), 128)],
|
|
1372
1348
|
]);
|
|
1373
1349
|
}
|
|
1374
|
-
function
|
|
1350
|
+
function getControllerDecoder() {
|
|
1375
1351
|
return getStructDecoder([
|
|
1376
|
-
['
|
|
1377
|
-
['
|
|
1378
|
-
['
|
|
1379
|
-
['
|
|
1380
|
-
['
|
|
1381
|
-
['
|
|
1382
|
-
['rateLimitOutflowAmountAvailable', getU64Decoder()],
|
|
1383
|
-
['rateLimitRemainder', getU64Decoder()],
|
|
1384
|
-
['lastBalance', getU64Decoder()],
|
|
1385
|
-
['lastRefreshTimestamp', getI64Decoder()],
|
|
1386
|
-
['lastRefreshSlot', getU64Decoder()],
|
|
1387
|
-
['padding', fixDecoderSize(getBytesDecoder(), 120)],
|
|
1352
|
+
['id', getU16Decoder()],
|
|
1353
|
+
['bump', getU8Decoder()],
|
|
1354
|
+
['status', getControllerStatusDecoder()],
|
|
1355
|
+
['authority', getAddressDecoder()],
|
|
1356
|
+
['authorityBump', getU8Decoder()],
|
|
1357
|
+
['padding', fixDecoderSize(getBytesDecoder(), 128)],
|
|
1388
1358
|
]);
|
|
1389
1359
|
}
|
|
1390
|
-
function
|
|
1391
|
-
return combineCodec(
|
|
1360
|
+
function getControllerCodec() {
|
|
1361
|
+
return combineCodec(getControllerEncoder(), getControllerDecoder());
|
|
1392
1362
|
}
|
|
1393
|
-
function
|
|
1394
|
-
return decodeAccount(encodedAccount,
|
|
1363
|
+
function decodeController(encodedAccount) {
|
|
1364
|
+
return decodeAccount(encodedAccount, getControllerDecoder());
|
|
1395
1365
|
}
|
|
1396
|
-
async function
|
|
1397
|
-
const maybeAccount = await
|
|
1366
|
+
async function fetchController(rpc, address, config) {
|
|
1367
|
+
const maybeAccount = await fetchMaybeController(rpc, address, config);
|
|
1398
1368
|
assertAccountExists(maybeAccount);
|
|
1399
1369
|
return maybeAccount;
|
|
1400
1370
|
}
|
|
1401
|
-
async function
|
|
1371
|
+
async function fetchMaybeController(rpc, address, config) {
|
|
1402
1372
|
const maybeAccount = await fetchEncodedAccount(rpc, address, config);
|
|
1403
|
-
return
|
|
1373
|
+
return decodeController(maybeAccount);
|
|
1404
1374
|
}
|
|
1405
|
-
async function
|
|
1406
|
-
const maybeAccounts = await
|
|
1375
|
+
async function fetchAllController(rpc, addresses, config) {
|
|
1376
|
+
const maybeAccounts = await fetchAllMaybeController(rpc, addresses, config);
|
|
1407
1377
|
assertAccountsExist(maybeAccounts);
|
|
1408
1378
|
return maybeAccounts;
|
|
1409
1379
|
}
|
|
1410
|
-
async function
|
|
1380
|
+
async function fetchAllMaybeController(rpc, addresses, config) {
|
|
1411
1381
|
const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
|
|
1412
|
-
return maybeAccounts.map((maybeAccount) =>
|
|
1382
|
+
return maybeAccounts.map((maybeAccount) => decodeController(maybeAccount));
|
|
1413
1383
|
}
|
|
1414
|
-
function
|
|
1415
|
-
return
|
|
1384
|
+
function getControllerSize() {
|
|
1385
|
+
return 165;
|
|
1416
1386
|
}
|
|
1417
1387
|
|
|
1418
|
-
const SVM_ALM_CONTROLLER_PROGRAM_ADDRESS = '
|
|
1388
|
+
const SVM_ALM_CONTROLLER_PROGRAM_ADDRESS = 'ALM1JSnEhc5PkNecbSZotgprBuJujL5objTbwGtpTgTd';
|
|
1419
1389
|
var SvmAlmControllerAccount;
|
|
1420
1390
|
(function (SvmAlmControllerAccount) {
|
|
1421
1391
|
SvmAlmControllerAccount[SvmAlmControllerAccount["Controller"] = 0] = "Controller";
|
|
@@ -1444,6 +1414,7 @@ var SvmAlmControllerInstruction;
|
|
|
1444
1414
|
SvmAlmControllerInstruction[SvmAlmControllerInstruction["AtomicSwapBorrow"] = 15] = "AtomicSwapBorrow";
|
|
1445
1415
|
SvmAlmControllerInstruction[SvmAlmControllerInstruction["AtomicSwapRepay"] = 16] = "AtomicSwapRepay";
|
|
1446
1416
|
SvmAlmControllerInstruction[SvmAlmControllerInstruction["ResetLzPushInFlight"] = 17] = "ResetLzPushInFlight";
|
|
1417
|
+
SvmAlmControllerInstruction[SvmAlmControllerInstruction["ClaimRent"] = 18] = "ClaimRent";
|
|
1447
1418
|
})(SvmAlmControllerInstruction || (SvmAlmControllerInstruction = {}));
|
|
1448
1419
|
function identifySvmAlmControllerInstruction(instruction) {
|
|
1449
1420
|
const data = 'data' in instruction ? instruction.data : instruction;
|
|
@@ -1501,6 +1472,9 @@ function identifySvmAlmControllerInstruction(instruction) {
|
|
|
1501
1472
|
if (containsBytes(data, getU8Encoder().encode(17), 0)) {
|
|
1502
1473
|
return SvmAlmControllerInstruction.ResetLzPushInFlight;
|
|
1503
1474
|
}
|
|
1475
|
+
if (containsBytes(data, getU8Encoder().encode(18), 0)) {
|
|
1476
|
+
return SvmAlmControllerInstruction.ClaimRent;
|
|
1477
|
+
}
|
|
1504
1478
|
throw new Error('The provided instruction could not be identified as a svmAlmController instruction.');
|
|
1505
1479
|
}
|
|
1506
1480
|
|
|
@@ -1565,7 +1539,7 @@ function getAtomicSwapBorrowInstructionDataCodec() {
|
|
|
1565
1539
|
function getAtomicSwapBorrowInstruction(input, config) {
|
|
1566
1540
|
const programAddress = config?.programAddress ?? SVM_ALM_CONTROLLER_PROGRAM_ADDRESS;
|
|
1567
1541
|
const originalAccounts = {
|
|
1568
|
-
controller: { value: input.controller ?? null, isWritable:
|
|
1542
|
+
controller: { value: input.controller ?? null, isWritable: true },
|
|
1569
1543
|
controllerAuthority: {
|
|
1570
1544
|
value: input.controllerAuthority ?? null,
|
|
1571
1545
|
isWritable: false,
|
|
@@ -1676,7 +1650,7 @@ function getAtomicSwapRepayInstruction(input, config) {
|
|
|
1676
1650
|
const programAddress = config?.programAddress ?? SVM_ALM_CONTROLLER_PROGRAM_ADDRESS;
|
|
1677
1651
|
const originalAccounts = {
|
|
1678
1652
|
payer: { value: input.payer ?? null, isWritable: false },
|
|
1679
|
-
controller: { value: input.controller ?? null, isWritable:
|
|
1653
|
+
controller: { value: input.controller ?? null, isWritable: true },
|
|
1680
1654
|
controllerAuthority: {
|
|
1681
1655
|
value: input.controllerAuthority ?? null,
|
|
1682
1656
|
isWritable: false,
|
|
@@ -1757,6 +1731,75 @@ function parseAtomicSwapRepayInstruction(instruction) {
|
|
|
1757
1731
|
};
|
|
1758
1732
|
}
|
|
1759
1733
|
|
|
1734
|
+
const CLAIM_RENT_DISCRIMINATOR = 18;
|
|
1735
|
+
function getClaimRentDiscriminatorBytes() {
|
|
1736
|
+
return getU8Encoder().encode(CLAIM_RENT_DISCRIMINATOR);
|
|
1737
|
+
}
|
|
1738
|
+
function getClaimRentInstructionDataEncoder() {
|
|
1739
|
+
return transformEncoder(getStructEncoder([['discriminator', getU8Encoder()]]), (value) => ({ ...value, discriminator: CLAIM_RENT_DISCRIMINATOR }));
|
|
1740
|
+
}
|
|
1741
|
+
function getClaimRentInstructionDataDecoder() {
|
|
1742
|
+
return getStructDecoder([['discriminator', getU8Decoder()]]);
|
|
1743
|
+
}
|
|
1744
|
+
function getClaimRentInstructionDataCodec() {
|
|
1745
|
+
return combineCodec(getClaimRentInstructionDataEncoder(), getClaimRentInstructionDataDecoder());
|
|
1746
|
+
}
|
|
1747
|
+
function getClaimRentInstruction(input, config) {
|
|
1748
|
+
const programAddress = config?.programAddress ?? SVM_ALM_CONTROLLER_PROGRAM_ADDRESS;
|
|
1749
|
+
const originalAccounts = {
|
|
1750
|
+
controller: { value: input.controller ?? null, isWritable: false },
|
|
1751
|
+
controllerAuthority: {
|
|
1752
|
+
value: input.controllerAuthority ?? null,
|
|
1753
|
+
isWritable: true,
|
|
1754
|
+
},
|
|
1755
|
+
authority: { value: input.authority ?? null, isWritable: false },
|
|
1756
|
+
permission: { value: input.permission ?? null, isWritable: false },
|
|
1757
|
+
destination: { value: input.destination ?? null, isWritable: true },
|
|
1758
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
1759
|
+
};
|
|
1760
|
+
const accounts = originalAccounts;
|
|
1761
|
+
if (!accounts.systemProgram.value) {
|
|
1762
|
+
accounts.systemProgram.value =
|
|
1763
|
+
'11111111111111111111111111111111';
|
|
1764
|
+
}
|
|
1765
|
+
const getAccountMeta = getAccountMetaFactory(programAddress);
|
|
1766
|
+
return Object.freeze({
|
|
1767
|
+
accounts: [
|
|
1768
|
+
getAccountMeta(accounts.controller),
|
|
1769
|
+
getAccountMeta(accounts.controllerAuthority),
|
|
1770
|
+
getAccountMeta(accounts.authority),
|
|
1771
|
+
getAccountMeta(accounts.permission),
|
|
1772
|
+
getAccountMeta(accounts.destination),
|
|
1773
|
+
getAccountMeta(accounts.systemProgram),
|
|
1774
|
+
],
|
|
1775
|
+
data: getClaimRentInstructionDataEncoder().encode({}),
|
|
1776
|
+
programAddress,
|
|
1777
|
+
});
|
|
1778
|
+
}
|
|
1779
|
+
function parseClaimRentInstruction(instruction) {
|
|
1780
|
+
if (instruction.accounts.length < 6) {
|
|
1781
|
+
throw new Error('Not enough accounts');
|
|
1782
|
+
}
|
|
1783
|
+
let accountIndex = 0;
|
|
1784
|
+
const getNextAccount = () => {
|
|
1785
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
1786
|
+
accountIndex += 1;
|
|
1787
|
+
return accountMeta;
|
|
1788
|
+
};
|
|
1789
|
+
return {
|
|
1790
|
+
programAddress: instruction.programAddress,
|
|
1791
|
+
accounts: {
|
|
1792
|
+
controller: getNextAccount(),
|
|
1793
|
+
controllerAuthority: getNextAccount(),
|
|
1794
|
+
authority: getNextAccount(),
|
|
1795
|
+
permission: getNextAccount(),
|
|
1796
|
+
destination: getNextAccount(),
|
|
1797
|
+
systemProgram: getNextAccount(),
|
|
1798
|
+
},
|
|
1799
|
+
data: getClaimRentInstructionDataDecoder().decode(instruction.data),
|
|
1800
|
+
};
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1760
1803
|
const EMIT_EVENT_DISCRIMINATOR = 0;
|
|
1761
1804
|
function getEmitEventDiscriminatorBytes() {
|
|
1762
1805
|
return getU8Encoder().encode(EMIT_EVENT_DISCRIMINATOR);
|
|
@@ -2562,13 +2605,12 @@ function getPullInstruction(input, config) {
|
|
|
2562
2605
|
controller: { value: input.controller ?? null, isWritable: false },
|
|
2563
2606
|
controllerAuthority: {
|
|
2564
2607
|
value: input.controllerAuthority ?? null,
|
|
2565
|
-
isWritable:
|
|
2608
|
+
isWritable: true,
|
|
2566
2609
|
},
|
|
2567
2610
|
authority: { value: input.authority ?? null, isWritable: false },
|
|
2568
2611
|
permission: { value: input.permission ?? null, isWritable: false },
|
|
2569
2612
|
integration: { value: input.integration ?? null, isWritable: true },
|
|
2570
2613
|
reserveA: { value: input.reserveA ?? null, isWritable: true },
|
|
2571
|
-
reserveB: { value: input.reserveB ?? null, isWritable: true },
|
|
2572
2614
|
programId: { value: input.programId ?? null, isWritable: false },
|
|
2573
2615
|
};
|
|
2574
2616
|
const accounts = originalAccounts;
|
|
@@ -2586,7 +2628,6 @@ function getPullInstruction(input, config) {
|
|
|
2586
2628
|
getAccountMeta(accounts.permission),
|
|
2587
2629
|
getAccountMeta(accounts.integration),
|
|
2588
2630
|
getAccountMeta(accounts.reserveA),
|
|
2589
|
-
getAccountMeta(accounts.reserveB),
|
|
2590
2631
|
getAccountMeta(accounts.programId),
|
|
2591
2632
|
],
|
|
2592
2633
|
data: getPullInstructionDataEncoder().encode(args),
|
|
@@ -2594,7 +2635,7 @@ function getPullInstruction(input, config) {
|
|
|
2594
2635
|
});
|
|
2595
2636
|
}
|
|
2596
2637
|
function parsePullInstruction(instruction) {
|
|
2597
|
-
if (instruction.accounts.length <
|
|
2638
|
+
if (instruction.accounts.length < 7) {
|
|
2598
2639
|
throw new Error('Not enough accounts');
|
|
2599
2640
|
}
|
|
2600
2641
|
let accountIndex = 0;
|
|
@@ -2612,7 +2653,6 @@ function parsePullInstruction(instruction) {
|
|
|
2612
2653
|
permission: getNextAccount(),
|
|
2613
2654
|
integration: getNextAccount(),
|
|
2614
2655
|
reserveA: getNextAccount(),
|
|
2615
|
-
reserveB: getNextAccount(),
|
|
2616
2656
|
programId: getNextAccount(),
|
|
2617
2657
|
},
|
|
2618
2658
|
data: getPullInstructionDataDecoder().decode(instruction.data),
|
|
@@ -2644,13 +2684,12 @@ function getPushInstruction(input, config) {
|
|
|
2644
2684
|
controller: { value: input.controller ?? null, isWritable: false },
|
|
2645
2685
|
controllerAuthority: {
|
|
2646
2686
|
value: input.controllerAuthority ?? null,
|
|
2647
|
-
isWritable:
|
|
2687
|
+
isWritable: true,
|
|
2648
2688
|
},
|
|
2649
2689
|
authority: { value: input.authority ?? null, isWritable: false },
|
|
2650
2690
|
permission: { value: input.permission ?? null, isWritable: false },
|
|
2651
2691
|
integration: { value: input.integration ?? null, isWritable: true },
|
|
2652
2692
|
reserveA: { value: input.reserveA ?? null, isWritable: true },
|
|
2653
|
-
reserveB: { value: input.reserveB ?? null, isWritable: true },
|
|
2654
2693
|
programId: { value: input.programId ?? null, isWritable: false },
|
|
2655
2694
|
};
|
|
2656
2695
|
const accounts = originalAccounts;
|
|
@@ -2668,7 +2707,6 @@ function getPushInstruction(input, config) {
|
|
|
2668
2707
|
getAccountMeta(accounts.permission),
|
|
2669
2708
|
getAccountMeta(accounts.integration),
|
|
2670
2709
|
getAccountMeta(accounts.reserveA),
|
|
2671
|
-
getAccountMeta(accounts.reserveB),
|
|
2672
2710
|
getAccountMeta(accounts.programId),
|
|
2673
2711
|
],
|
|
2674
2712
|
data: getPushInstructionDataEncoder().encode(args),
|
|
@@ -2676,7 +2714,7 @@ function getPushInstruction(input, config) {
|
|
|
2676
2714
|
});
|
|
2677
2715
|
}
|
|
2678
2716
|
function parsePushInstruction(instruction) {
|
|
2679
|
-
if (instruction.accounts.length <
|
|
2717
|
+
if (instruction.accounts.length < 7) {
|
|
2680
2718
|
throw new Error('Not enough accounts');
|
|
2681
2719
|
}
|
|
2682
2720
|
let accountIndex = 0;
|
|
@@ -2694,7 +2732,6 @@ function parsePushInstruction(instruction) {
|
|
|
2694
2732
|
permission: getNextAccount(),
|
|
2695
2733
|
integration: getNextAccount(),
|
|
2696
2734
|
reserveA: getNextAccount(),
|
|
2697
|
-
reserveB: getNextAccount(),
|
|
2698
2735
|
programId: getNextAccount(),
|
|
2699
2736
|
},
|
|
2700
2737
|
data: getPushInstructionDataDecoder().decode(instruction.data),
|
|
@@ -2830,9 +2867,11 @@ function getSyncInstruction(input, config) {
|
|
|
2830
2867
|
controller: { value: input.controller ?? null, isWritable: false },
|
|
2831
2868
|
controllerAuthority: {
|
|
2832
2869
|
value: input.controllerAuthority ?? null,
|
|
2833
|
-
isWritable:
|
|
2870
|
+
isWritable: true,
|
|
2834
2871
|
},
|
|
2872
|
+
payer: { value: input.payer ?? null, isWritable: true },
|
|
2835
2873
|
integration: { value: input.integration ?? null, isWritable: true },
|
|
2874
|
+
reserve: { value: input.reserve ?? null, isWritable: true },
|
|
2836
2875
|
};
|
|
2837
2876
|
const accounts = originalAccounts;
|
|
2838
2877
|
const getAccountMeta = getAccountMetaFactory(programAddress);
|
|
@@ -2840,14 +2879,16 @@ function getSyncInstruction(input, config) {
|
|
|
2840
2879
|
accounts: [
|
|
2841
2880
|
getAccountMeta(accounts.controller),
|
|
2842
2881
|
getAccountMeta(accounts.controllerAuthority),
|
|
2882
|
+
getAccountMeta(accounts.payer),
|
|
2843
2883
|
getAccountMeta(accounts.integration),
|
|
2884
|
+
getAccountMeta(accounts.reserve),
|
|
2844
2885
|
],
|
|
2845
2886
|
data: getSyncInstructionDataEncoder().encode({}),
|
|
2846
2887
|
programAddress,
|
|
2847
2888
|
});
|
|
2848
2889
|
}
|
|
2849
2890
|
function parseSyncInstruction(instruction) {
|
|
2850
|
-
if (instruction.accounts.length <
|
|
2891
|
+
if (instruction.accounts.length < 5) {
|
|
2851
2892
|
throw new Error('Not enough accounts');
|
|
2852
2893
|
}
|
|
2853
2894
|
let accountIndex = 0;
|
|
@@ -2861,7 +2902,9 @@ function parseSyncInstruction(instruction) {
|
|
|
2861
2902
|
accounts: {
|
|
2862
2903
|
controller: getNextAccount(),
|
|
2863
2904
|
controllerAuthority: getNextAccount(),
|
|
2905
|
+
payer: getNextAccount(),
|
|
2864
2906
|
integration: getNextAccount(),
|
|
2907
|
+
reserve: getNextAccount(),
|
|
2865
2908
|
},
|
|
2866
2909
|
data: getSyncInstructionDataDecoder().decode(instruction.data),
|
|
2867
2910
|
};
|
|
@@ -2933,13 +2976,13 @@ function getUpdateOracleDiscriminatorBytes() {
|
|
|
2933
2976
|
function getUpdateOracleInstructionDataEncoder() {
|
|
2934
2977
|
return transformEncoder(getStructEncoder([
|
|
2935
2978
|
['discriminator', getU8Encoder()],
|
|
2936
|
-
['feedArgs', getOptionEncoder(
|
|
2979
|
+
['feedArgs', getOptionEncoder(getFeedEncoder())],
|
|
2937
2980
|
]), (value) => ({ ...value, discriminator: UPDATE_ORACLE_DISCRIMINATOR }));
|
|
2938
2981
|
}
|
|
2939
2982
|
function getUpdateOracleInstructionDataDecoder() {
|
|
2940
2983
|
return getStructDecoder([
|
|
2941
2984
|
['discriminator', getU8Decoder()],
|
|
2942
|
-
['feedArgs', getOptionDecoder(
|
|
2985
|
+
['feedArgs', getOptionDecoder(getFeedDecoder())],
|
|
2943
2986
|
]);
|
|
2944
2987
|
}
|
|
2945
2988
|
function getUpdateOracleInstructionDataCodec() {
|
|
@@ -3051,17 +3094,5 @@ const deriveReservePda = async (controller, mint) => {
|
|
|
3051
3094
|
});
|
|
3052
3095
|
return reservePda;
|
|
3053
3096
|
};
|
|
3054
|
-
const deriveSplTokenSwapLpTokenPda = async (controller, lpMintAddress) => {
|
|
3055
|
-
const addressEncoder = getAddressEncoder$1();
|
|
3056
|
-
const [lpTokenPda] = await getProgramDerivedAddress({
|
|
3057
|
-
programAddress: address(SVM_ALM_CONTROLLER_PROGRAM_ADDRESS),
|
|
3058
|
-
seeds: [
|
|
3059
|
-
"spl-swap-lp",
|
|
3060
|
-
addressEncoder.encode(address(controller)),
|
|
3061
|
-
addressEncoder.encode(address(lpMintAddress)),
|
|
3062
|
-
],
|
|
3063
|
-
});
|
|
3064
|
-
return lpTokenPda;
|
|
3065
|
-
};
|
|
3066
3097
|
|
|
3067
|
-
export { ATOMIC_SWAP_BORROW_DISCRIMINATOR, ATOMIC_SWAP_REPAY_DISCRIMINATOR, AccountDiscriminators, AccountingAction, AccountingDirection, ControllerStatus, EMIT_EVENT_DISCRIMINATOR, INITIALIZE_CONTROLLER_DISCRIMINATOR, INITIALIZE_INTEGRATION_DISCRIMINATOR, INITIALIZE_ORACLE_DISCRIMINATOR, INITIALIZE_RESERVE_DISCRIMINATOR, IntegrationStatus, IntegrationType, MANAGE_CONTROLLER_DISCRIMINATOR, MANAGE_INTEGRATION_DISCRIMINATOR, MANAGE_PERMISSION_DISCRIMINATOR, MANAGE_RESERVE_DISCRIMINATOR, PULL_DISCRIMINATOR, PUSH_DISCRIMINATOR, PermissionStatus, REFRESH_ORACLE_DISCRIMINATOR, RESET_LZ_PUSH_IN_FLIGHT_DISCRIMINATOR, ReserveStatus, SVM_ALM_CONTROLLER_PROGRAM_ADDRESS, SYNC_DISCRIMINATOR, SYNC_RESERVE_DISCRIMINATOR, SvmAlmControllerAccount, SvmAlmControllerInstruction, UPDATE_ORACLE_DISCRIMINATOR, decodeController, decodeIntegration, decodeOracle, decodePermission, decodeReserve, deriveControllerAuthorityPda, deriveControllerPda, deriveIntegrationPda, derivePermissionPda, deriveReservePda,
|
|
3098
|
+
export { ATOMIC_SWAP_BORROW_DISCRIMINATOR, ATOMIC_SWAP_REPAY_DISCRIMINATOR, AccountDiscriminators, AccountingAction, AccountingDirection, CLAIM_RENT_DISCRIMINATOR, ControllerStatus, EMIT_EVENT_DISCRIMINATOR, INITIALIZE_CONTROLLER_DISCRIMINATOR, INITIALIZE_INTEGRATION_DISCRIMINATOR, INITIALIZE_ORACLE_DISCRIMINATOR, INITIALIZE_RESERVE_DISCRIMINATOR, IntegrationStatus, IntegrationType, MANAGE_CONTROLLER_DISCRIMINATOR, MANAGE_INTEGRATION_DISCRIMINATOR, MANAGE_PERMISSION_DISCRIMINATOR, MANAGE_RESERVE_DISCRIMINATOR, PULL_DISCRIMINATOR, PUSH_DISCRIMINATOR, PermissionStatus, REFRESH_ORACLE_DISCRIMINATOR, RESET_LZ_PUSH_IN_FLIGHT_DISCRIMINATOR, ReserveStatus, SVM_ALM_CONTROLLER_PROGRAM_ADDRESS, SYNC_DISCRIMINATOR, SYNC_RESERVE_DISCRIMINATOR, SvmAlmControllerAccount, SvmAlmControllerInstruction, UPDATE_ORACLE_DISCRIMINATOR, decodeController, decodeIntegration, decodeOracle, decodePermission, decodeReserve, deriveControllerAuthorityPda, deriveControllerPda, deriveIntegrationPda, derivePermissionPda, deriveReservePda, fetchAllController, fetchAllIntegration, fetchAllMaybeController, fetchAllMaybeIntegration, fetchAllMaybeOracle, fetchAllMaybePermission, fetchAllMaybeReserve, fetchAllOracle, fetchAllPermission, fetchAllReserve, fetchController, fetchIntegration, fetchMaybeController, fetchMaybeIntegration, fetchMaybeOracle, fetchMaybePermission, fetchMaybeReserve, fetchOracle, fetchPermission, fetchReserve, getAccountDiscriminatorsCodec, getAccountDiscriminatorsDecoder, getAccountDiscriminatorsEncoder, getAccountingActionCodec, getAccountingActionDecoder, getAccountingActionEncoder, getAccountingDirectionCodec, getAccountingDirectionDecoder, getAccountingDirectionEncoder, getAccountingEventCodec, getAccountingEventDecoder, getAccountingEventEncoder, getAtomicSwapBorrowDiscriminatorBytes, getAtomicSwapBorrowInstruction, getAtomicSwapBorrowInstructionDataCodec, getAtomicSwapBorrowInstructionDataDecoder, getAtomicSwapBorrowInstructionDataEncoder, getAtomicSwapConfigCodec, getAtomicSwapConfigDecoder, getAtomicSwapConfigEncoder, getAtomicSwapRepayDiscriminatorBytes, getAtomicSwapRepayInstruction, getAtomicSwapRepayInstructionDataCodec, getAtomicSwapRepayInstructionDataDecoder, getAtomicSwapRepayInstructionDataEncoder, getAtomicSwapStateCodec, getAtomicSwapStateDecoder, getAtomicSwapStateEncoder, getCctpBridgeConfigCodec, getCctpBridgeConfigDecoder, getCctpBridgeConfigEncoder, getCctpBridgeStateCodec, getCctpBridgeStateDecoder, getCctpBridgeStateEncoder, getClaimRentDiscriminatorBytes, getClaimRentInstruction, getClaimRentInstructionDataCodec, getClaimRentInstructionDataDecoder, getClaimRentInstructionDataEncoder, getControllerCodec, getControllerDecoder, getControllerEncoder, getControllerSize, getControllerStatusCodec, getControllerStatusDecoder, getControllerStatusEncoder, getControllerUpdateEventCodec, getControllerUpdateEventDecoder, getControllerUpdateEventEncoder, getDriftConfigCodec, getDriftConfigDecoder, getDriftConfigEncoder, getEmitEventDiscriminatorBytes, getEmitEventInstruction, getEmitEventInstructionDataCodec, getEmitEventInstructionDataDecoder, getEmitEventInstructionDataEncoder, getFeedArgsCodec, getFeedArgsDecoder, getFeedArgsEncoder, getFeedCodec, getFeedDecoder, getFeedEncoder, getInitializeArgsCodec, getInitializeArgsDecoder, getInitializeArgsEncoder, getInitializeControllerDiscriminatorBytes, getInitializeControllerInstruction, getInitializeControllerInstructionDataCodec, getInitializeControllerInstructionDataDecoder, getInitializeControllerInstructionDataEncoder, getInitializeIntegrationDiscriminatorBytes, getInitializeIntegrationInstruction, getInitializeIntegrationInstructionDataCodec, getInitializeIntegrationInstructionDataDecoder, getInitializeIntegrationInstructionDataEncoder, getInitializeOracleDiscriminatorBytes, getInitializeOracleInstruction, getInitializeOracleInstructionDataCodec, getInitializeOracleInstructionDataDecoder, getInitializeOracleInstructionDataEncoder, getInitializeReserveDiscriminatorBytes, getInitializeReserveInstruction, getInitializeReserveInstructionDataCodec, getInitializeReserveInstructionDataDecoder, getInitializeReserveInstructionDataEncoder, getIntegrationCodec, getIntegrationConfigCodec, getIntegrationConfigDecoder, getIntegrationConfigEncoder, getIntegrationDecoder, getIntegrationEncoder, getIntegrationSize, getIntegrationStateCodec, getIntegrationStateDecoder, getIntegrationStateEncoder, getIntegrationStatusCodec, getIntegrationStatusDecoder, getIntegrationStatusEncoder, getIntegrationTypeCodec, getIntegrationTypeDecoder, getIntegrationTypeEncoder, getIntegrationUpdateEventCodec, getIntegrationUpdateEventDecoder, getIntegrationUpdateEventEncoder, getKaminoConfigCodec, getKaminoConfigDecoder, getKaminoConfigEncoder, getLendingStateCodec, getLendingStateDecoder, getLendingStateEncoder, getLocalTokenCodec, getLocalTokenDecoder, getLocalTokenEncoder, getLzBridgeConfigCodec, getLzBridgeConfigDecoder, getLzBridgeConfigEncoder, getLzBridgeStateCodec, getLzBridgeStateDecoder, getLzBridgeStateEncoder, getManageControllerDiscriminatorBytes, getManageControllerInstruction, getManageControllerInstructionDataCodec, getManageControllerInstructionDataDecoder, getManageControllerInstructionDataEncoder, getManageIntegrationDiscriminatorBytes, getManageIntegrationInstruction, getManageIntegrationInstructionDataCodec, getManageIntegrationInstructionDataDecoder, getManageIntegrationInstructionDataEncoder, getManagePermissionDiscriminatorBytes, getManagePermissionInstruction, getManagePermissionInstructionDataCodec, getManagePermissionInstructionDataDecoder, getManagePermissionInstructionDataEncoder, getManageReserveDiscriminatorBytes, getManageReserveInstruction, getManageReserveInstructionDataCodec, getManageReserveInstructionDataDecoder, getManageReserveInstructionDataEncoder, getOFTStoreCodec, getOFTStoreDecoder, getOFTStoreEncoder, getOftSendParamsCodec, getOftSendParamsDecoder, getOftSendParamsEncoder, getOracleCodec, getOracleDecoder, getOracleEncoder, getOracleSize, getOracleUpdateEventCodec, getOracleUpdateEventDecoder, getOracleUpdateEventEncoder, getPeerConfigCodec, getPeerConfigDecoder, getPeerConfigEncoder, getPermissionCodec, getPermissionDecoder, getPermissionEncoder, getPermissionSize, getPermissionStatusCodec, getPermissionStatusDecoder, getPermissionStatusEncoder, getPermissionUpdateEventCodec, getPermissionUpdateEventDecoder, getPermissionUpdateEventEncoder, getPullArgsCodec, getPullArgsDecoder, getPullArgsEncoder, getPullDiscriminatorBytes, getPullInstruction, getPullInstructionDataCodec, getPullInstructionDataDecoder, getPullInstructionDataEncoder, getPushArgsCodec, getPushArgsDecoder, getPushArgsEncoder, getPushDiscriminatorBytes, getPushInstruction, getPushInstructionDataCodec, getPushInstructionDataDecoder, getPushInstructionDataEncoder, getRefreshOracleDiscriminatorBytes, getRefreshOracleInstruction, getRefreshOracleInstructionDataCodec, getRefreshOracleInstructionDataDecoder, getRefreshOracleInstructionDataEncoder, getRemoteTokenMessengerCodec, getRemoteTokenMessengerDecoder, getRemoteTokenMessengerEncoder, getReserveCodec, getReserveDecoder, getReserveEncoder, getReserveSize, getReserveStatusCodec, getReserveStatusDecoder, getReserveStatusEncoder, getReserveUpdateEventCodec, getReserveUpdateEventDecoder, getReserveUpdateEventEncoder, getResetLzPushInFlightDiscriminatorBytes, getResetLzPushInFlightInstruction, getResetLzPushInFlightInstructionDataCodec, getResetLzPushInFlightInstructionDataDecoder, getResetLzPushInFlightInstructionDataEncoder, getSplTokenExternalConfigCodec, getSplTokenExternalConfigDecoder, getSplTokenExternalConfigEncoder, getSplTokenExternalStateCodec, getSplTokenExternalStateDecoder, getSplTokenExternalStateEncoder, getSvmAlmControllerEventCodec, getSvmAlmControllerEventDecoder, getSvmAlmControllerEventEncoder, getSyncDiscriminatorBytes, getSyncInstruction, getSyncInstructionDataCodec, getSyncInstructionDataDecoder, getSyncInstructionDataEncoder, getSyncReserveDiscriminatorBytes, getSyncReserveInstruction, getSyncReserveInstructionDataCodec, getSyncReserveInstructionDataDecoder, getSyncReserveInstructionDataEncoder, getUpdateOracleDiscriminatorBytes, getUpdateOracleInstruction, getUpdateOracleInstructionDataCodec, getUpdateOracleInstructionDataDecoder, getUpdateOracleInstructionDataEncoder, identifySvmAlmControllerInstruction, initializeArgs, integrationConfig, integrationState, isInitializeArgs, isIntegrationConfig, isIntegrationState, isPullArgs, isPushArgs, isSvmAlmControllerEvent, parseAtomicSwapBorrowInstruction, parseAtomicSwapRepayInstruction, parseClaimRentInstruction, parseEmitEventInstruction, parseInitializeControllerInstruction, parseInitializeIntegrationInstruction, parseInitializeOracleInstruction, parseInitializeReserveInstruction, parseManageControllerInstruction, parseManageIntegrationInstruction, parseManagePermissionInstruction, parseManageReserveInstruction, parsePullInstruction, parsePushInstruction, parseRefreshOracleInstruction, parseResetLzPushInFlightInstruction, parseSyncInstruction, parseSyncReserveInstruction, parseUpdateOracleInstruction, pullArgs, pushArgs, svmAlmControllerEvent };
|