From cf74bf865616f811709cdf3a4ae8b6e3201e8fa0 Mon Sep 17 00:00:00 2001 From: spacehaz Date: Mon, 26 Aug 2024 16:02:22 +0300 Subject: [PATCH 1/2] added updates for linkdrop-sdk => linkdrop-batch-sdk --- package.json | 2 +- .../drop/async-actions/get-link-by-code.tsx | 4 +- src/data/store/reducers/user/types.tsx | 4 +- src/global.d.ts | 61 ------------------- yarn.lock | 8 +-- 5 files changed, 9 insertions(+), 70 deletions(-) diff --git a/package.json b/package.json index 835485ea..58838a7e 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "immer": "^9.0.6", "is-android": "^1.0.1", "is-ios": "^2.1.0", - "linkdrop-sdk": "^2.1.8", + "linkdrop-batch-sdk": "^2.1.9", "linkdrop-ui": "^0.0.44", "minimatch": "^3.0.5", "node-forge": "^1.3.0", diff --git a/src/data/store/reducers/drop/async-actions/get-link-by-code.tsx b/src/data/store/reducers/drop/async-actions/get-link-by-code.tsx index 020f7bef..0f8ada8f 100644 --- a/src/data/store/reducers/drop/async-actions/get-link-by-code.tsx +++ b/src/data/store/reducers/drop/async-actions/get-link-by-code.tsx @@ -10,7 +10,7 @@ import { TDropType, TWalletName } from 'types' -import LinkdropSDK from 'linkdrop-sdk' +import LinkdropBatchSDK from 'linkdrop-batch-sdk' import * as actionsToken from '../../token/actions' import { TokenActions } from '../../token/types' @@ -30,7 +30,7 @@ export default function getLinkByCode( ) => { dispatch(actionsDrop.setLoading(true)) dispatch(actionsDrop.setError(null)) - const sdk = new LinkdropSDK({ + const sdk = new LinkdropBatchSDK({ apiHost: REACT_APP_DASHBOARD_SERVER_URL, apiKey: REACT_APP_ZUPLO_API_KEY as string }) diff --git a/src/data/store/reducers/user/types.tsx b/src/data/store/reducers/user/types.tsx index 00072962..95dda95d 100644 --- a/src/data/store/reducers/user/types.tsx +++ b/src/data/store/reducers/user/types.tsx @@ -1,12 +1,12 @@ import { ActionType } from 'typesafe-actions' import * as actions from './actions' -import LinkdropSDK from 'linkdrop-sdk' +import LinkdropBatchSDK from 'linkdrop-batch-sdk' export interface UserState { address: string loading: boolean chainId: number | null - sdk: LinkdropSDK | null + sdk: LinkdropBatchSDK | null initialized: boolean userProvider: any signer: any diff --git a/src/global.d.ts b/src/global.d.ts index a0107040..bc82e8c2 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -1,64 +1,3 @@ - -declare module '@linkdrop/sdk' { - type ISDK = import('./types').ISDK - type TClaimResult = import('./types').TClaimResult - type TClaimLinkERC20 = import('./types').TClaimLinkERC20 - type TClaimLinkERC721 = import('./types').TClaimLinkERC721 - type TClaimLinkERC1155 = import('./types').TClaimLinkERC1155 - - class LinkdropSDK implements ISDK { - constructor(params: ISDK) - getProxyAddress: (campaignId: string) => string - - claimERC20: ({ - weiAmount, - tokenAddress, - tokenAmount, - expirationTime, - linkKey, - linkdropMasterAddress, - linkdropSignerSignature, - receiverAddress, - campaignId - }: TClaimLinkERC20) => TClaimResult - - claimERC721: ({ - weiAmount, - nftAddress, - tokenId, - expirationTime, - linkKey, - linkdropMasterAddress, - linkdropSignerSignature, - receiverAddress, - campaignId - }: TClaimLinkERC721) => TClaimResult - - claimERC1155: ({ - weiAmount, - nftAddress, - tokenId, - tokenAmount, - expirationTime, - linkKey, - linkdropMasterAddress, - linkdropSignerSignature, - receiverAddress, - campaignId - }: TClaimLinkERC1155) => TClaimResult - } - export = LinkdropSDK -} - - -// declare module '@walletconnect/utils/dist/esm' { -// type TDecrypt = ({ encoded, symKey } : { encoded: string, symKey: string }) => string -// const methods: { decrypt: TDecrypt } = { -// decrypt: ({ encoded, symKey }) => {} -// } -// export = methods -// } - declare module '@linkdrop/contracts/scripts/utils.js' { type Module = { signReceiverAddress: (linkKey: string, address: string) => string diff --git a/yarn.lock b/yarn.lock index 62c4b64e..c9cd544c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9822,10 +9822,10 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== -linkdrop-sdk@^2.1.8: - version "2.1.8" - resolved "https://registry.yarnpkg.com/linkdrop-sdk/-/linkdrop-sdk-2.1.8.tgz#1a77e3bce0a327b10656881f1db4b52a4124254f" - integrity sha512-Ep0psNkW/mgi3s1tERXGQ7e7xZ4WMZG9DafgtcFAEVtflzh3tt85m2UI1Qrg6dOWxkTR6ne9qNM24ca3wdCA5g== +linkdrop-batch-sdk@^2.1.9: + version "2.1.9" + resolved "https://registry.yarnpkg.com/linkdrop-batch-sdk/-/linkdrop-batch-sdk-2.1.9.tgz#a73083809e1dbcf011905daa1fcae295a172adb7" + integrity sha512-HHzOsIGixeEdCb0S5qmjtLOfuecC5IS1okVVmZ4Vs3wwPq1KcbHZ0qtVahbxkJaonSzF1FSwXT47BEzuQ84bAw== dependencies: "@stablelib/x25519" "^1.0.3" "@walletconnect/utils" "2.0.0-beta.100" From 3653590367d0bf3b99a6066588b20179075ed776 Mon Sep 17 00:00:00 2001 From: spacehaz Date: Mon, 26 Aug 2024 16:03:41 +0300 Subject: [PATCH 2/2] added updates for linkdrop-sdk => linkdrop-batch-sdk --- CHANGELOG.md | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8176fbaa..91b7fbe9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Linkdrop Claim app +## 2.2.27 +- new linkdrop-batch-sdk package + ## 2.2.26 - added query params to url (autoclaim and dest) - bug fixes diff --git a/package.json b/package.json index 58838a7e..cee81893 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "app-claim", - "version": "2.2.26-rc.0", + "version": "2.2.27-rc.0", "private": true, "dependencies": { "@auth0/auth0-react": "^2.1.1",