Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1341] feat: Allow QR code scanning of "transfer_hotspot_v2" transactions #1342

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MichaelBrew
Copy link
Contributor

Issue: #1341

This PR adds the ability to scan a QR code allowing users to pre-fill the "Transfer Hotspot" form (while also skipping the "has valid activity" check if directed as such in the code itself). The expected payload for the newly supported QR code is:

{
  type: "transfer"
  newOwnerAddress: string
  hotspotAddress?: string
  skipActivityCheck?: boolean
  isSeller?: boolean
}

This PR also updates src/providers/AppLinkProvider.tsx to determine a specific "ScanDataType" for scanned data, then handles each individually

// ScanDataType describes both the scanned data format as well as intended use.
// For example, multiple types are intended to pre-fill the payment "send" form but can provide
// varying levels of information (like single or multiple recipients, optional memo fields, etc).
enum ScanDataType {
  // Deeplink to somewhere in the app
  DEEPLINK,
  // Hotspot address update
  LOCATION_UPDATE,
  // DC burn
  DC_BURN,
  // Hotspot transfer
  TRANSFER,
  // Hotspot transfer with only address provided
  TRANSFER_ADDRESS_ONLY,
  // Payment
  PAYMENT,
  // Payment with only address provided
  PAYMENT_ADDRESS_ONLY,
  // Payment to multiple recipients
  PAYMENT_MULTI,
  // Payment to multiple recipients and optional memos
  PAYMENT_MULTI_MEMO,
}

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants