tp-lab / mobile-sdk Goto Github PK
View Code? Open in Web Editor NEWAndroid and iOS native SDK, developer can use this sdk to pull up TokenPocket wallet and do actions such as token transfer,push action, login etc. MiniWallet supported now.
Android and iOS native SDK, developer can use this sdk to pull up TokenPocket wallet and do actions such as token transfer,push action, login etc. MiniWallet supported now.
Hi,
I am developing dapp browser for tron in android. i have searched but coud'nt find any sources or documentation to proceed. Can you help me with that? or any guide or reference. please suggest me
I connect tp wallet to dapp with walletconnect, no matter which network I select in tp, the returned chain id is always 1.
接入android sdk后, OEC链中代币转账时. 转OKT主币时没有问题. 请问下是可能是哪里的问题?
Android的demo中跳转tp钱包需要一个actionId的参数,请问这个是从哪获取的
另外是否可以从App内直接跳转到tp钱包的dapp内呢
#5 0x000000010484b5b4 in __49-[TPPayResourceService loadResourceServiceConfig]_block_invoke at /Users/ica/repo/TPiOSSDK/TPSDK/TPSDK/PayResource/TPPayResourceService.m:107
签名成功返回app时在这里崩溃
我们希望通过这个 issue 收集使用Mobile-SDK 的项目信息,并借此与社区建立更多的联系,了解 SDK 的使用场景、方式及遇到的问题,以更好的推动 Web3.0 的生态发展。
您可以告诉我们使用 Mobile-SDK 的经验及遇到的问题,包括但不限于:
同时,也欢迎您留下项目相关信息,让社区看到更多Web3.0的交互和生态:
We hope to collect information on projects using Mobile-SDK through this issue, and establish more contacts with the community to understand the usage scenarios, methods and problems of the SDK, so as to better promote the ecological development of Web3.0.
You can tell us about your experience and problems using Mobile-SDK, including but not limited to:
At the same time, you are also welcome to leave project-related information, so that the community can see more interaction and ecology of Web3.0:
工程师您好,请教下您一个问题我用你们的demo,能把tp唤起,但是不能执行,总是报“非法参数”,能否帮忙。谢谢
binding.button.setOnClickListener(new View.OnClickListener(){
@OverRide
public void onClick(View v) {
Authorize authorize = new Authorize();
//已废弃
//authorize.setBlockchain(CHAIN);
//标识链
List blockchains = new ArrayList();
//blockchains.add(new Blockchain("ethereum", "56"));
blockchains.add(new Blockchain("ethereum", "56"));
authorize.setBlockchains(blockchains);
authorize.setAction("login");
authorize.setActionId(String.valueOf(System.currentTimeMillis()));
authorize.setProtocol("TokenPocket");
authorize.setVersion("v1.0");
authorize.setDappName("zs");
authorize.setDappIcon("https://eosknights.io/img/icon.png");
authorize.setMemo("demo");
authorize.setCallbackUrl("http://115.205.0.178:9011/taaBizApi/taaInitData");
//2分钟
authorize.setExpired(1602);
TPManager.getInstance().authorize(MainActivity.this, authorize, new TPListener() {
@OverRide
public void onSuccess(String s) {
String cc=s+"mmm";
Toast.makeText(MainActivity.this, cc, Toast.LENGTH_LONG).show();
}
@Override
public void onError(String s) {
String cc = s+"ccc";
Toast.makeText(MainActivity.this, cc, Toast.LENGTH_LONG).show();
}
@Override
public void onCancel(String s) {
String cc = s+"eeeee";
Toast.makeText(MainActivity.this, cc, Toast.LENGTH_LONG).show();
}
});
}
});
binding.button4.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
Toast.makeText(MainActivity.this,"ttttt",Toast.LENGTH_LONG).show();
Transfer transfer = new Transfer();
//已废弃
//transfer.setBlockchain("EOS");
//标识链
List<Blockchain> blockchains = new ArrayList<>();
blockchains.add(new Blockchain("ethereum", "56"));
transfer.setBlockchains(blockchains);
transfer.setAction("transfer");
transfer.setActionId(String.valueOf(System.currentTimeMillis()));
transfer.setDappName("zs");
transfer.setDappIcon("https://eosknights.io/img/icon.png");
transfer.setFrom("0x0c5dBa0A59776c3C31c31ac1C19AaFAeb800d1E8");
transfer.setTo("0x341Bb9895e7F6E76e89B93BDCa19364470D71a83");
transfer.setAmount(0.0001);
transfer.setContract("0xe10EBE772A01D53745a5a6DAc9C67fFb39C0b40F");
transfer.setSymbol("TAA");
transfer.setPrecision(18);
transfer.setMemo("test");
transfer.setExpired(1535944144L);
transfer.setCallbackUrl("http://115.205.0.178:9011/taaBizApi/taaInitData");
TPManager.getInstance().transfer(MainActivity.this, transfer,new TPListener() {
@Override
public void onSuccess(String data) {
String cc = data+"ccc";
Toast.makeText(MainActivity.this, cc, Toast.LENGTH_LONG).show();
}
@Override
public void onError(String data) {
String cc = data+"ccc";
Toast.makeText(MainActivity.this, cc, Toast.LENGTH_LONG).show();
}
@Override
public void onCancel(String data) {
String cc = data+"ccc";
Toast.makeText(MainActivity.this, cc, Toast.LENGTH_LONG).show();
}
});
}
});
}
大佬:们
我要用安卓的SDK来完成 TRX(波场币)->USDT 的兑换, DEMO中的一些参数不知道怎么传递? 请指点下吗?
返回结果如下:
{"txID":"","account":"TRbwME21SgmAtpfJqxg2whfEiTt5zWuvKu","chainId":"728126428","network":"tron","ref":"TokenPocket","result":1,"wallet":"TRbwME21SgmAtpfJqxg2whfEiTt5zWuvKu","action":"transfer","actionId":"269647312882634752","protocol":"TokenPocket","version":"1.0.5"}
工程师,现在我通过安卓app接口发起了transfer接口,我看接口里面有个回调地址,但是我把回调地址加上去了(回调地址格式:http://xxx.xxx.xxx/cc/dd),没有看到有返回信息,还有如果没有接到,请问在哪里查询交易信息。谢谢
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
Originally posted by @ericsj in microsoft/TypeScript#47090
#import "AppDelegate.h"
#import <TPSDK/TPSDK.h>
@interface AppDelegate ()
@implementation AppDelegate
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[TPApi registerAppID:@"demoapp"];
[TPApi enableLog:YES];
[TPApi setPayResourceSwitch:YES forAccount:@"verycoolcool"];
NSError *err;
[TPApi setSeed:@"12345678" error:&err];
if (err) {
NSLog(@"%@", err.localizedDescription);
}
[TPApi setBlockChain:TPBlockChainTypeEOSMainNet nodeUrl:@"http://eosinfo.mytokenpocket.vip" plugNodeUrl:@"http://eosinfo.mytokenpocket.vip"];
return YES;
}
code : [TPApi enableLog:YES]; <---- error
-[NSUserDefaults tb_setObject:forKey:inGroup:]: unrecognized selector sent to instance 0x28243c0c0 <---
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSUserDefaults tb_setObject:forKey:inGroup:]: unrecognized selector sent to instance 0x2812ee940'
*** First throw call stack:
(0x19b40b928 0x1af1aa480 0x19b31a960 0x19b40df84 0x19b40ff2c 0x102274a0c 0x102276130 0x102272190 0x19dcad7b0 0x19dcaf150 0x19dcb4f24 0x19d3878c0 0x19d8ac2c8 0x19d3883a8 0x19d387eb0 0x19d3881d4 0x19d387a90 0x19d38f72c 0x19d7c638c 0x19d8c4184 0x19d38f420 0x19d1ceae4 0x19d1cd590 0x19d1ce730 0x19dcb30fc 0x19d7eca84 0x1a9eeed00 0x1a9f164fc 0x1a9efc420 0x1a9f16214 0x10262d32c 0x1026307e4 0x1a9f3ae04 0x1a9f3aacc 0x1a9f3afa0 0x19b38afa8 0x19b38aea8 0x19b38a1fc 0x19b384718 0x19b383ed0 0x1b1acf570 0x19dcb12d0 0x19dcb684c 0x102273b18 0x19b062140)
libc++abi: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSUserDefaults tb_setObject:forKey:inGroup:]: unrecognized selector sent to instance 0x2812ee940'
terminating with uncaught exception of type NSException
May I know what is causing the error?
A framework has also been added to see additional sample code.
给个例子
web3.utils.soliditySha3({t: 'string', v: 'Hello!%'}, {t: 'int8', v:-23}, {t: 'address', v: '0x85F43D8a49eeB85d32Cf465507DD71d507100C1d'});
"0xa13b31627c1ed7aaded5aecec71baf02fe123797fffd45e662eac8e06fbe4955"
http://cw.hubwiz.com/card/c/web3.js-1.0/1/8/8/
这个就是新加的 签名那个
要对访问合约做身份验证
这个已经后台做好了。 我现在是要把参数做sha3的计算
在做sha3计算的时候, 我需要用web3j来实现 web3js里面的web3.utils.soliditySha3
Some sports-related dapps need to capture mobile device motion/sport data.
调用authorize方法后报错:Invoker authorize exception:java.lang.reflect.InvocationTargetException
这该咋办?
com.tokenpocket.lab:wallet-sdk:1.1.8 下载 不了。
maven { url 'https://dl.bintray.com/tokenpocket/Maven' }
这个无法下载sdk了。能放一个aar包或者jar包嘛
This is my android authorize code:
Authorize authorize = new Authorize();
List blockchains = new ArrayList();
blockchains.add(new Blockchain("ethereum", "56"));
authorize.setBlockchains(blockchains);
authorize.setAction("login");
authorize.setActionId(String.valueOf(System.currentTimeMillis()));
authorize.setProtocol("TokenPocket");
authorize.setVersion("v1.0");
authorize.setDappName("testApp");
authorize.setMemo("demo");
TPManager ins = TPManager.getInstance();
After onsuccess,How to verify the correctness of the signature on the server. For example, this is the code of metamask:
TypedData := &eip712.TypedData{
Types: eip712.Types{
"EIP712Domain": []eip712.Type{
{Name: "name", Type: "string"},
{Name: "version", Type: "string"},
{Name: "chainId", Type: "uint256"},
},
"login": []eip712.Type{
{Name: "wallet", Type: "address"},
},
},
Domain: eip712.TypedDataDomain{
Name: "login",
},
PrimaryType: "login",
Message: eip712.TypedDataMessage{
"wallet": address,
},
}
pubKey, err := beeCrypto.RecoverEIP712(common.Hex2Bytes(sign), TypedData)
This is a security issue. I hope you can let me know. thank you.
TP Wallet Version: 2.0.4
使用下载的TP SDK,无法拉起登录。
Safari输入 tpoutside:// 也无法拉起, "address is invalid"
使用以下代码,始终找不到网络。
login.blockchains = @[
[TPChainObj objWithNetwork:@"matic" chainId:@"1"],
[TPChainObj objWithNetwork:@"eth" chainId:@"56"],
[TPChainObj objWithNetwork:@"ethereum" chainId:@"56"]
];
login.wallet = @"TokenPocket";
[TPApi sendObj:login];
https://github.com/TP-Lab/TPUnitySDK No longer supported
iOS SDK sign message length is invalid
使用iOS demo 登录没有问题,签名弹出message length is invalid
安卓使用SDK进行信息签名:
签名完成后如何对已签名的信息进行校验?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.