difftreelog
test query properties rpc
in: master
3 files changed
tests/package.jsondiffbeforeafterboth38 "testNesting": "mocha --timeout 9999999 -r ts-node/register ./**/nest.test.ts",38 "testNesting": "mocha --timeout 9999999 -r ts-node/register ./**/nest.test.ts",39 "testUnnesting": "mocha --timeout 9999999 -r ts-node/register ./**/unnest.test.ts",39 "testUnnesting": "mocha --timeout 9999999 -r ts-node/register ./**/unnest.test.ts",40 "testStructure": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/**.test.ts",40 "testStructure": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/**.test.ts",41 "testProperties": "mocha --timeout 9999999 -r ts-node/register ./**/properties.test.ts",41 "testProperties": "mocha --timeout 9999999 -r ts-node/register ./**/properties.test.ts ./**/getPropertiesRpc.test.ts",42 "testMigration": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/migration-check.test.ts",42 "testMigration": "mocha --timeout 9999999 -r ts-node/register ./**/nesting/migration-check.test.ts",43 "testRmrk": "mocha --timeout 9999999 -r ts-node/register ./**/rmrk/**.test.ts",43 "testRmrk": "mocha --timeout 9999999 -r ts-node/register ./**/rmrk/**.test.ts",44 "testAddCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/addCollectionAdmin.test.ts",44 "testAddCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/addCollectionAdmin.test.ts",tests/src/getPropertiesRpc.test.tsdiffbeforeafterbothno changes
tests/src/util/playgrounds/unique.tsdiffbeforeafterboth926 * @example getProperties(1219, ['location', 'date', 'time', 'isParadise']);926 * @example getProperties(1219, ['location', 'date', 'time', 'isParadise']);927 * @returns array of key-value pairs927 * @returns array of key-value pairs928 */928 */929 async getProperties(collectionId: number, propertyKeys: string[] | null = null): Promise<IProperty[]> {929 async getProperties(collectionId: number, propertyKeys?: string[] | null): Promise<IProperty[]> {930 return (await this.helper.callRpc('api.rpc.unique.collectionProperties', [collectionId, ...(propertyKeys === null ? [] : [propertyKeys])])).toHuman();930 return (await this.helper.callRpc('api.rpc.unique.collectionProperties', [collectionId, propertyKeys])).toHuman();931 }931 }932932933 /**933 /**1208 * @example getTokenProperties(1219, ['location', 'date', 'time', 'isParadise']);1208 * @example getTokenProperties(1219, ['location', 'date', 'time', 'isParadise']);1209 * @returns array of key-value pairs1209 * @returns array of key-value pairs1210 */1210 */1211 async getTokenProperties(collectionId: number, tokenId: number, propertyKeys: string[] | null = null): Promise<IProperty[]> {1211 async getTokenProperties(collectionId: number, tokenId: number, propertyKeys?: string[] | null): Promise<IProperty[]> {1212 return (await this.helper.callRpc('api.rpc.unique.tokenProperties', [collectionId, tokenId, ...(propertyKeys === null ? [] : [propertyKeys])])).toHuman();1212 return (await this.helper.callRpc('api.rpc.unique.tokenProperties', [collectionId, tokenId, propertyKeys])).toHuman();1213 }1213 }121412141215 /**1215 /**2265 return await this.helper.collection.getEffectiveLimits(this.collectionId);2265 return await this.helper.collection.getEffectiveLimits(this.collectionId);2266 }2266 }226722672268 async getProperties(propertyKeys: string[] | null = null) {2268 async getProperties(propertyKeys?: string[] | null) {2269 return await this.helper.collection.getProperties(this.collectionId, propertyKeys);2269 return await this.helper.collection.getProperties(this.collectionId, propertyKeys);2270 }2270 }227122712364 return await this.helper.nft.getPropertyPermissions(this.collectionId, propertyKeys);2364 return await this.helper.nft.getPropertyPermissions(this.collectionId, propertyKeys);2365 }2365 }236623662367 async getTokenProperties(tokenId: number, propertyKeys: string[] | null = null) {2367 async getTokenProperties(tokenId: number, propertyKeys?: string[] | null) {2368 return await this.helper.nft.getTokenProperties(this.collectionId, tokenId, propertyKeys);2368 return await this.helper.nft.getTokenProperties(this.collectionId, tokenId, propertyKeys);2369 }2369 }237023702455 return await this.helper.rft.getPropertyPermissions(this.collectionId, propertyKeys);2455 return await this.helper.rft.getPropertyPermissions(this.collectionId, propertyKeys);2456 }2456 }245724572458 async getTokenProperties(tokenId: number, propertyKeys: string[] | null = null) {2458 async getTokenProperties(tokenId: number, propertyKeys?: string[] | null) {2459 return await this.helper.rft.getTokenProperties(this.collectionId, tokenId, propertyKeys);2459 return await this.helper.rft.getTokenProperties(this.collectionId, tokenId, propertyKeys);2460 }2460 }246124612567 return await this.collection.getTokenNextSponsored(this.tokenId, addressObj);2567 return await this.collection.getTokenNextSponsored(this.tokenId, addressObj);2568 }2568 }256925692570 async getProperties(propertyKeys: string[] | null = null) {2570 async getProperties(propertyKeys?: string[] | null) {2571 return await this.collection.getTokenProperties(this.tokenId, propertyKeys);2571 return await this.collection.getTokenProperties(this.tokenId, propertyKeys);2572 }2572 }25732573