2.2.35 • Published 12 months ago

@onramper/widget v2.2.35

Weekly downloads
45
License
MIT
Repository
github
Last release
12 months ago

Onramper widget

Onramper allows your users to buy cryptocurrency with fiat, directly from your website or app.

For docs and examples visit: docs.onramper.com

Installation
# Using yarn
$ yarn add @onramper/widget

# Using npm
$ npm install @onramper/widget
Code snippet
import OnramperWidget from "@onramper/widget";

export default function OnramperWidgetContainer() {
  return (
    <div style={{maxWidth: '482px',  maxHeight: '660px',  height: '100%',  width: '100%'}}>
      <OnramperWidget
        color="#0316C1"
        defaultAmount={200}
        defaultCrypto="BTC"
        API_KEY="pk_live_YOUR-API-KEY"
      />
    </div>
  )
}
Live example & customization

While importing the widget as a React component, you can customize it using the component props below. CodeSandbox

Component props

NameTypeExampleDefault value
defaultCryptoString?"ETH"undefined
defaultAmountNumber?500100
defaultAddrsObject?{"BTC":["ADDR1"], "ETH":["ADDR2"]}{}
onlyCryptosString[]?["BTC", "ETH", "NEO"]undefined
excludeCryptosString[]?["ETH", "NEO"]undefined
onlyGatewaysString[]?["Moonpay", "Wyre"]undefined
colorString?"#000000""#31a5ff"
API_KEYString"pk_live_YOUR-API-KEY"-
selectGatewayByString"performance""price"

Customize

You can pass the following arguments to customize the widget

ParameterDescription
defaultCryptoSelect a specific cryptocurrency by default. Should be specified the cryptocurrency code.
defaultAmountPositive integer representing the base amount of fiat to be filled in the widget. Should be indicated in USD, for other currencies, a rounded aproximated conversion will be automatically applied.
addressesA stringified JSON with the wallet addresses of the user. The keys should be the cryptocurrency code and the value a list containing the user addresses. Can be more than one address per wallet and more than one cryptocurrency.
onlyCryptosA comma-separated list of crypto codes to include. Only this cryptos will be shown to the user.
excludeCryptosA comma-separated list of crypto codes to exclude. This cryptos will be excluded from the list of available cryptos..
onlyGatewaysA comma-separated list of gateways to enable. Only these gateways will be shown to the user for selection.
colorColor to change the highlight of the widget. Should be an hex color.
2.2.35

12 months ago

2.2.34

1 year ago

2.2.33

1 year ago

2.2.31

1 year ago

2.2.32

1 year ago

2.2.28

1 year ago

2.2.29

1 year ago

2.2.27

1 year ago

2.2.30

1 year ago

2.2.26

2 years ago

2.2.24

2 years ago

2.2.25

2 years ago

2.2.22

2 years ago

2.2.23

2 years ago

2.2.21

2 years ago

2.2.18

2 years ago

2.2.19

2 years ago

2.2.20

2 years ago

2.2.17

2 years ago

2.2.15

2 years ago

2.2.16

2 years ago

2.2.13

2 years ago

2.2.14

2 years ago

2.2.11

2 years ago

2.2.7

2 years ago

2.2.12

2 years ago

2.2.10

2 years ago

2.2.9

2 years ago

2.2.8

2 years ago

2.2.6

3 years ago

2.2.4

3 years ago

2.2.3

3 years ago

2.2.2

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

1.1.14

3 years ago

1.1.13

3 years ago

1.1.12

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.1

3 years ago

1.1.2

3 years ago

1.1.0

3 years ago

1.0.15

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.2.0

3 years ago

0.1.13

3 years ago

0.1.12

3 years ago

0.1.11

3 years ago

0.1.10

3 years ago

0.1.8

3 years ago

0.1.9

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.4

3 years ago

0.1.5

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

4 years ago