1
This commit is contained in:
parent
91f7840515
commit
575cb0e271
@ -11,6 +11,7 @@ async function nftUnlock(session) {
|
|||||||
const netId = session.request('net_id');
|
const netId = session.request('net_id');
|
||||||
const tokenId = session.request('token_id');
|
const tokenId = session.request('token_id');
|
||||||
const nftAddress = session.request('nft_address');
|
const nftAddress = session.request('nft_address');
|
||||||
|
const toAddress = session.request('to_address');
|
||||||
const bc = serviceFactory.create('BlockChain');
|
const bc = serviceFactory.create('BlockChain');
|
||||||
{
|
{
|
||||||
const ret = await bc.init(netId);
|
const ret = await bc.init(netId);
|
||||||
@ -25,6 +26,12 @@ async function nftUnlock(session) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
if (!bc.isValidAddress(toAddress)) {
|
||||||
|
session.rspErr(500, 'toAddress error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const userAddress = bc.getUserAddress();
|
const userAddress = bc.getUserAddress();
|
||||||
const thisContractAddress = bc.getContractAddressByName('NFTLock');
|
const thisContractAddress = bc.getContractAddressByName('NFTLock');
|
||||||
@ -65,14 +72,14 @@ async function nftUnlock(session) {
|
|||||||
const nftList = [
|
const nftList = [
|
||||||
[
|
[
|
||||||
tokenId,
|
tokenId,
|
||||||
accountAddress,
|
toAddress,
|
||||||
false
|
false
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
const nftListArr = [];
|
const nftListArr = [];
|
||||||
nftList.forEach((item) => {
|
nftList.forEach((item) => {
|
||||||
nftListArr.push(item[0].toString());
|
nftListArr.push(item[0].toString());
|
||||||
nftListArr.push(accountAddress);
|
nftListArr.push(toAddress);
|
||||||
nftListArr.push('0x00');
|
nftListArr.push('0x00');
|
||||||
});
|
});
|
||||||
const signature = await bc.soliditySha3Sign(
|
const signature = await bc.soliditySha3Sign(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user