3.0.7 • Published 2 years ago

@credenza-web3/transaction-ui v3.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Credenza Transaction UI (DEPRECATED)

----------------------------------------------------------------------------------------------

Transaction UI is now a part of @credenza-web3/passport. This package should no longer be used

----------------------------------------------------------------------------------------------

Magic

Credenza passport requires magic if magicLink(email) login is required

<script src="https://auth.magic.link/sdk" type="application/javascript"></script>

Ethers.js

Ethers.js is required

<script src="https://cdn.ethers.io/lib/ethers-5.6.umd.min.js" type="application/javascript"></script>

Stripe

Credenza uses stripe for payments.

<script src="https://js.stripe.com/v3/"></script>

Credenza passport

Credenza Passport is required to complete payments.

<script src="https://unpkg.com/@credenza-web3/transaction-ui/dist/transaction-ui.umd.js"></script>
or
<script src="https://cdn.jsdelivr.net/npm/@credenza-web3/transaction-ui/dist/transaction-ui.umd.js"></script>

Installation

with npm

npm install @credenza-web3/transaction-ui

with yarn

yarn add @credenza-web3/transaction-ui

with pnpm

pnpm install @credenza-web3/transaction-ui

or include a script tag

<script src="https://unpkg.com/@credenza-web3/transaction-ui/dist/transaction-ui.umd.js"></script>

Usage

import {Passport} from '@credenza-web3/passport'
import {TransactionUI} from '@credenza-web3/transaction-ui'

or

const Passport = window.CredenzaPassport
const TransactionUI = window.CredenzaTUI
const passport = new Passport() // See passport docs for more...
await passport.init()

const transactionUI = new window.CredenzaTUI({
  passport,
  config: {
    title: string,
    subtitle: string,
    imageUrl: string, // https://website.com/image.png
    payments?: {
      credenzaStoredValue?: {
        disabled?: boolean //default - false
      },
      stripe?: {
        disabled?: boolean // default - false
      }
    },
    // This will help credenza to get a price and figure out a token to be transferred
    token?: {
      address: string, // contract address
      tokenId?: string, // token id if exists
      amount?: number  // amount of tokens if exists
      typeId?: number // if buying membership and typeId exists. Should be either tokenId or typeId
    },
    email?: {
      templateId?: string // For custom email template usage
    }
  },
})

Apple Pay

You must verify your domain. https://support.stripe.com/questions/enable-apple-pay-on-your-stripe-account Enabled by default on all supported devices and registered domains.

Google Pay

Is enabled on all supported devices by default

Transaction UI static properties

TransactionUI.chains (enum) Supported chains

Methods

Close TransactionUI

await transactionUI.close()

Events

Triggers when transaction completed

transactionUI.onTransaction((data) => {
  console.log('Payment data:', data)
})

Triggers when an error occurs

transactionUI.onError((errorData) => {
  console.log('Error', errorData)
})
3.0.7

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

2.0.3

2 years ago

2.1.0

2 years ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

0.5.18

2 years ago

0.5.16

2 years ago

0.5.17

2 years ago

0.5.15

2 years ago

0.5.14

2 years ago

0.5.13

2 years ago

0.5.12

2 years ago

0.5.11

2 years ago

0.5.10

2 years ago

0.5.9

2 years ago

0.5.8

2 years ago

0.5.7

2 years ago

0.5.6

2 years ago

0.5.5

2 years ago

0.5.4

2 years ago

0.5.3

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.8

2 years ago

0.4.7

2 years ago

0.4.6

2 years ago