This commit is contained in:
guoqing.zhu 2022-05-31 18:29:49 +08:00
parent 6c4d382625
commit 93e6b2bfc9
4 changed files with 54 additions and 1 deletions

View File

@ -3104,7 +3104,7 @@
"_position": {
"__type__": "cc.Vec3",
"x": -26.5,
"y": 107.8,
"y": 129.2,
"z": 0
},
"_scale": {

View File

@ -28,6 +28,10 @@ window.connectOK = (account) => {
jclogin.getNonce();
};
window.chainErr = ()=>{
console.log("chain err")
};
window.signApp = (sign) => {
jcgamelog.addOperation(OperationType.WALLET, 'signature success');

View File

@ -0,0 +1,40 @@
import { UIBase } from "../UI/UIBase";
const { ccclass, property } = cc._decorator;
@ccclass
export default class ChainErrTip extends UIBase {
public static prefabPath = "prefabs/tips/pb_chainerr";
@property(cc.Label) namelabel: cc.Label = null;
init(data: any) {
//
}
onClickOK() {
var chainInfo = {
chainId: "0x141",
chainName: "KCC Mainnet",
nativeCurrency: {
name: "kccToken",
symbol: "KCS",
decimals: 18,
},
blockExplorerUrls: ["https://explorer.kcc.io/en"],
rpcUrls: ["https://rpc-mainnet.kcc.network"],
};
if (cc.sys.os == cc.sys.OS_ANDROID) {
jsb.reflection.callStaticMethod(
"org/cocos2dx/javascript/AppActivity",
"addChain",
"(Ljava/lang/String;)V",
JSON.stringify(chainInfo)
);
}
}
onClose() {
// this.node.destroy();
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "898d0b7d-c207-4bfa-bd0a-81b8221cb4ce",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}