diff --git a/contracts/vault_router/src/error.rs b/contracts/vault_router/src/error.rs new file mode 100644 index 0000000..4dafe71 --- /dev/null +++ b/contracts/vault_router/src/error.rs @@ -0,0 +1,11 @@ +#![allow(unused)] +use soroban_sdk::contracterror; + +#[contracterror] +#[derive(Copy, Clone, Debug, Eq, PartialEq)] +#[repr(u32)] +pub enum VaultError { + InvalidTier = 1, + BelowMinDeposit = 2, + LockNotExpired = 3, +} \ No newline at end of file diff --git a/sdks/typescript/src/errors.ts b/sdks/typescript/src/errors.ts new file mode 100644 index 0000000..741f4ce --- /dev/null +++ b/sdks/typescript/src/errors.ts @@ -0,0 +1,14 @@ +export class YieldLadderError extends Error { + constructor(message: string) { + super(message); + this.name = 'YieldLadderError'; + } +} + +export class LockNotExpiredError extends YieldLadderError { + constructor() { super('Lock period has not expired yet'); this.name = 'LockNotExpiredError'; } +} + +export class BelowMinDepositError extends YieldLadderError { + constructor() { super('Amount is below the minimum deposit'); this.name = 'BelowMinDepositError'; } +} \ No newline at end of file