Skip to content
This repository was archived by the owner on May 16, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ Update [depositEth.ts](./depositEth.ts#L14) with your deposit amount then run
yarn deposit-eth
```

## Deposit NFT

Update [depositNft.ts](./depositNft.ts#L14) with your token address and id then run

```sh
yarn deposit-nft
```

## Prepare Eth Withdrawal

Update [createEthWithdrawal.ts](./createEthWithdrawal.ts#L12) with your withdrawal amount then run
Expand Down
23 changes: 23 additions & 0 deletions examples/depositNft.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Config, ImmutableX } from '@imtbl/core-sdk';
import { generateWalletConnection } from './libs/walletConnection';

(async () => {
try {
const walletConnection = await generateWalletConnection('goerli');

// IMX class client
const client = new ImmutableX(Config.SANDBOX);

// Deposit ERC721
const depositResponse = await client.deposit(walletConnection.ethSigner, {
type: 'ERC721',
tokenId: '', // TOKEN_ID
tokenAddress: '' // COLLECTION_CONTRACT_ADDRESS
});

console.log('depositResponse', depositResponse);
} catch (err) {
console.error(err);
process.exit(1);
}
})();
1 change: 1 addition & 0 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"create-exchange-transfer": "ts-node -r dotenv/config createExchangeTransfer.ts",
"create-nft-primary-txn": "ts-node -r dotenv/config createNftPrimaryTransaction.ts",
"deposit-eth": "ts-node -r dotenv/config depositEth.ts",
"deposit-nft": "ts-node -r dotenv/config depositNft.ts",
"create-eth-withdrawal": "ts-node -r dotenv/config createEthWithdrawal.ts",
"complete-eth-withdrawal": "ts-node -r dotenv/config completeEthWithdrawal.ts",
"create-project": "ts-node -r dotenv/config createProject.ts",
Expand Down