@huma-finance/permissionless-sdk 1.0.22 → 1.0.23

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.
@@ -1,9 +1,3 @@
1
- /**
2
- * Program IDL in camelCase format in order to be used in JS/TS.
3
- *
4
- * Note that this is only a type helper and is not the actual IDL. The original
5
- * IDL can be found at `target/idl/permissionless.json`.
6
- */
7
1
  export type Permissionless = {
8
2
  address: string;
9
3
  metadata: {
@@ -761,7 +755,7 @@ export type Permissionless = {
761
755
  args: [
762
756
  {
763
757
  name: "shares";
764
- type: "u128";
758
+ type: "u64";
765
759
  }
766
760
  ];
767
761
  },
@@ -953,6 +947,7 @@ export type Permissionless = {
953
947
  }
954
948
  ];
955
949
  };
950
+ relations: ["redemptionRequest"];
956
951
  },
957
952
  {
958
953
  name: "modeMint";
@@ -1213,6 +1208,108 @@ export type Permissionless = {
1213
1208
  }
1214
1209
  ];
1215
1210
  },
1211
+ {
1212
+ name: "clearInstantWithdrawalLiquiditySource";
1213
+ docs: [
1214
+ "Clears the deployment target from which liquidity is pulled when the pool's available",
1215
+ "balance is insufficient to satisfy an instant withdrawal.",
1216
+ "",
1217
+ "# Trigger Condition",
1218
+ "When the protocol is on.",
1219
+ "",
1220
+ "# Access Control",
1221
+ "Only strategy manager wallets can call this instruction."
1222
+ ];
1223
+ discriminator: [53, 151, 188, 231, 236, 184, 141, 85];
1224
+ accounts: [
1225
+ {
1226
+ name: "wallet";
1227
+ signer: true;
1228
+ relations: ["strategyManagerWallet"];
1229
+ },
1230
+ {
1231
+ name: "humaConfig";
1232
+ relations: ["poolConfig"];
1233
+ },
1234
+ {
1235
+ name: "poolConfig";
1236
+ writable: true;
1237
+ pda: {
1238
+ seeds: [
1239
+ {
1240
+ kind: "const";
1241
+ value: [112, 111, 111, 108, 95, 99, 111, 110, 102, 105, 103];
1242
+ },
1243
+ {
1244
+ kind: "account";
1245
+ path: "pool_config.pool_id";
1246
+ account: "poolConfig";
1247
+ }
1248
+ ];
1249
+ };
1250
+ },
1251
+ {
1252
+ name: "poolState";
1253
+ pda: {
1254
+ seeds: [
1255
+ {
1256
+ kind: "const";
1257
+ value: [112, 111, 111, 108, 95, 115, 116, 97, 116, 101];
1258
+ },
1259
+ {
1260
+ kind: "account";
1261
+ path: "poolConfig";
1262
+ }
1263
+ ];
1264
+ };
1265
+ },
1266
+ {
1267
+ name: "strategyManagerWallet";
1268
+ pda: {
1269
+ seeds: [
1270
+ {
1271
+ kind: "const";
1272
+ value: [
1273
+ 115,
1274
+ 116,
1275
+ 114,
1276
+ 97,
1277
+ 116,
1278
+ 101,
1279
+ 103,
1280
+ 121,
1281
+ 95,
1282
+ 109,
1283
+ 97,
1284
+ 110,
1285
+ 97,
1286
+ 103,
1287
+ 101,
1288
+ 114,
1289
+ 95,
1290
+ 119,
1291
+ 97,
1292
+ 108,
1293
+ 108,
1294
+ 101,
1295
+ 116
1296
+ ];
1297
+ },
1298
+ {
1299
+ kind: "account";
1300
+ path: "poolConfig";
1301
+ },
1302
+ {
1303
+ kind: "account";
1304
+ path: "strategy_manager_wallet.wallet";
1305
+ account: "strategyManagerWallet";
1306
+ }
1307
+ ];
1308
+ };
1309
+ }
1310
+ ];
1311
+ args: [];
1312
+ },
1216
1313
  {
1217
1314
  name: "closeLenderAccounts";
1218
1315
  docs: [
@@ -1853,13 +1950,14 @@ export type Permissionless = {
1853
1950
  {
1854
1951
  name: "declareLoss";
1855
1952
  docs: [
1856
- "Declares loss on an investment.",
1953
+ "Declares loss on an investment. When the loss is on liquid assets, the strategy manager must",
1954
+ "also update `liquid_assets_deployed` accordingly.",
1857
1955
  "",
1858
1956
  "# Trigger Condition",
1859
1957
  "When the protocol is on, and the pool is either on or in the pre-closure status.",
1860
1958
  "",
1861
1959
  "# Dev Notes",
1862
- "It is possible for the strategy manager to deploy and return liquidity after loss declaration.",
1960
+ "It is possible for the strategy manager to deploy and pay back liquidity after loss declaration.",
1863
1961
  "",
1864
1962
  "# Access Control",
1865
1963
  "Only strategy manager wallets can call this instruction."
@@ -3024,10 +3122,12 @@ export type Permissionless = {
3024
3122
  },
3025
3123
  {
3026
3124
  name: "deploymentConfig";
3125
+ optional: true;
3027
3126
  },
3028
3127
  {
3029
3128
  name: "deploymentState";
3030
3129
  writable: true;
3130
+ optional: true;
3031
3131
  pda: {
3032
3132
  seeds: [
3033
3133
  {
@@ -3325,10 +3425,12 @@ export type Permissionless = {
3325
3425
  },
3326
3426
  {
3327
3427
  name: "deploymentConfig";
3428
+ optional: true;
3328
3429
  },
3329
3430
  {
3330
3431
  name: "deploymentState";
3331
3432
  writable: true;
3433
+ optional: true;
3332
3434
  pda: {
3333
3435
  seeds: [
3334
3436
  {
@@ -4062,6 +4164,7 @@ export type Permissionless = {
4062
4164
  }
4063
4165
  ];
4064
4166
  };
4167
+ relations: ["redemptionRequest"];
4065
4168
  },
4066
4169
  {
4067
4170
  name: "modeMint";
@@ -4376,7 +4479,8 @@ export type Permissionless = {
4376
4479
  name: "recoverLoss";
4377
4480
  docs: [
4378
4481
  "Recovers declared losses by transferring assets from the strategy manager wallet to the pool.",
4379
- "The amount is distributed across mode losses proportionally.",
4482
+ "The transferred amount is applied to mode losses proportionally. When the recovery applies to",
4483
+ "losses on liquid assets, the strategy manager must also update `liquid_assets_deployed` accordingly.",
4380
4484
  "",
4381
4485
  "# Trigger Condition",
4382
4486
  "When the protocol is on and the pool is not closed.",
@@ -5454,6 +5558,111 @@ export type Permissionless = {
5454
5558
  }
5455
5559
  ];
5456
5560
  },
5561
+ {
5562
+ name: "setInstantWithdrawalLiquiditySource";
5563
+ docs: [
5564
+ "Sets the deployment target from which liquidity will be pulled when the pool's available",
5565
+ "balance is insufficient to satisfy an instant withdrawal.",
5566
+ "",
5567
+ "# Trigger Condition",
5568
+ "When the protocol is on.",
5569
+ "",
5570
+ "# Access Control",
5571
+ "Only strategy manager wallets can call this instruction."
5572
+ ];
5573
+ discriminator: [104, 139, 161, 239, 40, 211, 26, 252];
5574
+ accounts: [
5575
+ {
5576
+ name: "wallet";
5577
+ signer: true;
5578
+ relations: ["strategyManagerWallet"];
5579
+ },
5580
+ {
5581
+ name: "humaConfig";
5582
+ relations: ["poolConfig"];
5583
+ },
5584
+ {
5585
+ name: "poolConfig";
5586
+ writable: true;
5587
+ pda: {
5588
+ seeds: [
5589
+ {
5590
+ kind: "const";
5591
+ value: [112, 111, 111, 108, 95, 99, 111, 110, 102, 105, 103];
5592
+ },
5593
+ {
5594
+ kind: "account";
5595
+ path: "pool_config.pool_id";
5596
+ account: "poolConfig";
5597
+ }
5598
+ ];
5599
+ };
5600
+ },
5601
+ {
5602
+ name: "poolState";
5603
+ pda: {
5604
+ seeds: [
5605
+ {
5606
+ kind: "const";
5607
+ value: [112, 111, 111, 108, 95, 115, 116, 97, 116, 101];
5608
+ },
5609
+ {
5610
+ kind: "account";
5611
+ path: "poolConfig";
5612
+ }
5613
+ ];
5614
+ };
5615
+ },
5616
+ {
5617
+ name: "strategyManagerWallet";
5618
+ pda: {
5619
+ seeds: [
5620
+ {
5621
+ kind: "const";
5622
+ value: [
5623
+ 115,
5624
+ 116,
5625
+ 114,
5626
+ 97,
5627
+ 116,
5628
+ 101,
5629
+ 103,
5630
+ 121,
5631
+ 95,
5632
+ 109,
5633
+ 97,
5634
+ 110,
5635
+ 97,
5636
+ 103,
5637
+ 101,
5638
+ 114,
5639
+ 95,
5640
+ 119,
5641
+ 97,
5642
+ 108,
5643
+ 108,
5644
+ 101,
5645
+ 116
5646
+ ];
5647
+ },
5648
+ {
5649
+ kind: "account";
5650
+ path: "poolConfig";
5651
+ },
5652
+ {
5653
+ kind: "account";
5654
+ path: "strategy_manager_wallet.wallet";
5655
+ account: "strategyManagerWallet";
5656
+ }
5657
+ ];
5658
+ };
5659
+ },
5660
+ {
5661
+ name: "deploymentConfig";
5662
+ }
5663
+ ];
5664
+ args: [];
5665
+ },
5457
5666
  {
5458
5667
  name: "setInstantWithdrawalReserveLimit";
5459
5668
  docs: [
@@ -6617,6 +6826,14 @@ export type Permissionless = {
6617
6826
  name: "instantWithdrawalLenderRemovedEvent";
6618
6827
  discriminator: [228, 255, 164, 26, 160, 125, 77, 227];
6619
6828
  },
6829
+ {
6830
+ name: "instantWithdrawalLiquiditySourceClearedEvent";
6831
+ discriminator: [244, 93, 188, 227, 190, 128, 85, 101];
6832
+ },
6833
+ {
6834
+ name: "instantWithdrawalLiquiditySourceSetEvent";
6835
+ discriminator: [188, 167, 59, 236, 129, 19, 186, 11];
6836
+ },
6620
6837
  {
6621
6838
  name: "instantWithdrawalReserveLimitChangedEvent";
6622
6839
  discriminator: [163, 77, 62, 14, 42, 11, 32, 215];
@@ -6803,6 +7020,10 @@ export type Permissionless = {
6803
7020
  code: 6006;
6804
7021
  name: "invalidBasisPointHigherThan10000";
6805
7022
  },
7023
+ {
7024
+ code: 6007;
7025
+ name: "requiredAccountsNotProvided";
7026
+ },
6806
7027
  {
6807
7028
  code: 6101;
6808
7029
  name: "poolOwnerRequired";
@@ -6975,6 +7196,14 @@ export type Permissionless = {
6975
7196
  code: 6332;
6976
7197
  name: "liquidAssetsDeployedTooHigh";
6977
7198
  },
7199
+ {
7200
+ code: 6333;
7201
+ name: "redemptionRequestModeMismatch";
7202
+ },
7203
+ {
7204
+ code: 6334;
7205
+ name: "instantWithdrawalLiquiditySourceMismatch";
7206
+ },
6978
7207
  {
6979
7208
  code: 6401;
6980
7209
  name: "invalidModeConfig";
@@ -6997,18 +7226,22 @@ export type Permissionless = {
6997
7226
  },
6998
7227
  {
6999
7228
  code: 6406;
7000
- name: "modeTokenNotReadyToClose";
7229
+ name: "modeAssetsStale";
7001
7230
  },
7002
7231
  {
7003
7232
  code: 6407;
7004
- name: "lenderStateNotReadyToClose";
7233
+ name: "modeTokenNotReadyToClose";
7005
7234
  },
7006
7235
  {
7007
7236
  code: 6408;
7008
- name: "modeMintNotReadyToClose";
7237
+ name: "lenderStateNotReadyToClose";
7009
7238
  },
7010
7239
  {
7011
7240
  code: 6409;
7241
+ name: "modeMintNotReadyToClose";
7242
+ },
7243
+ {
7244
+ code: 6410;
7012
7245
  name: "modeStateNotReadyToClose";
7013
7246
  },
7014
7247
  {
@@ -7025,7 +7258,19 @@ export type Permissionless = {
7025
7258
  },
7026
7259
  {
7027
7260
  code: 6504;
7028
- name: "amountExceedsTokenLimit";
7261
+ name: "noLossToRecover";
7262
+ },
7263
+ {
7264
+ code: 6505;
7265
+ name: "tokenAccountOwnerMismatch";
7266
+ },
7267
+ {
7268
+ code: 6506;
7269
+ name: "manualStrategyNotAllowedAsLiquiditySource";
7270
+ },
7271
+ {
7272
+ code: 6507;
7273
+ name: "deploymentTargetIsActiveLiquiditySource";
7029
7274
  }
7030
7275
  ];
7031
7276
  types: [
@@ -7095,6 +7340,9 @@ export type Permissionless = {
7095
7340
  },
7096
7341
  {
7097
7342
  name: "jupLend";
7343
+ },
7344
+ {
7345
+ name: "kaminoLend";
7098
7346
  }
7099
7347
  ];
7100
7348
  };
@@ -7161,7 +7409,10 @@ export type Permissionless = {
7161
7409
  "",
7162
7410
  "# Fields",
7163
7411
  "* `instant_withdrawal_reserve_limit` - The maximum amount of assets that can be withdrawn instantly.",
7164
- "* `instant_withdrawal_fee_configs` - The fee configurations for instant withdrawal."
7412
+ "* `instant_withdrawal_fee_configs` - The fee configurations for instant withdrawal.",
7413
+ "* `liquidity_source` - The `DeploymentConfig` account key identifying the deployment target",
7414
+ "from which liquidity will be pulled if the pool's available balance is insufficient to",
7415
+ "satisfy an instant withdrawal."
7165
7416
  ];
7166
7417
  type: {
7167
7418
  kind: "struct";
@@ -7180,10 +7431,16 @@ export type Permissionless = {
7180
7431
  };
7181
7432
  };
7182
7433
  },
7434
+ {
7435
+ name: "liquiditySource";
7436
+ type: {
7437
+ option: "pubkey";
7438
+ };
7439
+ },
7183
7440
  {
7184
7441
  name: "reserved";
7185
7442
  type: {
7186
- array: ["u8", 160];
7443
+ array: ["u8", 127];
7187
7444
  };
7188
7445
  }
7189
7446
  ];
@@ -7324,6 +7581,69 @@ export type Permissionless = {
7324
7581
  ];
7325
7582
  };
7326
7583
  },
7584
+ {
7585
+ name: "instantWithdrawalLiquiditySourceClearedEvent";
7586
+ docs: [
7587
+ "The strategy manager has cleared the liquidity source for instant withdrawals.",
7588
+ "",
7589
+ "# Fields",
7590
+ "* `pool_id` - The pool ID.",
7591
+ "* `wallet` - The strategy manager wallet address.",
7592
+ "* `old_liquidity_source` - The previous `DeploymentConfig` key."
7593
+ ];
7594
+ type: {
7595
+ kind: "struct";
7596
+ fields: [
7597
+ {
7598
+ name: "poolId";
7599
+ type: "pubkey";
7600
+ },
7601
+ {
7602
+ name: "wallet";
7603
+ type: "pubkey";
7604
+ },
7605
+ {
7606
+ name: "oldLiquiditySource";
7607
+ type: "pubkey";
7608
+ }
7609
+ ];
7610
+ };
7611
+ },
7612
+ {
7613
+ name: "instantWithdrawalLiquiditySourceSetEvent";
7614
+ docs: [
7615
+ "The strategy manager has set the liquidity source for instant withdrawals.",
7616
+ "",
7617
+ "# Fields",
7618
+ "* `pool_id` - The pool ID.",
7619
+ "* `wallet` - The strategy manager wallet address.",
7620
+ "* `old_liquidity_source` - The previous `DeploymentConfig` key.",
7621
+ "* `new_liquidity_source` - The new `DeploymentConfig` key."
7622
+ ];
7623
+ type: {
7624
+ kind: "struct";
7625
+ fields: [
7626
+ {
7627
+ name: "poolId";
7628
+ type: "pubkey";
7629
+ },
7630
+ {
7631
+ name: "wallet";
7632
+ type: "pubkey";
7633
+ },
7634
+ {
7635
+ name: "oldLiquiditySource";
7636
+ type: {
7637
+ option: "pubkey";
7638
+ };
7639
+ },
7640
+ {
7641
+ name: "newLiquiditySource";
7642
+ type: "pubkey";
7643
+ }
7644
+ ];
7645
+ };
7646
+ },
7327
7647
  {
7328
7648
  name: "instantWithdrawalReserveLimitChangedEvent";
7329
7649
  docs: [