@alephium/web3 0.18.2 → 0.18.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -89,7 +89,7 @@ class NodeProvider {
89
89
  };
90
90
  this.guessFollowsNFTCollectionStd = async (contractId) => {
91
91
  const interfaceId = await this.guessStdInterfaceId(contractId);
92
- return interfaceId === types_1.StdInterfaceIds.NFTCollection;
92
+ return !!interfaceId && interfaceId.startsWith(types_1.StdInterfaceIds.NFTCollection);
93
93
  };
94
94
  this.guessStdTokenType = async (tokenId) => {
95
95
  const interfaceId = await this.guessStdInterfaceId(tokenId);
@@ -33,7 +33,8 @@ export declare function request(provider: Record<string, any>, args: ApiRequestA
33
33
  export declare enum StdInterfaceIds {
34
34
  FungibleToken = "0001",
35
35
  NFTCollection = "0002",
36
- NFT = "0003"
36
+ NFT = "0003",
37
+ NFTCollectionWithRoyalty = "000201"
37
38
  }
38
39
  export interface FungibleTokenMetaData {
39
40
  name: string;
@@ -268,4 +268,5 @@ var StdInterfaceIds;
268
268
  StdInterfaceIds["FungibleToken"] = "0001";
269
269
  StdInterfaceIds["NFTCollection"] = "0002";
270
270
  StdInterfaceIds["NFT"] = "0003";
271
+ StdInterfaceIds["NFTCollectionWithRoyalty"] = "000201";
271
272
  })(StdInterfaceIds = exports.StdInterfaceIds || (exports.StdInterfaceIds = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alephium/web3",
3
- "version": "0.18.2",
3
+ "version": "0.18.3",
4
4
  "description": "A JS/TS library to interact with the Alephium platform",
5
5
  "license": "GPL",
6
6
  "main": "dist/src/index.js",
@@ -163,7 +163,7 @@ export class NodeProvider implements NodeProviderApis {
163
163
 
164
164
  guessFollowsNFTCollectionStd = async (contractId: HexString): Promise<boolean> => {
165
165
  const interfaceId = await this.guessStdInterfaceId(contractId)
166
- return interfaceId === StdInterfaceIds.NFTCollection
166
+ return !!interfaceId && interfaceId.startsWith(StdInterfaceIds.NFTCollection)
167
167
  }
168
168
 
169
169
  guessStdTokenType = async (tokenId: HexString): Promise<'fungible' | 'non-fungible' | undefined> => {
package/src/api/types.ts CHANGED
@@ -273,7 +273,8 @@ export async function request(provider: Record<string, any>, args: ApiRequestArg
273
273
  export enum StdInterfaceIds {
274
274
  FungibleToken = '0001',
275
275
  NFTCollection = '0002',
276
- NFT = '0003'
276
+ NFT = '0003',
277
+ NFTCollectionWithRoyalty = '000201'
277
278
  }
278
279
 
279
280
  export interface FungibleTokenMetaData {
@@ -0,0 +1,7 @@
1
+ @std(id = #000201)
2
+ Interface INFTCollectionWithRoyalty extends INFTCollection {
3
+ pub fn royaltyAmount(tokenId: ByteVec, salePrice: U256) -> (U256)
4
+
5
+ @using(assetsInContract = true, preapprovedAssets = true)
6
+ pub fn payRoyalty(payer: Address, amount: U256) -> ()
7
+ }