Andromeda
ADO LibraryBuild AppsDevelop ADOsCLIWeb Application Docs
Andromeda Beta ADOs
Andromeda Beta ADOs
  • Platform and Framework
    • Introduction to AndromedaOS
    • ADO Classes
    • Andromeda Messaging Protocol
      • Kernel
      • ADO Database
      • Economics Engine
      • Virtual File System
    • ADO Base
      • AndromedaMsg
      • AndromedaQuery
    • Common Types
    • Deployed Contracts
  • Andromeda Digital Objects
    • Introduction to ADOs
    • Address List
    • Auction
    • App
    • Conditional Splitter
    • Crowdfund
    • Curve
    • CW20
    • CW20 Staking
    • CW721
    • CW20 Exchange
    • Graph
    • Lockdrop
    • Marketplace
    • Merkle-Airdrop
    • Point
    • Primitive
    • Rates
    • Rate Limiting Withdrawals
    • Fixed Amount Splitter
    • Splitter
    • Timelock
    • Validator Staking
    • Vesting
    • Weighted Distribution Splitter
  • Andromeda Apps
    • Introduction to Apps
    • Crowdfunding App
    • Auctioning App
    • Cw20 Staking App
    • Marketplace App
  • Developing an ADO
    • Getting Started
      • Instantiation
      • Execution
      • Queries
      • Testing
    • ADO Example
    • ADO Submissions
  • Andromeda CLI
    • Introduction
    • Help and Shortcuts
    • ADO
    • Bank
    • Chain
    • Gql
    • Tx
    • OS
    • Wallet
    • Wasm
    • Clearing CLI Data
    • Clear and Exit
  • Chain
    • Running a Node
    • Staking and Rewards
  • Andromeda Dashboard
    • Tokenomics Dashboard
    • Dashboard API
  • Andromeda Changelog
    • Newest Releases
  • Additional Resources
    • GitHub
    • Website
    • White Paper
Powered by GitBook

Additional Resources

  • Github
  • Website

Community

  • Discord
  • Telegram

Socials

  • Twitter
  • Medium
  • Youtube
On this page
  • Introduction
  • InstantiateMsg
  • ExecuteMsg
  • Deposits
  • WithdrawFunds
  • Base Executes
  • QueryMsg
  • CoinAllowanceDetails
  • AccountDetails
  • Base Queries

Was this helpful?

  1. Andromeda Digital Objects

Rate Limiting Withdrawals

Introduction

The Rate Limiting Withdrawals ADO acts as a bank account that limits the frequency and size of an account holder's withdrawals. Only one type of coin can be used.

Ado_type: rate-limiting-withdrawals

Version: 2.1.0-beta.1

InstantiateMsg

pub struct InstantiateMsg {
    pub allowed_coin: CoinAndLimit,
    pub minimal_withdrawal_frequency: MinimumFrequency,
    pub kernel_address: String,
    pub owner: Option<String>,
}
{
"allowed_coin":{
    "coin":"uandr",
    "limit":"500"
    },
"minimal_withdrawal_frequency":{
    "time":{
        "time":3600000
        }
    },
"kernel_address":"andr1...",
"owner":"andr1..."
}
Name
Type
Description

allowed_coin

Set the allowed coin denom and the maximum amount allowed to withdraw.

minimal_withdrawal_frequency

The time required between withdrawals. Specified in milliseconds. Cannot be 0.

kernel_address

String

owner

Option<String>

Optional address to specify as the owner of the ADO being created. Defaults to the sender if not specified.

CoinAndLimit

pub struct CoinAndLimit {
    pub coin: String,
    pub limit: Uint128,
}
Name
Type
Description

coin

String

Sets the accepted coin denom.

limit

Uint128

Sets the withdrawal limit in terms of amount.

MinimumFrequency

pub enum MinimumFrequency {
     Time { time: MillisecondsDuration },
     }
  • Time: A time in milliseconds. For example 3600 would specify that each the user needs to wait 3600 milliseconds between withdrawals.

ExecuteMsg

Deposits

Deposit funds for the specified recipient.

Only the allowed coin in instantiation can be deposited.

pub enum ExecuteMsg {
    Deposits {
        recipient: Option<String>,
    }
}
{
"deposits":{
    "recipient":"andr1..."
    }
}
Name
Type
Description

recipient

Option<String>

The owner of the deposited funds. If not set, defaults to the sender.

WithdrawFunds

Withdraw funds from the available balance.

Enough time should pass since the last withdrawal.

pub enum ExecuteMsg{
     WithdrawFunds {
        amount: Uint128,
    }
}
{
"withdraw_funds":{
    "amount":"100"
    }
}
Name
Type
Description

amount

Uint128

The amount of coins to withdraw.

Base Executes

QueryMsg

CoinAllowanceDetails

Provides the allowed coin and limits for withdrawal size and frequency.

pub enum QueryMsg{
    #[returns(CoinAllowance)]
    CoinAllowanceDetails {}
    }
{
"coin_allowance_details":{}
}

CoinAllowance

Returns a CoinAllowance struct.

pub struct CoinAllowance {
    pub coin: String,
    pub limit: Uint128,
    pub minimal_withdrawal_frequency: MillisecondsDuration,
}
{
"coin":"uandr",
"limit":"50000",
"minimal_withdrawal_frequency": 3600000
}
Name
Type
Description

coin

string

The coin denom.

limit

Uint128

The amount allowed to withdraw per withdrawal.

minimal_withdrawal_frequency

The time required between withdrawals. Specified in milliseconds.

AccountDetails

Shows the balance and latest withdrawal time.

pub enum QueryMsg{
     #[returns(AccountDetails)]
     AccountDetails {
        account: String,
    }
}
{
"account_details":{
    "account":"andr1..."
    }
}
Name
Type
Description

account

String

The address to check the account for.

AccountDetails

Returns an AccountDetails struct.

pub struct AccountDetails {
    pub balance: Uint128,
    pub latest_withdrawal: Option<Timestamp>,
}
{
"balance":"100000",
"latest_withdrawal":"1658744585559151746"
}
Name
Type
Description

balance

Uint128

The balance of the specified address.

latest_withdrawal

Option<Timestamp>

The time of the last withdrawal of the specified address.

Base Queries

PreviousRatesNextFixed Amount Splitter

Last updated 2 months ago

Was this helpful?

Contract address of the to be used for messaging. Kernel contract address can be found in our .

The rest of the execute messages can be found in the section.

The rest of the query messages can be found in the section.

ADO Base
ADO Base
kernel contract
AMP
deployed contracts
CoinAndLimit
MinimumFrequency
MillisecondsDuration