@silvana-one/nft 0.1.0

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.
Files changed (236) hide show
  1. package/README.md +1400 -0
  2. package/dist/node/admin/advanced.d.ts +469 -0
  3. package/dist/node/admin/advanced.js +525 -0
  4. package/dist/node/admin/advanced.js.map +1 -0
  5. package/dist/node/admin/index.d.ts +1 -0
  6. package/dist/node/admin/index.js +2 -0
  7. package/dist/node/admin/index.js.map +1 -0
  8. package/dist/node/contracts/admin.d.ts +140 -0
  9. package/dist/node/contracts/admin.js +336 -0
  10. package/dist/node/contracts/admin.js.map +1 -0
  11. package/dist/node/contracts/collection.d.ts +551 -0
  12. package/dist/node/contracts/collection.js +1049 -0
  13. package/dist/node/contracts/collection.js.map +1 -0
  14. package/dist/node/contracts/index.d.ts +3 -0
  15. package/dist/node/contracts/index.js +4 -0
  16. package/dist/node/contracts/index.js.map +1 -0
  17. package/dist/node/contracts/nft.d.ts +76 -0
  18. package/dist/node/contracts/nft.js +329 -0
  19. package/dist/node/contracts/nft.js.map +1 -0
  20. package/dist/node/contracts.d.ts +709 -0
  21. package/dist/node/contracts.js +61 -0
  22. package/dist/node/contracts.js.map +1 -0
  23. package/dist/node/index.cjs +5032 -0
  24. package/dist/node/index.d.ts +8 -0
  25. package/dist/node/index.js +9 -0
  26. package/dist/node/index.js.map +1 -0
  27. package/dist/node/interfaces/admin.d.ts +102 -0
  28. package/dist/node/interfaces/admin.js +2 -0
  29. package/dist/node/interfaces/admin.js.map +1 -0
  30. package/dist/node/interfaces/approval.d.ts +57 -0
  31. package/dist/node/interfaces/approval.js +62 -0
  32. package/dist/node/interfaces/approval.js.map +1 -0
  33. package/dist/node/interfaces/collection.d.ts +57 -0
  34. package/dist/node/interfaces/collection.js +2 -0
  35. package/dist/node/interfaces/collection.js.map +1 -0
  36. package/dist/node/interfaces/encoding.d.ts +24 -0
  37. package/dist/node/interfaces/encoding.js +32 -0
  38. package/dist/node/interfaces/encoding.js.map +1 -0
  39. package/dist/node/interfaces/events.d.ts +833 -0
  40. package/dist/node/interfaces/events.js +106 -0
  41. package/dist/node/interfaces/events.js.map +1 -0
  42. package/dist/node/interfaces/index.d.ts +10 -0
  43. package/dist/node/interfaces/index.js +11 -0
  44. package/dist/node/interfaces/index.js.map +1 -0
  45. package/dist/node/interfaces/ownable.d.ts +94 -0
  46. package/dist/node/interfaces/ownable.js +12 -0
  47. package/dist/node/interfaces/ownable.js.map +1 -0
  48. package/dist/node/interfaces/owner.d.ts +61 -0
  49. package/dist/node/interfaces/owner.js +101 -0
  50. package/dist/node/interfaces/owner.js.map +1 -0
  51. package/dist/node/interfaces/pausable.d.ts +74 -0
  52. package/dist/node/interfaces/pausable.js +14 -0
  53. package/dist/node/interfaces/pausable.js.map +1 -0
  54. package/dist/node/interfaces/types.d.ts +2297 -0
  55. package/dist/node/interfaces/types.js +507 -0
  56. package/dist/node/interfaces/types.js.map +1 -0
  57. package/dist/node/interfaces/update.d.ts +53 -0
  58. package/dist/node/interfaces/update.js +58 -0
  59. package/dist/node/interfaces/update.js.map +1 -0
  60. package/dist/node/marketplace/auction.d.ts +775 -0
  61. package/dist/node/marketplace/auction.js +430 -0
  62. package/dist/node/marketplace/auction.js.map +1 -0
  63. package/dist/node/marketplace/bid.d.ts +254 -0
  64. package/dist/node/marketplace/bid.js +260 -0
  65. package/dist/node/marketplace/bid.js.map +1 -0
  66. package/dist/node/marketplace/index.d.ts +5 -0
  67. package/dist/node/marketplace/index.js +6 -0
  68. package/dist/node/marketplace/index.js.map +1 -0
  69. package/dist/node/marketplace/nft-shares.d.ts +1083 -0
  70. package/dist/node/marketplace/nft-shares.js +398 -0
  71. package/dist/node/marketplace/nft-shares.js.map +1 -0
  72. package/dist/node/marketplace/offer.d.ts +192 -0
  73. package/dist/node/marketplace/offer.js +132 -0
  74. package/dist/node/marketplace/offer.js.map +1 -0
  75. package/dist/node/marketplace/types.d.ts +374 -0
  76. package/dist/node/marketplace/types.js +33 -0
  77. package/dist/node/marketplace/types.js.map +1 -0
  78. package/dist/node/metadata/index.d.ts +3 -0
  79. package/dist/node/metadata/index.js +4 -0
  80. package/dist/node/metadata/index.js.map +1 -0
  81. package/dist/node/metadata/metadata.d.ts +337 -0
  82. package/dist/node/metadata/metadata.js +439 -0
  83. package/dist/node/metadata/metadata.js.map +1 -0
  84. package/dist/node/metadata/text.d.ts +44 -0
  85. package/dist/node/metadata/text.js +42 -0
  86. package/dist/node/metadata/text.js.map +1 -0
  87. package/dist/node/metadata/tree.d.ts +75 -0
  88. package/dist/node/metadata/tree.js +85 -0
  89. package/dist/node/metadata/tree.js.map +1 -0
  90. package/dist/node/vk.d.ts +42 -0
  91. package/dist/node/vk.js +45 -0
  92. package/dist/node/vk.js.map +1 -0
  93. package/dist/node/zkprogram-example/game.d.ts +76 -0
  94. package/dist/node/zkprogram-example/game.js +108 -0
  95. package/dist/node/zkprogram-example/game.js.map +1 -0
  96. package/dist/node/zkprogram-example/index.d.ts +2 -0
  97. package/dist/node/zkprogram-example/index.js +3 -0
  98. package/dist/node/zkprogram-example/index.js.map +1 -0
  99. package/dist/node/zkprogram-example/update.d.ts +76 -0
  100. package/dist/node/zkprogram-example/update.js +85 -0
  101. package/dist/node/zkprogram-example/update.js.map +1 -0
  102. package/dist/tsconfig.tsbuildinfo +1 -0
  103. package/dist/tsconfig.web.tsbuildinfo +1 -0
  104. package/dist/web/admin/advanced.d.ts +469 -0
  105. package/dist/web/admin/advanced.js +525 -0
  106. package/dist/web/admin/advanced.js.map +1 -0
  107. package/dist/web/admin/index.d.ts +1 -0
  108. package/dist/web/admin/index.js +2 -0
  109. package/dist/web/admin/index.js.map +1 -0
  110. package/dist/web/contracts/admin.d.ts +140 -0
  111. package/dist/web/contracts/admin.js +336 -0
  112. package/dist/web/contracts/admin.js.map +1 -0
  113. package/dist/web/contracts/collection.d.ts +551 -0
  114. package/dist/web/contracts/collection.js +1049 -0
  115. package/dist/web/contracts/collection.js.map +1 -0
  116. package/dist/web/contracts/index.d.ts +3 -0
  117. package/dist/web/contracts/index.js +4 -0
  118. package/dist/web/contracts/index.js.map +1 -0
  119. package/dist/web/contracts/nft.d.ts +76 -0
  120. package/dist/web/contracts/nft.js +329 -0
  121. package/dist/web/contracts/nft.js.map +1 -0
  122. package/dist/web/contracts.d.ts +709 -0
  123. package/dist/web/contracts.js +61 -0
  124. package/dist/web/contracts.js.map +1 -0
  125. package/dist/web/index.d.ts +8 -0
  126. package/dist/web/index.js +9 -0
  127. package/dist/web/index.js.map +1 -0
  128. package/dist/web/interfaces/admin.d.ts +102 -0
  129. package/dist/web/interfaces/admin.js +2 -0
  130. package/dist/web/interfaces/admin.js.map +1 -0
  131. package/dist/web/interfaces/approval.d.ts +57 -0
  132. package/dist/web/interfaces/approval.js +62 -0
  133. package/dist/web/interfaces/approval.js.map +1 -0
  134. package/dist/web/interfaces/collection.d.ts +57 -0
  135. package/dist/web/interfaces/collection.js +2 -0
  136. package/dist/web/interfaces/collection.js.map +1 -0
  137. package/dist/web/interfaces/encoding.d.ts +24 -0
  138. package/dist/web/interfaces/encoding.js +32 -0
  139. package/dist/web/interfaces/encoding.js.map +1 -0
  140. package/dist/web/interfaces/events.d.ts +833 -0
  141. package/dist/web/interfaces/events.js +106 -0
  142. package/dist/web/interfaces/events.js.map +1 -0
  143. package/dist/web/interfaces/index.d.ts +10 -0
  144. package/dist/web/interfaces/index.js +11 -0
  145. package/dist/web/interfaces/index.js.map +1 -0
  146. package/dist/web/interfaces/ownable.d.ts +94 -0
  147. package/dist/web/interfaces/ownable.js +12 -0
  148. package/dist/web/interfaces/ownable.js.map +1 -0
  149. package/dist/web/interfaces/owner.d.ts +61 -0
  150. package/dist/web/interfaces/owner.js +101 -0
  151. package/dist/web/interfaces/owner.js.map +1 -0
  152. package/dist/web/interfaces/pausable.d.ts +74 -0
  153. package/dist/web/interfaces/pausable.js +14 -0
  154. package/dist/web/interfaces/pausable.js.map +1 -0
  155. package/dist/web/interfaces/types.d.ts +2297 -0
  156. package/dist/web/interfaces/types.js +507 -0
  157. package/dist/web/interfaces/types.js.map +1 -0
  158. package/dist/web/interfaces/update.d.ts +53 -0
  159. package/dist/web/interfaces/update.js +58 -0
  160. package/dist/web/interfaces/update.js.map +1 -0
  161. package/dist/web/marketplace/auction.d.ts +775 -0
  162. package/dist/web/marketplace/auction.js +430 -0
  163. package/dist/web/marketplace/auction.js.map +1 -0
  164. package/dist/web/marketplace/bid.d.ts +254 -0
  165. package/dist/web/marketplace/bid.js +260 -0
  166. package/dist/web/marketplace/bid.js.map +1 -0
  167. package/dist/web/marketplace/index.d.ts +5 -0
  168. package/dist/web/marketplace/index.js +6 -0
  169. package/dist/web/marketplace/index.js.map +1 -0
  170. package/dist/web/marketplace/nft-shares.d.ts +1083 -0
  171. package/dist/web/marketplace/nft-shares.js +398 -0
  172. package/dist/web/marketplace/nft-shares.js.map +1 -0
  173. package/dist/web/marketplace/offer.d.ts +192 -0
  174. package/dist/web/marketplace/offer.js +132 -0
  175. package/dist/web/marketplace/offer.js.map +1 -0
  176. package/dist/web/marketplace/types.d.ts +374 -0
  177. package/dist/web/marketplace/types.js +33 -0
  178. package/dist/web/marketplace/types.js.map +1 -0
  179. package/dist/web/metadata/index.d.ts +3 -0
  180. package/dist/web/metadata/index.js +4 -0
  181. package/dist/web/metadata/index.js.map +1 -0
  182. package/dist/web/metadata/metadata.d.ts +337 -0
  183. package/dist/web/metadata/metadata.js +439 -0
  184. package/dist/web/metadata/metadata.js.map +1 -0
  185. package/dist/web/metadata/text.d.ts +44 -0
  186. package/dist/web/metadata/text.js +42 -0
  187. package/dist/web/metadata/text.js.map +1 -0
  188. package/dist/web/metadata/tree.d.ts +75 -0
  189. package/dist/web/metadata/tree.js +85 -0
  190. package/dist/web/metadata/tree.js.map +1 -0
  191. package/dist/web/vk.d.ts +42 -0
  192. package/dist/web/vk.js +45 -0
  193. package/dist/web/vk.js.map +1 -0
  194. package/dist/web/zkprogram-example/game.d.ts +76 -0
  195. package/dist/web/zkprogram-example/game.js +108 -0
  196. package/dist/web/zkprogram-example/game.js.map +1 -0
  197. package/dist/web/zkprogram-example/index.d.ts +2 -0
  198. package/dist/web/zkprogram-example/index.js +3 -0
  199. package/dist/web/zkprogram-example/index.js.map +1 -0
  200. package/dist/web/zkprogram-example/update.d.ts +76 -0
  201. package/dist/web/zkprogram-example/update.js +85 -0
  202. package/dist/web/zkprogram-example/update.js.map +1 -0
  203. package/package.json +65 -0
  204. package/src/admin/advanced.ts +601 -0
  205. package/src/admin/index.ts +1 -0
  206. package/src/contracts/admin.ts +301 -0
  207. package/src/contracts/collection.ts +1172 -0
  208. package/src/contracts/index.ts +3 -0
  209. package/src/contracts/nft.ts +344 -0
  210. package/src/contracts.ts +107 -0
  211. package/src/index.ts +8 -0
  212. package/src/interfaces/admin.ts +127 -0
  213. package/src/interfaces/approval.ts +99 -0
  214. package/src/interfaces/collection.ts +68 -0
  215. package/src/interfaces/encoding.ts +32 -0
  216. package/src/interfaces/events.ts +115 -0
  217. package/src/interfaces/index.ts +10 -0
  218. package/src/interfaces/ownable.ts +32 -0
  219. package/src/interfaces/owner.ts +143 -0
  220. package/src/interfaces/pausable.ts +41 -0
  221. package/src/interfaces/types.ts +623 -0
  222. package/src/interfaces/update.ts +104 -0
  223. package/src/marketplace/auction.ts +527 -0
  224. package/src/marketplace/bid.ts +294 -0
  225. package/src/marketplace/index.ts +5 -0
  226. package/src/marketplace/nft-shares.ts +388 -0
  227. package/src/marketplace/offer.ts +153 -0
  228. package/src/marketplace/types.ts +33 -0
  229. package/src/metadata/index.ts +3 -0
  230. package/src/metadata/metadata.ts +603 -0
  231. package/src/metadata/text.ts +60 -0
  232. package/src/metadata/tree.ts +128 -0
  233. package/src/vk.ts +64 -0
  234. package/src/zkprogram-example/game.ts +136 -0
  235. package/src/zkprogram-example/index.ts +2 -0
  236. package/src/zkprogram-example/update.ts +98 -0
