@liquidium/client 0.7.1 → 0.8.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/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Identity, HttpAgent } from '@icp-sdk/core/agent';
1
+ import { Agent, Identity } from '@icp-sdk/core/agent';
2
2
  import { PublicClient } from 'viem';
3
3
 
4
4
  /**
@@ -22,6 +22,8 @@ interface EvmReadClient {
22
22
  interface LiquidiumClientConfig {
23
23
  /** Preset canister IDs. Only `mainnet` is bundled. */
24
24
  environment?: Environment;
25
+ /** Preconfigured ICP agent. Takes precedence over `icHost` and `identity`. */
26
+ agent?: Agent;
25
27
  /** ICP replica host override (defaults follow `@icp-sdk/core/agent`). */
26
28
  icHost?: string;
27
29
  /** Agent identity for signed canister calls. */
@@ -178,7 +180,7 @@ interface Wallet {
178
180
  }
179
181
 
180
182
  interface CanisterContext {
181
- agent: HttpAgent;
183
+ agent: Agent;
182
184
  canisterIds: CanisterIds;
183
185
  }
184
186
 
@@ -1880,13 +1882,25 @@ interface SimpleLoanConfig {
1880
1882
  /** Principal text of the lending canister used by Simple Loans. */
1881
1883
  lendingCanisterId: string;
1882
1884
  }
