Introducing Linkdrop SDK v1 – Linkdrop
It’s a pleasure for me to introduce you to the The Linkdrop SDK v1. This kit makes it easier than ever to onboard new users to your decentralized app or wallet by encoding ETH, ERC20/721 properties into claimable links and QR-codes — even for new users that does not yet have a wallet.
Below I will walk you through the basis of the Linkdrop SDK with the examples of ETH & ERC20, for ERC721 example click here. If you are not yet familiar with Linkdrop, a good starting point for the basic scheme we use is this Technical Description.
Installation
yarn add @linkdrop/sdk
Usage
const LinkdropSDK = require('@linkdrop/sdk').LinkdropSDK// ORimport from '@linkdrop/sdk'
Initialization
const linkdropSDK = new LinkdropSDK(.infura.io` by default,
// apiHost = <API_HOST>, // `https://$.linkdrop.io` by default
// claimHost = <CLAIM_HOST>, // 'https://claim.linkdrop.io' by default
}))
You can deploy your own Linkdrop factory contract or use ours deployed on Mainnet, Rinkeby and Goerli networks at 0xBa051891B752ecE3670671812486fe8dd34CC1c8
Precompute proxy address
let campaignId = 1
let proxyAddress = linkdropSDK.getProxyAddress(campaignId)
- Addresses are created counterfactually, using CREATE2 opcode
- You can top up the proxy address before deploying it
- This is how a new user can receive assets before having a wallet in advance
Linkdrop generation functionality
const = await linkdropSDK.generateLink()
- Generate as many links as you like including ETH, ERC20/721
- Include your own custom logic for issuance, expiration & deep-linking
- Integrate via SMS, Email, bots, in-app buttons or other channels
Linkdrop claiming functionality
const txHash = await linkdropSDK.claim(
- Claiming works by making a POST request to the API host provided during the initialization of the Linkdrop SDK
The scope of the first version of the Linkdrop SDK, includes all the core functionality we built and now utilize in production with the Linkdrop Dashboard on the Ethereum Mainnet. While it was a quite nice developer experience to build the SDK with this very specific use-case in mind, we’ve explored the SDK does also work with a number of other end-user facing use-cases including:
Do you wish to integrate above or other use-cases? We are happy to support and jam with you — just let us know what you are up to.
We hope the release of our Linkdrop SDK can inspire other great Web3 teams using similar CREATE2 opcode patterns to collaborate around a shared interoperable “Send by Link” standard. Our end-goal is to make it a reality for all users to be able to seamless send/receive digital assets via links/QR-codes from whatever wallet or decentralized application they prefer.
In the end, if we together enable a seamless interoperable Web3 user experience we all win.
There are several ways you can help grow and improve Linkdrop:
Published at Thu, 29 Aug 2019 12:08:21 +0000
Bitcoin Pic Of The Moment
✅ This image from Marco Verch (trendingtopics) is available under Creative Commons 2.0. Please link to the original photo and the license. 📝 License for use outside of the Creative Commons is available by request.
By trendingtopics on 2019-04-03 16:23:34
