Passport SDK v5.0
  • 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
    • Magic
    • Ethers.js
    • Installation
    • Usage
    • Passport Instance Properties
    • Passport Static Properties
    • Modes
    • Supported query params
  • Transaction UI v3.0 (now part of Passport)
    • Magic
    • Ethers.js
    • Installation
    • Usage
    • Apple Pay
    • Google Pay
    • Methods
    • Events
  • Appendix II: MetaMembership Contract Access
  • Appendix III: Ledger Contract Access
  • Appendix IV: Decentralized Commerce Configuration
Powered by GitBook
LogoLogo

©2023 Credenza. All rights reserved.

On this page
  • Methods
  • addMembership(address customerAddress, string memory metadata)
  • removeMembership(address customerAddress)

Appendix II: MetaMembership Contract Access

The membership contract is an opportunity to store data in a way that is not as traceable is NFT ownership and is controlled by the owner of the contract and therefore cannot be transferred. In addition, relevant non-PII metadata can be stored in the entry for quick retrieval.

Methods

addMembership(address customerAddress, string memory metadata)

This method creates an entry associated with the caller of the contract that is attributed to the customerAddress. If the entry already exists, this will override the metadata stored associated with the entry.

const tx = await contract.addMembership(ethAddress); //returns transaction information

removeMembership(address customerAddress)

For an existing member, this will revoke their membership, expunging the entry for future requests in the entry associated with the calling address.

const tx = await contract. removeMembership(ethAddress);  //returns transaction information

confirmMembership(address publisherAddress, address customerAddress)

This checks for a customerAddress entry associated with the membership owner’s public key, defined by publisherAddress. Unlike add/remove, this can be open to anyone or accessed by authorized partners defined by the owner of the contract.

const tx = await contract. confirmMembership(ethAddress); //returns boolean result

getMembershipMetadata(address publisherAddress,address customerAddress)

For members, this method will retrieve the metadata that was stored by customerAddress associated with a member with the public key customerAddress. Like confirmMembership, this is accessible to all authorized callers as defined by the contract owner.

const tx = await contract. getMembershipMetadata(ethAddress);  //returns metadata string
PreviousEventsNextAppendix III: Ledger Contract Access

Last updated 1 year ago