diff --git a/package.json b/package.json index 410d5bc69c..033afabea3 100644 --- a/package.json +++ b/package.json @@ -57,9 +57,6 @@ "workspaces": [ "sdk", "packages/config", - "packages/erc20", - "packages/erc721", - "packages/erc721-mint-by-id", "packages/immutablex_client", "packages/passport/sdk", "packages/passport/sdk-sample-app", diff --git a/packages/blockchain-data/sample-app/package.json b/packages/blockchain-data/sample-app/package.json index 2855c926ad..f9b9030ff0 100644 --- a/packages/blockchain-data/sample-app/package.json +++ b/packages/blockchain-data/sample-app/package.json @@ -5,7 +5,6 @@ "@ethersproject/providers": "^5.7.2", "@imtbl/blockchain-data": "0.0.0", "@imtbl/config": "0.0.0", - "@imtbl/erc721-mint-by-id": "0.0.0", "@types/node": "^18.14.2", "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", diff --git a/packages/blockchain-data/sample-app/src/app/erc721-mint-by-id/page.tsx b/packages/blockchain-data/sample-app/src/app/erc721-mint-by-id/page.tsx deleted file mode 100644 index 2b270b36cd..0000000000 --- a/packages/blockchain-data/sample-app/src/app/erc721-mint-by-id/page.tsx +++ /dev/null @@ -1,139 +0,0 @@ -'use client'; - -import { useState, useEffect } from 'react'; -import { getDefaultProvider, Wallet } from 'ethers'; -import { ERC721MintByID } from '@imtbl/erc721-mint-by-id'; - -import { PageLayout } from '@/components/PageLayout'; -import { Provider, TransactionResponse } from '@ethersproject/providers'; - -const CONTRACT_ADDRESS = process.env.NEXT_PUBLIC_CONTRACT_ADDRESS!; -const PRIVATE_KEY = process.env.NEXT_PUBLIC_PRIVATE_KEY!; - -interface State { - isLoading: Boolean; - contract: ERC721MintByID | null; - name: string; - provider: Provider | null; -} - -export default function ERC721MintByIDPage() { - const [state, setState] = useState({ - isLoading: true, - contract: null, - name: '', - provider: null, - }); - - const [result, setResult] = useState(null); - - useEffect(() => { - async function fn() { - // Contract interface instance - const contract = new ERC721MintByID(CONTRACT_ADDRESS); - const provider = getDefaultProvider('sepolia'); - - try { - const name = await contract.name(provider); - - setState({ - isLoading: false, - contract, - name, - provider, - }); - } catch (error) { - setState({ - isLoading: false, - contract, - name: '', - provider: null, - }); - } - } - fn(); - }, []); - - const mint = async () => { - if (state.contract === null) return; - if (state.provider === null) return; - - const wallet = new Wallet(PRIVATE_KEY, state.provider); - - // We can use the read function hasRole to check if the intended signer - // has sufficient permissions to mint before we send the transaction - const minterRole = await state.contract.MINTER_ROLE(state.provider); - - const hasMinterRole = await state.contract.hasRole( - state.provider, - minterRole, - wallet.address, - ); - - if (!hasMinterRole) { - // Handle scenario - console.log('Account doesnt have permissions to mint.'); - return; - } - - // Specify who we want to recieve the minted token - // In this case we are minting a token - const recipient = wallet.address; - - // Determine the ID of the next token to mint. - const nextTokenId = (await state.contract.totalSupply(state.provider)).add(1); - - // Rather than be executed directly, write functions on the SDK client are returned - // as populated transactions so that users can implement their own transaction signing logic. - const populatedTransaction = await state.contract.populateMint( - recipient, - nextTokenId, - ); - - const result: TransactionResponse = await wallet.sendTransaction( - populatedTransaction, - ); - - setResult(result); - }; - - return ( - -
- {state.isLoading ? ( -

Loading...

- ) : ( -
-
-

- ERC721 -

-

{state.name}

-
-
- -
- {result && ( -

- Token has been minted. Click{' '} - - here - {' '} - to view. -

- )} -
- )} -
-
- ); -} diff --git a/packages/erc20/.eslintignore b/packages/erc20/.eslintignore deleted file mode 100644 index 849ddff3b7..0000000000 --- a/packages/erc20/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist/ diff --git a/packages/erc20/.eslintrc b/packages/erc20/.eslintrc deleted file mode 100644 index f35a2b428e..0000000000 --- a/packages/erc20/.eslintrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": ["../../.eslintrc"], - "ignorePatterns": [], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "./tsconfig.json", - "tsconfigRootDir": ".", - "sourceType": "module" - }, - "rules": { - "@typescript-eslint/naming-convention": "off" - } -} diff --git a/packages/erc20/README.md b/packages/erc20/README.md deleted file mode 100644 index 2d1e5245ae..0000000000 --- a/packages/erc20/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# ERC20 -Wrapper functions for interacting with a deployed ERC20 contract. diff --git a/packages/erc20/package.json b/packages/erc20/package.json deleted file mode 100644 index b054df1626..0000000000 --- a/packages/erc20/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "@imtbl/erc20", - "description": "Wrapper functions for interacting with a deployed ERC20 contract.\n", - "version": "0.0.0", - "author": "Immutable", - "bugs": "https://github.com/immutable/ts-immutable-sdk/issues", - "dependencies": { - "@ethersproject/abi": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/contracts": "^5.7.0", - "@ethersproject/providers": "^5.7.2", - "@imtbl/contracts": "0.0.0", - "ethers": "^5.7.2", - "typechain": "^8.1.1" - }, - "devDependencies": { - "@rollup/plugin-typescript": "^11.0.0", - "@swc/core": "^1.3.36", - "@swc/jest": "^0.2.24", - "@typechain/ethers-v5": "^10.2.0", - "rollup": "^3.17.2", - "typescript": "^4.9.5" - }, - "engines": { - "node": ">=16.11.0" - }, - "files": [ - "dist" - ], - "homepage": "https://github.com/immutable/ts-immutable-sdk#readme", - "license": "Apache-2.0", - "main": "dist/index.js", - "private": true, - "repository": "immutable/ts-immutable-sdk.git", - "scripts": { - "build": "NODE_ENV=production rollup --config rollup.config.js", - "lint": "eslint ./src --ext .ts,.jsx,.tsx --max-warnings=0", - "prepare": "wsrun -r build", - "typecheck": "tsc --noEmit --jsx preserve" - }, - "type": "module", - "types": "dist/index.d.ts" -} diff --git a/packages/erc20/rollup.config.js b/packages/erc20/rollup.config.js deleted file mode 100644 index 16a7d58d7e..0000000000 --- a/packages/erc20/rollup.config.js +++ /dev/null @@ -1,10 +0,0 @@ -import typescript from '@rollup/plugin-typescript'; - -export default { - input: 'src/index.ts', - output: { - dir: 'dist', - format: 'es', - }, - plugins: [typescript()], -}; diff --git a/packages/erc20/src/erc20.ts b/packages/erc20/src/erc20.ts deleted file mode 100644 index bb87b2e809..0000000000 --- a/packages/erc20/src/erc20.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { BigNumberish, BigNumber } from '@ethersproject/bignumber'; -import { CallOverrides, PopulatedTransaction } from '@ethersproject/contracts'; -import { ERC20 as OpenZeppelinERC20, ERC20__factory as OpenZeppelinERC20Factory } from '@imtbl/contracts'; -import { PromiseOrValue } from '@imtbl/contracts/src/typechain/types/common'; -import { Overrides } from 'ethers'; -import { Provider } from '@ethersproject/providers'; - -export class ERC20 { - private readonly contract: OpenZeppelinERC20; - - constructor(contractAddress: string) { - const factory = new OpenZeppelinERC20Factory(); - this.contract = factory.attach(contractAddress); - } - - /** - * @returns a promise that resolves with a BigNumber that represents the amount of tokens in existence - */ - public async totalSupply(provider: Provider, overrides: CallOverrides = {}): Promise { - return this.contract.connect(provider).totalSupply(overrides); - } - - /** - * @returns a promise that resolves with a BigNumber that represents the amount of tokens owned by account - */ - public async balanceOf( - provider: Provider, - account: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return this.contract.connect(provider).balanceOf(account, overrides); - } - - /** - * @returns a promise that resolves with a BigNumber that represents the remaining number of tokens that spender will be allowed to spend on behalf of owner through transferFrom - */ - public async allowance( - provider: Provider, - owner: PromiseOrValue, - spender: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return this.contract.connect(provider).allowance(owner, spender, overrides); - } - - /** - * @returns a promise that resolves with a populated transaction - */ - public async populateTransfer( - to: PromiseOrValue, - amount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue }, - ): Promise { - return this.contract.populateTransaction.transfer(to, amount, overrides); - } - - /** - * @returns a promise that resolves with a populated transaction - */ - public async populateApprove( - spender: PromiseOrValue, - amount: PromiseOrValue, - overrides: Overrides & { from?: PromiseOrValue } = {}, - ): Promise { - return this.contract.populateTransaction.approve(spender, amount, overrides); - } - - /** - * @returns a promise that resolves with a populated transaction - */ - public async populateTransferFrom( - from: PromiseOrValue, - to: PromiseOrValue, - amount: PromiseOrValue, - overrides: Overrides & { from?: PromiseOrValue } = {}, - ): Promise { - return this.contract.populateTransaction.transferFrom(from, to, amount, overrides); - } -} diff --git a/packages/erc20/src/index.ts b/packages/erc20/src/index.ts deleted file mode 100644 index d1e7a48455..0000000000 --- a/packages/erc20/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// TODO export config -export { ERC20 } from './erc20'; diff --git a/packages/erc20/tsconfig.json b/packages/erc20/tsconfig.json deleted file mode 100644 index ab5a7f300c..0000000000 --- a/packages/erc20/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "./src", - "outDir": "./dist", - "rootDirs": ["src"], - "target": "es2022", - "module": "esnext", - "moduleResolution": "node", - "noEmit": true, - "allowJs": false, - "removeComments": false, - "strict": true, - "forceConsistentCasingInFileNames": false, - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "declaration": true, - "resolveJsonModule": true, - "skipLibCheck": true - }, - "include": ["src"], - "exclude": ["node_modules", "dist"] -} diff --git a/packages/erc20/typedoc.json b/packages/erc20/typedoc.json deleted file mode 100644 index d724ffa227..0000000000 --- a/packages/erc20/typedoc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": ["../../typedoc.base.json"], - "entryPoints": ["src/index.ts"], - "name": "erc20", -} diff --git a/packages/erc721-mint-by-id/.eslintignore b/packages/erc721-mint-by-id/.eslintignore deleted file mode 100644 index 849ddff3b7..0000000000 --- a/packages/erc721-mint-by-id/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist/ diff --git a/packages/erc721-mint-by-id/.eslintrc b/packages/erc721-mint-by-id/.eslintrc deleted file mode 100644 index f35a2b428e..0000000000 --- a/packages/erc721-mint-by-id/.eslintrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": ["../../.eslintrc"], - "ignorePatterns": [], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "./tsconfig.json", - "tsconfigRootDir": ".", - "sourceType": "module" - }, - "rules": { - "@typescript-eslint/naming-convention": "off" - } -} diff --git a/packages/erc721-mint-by-id/README.md b/packages/erc721-mint-by-id/README.md deleted file mode 100644 index 8e6f7b55ac..0000000000 --- a/packages/erc721-mint-by-id/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# ERC721 Mint by ID -Wrapper functions for interacting with a deployed ERC721 Mint by ID contract. diff --git a/packages/erc721-mint-by-id/package.json b/packages/erc721-mint-by-id/package.json deleted file mode 100644 index 5037a02ad3..0000000000 --- a/packages/erc721-mint-by-id/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@imtbl/erc721-mint-by-id", - "description": "Wrapper functions for interacting with a deployed ImmutableERC721MintByID contract.", - "version": "0.0.0", - "author": "Immutable", - "bugs": "https://github.com/immutable/ts-immutable-sdk/issues", - "dependencies": { - "@ethersproject/abi": "^5.7.0", - "@ethersproject/providers": "^5.7.2", - "@imtbl/contracts": "0.0.0", - "ethers": "^5.7.2", - "typechain": "^8.1.1" - }, - "devDependencies": { - "@rollup/plugin-typescript": "^11.0.0", - "@swc/core": "^1.3.36", - "@swc/jest": "^0.2.24", - "@typechain/ethers-v5": "^10.2.0", - "rollup": "^3.17.2", - "typescript": "^4.9.5" - }, - "engines": { - "node": ">=16.11.0" - }, - "files": [ - "dist" - ], - "homepage": "https://github.com/immutable/ts-immutable-sdk#readme", - "license": "Apache-2.0", - "main": "dist/index.js", - "private": true, - "repository": "immutable/ts-immutable-sdk.git", - "scripts": { - "build": "NODE_ENV=production rollup --config rollup.config.js", - "lint": "eslint ./src --ext .ts,.jsx,.tsx --max-warnings=0", - "prepare": "wsrun -r build", - "typecheck": "tsc --noEmit --jsx preserve" - }, - "type": "module", - "types": "dist/index.d.ts" -} diff --git a/packages/erc721-mint-by-id/rollup.config.js b/packages/erc721-mint-by-id/rollup.config.js deleted file mode 100644 index 16a7d58d7e..0000000000 --- a/packages/erc721-mint-by-id/rollup.config.js +++ /dev/null @@ -1,10 +0,0 @@ -import typescript from '@rollup/plugin-typescript'; - -export default { - input: 'src/index.ts', - output: { - dir: 'dist', - format: 'es', - }, - plugins: [typescript()], -}; diff --git a/packages/erc721-mint-by-id/src/erc721-mint-by-id.ts b/packages/erc721-mint-by-id/src/erc721-mint-by-id.ts deleted file mode 100644 index 9e819355bd..0000000000 --- a/packages/erc721-mint-by-id/src/erc721-mint-by-id.ts +++ /dev/null @@ -1,537 +0,0 @@ -import type { - BigNumber, BigNumberish, BytesLike, CallOverrides, Overrides, PopulatedTransaction, -} from 'ethers'; -import type { Provider } from '@ethersproject/providers'; -import { ImmutableERC721MintByID, ImmutableERC721MintByID__factory } from '@imtbl/contracts'; -import { ImmutableERC721Base } from '@imtbl/contracts/dist/typechain/types/ImmutableERC721MintByID'; -import { PromiseOrValue } from '@imtbl/contracts/dist/typechain/types/common'; - -// Struct for specifying token IDs to mint to an address. -export type IDMint = ImmutableERC721Base.IDMintStruct; - -// Struct for transferring multiple tokens between two addresses. -export type TransferRequest = ImmutableERC721Base.TransferRequestStruct; - -// Struct for safe burning multiple tokens from a single address. -export type IDBurn = ImmutableERC721Base.IDBurnStruct; - -export class ERC721MintByID { - private readonly contract: ImmutableERC721MintByID; - - constructor(contractAddress: string) { - const factory = new ImmutableERC721MintByID__factory(); - this.contract = factory.attach(contractAddress); - } - - /** - * Read functions - */ - - /** - * @returns the DEFAULT_ADMIN_ROLE as a string. - */ - public async DEFAULT_ADMIN_ROLE(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).DEFAULT_ADMIN_ROLE(overrides); - } - - /** - * @returns the MINTER_ROLE as a string. - */ - public async MINTER_ROLE(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).MINTER_ROLE(overrides); - } - - /** - * @returns the balance of an address as a BigNumber. - */ - public async balanceOf( - provider: Provider, - owner: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return await this.contract.connect(provider).balanceOf(owner, overrides); - } - - /** - * @returns the baseURI as a string. - */ - public async baseURI(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).baseURI(overrides); - } - - /** - * @returns the contractURI as a string. - */ - public async contractURI(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).contractURI(overrides); - } - - /** - * @returns admin addresses as an array of strings. - */ - public async getAdmins(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).getAdmins(overrides); - } - - /** - * @returns the approved address for a token ID, or zero if no address set. - */ - public async getApproved( - provider: Provider, - tokenId: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return await this.contract.connect(provider).getApproved(tokenId, overrides); - } - - /** - * @returns the role admin address. - */ - public async getRoleAdmin( - provider: Provider, - role: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return await this.contract.connect(provider).getRoleAdmin(role, overrides); - } - - /** - * @returns the role member address at a particular index. - */ - public async getRoleMember( - provider: Provider, - role: PromiseOrValue, - index: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return await this.contract.connect(provider).getRoleMember(role, index, overrides); - } - - /** - * @returns the role member count as a BigNumber. - */ - public async getRoleMemberCount( - provider: Provider, - role: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return await this.contract.connect(provider).getRoleMemberCount(role, overrides); - } - - /** - * @returns a boolean for whether an account has a particular role. - */ - public async hasRole( - provider: Provider, - role: PromiseOrValue, - account: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return await this.contract.connect(provider).hasRole(role, account, overrides); - } - - /** - * @returns a booolean that tells whether an operator is approved by a given owner. - */ - public async isApprovedForAll( - provider: Provider, - owner: PromiseOrValue, - operator: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return await this.contract.connect(provider).isApprovedForAll(owner, operator, overrides); - } - - /** - * @returns the name of the contract as a string. - */ - public async name(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).name(overrides); - } - - /** - * @returns the owner address of a particular tokenId. - */ - public async ownerOf( - provider: Provider, - tokenId: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return await this.contract.connect(provider).ownerOf(tokenId, overrides); - } - - /** - * Returns the current nonce of a given token ID. - * @param tokenId The ID of the token for which to retrieve the nonce. - * @return Current nonce of the given token. - */ - public async nonces( - provider: Provider, - tokenId: PromiseOrValue, - overrides?: CallOverrides, - ): Promise { - return await this.contract.connect(provider).nonces(tokenId, overrides); - } - - /** - * @returns the operator allowlist as a string. - */ - public async operatorAllowlist(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).operatorAllowlist(overrides); - } - - /** - * @returns the royalty information for a particular tokenId. - */ - public async royaltyInfo( - provider: Provider, - _tokenId: PromiseOrValue, - _salePrice: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise<[string, BigNumber]> { - return await this.contract.connect(provider).royaltyInfo(_tokenId, _salePrice, overrides); - } - - /** - * @returns the symbol of the contract as a string. - */ - public async symbol(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).symbol(overrides); - } - - /** - * @returns the Uniform Resource Identifier (URI) for tokenId token. - */ - public async tokenURI( - provider: Provider, - tokenId: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return await this.contract.connect(provider).tokenURI(tokenId, overrides); - } - - /** - * @returns returns the total amount of tokens stored by the contract. - */ - public async totalSupply(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).totalSupply(overrides); - } - - /** - * Write functions - */ - - /** - * @returns a populated transaction for the approve contract function - */ - public async populateApprove( - to: PromiseOrValue, - tokenId: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.approve(to, tokenId, overrides); - } - - /** - * Function to approve by way of owner signature - * @param spender the address to approve - * @param tokenId the index of the NFT to approve the spender on - * @param deadline a timestamp expiry for the permit - * @param sig a traditional or EIP-2098 signature - */ - public async populatePermit( - spender: PromiseOrValue, - tokenId: PromiseOrValue, - deadline: PromiseOrValue, - sig: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return await this.contract.populateTransaction.permit(spender, tokenId, deadline, sig, overrides); - } - - /** - * @returns a populated transaction for the burn contract function - */ - public async populateBurn( - tokenId: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.burn(tokenId, overrides); - } - - /** - * @returns a populated transaction for the batch burn contract function - */ - public async populateBurnBatch( - tokenIds: PromiseOrValue[], - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.burnBatch(tokenIds, overrides); - } - - /** - * @returns a populated transaction for the grantMinterRole contract function - */ - public async populateGrantMinterRole( - user: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.grantMinterRole(user, overrides); - } - - /** - * @returns a populated transaction for the grantRole contract function - */ - public async populateGrantRole( - role: PromiseOrValue, - account: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.grantRole(role, account, overrides); - } - - /** - * @returns a populated transaction for the mint contract function - */ - public async populateMint( - to: PromiseOrValue, - tokenId: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.mint(to, tokenId, overrides); - } - - /** - * @returns a populated transaction for the batch mint contract function - */ - public async populateSafeMintBatch( - mints: IDMint[], - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.safeMintBatch(mints, overrides); - } - - /** - * @returns a populated transaction for the safe burn contract function - */ - public async populateSafeBurn( - owner: PromiseOrValue, - tokenId: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.safeBurn(owner, tokenId, overrides); - } - - /** - * @returns a populated transaction for the safe burn batch contract function - */ - public async populateSafeBurnBatch( - burns: IDBurn[], - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.safeBurnBatch(burns, overrides); - } - - /** - * @returns a populated transaction for the renounceRole contract function - */ - public async populateRenounceRole( - role: PromiseOrValue, - account: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.renounceRole(role, account, overrides); - } - - /** - * @returns a populated transaction for the revokeMinterRole contract function - */ - public async populateRevokeMinterRole( - user: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.revokeMinterRole(user, overrides); - } - - /** - * @returns a populated transaction for the revokeRole contract function - */ - public async populateRevokeRole( - role: PromiseOrValue, - account: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.revokeRole(role, account, overrides); - } - - /** - * @returns a populated transaction for the batch save transfer from function - */ - public async populateSafeTransferFromBatch( - transfers: TransferRequest, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.safeTransferFromBatch(transfers, overrides); - } - - /** - * @returns a populated transaction for the safeTransferFrom(address,address,uint256) contract function - */ - public async 'populateSafeTransferFrom(address,address,uint256)'( - from: PromiseOrValue, - to: PromiseOrValue, - tokenId: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction['safeTransferFrom(address,address,uint256)']( - from, - to, - tokenId, - overrides, - ); - } - - /** - * @returns a populated transaction for the safeTransferFrom(address,address,uint256,bytes) contract function - */ - public async 'populateSafeTransferFrom(address,address,uint256,bytes)'( - from: PromiseOrValue, - to: PromiseOrValue, - tokenId: PromiseOrValue, - data: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction['safeTransferFrom(address,address,uint256,bytes)']( - from, - to, - tokenId, - data, - overrides, - ); - } - - /** - * @returns a populated transaction for the setApprovalForAll contract function - */ - public async populateSetApprovalForAll( - operator: PromiseOrValue, - approved: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.setApprovalForAll(operator, approved, overrides); - } - - /** - * @returns a populated transaction for the setBaseURI contract function - */ - public async populateSetBaseURI( - baseURI_: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.setBaseURI(baseURI_, overrides); - } - - /** - * @returns a populated transaction for the setContractURI contract function - */ - public async populateSetContractURI( - _contractURI: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.setContractURI(_contractURI, overrides); - } - - /** - * @returns a populated transaction for the setDefaultRoyaltyReceiver contract function - */ - public async populateSetDefaultRoyaltyReceiver( - receiver: PromiseOrValue, - feeNumerator: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.setDefaultRoyaltyReceiver(receiver, feeNumerator, overrides); - } - - /** - * @returns a populated transaction for the setNFTRoyaltyReceiver contract function - */ - public async populateSetNFTRoyaltyReceiver( - tokenId: PromiseOrValue, - receiver: PromiseOrValue, - feeNumerator: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.setNFTRoyaltyReceiver(tokenId, receiver, feeNumerator, overrides); - } - - /** - * @returns a populated transaction for the setNFTRoyaltyReceiverBatch contract function - */ - public async populateSetNFTRoyaltyReceiverBatch( - tokenIds: PromiseOrValue[], - receiver: PromiseOrValue, - feeNumerator: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.setNFTRoyaltyReceiverBatch( - tokenIds, - receiver, - feeNumerator, - overrides, - ); - } - - /** - * @returns a populated transaction for the setOperatorAllowlistRegistry contract function - */ - public async populateSetOperatorAllowlistRegistry( - _operatorAllowlist: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.setOperatorAllowlistRegistry(_operatorAllowlist, overrides); - } -} diff --git a/packages/erc721-mint-by-id/src/index.ts b/packages/erc721-mint-by-id/src/index.ts deleted file mode 100644 index b086b8edad..0000000000 --- a/packages/erc721-mint-by-id/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { ERC721MintByID } from './erc721-mint-by-id'; diff --git a/packages/erc721-mint-by-id/tsconfig.json b/packages/erc721-mint-by-id/tsconfig.json deleted file mode 100644 index ab5a7f300c..0000000000 --- a/packages/erc721-mint-by-id/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "./src", - "outDir": "./dist", - "rootDirs": ["src"], - "target": "es2022", - "module": "esnext", - "moduleResolution": "node", - "noEmit": true, - "allowJs": false, - "removeComments": false, - "strict": true, - "forceConsistentCasingInFileNames": false, - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "declaration": true, - "resolveJsonModule": true, - "skipLibCheck": true - }, - "include": ["src"], - "exclude": ["node_modules", "dist"] -} diff --git a/packages/erc721-mint-by-id/typedoc.json b/packages/erc721-mint-by-id/typedoc.json deleted file mode 100644 index 3af459a5f3..0000000000 --- a/packages/erc721-mint-by-id/typedoc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": ["../../typedoc.base.json"], - "entryPoints": ["src/index.ts"], - "name": "erc721-permissioned-mintable", -} diff --git a/packages/erc721/.eslintignore b/packages/erc721/.eslintignore deleted file mode 100644 index 849ddff3b7..0000000000 --- a/packages/erc721/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist/ diff --git a/packages/erc721/.eslintrc b/packages/erc721/.eslintrc deleted file mode 100644 index f35a2b428e..0000000000 --- a/packages/erc721/.eslintrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": ["../../.eslintrc"], - "ignorePatterns": [], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "./tsconfig.json", - "tsconfigRootDir": ".", - "sourceType": "module" - }, - "rules": { - "@typescript-eslint/naming-convention": "off" - } -} diff --git a/packages/erc721/README.md b/packages/erc721/README.md deleted file mode 100644 index df8120d25b..0000000000 --- a/packages/erc721/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# ERC721 -Wrapper functions for interacting with a deployed ERC721 contract. diff --git a/packages/erc721/package.json b/packages/erc721/package.json deleted file mode 100644 index d6ccdd5bb1..0000000000 --- a/packages/erc721/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "@imtbl/erc721", - "description": "Wrapper functions for interacting with a deployed ImmutableERC721 contract.", - "version": "0.0.0", - "author": "Immutable", - "bugs": "https://github.com/immutable/ts-immutable-sdk/issues", - "dependencies": { - "@ethersproject/abi": "^5.7.0", - "@ethersproject/contracts": "^5.7.0", - "@ethersproject/providers": "^5.7.2", - "@imtbl/contracts": "0.0.0", - "ethers": "^5.7.2", - "typechain": "^8.1.1" - }, - "devDependencies": { - "@rollup/plugin-typescript": "^11.0.0", - "@swc/core": "^1.3.36", - "@swc/jest": "^0.2.24", - "@typechain/ethers-v5": "^10.2.0", - "rollup": "^3.17.2", - "typescript": "^4.9.5" - }, - "engines": { - "node": ">=16.11.0" - }, - "files": [ - "dist" - ], - "homepage": "https://github.com/immutable/ts-immutable-sdk#readme", - "license": "Apache-2.0", - "main": "dist/index.js", - "private": true, - "repository": "immutable/ts-immutable-sdk.git", - "scripts": { - "build": "NODE_ENV=production rollup --config rollup.config.js", - "lint": "eslint ./src --ext .ts,.jsx,.tsx --max-warnings=0", - "prepare": "wsrun -r build", - "typecheck": "tsc --noEmit --jsx preserve" - }, - "type": "module", - "types": "dist/index.d.ts" -} diff --git a/packages/erc721/rollup.config.js b/packages/erc721/rollup.config.js deleted file mode 100644 index 16a7d58d7e..0000000000 --- a/packages/erc721/rollup.config.js +++ /dev/null @@ -1,10 +0,0 @@ -import typescript from '@rollup/plugin-typescript'; - -export default { - input: 'src/index.ts', - output: { - dir: 'dist', - format: 'es', - }, - plugins: [typescript()], -}; diff --git a/packages/erc721/src/erc721.ts b/packages/erc721/src/erc721.ts deleted file mode 100644 index d3f7f39346..0000000000 --- a/packages/erc721/src/erc721.ts +++ /dev/null @@ -1,644 +0,0 @@ -import type { - BigNumber, BigNumberish, BytesLike, CallOverrides, Overrides, PopulatedTransaction, -} from 'ethers'; -import type { Provider } from '@ethersproject/providers'; -import { ImmutableERC721, ImmutableERC721__factory } from '@imtbl/contracts'; -import { ERC721Hybrid } from '@imtbl/contracts/dist/typechain/types/ImmutableERC721'; -import { PromiseOrValue } from '@imtbl/contracts/dist/typechain/types/common'; - -// Struct for specifying token IDs to mint to an address, by quantity. -export type Mint = ERC721Hybrid.MintStruct; - -// Struct for specifying token IDs to mint to an address. -export type IDMint = ERC721Hybrid.IDMintStruct; - -// Struct for transferring multiple tokens between two addresses. -export type TransferRequest = ERC721Hybrid.TransferRequestStruct; - -// Struct for burning multiple tokens from the same address -export type IDBurn = ERC721Hybrid.IDBurnStruct; - -export class ERC721 { - private readonly contract: ImmutableERC721; - - constructor(contractAddress: string) { - const factory = new ImmutableERC721__factory(); - this.contract = factory.attach(contractAddress); - } - - /** - * Read functions - */ - - /** - * @returns the DEFAULT_ADMIN_ROLE as a string. - */ - public async DEFAULT_ADMIN_ROLE(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).DEFAULT_ADMIN_ROLE(overrides); - } - - /** - * Returns the domain separator used in the encoding of the signature for permits, as defined by EIP-712 - * @return the bytes32 domain separator - */ - public async DOMAIN_SEPARATOR(provider: Provider, overrides?: CallOverrides): Promise { - return await this.contract.connect(provider).DOMAIN_SEPARATOR(overrides); - } - - /** - * @returns the MINTER_ROLE as a string. - */ - public async MINTER_ROLE(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).MINTER_ROLE(overrides); - } - - /** - * @returns the balance of an address as a BigNumber. - */ - public async balanceOf( - provider: Provider, - owner: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return await this.contract.connect(provider).balanceOf(owner, overrides); - } - - /** - * @returns the baseURI as a string. - */ - public async baseURI(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).baseURI(overrides); - } - - /** - * @returns the contractURI as a string. - */ - public async contractURI(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).contractURI(overrides); - } - - /** - * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712 - * signature. - */ - public async eip712Domain( - provider: Provider, - overrides?: CallOverrides, - ): Promise< - [string, string, string, BigNumber, string, string, BigNumber[]] & { - fields: string; - name: string; - version: string; - chainId: BigNumber; - verifyingContract: string; - salt: string; - extensions: BigNumber[]; - } - > { - return await this.contract.eip712Domain(overrides); - } - - /** - * @returns admin addresses as an array of strings. - */ - public async getAdmins(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).getAdmins(overrides); - } - - /** - * @returns the approved address for a token ID, or zero if no address set. - */ - public async getApproved( - provider: Provider, - tokenId: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return await this.contract.connect(provider).getApproved(tokenId, overrides); - } - - /** - * @returns the role admin address. - */ - public async getRoleAdmin( - provider: Provider, - role: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return await this.contract.connect(provider).getRoleAdmin(role, overrides); - } - - /** - * @returns the role member address at a particular index. - */ - public async getRoleMember( - provider: Provider, - role: PromiseOrValue, - index: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return await this.contract.connect(provider).getRoleMember(role, index, overrides); - } - - /** - * @returns the role member count as a BigNumber. - */ - public async getRoleMemberCount( - provider: Provider, - role: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return await this.contract.connect(provider).getRoleMemberCount(role, overrides); - } - - /** - * @returns a boolean for whether an account has a particular role. - */ - public async hasRole( - provider: Provider, - role: PromiseOrValue, - account: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return await this.contract.connect(provider).hasRole(role, account, overrides); - } - - /** - * @returns a booolean that tells whether an operator is approved by a given owner. - */ - public async isApprovedForAll( - provider: Provider, - owner: PromiseOrValue, - operator: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return await this.contract.connect(provider).isApprovedForAll(owner, operator, overrides); - } - - /** - * @returns the name of the contract as a string. - */ - public async name(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).name(overrides); - } - - /** - * @returns the owner address of a particular tokenId. - */ - public async ownerOf( - provider: Provider, - tokenId: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return await this.contract.connect(provider).ownerOf(tokenId, overrides); - } - - /** - * Returns the current nonce of a given token ID. - * @param tokenId The ID of the token for which to retrieve the nonce. - * @return Current nonce of the given token. - */ - public async nonces( - provider: Provider, - tokenId: PromiseOrValue, - overrides?: CallOverrides, - ): Promise { - return await this.contract.connect(provider).nonces(tokenId, overrides); - } - - /** - * @returns the operator allowlist as a string. - */ - public async operatorAllowlist(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).operatorAllowlist(overrides); - } - - /** - * @returns the royalty information for a particular tokenId. - */ - public async royaltyInfo( - provider: Provider, - _tokenId: PromiseOrValue, - _salePrice: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise<[string, BigNumber]> { - return await this.contract.connect(provider).royaltyInfo(_tokenId, _salePrice, overrides); - } - - /** - * @returns the symbol of the contract as a string. - */ - public async symbol(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).symbol(overrides); - } - - /** - * @returns the Uniform Resource Identifier (URI) for tokenId token. - */ - public async tokenURI( - provider: Provider, - tokenId: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return await this.contract.connect(provider).tokenURI(tokenId, overrides); - } - - /** - * @returns returns the total amount of tokens stored by the contract. - */ - public async totalSupply(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).totalSupply(overrides); - } - - /** - * Write functions - */ - - /** - * @returns a populated transaction for the approve contract function - */ - public async populateApprove( - to: PromiseOrValue, - tokenId: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.approve(to, tokenId, overrides); - } - - /** - * Function to approve by way of owner signature - * @param spender the address to approve - * @param tokenId the index of the NFT to approve the spender on - * @param deadline a timestamp expiry for the permit - * @param sig a traditional or EIP-2098 signature - */ - public async populatePermit( - spender: PromiseOrValue, - tokenId: PromiseOrValue, - deadline: PromiseOrValue, - sig: PromiseOrValue, - overrides: CallOverrides = {}, - ): Promise { - return await this.contract.populateTransaction.permit(spender, tokenId, deadline, sig, overrides); - } - - /** - * @returns a populated transaction for the burn contract function - */ - public async populateBurn( - tokenId: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.burn(tokenId, overrides); - } - - /** - * @returns a populated transaction for the batch burn contract function - */ - public async populateBurnBatch( - tokenIds: PromiseOrValue[], - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.burnBatch(tokenIds, overrides); - } - - /** - * @returns a populated transaction for the safe burn contract function - */ - public async populateSafeBurn( - owner: PromiseOrValue, - tokenId: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.safeBurn(owner, tokenId, overrides); - } - - /** - * @returns a populated transaction for the safe burn batch contract function - */ - public async populateSafeBurnBatch( - burns: IDBurn[], - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.safeBurnBatch(burns, overrides); - } - - /** - * @returns a populated transaction for the grantMinterRole contract function - */ - public async populateGrantMinterRole( - user: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.grantMinterRole(user, overrides); - } - - /** - * @returns a populated transaction for the grantRole contract function - */ - public async populateGrantRole( - role: PromiseOrValue, - account: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.grantRole(role, account, overrides); - } - - /** - * @returns a populated transaction for the mint by ID contract function - */ - public async populateMint( - to: PromiseOrValue, - tokenId: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.mint(to, tokenId, overrides); - } - - /** - * @returns a populated transaction for the safe mint by ID contract function - */ - public async populateSafeMint( - to: PromiseOrValue, - tokenId: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.safeMint(to, tokenId, overrides); - } - - /** - * @returns a populated transaction for the mint by quantity contract function - */ - public async populateMintByQuantity( - to: PromiseOrValue, - quantity: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.mintByQuantity(to, quantity, overrides); - } - - /** - * @returns a populated transaction for the safe mint by quantity contract function - */ - public async populateSafeMintByQuantity( - to: PromiseOrValue, - quantity: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.safeMintByQuantity(to, quantity, overrides); - } - - /** - * @returns a populated transaction for the batch mint by quantity contract function - */ - public async populateMintBatchByQuantity( - mints: Mint[], - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.mintBatchByQuantity(mints, overrides); - } - - /** - * @returns a populated transaction for the batch safe mint by quantity contract function - */ - public async populateSafeMintBatchByQuantity( - mints: Mint[], - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.safeMintBatchByQuantity(mints, overrides); - } - - /** - * @returns a populated transaction for the batch mint by ID to multiple recipients contract function - */ - public async populateMintBatch( - mints: IDMint[], - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.mintBatch(mints, overrides); - } - - /** - * @returns a populated transaction for the batch safe mint by ID to multiple recipients contract function - */ - public async populateSafeMintBatch( - mints: IDMint[], - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.safeMintBatch(mints, overrides); - } - - /** - * @returns a populated transaction for the renounceRole contract function - */ - public async populateRenounceRole( - role: PromiseOrValue, - account: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.renounceRole(role, account, overrides); - } - - /** - * @returns a populated transaction for the revokeMinterRole contract function - */ - public async populateRevokeMinterRole( - user: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.revokeMinterRole(user, overrides); - } - - /** - * @returns a populated transaction for the revokeRole contract function - */ - public async populateRevokeRole( - role: PromiseOrValue, - account: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.revokeRole(role, account, overrides); - } - - /** - * @returns a populated transaction for the batch save transfer from function - */ - public async populateSafeTransferFromBatch( - transfers: TransferRequest, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.safeTransferFromBatch(transfers, overrides); - } - - /** - * @returns a populated transaction for the safeTransferFrom(address,address,uint256) contract function - */ - public async 'populateSafeTransferFrom(address,address,uint256)'( - from: PromiseOrValue, - to: PromiseOrValue, - tokenId: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction['safeTransferFrom(address,address,uint256)']( - from, - to, - tokenId, - overrides, - ); - } - - /** - * @returns a populated transaction for the safeTransferFrom(address,address,uint256,bytes) contract function - */ - public async 'populateSafeTransferFrom(address,address,uint256,bytes)'( - from: PromiseOrValue, - to: PromiseOrValue, - tokenId: PromiseOrValue, - data: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction['safeTransferFrom(address,address,uint256,bytes)']( - from, - to, - tokenId, - data, - overrides, - ); - } - - /** - * @returns a populated transaction for the setApprovalForAll contract function - */ - public async populateSetApprovalForAll( - operator: PromiseOrValue, - approved: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.setApprovalForAll(operator, approved, overrides); - } - - /** - * @returns a populated transaction for the setBaseURI contract function - */ - public async populateSetBaseURI( - baseURI_: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.setBaseURI(baseURI_, overrides); - } - - /** - * @returns a populated transaction for the setContractURI contract function - */ - public async populateSetContractURI( - _contractURI: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.setContractURI(_contractURI, overrides); - } - - /** - * @returns a populated transaction for the setDefaultRoyaltyReceiver contract function - */ - public async populateSetDefaultRoyaltyReceiver( - receiver: PromiseOrValue, - feeNumerator: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.setDefaultRoyaltyReceiver(receiver, feeNumerator, overrides); - } - - /** - * @returns a populated transaction for the setNFTRoyaltyReceiver contract function - */ - public async populateSetNFTRoyaltyReceiver( - tokenId: PromiseOrValue, - receiver: PromiseOrValue, - feeNumerator: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.setNFTRoyaltyReceiver(tokenId, receiver, feeNumerator, overrides); - } - - /** - * @returns a populated transaction for the setNFTRoyaltyReceiverBatch contract function - */ - public async populateSetNFTRoyaltyReceiverBatch( - tokenIds: PromiseOrValue[], - receiver: PromiseOrValue, - feeNumerator: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.setNFTRoyaltyReceiverBatch( - tokenIds, - receiver, - feeNumerator, - overrides, - ); - } - - /** - * @returns a populated transaction for the setOperatorAllowlistRegistry contract function - */ - public async populateSetOperatorAllowlistRegistry( - _operatorAllowlist: PromiseOrValue, - overrides: Overrides & { - from?: PromiseOrValue; - } = {}, - ): Promise { - return await this.contract.populateTransaction.setOperatorAllowlistRegistry(_operatorAllowlist, overrides); - } -} diff --git a/packages/erc721/src/index.ts b/packages/erc721/src/index.ts deleted file mode 100644 index 2776fe839b..0000000000 --- a/packages/erc721/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { ERC721 } from './erc721'; diff --git a/packages/erc721/tsconfig.json b/packages/erc721/tsconfig.json deleted file mode 100644 index ab5a7f300c..0000000000 --- a/packages/erc721/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "./src", - "outDir": "./dist", - "rootDirs": ["src"], - "target": "es2022", - "module": "esnext", - "moduleResolution": "node", - "noEmit": true, - "allowJs": false, - "removeComments": false, - "strict": true, - "forceConsistentCasingInFileNames": false, - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "declaration": true, - "resolveJsonModule": true, - "skipLibCheck": true - }, - "include": ["src"], - "exclude": ["node_modules", "dist"] -} diff --git a/packages/erc721/typedoc.json b/packages/erc721/typedoc.json deleted file mode 100644 index 8c6d500db2..0000000000 --- a/packages/erc721/typedoc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": ["../../typedoc.base.json"], - "entryPoints": ["src/index.ts"], - "name": "erc721-hybrid-permissioned-mintable", -} diff --git a/sdk/module-release.json b/sdk/module-release.json index 2844840c9f..1daa7a00b8 100644 --- a/sdk/module-release.json +++ b/sdk/module-release.json @@ -1,29 +1,26 @@ { - "__readme__": [ - "This file is responsible for which modules", - "get bundled and released as part of alpha and prod", - "releases of the SDK.", - "Under `modules`, each key is a file in `src`, and each value is either alpha or prod", - "Under `fileCopy`, each object has `src` and `dest` keys, as well, which are paths relative to this file" - ], - "modules": { - "config": "prod", - "blockchain_data": "prod", - "immutablex_client": "prod", - "passport": "prod", - "orderbook": "prod", - "provider": "prod", - "checkout_sdk": "prod", - "checkout_widgets": "prod", - "erc20": "prod", - "erc721": "prod", - "erc721_mint_by_id": "prod" - }, - "fileCopy": [ - { - "src": "../packages/checkout/widgets-lib/build/static/js/main.*.js", - "dest": "./dist/browser/checkout.js", - "stage": "prod" - } - ] + "__readme__": [ + "This file is responsible for which modules", + "get bundled and released as part of alpha and prod", + "releases of the SDK.", + "Under `modules`, each key is a file in `src`, and each value is either alpha or prod", + "Under `fileCopy`, each object has `src` and `dest` keys, as well, which are paths relative to this file" + ], + "modules": { + "config": "prod", + "blockchain_data": "prod", + "immutablex_client": "prod", + "passport": "prod", + "orderbook": "prod", + "provider": "prod", + "checkout_sdk": "prod", + "checkout_widgets": "prod" + }, + "fileCopy": [ + { + "src": "../packages/checkout/widgets-lib/build/static/js/main.*.js", + "dest": "./dist/browser/checkout.js", + "stage": "prod" + } + ] } diff --git a/sdk/package.json b/sdk/package.json index 96e2680865..51fc0246dc 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -10,8 +10,6 @@ "@0xsequence/config": "^0.43.34", "@ethersproject/abi": "^5.7.0", "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/contracts": "^5.7.0", "@ethersproject/providers": "^5.7.2", "@ethersproject/wallet": "^5.7.0", "@imtbl/core-sdk": "^2.0.2", @@ -27,8 +25,7 @@ "enc-utils": "^3.0.0", "ethers": "^5.7.2", "magic-sdk": "^13.3.1", - "oidc-client-ts": "^2.2.1", - "typechain": "^8.1.1" + "oidc-client-ts": "^2.2.1" }, "devDependencies": { "@imtbl/blockchain-data": "0.0.0", @@ -36,9 +33,6 @@ "@imtbl/checkout-widgets": "0.0.0", "@imtbl/config": "0.0.0", "@imtbl/cryptofiat": "0.0.0", - "@imtbl/erc20": "0.0.0", - "@imtbl/erc721": "0.0.0", - "@imtbl/erc721-mint-by-id": "0.0.0", "@imtbl/generated-clients": "0.0.0", "@imtbl/guardian": "0.0.0", "@imtbl/immutablex-client": "0.0.0", @@ -103,18 +97,6 @@ "./checkout_widgets": { "types": "./dist/checkout_widgets.d.ts", "import": "./dist/checkout_widgets.js" - }, - "./erc20": { - "types": "./dist/erc20.d.ts", - "import": "./dist/erc20.js" - }, - "./erc721": { - "types": "./dist/erc721.d.ts", - "import": "./dist/erc721.js" - }, - "./erc721_mint_by_id": { - "types": "./dist/erc721_mint_by_id.d.ts", - "import": "./dist/erc721_mint_by_id.js" } }, "files": [ diff --git a/sdk/src/erc20.ts b/sdk/src/erc20.ts deleted file mode 100644 index 8b8c290de4..0000000000 --- a/sdk/src/erc20.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@imtbl/erc20'; diff --git a/sdk/src/erc721.ts b/sdk/src/erc721.ts deleted file mode 100644 index 3590643139..0000000000 --- a/sdk/src/erc721.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@imtbl/erc721'; diff --git a/sdk/src/erc721_mint_by_id.ts b/sdk/src/erc721_mint_by_id.ts deleted file mode 100644 index 2edceb1029..0000000000 --- a/sdk/src/erc721_mint_by_id.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@imtbl/erc721-mint-by-id'; diff --git a/sdk/src/index.ts b/sdk/src/index.ts index bdf1baa974..59b814fc7c 100644 --- a/sdk/src/index.ts +++ b/sdk/src/index.ts @@ -6,6 +6,3 @@ export * as orderbook from './orderbook'; export * as provider from './provider'; export * as checkoutSdk from './checkout_sdk'; export * as checkoutWidgets from './checkout_widgets'; -export * as erc20 from './erc20'; -export * as erc721 from './erc721'; -export * as erc721MintById from './erc721_mint_by_id'; diff --git a/typedoc.json b/typedoc.json index caaf75c7b0..a300ba7cd1 100644 --- a/typedoc.json +++ b/typedoc.json @@ -6,13 +6,10 @@ "packages/checkout/widgets/", "packages/config/", "packages/economy/sdk/", - "packages/erc20/", - "packages/erc721/", - "packages/erc721-mint-by-id", "packages/immutablex_client/", "packages/orderbook/", "packages/passport/sdk/", - "packages/provider/", + "packages/provider/" ], "name": "ts-immutable-sdk", "entryPointStrategy": "packages", @@ -28,6 +25,6 @@ "titleLink": "https://docs.immutable.com/docs/x/sdks/typescript", "navigationLinks": { "Immutable Docs": "https://docs.immutable.com", - "Immutable Hub": "https://hub.immutable.com", + "Immutable Hub": "https://hub.immutable.com" } } diff --git a/yarn.lock b/yarn.lock index faf45687fd..5b59b59a22 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2669,7 +2669,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/contracts@npm:5.7.0, @ethersproject/contracts@npm:^5.7.0": +"@ethersproject/contracts@npm:5.7.0": version: 5.7.0 resolution: "@ethersproject/contracts@npm:5.7.0" dependencies: @@ -3261,7 +3261,7 @@ __metadata: languageName: unknown linkType: soft -"@imtbl/contracts@0.0.0, @imtbl/contracts@workspace:packages/internal/contracts": +"@imtbl/contracts@workspace:packages/internal/contracts": version: 0.0.0-use.local resolution: "@imtbl/contracts@workspace:packages/internal/contracts" dependencies: @@ -3482,63 +3482,6 @@ __metadata: languageName: unknown linkType: soft -"@imtbl/erc20@0.0.0, @imtbl/erc20@workspace:packages/erc20": - version: 0.0.0-use.local - resolution: "@imtbl/erc20@workspace:packages/erc20" - dependencies: - "@ethersproject/abi": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/contracts": ^5.7.0 - "@ethersproject/providers": ^5.7.2 - "@imtbl/contracts": 0.0.0 - "@rollup/plugin-typescript": ^11.0.0 - "@swc/core": ^1.3.36 - "@swc/jest": ^0.2.24 - "@typechain/ethers-v5": ^10.2.0 - ethers: ^5.7.2 - rollup: ^3.17.2 - typechain: ^8.1.1 - typescript: ^4.9.5 - languageName: unknown - linkType: soft - -"@imtbl/erc721-mint-by-id@0.0.0, @imtbl/erc721-mint-by-id@workspace:packages/erc721-mint-by-id": - version: 0.0.0-use.local - resolution: "@imtbl/erc721-mint-by-id@workspace:packages/erc721-mint-by-id" - dependencies: - "@ethersproject/abi": ^5.7.0 - "@ethersproject/providers": ^5.7.2 - "@imtbl/contracts": 0.0.0 - "@rollup/plugin-typescript": ^11.0.0 - "@swc/core": ^1.3.36 - "@swc/jest": ^0.2.24 - "@typechain/ethers-v5": ^10.2.0 - ethers: ^5.7.2 - rollup: ^3.17.2 - typechain: ^8.1.1 - typescript: ^4.9.5 - languageName: unknown - linkType: soft - -"@imtbl/erc721@0.0.0, @imtbl/erc721@workspace:packages/erc721": - version: 0.0.0-use.local - resolution: "@imtbl/erc721@workspace:packages/erc721" - dependencies: - "@ethersproject/abi": ^5.7.0 - "@ethersproject/contracts": ^5.7.0 - "@ethersproject/providers": ^5.7.2 - "@imtbl/contracts": 0.0.0 - "@rollup/plugin-typescript": ^11.0.0 - "@swc/core": ^1.3.36 - "@swc/jest": ^0.2.24 - "@typechain/ethers-v5": ^10.2.0 - ethers: ^5.7.2 - rollup: ^3.17.2 - typechain: ^8.1.1 - typescript: ^4.9.5 - languageName: unknown - linkType: soft - "@imtbl/factory-sdk@0.0.0, @imtbl/factory-sdk@workspace:packages/internal/factory/sdk": version: 0.0.0-use.local resolution: "@imtbl/factory-sdk@workspace:packages/internal/factory/sdk" @@ -3772,8 +3715,6 @@ __metadata: "@0xsequence/config": ^0.43.34 "@ethersproject/abi": ^5.7.0 "@ethersproject/abstract-signer": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/contracts": ^5.7.0 "@ethersproject/providers": ^5.7.2 "@ethersproject/wallet": ^5.7.0 "@imtbl/blockchain-data": 0.0.0 @@ -3782,9 +3723,6 @@ __metadata: "@imtbl/config": 0.0.0 "@imtbl/core-sdk": ^2.0.2 "@imtbl/cryptofiat": 0.0.0 - "@imtbl/erc20": 0.0.0 - "@imtbl/erc721": 0.0.0 - "@imtbl/erc721-mint-by-id": 0.0.0 "@imtbl/generated-clients": 0.0.0 "@imtbl/guardian": 0.0.0 "@imtbl/immutablex-client": 0.0.0 @@ -3819,7 +3757,6 @@ __metadata: rollup-plugin-dts: ^5.3.0 rollup-plugin-polyfill-node: ^0.12.0 semver: ^7.4.0 - typechain: ^8.1.1 typescript: ^4.9.5 peerDependencies: react: ^18.2.0 @@ -12509,7 +12446,6 @@ __metadata: "@ethersproject/providers": ^5.7.2 "@imtbl/blockchain-data": 0.0.0 "@imtbl/config": 0.0.0 - "@imtbl/erc721-mint-by-id": 0.0.0 "@types/node": ^18.14.2 "@types/react": ^18.0.28 "@types/react-dom": ^18.0.11