Skip to content

Commit

Permalink
Merge branch 'main' into TD-1677-add-bids
Browse files Browse the repository at this point in the history
  • Loading branch information
lfportal authored Sep 20, 2024
2 parents 30cad11 + 50704a1 commit 55d9933
Show file tree
Hide file tree
Showing 26 changed files with 747 additions and 127 deletions.
12 changes: 12 additions & 0 deletions examples/blockchain-data/api-examples-with-node/get-token.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { blockchainData } from '@imtbl/sdk';

import { client } from '../lib';

export async function getToken(
contractAddress: string,
): Promise<blockchainData.Types.GetTokenResult> {
return await client.getToken({
chainName: 'imtbl-zkevm-testnet',
contractAddress,
});
}
42 changes: 30 additions & 12 deletions examples/blockchain-data/api-examples-with-node/index.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,45 @@
import { verifySuccessfulMints } from "./verify-successful-mints";
import { getChains } from "./exported-types";
import { getCollection } from "./get-collection";
import { getMetadata } from "./get-metadata";
import { getNFT } from "./get-nft";
import { listMetadata } from "./list-metadata";
import { listCollections } from "./list-collections";
import { listCollectionsByNFTOwner } from "./list-collections-by-owner";
import { listActivities } from "./list-activities";
import { listNFTsByAccountAddress } from "./list-nfts-by-account-address";
import { refreshNFTMetadata } from "./refresh-nft-metadata";
import { refreshStackedMetadata } from "./refresh-stacked-metadata";
import { verifySuccessfulMints } from './verify-successful-mints';
import { getChains } from './exported-types';
import { getCollection } from './get-collection';
import { getMetadata } from './get-metadata';
import { getNFT } from './get-nft';
import { getToken } from './get-token';
import { listAllNFTs } from './list-nfts';
import { listAllNFTOwners } from './list-all-nft-owners';
import { listChains } from './list-chains';
import { listMetadata } from './list-metadata';
import { listCollections } from './list-collections';
import { listCollectionsByNFTOwner } from './list-collections-by-owner';
import { listActivities } from './list-activities';
import { listActivitiesByActivityType } from './list-activties-by-activity-type';
import { listNFTsByAccountAddress } from './list-nfts-by-account-address';
import { listNFTsByCollection } from './list-nfts-by-collection';
import { listNFTOwnersByContractAddress } from './list-nft-owners-by-contract-address';
import { listNFTOwnersByTokenId } from './list-nft-owners-by-token-id';
import { listTokens } from './list-tokens';
import { refreshNFTMetadata } from './refresh-nft-metadata';
import { refreshStackedMetadata } from './refresh-stacked-metadata';

