Skip to content

Instantly share code, notes, and snippets.

Avatar

Nattapon Nimakul totiz

View GitHub Profile
View NattaponV2.sol
pragma solidity ^0.6.0;
interface ERC20Basic {
// uint public totalSupply;
function balanceOf(address who) external view returns (uint);
function transfer(address to, uint value) external;
event Transfer(address indexed from, address indexed to, uint value);
}
contract NattaponV2 is ERC20Basic {
View NattaponToken.sol
/**
*Submitted for verification at Etherscan.io on 2017-07-05
*/
pragma solidity ^0.4.11;
/**
* Math operations with safety checks
*/
View libra_service_api_create_wallet.sh
curl --location --request POST "https://libraservice2.kulap.io/createWallet" \
--header "Content-Type: application/json" \
--data "{
\"minting\": true
}"
@totiz
totiz / libra_wallet_transfer.js
Created Jul 28, 2019
Libra Transfer with javascript
View libra_wallet_transfer.js
const { LibraWallet, LibraClient, LibraNetwork } = require('kulap-libra')
const BigNumber = require('bignumber.js')
async function createWallet() {
// Generate/get an account
// const wallet = new LibraWallet()
const wallet = new LibraWallet({mnemonic: 'finish topple cannon hammer eyebrow disorder enter reject long then tragic hammer diagram spy mom weapon amateur cup census sketch review consider galaxy foam'})
const account = wallet.newAccount()
return {
@totiz
totiz / libra_wallet_query_balance.js
Last active Jul 28, 2019
Query Balance in Libra Blockchain with javascript
View libra_wallet_query_balance.js
const { LibraWallet, LibraClient, LibraNetwork } = require('kulap-libra')
const BigNumber = require('bignumber.js')
async function createWallet() {
// Generate an account
const wallet = new LibraWallet()
const account = wallet.newAccount()
return {
address: account.getAddress().toHex(),
View libra_wallet.js
const { LibraWallet, LibraClient, LibraNetwork } = require('kulap-libra')
const axios = require('axios')
const BigNumber = require('bignumber.js')
async function createWallet() {
// Generate an account
// const wallet = new LibraWallet()
const wallet = new LibraWallet({
mnemonic: 'order curtain live pact market tissue rally run dolphin shuffle convince napkin spot main suffer segment excite toilet ceiling cute master six agent narrow'
});
@totiz
totiz / libra_wallet_mint.js
Last active Jul 28, 2019
Libra Wallet Minting
View libra_wallet_mint.js
const { LibraWallet, LibraClient, LibraNetwork } = require('kulap-libra')
const BigNumber = require('bignumber.js')
async function createWallet() {
// Generate an account
const wallet = new LibraWallet()
const account = wallet.newAccount()
return {
address: account.getAddress().toHex(),
@totiz
totiz / libra_create_wallet.js
Last active Jul 28, 2019
Create libra wallet with npm i kulap-libra
View libra_create_wallet.js
async function createWallet() {
const { LibraWallet } = require('kulap-libra')
// Generate an account
const wallet = new LibraWallet() // create new wallet with BIP39
const account = wallet.newAccount() // Derivation paths to "LIBRA WALLET: derived key$0"
return {
address: account.getAddress().toHex(), // Get full address
mnemonic: wallet.config.mnemonic // Your super secret key
View Libra query balance return.json
{
"address": "08c7bdf66f0ac29e154e9c05a8c00cc661f35a63a74d6f63dcc290c0d70e18c3",
"balance": "100"
}
View Libra query balance.json
{
"address": "08c7bdf66f0ac29e154e9c05a8c00cc661f35a63a74d6f63dcc290c0d70e18c3"
}
You can’t perform that action at this time.