token - UCHAIN-WORLD/uchain-fullnode GitHub Wiki
title: token
-
create tokencreatetoken
- Parameters (named)
-d
or[--description]
The token data chuck, defaults to empty string.-i
or[--issuer]
Issue must be specified as a UID symbol.-n
or[--decimalnumber]
The token amount decimal number, defaults to 0.-r
or[--rate]
The percent threshold value when you secondary issue. 0, not allowed to secondary issue; -1, the token can be secondary issue freely; [1, 100], the token can be secondary issue when own percentage greater than or equal to this value. Defaults to 0.-s
or[--symbol]
The token symbol, global uniqueness, only supports UPPER-CASE alphabet and dot(.), eg: -.LAPTOP, dot separates prefix '-', It's impossible to create any token named with '-' prefix, but this issuer.-v
or[--volume]
The token maximum supply volume, with unit of integer bits.
- Parameters (positional)
WALLET_NAME
Wallet name.WALLET_AUTH
Wallet password/authorization.
- Example
$ uc-cli createtoken -i [email protected] -s bala -v 10000 yang 123456 { "address" : "", "decimal_number" : 0, "description" : "", "is_secondaryissue" : false, "issuer" : "[email protected]", "maximum_supply" : 10000, "secondaryissue_threshold" : 0, "status" : "unissued", "symbol" : "BALA" }
-
deletetoken
create token
- Parameters (named)
-s
or[--symbol]
The token symbol/name. Global unique.
- Parameters (positional)
WALLET_NAME
Wallet name.WALLET_AUTH
Wallet password/authorization.
- Example
$ uc-cli deletetoken -s bala yang 123456 { "status" : "deleted successfully", "symbol" : "BALA" }
-
registertoken
Broadcast the token whole network.
- Parameters (named)
-f
or[--fee]
Transaction fee. defaults to 10000 UCN bits.-m
or[--model]
The token offering model by block height. TYPE=1 - fixed quantity model; TYPE=2 - specify parameters; LQ - Locked Quantity each period; LP - Locked Period, numeber of how many blocks; UN - Unlock Number, number of how many LPs; eg: TYPE=1;LQ=9000;LP=60000;UN=3 TYPE=2;LQ=9000;LP=60000;UN=3;UC=20000,20000,20000;UQ=3000,3000,3000 defaults to disable.-p
or[--percentage]
Percentage of fee send to miner. minimum is 20.
- Parameters (positional)
WALLET_NAME
Wallet name.WALLET_AUTH
Wallet password/authorization.SYMBOL
The token symbol, global uniqueness, only supports UPPER-CASE alphabet and dot(.)
- Example
$ uc-cli registertoken yang 123456 BALA { "hash" : "19bc96f1e5ce3b69d0d97542ce4a355daafa186e75ab2749d04d7b5bd8e3b714", "inputs" : [ { "address" : "UkRYvsnfJkwSTAUCcZnqCK8sE1ZYJP6so7", "previous_output" : { "hash" : "32bca25c8c3b69fae98d25d6570b5f6671e01a9806f3bbb3f7e3ea9823d46b40", "index" : 1 }, "script" : "[ 3045022100a7f4b8558b32e00cdac92c4bf380aa4852965be363e4f7e17543677ee6d45d3902203bd3c252a18de9f8f43b4546f6f580b5ea1c00738d4a27eaf837eed02a14866401 ] [ 0386e78227d2e2a80e5d99a727a48b67501ea87223634544a38ae1c1720e59167d ]", "sequence" : 4294967295 }, { "address" : "UNfrtAxhJRi83PjTPjV3yNPKnjLYR22Bhx", "previous_output" : { "hash" : "addc571765ee76b32eacf1c8e412b6e0eba1f302bcb16974bcadf250a547916b", "index" : 2 }, "script" : "[ 30450221009fbf933b50c170286deb470da86c51bf7a9084a3035e68f7a20cc2eceac1622502203ee3ed41a915ab3c77645aabecdf3de21dacb136b0c701899469cd34bcdc244001 ] [ 027c99068f735e53064682b9ef1f548a00191b5ffb2fd9b9c8f32cde97793a0ed4 ]", "sequence" : 4294967295 } ], "lock_time" : "0", "outputs" : [ { "address" : "UNfrtAxhJRi83PjTPjV3yNPKnjLYR22Bhx", "asset" : { "address" : "UNfrtAxhJRi83PjTPjV3yNPKnjLYR22Bhx", "decimal_number" : 0, "description" : "", "is_secondaryissue" : false, "issuer" : "[email protected]", "quantity" : 10000, "secondaryissue_threshold" : 0, "symbol" : "BALA", "to_uid" : "[email protected]", "type" : "token-issue" }, "index" : 0, "locked_height_range" : 0, "script" : "dup hash160 [ 078910a58cea508623e2be9b38beb6e7d576e880 ] equalverify checksig", "value" : 0 }, { "address" : "UNfrtAxhJRi83PjTPjV3yNPKnjLYR22Bhx", "asset" : { "address" : "UNfrtAxhJRi83PjTPjV3yNPKnjLYR22Bhx", "cert" : "domain", "owner" : "[email protected]", "symbol" : "BALA", "to_uid" : "[email protected]", "type" : "token-cert" }, "index" : 1, "locked_height_range" : 0, "script" : "dup hash160 [ 078910a58cea508623e2be9b38beb6e7d576e880 ] equalverify checksig", "value" : 0 }, { "address" : "UNKAn2fsG5CPeP4s9mxTvJKSjmqqdwu3Tq", "asset" : { "type" : "ucn" }, "index" : 2, "locked_height_range" : 0, "script" : "dup hash160 [ 039f445e123efa6e43a55fbb274e631646875a6a ] equalverify checksig", "value" : 800000000000 }, { "address" : "UNfrtAxhJRi83PjTPjV3yNPKnjLYR22Bhx", "asset" : { "type" : "ucn" }, "index" : 3, "locked_height_range" : 0, "script" : "dup hash160 [ 078910a58cea508623e2be9b38beb6e7d576e880 ] equalverify checksig", "value" : 80999017999200000 } ], "version" : "4" }
-
sendtokento
send token to someone.
- Parameters (named)
-c
or[--change]
Change to this uid/address.-f
or[--fee]
Transaction fee. defaults to 10000 UCN bits.-i
or[--memo]
Attached memo for this transaction.-m
or[--model]
The token offering model by block height. TYPE=1 - fixed quantity model; TYPE=2 - specify parameters; LQ - Locked Quantity each period; LP - Locked Period, numeber of how many blocks; UN - Unlock Number, number of how many LPs; eg: TYPE=1;LQ=9000;LP=60000;UN=3 TYPE=2;LQ=9000;LP=60000;UN=3;UC=20000,20000,20000;UQ=3000,3000,3000 defaults to disable.
- Parameters (positional)
WALLET_NAME
Wallet name.WALLET_AUTH
Wallet password/authorization.TO_
Asset receiver uid/address.TOKEN
Asset token symbol.AMOUNT
Asset integer bits. see token <decimal_number>.
- Example
$ uc-cli sendtokento yang 123456 USa9SKiMHZ3TRcodvJi6oGVgS65iy47Hh4 BLOCK 100 { "hash" : "2a8e2a4132f2519da3d6bb26a3833c2f6f081b5ddb18247c781d585b821b90a8", "inputs" : [ { "address" : "UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq", "previous_output" : { "hash" : "d3708c58132c0627288bb4f94d7984b745b9cf00c00b7b8b92ab2792de7463c1", "index" : 0 }, "script" : "[ 30450221009343f4f9ebe0c860f625bec0ad4044f79dc426cfb35fb36a7a17952b7bcfd8d20220021d41f64122825f1d2c92eb08866d99a46246155ea1072741b0783db03c86fd01 ] [ 03bec77692da62f861065c04d09de5b217c14be033453a9235a1c67853cccf3ea9 ]", "sequence" : 4294967295 }, { "address" : "UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq", "previous_output" : { "hash" : "1d51c51c4b0ef79855b7aa0d79a8dfad2996b00c927a8ccc41d59e43c443c21f", "index" : 1 }, "script" : "[ 30440220371062c0adad7a2a2a2059786b7629116f53a14cb34e97760e519dfa8ae3e9ae02204113fb77fafd36d2be2ea4769604ec1acc34dfbb1686838ba282fa0a4346819001 ] [ 03bec77692da62f861065c04d09de5b217c14be033453a9235a1c67853cccf3ea9 ]", "sequence" : 4294967295 } ], "lock_time" : "0", "outputs" : [ { "address" : "USa9SKiMHZ3TRcodvJi6oGVgS65iy47Hh4", "asset" : { "quantity" : 100, "symbol" : "BLOCK", "type" : "token-transfer" }, "index" : 0, "locked_height_range" : 0, "script" : "dup hash160 [ 3254e428b11bf9c23a227c3148148fa868ff3e9d ] equalverify checksig", "value" : 0 }, { "address" : "UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq", "asset" : { "type" : "ucn" }, "index" : 1, "locked_height_range" : 0, "script" : "dup hash160 [ e65032659d90b0c770f649a385949001f6a4ddfd ] equalverify checksig", "value" : 81999979998929990 }, { "address" : "UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq", "asset" : { "quantity" : 7539, "symbol" : "BLOCK", "type" : "token-transfer" }, "index" : 2, "locked_height_range" : 0, "script" : "dup hash160 [ e65032659d90b0c770f649a385949001f6a4ddfd ] equalverify checksig", "value" : 0 } ], "version" : "4" }
-
sendtokenfrom
send token to someone from specific address.
- Parameters (named)
-c
or[--change]
Change to this uid/address.-f
or[--fee]
Transaction fee. defaults to 10000 UCN bits.-i
or[--memo]
Attached memo for this transaction.-m
or[--model]
The token offering model by block height. TYPE=1 - fixed quantity model; TYPE=2 - specify parameters; LQ - Locked Quantity each period; LP - Locked Period, numeber of how many blocks; UN - Unlock Number, number of how many LPs; eg: TYPE=1;LQ=9000;LP=60000;UN=3 TYPE=2;LQ=9000;LP=60000;UN=3;UC=20000,20000,20000;UQ=3000,3000,3000 defaults to disable.
- Parameters (positional)
WALLET_NAME
Wallet name.WALLET_AUTH
Wallet password/authorization.FROM_
From uid/addressTO_
Asset receiver uid/address.SYMBOL
Asset symbol.AMOUNT
Asset integer bits. see token <decimal_number>.
- Example
$ uc-cli sendtokenfrom yang 123456 UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq USa9SKiMHZ3TRcodvJi6oGVgS65iy47Hh4 BLOCK 100 { "hash" : "fbc32557334266bf5fcfcb9a02b06487923a6791477803d8c3b3a0b8ac39bc18", "inputs" : [ { "address" : "UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq", "previous_output" : { "hash" : "1362c7e68badbed8837d5ae6b9022c92df4ba50b06aae488582e0ca6475aad94", "index" : 1 }, "script" : "[ 304402202b831fdf179125a934822eb83aad0485e6cb038941f76fe9a089c5488a5ae67f0220603620b84ccf4877c070ab527e7a092084b9693f4b1716a58cd3580ffc272a7c01 ] [ 03bec77692da62f861065c04d09de5b217c14be033453a9235a1c67853cccf3ea9 ]", "sequence" : 4294967295 }, { "address" : "UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq", "previous_output" : { "hash" : "2a8e2a4132f2519da3d6bb26a3833c2f6f081b5ddb18247c781d585b821b90a8", "index" : 2 }, "script" : "[ 3044022056062d1b0f6e5ea0c4e3edee90aa82c34024932afb8b84928fc86d1078cd1bdf022048ba36074dfe682a572084cd8c8cc0544bc3f7b1d9f2481c7669e88f174c743e01 ] [ 03bec77692da62f861065c04d09de5b217c14be033453a9235a1c67853cccf3ea9 ]", "sequence" : 4294967295 } ], "lock_time" : "0", "outputs" : [ { "address" : "USa9SKiMHZ3TRcodvJi6oGVgS65iy47Hh4", "asset" : { "quantity" : 100, "symbol" : "BLOCK", "type" : "token-transfer" }, "index" : 0, "locked_height_range" : 0, "script" : "dup hash160 [ 3254e428b11bf9c23a227c3148148fa868ff3e9d ] equalverify checksig", "value" : 0 }, { "address" : "UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq", "asset" : { "type" : "ucn" }, "index" : 1, "locked_height_range" : 0, "script" : "dup hash160 [ e65032659d90b0c770f649a385949001f6a4ddfd ] equalverify checksig", "value" : 19999920000 }, { "address" : "UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq", "asset" : { "quantity" : 7439, "symbol" : "BLOCK", "type" : "token-transfer" }, "index" : 2, "locked_height_range" : 0, "script" : "dup hash160 [ e65032659d90b0c770f649a385949001f6a4ddfd ] equalverify checksig", "value" : 0 } ], "version" : "4" }
-
showtokens
list tokens details.
- Parameters (named)
-c
or[--cert]
If specified, then only get related cert. Default is not specified.
- Parameters (positional)
WALLET_NAME
Wallet name.WALLET_AUTH
Wallet password/authorization.
- Example
$ uc-cli showtokens yang 123456 [ { "decimal_number" : 1, "description" : "BLOCK token is issued by blackhole,just for name not to use", "issuer" : "BLACKHOLE", "locked_quantity" : 0, "quantity" : 70522, "secondaryissue_threshold" : 0, "status" : "unspent", "symbol" : "BLOCK" } ]
-
showtoken
Show existed tokens details from UC blockchain.
- Parameters (named)
-c
or[--cert]
If specified, then only get related cert. Default is not specified.
- Parameters (positional)
SYMBOL
Asset symbol. If not specified, will show whole network token symbols.
- Example
$ uc-cli showtoken BLOCK [ { "address" : "1111111111111111111114oLvT2", "decimal_number" : 1, "description" : "BLOCK token is issued by blackhole,just for name not to use", "is_secondaryissue" : false, "issuer" : "BLACKHOLE", "maximum_supply" : 1, "secondaryissue_threshold" : 0, "status" : "issued", "symbol" : "BLOCK" } ]
***
-
showwallettoken
show wallet token.
- Parameters (named)
-c
or[--cert]
If specified, then only get related cert. Default is not specified.-d
or[--deposited]
If specified, then only get deposited tokens. Default is not specified.
- Parameters (positional)
WALLET_NAME
Wallet name.WALLET_AUTH
Wallet password/authorization.SYMBOL
Asset symbol. If not specified, will show whole network token symbols.
- Example
$ uc-cli showwallettoken yang 123456 [ { "address" : "UXFQvGKWh8GzEtV1RNw2Vo1abnynPy58u1", "decimal_number" : 1, "description" : "BLOCK token is issued by blackhole,just for name not to use", "issuer" : "BLACKHOLE", "locked_quantity" : 0, "quantity" : 63022, "secondaryissue_threshold" : 0, "status" : "unspent", "symbol" : "BLOCK" }, { "address" : "UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq", "decimal_number" : 1, "description" : "BLOCK token is issued by blackhole,just for name not to use", "issuer" : "BLACKHOLE", "locked_quantity" : 0, "quantity" : 7500, "secondaryissue_threshold" : 0, "status" : "unspent", "symbol" : "BLOCK" } ]
-
showaddresstoken
show address token.
- Parameters (named)
-c
or[--cert]
If specified, then only get related cert. Default is not specified.-d
or[--deposited]
If specified, then only get deposited tokens. Default is not specified.-s
or[--symbol]
Asset symbol.
- Parameters (positional)
ADDRESS
address.
- Example
$ uc-cli showaddresstoken UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq [ { "address" : "UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq", "decimal_number" : 1, "description" : "BLOCK token is issued by blackhole,just for name not to use", "issuer" : "BLACKHOLE", "locked_quantity" : 0, "quantity" : 7500, "secondaryissue_threshold" : 0, "status" : "unspent", "symbol" : "BLOCK" } ]
***
-
destroy
destroy token to blackhole address 1111111111111111111114oLvT2.
- Parameters (named)
-c
or[--cert]
If specified, then only get related cert. Default is not specified.-m
or[--card]
If specified, then only destroy related card. Default is not specified.
- Parameters (positional)
WALLET_NAME
Wallet name required.WALLET_AUTH
Wallet password(authorization) required.SYMBOL
The token will be destroyed.AMOUNT
Asset integer bits. see token <decimal_number>.
- Example
$ uc-cli destroy yang 123456 BLOCK 10 { "hash" : "dbb975bee40b42aa742fb1c06f30dab8fdbb1c1188a60306bf65c21fb0fd79eb", "inputs" : [ { "address" : "UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq", "previous_output" : { "hash" : "131ce891d567498451d5b7446584f8813c1c907f9e531a85845d7a2d1893330d", "index" : 0 }, "script" : "[ 30450221008861cdb0cdd734e13796355f84e4bb85b329bd1aadaf4d1ef48473431a90fb0102203e05c8bb4e2ecaf09516c34ebe0efc9fd997e6aebe80a6aee4067af61129999801 ] [ 03bec77692da62f861065c04d09de5b217c14be033453a9235a1c67853cccf3ea9 ]", "sequence" : 4294967295 }, { "address" : "UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq", "previous_output" : { "hash" : "2a8e2a4132f2519da3d6bb26a3833c2f6f081b5ddb18247c781d585b821b90a8", "index" : 1 }, "script" : "[ 304402203d6a07eb628b2aabeb317580aecd1b2d67718664af47e12080fc21f88df30b4002200999755460aff18ab35028b13b4ecbfa87557b781d2e62bc606f983e5abd168801 ] [ 03bec77692da62f861065c04d09de5b217c14be033453a9235a1c67853cccf3ea9 ]", "sequence" : 4294967295 } ], "lock_time" : "0", "outputs" : [ { "address" : "1111111111111111111114oLvT2", "asset" : { "from_uid" : "", "quantity" : 10, "symbol" : "BLOCK", "to_uid" : "BLACKHOLE", "type" : "token-transfer" }, "index" : 0, "locked_height_range" : 0, "script" : "return", "value" : 0 }, { "address" : "UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq", "asset" : { "type" : "ucn" }, "index" : 1, "locked_height_range" : 0, "script" : "dup hash160 [ e65032659d90b0c770f649a385949001f6a4ddfd ] equalverify checksig", "value" : 81999979998919990 }, { "address" : "UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq", "asset" : { "quantity" : 7490, "symbol" : "BLOCK", "type" : "token-transfer" }, "index" : 2, "locked_height_range" : 0, "script" : "dup hash160 [ e65032659d90b0c770f649a385949001f6a4ddfd ] equalverify checksig", "value" : 0 } ], "version" : "4" }
***
-
vote
vote to a miner's addresss, then lock some ucn for about 48h.1 ucn can get 20 votes.
- Parameters (named)
-f
or[--fee]
Transaction fee. defaults to 10000 UCN bits.-r
or[--receivers]
vote to [uid/address:ucn_bits].
- Parameters (positional)
WALLET_NAME
Wallet name required.WALLET_AUTH
Wallet password(authorization) required.FROM_
The address to deposit some ucn for 48h.
- Example
$ uc-cli vote yang 123456 UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq -r UbkBgDeQHHJyGBuT7txepqCiJbpJ3JSYZD:10000 -r USa9SKiMHZ3TRcodvJi6oGVgS65iy47Hh4:40000 { "hash" : "b5b02e50e8b444b4c7b23abd5868fa18124277d4c5c48db545d03dbe4930e5a6", "inputs" : [ { "address" : "UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq", "previous_output" : { "hash" : "fbc32557334266bf5fcfcb9a02b06487923a6791477803d8c3b3a0b8ac39bc18", "index" : 1 }, "script" : "[ 3045022100f30009a7f0784f471a6b65857df114f1c3fb09b26827eebe85b63546d01aff0b0220091615d70c6a4e98869fca68805c11eb67723c0f5bfcd42255751cb175573a0b01 ] [ 03bec77692da62f861065c04d09de5b217c14be033453a9235a1c67853cccf3ea9 ]", "sequence" : 4294967295 }, { "address" : "UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq", "previous_output" : { "hash" : "dbb975bee40b42aa742fb1c06f30dab8fdbb1c1188a60306bf65c21fb0fd79eb", "index" : 1 }, "script" : "[ 30440220504524c2dfd96186f03a9fc93ed963829bad2d73f1b094af73ebe11726b14cd902201b10e47fcd97345b144b8c8f2bcd649fca00b7ad30f777e50233804464f013d101 ] [ 03bec77692da62f861065c04d09de5b217c14be033453a9235a1c67853cccf3ea9 ]", "sequence" : 4294967295 } ], "lock_time" : "0", "outputs" : [ { "address" : "UbkBgDeQHHJyGBuT7txepqCiJbpJ3JSYZD", "asset" : { "quantity" : 10000, "symbol" : "VOTE", "type" : "token-transfer" }, "index" : 0, "locked_height_range" : 0, "script" : "dup hash160 [ 96f40d6b7ae306763ac42788fee3cb4f2f598286 ] equalverify checksig", "value" : 0 }, { "address" : "USa9SKiMHZ3TRcodvJi6oGVgS65iy47Hh4", "asset" : { "quantity" : 40000, "symbol" : "VOTE", "type" : "token-transfer" }, "index" : 1, "locked_height_range" : 0, "script" : "dup hash160 [ 3254e428b11bf9c23a227c3148148fa868ff3e9d ] equalverify checksig", "value" : 0 }, { "address" : "UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq", "asset" : { "type" : "ucn" }, "index" : 2, "locked_height_range" : 345600, "script" : "[ 004605 ] numequalverify dup hash160 [ e65032659d90b0c770f649a385949001f6a4ddfd ] equalverify checksig", "value" : 250000000000 }, { "address" : "UiyoSgUnCbfSFVKcufwMZALVMURmiEfswq", "asset" : { "type" : "ucn" }, "index" : 3, "locked_height_range" : 0, "script" : "dup hash160 [ e65032659d90b0c770f649a385949001f6a4ddfd ] equalverify checksig", "value" : 81999749998829990 } ], "version" : "4" }