-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NEO Unified dApi (NUDApi) #1
Comments
Is it better to add .neo in front of .event |
@vincentOpenSource Changed, thanks. |
I tried to add event listeners. Lines 119 to 120 in f77e4a1
@vincentOpenSource Teemo better have native event listeners, too. |
根据以下原则各个钱包进行统一修改:
O3:
NEOLine:
Teemo:
为了尽量保持钱包dApi的兼容性,保证已经使用各个钱包的Dapp的正常运行,原来的接口尽量保留,改动以增加接口的形式来做。 |
Teemo的DAPI是通过chrome注入来实现的,在页面未注入完成DAPI的时候是无法调用Teemo.NEO 下的方法的,否则会报错。所以基于Teemo开发的DAPP 通常做法,是使用window原生的addEventListener方法监听Teemo.NEO.EVENT.READY 事件。当 READY之后再去调用Teemo相关DAPI 。所以最好还是使用原生window.addEventListener。或者单独对 READY做window.addEventListener,其他的 event 提供addEventListener,removeEventListener 方法 |
@vincentOpenSource
我觉得后者的处理方法更好。NEOLine目前也是这么做的。 补充:更好的解决方案可能是将add/removeEventListener定义成静态方法。 |
NEO Unified dApi (NUDApi)
Although neo now have a dApp Platform Provider Interface standard, A dApp that uses one dApi wallet cannot invoke another dApi wallet, which is not so convinient for dApp developers.
Purpose
Neo Unified dApi(NUDApi) is to enable dApp to use one unified interface to invoke all wallets that aggrees to the dApi standard.
What need to be done
Now this project is CODE-SPECIFIED, but we should aim at CONFIGURE.
To accomplish that, we should unify top level interfaces and events.
${PROVIDER}.NEO
${PROVIDER}.NEO.EVENT.READY
Suggestions
Any suggestions would be welcomed.
The text was updated successfully, but these errors were encountered: