Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge changes down #73

Merged
merged 6 commits into from
Nov 2, 2023
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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@itheum/sdk-mx-data-nft",
"version": "2.1.5",
"version": "2.2.0",
"description": "SDK for Itheum's Data NFT Technology on MultiversX Blockchain",
"main": "out/index.js",
"types": "out/index.d.js",
Expand Down
8 changes: 4 additions & 4 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,26 @@ const testnetNetworkConfig: Config = {
};

export const itheumTokenIdentifier: { [key in EnvironmentsEnum]: string } = {
devnet: 'ITHEUM-a61317',
devnet: 'ITHEUM-fce905',
mainnet: 'ITHEUM-df6f26',
testnet: ''
};

export const dataNftTokenIdentifier: { [key in EnvironmentsEnum]: string } = {
devnet: 'DATANFTFT4-3ba099',
devnet: 'DATANFTFT-e0b917',
mainnet: 'DATANFTFT-e936d4',
testnet: ''
}; //[future] list of whitelisted tokens as Data NFTs

export const marketPlaceContractAddress: { [key in EnvironmentsEnum]: string } =
{
devnet: 'erd1qqqqqqqqqqqqqpgqrwtl03qdxjv2e52ta5ry4rg0z7l95neqfsxsp4y4xh',
devnet: 'erd1qqqqqqqqqqqqqpgqlhewm06p4c9qhq32p239hs45dvry948tfsxshx3e0l',
mainnet: 'erd1qqqqqqqqqqqqqpgqay2r64l9nhhvmaqw4qanywfd0954w2m3c77qm7drxc',
testnet: ''
};

export const minterContractAddress: { [key in EnvironmentsEnum]: string } = {
devnet: 'erd1qqqqqqqqqqqqqpgqpd9qxrq5a03jrneafmlmckmlj5zgdj55fsxsqa7jsm',
devnet: 'erd1qqqqqqqqqqqqqpgq7thwlde9hvc5ty7lx2j3l9tvy3wgkwu7fsxsvz9rat',
mainnet: 'erd1qqqqqqqqqqqqqpgqmuzgkurn657afd3r2aldqy2snsknwvrhc77q3lj8l6',
testnet: ''
};
Expand Down
10 changes: 7 additions & 3 deletions src/datanft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,20 @@ export class DataNft {
/**
* Returns an array of `DataNft` objects owned by the address
* @param address the address to query
* @param identifier the Data NFT-FT token identifier (default = `DATA-NFT-FT` token identifier based on the {@link EnvironmentsEnum})
* @param collections the collection identifiers to query. If not provided, the default collection identifier based on the {@link EnvironmentsEnum}
*/
static async ownedByAddress(
address: string,
identifier = dataNftTokenIdentifier[this.env as EnvironmentsEnum]
collections?: string[]
): Promise<DataNft[]> {
this.ensureNetworkConfigSet();

const identifiersMap =
collections?.join(',') ||
dataNftTokenIdentifier[this.env as EnvironmentsEnum];

const res = await fetch(
`${this.apiConfiguration}/accounts/${address}/nfts?size=10000&collections=${identifier}&withSupply=true`
`${this.apiConfiguration}/accounts/${address}/nfts?size=10000&collections=${identifiersMap}&withSupply=true`
);

checkStatus(res);
Expand Down
6 changes: 0 additions & 6 deletions tests/datanft.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ describe('Data NFT test', () => {
const nonceToSign = await dataNft.getMessageToSign();

expect(typeof nonceToSign).toBe('string');
const nft = await DataNft.createFromApi({
nonce: 62,
tokenIdentifier: 'DATANFTFT3-d0978e'
});

expect(nft).toBeInstanceOf(DataNft);
}, 10000);

test('#getOwnedByAddress', async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/sftminter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('Data Nft Minter Test', () => {
const dataNftMarket = new SftMinter('devnet');
expect(dataNftMarket.getContractAddress()).toBeInstanceOf(Address);
expect(dataNftMarket.getContractAddress().bech32()).toStrictEqual(
'erd1qqqqqqqqqqqqqpgqpd9qxrq5a03jrneafmlmckmlj5zgdj55fsxsqa7jsm'
'erd1qqqqqqqqqqqqqpgq7thwlde9hvc5ty7lx2j3l9tvy3wgkwu7fsxsvz9rat'
);
});

Expand Down