Skip to content

Commit

Permalink
Merge pull request #44 from LinkdropHQ/2.1.15_branch
Browse files Browse the repository at this point in the history
2.1.15 branch
  • Loading branch information
spacehaz authored Nov 20, 2024
2 parents 25b90b6 + 9c7d1ae commit 276a75b
Show file tree
Hide file tree
Showing 9 changed files with 883 additions and 12,612 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Linkdrop SDK


## 2.1.14
- added claiming_finished_auto_redirect property

## 2.1.13
- fix for factory address type

## 2.1.12
- get factory address for claim link

## 2.1.11
- added X Layer network support

## 2.1.10
- added additional_wallets_on param to link

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

Expand Down
16 changes: 4 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ Currently, Linkdrop supports the following networks:
- Ethereum Mainnet
- Polygon Mainnet
- Basic Mainnet

Testnets:
- Goerli (Ethereum testnet)
- Mumbai (Polygon testnet)
- Basic Goerli (Basic testnet)
- X Layer Mainnet
- Immutable Zkevm

We can add support of any EVM-based chain by request. Please contact us If you need to use Linkdrop on other networks.

Expand All @@ -28,13 +25,8 @@ import LinkdropBatchSDK from 'linkdrop-batch-sdk'
// or
// 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 LinkdropBatchSDK({ mode: 'testnets', apiKey });
```
To use SDK on a production network (Ethereum Mainnet or Polygon):

To use SDK on a production network (Ethereum Mainnet, Polygon, Base, X Layer, Immutable Zkevm):
```ts
// initializing Linkdrop SDK on a production network
const apiKey = /* to request an API key, please contact us at [email protected] */
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "linkdrop-batch-sdk",
"version": "2.1.9",
"version": "2.1.14",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
Expand Down
1 change: 1 addition & 0 deletions src/configs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ export const polygonJSONRPCUrl = 'https://rpc-mainnet.maticvigil.com/v1/ad4cd2ea
export const mainnetJSONRPCUrl = 'https://mainnet.infura.io/v3/620c738fbe1843a18f47ada0e60e738a'
export const baseJSONRPCUrl = 'https://developer-access-mainnet.base.org'
export const immutableZkevmJSONRPCUrl = 'https://rpc.immutable.com'
export const xlayerJSONRPCUrl='https://rpc.xlayer.tech'
5 changes: 4 additions & 1 deletion src/helpers/define-json-rpc-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
polygonJSONRPCUrl,
mainnetJSONRPCUrl,
baseJSONRPCUrl,
immutableZkevmJSONRPCUrl
immutableZkevmJSONRPCUrl,
xlayerJSONRPCUrl
} from '../configs'

const defineJSONRpcUrl = ({ chainId } : { chainId: number }) => {
Expand All @@ -17,6 +18,8 @@ const defineJSONRpcUrl = ({ chainId } : { chainId: number }) => {
return baseJSONRPCUrl
case 'immutableZkevm':
return immutableZkevmJSONRPCUrl
case 'xlayer':
return xlayerJSONRPCUrl
default:
return alert('Current chain id is not supported')
}
Expand Down
1 change: 1 addition & 0 deletions src/helpers/define-network-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const defineNetworkName = (chainId: number | null) : string => {
case 137: return 'matic'
case 8453: return 'base'
case 13371: return 'immutable-zkevm'
case 196: return 'xlayer'
default: return 'mainnet'
}
}
Expand Down
10 changes: 8 additions & 2 deletions src/helpers/get-link-params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,18 @@ const getLinkParams = async (
claiming_finished_button_title,
claiming_finished_button_url,
claiming_finished_button_on,
claiming_finished_auto_redirect,
preferred_wallet_on,
linkdrop_token,
token_image,
token_name
token_name,
additional_wallets_on,
factory_address
} : TLinkParams = data

return {
creator_address,
factory_address,
sponsored,
chain_id,
campaign_number,
Expand All @@ -57,6 +61,7 @@ const getLinkParams = async (
claim_pattern,
token_id,
token_amount,
claiming_finished_auto_redirect,
sender_signature,
proxy_contract_version,
wei_amount,
Expand All @@ -69,7 +74,8 @@ const getLinkParams = async (
preferred_wallet_on,
linkdrop_token,
token_image,
token_name
token_name,
additional_wallets_on
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions src/types/link-params/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ type TLinkParams = {
claiming_finished_button_title: string
claiming_finished_button_url: string
claiming_finished_button_on: boolean
claiming_finished_auto_redirect: boolean
preferred_wallet_on: boolean
linkdrop_token: boolean,
token_image: string,
linkdrop_token: boolean
token_image: string
token_name: string
additional_wallets_on: boolean
factory_address: string
}

export default TLinkParams
Loading

0 comments on commit 276a75b

Please sign in to comment.