api_uids - UCHAIN-WORLD/uchain-fullnode GitHub Wiki

title: api uids

Command list


  • registeruid

    • JS Parameters
     { 
       method: 'POST',  
       url: 'http://127.0.0.1:8707/rpc/v3',  
       headers:   
       {  
        'Content-Type': 'application/json'   
       },  
       body: 
       { 
         "jsonrpc": "3.0",  
         "method": "registeruid",  
        "params": [ "tony4", "123456",
    			   "UfEUeYUPL8pNW7g8taDQKbHjuawSwFJXiX",
    			   "[email protected]"],  
         "id": 7    
       },  
       json: true   
    };
    
  • Response

    {
    "id" : 7,
    "jsonrpc" : "3.0",
    "result":
    {
    "hash" : "302dd8a3c07966b6420b7ae8c7447eb7a86d1c41a1d81acbad9e0855eae4aff4",
    "inputs" : 
    [
    	{
    		"address" : "UfEUeYUPL8pNW7g8taDQKbHjuawSwFJXiX",
    		"previous_output" : 
    		{
    			"hash" : "24a69d91e0e034ff9e9d98de0d11bd7ac1bd7c1ebd53e66043a56a0df27c8b30",
    			"index" : 0
    		},
    		"script" : "[ 30440220283bf9ce03a5d22c25a507bbdc893af0fe1246db12fe5095c674bd9f9519dd800220064bbc8e7c7941410755949dc2f2899a9b9e47453a44fab89dfaae602d6ecd4201 ] [ 02328a6c43d56baa8ed09abbac7b5fdf59ea7b79ea3321c643db590b2984d797d3 ]",
    		"sequence" : 4294967295
    	}
    ],
    "lock_time" : "0",
    "outputs" : 
    [
    	{
    		"address" : "UfEUeYUPL8pNW7g8taDQKbHjuawSwFJXiX",
    		"asset" : 
    		{
    			"address" : "UfEUeYUPL8pNW7g8taDQKbHjuawSwFJXiX",
    			"symbol" : "[email protected]",
    			"type" : "uid-register"
    		},
    		"index" : 0,
    		"locked_height_range" : 0,
    		"script" : "dup hash160 [ bd363e5463bd682d1ba7dfa174150db344865597 ] equalverify checksig",
    		"value" : 0
    	},
    	{
    		"address" : "UQudmH5pc3BuBebzVrdhVeXR8P8JXGUwCZ",
    		"asset" : 
    		{
    			"type" : "ucn"
    		},
    		"index" : 1,
    		"locked_height_range" : 0,
    		"script" : "dup hash160 [ 20143060db1a710b2759207a4bc0cb36b8d95afe ] equalverify checksig",
    		"value" : 8000000000
    	},
    	{
    		"address" : "UfEUeYUPL8pNW7g8taDQKbHjuawSwFJXiX",
    		"asset" : 
    		{
    			"type" : "ucn"
    		},
    		"index" : 2,
    		"locked_height_range" : 0,
    		"script" : "dup hash160 [ bd363e5463bd682d1ba7dfa174150db344865597 ] equalverify checksig",
    		"value" : 10000000000
    	}
    ],
    "version" : "4"
    }
    }
    

  • transferuid

    • JS Parameters
     { 
       method: 'POST',  
       url: 'http://127.0.0.1:8707/rpc/v3',  
       headers:   
       {  
        'Content-Type': 'application/json'   
       },  
       body: 
       { 
         "jsonrpc": "3.0",  
         "method": "transferuid",  
        "params": [ "tony4", "123456",
    			   "UkRYvsnfJkwSTAUCcZnqCK8sE1ZYJP6so7",
    			   "[email protected]"],  
         "id": 7    
       },  
       json: true   
    };
    
  • Response

    {
    "id" : 7,
    "jsonrpc" : "3.0",
    "result":
    {
    "hash" : "d168b5d5ae2096f1ba75393e170c71b05c30804eebc7a7f2aeba50b0fd67c96f",
    "inputs" : 
    [
    	{
    		"address" : "UkRYvsnfJkwSTAUCcZnqCK8sE1ZYJP6so7",
    		"previous_output" : 
    		{
    			"hash" : "3f00b7d6f63e13a03fd1ba6f7d1a8933cd9ceee97a4458115d95b77dfa73bd66",
    			"index" : 1
    		},
    		"script" : "[ 30450221008e151a313f5ea1d7b9d8ab4e87d4132fc0e98dab5fd9dd18b8990bb54e4ec8940220355b4deb68895cef2e85c03e600adb9c672e5920c0e4b61ad96742b3fbfa2bc601 ] [ 0386e78227d2e2a80e5d99a727a48b67501ea87223634544a38ae1c1720e59167d ]",
    		"sequence" : 4294967295
    	},
    	{
    		"address" : "UNfrtAxhJRi83PjTPjV3yNPKnjLYR22Bhx",
    		"previous_output" : 
    		{
    			"hash" : "2f75897cba171de110f0fb8d4b40b6cb56d224b71a3ee57eab319bf433b16b0d",
    			"index" : 0
    		},
    		"script" : "[ 30440220240fe152547ff74ab41f3c8f99487258e70b73d0c0668b8cbe46bf6e5233ee29022034a25339731ff6194dde0aaf27ba338e8cf6fc7eb538359bbc71a7f498b10fb301 ] [ 027c99068f735e53064682b9ef1f548a00191b5ffb2fd9b9c8f32cde97793a0ed4 ]",
    		"sequence" : 4294967295
    	}
    ],
    "lock_time" : "0",
    "outputs" : 
    [
    	{
    		"address" : "UkRYvsnfJkwSTAUCcZnqCK8sE1ZYJP6so7",
    		"asset" : 
    		{
    			"address" : "UkRYvsnfJkwSTAUCcZnqCK8sE1ZYJP6so7",
    			"symbol" : "[email protected]",
    			"type" : "uid-transfer"
    		},
    		"index" : 0,
    		"locked_height_range" : 0,
    		"script" : "dup hash160 [ f62705a6cfc44ad47792988464b6e47a06ef114a ] equalverify checksig",
    		"value" : 0
    	}
    ],
    "version" : "4"
    }
    }
    
    

  • showuids

    • JS Parameters
     { 
       method: 'POST',  
       url: 'http://127.0.0.1:8707/rpc/v3',  
       headers:   
       {  
        'Content-Type': 'application/json'   
       },  
       body: 
       { 
         "jsonrpc": "3.0",  
         "method": "showuids",  
        "params": [],  
         "id": 7    
       },  
       json: true   
    };
    
  • Response

    {
    "id" : 7,
    "jsonrpc" : "3.0",
    "result":
    {
    "current_page" : 1,
    "total_count" : 3,
    "total_page" : 1,
    "uids" : 
    [
    	{
    		"address" : "UNfrtAxhJRi83PjTPjV3yNPKnjLYR22Bhx",
    		"status" : "registered",
    		"symbol" : "[email protected]"
    	},
    	{
    		"address" : "UfEUeYUPL8pNW7g8taDQKbHjuawSwFJXiX",
    		"status" : "registered",
    		"symbol" : "[email protected]"
    	},
    	{
    		"address" : "1111111111111111111114oLvT2",
    		"status" : "registered",
    		"symbol" : "BLACKHOLE"
    	}
    ]
    }
    }
    
    

  • showuid

    • JS Parameters
     { 
       method: 'POST',  
       url: 'http://127.0.0.1:8707/rpc/v3',  
       headers:   
       {  
        'Content-Type': 'application/json'   
       },  
       body: 
       { 
         "jsonrpc": "3.0",  
         "method": "showuid",  
        "params": ["[email protected]"],  
         "id": 7    
       },  
       json: true   
    };
    
  • Response

    {
    "id" : 7,
    "jsonrpc" : "3.0",
    "result":
    [
    {
    	"address" : "UfEUeYUPL8pNW7g8taDQKbHjuawSwFJXiX",
    	"status" : "current",
    	"symbol" : "[email protected]"
    }
    ]
    }