BSV
$53.36
Vol 28.32m
-0.58%
BTC
$95308
Vol 39861.56m
-2.11%
BCH
$444.13
Vol 337.06m
-2.17%
LTC
$100.32
Vol 808.16m
-0.36%
DOGE
$0.31
Vol 4742.4m
-4.27%
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

StreamSail Pro sets a new standard in live streaming: AI-powered engagement meets blockchain transparency
StreamSail Pro makes streaming not just easier, but more engaging and profitable with blockchain, interactive in-stream games, customizable overlays and...
October 23, 2024
Global Ledger partners with BSV Association to bring full support and coverage with AML Solutions and Integration for the BSV blockchain
As a new service provider of BSV Association, Global Ledger will provide the tools and on-chain analytics focusing on security,...
September 26, 2024
Advertisement
Advertisement
Advertisement