dont know sht
This commit is contained in:
parent
41219ec2a5
commit
2aacd20379
Binary file not shown.
@ -68,5 +68,37 @@
|
|||||||
landmarkType = "9">
|
landmarkType = "9">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
</BreakpointProxy>
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
uuid = "018F2F97-2090-4CE0-932F-F5A74012BD18"
|
||||||
|
shouldBeEnabled = "No"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "Classes_cocos/AppDelegate.mm"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "49"
|
||||||
|
endingLineNumber = "49"
|
||||||
|
landmarkName = "AppDelegate::applicationDidFinishLaunching()"
|
||||||
|
landmarkType = "7">
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
uuid = "8C06AA2C-7C7E-410D-A0E4-4A25404BC290"
|
||||||
|
shouldBeEnabled = "No"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "../../../../cocos/cocos2d-x/cocos/platform/ios/CCApplication-ios.mm"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "61"
|
||||||
|
endingLineNumber = "61"
|
||||||
|
landmarkName = "-initWithApplication:"
|
||||||
|
landmarkType = "7">
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
</Breakpoints>
|
</Breakpoints>
|
||||||
</Bucket>
|
</Bucket>
|
||||||
|
81
js/main.js
81
js/main.js
@ -6,10 +6,10 @@ console.log(">>begin load wallet main file");
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
function initWallet(funId, type, chain, channel) {
|
function initWallet(funId, type, chain, channel) {
|
||||||
// chain = chain || 80001
|
type = parseInt(type)
|
||||||
channel = channel || 1
|
chain = parseInt(chain)
|
||||||
type = 0
|
channel = channel || 0;
|
||||||
chain = 80001
|
channel = parseInt(channel);
|
||||||
try {
|
try {
|
||||||
var wallet;
|
var wallet;
|
||||||
if (!window.jc || !jc.wallet) {
|
if (!window.jc || !jc.wallet) {
|
||||||
@ -126,7 +126,6 @@ function changeChain(funId, chainId) {
|
|||||||
* @param {string} tips: tips message when sign
|
* @param {string} tips: tips message when sign
|
||||||
*/
|
*/
|
||||||
function loginSign(funId, nonce, tips) {
|
function loginSign(funId, nonce, tips) {
|
||||||
console.log('login sign: ' + funId)
|
|
||||||
jc.wallet
|
jc.wallet
|
||||||
.loginSign(nonce, tips)
|
.loginSign(nonce, tips)
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
@ -165,33 +164,18 @@ function createAccount(funId) {
|
|||||||
* @return {string} account actived
|
* @return {string} account actived
|
||||||
*/
|
*/
|
||||||
function importAccount(funId, privateKey) {
|
function importAccount(funId, privateKey) {
|
||||||
console.log('importAccount: ' + funId);
|
try {
|
||||||
jsb.signWithApple(funId);
|
let address = jc.wallet.importAccount(privateKey);
|
||||||
// jsb.restoreKey(funId, '1111');
|
return JSON.stringify({
|
||||||
// jsb.scanQRCode(funId, '111');
|
errcode: 0,
|
||||||
// jsb.showQRCode('00123', '0x12312312313123123123', 'CEBG RECOVERY KEY', '0x1231231231321231');
|
data: address,
|
||||||
// try {
|
});
|
||||||
// let address = jc.wallet.importAccount(privateKey);
|
} catch (err) {
|
||||||
// return JSON.stringify({
|
return JSON.stringify({
|
||||||
// errcode: 0,
|
errcode: 1,
|
||||||
// data: address,
|
errmsg: err,
|
||||||
// });
|
});
|
||||||
// } catch (err) {
|
}
|
||||||
// return JSON.stringify({
|
|
||||||
// errcode: 1,
|
|
||||||
// errmsg: err,
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// jc.wallet.erc20Standard.transfer({
|
|
||||||
// address: '0xC76c692450d6221A8B1E035CB8bdB639bC60658D',
|
|
||||||
// from: '0x50A8e60041A206AcaA5F844a1104896224be6F39',
|
|
||||||
// to: '0x746338765a8FbDD1c5aB61bfb92CD6D960C3C662',
|
|
||||||
// amount: 101
|
|
||||||
// }).then((res) => {
|
|
||||||
// console.log(JSON.stringify(res))
|
|
||||||
// }).catch(err => {
|
|
||||||
// console.log(JSON.stringify(err))
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* active one account
|
* active one account
|
||||||
@ -350,6 +334,7 @@ function restoreFromMnemonic(funId, mnemonic, password) {
|
|||||||
|
|
||||||
function scanQRCode(funId, title) {
|
function scanQRCode(funId, title) {
|
||||||
try {
|
try {
|
||||||
|
console.log('scanQRCode: ' + title)
|
||||||
jsb.scanQRCode(funId, title);
|
jsb.scanQRCode(funId, title);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return JSON.stringify({
|
return JSON.stringify({
|
||||||
@ -395,6 +380,8 @@ function signOutGoogle(funId) {
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
function buyNft721(funId, addresses, values, signature) {
|
function buyNft721(funId, addresses, values, signature) {
|
||||||
|
addresses = JSON.parse(addresses)
|
||||||
|
values = JSON.parse(values)
|
||||||
jc.wallet.jcStandard
|
jc.wallet.jcStandard
|
||||||
.buyNft721({
|
.buyNft721({
|
||||||
addresses,
|
addresses,
|
||||||
@ -406,7 +393,7 @@ function buyNft721(funId, addresses, values, signature) {
|
|||||||
funId,
|
funId,
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
errcode: 0,
|
errcode: 0,
|
||||||
data: result,
|
data: JSON.stringify(result),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
@ -416,6 +403,11 @@ function buyNft721(funId, addresses, values, signature) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function buyNft1155(funId, addresses, values, ids, amounts, signature) {
|
function buyNft1155(funId, addresses, values, ids, amounts, signature) {
|
||||||
|
addresses = JSON.parse(addresses)
|
||||||
|
values = JSON.parse(values)
|
||||||
|
ids = JSON.parse(ids)
|
||||||
|
amounts = JSON.parse(amounts)
|
||||||
|
|
||||||
jc.wallet.jcStandard
|
jc.wallet.jcStandard
|
||||||
.buyNft1155({
|
.buyNft1155({
|
||||||
addresses,
|
addresses,
|
||||||
@ -429,7 +421,7 @@ function buyNft1155(funId, addresses, values, ids, amounts, signature) {
|
|||||||
funId,
|
funId,
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
errcode: 0,
|
errcode: 0,
|
||||||
data: result,
|
data: JSON.stringify(result),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
@ -446,7 +438,7 @@ function evolveNft721(
|
|||||||
nonce,
|
nonce,
|
||||||
signature
|
signature
|
||||||
) {
|
) {
|
||||||
{
|
tokenIds = JSON.parse(tokenIds)
|
||||||
jc.wallet.jcStandard
|
jc.wallet.jcStandard
|
||||||
.evolve721NFT({
|
.evolve721NFT({
|
||||||
nftAddress,
|
nftAddress,
|
||||||
@ -460,17 +452,17 @@ function evolveNft721(
|
|||||||
funId,
|
funId,
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
errcode: 0,
|
errcode: 0,
|
||||||
data: result,
|
data: JSON.stringify(result),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
jsb.jcCallback(funId,JSON.stringify({errcode: 1,errmsg: err}));
|
jsb.jcCallback(funId,JSON.stringify({errcode: 1,errmsg: err}));
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function evolveChip(funId, tokenIds, startTime, nonce, signature) {
|
function evolveChip(funId, tokenIds, startTime, nonce, signature) {
|
||||||
|
tokenIds = JSON.parse(tokenIds)
|
||||||
jc.wallet.jcStandard
|
jc.wallet.jcStandard
|
||||||
.evolveChip({
|
.evolveChip({
|
||||||
tokenIds,
|
tokenIds,
|
||||||
@ -483,7 +475,7 @@ function evolveChip(funId, tokenIds, startTime, nonce, signature) {
|
|||||||
funId,
|
funId,
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
errcode: 0,
|
errcode: 0,
|
||||||
data: result,
|
data: JSON.stringify(result),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
@ -500,6 +492,9 @@ function mintShardBatchUser(
|
|||||||
nonce,
|
nonce,
|
||||||
signature
|
signature
|
||||||
) {
|
) {
|
||||||
|
tokenIds = JSON.parse(tokenIds)
|
||||||
|
amounts = JSON.parse(amounts)
|
||||||
|
|
||||||
jc.wallet.jcStandard
|
jc.wallet.jcStandard
|
||||||
.mintShardBatchUser({
|
.mintShardBatchUser({
|
||||||
tokenIds,
|
tokenIds,
|
||||||
@ -513,7 +508,7 @@ function mintShardBatchUser(
|
|||||||
funId,
|
funId,
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
errcode: 0,
|
errcode: 0,
|
||||||
data: result,
|
data: JSON.stringify(result),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
@ -534,6 +529,9 @@ function shardMixByUser(
|
|||||||
nonce,
|
nonce,
|
||||||
signature
|
signature
|
||||||
) {
|
) {
|
||||||
|
ids = JSON.parse(ids)
|
||||||
|
amounts = JSON.parse(amounts)
|
||||||
|
|
||||||
jc.wallet.jcStandard
|
jc.wallet.jcStandard
|
||||||
.shardMixByUser({
|
.shardMixByUser({
|
||||||
tokenId,
|
tokenId,
|
||||||
@ -551,14 +549,15 @@ function shardMixByUser(
|
|||||||
funId,
|
funId,
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
errcode: 0,
|
errcode: 0,
|
||||||
data: result,
|
data: JSON.stringify(result),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
jsb.jcCallback(funId,JSON.stringify({errcode: 1,errmsg: err}));
|
jsb.jcCallback(funId,JSON.stringify({errcode: 1,errmsg: err}));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// addresses: [nftId, chip, sign_address]
|
// addresses: [nftId, chip, sign_address]
|
||||||
// values: [token_id,salt_nonce,startTime]
|
// values: [token_id,salt_nonce,startTime]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user