import { Buffer } from "buffer"; import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions, MethodOptions } from "@stellar/stellar-sdk/contract"; import type { u32, u64, u128, Option } from "@stellar/stellar-sdk/contract"; export * from "@stellar/stellar-sdk"; export * as contract from "@stellar/stellar-sdk/contract"; export * as rpc from "@stellar/stellar-sdk/rpc"; export declare const networks: { readonly testnet: { readonly networkPassphrase: "Test SDF Network ; September 2015"; readonly contractId: "CCNKUA62K3T4FQTFOGOVHZNS7UJ36UWYHS727TYSKSWTJ3LVZJOBFMVL"; }; }; export interface PoolManagerAddressesChangedEvent { pool: string; pool_storage: string; } export interface PoolStorageAddressesChangedEvent { credit: string; pool: string; pool_manager: string; } export type ClientDataKey = { tag: "HumaConfig"; values: void; } | { tag: "PoolStorage"; values: void; } | { tag: "Pool"; values: void; }; export interface PoolOperatorAddedEvent { operator: string; } export interface PoolOperatorRemovedEvent { operator: string; } export interface HumaConfigChangedEvent { huma_config: string; huma_owner: string; sentinel: string; } export interface TrancheAddressesChangedEvent { junior_addr: string; senior_addr: string; } export interface JuniorTrancheAddressChangedEvent { junior_addr: string; } export interface NewEpochStartedEvent { end_time: u64; epoch_id: u64; } export interface EpochClosedEvent { epoch_id: u64; } export interface EpochProcessedAfterPoolClosureEvent { epoch_id: u64; } export interface RedemptionRequestsProcessedEvent { junior_tranche_assets: u128; junior_tranche_price: u128; senior_tranche_assets: u128; senior_tranche_price: u128; unprocessed_amount: u128; } export declare const PoolManagerError: { 301: { message: string; }; 302: { message: string; }; 303: { message: string; }; 304: { message: string; }; 305: { message: string; }; 306: { message: string; }; 307: { message: string; }; }; export interface PoolEnabledEvent { by: string; } export interface PoolDisabledEvent { by: string; } export interface PoolClosedEvent { by: string; } export interface PoolOwnerChangedEvent { pool_owner: string; } export interface PoolOwnerTreasuryChangedEvent { treasury: string; } export interface EvaluationAgentChangedEvent { ea: string; } export interface TranchesPolicyTypeChangedEvent { policy_type: TranchesPolicyType; } export interface PoolSettingsChangedEvent { default_grace_period_days: u32; late_payment_grace_period_days: u32; max_credit_line: u128; min_deposit_amount: u128; pay_period_duration: PayPeriodDuration; principal_only_payment_allowed: boolean; } export interface LPConfigChangedEvent { auto_redemption_after_lockup: boolean; fixed_senior_yield_bps: u32; liquidity_cap: u128; max_senior_junior_ratio: u32; tranches_risk_adjustment_bps: u32; withdrawal_lockout_period_days: u32; } export interface FeeStructureChangedEvent { front_loading_fee_bps: u32; front_loading_fee_flat: u128; late_fee_bps: u32; yield_bps: u32; } export interface AdminRnRChangedEvent { ea_liquidity_rate: u32; ea_reward_rate: u32; pool_owner_liquidity_rate: u32; pool_owner_reward_rate: u32; } export interface PoolNameChangedEvent { name: string; } export interface ProtocolRewardsWithdrawnEvent { amount: u128; receiver: string; } export interface PoolRewardsWithdrawnEvent { amount: u128; receiver: string; } export interface PoolRewardsWithdrawalFailedEvent { amount: u128; receiver: string; } export interface EvaluationAgentRewardsWithdrawnEvent { amount: u128; receiver: string; } export interface EARewardsWithdrawalFailedEvent { amount: u128; receiver: string; } export type PayPeriodDuration = { tag: "Monthly"; values: void; } | { tag: "Quarterly"; values: void; } | { tag: "SemiAnnually"; values: void; }; export declare const CalendarError: { 801: { message: string; }; }; export declare const CommonError: { 1: { message: string; }; 2: { message: string; }; 3: { message: string; }; 4: { message: string; }; 5: { message: string; }; 6: { message: string; }; 7: { message: string; }; }; export type TranchesPolicyType = { tag: "FixedSeniorYield"; values: void; } | { tag: "RiskAdjusted"; values: void; }; export interface PoolSettings { default_grace_period_days: u32; late_payment_grace_period_days: u32; max_credit_line: u128; min_deposit_amount: u128; pay_period_duration: PayPeriodDuration; principal_only_payment_allowed: boolean; } export interface LPConfig { auto_redemption_after_lockup: boolean; fixed_senior_yield_bps: u32; liquidity_cap: u128; max_senior_junior_ratio: u32; tranches_risk_adjustment_bps: u32; withdrawal_lockout_period_days: u32; } export interface FeeStructure { front_loading_fee_bps: u32; front_loading_fee_flat: u128; late_fee_bps: u32; yield_bps: u32; } export type PoolStatus = { tag: "Off"; values: void; } | { tag: "On"; values: void; } | { tag: "Closed"; values: void; }; export interface Epoch { end_time: u64; id: u64; } export interface AdminRnR { liquidity_rate_bps_ea: u32; liquidity_rate_bps_pool_owner: u32; reward_rate_bps_ea: u32; reward_rate_bps_pool_owner: u32; } export interface TrancheAddresses { addrs: Array>; } export interface TrancheAssets { assets: Array; } export interface EpochRedemptionSummary { epoch_id: u64; total_amount_processed: u128; total_shares_processed: u128; total_shares_requested: u128; } export interface Client { /** * Construct and simulate a initialize transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ initialize: ({ pool_name, huma_config, pool_storage, pool }: { pool_name: string; huma_config: string; pool_storage: string; pool: string; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a set_huma_config transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ set_huma_config: ({ huma_config }: { huma_config: string; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a set_contract_addrs transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ set_contract_addrs: ({ caller, pool_storage, pool }: { caller: string; pool_storage: string; pool: string; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a set_storage_contract_addrs transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ set_storage_contract_addrs: ({ caller, pool, pool_manager, credit }: { caller: string; pool: string; pool_manager: string; credit: string; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a set_pool_name transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ set_pool_name: ({ caller, name }: { caller: string; name: string; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a set_pool_owner transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ set_pool_owner: ({ caller, addr }: { caller: string; addr: string; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a set_pool_owner_treasury transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ set_pool_owner_treasury: ({ caller, addr }: { caller: string; addr: string; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a set_evaluation_agent transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ set_evaluation_agent: ({ caller, addr }: { caller: string; addr: string; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a set_tranche_addresses transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ set_tranche_addresses: ({ caller, junior_addr, senior_addr }: { caller: string; junior_addr: string; senior_addr: Option; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a set_admin_rnr transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ set_admin_rnr: ({ caller, pool_owner_reward_rate, pool_owner_liquidity_rate, ea_reward_rate, ea_liquidity_rate }: { caller: string; pool_owner_reward_rate: u32; pool_owner_liquidity_rate: u32; ea_reward_rate: u32; ea_liquidity_rate: u32; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a set_pool_settings transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ set_pool_settings: ({ caller, max_credit_line, min_deposit_amount, pay_period_duration, late_payment_grace_period_days, default_grace_period_days, principal_only_payment_allowed }: { caller: string; max_credit_line: u128; min_deposit_amount: u128; pay_period_duration: PayPeriodDuration; late_payment_grace_period_days: u32; default_grace_period_days: u32; principal_only_payment_allowed: boolean; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a set_lp_config transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ set_lp_config: ({ caller, liquidity_cap, max_senior_junior_ratio, fixed_senior_yield_bps, tranches_risk_adjustment_bps, withdrawal_lockout_period_days, auto_redemption_after_lockup }: { caller: string; liquidity_cap: u128; max_senior_junior_ratio: u32; fixed_senior_yield_bps: u32; tranches_risk_adjustment_bps: u32; withdrawal_lockout_period_days: u32; auto_redemption_after_lockup: boolean; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a set_fee_structure transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ set_fee_structure: ({ caller, yield_bps, late_fee_bps, front_loading_fee_flat, front_loading_fee_bps }: { caller: string; yield_bps: u32; late_fee_bps: u32; front_loading_fee_flat: u128; front_loading_fee_bps: u32; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a set_tranches_policy_type transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ set_tranches_policy_type: ({ caller, policy_type }: { caller: string; policy_type: TranchesPolicyType; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a add_pool_operator transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ add_pool_operator: ({ addr }: { addr: string; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a remove_pool_operator transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ remove_pool_operator: ({ addr }: { addr: string; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a enable_pool transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ enable_pool: ({ caller }: { caller: string; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a disable_pool transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ disable_pool: ({ caller }: { caller: string; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a close_pool transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ close_pool: ({ caller }: { caller: string; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a close_epoch transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ close_epoch: (options?: MethodOptions) => Promise>; /** * Construct and simulate a withdraw_protocol_fees transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ withdraw_protocol_fees: ({ amount }: { amount: u128; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a withdraw_pool_owner_fees transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ withdraw_pool_owner_fees: ({ amount }: { amount: u128; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a withdraw_ea_fees transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ withdraw_ea_fees: ({ caller, amount }: { caller: string; amount: u128; }, options?: MethodOptions) => Promise>; /** * Construct and simulate a upgrade transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ upgrade: ({ new_wasm_hash }: { new_wasm_hash: Buffer; }, options?: MethodOptions) => Promise>; } export declare class Client extends ContractClient { readonly options: ContractClientOptions; static deploy( /** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */ options: MethodOptions & Omit & { /** The hash of the Wasm blob, which must already be installed on-chain. */ wasmHash: Buffer | string; /** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */ salt?: Buffer | Uint8Array; /** The format used to decode `wasmHash`, if it's provided as a string. */ format?: "hex" | "base64"; }): Promise>; constructor(options: ContractClientOptions); readonly fromJSON: { initialize: (json: string) => AssembledTransaction; set_huma_config: (json: string) => AssembledTransaction; set_contract_addrs: (json: string) => AssembledTransaction; set_storage_contract_addrs: (json: string) => AssembledTransaction; set_pool_name: (json: string) => AssembledTransaction; set_pool_owner: (json: string) => AssembledTransaction; set_pool_owner_treasury: (json: string) => AssembledTransaction; set_evaluation_agent: (json: string) => AssembledTransaction; set_tranche_addresses: (json: string) => AssembledTransaction; set_admin_rnr: (json: string) => AssembledTransaction; set_pool_settings: (json: string) => AssembledTransaction; set_lp_config: (json: string) => AssembledTransaction; set_fee_structure: (json: string) => AssembledTransaction; set_tranches_policy_type: (json: string) => AssembledTransaction; add_pool_operator: (json: string) => AssembledTransaction; remove_pool_operator: (json: string) => AssembledTransaction; enable_pool: (json: string) => AssembledTransaction; disable_pool: (json: string) => AssembledTransaction; close_pool: (json: string) => AssembledTransaction; close_epoch: (json: string) => AssembledTransaction; withdraw_protocol_fees: (json: string) => AssembledTransaction; withdraw_pool_owner_fees: (json: string) => AssembledTransaction; withdraw_ea_fees: (json: string) => AssembledTransaction; upgrade: (json: string) => AssembledTransaction; }; }