package com.liquidnet.common.third.xuper.util;


import com.baidu.xasset.auth.XchainAccount;
import com.baidu.xasset.client.base.BaseDef.*;
import com.baidu.xasset.client.xasset.Asset;
import com.baidu.xasset.client.xasset.XassetDef.*;
import com.baidu.xasset.common.config.Config.*;
import com.baidu.xuper.api.Account;

import java.util.logging.Logger;

/**
 * @author AnJiabin <anjiabin@zhengzai.tv>
 * @version V1.0
 * @Description: TODO
 * @class: TestXuperChain
 * @Package com.liquidnet.common.third.xuper.util
 * @Copyright: LightNet @ Copyright (c) 2022
 * @date 2022/4/18 13:21
 */
public class TestXuperChain {
    public static void main(String[] args) {
        // 配置AK/SK
        long appId = 0;
        String ak = "12121212121212121";
        String sk = "1212121212122";

        XassetCliConfig cfg = new XassetCliConfig();
        cfg.setCredentials(appId, ak, sk);
        cfg.setEndPoint("http://120.48.16.137:8360");

        // 创建区块链账户
        Account acc = XchainAccount.newXchainEcdsaAccount(XchainAccount.mnemStrgthStrong, XchainAccount.mnemLangEN);
        // 初始化接口类
        Asset handle = new Asset(cfg, Logger.getGlobal());
        // 调用方法
        Resp<GetStokenResp> result = handle.getStoken(acc);
        System.out.println(result);
    }
}
