dont know sht
This commit is contained in:
parent
41219ec2a5
commit
2aacd20379
Binary file not shown.
@ -68,5 +68,37 @@
|
||||
landmarkType = "9">
|
||||
</BreakpointContent>
|
||||
</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>
|
||||
</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) {
|
||||
// chain = chain || 80001
|
||||
channel = channel || 1
|
||||
type = 0
|
||||
chain = 80001
|
||||
type = parseInt(type)
|
||||
chain = parseInt(chain)
|
||||
channel = channel || 0;
|
||||
channel = parseInt(channel);
|
||||
try {
|
||||
var wallet;
|
||||
if (!window.jc || !jc.wallet) {
|
||||
@ -126,7 +126,6 @@ function changeChain(funId, chainId) {
|
||||
* @param {string} tips: tips message when sign
|
||||
*/
|
||||
function loginSign(funId, nonce, tips) {
|
||||
console.log('login sign: ' + funId)
|
||||
jc.wallet
|
||||
.loginSign(nonce, tips)
|
||||
.then((result) => {
|
||||
@ -165,33 +164,18 @@ function createAccount(funId) {
|
||||
* @return {string} account actived
|
||||
*/
|
||||
function importAccount(funId, privateKey) {
|
||||
console.log('importAccount: ' + funId);
|
||||
jsb.signWithApple(funId);
|
||||
// jsb.restoreKey(funId, '1111');
|
||||
// jsb.scanQRCode(funId, '111');
|
||||
// jsb.showQRCode('00123', '0x12312312313123123123', 'CEBG RECOVERY KEY', '0x1231231231321231');
|
||||
// try {
|
||||
// let address = jc.wallet.importAccount(privateKey);
|
||||
// return JSON.stringify({
|
||||
// errcode: 0,
|
||||
// data: address,
|
||||
// });
|
||||
// } 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))
|
||||
// })
|
||||
try {
|
||||
let address = jc.wallet.importAccount(privateKey);
|
||||
return JSON.stringify({
|
||||
errcode: 0,
|
||||
data: address,
|
||||
});
|
||||
} catch (err) {
|
||||
return JSON.stringify({
|
||||
errcode: 1,
|
||||
errmsg: err,
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* active one account
|
||||
@ -350,6 +334,7 @@ function restoreFromMnemonic(funId, mnemonic, password) {
|
||||
|
||||
function scanQRCode(funId, title) {
|
||||
try {
|
||||
console.log('scanQRCode: ' + title)
|
||||
jsb.scanQRCode(funId, title);
|
||||
} catch (err) {
|
||||
return JSON.stringify({
|
||||
@ -395,6 +380,8 @@ function signOutGoogle(funId) {
|
||||
//}
|
||||
|
||||
function buyNft721(funId, addresses, values, signature) {
|
||||
addresses = JSON.parse(addresses)
|
||||
values = JSON.parse(values)
|
||||
jc.wallet.jcStandard
|
||||
.buyNft721({
|
||||
addresses,
|
||||
@ -406,7 +393,7 @@ function buyNft721(funId, addresses, values, signature) {
|
||||
funId,
|
||||
JSON.stringify({
|
||||
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) {
|
||||
addresses = JSON.parse(addresses)
|
||||
values = JSON.parse(values)
|
||||
ids = JSON.parse(ids)
|
||||
amounts = JSON.parse(amounts)
|
||||
|
||||
jc.wallet.jcStandard
|
||||
.buyNft1155({
|
||||
addresses,
|
||||
@ -429,7 +421,7 @@ function buyNft1155(funId, addresses, values, ids, amounts, signature) {
|
||||
funId,
|
||||
JSON.stringify({
|
||||
errcode: 0,
|
||||
data: result,
|
||||
data: JSON.stringify(result),
|
||||
})
|
||||
);
|
||||
})
|
||||
@ -446,7 +438,7 @@ function evolveNft721(
|
||||
nonce,
|
||||
signature
|
||||
) {
|
||||
{
|
||||
tokenIds = JSON.parse(tokenIds)
|
||||
jc.wallet.jcStandard
|
||||
.evolve721NFT({
|
||||
nftAddress,
|
||||
@ -460,17 +452,17 @@ function evolveNft721(
|
||||
funId,
|
||||
JSON.stringify({
|
||||
errcode: 0,
|
||||
data: result,
|
||||
data: JSON.stringify(result),
|
||||
})
|
||||
);
|
||||
})
|
||||
.catch((err) => {
|
||||
jsb.jcCallback(funId,JSON.stringify({errcode: 1,errmsg: err}));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function evolveChip(funId, tokenIds, startTime, nonce, signature) {
|
||||
tokenIds = JSON.parse(tokenIds)
|
||||
jc.wallet.jcStandard
|
||||
.evolveChip({
|
||||
tokenIds,
|
||||
@ -483,7 +475,7 @@ function evolveChip(funId, tokenIds, startTime, nonce, signature) {
|
||||
funId,
|
||||
JSON.stringify({
|
||||
errcode: 0,
|
||||
data: result,
|
||||
data: JSON.stringify(result),
|
||||
})
|
||||
);
|
||||
})
|
||||
@ -500,6 +492,9 @@ function mintShardBatchUser(
|
||||
nonce,
|
||||
signature
|
||||
) {
|
||||
tokenIds = JSON.parse(tokenIds)
|
||||
amounts = JSON.parse(amounts)
|
||||
|
||||
jc.wallet.jcStandard
|
||||
.mintShardBatchUser({
|
||||
tokenIds,
|
||||
@ -513,7 +508,7 @@ function mintShardBatchUser(
|
||||
funId,
|
||||
JSON.stringify({
|
||||
errcode: 0,
|
||||
data: result,
|
||||
data: JSON.stringify(result),
|
||||
})
|
||||
);
|
||||
})
|
||||
@ -534,6 +529,9 @@ function shardMixByUser(
|
||||
nonce,
|
||||
signature
|
||||
) {
|
||||
ids = JSON.parse(ids)
|
||||
amounts = JSON.parse(amounts)
|
||||
|
||||
jc.wallet.jcStandard
|
||||
.shardMixByUser({
|
||||
tokenId,
|
||||
@ -551,14 +549,15 @@ function shardMixByUser(
|
||||
funId,
|
||||
JSON.stringify({
|
||||
errcode: 0,
|
||||
data: result,
|
||||
data: JSON.stringify(result),
|
||||
})
|
||||
);
|
||||
})
|
||||
.catch((err) => {
|
||||
jsb.jcCallback(funId,JSON.stringify({errcode: 1,errmsg: err}));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// addresses: [nftId, chip, sign_address]
|
||||
// values: [token_id,salt_nonce,startTime]
|
||||
|
Loading…
x
Reference in New Issue
Block a user