Skip to content

Instantly share code, notes, and snippets.

View tranvictor's full-sized avatar

Victor Tran tranvictor

View GitHub Profile
{
"tokens": {
"OMG": {
"name": "OmiseGO",
"decimals": 18,
"address": "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07",
"minimalRecordResolution": "1000000000000000",
"maxPerBlockImbalance": "775091297865175138304",
"maxTotalImbalance": "1096640332676811325440",
"internal use": true,
{
"tokens": {
"OMG": {
"name": "OmiseGO",
"decimals": 18,
"address": "0x5b9a857e0C3F2acc5b94f6693536d3Adf5D6e6Be",
"minimalRecordResolution": "1000000000000000",
"maxPerBlockImbalance": "775091297865175138304",
"maxTotalImbalance": "1096640332676811325440"
},
{
"tokens": {
"OMG": {
"name": "OmiseGO",
"decimals": 18,
"address": "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07",
"minimalRecordResolution": "1000000000000000",
"maxPerBlockImbalance": "439794468212403470336",
"maxTotalImbalance": "722362414038872621056",
"internal use": true,
def callUpdateToKyberAPI(email, addresses, timestamps)
key = Rails.application.secrets.kyber_key
nonce = (Time.now.to_f * 1000).to_i
msg = URI.encode_www_form(
[[:addresses, addresses], [:nonce, nonce], [:timestamps, timestamps], [:user, email]])
uri = URI.parse("https://mainnet-data.kyber.network/update-user-addresses")
https = Net::HTTP.new(uri.host,uri.port)
https.use_ssl = true
req = Net::HTTP::Post.new(
uri.path, initheader = {
kr:
dictionary:
name: &name 이름
email: &email 이메일
password: &password 비밀번호
submit: &submit 제출
kyber_swap: &kyber_swap KyberSwap
kyber_go: &kyber_go KyberGO
subscribe: &subscribe 구독하기
subscribe_news: 뉴스레터 구독하기
# KyberWidget
Payment button (widget) to allow users to pay for goods from tokens supported by Kyber, yet the merchants/ vendors can accept in whichever token they prefer.
## What does it do
The widget provides a friendly and convenient user interface for users to use ERC20 tokens to pay to an ETH address. Users can use different wallets of choice (for example, keystore, trezor, ledger, private key and metamask) to sign the transaction and make the payment, the widget will broadcast the transaction to the Ethereum network automatically and notify the app (vendors) about the transaction.
## How to use the widget
All you have to do is to place a button with proper url to your website.
Eg.

KyberWidget

Payment button (widget) to allow users to pay for goods from tokens supported by Kyber, yet the merchants/ vendors can accept in whichever token they prefer.

What does it do

The widget provides a friendly and convenient user interface for users to use ERC20 tokens to pay to an ETH address. Users can use different wallets of choice (for example, keystore, trezor, ledger, private key and metamask) to sign the transaction and make the payment, the widget will broadcast the transaction to the Ethereum network automatically and notify the app (vendors) about the transaction.

How to use the widget

All you have to do is to place a button with proper url to your website.

Eg.

KyberWidget

Payment button (widget) to allow users to pay for goods from tokens supported by Kyber, yet the merchants/ vendors can accept in whichever token they prefer.

What does it do

The widget provides a friendly and convenient user interface for users to use ERC20 tokens to pay to an ETH address. Users can use different wallets of choice (for example, keystore, trezor, ledger, private key and metamask) to sign the transaction and make the payment, the widget will broadcast the transaction to the Ethereum network automatically and notify the app (vendors) about the transaction.

How to use the widget

All you have to do is to place a button with proper url to your website.

Eg.

KyberWidget for Etheremon

KyberWidget for Etheremon allow users to pay for catchable monsters from any of tokens supported by Kyber.

Demo

A simple demo is available at https://widget.knstats.com/shop/. If you specify https://kyberpay-sample.knstats.com/callback as callback URL, you could go to https://kyberpay-sample.knstats.com/list to see postback transaction list.

How to use the widget

Include widget's CSS and javascript

KyberNetworkProxyContract.trade(
'0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', //ETH
srcAmount, // uint srcAmount
'0xaD6D458402F60fD3Bd25163575031ACDce07538D', //DAI for Rospten
web3.eth.accounts[0], // send to MetaMask owner account
maxDestAmount, //uint maxDestAmount
minConversionRate, //uint minConversionRate
0, //uint walletId
{ value: srcAmount },
function(error, result)