export {
verifySuccessfulMints,
getChains,
getCollection,
getMetadata,
getNFT,
getToken,
listAllNFTs,
listAllNFTOwners,
listChains,
listMetadata,
listCollections,
listCollectionsByNFTOwner,
listActivities,
listActivitiesByActivityType,
listNFTsByAccountAddress,
listNFTsByCollection,
listNFTOwnersByContractAddress,
listNFTOwnersByTokenId,
listTokens,
refreshNFTMetadata,
refreshStackedMetadata,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { blockchainData } from '@imtbl/sdk';
import { client } from '../lib';

export async function listActivitiesByActivityType(
contractAddress: string,
activityType: blockchainData.Types.ActivityType,
): Promise<blockchainData.Types.ListActivitiesResult> {
return await client.listActivities({
chainName: 'imtbl-zkevm-testnet',
contractAddress,
activityType,
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { blockchainData } from '@imtbl/sdk';
import { client } from '../lib';

export async function listAllNFTOwners(): Promise<blockchainData.Types.ListNFTOwnersResult> {
return await client.listAllNFTOwners({
chainName: 'imtbl-zkevm-testnet',
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { blockchainData } from '@imtbl/sdk';

import { client } from '../lib';

export async function listChains(
request: blockchainData.Types.ListChainsRequestParams,
): Promise<blockchainData.Types.ListChainsResult> {
return await client.listChains(request);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { blockchainData } from '@imtbl/sdk';
import { client } from '../lib';

export async function listNFTOwnersByContractAddress(
contractAddress: string,
): Promise<blockchainData.Types.ListNFTOwnersResult> {
return await client.listNFTOwnersByContractAddress({
chainName: 'imtbl-zkevm-testnet',
contractAddress,
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { blockchainData } from '@imtbl/sdk';
import { client } from '../lib';

export async function listNFTOwnersByTokenId(
contractAddress: string,
tokenId: string,
): Promise<blockchainData.Types.ListNFTOwnersResult> {
return await client.listNFTOwners({
chainName: 'imtbl-zkevm-testnet',
contractAddress,
tokenId,
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { blockchainData } from '@imtbl/sdk';
import { client } from '../lib';

export async function listNFTsByCollection(
contractAddress: string,
tokenId: string[],
): Promise<blockchainData.Types.ListNFTsResult> {
return await client.listNFTs({
chainName: 'imtbl-zkevm-testnet',
contractAddress,
tokenId,
});
}
8 changes: 8 additions & 0 deletions examples/blockchain-data/api-examples-with-node/list-nfts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { blockchainData } from '@imtbl/sdk';
import { client } from '../lib';

export async function listAllNFTs(): Promise<blockchainData.Types.ListNFTsResult> {
return await client.listAllNFTs({
chainName: 'imtbl-zkevm-testnet',
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { blockchainData } from '@imtbl/sdk';

import { client } from '../lib';

export async function listTokens(): Promise<blockchainData.Types.ListTokensResult> {
return await client.listTokens({
chainName: 'imtbl-zkevm-testnet',
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { blockchainData } from "@imtbl/sdk";
import { client } from "../lib";

export async function createMintRequestWithTokenIdAndMetadataAndAmount(
chainName: string,
contractAddress: string,
owner_address: string,
reference_id: string,
token_id: string,
amount: string
): Promise<blockchainData.Types.CreateMintRequestResult> {
return await client.createMintRequest({
chainName,
contractAddress,
createMintRequestRequest: {
assets: [
{
owner_address,
reference_id,
token_id,
amount,
metadata: {
name: "Brown Dog Red Car",
description: "This SFT is a Brown Dog in a Red Car",
image: "https://mt-test-2.s3.ap-southeast-2.amazonaws.com/BDRC.png",
external_url: null,
animation_url: null,
youtube_url: null,
attributes: [
{
trait_type: "Pet",
value: "Dog",
},
{
trait_type: "Pet Colour",
value: "Brown",
},
{
trait_type: "Vehicle",
value: "Car",
},
{
trait_type: "Vehicle Colour",
value: "Red",
},
],
},
},
],
},
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { blockchainData } from "@imtbl/sdk";
import { client } from "../lib";

export async function createMintRequestWithTokenIdAndMetadataAndAmount(
chainName: string,
contractAddress: string,
owner_address: string,
reference_id: string,
token_id: string,
amount: string
): Promise<blockchainData.Types.CreateMintRequestResult> {
return await client.createMintRequest({
chainName,
contractAddress,
createMintRequestRequest: {
assets: [
{
owner_address,
reference_id,
token_id,
amount,
},
],
},
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import { blockchainData } from "@imtbl/sdk";
import { client } from "../lib";

export async function createMintRequestWithMetadata(
chainName: string,
contractAddress: string,
owner_address: string,
reference_id: string
): Promise<blockchainData.Types.CreateMintRequestResult> {
return await client.createMintRequest({
chainName,
contractAddress,
createMintRequestRequest: {
assets: [
{
owner_address,
reference_id,
metadata: {
name: "Brown Dog Green Car",
description: "This NFT is a Brown Dog in a Green Car",
image: "https://mt-test-2.s3.ap-southeast-2.amazonaws.com/BDGC.png",
external_url: null,
animation_url: null,
youtube_url: null,
attributes: [
{
trait_type: "Pet",
value: "Dog",
},
{
trait_type: "Pet Colour",
value: "Brown",
},
{
trait_type: "Vehicle",
value: "Car",
},
{
trait_type: "Vehicle Colour",
value: "Green",
},
],
},
},
{
owner_address,
reference_id,
metadata: {
name: "Brown Dog Red Car",
description: "This NFT is a Brown Dog in a Red Car",
image: "https://mt-test-2.s3.ap-southeast-2.amazonaws.com/BDRC.png",
external_url: null,
animation_url: null,
youtube_url: null,
attributes: [
{
trait_type: "Pet",
value: "Dog",
},
{
trait_type: "Pet Colour",
value: "Brown",
},
{
trait_type: "Vehicle",
value: "Car",
},
{
trait_type: "Vehicle Colour",
value: "Red",
},
],
},
},
],
},
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { blockchainData } from "@imtbl/sdk";
import { client } from "../lib";

export async function createMintRequest(
chainName: string,
contractAddress: string,
owner_address: string,
reference_id: string
): Promise<blockchainData.Types.CreateMintRequestResult> {
return await client.createMintRequest({
chainName,
contractAddress,
createMintRequestRequest: {
assets: [
{
owner_address,
reference_id,
},
],
},
});
}
Loading

0 comments on commit 55d9933

Please sign in to comment.