@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.
- package/dist/alephium-web3.min.js +1 -1
- package/dist/alephium-web3.min.js.map +1 -1
- package/dist/src/api/node-provider.js +1 -1
- package/dist/src/api/types.d.ts +2 -1
- package/dist/src/api/types.js +1 -0
- package/package.json +1 -1
- package/src/api/node-provider.ts +1 -1
- package/src/api/types.ts +2 -1
- package/std/nft_collection_with_royalty_interface.ral +7 -0
|
@@ -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
|
|
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);
|
package/dist/src/api/types.d.ts
CHANGED
|
@@ -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;
|
package/dist/src/api/types.js
CHANGED
|
@@ -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
package/src/api/node-provider.ts
CHANGED
|
@@ -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
|
|
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
|
+
}
|