Newcoin.org
Search…
πŸͺ£
Stake pools tooling
Leverage the stake pool libraries to create pools, stake withdraw and whitelist users.
​

How to create a pool?

pnco
ncojs
​
1
cleos -u http://testnet.newcoin.org push transaction '{
2
"delay_sec": 0,
3
"max_cpu_usage_ms": 0,
4
"actions": [
5
{
6
"account": "pools.nco",
7
"name": "createpool",
8
"data": {
9
"owner": "alice",
10
"description": "some description",
11
},
12
"authorization": [
13
{
14
"actor": "alice",
15
"permission": "active"
16
}
17
]
18
}
19
]
20
}'
Copied!
1
const result = await api.transact({
2
actions: [{
3
account: 'pools.nco',
4
name: 'createpool',
5
authorization: [{
6
actor: 'alice',
7
permission: 'active',
8
}],
9
data: {
10
owner: 'alice',
11
description: 'some description'
12
},
13
}]
14
}, {
15
blocksBehind: 3,
16
expireSeconds: 30,
17
});
Copied!

How to stake to pool?

pnco
ncojs
​
1
cleos -u http://testnet.newcoin.org push transaction '{
2
"delay_sec": 0,
3
"max_cpu_usage_ms": 0,
4
"actions": [
5
{
6
"account": "token.nco",
7
"name": "transfer",
8
"data": {
9
"from": "alice",
10
"to": "pools.nco",
11
"quantity": "10000.0000 NCO",
12
"memo": "pool:1"
13
},
14
"authorization": [
15
{
16
"actor": "alice",
17
"permission": "active"
18
}
19
]
20
}
21
]
22
}'
Copied!
​
1
const result = await api.transact({
2
actions: [{
3
account: 'token.nco',
4
name: 'transfer',
5
authorization: [{
6
actor: 'alice',
7
permission: 'active',
8
}],
9
data: {
10
from: 'alice',
11
to: 'pools.nco',
12
quantity: '10000.0000 NCO',
13
memo: 'pool:1'
14
},
15
}]
16
}, {
17
blocksBehind: 3,
18
expireSeconds: 30,
19
});
Copied!

How to withdraw from pool?

pnco
ncojs
​
1
cleos -u http://testnet.newcoin.org push transaction '{
2
"delay_sec": 0,
3
"max_cpu_usage_ms": 0,
4
"actions": [
5
{
6
"account": "pools.nco",
7
"name": "withdraw",
8
"data": {
9
"owner": "alice",
10
"quantity": "100000 CA"
11
},
12
"authorization": [
13
{
14
"actor": "alice",
15
"permission": "active"
16
}
17
]
18
}
19
]
20
}'
Copied!
1
const result = await api.transact({
2
actions: [{
3
account: 'pools.nco',
4
name: 'withdraw',
5
authorization: [{
6
actor: 'alice',
7
permission: 'active',
8
}],
9
data: {
10
owner: 'alice',
11
quantity: '100000 CA'
12
},
13
}]
14
}, {
15
blocksBehind: 3,
16
expireSeconds: 30,
17
});
Copied!

How to add user to white list?

pnco
1
cleos -u http://testnet.newcoin.org push transaction '{
2
"delay_sec": 0,
3
"max_cpu_usage_ms": 0,
4
"actions": [
5
{
6
"account": "pools.nco",
7
"name": "addwhlst",
8
"data": {
9
"id": "1",
10
"user": "alice"
11
},
12
"authorization": [
13
{
14
"actor": "alice",
15
"permission": "active"
16
}
17
]
18
}
19
]
20
}'
Copied!
Last modified 25d ago