Open TrevorJTClarke opened 2 years ago
get_info
get_config
get_delegations
deposit_and_stake
get_staked_balance
unstake
withdraw
yield_harvest
liquid_unstake
meta-v2.pool.testnet
Examples:
# add/remove staking pools near call $TREASURY_ACCOUNT_ID add_staking_pool '{"pool_account_id": "node0"}' --accountId $TREASURY_ACCOUNT_ID --gas $MAX_GAS near call $TREASURY_ACCOUNT_ID add_staking_pool '{"pool_account_id": "meta-v2.pool.testnet", "liquid_unstake_function": "liquid_unstake", "yield_function": "harvest_meta", "withdraw_function": "withdraw_all"}' --accountId $TREASURY_ACCOUNT_ID --gas $MAX_GAS near call $TREASURY_ACCOUNT_ID add_staking_pool '{"pool_account_id": "hotones.pool.f863973.m0"}' --accountId $TREASURY_ACCOUNT_ID --gas $MAX_GAS near call $TREASURY_ACCOUNT_ID remove_staking_pool '{"pool_account_id": "hotones.pool.f863973.m0"}' --accountId $TREASURY_ACCOUNT_ID --gas $MAX_GAS near view $TREASURY_ACCOUNT_ID get_delegations near view $TREASURY_ACCOUNT_ID get_config near view $TREASURY_ACCOUNT_ID get_info # deposit&stake near call $TREASURY_ACCOUNT_ID deposit_and_stake '{"pool_account_id": "meta-v2.pool.testnet"}' --accountId $TREASURY_ACCOUNT_ID --amount 10 near call $TREASURY_ACCOUNT_ID deposit_and_stake '{"pool_account_id": "hotones.pool.f863973.m0"}' --accountId $TREASURY_ACCOUNT_ID --amount 10 --gas $MAX_GAS near call $TREASURY_ACCOUNT_ID deposit_and_stake '{"pool_account_id": "hotones.pool.f863973.m0", "amount": "100000000000000000000000000"}' --accountId $TREASURY_ACCOUNT_ID --gas $MAX_GAS # # update internal balance near call $TREASURY_ACCOUNT_ID get_staked_balance '{"pool_account_id": "meta-v2.pool.testnet"}' --accountId $TREASURY_ACCOUNT_ID --gas $MAX_GAS near call $TREASURY_ACCOUNT_ID get_staked_balance '{"pool_account_id": "hotones.pool.f863973.m0"}' --accountId $TREASURY_ACCOUNT_ID --gas $MAX_GAS near view $TREASURY_ACCOUNT_ID get_delegations # liquidunstake near call $TREASURY_ACCOUNT_ID liquid_unstake '{"pool_account_id": "meta-v2.pool.testnet", "amount": "5000000000000000000000000"}' --accountId $TREASURY_ACCOUNT_ID --gas $MAX_GAS near call $TREASURY_ACCOUNT_ID liquid_unstake '{"pool_account_id": "meta-v2.pool.testnet"}' --accountId $TREASURY_ACCOUNT_ID --gas $MAX_GAS # unstake near call $TREASURY_ACCOUNT_ID unstake '{"pool_account_id": "meta-v2.pool.testnet"}' --accountId $TREASURY_ACCOUNT_ID --gas $MAX_GAS near call $TREASURY_ACCOUNT_ID unstake '{"pool_account_id": "hotones.pool.f863973.m0", "amount": "5000000000000000000000000"}' --accountId $TREASURY_ACCOUNT_ID --gas $MAX_GAS # withdraw near call $TREASURY_ACCOUNT_ID withdraw '{"pool_account_id": "meta-v2.pool.testnet"}' --accountId $TREASURY_ACCOUNT_ID --gas $MAX_GAS # withdraw near call $TREASURY_ACCOUNT_ID yield_harvest '{"pool_account_id": "meta-v2.pool.testnet"}' --accountId $TREASURY_ACCOUNT_ID --gas $MAX_GAS
Unit Tests
get_info
,get_config
,get_delegations
deposit_and_stake
, confirm it works for both attached deposit, and optional amountget_staked_balance
validate balance matches the deposited amount (requires deposit_and_stake to be called first)unstake
, validate this works AND if croncat is specified - withdraw task was createdwithdraw
can be called and works as expectedyield_harvest
can be called and works as expected for supported poolliquid_unstake
works for supported pools and returns valid amount based on optional amount OR returns valid amount for unstaking allWorkspace Tests
meta-v2.pool.testnet
deposit_and_stake
with attached amountget_delegations
and verify stake amountliquid_unstake
and specify 1/4 amount stakedget_staked_balance
to update internal valuesget_delegations
and verify stake + unstake amountsunstake
and specify 1/2 amount staked, validate auto withdraw is setupdeposit_and_stake
with internal amountget_staked_balance
to update internal valuesget_delegations
and verify stake + unstake amountsunstake
and specify 1/2 amount staked, validate auto withdraw is setupmeta-v2.pool.testnet
deposit_and_stake
with attached amountyield_harvest
on the pool contractExamples: