Passport SDK v8
  • Overview
  • Account Lifecycle
  • Integration
    • Client Side Enablement
    • Credenza Presence (Optional Visual Elements)
    • Account Provisioning (Sign-up)
      • New Authentication System
      • Existing Authentication System - New Customer
      • Existing Authentication System - Existing Customer
  • Passport Subsequent Logins
  • Post-Login Capabilities
    • Account Information Access
    • Blockchain Wallet Access
  • Smart Contract Interactions
    • Instantiating The Contract Object (Server-Side)
    • Instantiating The Contract Object (Client-side)
    • Calling Contracts
  • Monetary Transactions
  • Appendix I: Passport Configuration Options
    • Credenza Core Web SDK (Auth)
    • Ethers.js
    • Installation
    • Usage
    • Passport Instance Properties
    • Passport Static Properties
    • Modes
  • Appendix IA: Transaction UI v3.0 (now part of Passport)
    • Installation
    • Usage
    • Apple Pay
    • Google Pay
    • Methods
    • Events
  • Appendix II: MetaMembership Contract Access
  • Appendix III: Ledger Contract Access
  • Appendix IV: Decentralized Commerce Configuration
  • Appendix V: Migration From Previous Passports
Powered by GitBook
LogoLogo

©2023 Credenza. All rights reserved.

On this page

Monetary Transactions

Cryptocurrency values are treated the same way as a very smart contracts, except they follow a very specific contract type that adheres to ERC20. In the code below, we will fund a user’s account, which we could do after a credit card transaction.

async function sendCRED(ethAddress,amount){
  const contract = contractLib.getCredenzaContract({
    address: address,wallet: walletObj,name: 'CredenzaToken'
   })
  const pts = await contract.transfer(ethAddress,amount);
}

Note that Credenza Passport and Credenza Presence already have a mechanism to automate the workflow of a fiat to stored value transactions.

This code would transfer 100 tokens (you can decide what that means) from the treasury to the user. The smart contract could be modified so that the client can revoke fan tokens at any time, especially if there is theft abuse of the system. Contrary to popular belief, blockchain transactions can effectively be rolled back — it’s just a credit and a debit instead of the original incorrect transaction being deleted. The smart contract (even an ERC20) can be extended to offer the client this flexibility.

PreviousCalling ContractsNextAppendix I: Passport Configuration Options