Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 136 additions & 0 deletions packages/types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,10 @@ export enum ArchiveRecordType {
export interface Client {
/**
* Construct and simulate a ping 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.
<<<<<<< HEAD
* Heartbeat: records the current ledger timestamp as the admin's last
* sign of life, restarting the dead man's switch claim clock.
=======
* Routes a payment from a sender to a recipient, deducting a platform fee.
*
* # Parameters
Expand All @@ -562,6 +566,7 @@ export interface Client {
* - `token_address`: Contract ID of the token being transferred.
* - `amount`: Amount to route, in the token's smallest unit. Must be
* positive and within the configured min/max and daily-limit bounds.
>>>>>>> origin/main
*
* This is the primary way for the admin to reset the timer without
* changing any contract state. Routing a payment also bumps the
Expand Down Expand Up @@ -1601,6 +1606,16 @@ export interface Client {
add_supported_token: ({_token}: {_token: string}, options?: MethodOptions) => Promise<AssembledTransaction<Result<void>>>

/**
<<<<<<< HEAD
* Construct and simulate a remove_backup_admin 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.
* Disables the dead man's switch, removing the backup admin and its
* claim window. The inactivity timeout is left in storage untouched so
* a later re-arming (via timelock) can reuse it.
*
* Admin authorization is required.
*/
remove_backup_admin: (options?: MethodOptions) => Promise<AssembledTransaction<Result<void>>>
=======
* Construct and simulate a commit_archive_root 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.
* Commits a SHA-256 Merkle root of a batch of payment-record snapshots
* into persistent storage, opening a new archive epoch.
Expand Down Expand Up @@ -1673,6 +1688,7 @@ export interface Client {
* Panics if the current admin does not authorize the call.
*/
set_multisig_config: ({signers, threshold}: {signers: Array<string>, threshold: u32}, options?: MethodOptions) => Promise<AssembledTransaction<Result<void>>>
>>>>>>> origin/main

/**
* Construct and simulate a unblacklist_address 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.
Expand Down Expand Up @@ -1837,6 +1853,112 @@ export interface Client {
set_platform_treasury: ({new_treasury}: {new_treasury: string}, options?: MethodOptions) => Promise<AssembledTransaction<Result<void>>>

/**
<<<<<<< HEAD
* Construct and simulate a get_rate_limit_remaining 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.
* Returns how many more payment invocations `sender` can make in the
* current ledger under the active cap.
*
* # Parameters
* - `sender`: Address whose remaining allowance to compute.
*
* # Returns
* Remaining invocations in the current ledger window, saturating at 0
* once the cap is reached. Whitelisted senders (and a disabled limiter)
* report `u32::MAX`.
*
* # Panics
* Does not panic.
*/
get_rate_limit_remaining: ({sender}: {sender: string}, options?: MethodOptions) => Promise<AssembledTransaction<u32>>

/**
* Construct and simulate a set_rate_limit_whitelist 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.
* Whitelists an address, exempting it from the per-ledger invocation cap
* so legitimate high-volume senders are never throttled. Admin-only.
*
* # Parameters
* - `address`: Sender to exempt from rate limiting.
*
* # Returns
* `Ok(())` on success, or `Err(Error::NotInitialized)` if the contract
* has no admin set yet.
*
* # Panics
* Panics if the current admin does not authorize the call.
*/
set_rate_limit_whitelist: ({address}: {address: string}, options?: MethodOptions) => Promise<AssembledTransaction<Result<void>>>

/**
* Construct and simulate a is_rate_limit_whitelisted 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.
* Returns whether an address is exempt from the rate limiter.
*
* # Parameters
* - `address`: Address to check.
*
* # Returns
* `true` if the address is on the rate-limit whitelist.
*
* # Panics
* Does not panic.
*/
is_rate_limit_whitelisted: ({address}: {address: string}, options?: MethodOptions) => Promise<AssembledTransaction<boolean>>

/**
* Construct and simulate a set_backup_admin_internal 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.
* Configures the dead man's switch: nominates `backup` as the recovery
* address and sets the inactivity `timeout_seconds` after which the
* backup may claim admin rights.
*
* This is a sensitive administrative change and therefore goes through
* the timelock: call `queue_action` with
* `ActionType::SetBackupAdmin { backup, timeout_seconds }` and execute
* after the 24-hour delay. The claim itself is NOT timelocked — if the
* admin is gone, nobody would be left to execute a queued claim.
*
* # Parameters
* - `backup`: Address allowed to claim admin rights after the timeout.
* - `timeout_seconds`: Inactivity window in seconds. Must be at least
* `MIN_DMS_TIMEOUT` (7 days).
*
* # Returns
* `Ok(())` on success, or `Err(Error::NotInitialized)` if the contract
* has no admin set yet, or `Err(Error::InvalidDmsConfig)` if
* `timeout_seconds` is below the minimum or `backup` equals the
* current admin.
*
* # Panics
* Panics if the current admin does not authorize the call.
*/
set_backup_admin_internal: ({backup, timeout_seconds}: {backup: string, timeout_seconds: u64}, options?: MethodOptions) => Promise<AssembledTransaction<Result<void>>>

/**
* Construct and simulate a is_dead_mans_switch_expired 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.
* Returns `true` if the dead man's switch is armed (a backup admin is
* configured) and the timeout has elapsed, i.e. `claim_admin` would
* currently succeed for the backup.
*
* # Panics
* Does not panic.
*/
is_dead_mans_switch_expired: (options?: MethodOptions) => Promise<AssembledTransaction<boolean>>

/**
* Construct and simulate a remove_rate_limit_whitelist 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.
* Removes an address from the rate-limit whitelist, restoring the
* standard per-ledger cap for it. Admin-only.
*
* # Parameters
* - `address`: Sender to remove from the whitelist.
*
* # Returns
* `Ok(())` on success, or `Err(Error::NotInitialized)` if the contract
* has no admin set yet.
*
* # Panics
* Panics if the current admin does not authorize the call.
*/
remove_rate_limit_whitelist: ({address}: {address: string}, options?: MethodOptions) => Promise<AssembledTransaction<Result<void>>>
=======
* Construct and simulate a prune_archived_entries 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.
* Deletes on-chain ledger entries committed via `commit_archive_root`.
*
Expand Down Expand Up @@ -1954,6 +2076,7 @@ export interface Client {
* or if `swap_result.get(0)` or `swap_result.get(1)` returns `None`.
*/
route_payment_with_swap_raw: ({sender, recipient, dex_router, token_in, token_out, amount_in, path, min_amount_out}: {sender: string, recipient: string, dex_router: string, token_in: string, token_out: string, amount_in: i128, path: Array<string>, min_amount_out: i128}, options?: MethodOptions) => Promise<AssembledTransaction<Result<void>>>
>>>>>>> origin/main

}
export class Client extends ContractClient {
Expand Down Expand Up @@ -2142,10 +2265,14 @@ export class Client extends ContractClient {
set_fallback_price: this.txFromJSON<Result<void>>,
set_yield_protocol: this.txFromJSON<Result<void>>,
add_supported_token: this.txFromJSON<Result<void>>,
<<<<<<< HEAD
remove_backup_admin: this.txFromJSON<Result<void>>,
=======
commit_archive_root: this.txFromJSON<Result<u64>>,
get_multisig_config: this.txFromJSON<Result<MultisigConfig>>,
migrate_user_record: this.txFromJSON<boolean>,
set_multisig_config: this.txFromJSON<Result<void>>,
>>>>>>> origin/main
unblacklist_address: this.txFromJSON<Result<void>>,
withdraw_from_yield: this.txFromJSON<Result<void>>,
configure_governance: this.txFromJSON<Result<void>>,
Expand All @@ -2157,11 +2284,20 @@ export class Client extends ContractClient {
is_upgrade_authorized: this.txFromJSON<Result<boolean>>,
set_fee_config_legacy: this.txFromJSON<Result<void>>,
set_platform_treasury: this.txFromJSON<Result<void>>,
<<<<<<< HEAD
get_rate_limit_remaining: this.txFromJSON<u32>,
set_rate_limit_whitelist: this.txFromJSON<Result<void>>,
is_rate_limit_whitelisted: this.txFromJSON<boolean>,
set_backup_admin_internal: this.txFromJSON<Result<void>>,
is_dead_mans_switch_expired: this.txFromJSON<boolean>,
remove_rate_limit_whitelist: this.txFromJSON<Result<void>>
=======
prune_archived_entries: this.txFromJSON<Result<u32>>,
revoke_upgrade_approval: this.txFromJSON<Result<void>>,
route_payment_with_swap: this.txFromJSON<Result<i128>>,
set_staleness_threshold: this.txFromJSON<Result<void>>,
route_payments_with_swap: this.txFromJSON<Result<i128>>,
route_payment_with_swap_raw: this.txFromJSON<Result<void>>
>>>>>>> origin/main
}
}
Loading
Loading