1883
- /** Authentication metadata for warmed Simple Loans profiles. */
1884
- interface SimpleLoanAuthorization {
1885
+ /**
1886
+ * Legacy Ethereum-signature authentication metadata for a warmed Simple Loans profile.
1887
+ *
1888
+ * @deprecated New warmed profiles use `SimpleLoanIcpCallerAuthorization`. This
1889
+ * type remains supported for old canisters and existing profiles.
1890
+ */
1891
+ interface SimpleLoanEthSignatureAuthorization {
1885
1892
  type: "EthSignature";
1886
1893
  derivationIndex: Uint8Array;
1887
1894
  publicKey: Uint8Array;
1888
1895
  address: string;
1889
1896
  }
1897
+ /** Native IC caller authentication metadata for a warmed Simple Loans profile. */
1898
+ interface SimpleLoanIcpCallerAuthorization {
1899
+ type: "IcpCaller";
1900
+ subaccount: Uint8Array;
1901
+ }
1902
+ /** Authentication metadata for warmed Simple Loans profiles. */
1903
+ type SimpleLoanAuthorization = SimpleLoanEthSignatureAuthorization | SimpleLoanIcpCallerAuthorization;
1890
1904
  /** Warmed profile available for a future simple loan. */
1891
1905
  interface SimpleLoanWarmedProfile {
1892
1906
  id: bigint;
@@ -1949,7 +1963,12 @@ interface SimpleLoanStuckFundsWithdrawalRequestedEventType {
1949
1963
  poolId: string;
1950
1964
  amount: bigint;
1951
1965
  }
1952
- /** Profile-warmed event payload. */
1966
+ /**
1967
+ * Legacy Ethereum-signature profile-warmed event payload.
1968
+ *
1969
+ * @deprecated New profile warmups emit `SimpleLoanIcpProfileWarmedEventType`.
1970
+ * This type remains supported for historical events.
1971
+ */
1953
1972
  interface SimpleLoanProfileWarmedEventType {
1954
1973
  type: "ProfileWarmed";
1955
1974
  derivationIndex: Uint8Array;
@@ -1957,6 +1976,13 @@ interface SimpleLoanProfileWarmedEventType {
1957
1976
  ethAddress: string;
1958
1977
  profileId: string;
1959
1978
  }
1979
+ /** ICP-authorized profile-warmed event payload. */
1980
+ interface SimpleLoanIcpProfileWarmedEventType {
1981
+ type: "IcpProfileWarmed";
1982
+ subaccount: Uint8Array;
1983
+ warmedProfileId: bigint;
1984
+ profileId: string;
1985
+ }
1960
1986
  /** Repay-complete event payload. */
1961
1987
  interface SimpleLoanRepayCompleteEventType {
1962
1988
  type: "RepayComplete";
@@ -1971,7 +1997,7 @@ interface SimpleLoanDepositTimerStartedEventType {
1971
1997
  timestamp: bigint;
1972
1998
  }
1973
1999
  /** Direct canister event payload returned by Simple Loans event queries. */
1974
- type SimpleLoanEventType = SimpleLoanCreatedEventType | SimpleLoanFullLendWithdrawalRequestedEventType | SimpleLoanBorrowRequestedEventType | SimpleLoanDepositTimerExceededEventType | SimpleLoanStuckFundsWithdrawalRequestedEventType | SimpleLoanProfileWarmedEventType | SimpleLoanRepayCompleteEventType | SimpleLoanDepositTimerStartedEventType;
2000
+ type SimpleLoanEventType = SimpleLoanCreatedEventType | SimpleLoanFullLendWithdrawalRequestedEventType | SimpleLoanBorrowRequestedEventType | SimpleLoanDepositTimerExceededEventType | SimpleLoanStuckFundsWithdrawalRequestedEventType | SimpleLoanProfileWarmedEventType | SimpleLoanIcpProfileWarmedEventType | SimpleLoanRepayCompleteEventType | SimpleLoanDepositTimerStartedEventType;
1975
2001
  /** Fee-inclusive collateral deposit quote for one transfer target. */
1976
2002
  interface SimpleLoanInitialDepositTargetQuote {
1977
2003
  /** Full amount to send to the collateral deposit target, including fee. */
@@ -2426,4 +2452,4 @@ interface ExecuteWithOptions {
2426
2452
  */
2427
2453
  declare function executeWith(options: ExecuteWithOptions): <TResult>(action: WalletAction<TResult>) => Promise<TResult>;
2428
2454
 
2429
- export { ASSET_METADATA, AccountsModule, ActivitiesModule, type Activity, ActivityFilter, type ActivityStatusFoundResponse, type ActivityStatusNotFoundResponse, type ActivityTopUp, Asset, type AssetIdentifier, type AssetMetadata, type AssetPriceSnapshot, type AssetPrices, type BaseGetActivityStatusRequest, type BaseListActivitiesRequest, type BorrowAction, type BorrowOutflowDetails, type BorrowingPower, type BtcOnBtcAssetIdentifier, type BtcOnIcpAssetIdentifier, CK_ETH_DEPOSIT_CONTRACT_ADDRESS, type CalculateLtvRequest, type CanisterIdOverrides, type CanisterIds, Chain, type ChainAddressAccount, type ContractInteractionSupplyFlowRequest, type CreateAccountAction, type CreateAccountData, type CreateAccountRequest, type CreateBorrowData, type CreateBorrowRequest, type CreateProfileParams, type CreateSimpleLoanBorrow, type CreateSimpleLoanCollateral, type CreateSimpleLoanRefund, type CreateSimpleLoanRequest, type CreateTransferErc20TransactionParams, type CreateWithdrawData, type CreateWithdrawRequest, Environment, type EstimateInflowFeeRequest, type EthOnEthAssetIdentifier, type EthOnIcpAssetIdentifier, type EthTransactionRequest, type EvmContractTransaction, type EvmReadClient, EvmSupplyApprovalStrategy, type EvmSupplyContext, type ExecuteWithOptions, type FindPoolQuery, type FullWithdrawAmount, type GetActivityStatusByProfileRequest, type GetActivityStatusByShortRefRequest, type GetActivityStatusRequest, type GetActivityStatusResponse, type GetDepositAddressRequest, type GetEvmSupplyContextRequest, HEALTH_FACTOR_DECIMALS, HEALTH_FACTOR_SCALE, type HealthFactor, HistoryModule, INTEREST_YEAR_365_DAYS_SECONDS, type IcPrincipalAccount, type IcpAccountIdentifierAccount, type IcpOnIcpAssetIdentifier, type IcrcAccount, type IcrcTransferDetails, type InflowActivity, type InflowActivityOperation, type InflowActivityStatus, type InflowFeeEstimate, type InflowOperation, LendingModule, type LiquidiumAccount, type LiquidiumAccountInput, type LiquidiumAccountReference, LiquidiumAccountType, LiquidiumClient, type LiquidiumClientConfig, LiquidiumError, LiquidiumErrorCode, type LiquidiumErrorContext, type LiquidiumOperation, type LiquidiumState, type LiquidiumStatus, type ListActivitiesByProfileRequest, type ListActivitiesByShortRefRequest, type ListActivitiesRequest, type LtvCalculation, MIN_BORROW_AMOUNTS_BY_ASSET, MIN_DEPOSIT_AMOUNTS_BY_ASSET, MIN_WITHDRAW_AMOUNTS_BY_ASSET, type ManualTransferSupplyFlowRequest, MarketModule, type MaxRepayAmount, type MinimumBorrowAsset, type MinimumDepositAsset, type MinimumWithdrawAsset, type OutflowActivity, type OutflowActivityOperation, type OutflowActivityStatus, type OutflowDetails, OutflowType, type PaginatedResponse, type Pool, type PoolCanisterIds, type PoolRate, type Position, PositionsModule, type PrepareCreateProfileOptions, type ProtocolActivityEntry, type ProtocolActivityFeedFilters, type ProtocolActivityOperation, QuoteModule, type QuoteRequest, type QuoteResult, type QuoteValidationError, QuoteValidationErrorCode, type QuoteWarning, QuoteWarningCode, RATE_DECIMALS, RATE_SCALE, SUPPLY_COMPOUNDING_INTERVAL_15_SECONDS, type SendBtcTransactionRequest, type SendEthTransactionRequest, type SendIcrcTransferRequest, type SignMessageRequest, type SignMessageWalletAction, type SignatureInfo, type SigningChain, type SimpleLoan, type SimpleLoanAccount, type SimpleLoanAsset, type SimpleLoanAuthorization, type SimpleLoanBorrow, type SimpleLoanBorrowRequestedEventType, type SimpleLoanCollateral, type SimpleLoanConfig, SimpleLoanCreatedError, type SimpleLoanCreatedEventType, type SimpleLoanDepositTimerExceededEventType, type SimpleLoanDepositTimerStartedEventType, type SimpleLoanDestination, type SimpleLoanEvent, type SimpleLoanEventType, type SimpleLoanFindBorrow, type SimpleLoanFindCollateral, type SimpleLoanFindResult, type SimpleLoanFullLendWithdrawalRequestedEventType, type SimpleLoanGetByIdRequest, type SimpleLoanGetByRefRequest, type SimpleLoanGetRequest, type SimpleLoanInitialDeposit, type SimpleLoanInitialDepositTargetQuote, type SimpleLoanLeg, type SimpleLoanListEventsRequest, type SimpleLoanPositionSummary, type SimpleLoanProfileWarmedEventType, type SimpleLoanRepayCompleteEventType, type SimpleLoanRepayment, type SimpleLoanRepaymentTargetQuote, type SimpleLoanStuckFundsWithdrawalRequestedEventType, type SimpleLoanTerms, type SimpleLoanWarmedProfile, SimpleLoansModule, type SubmitInflowRequest, type SubmitInflowResponse, type SubmitSupplyFlowInflowRequest, SupplyAction, type SupplyFlow, type SupplyFlowRequest, SupplyPlanType, type SupplyTarget, type TransferSupplyFlowRequest, USDC_CONTRACT_ADDRESS, USDT_CONTRACT_ADDRESS, type UsdcOnEthAssetIdentifier, type UsdcOnIcpAssetIdentifier, type UsdtOnEthAssetIdentifier, type UsdtOnIcpAssetIdentifier, type UserHistoryEntry, type UserHistoryEntryApiItem, type UserHistoryOperation, type UserHistoryResponse, type UserLiquidationHistoryEntry, type UserLiquidationHistoryFilters, type UserLiquidationHistoryStatus, type UserPositionSummary, type UserReserve, type UserStats, type UserTransactionHistoryEntry, type UserTransactionHistoryFilters, type UserTransactionHistoryOperation, type UserTransactionHistoryState, type Wallet, type WalletAction, WalletActionKind, type WalletAdapter, WalletExecutionKind, type WalletExecutionParams, type WalletTransferSupplyFlowRequest, type WithdrawAction, type WithdrawOutflowDetails, createTransferErc20Transaction, estimateBorrowApy, estimateSupplyApy, executeWith, getAssetMetadata, getMinimumBorrowAmount, getMinimumDepositAmount, getMinimumWithdrawAmount, intFromPublicId, isAssetIdentifier, publicIdFromInt };
2455
+ export { ASSET_METADATA, AccountsModule, ActivitiesModule, type Activity, ActivityFilter, type ActivityStatusFoundResponse, type ActivityStatusNotFoundResponse, type ActivityTopUp, Asset, type AssetIdentifier, type AssetMetadata, type AssetPriceSnapshot, type AssetPrices, type BaseGetActivityStatusRequest, type BaseListActivitiesRequest, type BorrowAction, type BorrowOutflowDetails, type BorrowingPower, type BtcOnBtcAssetIdentifier, type BtcOnIcpAssetIdentifier, CK_ETH_DEPOSIT_CONTRACT_ADDRESS, type CalculateLtvRequest, type CanisterIdOverrides, type CanisterIds, Chain, type ChainAddressAccount, type ContractInteractionSupplyFlowRequest, type CreateAccountAction, type CreateAccountData, type CreateAccountRequest, type CreateBorrowData, type CreateBorrowRequest, type CreateProfileParams, type CreateSimpleLoanBorrow, type CreateSimpleLoanCollateral, type CreateSimpleLoanRefund, type CreateSimpleLoanRequest, type CreateTransferErc20TransactionParams, type CreateWithdrawData, type CreateWithdrawRequest, Environment, type EstimateInflowFeeRequest, type EthOnEthAssetIdentifier, type EthOnIcpAssetIdentifier, type EthTransactionRequest, type EvmContractTransaction, type EvmReadClient, EvmSupplyApprovalStrategy, type EvmSupplyContext, type ExecuteWithOptions, type FindPoolQuery, type FullWithdrawAmount, type GetActivityStatusByProfileRequest, type GetActivityStatusByShortRefRequest, type GetActivityStatusRequest, type GetActivityStatusResponse, type GetDepositAddressRequest, type GetEvmSupplyContextRequest, HEALTH_FACTOR_DECIMALS, HEALTH_FACTOR_SCALE, type HealthFactor, HistoryModule, INTEREST_YEAR_365_DAYS_SECONDS, type IcPrincipalAccount, type IcpAccountIdentifierAccount, type IcpOnIcpAssetIdentifier, type IcrcAccount, type IcrcTransferDetails, type InflowActivity, type InflowActivityOperation, type InflowActivityStatus, type InflowFeeEstimate, type InflowOperation, LendingModule, type LiquidiumAccount, type LiquidiumAccountInput, type LiquidiumAccountReference, LiquidiumAccountType, LiquidiumClient, type LiquidiumClientConfig, LiquidiumError, LiquidiumErrorCode, type LiquidiumErrorContext, type LiquidiumOperation, type LiquidiumState, type LiquidiumStatus, type ListActivitiesByProfileRequest, type ListActivitiesByShortRefRequest, type ListActivitiesRequest, type LtvCalculation, MIN_BORROW_AMOUNTS_BY_ASSET, MIN_DEPOSIT_AMOUNTS_BY_ASSET, MIN_WITHDRAW_AMOUNTS_BY_ASSET, type ManualTransferSupplyFlowRequest, MarketModule, type MaxRepayAmount, type MinimumBorrowAsset, type MinimumDepositAsset, type MinimumWithdrawAsset, type OutflowActivity, type OutflowActivityOperation, type OutflowActivityStatus, type OutflowDetails, OutflowType, type PaginatedResponse, type Pool, type PoolCanisterIds, type PoolRate, type Position, PositionsModule, type PrepareCreateProfileOptions, type ProtocolActivityEntry, type ProtocolActivityFeedFilters, type ProtocolActivityOperation, QuoteModule, type QuoteRequest, type QuoteResult, type QuoteValidationError, QuoteValidationErrorCode, type QuoteWarning, QuoteWarningCode, RATE_DECIMALS, RATE_SCALE, SUPPLY_COMPOUNDING_INTERVAL_15_SECONDS, type SendBtcTransactionRequest, type SendEthTransactionRequest, type SendIcrcTransferRequest, type SignMessageRequest, type SignMessageWalletAction, type SignatureInfo, type SigningChain, type SimpleLoan, type SimpleLoanAccount, type SimpleLoanAsset, type SimpleLoanAuthorization, type SimpleLoanBorrow, type SimpleLoanBorrowRequestedEventType, type SimpleLoanCollateral, type SimpleLoanConfig, SimpleLoanCreatedError, type SimpleLoanCreatedEventType, type SimpleLoanDepositTimerExceededEventType, type SimpleLoanDepositTimerStartedEventType, type SimpleLoanDestination, type SimpleLoanEthSignatureAuthorization, type SimpleLoanEvent, type SimpleLoanEventType, type SimpleLoanFindBorrow, type SimpleLoanFindCollateral, type SimpleLoanFindResult, type SimpleLoanFullLendWithdrawalRequestedEventType, type SimpleLoanGetByIdRequest, type SimpleLoanGetByRefRequest, type SimpleLoanGetRequest, type SimpleLoanIcpCallerAuthorization, type SimpleLoanIcpProfileWarmedEventType, type SimpleLoanInitialDeposit, type SimpleLoanInitialDepositTargetQuote, type SimpleLoanLeg, type SimpleLoanListEventsRequest, type SimpleLoanPositionSummary, type SimpleLoanProfileWarmedEventType, type SimpleLoanRepayCompleteEventType, type SimpleLoanRepayment, type SimpleLoanRepaymentTargetQuote, type SimpleLoanStuckFundsWithdrawalRequestedEventType, type SimpleLoanTerms, type SimpleLoanWarmedProfile, SimpleLoansModule, type SubmitInflowRequest, type SubmitInflowResponse, type SubmitSupplyFlowInflowRequest, SupplyAction, type SupplyFlow, type SupplyFlowRequest, SupplyPlanType, type SupplyTarget, type TransferSupplyFlowRequest, USDC_CONTRACT_ADDRESS, USDT_CONTRACT_ADDRESS, type UsdcOnEthAssetIdentifier, type UsdcOnIcpAssetIdentifier, type UsdtOnEthAssetIdentifier, type UsdtOnIcpAssetIdentifier, type UserHistoryEntry, type UserHistoryEntryApiItem, type UserHistoryOperation, type UserHistoryResponse, type UserLiquidationHistoryEntry, type UserLiquidationHistoryFilters, type UserLiquidationHistoryStatus, type UserPositionSummary, type UserReserve, type UserStats, type UserTransactionHistoryEntry, type UserTransactionHistoryFilters, type UserTransactionHistoryOperation, type UserTransactionHistoryState, type Wallet, type WalletAction, WalletActionKind, type WalletAdapter, WalletExecutionKind, type WalletExecutionParams, type WalletTransferSupplyFlowRequest, type WithdrawAction, type WithdrawOutflowDetails, createTransferErc20Transaction, estimateBorrowApy, estimateSupplyApy, executeWith, getAssetMetadata, getMinimumBorrowAmount, getMinimumDepositAmount, getMinimumWithdrawAmount, intFromPublicId, isAssetIdentifier, publicIdFromInt };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Identity, HttpAgent } from '@icp-sdk/core/agent';
1
+ import { Agent, Identity } from '@icp-sdk/core/agent';
2
2
  import { PublicClient } from 'viem';
3
3
 
4
4
  /**
@@ -22,6 +22,8 @@ interface EvmReadClient {
22
22
  interface LiquidiumClientConfig {
23
23
  /** Preset canister IDs. Only `mainnet` is bundled. */
24
24
  environment?: Environment;
25
+ /** Preconfigured ICP agent. Takes precedence over `icHost` and `identity`. */
26
+ agent?: Agent;
25
27
  /** ICP replica host override (defaults follow `@icp-sdk/core/agent`). */
26
28
  icHost?: string;
27
29
  /** Agent identity for signed canister calls. */
@@ -178,7 +180,7 @@ interface Wallet {
178
180
  }
179
181
 
180
182
  interface CanisterContext {
181
- agent: HttpAgent;
183
+ agent: Agent;
182
184
  canisterIds: CanisterIds;
183
185
  }
184
186
 
@@ -1880,13 +1882,25 @@ interface SimpleLoanConfig {
1880
1882
  /** Principal text of the lending canister used by Simple Loans. */
1881
1883
  lendingCanisterId: string;
1882
1884
  }
1883
- /** Authentication metadata for warmed Simple Loans profiles. */
1884
- interface SimpleLoanAuthorization {
1885
+ /**
1886
+ * Legacy Ethereum-signature authentication metadata for a warmed Simple Loans profile.
1887
+ *
1888
+ * @deprecated New warmed profiles use `SimpleLoanIcpCallerAuthorization`. This
1889
+ * type remains supported for old canisters and existing profiles.
1890
+ */
1891
+ interface SimpleLoanEthSignatureAuthorization {
1885
1892
  type: "EthSignature";
1886
1893
  derivationIndex: Uint8Array;
1887
1894
  publicKey: Uint8Array;
1888
1895
  address: string;
1889
1896
  }
1897
+ /** Native IC caller authentication metadata for a warmed Simple Loans profile. */
1898
+ interface SimpleLoanIcpCallerAuthorization {
1899
+ type: "IcpCaller";
1900
+ subaccount: Uint8Array;
1901
+ }
1902
+ /** Authentication metadata for warmed Simple Loans profiles. */
1903
+ type SimpleLoanAuthorization = SimpleLoanEthSignatureAuthorization | SimpleLoanIcpCallerAuthorization;
1890
1904
  /** Warmed profile available for a future simple loan. */
1891
1905
  interface SimpleLoanWarmedProfile {
1892
1906
  id: bigint;
@@ -1949,7 +1963,12 @@ interface SimpleLoanStuckFundsWithdrawalRequestedEventType {
1949
1963
  poolId: string;
1950
1964
  amount: bigint;
1951
1965
  }
1952
- /** Profile-warmed event payload. */
1966
+ /**
1967
+ * Legacy Ethereum-signature profile-warmed event payload.
1968
+ *
1969
+ * @deprecated New profile warmups emit `SimpleLoanIcpProfileWarmedEventType`.
1970
+ * This type remains supported for historical events.
1971
+ */
1953
1972
  interface SimpleLoanProfileWarmedEventType {
1954
1973
  type: "ProfileWarmed";
1955
1974
  derivationIndex: Uint8Array;
@@ -1957,6 +1976,13 @@ interface SimpleLoanProfileWarmedEventType {
1957
1976
  ethAddress: string;
1958
1977
  profileId: string;
1959
1978
  }
1979
+ /** ICP-authorized profile-warmed event payload. */
1980
+ interface SimpleLoanIcpProfileWarmedEventType {
1981
+ type: "IcpProfileWarmed";
1982
+ subaccount: Uint8Array;
1983
+ warmedProfileId: bigint;
1984
+ profileId: string;
1985
+ }
1960
1986
  /** Repay-complete event payload. */
1961
1987
  interface SimpleLoanRepayCompleteEventType {
1962
1988
  type: "RepayComplete";
@@ -1971,7 +1997,7 @@ interface SimpleLoanDepositTimerStartedEventType {
1971
1997
  timestamp: bigint;
1972
1998
  }
1973
1999
  /** Direct canister event payload returned by Simple Loans event queries. */
1974
- type SimpleLoanEventType = SimpleLoanCreatedEventType | SimpleLoanFullLendWithdrawalRequestedEventType | SimpleLoanBorrowRequestedEventType | SimpleLoanDepositTimerExceededEventType | SimpleLoanStuckFundsWithdrawalRequestedEventType | SimpleLoanProfileWarmedEventType | SimpleLoanRepayCompleteEventType | SimpleLoanDepositTimerStartedEventType;
2000
+ type SimpleLoanEventType = SimpleLoanCreatedEventType | SimpleLoanFullLendWithdrawalRequestedEventType | SimpleLoanBorrowRequestedEventType | SimpleLoanDepositTimerExceededEventType | SimpleLoanStuckFundsWithdrawalRequestedEventType | SimpleLoanProfileWarmedEventType | SimpleLoanIcpProfileWarmedEventType | SimpleLoanRepayCompleteEventType | SimpleLoanDepositTimerStartedEventType;
1975
2001
  /** Fee-inclusive collateral deposit quote for one transfer target. */
1976
2002
  interface SimpleLoanInitialDepositTargetQuote {
1977
2003
  /** Full amount to send to the collateral deposit target, including fee. */
@@ -2426,4 +2452,4 @@ interface ExecuteWithOptions {
2426
2452
  */
2427
2453
  declare function executeWith(options: ExecuteWithOptions): <TResult>(action: WalletAction<TResult>) => Promise<TResult>;
2428
2454
 
2429
- export { ASSET_METADATA, AccountsModule, ActivitiesModule, type Activity, ActivityFilter, type ActivityStatusFoundResponse, type ActivityStatusNotFoundResponse, type ActivityTopUp, Asset, type AssetIdentifier, type AssetMetadata, type AssetPriceSnapshot, type AssetPrices, type BaseGetActivityStatusRequest, type BaseListActivitiesRequest, type BorrowAction, type BorrowOutflowDetails, type BorrowingPower, type BtcOnBtcAssetIdentifier, type BtcOnIcpAssetIdentifier, CK_ETH_DEPOSIT_CONTRACT_ADDRESS, type CalculateLtvRequest, type CanisterIdOverrides, type CanisterIds, Chain, type ChainAddressAccount, type ContractInteractionSupplyFlowRequest, type CreateAccountAction, type CreateAccountData, type CreateAccountRequest, type CreateBorrowData, type CreateBorrowRequest, type CreateProfileParams, type CreateSimpleLoanBorrow, type CreateSimpleLoanCollateral, type CreateSimpleLoanRefund, type CreateSimpleLoanRequest, type CreateTransferErc20TransactionParams, type CreateWithdrawData, type CreateWithdrawRequest, Environment, type EstimateInflowFeeRequest, type EthOnEthAssetIdentifier, type EthOnIcpAssetIdentifier, type EthTransactionRequest, type EvmContractTransaction, type EvmReadClient, EvmSupplyApprovalStrategy, type EvmSupplyContext, type ExecuteWithOptions, type FindPoolQuery, type FullWithdrawAmount, type GetActivityStatusByProfileRequest, type GetActivityStatusByShortRefRequest, type GetActivityStatusRequest, type GetActivityStatusResponse, type GetDepositAddressRequest, type GetEvmSupplyContextRequest, HEALTH_FACTOR_DECIMALS, HEALTH_FACTOR_SCALE, type HealthFactor, HistoryModule, INTEREST_YEAR_365_DAYS_SECONDS, type IcPrincipalAccount, type IcpAccountIdentifierAccount, type IcpOnIcpAssetIdentifier, type IcrcAccount, type IcrcTransferDetails, type InflowActivity, type InflowActivityOperation, type InflowActivityStatus, type InflowFeeEstimate, type InflowOperation, LendingModule, type LiquidiumAccount, type LiquidiumAccountInput, type LiquidiumAccountReference, LiquidiumAccountType, LiquidiumClient, type LiquidiumClientConfig, LiquidiumError, LiquidiumErrorCode, type LiquidiumErrorContext, type LiquidiumOperation, type LiquidiumState, type LiquidiumStatus, type ListActivitiesByProfileRequest, type ListActivitiesByShortRefRequest, type ListActivitiesRequest, type LtvCalculation, MIN_BORROW_AMOUNTS_BY_ASSET, MIN_DEPOSIT_AMOUNTS_BY_ASSET, MIN_WITHDRAW_AMOUNTS_BY_ASSET, type ManualTransferSupplyFlowRequest, MarketModule, type MaxRepayAmount, type MinimumBorrowAsset, type MinimumDepositAsset, type MinimumWithdrawAsset, type OutflowActivity, type OutflowActivityOperation, type OutflowActivityStatus, type OutflowDetails, OutflowType, type PaginatedResponse, type Pool, type PoolCanisterIds, type PoolRate, type Position, PositionsModule, type PrepareCreateProfileOptions, type ProtocolActivityEntry, type ProtocolActivityFeedFilters, type ProtocolActivityOperation, QuoteModule, type QuoteRequest, type QuoteResult, type QuoteValidationError, QuoteValidationErrorCode, type QuoteWarning, QuoteWarningCode, RATE_DECIMALS, RATE_SCALE, SUPPLY_COMPOUNDING_INTERVAL_15_SECONDS, type SendBtcTransactionRequest, type SendEthTransactionRequest, type SendIcrcTransferRequest, type SignMessageRequest, type SignMessageWalletAction, type SignatureInfo, type SigningChain, type SimpleLoan, type SimpleLoanAccount, type SimpleLoanAsset, type SimpleLoanAuthorization, type SimpleLoanBorrow, type SimpleLoanBorrowRequestedEventType, type SimpleLoanCollateral, type SimpleLoanConfig, SimpleLoanCreatedError, type SimpleLoanCreatedEventType, type SimpleLoanDepositTimerExceededEventType, type SimpleLoanDepositTimerStartedEventType, type SimpleLoanDestination, type SimpleLoanEvent, type SimpleLoanEventType, type SimpleLoanFindBorrow, type SimpleLoanFindCollateral, type SimpleLoanFindResult, type SimpleLoanFullLendWithdrawalRequestedEventType, type SimpleLoanGetByIdRequest, type SimpleLoanGetByRefRequest, type SimpleLoanGetRequest, type SimpleLoanInitialDeposit, type SimpleLoanInitialDepositTargetQuote, type SimpleLoanLeg, type SimpleLoanListEventsRequest, type SimpleLoanPositionSummary, type SimpleLoanProfileWarmedEventType, type SimpleLoanRepayCompleteEventType, type SimpleLoanRepayment, type SimpleLoanRepaymentTargetQuote, type SimpleLoanStuckFundsWithdrawalRequestedEventType, type SimpleLoanTerms, type SimpleLoanWarmedProfile, SimpleLoansModule, type SubmitInflowRequest, type SubmitInflowResponse, type SubmitSupplyFlowInflowRequest, SupplyAction, type SupplyFlow, type SupplyFlowRequest, SupplyPlanType, type SupplyTarget, type TransferSupplyFlowRequest, USDC_CONTRACT_ADDRESS, USDT_CONTRACT_ADDRESS, type UsdcOnEthAssetIdentifier, type UsdcOnIcpAssetIdentifier, type UsdtOnEthAssetIdentifier, type UsdtOnIcpAssetIdentifier, type UserHistoryEntry, type UserHistoryEntryApiItem, type UserHistoryOperation, type UserHistoryResponse, type UserLiquidationHistoryEntry, type UserLiquidationHistoryFilters, type UserLiquidationHistoryStatus, type UserPositionSummary, type UserReserve, type UserStats, type UserTransactionHistoryEntry, type UserTransactionHistoryFilters, type UserTransactionHistoryOperation, type UserTransactionHistoryState, type Wallet, type WalletAction, WalletActionKind, type WalletAdapter, WalletExecutionKind, type WalletExecutionParams, type WalletTransferSupplyFlowRequest, type WithdrawAction, type WithdrawOutflowDetails, createTransferErc20Transaction, estimateBorrowApy, estimateSupplyApy, executeWith, getAssetMetadata, getMinimumBorrowAmount, getMinimumDepositAmount, getMinimumWithdrawAmount, intFromPublicId, isAssetIdentifier, publicIdFromInt };
2455
+ export { ASSET_METADATA, AccountsModule, ActivitiesModule, type Activity, ActivityFilter, type ActivityStatusFoundResponse, type ActivityStatusNotFoundResponse, type ActivityTopUp, Asset, type AssetIdentifier, type AssetMetadata, type AssetPriceSnapshot, type AssetPrices, type BaseGetActivityStatusRequest, type BaseListActivitiesRequest, type BorrowAction, type BorrowOutflowDetails, type BorrowingPower, type BtcOnBtcAssetIdentifier, type BtcOnIcpAssetIdentifier, CK_ETH_DEPOSIT_CONTRACT_ADDRESS, type CalculateLtvRequest, type CanisterIdOverrides, type CanisterIds, Chain, type ChainAddressAccount, type ContractInteractionSupplyFlowRequest, type CreateAccountAction, type CreateAccountData, type CreateAccountRequest, type CreateBorrowData, type CreateBorrowRequest, type CreateProfileParams, type CreateSimpleLoanBorrow, type CreateSimpleLoanCollateral, type CreateSimpleLoanRefund, type CreateSimpleLoanRequest, type CreateTransferErc20TransactionParams, type CreateWithdrawData, type CreateWithdrawRequest, Environment, type EstimateInflowFeeRequest, type EthOnEthAssetIdentifier, type EthOnIcpAssetIdentifier, type EthTransactionRequest, type EvmContractTransaction, type EvmReadClient, EvmSupplyApprovalStrategy, type EvmSupplyContext, type ExecuteWithOptions, type FindPoolQuery, type FullWithdrawAmount, type GetActivityStatusByProfileRequest, type GetActivityStatusByShortRefRequest, type GetActivityStatusRequest, type GetActivityStatusResponse, type GetDepositAddressRequest, type GetEvmSupplyContextRequest, HEALTH_FACTOR_DECIMALS, HEALTH_FACTOR_SCALE, type HealthFactor, HistoryModule, INTEREST_YEAR_365_DAYS_SECONDS, type IcPrincipalAccount, type IcpAccountIdentifierAccount, type IcpOnIcpAssetIdentifier, type IcrcAccount, type IcrcTransferDetails, type InflowActivity, type InflowActivityOperation, type InflowActivityStatus, type InflowFeeEstimate, type InflowOperation, LendingModule, type LiquidiumAccount, type LiquidiumAccountInput, type LiquidiumAccountReference, LiquidiumAccountType, LiquidiumClient, type LiquidiumClientConfig, LiquidiumError, LiquidiumErrorCode, type LiquidiumErrorContext, type LiquidiumOperation, type LiquidiumState, type LiquidiumStatus, type ListActivitiesByProfileRequest, type ListActivitiesByShortRefRequest, type ListActivitiesRequest, type LtvCalculation, MIN_BORROW_AMOUNTS_BY_ASSET, MIN_DEPOSIT_AMOUNTS_BY_ASSET, MIN_WITHDRAW_AMOUNTS_BY_ASSET, type ManualTransferSupplyFlowRequest, MarketModule, type MaxRepayAmount, type MinimumBorrowAsset, type MinimumDepositAsset, type MinimumWithdrawAsset, type OutflowActivity, type OutflowActivityOperation, type OutflowActivityStatus, type OutflowDetails, OutflowType, type PaginatedResponse, type Pool, type PoolCanisterIds, type PoolRate, type Position, PositionsModule, type PrepareCreateProfileOptions, type ProtocolActivityEntry, type ProtocolActivityFeedFilters, type ProtocolActivityOperation, QuoteModule, type QuoteRequest, type QuoteResult, type QuoteValidationError, QuoteValidationErrorCode, type QuoteWarning, QuoteWarningCode, RATE_DECIMALS, RATE_SCALE, SUPPLY_COMPOUNDING_INTERVAL_15_SECONDS, type SendBtcTransactionRequest, type SendEthTransactionRequest, type SendIcrcTransferRequest, type SignMessageRequest, type SignMessageWalletAction, type SignatureInfo, type SigningChain, type SimpleLoan, type SimpleLoanAccount, type SimpleLoanAsset, type SimpleLoanAuthorization, type SimpleLoanBorrow, type SimpleLoanBorrowRequestedEventType, type SimpleLoanCollateral, type SimpleLoanConfig, SimpleLoanCreatedError, type SimpleLoanCreatedEventType, type SimpleLoanDepositTimerExceededEventType, type SimpleLoanDepositTimerStartedEventType, type SimpleLoanDestination, type SimpleLoanEthSignatureAuthorization, type SimpleLoanEvent, type SimpleLoanEventType, type SimpleLoanFindBorrow, type SimpleLoanFindCollateral, type SimpleLoanFindResult, type SimpleLoanFullLendWithdrawalRequestedEventType, type SimpleLoanGetByIdRequest, type SimpleLoanGetByRefRequest, type SimpleLoanGetRequest, type SimpleLoanIcpCallerAuthorization, type SimpleLoanIcpProfileWarmedEventType, type SimpleLoanInitialDeposit, type SimpleLoanInitialDepositTargetQuote, type SimpleLoanLeg, type SimpleLoanListEventsRequest, type SimpleLoanPositionSummary, type SimpleLoanProfileWarmedEventType, type SimpleLoanRepayCompleteEventType, type SimpleLoanRepayment, type SimpleLoanRepaymentTargetQuote, type SimpleLoanStuckFundsWithdrawalRequestedEventType, type SimpleLoanTerms, type SimpleLoanWarmedProfile, SimpleLoansModule, type SubmitInflowRequest, type SubmitInflowResponse, type SubmitSupplyFlowInflowRequest, SupplyAction, type SupplyFlow, type SupplyFlowRequest, SupplyPlanType, type SupplyTarget, type TransferSupplyFlowRequest, USDC_CONTRACT_ADDRESS, USDT_CONTRACT_ADDRESS, type UsdcOnEthAssetIdentifier, type UsdcOnIcpAssetIdentifier, type UsdtOnEthAssetIdentifier, type UsdtOnIcpAssetIdentifier, type UserHistoryEntry, type UserHistoryEntryApiItem, type UserHistoryOperation, type UserHistoryResponse, type UserLiquidationHistoryEntry, type UserLiquidationHistoryFilters, type UserLiquidationHistoryStatus, type UserPositionSummary, type UserReserve, type UserStats, type UserTransactionHistoryEntry, type UserTransactionHistoryFilters, type UserTransactionHistoryOperation, type UserTransactionHistoryState, type Wallet, type WalletAction, WalletActionKind, type WalletAdapter, WalletExecutionKind, type WalletExecutionParams, type WalletTransferSupplyFlowRequest, type WithdrawAction, type WithdrawOutflowDetails, createTransferErc20Transaction, estimateBorrowApy, estimateSupplyApy, executeWith, getAssetMetadata, getMinimumBorrowAmount, getMinimumDepositAmount, getMinimumWithdrawAmount, intFromPublicId, isAssetIdentifier, publicIdFromInt };
package/dist/index.js CHANGED
@@ -319,6 +319,12 @@ function appendErrorContext(message, context) {
319
319
  return `${message} (${details.join(", ")})`;
320
320
  }
321
321
  function createCanisterContext(opts) {
322
+ if (opts.agent) {
323
+ return {
324
+ agent: opts.agent,
325
+ canisterIds: opts.canisterIds
326
+ };
327
+ }
322
328
  const host = resolveHost(opts.icHost);
323
329
  const agent = HttpAgent.createSync({
324
330
  host,
@@ -1495,7 +1501,9 @@ var flexibleSimpleLoansIdlFactory = ({ IDL }) => {
1495
1501
  InvalidEthAddress: IDL.Null,
1496
1502
  CouldNotDecode: IDL.Text,
1497
1503
  ProfileNotFound: IDL.Null,
1498
- InvalidBtcSignature: IDL.Null
1504
+ InvalidBtcSignature: IDL.Null,
1505
+ AnonymousIcpCaller: IDL.Null,
1506
+ InvalidIcpSubaccount: IDL.Null
1499
1507
  });
1500
1508
  const ProtocolError = IDL.Variant({
1501
1509
  PositionNotFound: IDL.Null,
@@ -1615,6 +1623,11 @@ var flexibleSimpleLoansIdlFactory = ({ IDL }) => {
1615
1623
  eth_address: IDL.Text,
1616
1624
  lending_profile: IDL.Principal
1617
1625
  }),
1626
+ IcpProfileWarmed: IDL.Record({
1627
+ subaccount: IDL.Vec(IDL.Nat8),
1628
+ warmed_profile_id: IDL.Nat,
1629
+ lending_profile: IDL.Principal
1630
+ }),
1618
1631
  RepayComplete: CreateLoanResponse,
1619
1632
  DepositTimerStarted: IDL.Record({
1620
1633
  loan_id: IDL.Nat,
@@ -1632,6 +1645,9 @@ var flexibleSimpleLoansIdlFactory = ({ IDL }) => {
1632
1645
  derivation_index: IDL.Vec(IDL.Nat8),
1633
1646
  pubkey: IDL.Vec(IDL.Nat8),
1634
1647
  address: IDL.Text
1648
+ }),
1649
+ IcpCaller: IDL.Record({
1650
+ subaccount: IDL.Vec(IDL.Nat8)
1635
1651
  })
1636
1652
  });
1637
1653
  const Loan = IDL.Record({
@@ -7505,6 +7521,15 @@ function mapSimpleLoanEventType(eventType) {
7505
7521
  profileId: event.lending_profile.toText()
7506
7522
  };
7507
7523
  }
7524
+ if ("IcpProfileWarmed" in eventType) {
7525
+ const event = eventType.IcpProfileWarmed;
7526
+ return {
7527
+ type: "IcpProfileWarmed",
7528
+ subaccount: event.subaccount,
7529
+ warmedProfileId: event.warmed_profile_id,
7530
+ profileId: event.lending_profile.toText()
7531
+ };
7532
+ }
7508
7533
  if ("RepayComplete" in eventType) {
7509
7534
  return {
7510
7535
  type: "RepayComplete",
@@ -7527,6 +7552,12 @@ function mapWarmedProfile(profile) {
7527
7552
  };
7528
7553
  }
7529
7554
  function authorizationFromCanister(authorization) {
7555
+ if ("IcpCaller" in authorization) {
7556
+ return {
7557
+ type: "IcpCaller",
7558
+ subaccount: authorization.IcpCaller.subaccount
7559
+ };
7560
+ }
7530
7561
  return {
7531
7562
  type: "EthSignature",
7532
7563
  derivationIndex: authorization.EthSignature.derivation_index,
@@ -7723,6 +7754,7 @@ var LiquidiumClient = class {
7723
7754
  const canisterIds = resolveCanisterIds(environment, config.canisterIds);
7724
7755
  const timeoutMs = config.timeoutMs ?? DEFAULT_TIMEOUT_MS;
7725
7756
  this.canisterContext = createCanisterContext({
7757
+ agent: config.agent,
7726
7758
  icHost: config.icHost,
7727
7759
  identity: config.identity,
7728
7760
  canisterIds