Skip to content

Commit

Permalink
added updates for linkdrop-sdk => linkdrop-batch-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
spacehaz committed Aug 26, 2024
1 parent 711d2e4 commit 4648695
Show file tree
Hide file tree
Showing 18 changed files with 14,614 additions and 2,603 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Linkdrop SDK

## 2.1.9
- package rename to linkdrop-batch-sdk

## 2.1.8
- added support for immutableZkevm network
- removed support for baseGoerli, goerli and mumbai
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ Create a campaign using Linkdrop Dashboard. When creating a campaign you will ne

First, import SDK into your code:
```ts
import LinkdropSDK from 'linkdrop-sdk'
import LinkdropBatchSDK from 'linkdrop-batch-sdk'
// or
// const LinkdropSDK = require('linkdrop-sdk').default
// const LinkdropBatchSDK = require('linkdrop-batch-sdk').default
```
To use SDK on a tesnet:
```ts
// initializing Linkdrop SDK on a testnet (Goerli or Mumbai)
const apiKey = /* to request an API key, please contact us at [email protected] */
const sdk = new LinkdropSDK({ mode: 'testnets', apiKey });
const sdk = new LinkdropBatchSDK({ mode: 'testnets', apiKey });
```
To use SDK on a production network (Ethereum Mainnet or Polygon):
```ts
// initializing Linkdrop SDK on a production network
const apiKey = /* to request an API key, please contact us at [email protected] */
const sdk = new LinkdropSDK({ apiKey });
const sdk = new LinkdropBatchSDK({ apiKey });
```

## Claim methods (Can be used on Front-end & Back-end)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "linkdrop-sdk",
"version": "2.1.8",
"name": "linkdrop-batch-sdk",
"version": "2.1.9",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import LinkdropSDK from './modules/linkdrop-sdk'
import LinkdropBatchSDK from './modules/linkdrop-batch-sdk'

export default LinkdropSDK
export default LinkdropBatchSDK
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
ILinkdropSDK,
ILinkdropBatchSDK,
TNetworkName,
TMode
} from '../../types'
Expand All @@ -18,9 +18,9 @@ import {
} from '../../configs'
import { createLink, computeProxyAddress } from './utils'
import { generateAccount } from '../../utils'
import { TRedeem } from '../../types/modules/linkdrop-sdk/redeem'
import { TRedeem } from '../../types/modules/linkdrop-batch-sdk/redeem'

class LinkdropSDK implements ILinkdropSDK {
class LinkdropSDK implements ILinkdropBatchSDK {
chain: TNetworkName
apiHost: string
claimHostUrl: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TComputeProxyAddress from '../../../types/modules/linkdrop-sdk/compute-proxy-address'
import TComputeProxyAddress from '../../../types/modules/linkdrop-batch-sdk/compute-proxy-address'
import { ethers } from 'ethers'

export const buildCreate2Address = (creatorAddress: string, saltHex: string, byteCode: string) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TCreateLink from '../../../types/modules/linkdrop-sdk/create-link'
import TCreateLink from '../../../types/modules/linkdrop-batch-sdk/create-link'
import { prepareAsset } from '../../../helpers'

const createLink: TCreateLink = async (
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ILinkdropSDK, ICampaign, IBatch } from './modules'
import { ILinkdropBatchSDK, ICampaign, IBatch } from './modules'
import { TNetworkName } from './network-name'
import { TTokenType } from './token-type'
import { TLinkdropSigner } from './linkdrop-signer'
Expand All @@ -16,7 +16,7 @@ import { TLinkStatusResult } from './link-status-result'
import TMode from './mode'

export {
ILinkdropSDK,
ILinkdropBatchSDK,
TLinkStatusResult,
TMode,
TLinkParsed,
Expand Down
4 changes: 2 additions & 2 deletions src/types/modules/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import ICampaign from "./campaign"
import ILinkdropSDK from "./linkdrop-sdk"
import ILinkdropBatchSDK from "./linkdrop-batch-sdk"
import IBatch from "./batch"

export {
ICampaign,
ILinkdropSDK,
ILinkdropBatchSDK,
IBatch
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import TCreateLink from './create-link'
import TComputeProxyAddress from './compute-proxy-address'
import TGenerateAccount from '../../../utils/generate-account/types'

interface ILinkdropSDK {
interface ILinkdropBatchSDK {
chain: TNetworkName
apiHost: string
getCampaign: TGetCampaign
Expand All @@ -21,4 +21,4 @@ interface ILinkdropSDK {
}
}

export default ILinkdropSDK
export default ILinkdropBatchSDK
Loading

0 comments on commit 4648695

Please sign in to comment.