v3

Coming from v1 & v2

Every btcdirect(...) call of the v1 & v2 widget, and what it is on the v3 element.

Everything the v1 & v2 widget does, the v3 element does too. What changes is the shape: one element configured by attributes instead of a script configured by method calls. Your v1 & v2 integration keeps working as it is; move when it suits you.

The script and its bundles

fiat-to-coin bundle

<btcdirect-journey>

With subjects offer_fiat_to_coin and onboarding.

coin-to-fiat bundle

<btcdirect-journey>

With subjects offer_coin_to_fiat and onboarding.

onboarding bundle

<btcdirect-journey>

With subjects onboarding.

transaction-history bundle

<btcdirect-transactions>

See Transactions and recurring buys.

dollar-cost-average bundle

<btcdirect-savings>

See Transactions and recurring buys.

init options

token

api-key

Same value.

locale

locale

The language is what counts: nl-NL and nl both give Dutch.

theme

theme

Same values.

selector

—

Not needed: you place the element where you want it.

userIdentifier

user-identifier

Same value.

returnUrl

return-url

Same value.

partnerOrderIdentifier

partner-order-identifier

Same value.

walletConfirmationRequired

wallet-confirmation-required

Same value.

Calls before the widget loads

currencies

currencyfiat-currency

crypto becomes currency, fiat becomes fiat-currency.

order

fiat-amountcrypto-amount

Whichever of the two the call named.

payment-method

payment-method

Same value.

lock-cryptocurrency

fixed-currency

Set to true.

wallet-addresses

wallets

A property rather than an attribute, holding the same list: currency, address, memo, label and your id.

wallet-address-selected

wallet-addresssource-wallet

wallet-address on a buy, source-wallet on a sell.

partner-order-identifier

partner-order-identifier

Same value.

attempt-direct-confirm

direct-confirm

Set to true.

include-dca

<btcdirect-savings>

Place the recurring-buy element beside the trading one.

baseCurrencyquoteCurrency

currencyfiat-currency

Same values.

quoteCurrencyAmount

fiat-amount

As a decimal string.

baseCurrencyAmount

crypto-amount

As a decimal string.

walletAddresswalletAddressTag

wallet-addresswallet-memo

Same values.

fixedAmountfixedCurrencyfixedPaymentMethod

fixed-amountfixed-currencyfixed-payment-method

true or false.

showWalletAddress

hide-wallet-address

The opposite way round: showWalletAddress false is hide-wallet-address true.

returnUrlpartnerOrderIdentifier

return-urlpartner-order-identifier

Same values.

Calls while the customer uses it

wallet-address-confirmation

confirmWalletAddress(address)

See Methods.

wallet-address-confirmation-canceled

cancelWalletAddress()

See Methods.

transaction-id-confirmation

confirmSellTransaction(orderId, transactionId)

Now also tells you whether it was accepted.

coin-to-fiat-order-canceled

cancelSellTransaction()

See Methods.

locale

locale

Set the attribute; it takes effect at once.

logout

signOut()

See Methods.

Events

The v3 events are dispatched on the element instead of on window. Every v1 & v2 event name below starts with btcdirect-embeddable-, left out for space.

fiat-to-coin-order-confirmed

btcdirect:order-created

amount is a decimal string and currency a ticker, where v1 & v2 sent a number and iso:EUR.

coin-to-fiat-order-requested

btcdirect:sell-transaction-requested

amount is a decimal string.

wallet-address-confirmation-requested

btcdirect:wallet-confirmation-requested

Same detail.

registration-started

btcdirect:registration-started

No detail.

registration-completed

btcdirect:onboarding-complete

No detail.

user-signed-in

btcdirect:signed-in

No detail.

user-identified

btcdirect:identified

No detail.

user-signed-out

btcdirect:signed-out

No detail.