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
16 changes: 16 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,22 @@ Update [mint.ts](./mint.ts#L9) with your minting details then run
yarn mint
```

## List mints

Update [listMints.ts](./listMints.ts#L13) with your mint query details then run

```sh
yarn list-mints
```

## Get mint

Update [getMint.ts](./getMint.ts#L13) with your mint id then run

```sh
yarn get-mint
```

## Create order

Update [createOrder.ts](./createOrder.ts#L9) with your order details then run
Expand Down
21 changes: 21 additions & 0 deletions examples/getMint.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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);

// Get details of a mint with the mint ID (transaction_id returned from listMints)
const getMintResponse = await client.getMint({
id: ''
});

console.log('getMintResponse', JSON.stringify(getMintResponse));
} catch (err) {
console.error(err);
process.exit(1);
}
})();
36 changes: 36 additions & 0 deletions examples/listMints.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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);

// Get a list of mints
const listMintsResponse = await client.listMints({
//pageSize: 100,
//cursor: '',
//orderBy: '',
//direction: '',
//user: '',
//status: '',
//minTimestamp: '',
//maxTimestamp: '',
//tokenType: '',
//tokenId: '',
//assetId: '',
//tokenName: '',
//tokenAddress: '',
//minQuantity: '',
//maxQuantity: '',
//metadata: ''
});

console.log('listMintsResponse', JSON.stringify(listMintsResponse));
} catch (err) {
console.error(err);
process.exit(1);
}
})();
2 changes: 2 additions & 0 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"create-project": "ts-node -r dotenv/config createProject.ts",
"create-collection": "ts-node -r dotenv/config createCollection.ts",
"mint": "ts-node -r dotenv/config mint.ts",
"list-mints": "ts-node -r dotenv/config listMints.ts",
"get-mint": "ts-node -r dotenv/config getMint.ts",
"transfer-nfts": "ts-node -r dotenv/config transferNfts.ts",
"transfer-eth": "ts-node -r dotenv/config transferEth.ts",
"transfer-erc20": "ts-node -r dotenv/config transferErc20.ts"
Expand Down