jl777
9 years ago
9 changed files with 441 additions and 139 deletions
@ -0,0 +1,48 @@ |
|||
/******************************************************************************
|
|||
* Copyright © 2014-2016 The SuperNET Developers. * |
|||
* * |
|||
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * |
|||
* the top-level directory of this distribution for the individual copyright * |
|||
* holder information and the developer policies on copyright and licensing. * |
|||
* * |
|||
* Unless otherwise agreed in a custom licensing agreement, no part of the * |
|||
* SuperNET software, including this file may be copied, modified, propagated * |
|||
* or distributed except according to the terms contained in the LICENSE file * |
|||
* * |
|||
* Removal or modification of this copyright notice is prohibited. * |
|||
* * |
|||
******************************************************************************/ |
|||
|
|||
// BTCoffer:
|
|||
// sends NXT assetid, volume and desired
|
|||
// request:
|
|||
// other node sends (othercoin, othercoinaddr, otherNXT and reftx that expires well before phasedtx)
|
|||
// proposal:
|
|||
// NXT node submits phasedtx that refers to it, but it wont confirm
|
|||
// approve:
|
|||
// other node verifies unconfirmed has phasedtx and broadcasts cltv, also to NXT node, releases trigger
|
|||
// confirm:
|
|||
// NXT node verifies bitcoin txbytes has proper payment and cashes in with onetimepubkey
|
|||
// BTC* node approves phased tx with onetimepubkey
|
|||
|
|||
char *instantdex_ALTswap(struct supernet_info *myinfo,char *cmdstr,struct instantdex_msghdr *msg,cJSON *argjson,char *remoteaddr,uint64_t signerbits,uint8_t *data,int32_t datalen) // receiving side
|
|||
{ |
|||
char *retstr = 0; |
|||
if ( strcmp(cmdstr,"offer") == 0 ) |
|||
{ |
|||
} |
|||
else if ( strcmp(cmdstr,"proposal") == 0 ) |
|||
{ |
|||
|
|||
} |
|||
else if ( strcmp(cmdstr,"accept") == 0 ) |
|||
{ |
|||
|
|||
} |
|||
else if ( strcmp(cmdstr,"confirm") == 0 ) |
|||
{ |
|||
|
|||
} |
|||
else retstr = clonestr("{\"error\":\"ALT swap got unrecognized command\"}"); |
|||
return(retstr); |
|||
} |
@ -0,0 +1,48 @@ |
|||
/******************************************************************************
|
|||
* Copyright © 2014-2016 The SuperNET Developers. * |
|||
* * |
|||
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * |
|||
* the top-level directory of this distribution for the individual copyright * |
|||
* holder information and the developer policies on copyright and licensing. * |
|||
* * |
|||
* Unless otherwise agreed in a custom licensing agreement, no part of the * |
|||
* SuperNET software, including this file may be copied, modified, propagated * |
|||
* or distributed except according to the terms contained in the LICENSE file * |
|||
* * |
|||
* Removal or modification of this copyright notice is prohibited. * |
|||
* * |
|||
******************************************************************************/ |
|||
|
|||
// BTCoffer:
|
|||
// sends NXT assetid, volume and desired
|
|||
// request:
|
|||
// other node sends (othercoin, othercoinaddr, otherNXT and reftx that expires well before phasedtx)
|
|||
// proposal:
|
|||
// NXT node submits phasedtx that refers to it, but it wont confirm
|
|||
// approve:
|
|||
// other node verifies unconfirmed has phasedtx and broadcasts cltv, also to NXT node, releases trigger
|
|||
// confirm:
|
|||
// NXT node verifies bitcoin txbytes has proper payment and cashes in with onetimepubkey
|
|||
// BTC* node approves phased tx with onetimepubkey
|
|||
|
|||
char *instantdex_BTCswap(struct supernet_info *myinfo,char *cmdstr,struct instantdex_msghdr *msg,cJSON *argjson,char *remoteaddr,uint64_t signerbits,uint8_t *data,int32_t datalen) // receiving side
|
|||
{ |
|||
char *retstr = 0; |
|||
if ( strcmp(cmdstr,"offer") == 0 ) |
|||
{ |
|||
} |
|||
else if ( strcmp(cmdstr,"proposal") == 0 ) |
|||
{ |
|||
|
|||
} |
|||
else if ( strcmp(cmdstr,"accept") == 0 ) |
|||
{ |
|||
|
|||
} |
|||
else if ( strcmp(cmdstr,"confirm") == 0 ) |
|||
{ |
|||
|
|||
} |
|||
else retstr = clonestr("{\"error\":\"BTC swap got unrecognized command\"}"); |
|||
return(retstr); |
|||
} |
@ -0,0 +1,48 @@ |
|||
/******************************************************************************
|
|||
* Copyright © 2014-2016 The SuperNET Developers. * |
|||
* * |
|||
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * |
|||
* the top-level directory of this distribution for the individual copyright * |
|||
* holder information and the developer policies on copyright and licensing. * |
|||
* * |
|||
* Unless otherwise agreed in a custom licensing agreement, no part of the * |
|||
* SuperNET software, including this file may be copied, modified, propagated * |
|||
* or distributed except according to the terms contained in the LICENSE file * |
|||
* * |
|||
* Removal or modification of this copyright notice is prohibited. * |
|||
* * |
|||
******************************************************************************/ |
|||
|
|||
// BTCoffer:
|
|||
// sends NXT assetid, volume and desired
|
|||
// request:
|
|||
// other node sends (othercoin, othercoinaddr, otherNXT and reftx that expires well before phasedtx)
|
|||
// proposal:
|
|||
// NXT node submits phasedtx that refers to it, but it wont confirm
|
|||
// approve:
|
|||
// other node verifies unconfirmed has phasedtx and broadcasts cltv, also to NXT node, releases trigger
|
|||
// confirm:
|
|||
// NXT node verifies bitcoin txbytes has proper payment and cashes in with onetimepubkey
|
|||
// BTC* node approves phased tx with onetimepubkey
|
|||
|
|||
char *instantdex_NXTswap(struct supernet_info *myinfo,char *cmdstr,struct instantdex_msghdr *msg,cJSON *argjson,char *remoteaddr,uint64_t signerbits,uint8_t *data,int32_t datalen) // receiving side
|
|||
{ |
|||
char *retstr = 0; |
|||
if ( strcmp(cmdstr,"offer") == 0 ) |
|||
{ |
|||
} |
|||
else if ( strcmp(cmdstr,"proposal") == 0 ) |
|||
{ |
|||
|
|||
} |
|||
else if ( strcmp(cmdstr,"accept") == 0 ) |
|||
{ |
|||
|
|||
} |
|||
else if ( strcmp(cmdstr,"confirm") == 0 ) |
|||
{ |
|||
|
|||
} |
|||
else retstr = clonestr("{\"error\":\"NXT swap got unrecognized command\"}"); |
|||
return(retstr); |
|||
} |
@ -0,0 +1,49 @@ |
|||
/******************************************************************************
|
|||
* Copyright © 2014-2016 The SuperNET Developers. * |
|||
* * |
|||
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * |
|||
* the top-level directory of this distribution for the individual copyright * |
|||
* holder information and the developer policies on copyright and licensing. * |
|||
* * |
|||
* Unless otherwise agreed in a custom licensing agreement, no part of the * |
|||
* SuperNET software, including this file may be copied, modified, propagated * |
|||
* or distributed except according to the terms contained in the LICENSE file * |
|||
* * |
|||
* Removal or modification of this copyright notice is prohibited. * |
|||
* * |
|||
******************************************************************************/ |
|||
|
|||
// BTCoffer:
|
|||
// sends NXT assetid, volume and desired
|
|||
// request:
|
|||
// other node sends (othercoin, othercoinaddr, otherNXT and reftx that expires well before phasedtx)
|
|||
// proposal:
|
|||
// NXT node submits phasedtx that refers to it, but it wont confirm
|
|||
// approve:
|
|||
// other node verifies unconfirmed has phasedtx and broadcasts cltv, also to NXT node, releases trigger
|
|||
// confirm:
|
|||
// NXT node verifies bitcoin txbytes has proper payment and cashes in with onetimepubkey
|
|||
// BTC* node approves phased tx with onetimepubkey
|
|||
|
|||
char *instantdex_PAXswap(struct supernet_info *myinfo,char *cmdstr,struct instantdex_msghdr *msg,cJSON *argjson,char *remoteaddr,uint64_t signerbits,uint8_t *data,int32_t datalen) // receiving side
|
|||
{ |
|||
char *retstr = 0; |
|||
return(clonestr("{\"error\":\"PAX swap is not yet\"}")); |
|||
if ( strcmp(cmdstr,"offer") == 0 ) |
|||
{ |
|||
} |
|||
else if ( strcmp(cmdstr,"proposal") == 0 ) |
|||
{ |
|||
|
|||
} |
|||
else if ( strcmp(cmdstr,"accept") == 0 ) |
|||
{ |
|||
|
|||
} |
|||
else if ( strcmp(cmdstr,"confirm") == 0 ) |
|||
{ |
|||
|
|||
} |
|||
else retstr = clonestr("{\"error\":\"PAX swap got unrecognized command\"}"); |
|||
return(retstr); |
|||
} |
Loading…
Reference in new issue