@@ -0,0 +1,551 @@
1
+ /**
2
+ * The NFT Collection Contract is responsible for managing a collection of NFTs.
3
+ * It handles minting new NFTs, transferring ownership, buying, selling,
4
+ * and interfacing with Admin Contracts for additional functionalities.
5
+ *
6
+ * @module CollectionContract
7
+ */
8
+ import { Field, PublicKey, AccountUpdate, Bool, State, DeployArgs, AccountUpdateForest, VerificationKey, UInt32, UInt64, SmartContract } from "o1js";
9
+ import { MintParams, MintRequest, TransferParams, CollectionData, NFTUpdateProof, NFTStateStruct, MintEvent, TransferEvent, ApproveEvent, UpgradeVerificationKeyEvent, LimitMintingEvent, PauseNFTEvent, NFTAdminBase, NFTAdminContractConstructor, PauseEvent, OwnershipChangeEvent, NFTOwnerBase, NFTOwnerContractConstructor, UpgradeVerificationKeyData, NFTApprovalContractConstructor, NFTApprovalBase, NFTUpdateContractConstructor, NFTUpdateBase, TransferExtendedParams } from "../interfaces/index.js";
10
+ export { CollectionDeployProps, CollectionFactory, CollectionErrors };
11
+ declare const CollectionErrors: {
12
+ wrongMasterNFTaddress: string;
13
+ transferNotAllowed: string;
14
+ collectionPaused: string;
15
+ cannotMintMasterNFT: string;
16
+ cannotMint: string;
17
+ noPermissionToPause: string;
18
+ noPermissionToResume: string;
19
+ collectionNotPaused: string;
20
+ transferApprovalRequired: string;
21
+ noPermissionToChangeName: string;
22
+ noPermissionToChangeBaseUri: string;
23
+ noPermissionToChangeCreator: string;
24
+ noPermissionToChangeRoyalty: string;
25
+ noPermissionToChangeTransferFee: string;
26
+ noPermissionToSetAdmin: string;
27
+ cannotUpgradeVerificationKey: string;
28
+ upgradeContractAddressNotSet: string;
29
+ adminContractAddressNotSet: string;
30
+ onlyOwnerCanUpgradeVerificationKey: string;
31
+ invalidRoyaltyFee: string;
32
+ invalidOracleAddress: string;
33
+ };
34
+ interface CollectionDeployProps extends Exclude<DeployArgs, undefined> {
35
+ collectionName: Field;
36
+ creator: PublicKey;
37
+ admin: PublicKey;
38
+ baseURL: Field;
39
+ symbol: string;
40
+ url: string;
41
+ }
42
+ /**
43
+ * Creates a new NFT Collection Contract class.
44
+ *
45
+ * @param params - Constructor parameters including admin and upgrade contracts, and network ID.
46
+ * @returns The Collection class extending TokenContract and implementing required interfaces.
47
+ */
48
+ declare function CollectionFactory(params: {
49
+ adminContract: () => NFTAdminContractConstructor;
50
+ ownerContract: () => NFTOwnerContractConstructor;
51
+ approvalContract: () => NFTApprovalContractConstructor;
52
+ updateContract: () => NFTUpdateContractConstructor;
53
+ }): {
54
+ new (address: PublicKey, tokenId?: Field): {
55
+ /** The name of the NFT collection. */
56
+ collectionName: State<import("node_modules/o1js/dist/node/lib/provable/field.js").Field>;
57
+ /** The public key of the creator of the collection. */
58
+ creator: State<PublicKey>;
59
+ /** The public key of the Admin Contract. */
60
+ admin: State<PublicKey>;
61
+ /** The base URL for the metadata of the NFTs in the collection. */
62
+ baseURL: State<import("node_modules/o1js/dist/node/lib/provable/field.js").Field>;
63
+ /**
64
+ * A packed data field containing additional collection parameters,
65
+ * such as flags and fee configurations.
66
+ */
67
+ packedData: State<import("node_modules/o1js/dist/node/lib/provable/field.js").Field>;
68
+ /**
69
+ * Deploys the NFT Collection Contract with the initial settings.
70
+ *
71
+ * @param props - Deployment properties including collection name, creator, admin, baseURL, symbol, and URL.
72
+ */
73
+ deploy(props: CollectionDeployProps): Promise<void>;
74
+ /**
75
+ * Initializes the collection with a master NFT and initial data.
76
+ *
77
+ * @param masterNFT - The master NFT parameters.
78
+ * @param collectionData - Initial collection data including flags and configurations.
79
+ */
80
+ initialize(masterNFT: MintParams, collectionData: CollectionData): Promise<void>;
81
+ /**
82
+ * Defines the events emitted by the contract.
83
+ */
84
+ events: {
85
+ mint: typeof MintEvent;
86
+ update: typeof PublicKey;
87
+ transfer: typeof TransferEvent;
88
+ approve: typeof ApproveEvent;
89
+ upgradeNFTVerificationKey: typeof UpgradeVerificationKeyEvent;
90
+ upgradeVerificationKey: typeof import("node_modules/o1js/dist/node/lib/provable/field.js").Field & ((x: string | number | bigint | import("node_modules/o1js/dist/node/lib/provable/core/fieldvar.js").FieldConst | import("node_modules/o1js/dist/node/lib/provable/core/fieldvar.js").FieldVar | import("node_modules/o1js/dist/node/lib/provable/field.js").Field) => import("node_modules/o1js/dist/node/lib/provable/field.js").Field);
91
+ limitMinting: typeof LimitMintingEvent;
92
+ pause: typeof PauseEvent;
93
+ resume: typeof PauseEvent;
94
+ pauseNFT: typeof PauseNFTEvent;
95
+ resumeNFT: typeof PauseNFTEvent;
96
+ ownershipChange: typeof OwnershipChangeEvent;
97
+ setName: typeof import("node_modules/o1js/dist/node/lib/provable/field.js").Field & ((x: string | number | bigint | import("node_modules/o1js/dist/node/lib/provable/core/fieldvar.js").FieldConst | import("node_modules/o1js/dist/node/lib/provable/core/fieldvar.js").FieldVar | import("node_modules/o1js/dist/node/lib/provable/field.js").Field) => import("node_modules/o1js/dist/node/lib/provable/field.js").Field);
98
+ setBaseURL: typeof import("node_modules/o1js/dist/node/lib/provable/field.js").Field & ((x: string | number | bigint | import("node_modules/o1js/dist/node/lib/provable/core/fieldvar.js").FieldConst | import("node_modules/o1js/dist/node/lib/provable/core/fieldvar.js").FieldVar | import("node_modules/o1js/dist/node/lib/provable/field.js").Field) => import("node_modules/o1js/dist/node/lib/provable/field.js").Field);
99
+ setRoyaltyFee: typeof UInt32;
100
+ setTransferFee: typeof UInt64;
101
+ setAdmin: typeof PublicKey;
102
+ };
103
+ /**
104
+ * Overrides the approveBase method to prevent transfers of tokens.
105
+ *
106
+ * @param forest - The account update forest.
107
+ */
108
+ approveBase(forest: AccountUpdateForest): Promise<void>;
109
+ /**
110
+ * Retrieves the Admin Contract instance.
111
+ *
112
+ * @returns The Admin Contract instance implementing NFTAdminBase.
113
+ */
114
+ getAdminContract(): NFTAdminBase;
115
+ /**
116
+ * Retrieves the NFT Owner Contract instance.
117
+ *
118
+ * @returns The Owner Contract instance implementing NFTOwnerBase.
119
+ */
120
+ getOwnerContract(address: PublicKey): NFTOwnerBase;
121
+ /**
122
+ * Retrieves the NFT Approval Contract instance.
123
+ *
124
+ * @returns The Approval Contract instance implementing NFTApprovalBase.
125
+ */
126
+ getApprovalContract(address: PublicKey): NFTApprovalBase;
127
+ /**
128
+ * Retrieves the NFT Update Contract instance.
129
+ *
130
+ * @returns The Update Contract instance implementing NFTUpdateBase.
131
+ */
132
+ getUpdateContract(address: PublicKey): NFTUpdateBase;
133
+ /**
134
+ * Ensures that the transaction is authorized by the creator.
135
+ *
136
+ * @returns The AccountUpdate of the creator.
137
+ */
138
+ ensureCreatorSignature(): Promise<AccountUpdate>;
139
+ /**
140
+ * Ensures that the transaction is authorized by the NFT owner
141
+ *
142
+ * @returns The AccountUpdate of the NFT owner.
143
+ */
144
+ ensureOwnerSignature(owner: PublicKey): Promise<AccountUpdate>;
145
+ /**
146
+ * Ensures that the collection is not paused.
147
+ *
148
+ * @returns The packed data of the collection.
149
+ */
150
+ ensureNotPaused(): Promise<void>;
151
+ /**
152
+ * Mints a new NFT directly by the creator.
153
+ *
154
+ * This method allows the creator of the collection to mint an NFT without requiring approval
155
+ * from the admin contract. It ensures that the collection is not paused and that the caller
156
+ * is the creator of the collection. A fee of 1 MINA is deducted from the creator's balance
157
+ * to cover the cost of creating a new account.
158
+ *
159
+ * We do not constrain here the address of the NFT to allow for the Master NFT to be minted.
160
+ * The Master NFT is the NFT with the same address as the Collection contract and it holds
161
+ * the metadata for the collection. It can be minted only by the creator of the collection.
162
+ *
163
+ * @param params - The mint parameters containing details of the NFT to be minted.
164
+ */
165
+ mintByCreator(params: MintParams): Promise<void>;
166
+ /**
167
+ * Mints a new NFT with approval.
168
+ *
169
+ * @param mintRequest - The minting request containing parameters and proofs.
170
+ */
171
+ mint(mintRequest: MintRequest): Promise<void>;
172
+ /**
173
+ * Internal method to mint an NFT.
174
+ *
175
+ * @param params - The mint parameters.
176
+ * @param collectionData - The current collection data.
177
+ * @returns The MintEvent emitted.
178
+ */
179
+ _mint(params: MintParams): Promise<MintEvent>;
180
+ /**
181
+ * Updates the NFT with admin approval.
182
+ *
183
+ * @param proof - The proof of the NFT update.
184
+ * @param vk - The verification key.
185
+ */
186
+ update(proof: NFTUpdateProof, vk: VerificationKey): Promise<void>;
187
+ /**
188
+ * Updates the NFT with admin approval and oracle approval.
189
+ *
190
+ * @param proof - The proof of the NFT update.
191
+ * @param vk - The verification key.
192
+ */
193
+ updateWithOracle(proof: NFTUpdateProof, vk: VerificationKey): Promise<void>;
194
+ /**
195
+ * Updates the NFT with admin approval - internal method.
196
+ *
197
+ * @param proof - The proof of the NFT update.
198
+ * @param vk - The verification key.
199
+ */
200
+ _update(proof: NFTUpdateProof, vk: VerificationKey): Promise<void>;
201
+ /**
202
+ * Approves an address to transfer an NFT.
203
+ *
204
+ * @param nftAddress - The address of the NFT.
205
+ * @param approved - The approved public key.
206
+ */
207
+ approveAddress(nftAddress: PublicKey, approved: PublicKey): Promise<void>;
208
+ /**
209
+ * Transfers ownership of an NFT without admin approval.
210
+ *
211
+ * @param address - The address of the NFT.
212
+ * @param to - The recipient's public key.
213
+ */
214
+ approveAddressByProof(nftAddress: PublicKey, approved: PublicKey): Promise<void>;
215
+ /**
216
+ * Transfers ownership of an NFT without admin approval.
217
+ * This method should be used by wallets for collections that do not require transfer approval
218
+ * and the owners of the NFTs which approve the transfer by signature
219
+ *
220
+ * @param address - The address of the NFT.
221
+ * @param to - The recipient's public key.
222
+ * @param price - The price of the NFT (optional).
223
+ */
224
+ transferBySignature(params: TransferParams): Promise<void>;
225
+ /**
226
+ * Transfers ownership of an NFT using a proof in case the owner is a contract
227
+ * Can be called by the owner or approved that should be a contracts
228
+ * supporting NFTApprovalBase interface
229
+ *
230
+ * @param params - The transfer parameters.
231
+ */
232
+ transferByProof(params: TransferParams): Promise<void>;
233
+ /**
234
+ * Transfers ownership of an NFT using a proof in case the owner is a contract
235
+ * Can be called by the owner or approved that should be a contracts
236
+ * supporting NFTApprovalBase interface
237
+ *
238
+ * @param params - The transfer parameters.
239
+ */
240
+ approvedTransferByProof(params: TransferParams): Promise<void>;
241
+ /**
242
+ * Transfers ownership of an NFT with admin approval.
243
+ *
244
+ * @param address - The address of the NFT.
245
+ * @param to - The recipient's public key.
246
+ * @param price - The price of the NFT (optional).
247
+ */
248
+ approvedTransferBySignature(params: TransferParams): Promise<void>;
249
+ /**
250
+ * Internal method to transfer an NFT.
251
+ *
252
+ * @param address - The address of the NFT.
253
+ * @param to - The recipient's public key.
254
+ * @param transferFee - The transfer fee amount.
255
+ * @returns The TransferEvent emitted.
256
+ */
257
+ _transfer(params: {
258
+ transferEventDraft: TransferExtendedParams;
259
+ transferFee: UInt64;
260
+ royaltyFee: UInt32;
261
+ }): Promise<TransferExtendedParams>;
262
+ /**
263
+ * Upgrades the verification key of a specific NFT.
264
+ *
265
+ * @param address - The address of the NFT.
266
+ * @param vk - The new verification key.
267
+ */
268
+ upgradeNFTVerificationKeyBySignature(address: PublicKey, vk: VerificationKey): Promise<void>;
269
+ /**
270
+ * Upgrades the verification key of a specific NFT by Proof.
271
+ *
272
+ * @param address - The address of the NFT.
273
+ * @param vk - The new verification key.
274
+ */
275
+ upgradeNFTVerificationKeyByProof(address: PublicKey, vk: VerificationKey): Promise<void>;
276
+ _upgrade(address: PublicKey, vk: VerificationKey): Promise<UpgradeVerificationKeyData>;
277
+ /**
278
+ * Upgrades the verification key of the collection contract.
279
+ *
280
+ * @param vk - The new verification key.
281
+ */
282
+ upgradeVerificationKey(vk: VerificationKey): Promise<void>;
283
+ /**
284
+ * Limits further minting of NFTs in the collection.
285
+ */
286
+ limitMinting(): Promise<void>;
287
+ /**
288
+ * Pauses the collection, disabling certain actions.
289
+ */
290
+ pause(): Promise<void>;
291
+ /**
292
+ * Resumes the collection, re-enabling actions.
293
+ */
294
+ resume(): Promise<void>;
295
+ /**
296
+ * Pauses a specific NFT, disabling its actions.
297
+ *
298
+ * @param address - The address of the NFT to pause.
299
+ */
300
+ pauseNFTBySignature(address: PublicKey): Promise<void>;
301
+ /**
302
+ * Pauses a specific NFT, disabling its actions.
303
+ *
304
+ * @param address - The address of the NFT to pause.
305
+ */
306
+ pauseNFTByProof(address: PublicKey): Promise<void>;
307
+ /**
308
+ * Resumes a specific NFT, re-enabling its actions.
309
+ *
310
+ * @param address - The address of the NFT to resume.
311
+ */
312
+ resumeNFT(address: PublicKey): Promise<void>;
313
+ /**
314
+ * Resumes a specific NFT, re-enabling its actions.
315
+ *
316
+ * @param address - The address of the NFT to resume.
317
+ */
318
+ resumeNFTByProof(address: PublicKey): Promise<void>;
319
+ /**
320
+ * Sets a new name for the collection.
321
+ * Requires owner signature and collection to not be paused.
322
+ * Emits a 'setName' event with the new name.
323
+ *
324
+ * @param name - The new name for the collection as a Field value
325
+ * @throws {Error} If caller lacks permission to change name
326
+ */
327
+ setName(name: Field): Promise<void>;
328
+ /**
329
+ * Updates the base URL for the collection's metadata.
330
+ * Requires owner signature and collection to not be paused.
331
+ * Emits a 'setBaseURL' event with the new URL.
332
+ *
333
+ * @param baseURL - The new base URL as a Field value
334
+ * @throws {Error} If caller lacks permission to change base URI
335
+ */
336
+ setBaseURL(baseURL: Field): Promise<void>;
337
+ /**
338
+ * Sets a new admin address for the collection.
339
+ * Requires owner signature and collection to not be paused.
340
+ * Emits a 'setAdmin' event with the new admin address.
341
+ *
342
+ * @param admin - The public key of the new admin
343
+ * @throws {Error} If caller lacks permission to set admin
344
+ */
345
+ setAdmin(admin: PublicKey): Promise<void>;
346
+ /**
347
+ * Updates the royalty fee for the collection.
348
+ * Requires owner signature and collection to not be paused.
349
+ * Emits a 'setRoyaltyFee' event with the new fee.
350
+ *
351
+ * @param royaltyFee - The new royalty fee as a UInt32 value
352
+ * @throws {Error} If caller lacks permission to change royalty fee
353
+ */
354
+ setRoyaltyFee(royaltyFee: UInt32): Promise<void>;
355
+ /**
356
+ * Updates the transfer fee for the collection.
357
+ * Requires owner signature and collection to not be paused.
358
+ * Emits a 'setTransferFee' event with the new fee.
359
+ *
360
+ * @param transferFee - The new transfer fee as a UInt64 value
361
+ * @throws {Error} If caller lacks permission to change transfer fee
362
+ */
363
+ setTransferFee(transferFee: UInt64): Promise<void>;
364
+ /**
365
+ * Transfers ownership of the collection to a new owner.
366
+ *
367
+ * @param to - The public key of the new owner.
368
+ * @returns The public key of the old owner.
369
+ */
370
+ transferOwnership(to: PublicKey): Promise<PublicKey>;
371
+ getNFTState(address: PublicKey): Promise<NFTStateStruct>;
372
+ deriveTokenId(): import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
373
+ readonly internal: {
374
+ mint({ address, amount, }: {
375
+ address: PublicKey | AccountUpdate | SmartContract;
376
+ amount: number | bigint | UInt64;
377
+ }): AccountUpdate;
378
+ burn({ address, amount, }: {
379
+ address: PublicKey | AccountUpdate | SmartContract;
380
+ amount: number | bigint | UInt64;
381
+ }): AccountUpdate;
382
+ send({ from, to, amount, }: {
383
+ from: PublicKey | AccountUpdate | SmartContract;
384
+ to: PublicKey | AccountUpdate | SmartContract;
385
+ amount: number | bigint | UInt64;
386
+ }): AccountUpdate;
387
+ };
388
+ forEachUpdate(updates: AccountUpdateForest, callback: (update: AccountUpdate, usesToken: Bool) => void): void;
389
+ checkZeroBalanceChange(updates: AccountUpdateForest): void;
390
+ approveAccountUpdate(accountUpdate: AccountUpdate | import("o1js").AccountUpdateTree): Promise<void>;
391
+ approveAccountUpdates(accountUpdates: (AccountUpdate | import("o1js").AccountUpdateTree)[]): Promise<void>;
392
+ transfer(from: PublicKey | AccountUpdate, to: PublicKey | AccountUpdate, amount: UInt64 | number | bigint): Promise<void>;
393
+ "__#3@#private": any;
394
+ address: PublicKey;
395
+ tokenId: Field;
396
+ init(): void;
397
+ requireSignature(): void;
398
+ skipAuthorization(): void;
399
+ readonly self: AccountUpdate;
400
+ newSelf(methodName?: string): AccountUpdate;
401
+ sender: {
402
+ self: SmartContract;
403
+ getUnconstrained(): PublicKey;
404
+ getAndRequireSignature(): PublicKey;
405
+ };
406
+ readonly account: import("node_modules/o1js/dist/node/lib/mina/precondition.js").Account;
407
+ readonly network: import("node_modules/o1js/dist/node/lib/mina/precondition.js").Network;
408
+ readonly currentSlot: import("node_modules/o1js/dist/node/lib/mina/precondition.js").CurrentSlot;
409
+ approve(update: AccountUpdate | import("o1js").AccountUpdateTree | AccountUpdateForest): void;
410
+ send(args: {
411
+ to: PublicKey | AccountUpdate | SmartContract;
412
+ amount: number | bigint | UInt64;
413
+ }): AccountUpdate;
414
+ readonly balance: {
415
+ addInPlace(x: string | number | bigint | UInt64 | UInt32 | import("o1js").Int64): void;
416
+ subInPlace(x: string | number | bigint | UInt64 | UInt32 | import("o1js").Int64): void;
417
+ };
418
+ emitEventIf<K extends "update" | "approve" | "transfer" | "upgradeVerificationKey" | "pause" | "resume" | "mint" | "upgradeNFTVerificationKey" | "limitMinting" | "pauseNFT" | "resumeNFT" | "ownershipChange" | "setName" | "setBaseURL" | "setRoyaltyFee" | "setTransferFee" | "setAdmin">(condition: Bool, type: K, event: any): void;
419
+ emitEvent<K extends "update" | "approve" | "transfer" | "upgradeVerificationKey" | "pause" | "resume" | "mint" | "upgradeNFTVerificationKey" | "limitMinting" | "pauseNFT" | "resumeNFT" | "ownershipChange" | "setName" | "setBaseURL" | "setRoyaltyFee" | "setTransferFee" | "setAdmin">(type: K, event: any): void;
420
+ fetchEvents(start?: UInt32, end?: UInt32): Promise<{
421
+ type: string;
422
+ event: {
423
+ data: import("o1js").ProvablePure<any>;
424
+ transactionInfo: {
425
+ transactionHash: string;
426
+ transactionStatus: string;
427
+ transactionMemo: string;
428
+ };
429
+ };
430
+ blockHeight: UInt32;
431
+ blockHash: string;
432
+ parentBlockHash: string;
433
+ globalSlot: UInt32;
434
+ chainStatus: string;
435
+ }[]>;
436
+ };
437
+ MAX_ACCOUNT_UPDATES: number;
438
+ _methods?: import("node_modules/o1js/dist/node/lib/proof-system/zkprogram.js").MethodInterface[];
439
+ _methodMetadata?: Record<string, {
440
+ actions: number;
441
+ rows: number;
442
+ digest: string;
443
+ gates: import("node_modules/o1js/dist/node/snarky.js").Gate[];
444
+ }>;
445
+ _provers?: import("node_modules/o1js/dist/node/snarky.js").Pickles.Prover[];
446
+ _maxProofsVerified?: 0 | 1 | 2;
447
+ _verificationKey?: {
448
+ data: string;
449
+ hash: Field;
450
+ };
451
+ Proof(): {
452
+ new ({ proof, publicInput, publicOutput, maxProofsVerified, }: {
453
+ proof: unknown;
454
+ publicInput: import("o1js").ZkappPublicInput;
455
+ publicOutput: undefined;
456
+ maxProofsVerified: 0 | 2 | 1;
457
+ }): {
458
+ verify(): void;
459
+ verifyIf(condition: import("node_modules/o1js/dist/node/lib/provable/bool.js").Bool): void;
460
+ publicInput: import("o1js").ZkappPublicInput;
461
+ publicOutput: undefined;
462
+ proof: unknown;
463
+ maxProofsVerified: 0 | 2 | 1;
464
+ shouldVerify: import("node_modules/o1js/dist/node/lib/provable/bool.js").Bool;
465
+ toJSON(): import("o1js").JsonProof;
466
+ publicFields(): {
467
+ input: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[];
468
+ output: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[];
469
+ };
470
+ };
471
+ publicInputType: Omit<import("node_modules/o1js/dist/node/lib/provable/types/provable-intf.js").Provable<{
472
+ accountUpdate: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
473
+ calls: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
474
+ }, {
475
+ accountUpdate: bigint;
476
+ calls: bigint;
477
+ }>, "fromFields"> & {
478
+ fromFields: (fields: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[]) => {
479
+ accountUpdate: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
480
+ calls: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
481
+ };
482
+ } & {
483
+ toInput: (x: {
484
+ accountUpdate: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
485
+ calls: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
486
+ }) => {
487
+ fields?: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[] | undefined;
488
+ packed?: [import("node_modules/o1js/dist/node/lib/provable/field.js").Field, number][] | undefined;
489
+ };
490
+ toJSON: (x: {
491
+ accountUpdate: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
492
+ calls: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
493
+ }) => {
494
+ accountUpdate: string;
495
+ calls: string;
496
+ };
497
+ fromJSON: (x: {
498
+ accountUpdate: string;
499
+ calls: string;
500
+ }) => {
501
+ accountUpdate: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
502
+ calls: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
503
+ };
504
+ empty: () => {
505
+ accountUpdate: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
506
+ calls: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
507
+ };
508
+ };
509
+ publicOutputType: import("node_modules/o1js/dist/node/lib/provable/types/struct.js").ProvablePureExtended<undefined, undefined, null>;
510
+ tag: () => typeof SmartContract;
511
+ fromJSON<S extends import("node_modules/o1js/dist/node/lib/util/types.js").Subclass<typeof import("o1js").Proof>>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise<import("o1js").Proof<import("o1js").InferProvable<S["publicInputType"]>, import("o1js").InferProvable<S["publicOutputType"]>>>;
512
+ dummy<Input, OutPut>(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 2 | 1, domainLog2?: number): Promise<import("o1js").Proof<Input, OutPut>>;
513
+ readonly provable: {
514
+ toFields: (value: import("o1js").Proof<any, any>) => import("node_modules/o1js/dist/node/lib/provable/field.js").Field[];
515
+ toAuxiliary: (value?: import("o1js").Proof<any, any> | undefined) => any[];
516
+ fromFields: (fields: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[], aux: any[]) => import("o1js").Proof<any, any>;
517
+ sizeInFields(): number;
518
+ check: (value: import("o1js").Proof<any, any>) => void;
519
+ toValue: (x: import("o1js").Proof<any, any>) => import("node_modules/o1js/dist/node/lib/proof-system/proof.js").ProofValue<any, any>;
520
+ fromValue: (x: import("o1js").Proof<any, any> | import("node_modules/o1js/dist/node/lib/proof-system/proof.js").ProofValue<any, any>) => import("o1js").Proof<any, any>;
521
+ toCanonical?: ((x: import("o1js").Proof<any, any>) => import("o1js").Proof<any, any>) | undefined;
522
+ };
523
+ publicFields(value: import("o1js").ProofBase<any, any>): {
524
+ input: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[];
525
+ output: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[];
526
+ };
527
+ _proofFromBase64(proofString: string, maxProofsVerified: 0 | 2 | 1): unknown;
528
+ _proofToBase64(proof: unknown, maxProofsVerified: 0 | 2 | 1): string;
529
+ };
530
+ compile({ cache, forceRecompile, }?: {
531
+ cache?: import("o1js").Cache | undefined;
532
+ forceRecompile?: boolean | undefined;
533
+ }): Promise<{
534
+ verificationKey: {
535
+ data: string;
536
+ hash: import("node_modules/o1js/dist/node/lib/provable/field.js").Field;
537
+ };
538
+ provers: import("node_modules/o1js/dist/node/snarky.js").Pickles.Prover[];
539
+ verify: (statement: import("node_modules/o1js/dist/node/snarky.js").Pickles.Statement<import("node_modules/o1js/dist/node/lib/provable/core/fieldvar.js").FieldConst>, proof: unknown) => Promise<boolean>;
540
+ }>;
541
+ digest(): Promise<string>;
542
+ runOutsideCircuit(run: () => void): void;
543
+ analyzeMethods({ printSummary }?: {
544
+ printSummary?: boolean | undefined;
545
+ }): Promise<Record<string, {
546
+ actions: number;
547
+ rows: number;
548
+ digest: string;
549
+ gates: import("node_modules/o1js/dist/node/snarky.js").Gate[];
550
+ }>>;
551
+ };