Technology
-
DQtech Column | Learn from DEX about PlatON Application Development – Android (V)
Author Dex_DQT In this chapter we will build the import function for the Mnemonic Phrase/key/wallet file Create the main page for importing This page uses ATON’s SmartTabLayout, which was previously used to support ViewPager in the ATON project, but I modified it to support ViewPager2. Please refer to the SmartTabLayout class in the com.platon.aton.widge.table package. Then create the ImportActivity class in the activity package, which inherits from the BaseActivity class. Also modify all other Activities to inherit from this class.The code of the BaseActivity class is as follows: : This…
-
DQtech Column | Learn from DEX about PlatON Application Development – Android (IV)
Author Dex_DQT In this chapter we will learn how to generate a secret key from a mnemonic and save it as a file Create a page to confirm mnemonics For the specific layout code, see the file res/layout/activity_verify_mnemonic_phrase.xmlThe page effect is as follows: Then add the VerifyMnemonicPhraseActivity class to the Activity directory, the code is parsed as follows: Create WordInfo class to store the following information about the current word:1, the selected state2, the word itself3, the index of the word in the selected list4, the index of the word…
-
DQtech Column | Learn from DEX about PlatON Application Development – Android (III)
Author Dex_DQT This chapter we start to refer to ATON to build a page——Actually in order to facilitate the use of UI resources for the Android version of Digging, we will basically refer to ATON in the future. Due to the layout code of Android is relatively large, we won’t post it one by one, and you can download the source code by yourself to see. Splash Activity Create activity_splash.xml in the directory res/layout with the following layout code. The ConstraintLayout is used here, and the SplashActivity class is created…
-
DQtech Column | Learn from DEX about PlatON Application Development – Android (II)
Author Dex_DQT In the previous chapter, we finished setting up the environment and calling the SDK to get the balance of the specified wallet, but the calls provided by the SDK have to be used in a sub-thread, which is troublesome. Therefore, in this chapter, we would encapsulate the interface through JSONRPC, which is easier to be used. Introduce the retrofit package Open app/build.gradle, as follow Add dependency injections shown in follows: modify PlatonApi as follows: This project uses retrofit and koltin’s concurrency to implement http calls. It should be…
-
DQtech Column | Learn from DEX about PlatON Application Development – Android (I)
Author Dex_DQT From now, we will begin to learn how to build the Android version of Digging. In this chapter, we will build the environment and create the function to getting the wallet balance. Build Project This article uses koltin for development, and the IDE is Android. Open Android studio and create a new project. Here we choose Empty Activity The development language is koltin, and the minimum supported SDK is API 21 After the project is created, the directory is as follows: Then we introduce the SDK of Platon’s…
-
DQtech Column | Learn from DEX about PlatON Application Development – Javascript (X)
In this chapter, we will implement the function of exporting Digging interface, so that web pages can call it. At the same time, this chapter is also the final chapter of JavaScript. Write Import Interface In the previous chapter, we added the following code to the manifest.json, so that the multi networks we added can send requests normally. content_ scripts is a js script running in the context of a web page. It can read the dom of a web page or modify it and can be used as a…
-
DQtech Column | Learn from DEX about PlatON Application Development – Javascript (IX)
Author Dex_DQT In this chapter, we will learn how to receive the Commission reward, redeem the Commission and realize the function of multiple network nodes. Write a page that displays a list of wallet delegates Create my-delegate-table.vue in the component directory, as shown in the follows:Some code is as follow: Then uses this component in main-page.vue, and the effect is shown in the figure below: Write the logic to get the delegate list add the following code in the Delegated management of background.js: Because the node does not provide an…
-
DQtech Column | Learn from DEX about PlatON Application Development – Javascript (VIII)
In this chapter, we will learn to realize the multi account switching between test network and main network, as well as the function of entrusting lat. As there are no pledge nodes in the development and test network of PlatON, we would implement the delegation function in the main network in this chapter Add NetworkManager Previously, the connection address of the test network was placed in the transaction manager. In order to support multi network switching, we extracted the node connection into the NetworkManager. Add the code of NetworkManager in…
-
DQtech Column | Learn from DEX about PlatON Application Development – Javascript (Engineering Transformation)
Some readers responded that by clicking the plug-in, the page to unlock the password will appear in a pop-up box, as shown in the following figure: Mnemonic pages are displayed in a pop-up box, which brings a bad user experience. Therefore, before starting the teaching of Chapter 6, we should transform the project to achieve the effect that some pages must be opened in the form of tab. Modify the HTML File in the Public Directory Change the file name index.html to home.html Create popup.html in this directory and copy…
-
DQtech Column | Learn from DEX about PlatON Application Development – Javascript (VII)
In this chapter, we would complete the transaction list, check whether the transfer is successful and export the wallet secret key. Create transaction list page Write the transaction list and transaction record into 2 different components respectively, then create pending pending-transaction-table.vue file in component directory, some codes are as follows: The fields displayed here are: 交易哈希 Transaction hash 接收地址 Receiving address 当前状态 Current state 发送时间 Sending time 所在区块 Block 发送LAT数量 Number of LATs sent 状态 Statuse There are two statuses: being confirmed and pending Open the page main-page.vue and add…
-
DQtech Column | Learn from DEX about PlatON Application Development – Javascript (VI)
In this chapter, we will learn the functions of wallet transfer and query transaction records. Due to the variety of contents, it would be divided into two chapters. Build Master Page Create main-page.vue file in the page director. Part of the code is as follows: The page is as follows: The transaction record table is extracted into a Vue component, transaction-table.vue, and placed in the component directory on this page, which can reduce the code of main-page.vue and better maintain. Next, build the page to send lat Build a Page…
-
DQtech Column | Learn from DEX about PlatON Application Development – Javascript (V)
In this chapter, we will import mnemonics, save secret keys, and reset passwords through mnemonics Build a Page for Importing Mnemonics In the page directory, create the file import-seed-phrase-page.vue. ssome codes are as follows: The interface is as follows: Next, let’s start writing logic. In order to reuse the code of generating secret keys through mnemonics in Chapter 4, we extract the code of generating secret keys in Chapter 4 into a tool class. Create file mnemonicUtil.js in src/util directory, as shown below: The code of mnemonicUtil.js is as below:…
-
Community Selections | Connect DApp to ATON through WalletConnect
Author lzb Introduction ATON 1.1.0 Version has already supported walletconnect protocol. Users can realize the connection and transaction signature with DApp on the premise of ensuring that the private key does not leave the mobile device and is not exposed to DApp. In this chapter we will transform the Digging of browser version to realize the transfer function through WallectConnect. What is WalletConnect WalletConnect is an open protocol for secure communication between DApps and wallets. The protocol establishes a remote pairing between two applications and / or devices, and transmits the…
-
Community Selections | MetaMask with PlatON SDK to Build, Sign and Send WASM Transactions
Author : HT.HUANG This tutorial will show developers how to interact with PlatON WASM contract using MetaMask plugin wallet, it also applies to EVM contracts. Prerequisite OS: Windows 10/Ubuntu 18.04 node: 12.22.8 web browser: firefox/chrome Install Usage start web server The following information will be printed install metamask plugin in your browserYou can find tutorial here. Add PlatON Dev Network to metamaskYou can find tutorial here. Import private key into your metamask walletPrivate key used in demo Open the web pageVisit http://localhost:9011/index.html You can replace localhost with public IP if you are not…
-
Community Selections | Reform Digging to Support the Transfer Function of ATON WallectConnect
ATON 1.1.0 Version has already supported walletconnect protocol. Users can realize the connection and transaction signature with DApp on the premise of ensuring that the private key does not leave the mobile device and is not exposed to DApp. In this chapter we will transform the Digging of browser version to realize the transfer function through WallectConnect. Create project This function is built by deleting the source code in Learning from DEX Platon Application Development – JavaScript. The transformed project directory is as follows: We only keep main-page.vue ands end-lat-page.vue…