NRC-22 MainPool
MainPool contract swaps $NCO for Governance NCO with a ticker $GNCO, locks $NCO and distributes fees automatically according to the stake fee distribution structure. $GNCO tokens are minted after the lock and are burned when $NCO is unlocked and recovered by the owner.
MainPool Actions
All MainPool actions can be found in the Newcoin-SDK
Staking
Stake to the MainPool
const nco = new NCO_BlockchainAPI(
NCO_BlockchainAPI.defaults.devnet_urls, NCO_BlockchainAPI.defaults.devnet_services
);
nco.stakeMainDAO({
amt: "10.0000 NCO" //string;
payer: "satoshi.io" //string;
payer_prv_key: "<private key>" //string;
}).then((res) => {
console.log("Transaction ID: " + res.TxID_stakeMainDAO)
}).catch((error) => console.log("Error: "+error))
Requires: private key, Errors: auth, negative amt
Requires: Authorization from Account
Errors:
- "Error: Invalid checksum ...": Authentication Error - probably that payer & Payer private key do not match
- "Error: transaction declares authority ...": Authentication Error - seems the payer and private key do not match.
- "do_stake : amount in should be positive": the amount in amt should be positive
- "Error: Expected symbol to be A-Z and between one and seven characters": the amt needs to be in the Format "#.#### NCO"
Unstake instantly from the MainPool
const nco = new NCO_BlockchainAPI(
NCO_BlockchainAPI.defaults.devnet_urls, NCO_BlockchainAPI.defaults.devnet_services
);
nco.instUnstakeMainDAO({
amt: "10.0000 NCO" //string;
payer: "satoshi.io" //string;
payer_prv_key: "<private key>" //string;
}).then((res) => {
console.log("Transaction ID: " + res?.TxID_unstakeMainDAO)
}).catch((error) => console.log("Error: "+error))
Requires: private key, Errors: auth, negative amt
Requires: Authorization from Account
Errors:
- "Error: Invalid checksum ...": Authentication Error - probably that payer & Payer private key do not match
- "Error: transaction declares authority ...": Authentication Error - seems the payer and private key do not match.
- "do_stake : amount in should be positive": the amount in amt should be positive
- "Error: Expected symbol to be A-Z and between one and seven characters": the amt needs to be in the Format "#.#### GNCO"
Delayed unstake from the MainPool
const nco = new NCO_BlockchainAPI(
NCO_BlockchainAPI.defaults.devnet_urls, NCO_BlockchainAPI.defaults.devnet_services
);
nco.dldUnstakeMainDAO({
amt: "10.0000 NCO" //string;
payer: "satoshi.io" //string;
payer_prv_key: "<private key>" //string;
}).then((res) => {
console.log("Transaction ID: " + res?.TxID_unstakeMainDAO)
}).catch((error) => console.log("Error: "+error))
Requires: private key, Errors: auth, negative amt
Requires: Authorization from Account
Errors:
- "Error: Invalid checksum ...": Authentication Error - probably that payer & Payer private key do not match
- "Error: transaction declares authority ...": Authentication Error - seems the payer and private key do not match.
- "do_stake : amount in should be positive": the amount in amt should be positive
- "Error: Expected symbol to be A-Z and between one and seven characters": the amt needs to be in the Format "#.#### GNCO"
Redeem a delayed unstake from the MainPool
function redeem (from, id){
TBD
}
Requires: Account, Errors: ?
Requires: Authorization from Account Errors: