Native Coin

Native Coin React Widgets and Modals

Get Method Widgets and Modals

To use the widgets in React components you need to import the Widget component:

import { Widget } from '@paytweed/frontend-sdk-react'

Every widget has an optional parameter called settings.

NameTypeDefaultDescription

fullScreen

Boolean

true

Should widget be shown fullscreen

hideMenu

Boolean

true

Deprecated

preventClose

Boolean

true

Hides close button

You can provide them to the widget like this:

<Widget settings={{hideMenu: false}}>

Exchange

Description

Exchange between native coins (ETH → XTZ for ex.).

Fees will be taken from the source currency.

Parameters

NameTypeRequiredDefaultDescription

amount

String

✔️

Amount of source coin to be sent

fromBlockchainId

String

✔️

Source blockchain id

toBlockchainId

String

✔️

Destination blockchain id

Usage Example

<Widget.Coin.Exchange amount="1.23" fromBlockchainId="ethereum" toBlockchainId="tezos">

Send to user

Description

Sends a token to another user on the platform by its user ID. The user will get a Sign Transaction widget to approve the transaction.

Parameters

NameTypeRequiredDescription

blockchainId

String

✔️

Blockchain

amount

String

✔️

Amount of crypto

onClose

() => void

Close callback

onError

() => void

Error callback

onSuccess

() => void

Success callback

userId

String

✔️

Id of user to send crypto to

Usage Example

const App = () => <Widget.Coin.SendToUser blockchainId='ethereum' amount='1.23' userId='1' />

Send to wallet

Description

Sends a token to another wallet by its wallet address. The user will get a Sign Transaction widget to approve the transaction.

Parameters

NameTypeRequiredDescription

blockchainId

String

✔️

Blockchain

value

String

✔️

Amount of crypto

onClose

() => void

Close callback

onError

() => void

Error callback

onSuccess

() => void

Success callback

walletAddress

String

✔️

Address of wallet to send crypto to

Usage Example

const App = () => (
  <Widget.Coin.SendToWallet
    blockchainId='ethereum'
    value='1.23'
    walletAddress='0x15b895d74582daea01be8e5be264243d8c9d7bb1'
  />
)

GET Native Coin Widgets and Modals

To use the widgets in React components you need to import the Widget component:

import { Widget } from '@paytweed/frontend-sdk-react'

Every widget has an optional parameter called settings.

NameTypeDefaultDescription

fullScreen

Boolean

true

Should widget be shown fullscreen

hideMenu

Boolean

true

Deprecated

preventClose

Boolean

true

Hides close button

You can provide them to the widget like this:

<Widget settings={{hideMenu: false}}>

Exchange

Description

Exchange between native coins (ETH → XTZ for ex.).

Fees will be taken from the source currency.

Parameters

NameTypeRequiredDefaultDescription

amount

String

✔️

Amount of source coin to be sent

fromBlockchainId

String

✔️

Source blockchain id

toBlockchainId

String

✔️

Destination blockchain id

Usage Example

<Widget.Coin.Exchange amount="1.23" fromBlockchainId="ethereum" toBlockchainId="tezos">

Send to user

Description

Sends a token to another user on the platform by its user ID. The user will get a Sign Transaction widget to approve the transaction.

Parameters

NameTypeRequiredDescription

blockchainId

String

✔️

Blockchain

amount

String

✔️

Amount of crypto

onClose

() => void

Close callback

onError

() => void

Error callback

onSuccess

() => void

Success callback

userId

String

✔️

Id of user to send crypto to

Usage Example

const App = () => <Widget.Coin.SendToUser blockchainId='ethereum' amount='1.23' userId='1' />

Send to wallet

Description

Sends a token to another wallet by its wallet address. The user will get a Sign Transaction widget to approve the transaction.

Parameters

NameTypeRequiredDescription

blockchainId

String

✔️

Blockchain

value

String

✔️

Amount of crypto

onClose

() => void

Close callback

onError

() => void

Error callback

onSuccess

() => void

Success callback

walletAddress

String

✔️

Address of wallet to send crypto to

Usage Example

const App = () => (
  <Widget.Coin.SendToWallet
    blockchainId='ethereum'
    value='1.23'
    walletAddress='0x15b895d74582daea01be8e5be264243d8c9d7bb1'
  />
)

Last updated