This commit is contained in:
guoqing.zhu 2022-05-31 22:10:17 +08:00
parent de30010a34
commit e3f8c396f7
4 changed files with 6 additions and 12 deletions

View File

@ -172,7 +172,6 @@ cc.Class({
}, },
showchainErrTip(){ showchainErrTip(){
console.log("链id错误")
uimanger.showUI(ChainErrTip.prefabPath); uimanger.showUI(ChainErrTip.prefabPath);
}, },

View File

@ -5,7 +5,6 @@ const { ccclass, property } = cc._decorator;
@ccclass @ccclass
export default class ChainErrTip extends UIBase { export default class ChainErrTip extends UIBase {
public static prefabPath = "prefabs/tips/pb_chainerr"; public static prefabPath = "prefabs/tips/pb_chainerr";
init(data: any) { init(data: any) {
// //
@ -33,8 +32,7 @@ export default class ChainErrTip extends UIBase {
); );
} }
this.node.destroy() this.node.destroy();
} }
onClose() { onClose() {

View File

@ -40,13 +40,13 @@ import com.youme.voiceengine.api;
import com.youme.voiceengine.mgr.YouMeManager; import com.youme.voiceengine.mgr.YouMeManager;
import org.cocos2dx.javascript.wc.JWCSession; import org.cocos2dx.javascript.wc.JWCSession;
import org.cocos2dx.javascript.wc.entity.CallResult; import org.cocos2dx.javascript.wc.CallResult;
import org.cocos2dx.javascript.wc.entity.ChainObj; import org.cocos2dx.javascript.wc.ChainObj;
import org.cocos2dx.javascript.wc.entity.ChangeChainObj;
import org.cocos2dx.lib.Cocos2dxActivity; import org.cocos2dx.lib.Cocos2dxActivity;
import org.cocos2dx.lib.Cocos2dxGLSurfaceView; import org.cocos2dx.lib.Cocos2dxGLSurfaceView;
import org.cocos2dx.lib.Cocos2dxJavascriptJavaBridge; import org.cocos2dx.lib.Cocos2dxJavascriptJavaBridge;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.json.JSONObject;
import org.walletconnect.Session; import org.walletconnect.Session;
import java.io.IOException; import java.io.IOException;
@ -418,17 +418,15 @@ public class AppActivity extends Cocos2dxActivity implements YouMeCallBackInterf
* } * }
*/ */
public static void addChain(String paramStr){ public static void addChain(String paramStr){
System.out.println("链信息"+paramStr);
final Moshi moshi = new Moshi.Builder().build(); final Moshi moshi = new Moshi.Builder().build();
JsonAdapter<ChainObj> jsonAdapter = moshi.adapter(ChainObj.class); JsonAdapter<ChainObj> jsonAdapter = moshi.adapter(ChainObj.class);
try { try {
final ChainObj chainObj = jsonAdapter.fromJson(paramStr); final ChainObj chainObj = jsonAdapter.fromJson(paramStr);
Log.i(TAG, chainObj.toString());
List paramList = new ArrayList<>(); List paramList = new ArrayList<>();
paramList.add(chainObj); paramList.add(chainObj);
Log.i(TAG, "addChain");
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
ExampleApplication.session.performMethodCall(new Session.MethodCall.Custom(time, "wallet_addEthereumChain", paramList), new Function1<Session.MethodCall.Response, Unit>() {
ExampleApplication.session.performMethodCall(new Session.MethodCall.Custom(time, "eth_signTypedData", paramList), new Function1<Session.MethodCall.Response, Unit>() {
@Override @Override
public Unit invoke(Session.MethodCall.Response resp) { public Unit invoke(Session.MethodCall.Response resp) {
CallResult result = new CallResult("addChain"); CallResult result = new CallResult("addChain");

View File

@ -36,7 +36,6 @@
"height": 640, "height": 640,
"width": 960 "width": 960
}, },
"start-scene": "current",
"use-customize-simulator": true, "use-customize-simulator": true,
"use-project-simulator-setting": false "use-project-simulator-setting": false
} }