/
non-fungible-methods.ts
72 lines (56 loc) · 1.66 KB
/
non-fungible-methods.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import type { MetadataValue } from "./metadata";
export type CollectionApproval = {
fromSubaccount?: ArrayBuffer;
spender: string;
expiresAt?: bigint;
memo?: ArrayBuffer;
createdAtTime?: bigint;
};
export type TokenApproval = CollectionApproval & {
tokenId: bigint;
};
export type NonFungibleTokenMethods = {
supplyCap(): Promise<bigint | undefined>;
tokenMetadata(
tokenId: bigint
): Promise<Array<[string, MetadataValue]> | undefined>;
ownerOf(tokenId: bigint): Promise<string | undefined>;
tokens(prev?: bigint, take?: bigint): Promise<bigint[]>;
tokensOf(account: string, prev?: bigint, take?: bigint): Promise<bigint[]>;
transferToken(args: {
tokenId: bigint;
fromSubaccount?: ArrayBuffer;
to: string;
memo?: ArrayBuffer;
createdAtTime?: bigint;
}): Promise<bigint>;
transferTokenFrom(args: {
tokenId: bigint;
spenderSubaccount?: ArrayBuffer;
from: string;
to: string;
memo?: ArrayBuffer;
createdAtTime?: bigint;
}): Promise<bigint>;
approveToken(args: TokenApproval): Promise<bigint>;
approveCollection(args: CollectionApproval): Promise<bigint>;
revokeTokenApproval(args: Omit<TokenApproval, "expiresAt">): Promise<bigint>;
revokeCollectionApproval(
args: Omit<CollectionApproval, "expiresAt">
): Promise<bigint>;
isApproved(args: {
tokenId: bigint;
fromSubaccount?: ArrayBuffer;
spender?: string;
}): Promise<boolean>;
getTokenApprovals(
tokenId: bigint,
prev?: TokenApproval,
take?: bigint
): Promise<TokenApproval>;
getCollectionApprovals(
owner: string,
prev?: CollectionApproval,
take?: bigint
): Promise<CollectionApproval>;
};