RateLimited°C
11-06-2024
BSV
$47.99
Vol 20.59m
5.68%
BTC
$70632
Vol 58571.42m
4.17%
BCH
$347.01
Vol 284.55m
5.32%
LTC
$66.65
Vol 399.3m
1.14%
DOGE
$0.18
Vol 5581.56m
10.86%
Getting your Trinity Audio player ready...

Following the Badge service, the platform “DotWallet for Developers” and sCrypt are working together again! It is aimed to enable developers to build Dapps based on sCrypt easily and make interactions with DotWallet available for them through the new API , lightening the load for developers so that they can build superior Dapps.

From now on, when developers build Dapps on the platform “DotWallet for Developers”, they can enjoy one-click quicker login and get connected with the massive amount of users on DotWallet. Meanwhile, at the moment they are writing smart contracts based on sCrypt, they can have direct interaction with the DotWallet. As the latter will act accordingly in line with the running results of the sCrypt smart contract. Those actions like: user’s signature, payment sent and received through the wallet, payment sent and received through “Cards” powered by Badge service, UTXO selection etc. This whole process can be done completely on chain, without the third party intervention, so that decentralization is truly realized.

The APIs opened this time are as follows:

1. listunspent: an interface for querying the available UTXO, used to make transactions with non-standard scripts on the DAPP side. If successful, the available utxo array will be returned;

2. getSignature: an interface for signing any transaction template. Dapp constructs the unsigned transaction, which is submitted by this interface to the wallet for signature. If successful, unlockscript or Signature will be returned;

3. sendRawTransaction: an interface for transaction. This one is relatively simple, mainly in charge of broadcasting the transaction. If successful, transaction ID will be returned;

4. publickey∶ to get a usable public key;

5. getRawChangeAddress∶ to get a change address;

6. balance: to check the wallet balance;

7. requestAccount∶ establish a connection with the wallet and request permission;

Demo–Tic-Tac-Toe

Here is a simple Dapp “Tic-Tac-Toe” demo to help developers better understand the above interfaces. (This game is only used as a functional demonstration, the interface design and user experience have not been optimized.)

|Game address:http://47.92.84.91:33300/

This application is very user-friendly, only two DotWallet accounts with BSV balance is required. Here’s the guidance:

Step one: use a browser to log in DotWallet A account, and open the game window in the same browser, then click “login dotwallet” to authorize DotWallet A account login to obtain the account balance.

Step two: enter the number in the Bet amount, the minimum is 20000sat., then click “Start Bet”-“Join” to jump and open a new game window.

Step three: log out the DotWallet A account and log in the DotWallet B account. Click “login dotwallet” in the new game window to authorize DotWallet B account login to obtain the account balance and deduct the corresponding betting amount.

At this point, the same BSV betting by the two accounts will be locked in the contract without any third party intervention. Only the winning one is allowed to take the coins in the contract and send them directly to the DotWallet. If no one wins in the end, the coins bet by the two players will be automatically returned to the wallet.

New API documentation is available now, for more information, please visit the platform “DotWallet for Developers”:

https://developers.dotwallet.cn/documents/zh/#dapp

— — — —

To learn more;

sCrypt official website:https://scrypt.io

TicTacToe source code:https://github.com/sCrypt-Inc/tic-tac-toe

Touchstone source code:https://github.com/dotwallet/touchstone

DotWallet for Developers:https://developers.dotwallet.com/

Recommended for you

SmartLedger launches WinScope: A transparent, AI-driven decentralized autonomous sports prediction platform empowering bettors with real-time insights and community governance
SmartLedger is setting up a new standard for informed sports prediction with WinScope, a platform that utilizes AI to empower...
November 5, 2024
CBI partners with Zumo to advance innovation in sustainability of digital assets
The Commercial Bank International strikes a partnership with Zumo to explore digital asset sustainability in developing solutions as the UAE...
November 5, 2024
Advertisement
Advertisement
Advertisement