@6529-collections/stream-sdk 0.0.0-stage → 0.1.0-bootstrap.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 (148) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE +4 -0
  4. package/README.md +413 -2
  5. package/dist/actions/accounts.d.ts +58 -0
  6. package/dist/actions/accounts.js +73 -0
  7. package/dist/actions/content.d.ts +22 -0
  8. package/dist/actions/content.js +45 -0
  9. package/dist/actions/curated.d.ts +177 -0
  10. package/dist/actions/curated.js +279 -0
  11. package/dist/actions/editions.d.ts +100 -0
  12. package/dist/actions/editions.js +161 -0
  13. package/dist/actions/independent.d.ts +149 -0
  14. package/dist/actions/independent.js +274 -0
  15. package/dist/actions/money.d.ts +117 -0
  16. package/dist/actions/money.js +148 -0
  17. package/dist/actions/record.d.ts +144 -0
  18. package/dist/actions/record.js +229 -0
  19. package/dist/actions/sale.d.ts +82 -0
  20. package/dist/actions/sale.js +113 -0
  21. package/dist/actions/shared.d.ts +40 -0
  22. package/dist/actions/shared.js +70 -0
  23. package/dist/actions/vault.d.ts +58 -0
  24. package/dist/actions/vault.js +94 -0
  25. package/dist/constants.d.ts +130 -0
  26. package/dist/constants.js +65 -0
  27. package/dist/display.d.ts +31 -0
  28. package/dist/display.js +28 -0
  29. package/dist/encoding.d.ts +110 -0
  30. package/dist/encoding.js +138 -0
  31. package/dist/errors.d.ts +76 -0
  32. package/dist/errors.js +66 -0
  33. package/dist/files/fetch.d.ts +85 -0
  34. package/dist/files/fetch.js +208 -0
  35. package/dist/files/verify.d.ts +36 -0
  36. package/dist/files/verify.js +125 -0
  37. package/dist/generated/abis/AccessManager.d.ts +1125 -0
  38. package/dist/generated/abis/AccessManager.js +1471 -0
  39. package/dist/generated/abis/Accounts.d.ts +1568 -0
  40. package/dist/generated/abis/Accounts.js +2049 -0
  41. package/dist/generated/abis/ClaimRouter.d.ts +343 -0
  42. package/dist/generated/abis/ClaimRouter.js +452 -0
  43. package/dist/generated/abis/ConsolidationAdapter.d.ts +97 -0
  44. package/dist/generated/abis/ConsolidationAdapter.js +133 -0
  45. package/dist/generated/abis/ContentStore.d.ts +812 -0
  46. package/dist/generated/abis/ContentStore.js +1073 -0
  47. package/dist/generated/abis/EconomicsResolver.d.ts +586 -0
  48. package/dist/generated/abis/EconomicsResolver.js +769 -0
  49. package/dist/generated/abis/Eip712CurationVerifier.d.ts +304 -0
  50. package/dist/generated/abis/Eip712CurationVerifier.js +406 -0
  51. package/dist/generated/abis/EnglishAuction.d.ts +1435 -0
  52. package/dist/generated/abis/EnglishAuction.js +1865 -0
  53. package/dist/generated/abis/GovernedVault.d.ts +468 -0
  54. package/dist/generated/abis/GovernedVault.js +617 -0
  55. package/dist/generated/abis/IndependentEditionAuction.d.ts +2373 -0
  56. package/dist/generated/abis/IndependentEditionAuction.js +3076 -0
  57. package/dist/generated/abis/IndependentStream6529.d.ts +1408 -0
  58. package/dist/generated/abis/IndependentStream6529.js +1834 -0
  59. package/dist/generated/abis/IndependentStreamDeployer.d.ts +141 -0
  60. package/dist/generated/abis/IndependentStreamDeployer.js +188 -0
  61. package/dist/generated/abis/IndependentStreamEditions6529.d.ts +963 -0
  62. package/dist/generated/abis/IndependentStreamEditions6529.js +1253 -0
  63. package/dist/generated/abis/IndependentStreamRegistry.d.ts +1351 -0
  64. package/dist/generated/abis/IndependentStreamRegistry.js +1755 -0
  65. package/dist/generated/abis/PackageRegistry.d.ts +1205 -0
  66. package/dist/generated/abis/PackageRegistry.js +1573 -0
  67. package/dist/generated/abis/RevenueEscrow.d.ts +626 -0
  68. package/dist/generated/abis/RevenueEscrow.js +820 -0
  69. package/dist/generated/abis/SaleStarter.d.ts +48 -0
  70. package/dist/generated/abis/SaleStarter.js +67 -0
  71. package/dist/generated/abis/SepoliaOpenGate.d.ts +317 -0
  72. package/dist/generated/abis/SepoliaOpenGate.js +419 -0
  73. package/dist/generated/abis/SplitLedger.d.ts +1097 -0
  74. package/dist/generated/abis/SplitLedger.js +1438 -0
  75. package/dist/generated/abis/StatementLog.d.ts +958 -0
  76. package/dist/generated/abis/StatementLog.js +1248 -0
  77. package/dist/generated/abis/Stream6529.d.ts +1490 -0
  78. package/dist/generated/abis/Stream6529.js +1941 -0
  79. package/dist/generated/abis/StreamDirectory6529.d.ts +355 -0
  80. package/dist/generated/abis/StreamDirectory6529.js +468 -0
  81. package/dist/generated/abis/StreamEditions6529.d.ts +1240 -0
  82. package/dist/generated/abis/StreamEditions6529.js +1614 -0
  83. package/dist/generated/abis/StreamTerms.d.ts +312 -0
  84. package/dist/generated/abis/StreamTerms.js +409 -0
  85. package/dist/generated/abis/StreamWorkFacts6529.d.ts +810 -0
  86. package/dist/generated/abis/StreamWorkFacts6529.js +1049 -0
  87. package/dist/generated/abis/UniformEditionAuction.d.ts +2372 -0
  88. package/dist/generated/abis/UniformEditionAuction.js +3074 -0
  89. package/dist/generated/abis/WorkDelivery.d.ts +605 -0
  90. package/dist/generated/abis/WorkDelivery.js +786 -0
  91. package/dist/generated/abis/WorkRules.d.ts +1154 -0
  92. package/dist/generated/abis/WorkRules.js +1501 -0
  93. package/dist/generated/abis/index.d.ts +28 -0
  94. package/dist/generated/abis/index.js +31 -0
  95. package/dist/generated/instances.d.ts +7 -0
  96. package/dist/generated/instances.js +9 -0
  97. package/dist/generated/sepoliaR10.d.ts +1391 -0
  98. package/dist/generated/sepoliaR10.js +1545 -0
  99. package/dist/hashing/content.d.ts +42 -0
  100. package/dist/hashing/content.js +54 -0
  101. package/dist/hashing/ids.d.ts +67 -0
  102. package/dist/hashing/ids.js +73 -0
  103. package/dist/hashing/items.d.ts +30 -0
  104. package/dist/hashing/items.js +44 -0
  105. package/dist/hashing/packages.d.ts +35 -0
  106. package/dist/hashing/packages.js +76 -0
  107. package/dist/hashing/vault.d.ts +17 -0
  108. package/dist/hashing/vault.js +37 -0
  109. package/dist/hashing/workState.d.ts +31 -0
  110. package/dist/hashing/workState.js +37 -0
  111. package/dist/index.d.ts +44 -0
  112. package/dist/index.js +47 -0
  113. package/dist/instance.d.ts +236 -0
  114. package/dist/instance.js +99 -0
  115. package/dist/items.d.ts +85 -0
  116. package/dist/items.js +144 -0
  117. package/dist/reads/accounts.d.ts +86 -0
  118. package/dist/reads/accounts.js +121 -0
  119. package/dist/reads/chain.d.ts +54 -0
  120. package/dist/reads/chain.js +133 -0
  121. package/dist/reads/creation.d.ts +139 -0
  122. package/dist/reads/creation.js +256 -0
  123. package/dist/reads/editionSale.d.ts +120 -0
  124. package/dist/reads/editionSale.js +182 -0
  125. package/dist/reads/metadata.d.ts +195 -0
  126. package/dist/reads/metadata.js +191 -0
  127. package/dist/reads/money.d.ts +51 -0
  128. package/dist/reads/money.js +68 -0
  129. package/dist/reads/network.d.ts +137 -0
  130. package/dist/reads/network.js +157 -0
  131. package/dist/reads/sale.d.ts +94 -0
  132. package/dist/reads/sale.js +133 -0
  133. package/dist/reads/vault.d.ts +47 -0
  134. package/dist/reads/vault.js +75 -0
  135. package/dist/reads/work.d.ts +293 -0
  136. package/dist/reads/work.js +338 -0
  137. package/dist/reads/workPage.d.ts +197 -0
  138. package/dist/reads/workPage.js +169 -0
  139. package/dist/signing/messages.d.ts +679 -0
  140. package/dist/signing/messages.js +397 -0
  141. package/dist/testing.d.ts +17 -0
  142. package/dist/testing.js +18 -0
  143. package/dist/types.d.ts +167 -0
  144. package/dist/types.js +14 -0
  145. package/docs/publishing.md +54 -0
  146. package/docs/reference.md +335 -0
  147. package/docs/using-from-a-site.md +175 -0
  148. package/package.json +93 -4
@@ -0,0 +1,335 @@
1
+ <!-- Generated by scripts/reference.mjs from the doc comments in src/. Do not edit: run `npm run reference`. -->
2
+
3
+ # Reference: every function and the contract function behind it
4
+
5
+ Each row is one exported function: what it does, and the contract function, event or rule it
6
+ rests on, with a link to the source of the contracts at the commit this release was written
7
+ against. The text comes from the doc comment above the function, so this page and the code
8
+ cannot say different things; CI fails if they do.
9
+
10
+ ## Instance and chain guard
11
+
12
+ Which deployment, and the check that a client is on its chain.
13
+
14
+ | Function | What it does | Contract |
15
+ | --- | --- | --- |
16
+ | [`contractAt`](../src/instance.ts) | The deployed contract at `address`, with its record name, or null. For a page that shows an address and wants to say what it is and link its source. | none: a local helper |
17
+ | [`instanceFromRecord`](../src/instance.ts) | An instance for another deployment of THE SAME CODE as `base`: a local development chain, or a fresh test deployment from the same commit. Addresses, blocks and code hashes come from the deployment record (the JSON the contracts repository writes under `deployments/`); the ABIs, the protocol's strings and the governance table are `base`'s, which is why the record must name the same source commit. The record does not hold the network account, a test gate or who held each role at launch (those are in the deployment's genesis file), so they are given; `holdersAtGenesis` is empty unless given. | none: a local helper |
18
+ | [`assertInstanceChain`](../src/instance.ts) | Checks that `client` is connected to the chain `instance` lives on, and that the chain is a test network. Every read and action in this library calls it first, so a wallet that is on another network gets an error instead of a transaction to an address that means something else there. The answer is remembered only for a client without an account: such a client reads through a fixed RPC. A client with an account may be a browser wallet, which can switch network at any moment, so it is asked every time. | none: a local helper |
19
+
20
+ ## Hashing
21
+
22
+ Every hash the contracts compute, computed locally.
23
+
24
+ | Function | What it does | Contract |
25
+ | --- | --- | --- |
26
+ | [`itemHash`](../src/hashing/items.ts) | An item's hash: its identity, consumed at most once. | [`StreamHashing.itemHash`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/interfaces/types/StreamHashing.sol), read back from a minted work with `Stream6529.itemHashOf(tokenId)`. |
27
+ | [`mediaHash`](../src/hashing/items.ts) | The hash of an ordered media list, which `PackageItem.mediaHash` commits to. The primary file comes first and carries the item's `contentHash`. | [`StreamHashing.mediaHash`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/interfaces/types/StreamHashing.sol). |
28
+ | [`licenseKey`](../src/hashing/items.ts) | A license's canonical key: keccak256 of its SPDX identifier with the ASCII letters A to Z lowercased. Only those 26 bytes change, exactly as the contract does it, so this is not `toLowerCase()`. | [`StreamHashing.licenseKey`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/interfaces/types/StreamHashing.sol). |
29
+ | [`itemLeaf`](../src/hashing/packages.ts) | The Merkle leaf of an item hash: `keccak256(itemHash)`. Hashing twice makes a leaf's preimage 32 bytes, so an inner node (64 bytes) can never pass as a leaf. | [`StreamHashing.leaf`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/interfaces/types/StreamHashing.sol). |
30
+ | [`packageTree`](../src/hashing/packages.ts) | Builds the package tree over item hashes: the root every party signs, and the proof each item is minted with. | verified by [`StreamHashing.isItem`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/interfaces/types/StreamHashing.sol) (OpenZeppelin `MerkleProof.verify`), which `PackageRegistry.isApprovedItem` calls. |
31
+ | [`isPackageItem`](../src/hashing/packages.ts) | Whether `itemHash` is an item of the package with root `packageRoot`. | [`StreamHashing.isItem`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/interfaces/types/StreamHashing.sol). |
32
+ | [`manifestId`](../src/hashing/content.ts) | A file's ID in the content store. The ID commits to the chunk hashes, the stored length, the encoding, the MIME type and the SHA-256 of the decoded media, so a file fetched from anywhere can be checked against its ID alone. | [`ContentStore.manifestId`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/content/ContentStore.sol). |
33
+ | [`splitChunks`](../src/hashing/content.ts) | Splits stored bytes into the chunks the content store takes: `CHUNK_SIZE` bytes each, the last one shorter. | none: a local helper |
34
+ | [`prepareFile`](../src/hashing/content.ts) | Prepares a file for the content store, stored as it is (identity encoding): chunks, chunk hashes, SHA-256 and the file ID, all computed here. | the arguments of [`ContentStore.registerManifest`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/content/ContentStore.sol). |
35
+ | [`chunkData`](../src/hashing/content.ts) | Hex of bytes, for `ContentStore.writeChunk`. | none: a local helper |
36
+ | [`saleId`](../src/hashing/ids.ts) | The ID of a token's sale: the same rule on the English auction (`token` is the 1/1 contract) and on both edition auctions (`token` is the editions contract, `tokenId` the edition ID, which equals its master's token ID). | [`EnglishAuction.saleIdOf`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/EnglishAuction.sol), [`UniformEditionAuctionLens.saleIdOf`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/UniformEditionAuctionLens.sol). |
37
+ | [`statementSubjectKey`](../src/hashing/ids.ts) | The key of a statement subject: a token (`token`, `id`), or a work ID when `token` is zero. | [`StatementLog.subjectKey`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/records/StatementLog.sol). |
38
+ | [`listingSubject`](../src/hashing/ids.ts) | The subject of a listing consent: the `what` of the `Consent` message an artist signs to list a contract. Compute it here and show its inputs to the artist; do not sign a value an RPC supplied. | [`IndependentStreamRegistry.listingSubject`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/independent/IndependentStreamRegistry.sol). |
39
+ | [`independentConsent`](../src/hashing/ids.ts) | What a collaborator of an Independent Stream work consents to: the item and its royalty rate. It is the `what` of the `Consent` message, whose `subject` is the token contract. | [`Core.independentConsent`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/interfaces/core/CoreTypes.sol). |
40
+ | [`newArtistId`](../src/hashing/ids.ts) | The artist ID a wallet gets when its account is created: the address as a number. | [`PackageTypes.sol`, `Party`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/interfaces/types/PackageTypes.sol). |
41
+ | [`artistIdAddress`](../src/hashing/ids.ts) | The address whose number an artist ID is. It is the account's first root, not always its current one. | none: a local helper |
42
+ | [`workStateHash`](../src/hashing/workState.ts) | A work's state hash. A signature over a change names the state it was made for, so it cannot be used after anything about the work changed. | [`WorkRules.workStateHash`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/records/WorkRules.sol). |
43
+ | [`vaultAddress`](../src/hashing/vault.ts) | The address of the vault (split wallet) of a payee list, computed here. A vault's address is fixed by its payees: the ledger creates it with CREATE2 from one init code, with the salt `keccak256(abi.encode(keccak256(abi.encode(payees)), salt))`. ETH sent to the address is held for the payees even before the vault is created. | [`SplitLedger.walletFor`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/SplitLedger.sol) (`_walletSalt`, `walletInitCodeHash`). |
44
+ | [`vaultAddressOf`](../src/hashing/vault.ts) | `vaultAddress` for a ledger and init code hash given directly. | none: a local helper |
45
+
46
+ ## Signed messages
47
+
48
+ Every EIP-712 message the contracts check, as typed data.
49
+
50
+ | Function | What it does | Contract |
51
+ | --- | --- | --- |
52
+ | [`signingDomains`](../src/signing/messages.ts) | The signing domain of each contract of an instance. | none: a local helper |
53
+ | [`walletProof`](../src/signing/messages.ts) | The proof form the contracts read a wallet's signature in: the wallet's 20 bytes followed by its signature (`abi.encodePacked(wallet, signature)`). | [`Accounts.requireSigned`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/identity/Accounts.sol). |
54
+ | [`packageAcceptanceTypedData`](../src/signing/messages.ts) | A party accepts a package root. The first acceptance of a wallet creates its account with these profile fields; every later one must repeat the stored fields. | checked by [`PackageRegistry.acceptPackage`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/curation/PackageRegistry.sol); the digest is `PackageRegistry.acceptanceDigest`. |
55
+ | [`moveToStreamTypedData`](../src/signing/messages.ts) | The lead artist moves an approved item to Stream: the signature that lets anyone start the work's sale, once. | checked by [`PackageRegistry.authorize`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/curation/PackageRegistry.sol) when a sale starts; the digest is `PackageRegistry.moveDigest`. |
56
+ | [`packageApprovalTypedData`](../src/signing/messages.ts) | A curation signer approves a package root. Only an account holding the curation signer role can make a signature the registry accepts. | checked by [`Eip712CurationVerifier`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/curation/Eip712CurationVerifier.sol) for `PackageRegistry.registerPackage`; the digest is `approvalDigest`. The attestation the registry takes is `abi.encode(signer, signature)`. |
57
+ | [`artistRegistrationTypedData`](../src/signing/messages.ts) | A wallet agrees to the account the Independent Stream module creates for it when it lists its first contract. | checked by [`Accounts.registerIndependent`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/identity/Accounts.sol), called from `IndependentStreamRegistry.register`; the digest is `Accounts.registrationDigest`. |
58
+ | [`consentTypedData`](../src/signing/messages.ts) | An account consents to `what`, for the contract `subject` only. There is no deadline and no nonce in the message: where one is needed it is inside `what` (see `listingSubject`). | checked by [`Accounts.requireConsent`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/identity/Accounts.sol), where `subject` is the calling contract; the digest is `Accounts.consentDigest`. |
59
+ | [`identityChangeTypedData`](../src/signing/messages.ts) | An account's own identity change, signed by any wallet of the account. | checked by [`Accounts`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/identity/Accounts.sol) when the change is staged; the digest is `Accounts.changeDigest`. `nonce` is `Accounts.changeNonce(artistId)`. |
60
+ | [`replacementAcceptanceTypedData`](../src/signing/messages.ts) | The new root accepts a replacement of an account's root by the network. | checked by [`Accounts`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/identity/Accounts.sol); the digest is `Accounts.replacementDigest`. |
61
+ | [`relicenseTypedData`](../src/signing/messages.ts) | Every party agrees to relicense a work. `licenseKey` is `licenseKey(spdxId)` of the new license and `textFileId` the file ID of its text. | checked by [`WorkRules.relicense`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/records/WorkRules.sol), one signature per party, and the network makes the call. |
62
+ | [`royaltyRateChangeTypedData`](../src/signing/messages.ts) | Every party agrees to change a work's royalty rate (`rate` out of 100,000). | checked by [`WorkRules.setRoyaltyRate`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/records/WorkRules.sol), one signature per party, and the network makes the call. |
63
+ | [`renouncePowersTypedData`](../src/signing/messages.ts) | The lead artist gives up powers over a work for good. `powers` is a mask of `WORK_POWERS`. | checked by [`WorkRules.renounce`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/records/WorkRules.sol). |
64
+ | [`releaseAuthorizationTypedData`](../src/signing/messages.ts) | A payee authorizes a release of its share to a recipient, relayed by anyone. | checked by [`SplitLedger.releaseWithAuthorization`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/SplitLedger.sol); the digest is `SplitLedger.releaseDigest`. |
65
+ | [`statementAuthorizationTypedData`](../src/signing/messages.ts) | A signer authorizes one statement in a role, relayed by anyone. | checked by [`StatementLog.appendSigned`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/records/StatementLog.sol); the digest is `StatementLog.authorizationDigest`. |
66
+
67
+ ## Encodings
68
+
69
+ The byte encodings the contracts take as opaque `bytes`.
70
+
71
+ | Function | What it does | Contract |
72
+ | --- | --- | --- |
73
+ | [`encodeStreamMintRequest`](../src/encoding.ts) | `abi.encode(StreamMintRequest)`: the `request` of `EnglishAuction.start`, `startWithBid` and `SaleStarter.start` for a curated work. | decoded by [`PackageRegistry.authorize`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/curation/PackageRegistry.sol). |
74
+ | [`encodeIndependentMint`](../src/encoding.ts) | `abi.encode(IIndependentStream.IndependentMint)`: the `request` of `EnglishAuction.start` and `startWithBid` for an Independent Stream work. | decoded by [`IndependentStreamRegistry.authorize`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/independent/IndependentStreamRegistry.sol). |
75
+ | [`encodeCuratedEditionOpen`](../src/encoding.ts) | The `data` of `UniformEditionAuction.open` for a curated edition master: `abi.encode(item, packageRoot, proof)`. | [`UniformEditionAuction.open`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/UniformEditionAuction.sol). |
76
+ | [`encodeIndependentEditionOpen`](../src/encoding.ts) | The `data` of `IndependentEditionAuction.open` for an Independent Stream edition master: `abi.encode(item)`. | [`IndependentEditionAuction.open`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/independent/IndependentEditionAuction.sol). |
77
+ | [`encodeIndependent721Config`](../src/encoding.ts) | The `config` of `IndependentStreamDeployer.deploy` for a 1/1 contract: `abi.encode(name, symbol, workFacts, streamDirectory, artistId, owner, renderer)`. | the constructor of [`IndependentStream6529`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/independent/IndependentStream6529.sol). |
78
+ | [`encodeIndependentEditionsConfig`](../src/encoding.ts) | The `config` of `IndependentStreamDeployer.deploy` for an editions contract: `abi.encode(name, symbol, master, streamDirectory, artistId, owner)`. | the constructor of [`IndependentStreamEditions6529`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/independent/IndependentStreamEditions6529.sol). |
79
+ | [`decodeStartCalldata`](../src/encoding.ts) | Reads the item out of the calldata of a transaction that started a first sale: `EnglishAuction.start`, `EnglishAuction.startWithBid` or `SaleStarter.start`. Returns null for any other call. | none: a local helper |
80
+
81
+ ## Building an item
82
+
83
+ From a draft to the item that is hashed, approved and signed.
84
+
85
+ | Function | What it does | Contract |
86
+ | --- | --- | --- |
87
+ | [`itemProblems`](../src/items.ts) | The rules of an item that can be checked without the chain, each with its name: the ones the package registry enforces when a sale starts. An item that breaks one is approved and accepted all the same, and only refused (`InvalidItem`, with no reason) at the start, after every party has signed. Run this before anyone signs; `previewCuratedItem` also asks the registry. | `_checkItem` of [`PackageRegistry`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/curation/PackageRegistry.sol) and the payee order of [`Splits`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/Splits.sol). |
88
+ | [`canonicalPayees`](../src/items.ts) | Payees in the one order the contracts accept: strictly ascending by artist ID, then by address. The order carries no meaning, and the same payee twice is refused. | [`Splits`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/Splits.sol) (`PayeesNotCanonical`), and `PackageRegistry`'s check of an item's payees. |
89
+ | [`buildItem`](../src/items.ts) | Builds the `PackageItem` of a work sold by English auction in ETH, unseeded, and the media list it commits to. The item is what gets hashed, approved, signed and minted: show its fields to the artist before any signature. | the `PackageItem` struct of [`PackageTypes.sol`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/interfaces/types/PackageTypes.sol). |
90
+ | [`cc0License`](../src/items.ts) | A CC0 license for `buildItem`, given the file ID of the CC0 text the instance stores. | none: a local helper |
91
+
92
+ ## Reads: works
93
+
94
+ What the chain says about a work.
95
+
96
+ | Function | What it does | Contract |
97
+ | --- | --- | --- |
98
+ | [`readWorkPage`](../src/reads/workPage.ts) | What a page about one work shows, in one call: | see `sources` in the result, and each read function named above. |
99
+ | [`readWork`](../src/reads/work.ts) | A work's permanent facts: its item hash, artist, collection, kind, seed, royalty, how its first sale ended, its record, license and files. | [`Stream6529.workOf`, `ownerOf`, `collectionOf`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/core/StreamBase.sol), [`StreamWorkFacts6529.factsOf`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/core/StreamWorkFacts6529.sol), [`Accounts.artist`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/identity/Accounts.sol). An artist's own contract answers the same functions. |
100
+ | [`readWorkMint`](../src/reads/work.ts) | The facts a work's mint recorded: its content hash, package root, media hash, seller vault and the transaction that started its first sale. Returns null if no mint event is found in the range scanned. | the `WorkMinted` event of [`Stream6529`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/core/StreamBase.sol). |
101
+ | [`readWorkItem`](../src/reads/work.ts) | The full item a work was minted from: who made it, who is paid and in what shares, the license it was approved with, and its sale and edition terms. The chain stores only the item's hash; the item itself is in the `RecordOpened` event once the record is open, and before that in the calldata of the transaction that started the first sale. | the `RecordOpened` event of [`StreamWorkFacts6529`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/core/StreamWorkFacts6529.sol); `EnglishAuction.start`, `startWithBid` and `SaleStarter.start` calldata. |
102
+ | [`readWorkFiles`](../src/reads/work.ts) | The files of a work with their hashes, sizes, types and where copies can be fetched. The record must be open (`readWork(...).record.opened`), or the list is empty. | [`StreamWorkFacts6529.factsOf`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/core/StreamWorkFacts6529.sol), [`ContentStore.fileInfo`, `isComplete`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/content/ContentStore.sol), [`WorkDelivery.locators`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/stream/WorkDelivery.sol). |
103
+ | [`readRoyalty`](../src/reads/work.ts) | The ERC-2981 royalty for a sale of `salePrice`. | [`Stream6529.royaltyInfo`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/core/StreamBase.sol). |
104
+ | [`canRelease`](../src/reads/work.ts) | Whether `viewer` can send the plain release (`releaseFromVault`) for this payee: the "take out" button. For an `"artist"` payee only the wallet that IS the payout address can (the artist's other wallets cannot; they need `signReleaseAuthorization` and `releaseSigned`). For an `"address"` payee any connected wallet can, and the money still goes only to `paidTo`. False with no viewer, and for an artist account that does not exist yet. | the caller rule of [`SplitLedger.release`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/SplitLedger.sol); nothing is read here. |
105
+ | [`readSplit`](../src/reads/work.ts) | The seller vault of a work's payees: its address, and what each payee has released and can release now, in ETH. `payees` is the item's payee list (`readWorkItem(...).item.payees`). | [`SplitLedger.walletFor`, `releasable`, `released`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/SplitLedger.sol), with salt zero, as the terms module derives a work's seller vault. |
106
+ | [`readCollections`](../src/reads/work.ts) | The collections of a token contract, newest first, at most `limit` (default 100). Collection names are free text from the chain: clean them before display. | [`Stream6529.collectionCount`, `collectionOf`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/core/StreamBase.sol). |
107
+ | [`readCc0TextFileId`](../src/reads/work.ts) | The file ID of the CC0 1.0 legal text this instance stores: the `textFileId` of a CC0 license (`cc0License`). | [`StreamWorkFacts6529.cc0TextFileId`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/core/StreamWorkFacts6529.sol). |
108
+ | [`parseRecord`](../src/reads/metadata.ts) | Reads the known keys out of a record's JSON (as `fetchRecord` returns it): name, description, artists, year, medium, dimensions, attributes, dependencies. A key that is missing or of another type comes back null or empty; nothing throws. Every string is the artist's own text: escape it for display. | the keys [`Renderer`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/content/Renderer.sol) reads from a record for `tokenURI`. |
109
+ | [`readTokenMetadata`](../src/reads/metadata.ts) | The metadata of a work as marketplaces and wallets see it: `tokenURI(tokenId)`, with its JSON parsed when it is a `data:` URI. Use it to compare what a page shows with what a marketplace will show. It is the renderer's output: an `image` or `animation_url` inside it can point anywhere, so treat it as untrusted and prefer `fetchWorkFile` for the art itself. Returns null when the token does not exist or its renderer does not answer. | [`Stream6529.tokenURI`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/core/StreamBase.sol), answered by [`Renderer.tokenURI`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/content/Renderer.sol). |
110
+ | [`readContractMetadata`](../src/reads/metadata.ts) | A token contract's own metadata (`contractURI`, ERC-7572), parsed like `readTokenMetadata`. Works for the 1/1 contracts and the editions contracts. | [`Stream6529.contractURI`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/core/StreamBase.sol). |
111
+ | [`readEdition`](../src/reads/metadata.ts) | The edition of a master work on an editions contract: how many copies exist, whether more can be minted, its royalty, its metadata URI, and a holder's balance. `editions` is the ERC-1155 contract (`readEditionVenue(...).editions`; default: the instance's curated one). | the `EditionCreated` event and [`StreamEditions6529.editionOf`, `uri`, `balanceOf`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/core/StreamEditions6529.sol). |
112
+ | [`readWorks`](../src/reads/metadata.ts) | The works of a token contract, oldest first, optionally only one collection's or one artist's. Read from the contract's `WorkMinted` events, so it includes works that were burned since; `readWork` tells what each is now. For a testnet's volumes a scan is enough; a site with many works wants an indexer. | the `WorkMinted` event of [`Stream6529`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/core/StreamBase.sol) (indexed by token, collection and artist). |
113
+ | [`readStatements`](../src/reads/metadata.ts) | The statements the log holds about a subject: a token (`token`, `id`), or, with the zero address as token, a package (`id` is the package root as a number). Statements are append-only attributions: who said what about a work, with a hash of the document. | [`StatementLog.chainOf`, `latestDisputeOutcome`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/records/StatementLog.sol) and its `StatementAppended` event. |
114
+
115
+ ## Reads: vaults
116
+
117
+ Where sale proceeds and royalties wait.
118
+
119
+ | Function | What it does | Contract |
120
+ | --- | --- | --- |
121
+ | [`royaltyPayees`](../src/reads/vault.ts) | The payee list of a work's royalty vault: the work's seller vault takes everything but the network's share, and the network's fee recipient takes that share, both as fixed payees in address order. With a fee share of zero there is no royalty vault: royalties go straight to the seller vault. | [`Splits.royaltyPayees`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/Splits.sol). |
122
+ | [`readVault`](../src/reads/vault.ts) | A vault (split wallet) by its address: its payees, and what each has released and can release now in ETH. The payee list is not stored on chain; it is read from the event the ledger emitted when the vault was created, and checked: the list must derive this address. Returns null for a vault nobody has created yet (ETH sent to its address is still held for it; build its payee list from the work's item and use `readSplit`). | the `WalletCreated` event and `walletFor`, `releasable`, `released` of [`SplitLedger`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/SplitLedger.sol). |
123
+ | [`readRoyaltyVault`](../src/reads/vault.ts) | The royalty vault of a work. Royalties are NOT paid to the seller vault: they go to a second vault that splits them between the network and the seller vault. Anyone can move the seller vault's part on (`collectRoyalties`), and the work's payees then take their shares from the seller vault as they do for sale proceeds (`releaseFromVault`). | [`Stream6529.workOf`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/core/StreamBase.sol) (`royaltyReceiver`), and `readVault`. |
124
+ | [`readEscrow`](../src/reads/money.ts) | What the revenue escrow holds for an account. A payment that could not be delivered (a wallet that refused ETH, a token that blocks an address) is credited here instead, so the sale still settles; the credit waits for anyone to flush it to the wallet it was made for. A credit nobody flushes for the unclaimed period (180 days at launch) can be moved to the network. | [`RevenueEscrow.owed`, `expirableAt`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/RevenueEscrow.sol). |
125
+ | [`readNetworkVaults`](../src/reads/money.ts) | The network's fee vault and museum vault: where each forwards to, and the ETH each holds. Neither vault can send anywhere but its destination; anyone may trigger the forward (`forwardVault`). | [`GovernedVault.destination`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/GovernedVault.sol), and `RevenueEscrow.owed`. |
126
+ | [`readIsConsolidated`](../src/reads/money.ts) | Whether `wallet` is consolidated with `root` in the 6529 delegation contract (use case 999, all collections, registered in both directions and not expired). A consolidated wallet acts for the root's account with the same rights. Consolidations are made in the delegation contract itself (`instance.delegation`), not in these contracts. | [`ConsolidationAdapter.isConsolidated`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/identity/ConsolidationAdapter.sol). |
127
+
128
+ ## Reads: before creating
129
+
130
+ What a creation flow checks before it signs or sends.
131
+
132
+ | Function | What it does | Contract |
133
+ | --- | --- | --- |
134
+ | [`gateOf`](../src/reads/creation.ts) | The test gate of an instance, or an error saying it has none. | none: a local helper |
135
+ | [`readGate`](../src/reads/creation.ts) | Whether the test gate of an instance is open for `account` right now: it can create a collection and its approval of a package is accepted. The network can close the gate at any time, so ask before a run that stores files. | [`SepoliaOpenGate.createCollection`, `attestationOf`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/script/sepolia/SepoliaOpenGate.sol), [`PackageRegistry.registerPackage`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/curation/PackageRegistry.sol). A TEST CONVENIENCE: with the gate open nothing is curated. |
136
+ | [`readPackageStatus`](../src/reads/creation.ts) | The state of a package root in the registry: not registered, approved, or revoked (also when its signer's approvals were stopped). | [`PackageRegistry.packageOf`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/curation/PackageRegistry.sol). |
137
+ | [`readStoredProfile`](../src/reads/creation.ts) | The profile fields an acceptance by `account` must carry: the stored ones if the wallet has an account (every later acceptance must repeat them), otherwise null, and the caller decides what the new account's fields are. | [`Accounts.artistIdOf`, `artist`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/identity/Accounts.sol). |
138
+ | [`readNextMoveNonce`](../src/reads/creation.ts) | An artist's first unused move nonce, counting up from 0. Any unused number is valid; small ones share storage words, which costs the least gas. | [`PackageRegistry.isMoveNonceUsed`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/curation/PackageRegistry.sol). |
139
+ | [`readMintedToken`](../src/reads/creation.ts) | The token already minted from `item` on `token`, or null. | [`Stream6529.tokenOfContent`, `itemHashOf`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/core/StreamBase.sol). |
140
+ | [`previewCuratedItem`](../src/reads/creation.ts) | Checks a curated item before anyone signs for it. An item that breaks a rule is approved and accepted all the same and only refused when the sale starts, with no reason given; by then the first acceptance has stored each new party's profile for good. | [`PackageRegistry.preview`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/curation/PackageRegistry.sol). |
141
+ | [`readListingPlan`](../src/reads/creation.ts) | What listing `token` will record: which template deployed it, its partner, and the network share the listing fixes. Show `feeShare` to the artist: the consent they sign names it. | [`IndependentStreamDeployer.deployed`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/independent/IndependentStreamDeployer.sol), [`IndependentStreamEditions6529.stream`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/independent/IndependentStreamEditions6529.sol), [`EconomicsResolver.economics`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/EconomicsResolver.sol). |
142
+ | [`isFileRegistered`](../src/reads/creation.ts) | Whether a file is registered in the content store. | [`ContentStore.fileInfo`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/content/ContentStore.sol), which reverts for an unknown file. |
143
+
144
+ ## Display
145
+
146
+ Showing a verified file safely.
147
+
148
+ | Function | What it does | Contract |
149
+ | --- | --- | --- |
150
+ | [`displayAdvice`](../src/display.ts) | How to show a file of a given MIME type safely. "Verified" means the bytes are the ones the work commits to; it does not mean they are safe to put in your page. The content store accepts any type, including `image/svg+xml`, `text/html` and `text/javascript`, and those can run code. A page that inlines a verified SVG, sets it as `innerHTML`, or serves a verified HTML file from its own origin gives the artist's file the page's cookies and wallet connection. | the MIME type is the one declared in the file's manifest ([`ContentStore.registerManifest`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/content/ContentStore.sol)), limited by the store to lowercase letters, digits and `+-._/`. |
151
+
152
+ ## Reads: sales
153
+
154
+ The 1/1 auction and the edition auction.
155
+
156
+ | Function | What it does | Contract |
157
+ | --- | --- | --- |
158
+ | [`readSale`](../src/reads/sale.ts) | The state of a work's first sale: the top bid, the end time, what a new bid must pay and what can be done next. | [`EnglishAuction.auction`, `auctionClock`, `minimumBid`, `pendingDelivery`, `refusableAt`, `config`, `paused`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/EnglishAuction.sol). |
159
+ | [`readSaleHistory`](../src/reads/sale.ts) | The bids and the settlement of a work's sale, from the auction's events. A restart keeps the sale ID, so only events since the latest start count. | the `SaleStarted`, `BidPlaced` and `SaleSettled` events of [`EnglishAuction`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/EnglishAuction.sol). |
160
+ | [`readEditionVenue`](../src/reads/editionSale.ts) | The editions contract and the edition auction of a 1/1 contract: the instance's own pair for `Stream6529`, or the artist's listed editions contract and the Independent edition auction. Returns null for an artist's contract with no editions contract listed. | [`IndependentStreamRegistry.listingOf`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/independent/IndependentStreamRegistry.sol). |
161
+ | [`readEditionSale`](../src/reads/editionSale.ts) | The edition sale of a master work: status, ladder, bids per step, end times and the result so far. Returns null when the 1/1 contract has no editions contract. A sale nobody opened yet comes back with status `"notOpened"`. | [`UniformEditionAuction.auction`, `endTimes`, `clearing`, `ladder`, `stepTotals`, `abandonable`, `paused`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/UniformEditionAuctionLens.sol) (the auction forwards its read functions to its lens; call them on the auction's address). |
162
+ | [`readEditionBid`](../src/reads/editionSale.ts) | One edition bid and its outcome. Returns null once the bid was claimed (the contract deletes it) or if it never existed. | [`UniformEditionAuction.bidOf`, `bidOutcome`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/UniformEditionAuctionLens.sol). |
163
+ | [`readEditionBids`](../src/reads/editionSale.ts) | Every bid of an edition sale, from its events, optionally only one bidder's. Use it to find a wallet's bid IDs for `claimEditionBid`. | the `BidPlaced`, `BidRaised` and `BidClaimed` events of [`UniformEditionAuction`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/UniformEditionAuction.sol). |
164
+
165
+ ## Reads: accounts
166
+
167
+ Artist accounts and credits.
168
+
169
+ | Function | What it does | Contract |
170
+ | --- | --- | --- |
171
+ | [`readArtistId`](../src/reads/accounts.ts) | The artist ID recorded for an address: the account it is (or was) the root of, or, with none, the ID a new account for it gets (the address as a number). | [`Accounts.artistIdOf`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/identity/Accounts.sol). |
172
+ | [`readAccountOf`](../src/reads/accounts.ts) | The account a wallet acts for, or null. This is the one place the library answers "whose wallet is this", so that a change in the contracts is a change here only. | [`Accounts.artistIdOf`, `isWallet`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/identity/Accounts.sol). |
173
+ | [`readAccount`](../src/reads/accounts.ts) | An account's identity, authority and payout address, or null when no account has this ID. | [`Accounts.artist`, `activeAuthorityOf`, `payoutAddress`, `changeNonce`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/identity/Accounts.sol). |
174
+ | [`readIsWallet`](../src/reads/accounts.ts) | Whether `wallet` acts for the account `artistId` (its root, or a wallet consolidated with it). | [`Accounts.isWallet`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/identity/Accounts.sol). |
175
+ | [`readClaimable`](../src/reads/accounts.ts) | The ETH credited to `account` on the three auction contracts: outbid 1/1 bids and edition refunds are credited, never pushed, and wait to be withdrawn. | [`EnglishAuction.claimable`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/EnglishAuction.sol), [`UniformEditionAuction.claimable`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/UniformEditionAuction.sol). |
176
+
177
+ ## Reads: the network
178
+
179
+ How the instance is governed.
180
+
181
+ | Function | What it does | Contract |
182
+ | --- | --- | --- |
183
+ | [`readNetwork`](../src/reads/network.ts) | A read-only view of how an instance is governed right now: the network account, the modules in force and any waiting to replace them, each role and who holds it, the role each governed function needs, the settings, and the calls scheduled in the access manager with the time each can run. | [`AccessManager`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/manager/AccessManager.sol) `hasRole`, `getTargetFunctionRole`, `getSchedule`, event `OperationScheduled`; [`StreamDirectory6529`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/core/StreamDirectory6529.sol) and the token contracts' `moduleOf`, `pendingModule`, `moduleDelay`; [`EconomicsResolver.economics`, `museum`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/EconomicsResolver.sol). |
184
+
185
+ ## Reads: chain helpers
186
+
187
+ Time, deadlines and event scans.
188
+
189
+ | Function | What it does | Contract |
190
+ | --- | --- | --- |
191
+ | [`chainTime`](../src/reads/chain.ts) | The chain's clock: the timestamp of the latest block, in Unix seconds. | none: a local helper |
192
+ | [`chainDeadline`](../src/reads/chain.ts) | A signature deadline on the chain's clock: the latest block's time plus `lifetimeSeconds`. | none: a local helper |
193
+ | [`allowClockDifferenceForTests`](../src/reads/chain.ts) | Turns the clock check of `chainDeadline` off for the whole process. FOR LOCAL FORKS ONLY, where tests move the chain's clock by days; never in a page or a script that signs for real. | none: a local helper |
194
+ | [`isContractRevert`](../src/reads/chain.ts) | Whether `error` is a revert of the contract itself (not a network failure), optionally one named `errorName`. | none: a local helper |
195
+ | [`revertName`](../src/reads/chain.ts) | The name of the custom error a contract reverted with, or null when it is not a named revert. | none: a local helper |
196
+ | [`orOnRevert`](../src/reads/chain.ts) | Runs a read and answers `fallback` when the contract reverts. Any other failure is thrown. | none: a local helper |
197
+ | [`scanEvents`](../src/reads/chain.ts) | One event's logs from one contract, since the instance was deployed, fetched in block windows so that public RPCs accept the requests. `args` filters by indexed arguments. | none: a local helper |
198
+
199
+ ## Files
200
+
201
+ Fetching files and verifying them.
202
+
203
+ | Function | What it does | Contract |
204
+ | --- | --- | --- |
205
+ | [`readManifest`](../src/files/fetch.ts) | A file's manifest, read from the content store and proven against the file ID: the chunk hashes, length, encoding, MIME type and SHA-256 must hash to `fileId`. No answer can pass for a manifest that is not this file ID's, so everything `fetchFile` checks rests on the file ID. Whether that file ID belongs to a given work is another question, answered by whoever supplied it (for a work: the token contract, through your RPC). | [`ContentStore.fileInfo`, `chunkHash`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/content/ContentStore.sol). |
206
+ | [`fetchFile`](../src/files/fetch.ts) | Fetches a file and returns it only after its bytes were verified against its file ID. | [`ContentStore.readChunk`, `isComplete`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/content/ContentStore.sol); locators from [`WorkDelivery.locators`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/stream/WorkDelivery.sol). |
207
+ | [`fetchWorkFile`](../src/files/fetch.ts) | Fetches one file of a work, verified: the primary file by default, or the file with `fileId`, which must be one of the work's files. The work's registered Arweave and IPFS copies are used when the chain does not hold the file. | as `readWorkFiles` and `fetchFile`. |
208
+ | [`fetchRecord`](../src/files/fetch.ts) | A work's descriptive record (JSON: name, description, artists and more), fetched and verified like any file, then parsed. The fields are whatever the artist wrote: treat them as untrusted text. | `factsOf(token, tokenId).recordFileId` in [`StreamWorkFacts6529`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/core/StreamWorkFacts6529.sol). |
209
+ | [`chainManifestId`](../src/files/verify.ts) | The file ID a manifest must have. For `digestKind` 0 this is `manifestId`; a file registered with another digest kind appends the kind. | [`ContentStore.registerManifest`, `registerManifestList`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/content/ContentStore.sol). |
210
+ | [`decodeStored`](../src/files/verify.ts) | Turns stored bytes into the media: as they are, base64-decoded, unpacked from gzip, or both. | none: a local helper |
211
+ | [`assertDecoded`](../src/files/verify.ts) | Checks decoded media against the SHA-256 its manifest declares. Throws on a mismatch. Only `digestKind` 0 (SHA-256) can be checked by this release. | none: a local helper |
212
+ | [`verifyStored`](../src/files/verify.ts) | Checks stored bytes against a manifest, chunk by chunk, and returns the decoded media after checking it against the manifest's SHA-256. Throws `FileVerificationError` on any mismatch. | none: a local helper |
213
+ | [`verifyFetched`](../src/files/verify.ts) | Checks bytes fetched from outside the chain against a manifest: they may be the decoded media (the usual case) or the stored form. Returns the decoded media, or throws. | none: a local helper |
214
+
215
+ ## Actions: files
216
+
217
+ Putting files into the content store.
218
+
219
+ | Function | What it does | Contract |
220
+ | --- | --- | --- |
221
+ | [`storeFile`](../src/actions/content.ts) | Stores a file in the content store: writes each chunk that is not there yet, then registers the manifest. Anyone may store any file, and a chunk or file stored already is skipped, so the call can be repeated after a failure. With `upload: false` only the manifest is registered: the file gets its ID, and its bytes are served from Arweave or IPFS. | [`ContentStore.writeChunk`, `registerManifest`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/content/ContentStore.sol). |
222
+
223
+ ## Actions: a curated work
224
+
225
+ The curated flow, through the test gate on a test instance.
226
+
227
+ | Function | What it does | Contract |
228
+ | --- | --- | --- |
229
+ | [`createCollectionThroughGate`](../src/actions/curated.ts) | Creates a collection of the curated Stream contract through the test gate. Anyone may; a collection has no owner, and any later item may name it. | [`SepoliaOpenGate.createCollection`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/script/sepolia/SepoliaOpenGate.sol), which forwards to `Stream6529.createCollection`. On an instance without a gate only the platform role can create collections. |
230
+ | [`registerPackageThroughGate`](../src/actions/curated.ts) | Registers a package root with the test gate's approval, so no curation signer is needed. Anyone may send it. A root registers once: when it is approved already, nothing is sent. | [`SepoliaOpenGate.attestationOf`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/script/sepolia/SepoliaOpenGate.sol) supplies the evidence hash and the attestation, passed unchanged to [`PackageRegistry.registerPackage`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/curation/PackageRegistry.sol). On an instance without a gate, the attestation is `abi.encode(signer, signature)` of a curation signer's `PackageApproval` (`packageApprovalTypedData`). |
231
+ | [`acceptPackage`](../src/actions/curated.ts) | The wallet accepts a package root as one of its parties: it signs a `PackageAcceptance` and sends it. A wallet's first acceptance creates its account. Every party of every item must accept before an item can be minted. | [`PackageRegistry.acceptPackage`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/curation/PackageRegistry.sol); message `PackageAcceptance` (`packageAcceptanceTypedData`). |
232
+ | [`signMove`](../src/actions/curated.ts) | The lead artist signs the move of one approved item to Stream. Whoever holds the result can start the item's sale, once, until the deadline; the artist can cancel it before with `PackageRegistry.revokeMove`. | message `MoveToStream` (`moveToStreamTypedData`), checked by [`PackageRegistry.authorize`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/curation/PackageRegistry.sol). |
233
+ | [`startedTokenId`](../src/actions/curated.ts) | The token a start minted, read from the receipt's `SaleStarted` log. | none: a local helper |
234
+ | [`startCuratedSale`](../src/actions/curated.ts) | Starts the sale of an approved, accepted curated item: the work is minted into the English auction and its 24-hour sale begins (the duration is the auction's setting; r10 runs one hour). Anyone may send it; the artist's signed move is what authorizes it. | [`SaleStarter.start`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/SaleStarter.sol), [`EnglishAuction.startWithBid`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/EnglishAuction.sol); the request is `encodeStreamMintRequest`. |
235
+ | [`openRecord`](../src/actions/curated.ts) | Publishes a work's record: its files, license and descriptive record become readable on chain (`open`), and, when every file is stored in full, it is marked complete on chain so the renderer can serve the art (`markOnChainComplete`). Anyone may send both; each is skipped when done. The item and media must be the ones the work was minted from. | [`StreamWorkFacts6529.open`, `markOnChainComplete`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/core/StreamWorkFacts6529.sol). |
236
+ | [`openCuratedEditionSale`](../src/actions/curated.ts) | Opens the edition sale of a curated edition master, beside its 1/1 sale. Anyone may send it, from the start of the 1/1 until 15 minutes after the 1/1 ends, which is when the edition sale closes. Until someone opens it, nobody can bid on the editions. Nothing is sent when it is open already. | [`UniformEditionAuction.open`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/UniformEditionAuction.sol) with `encodeCuratedEditionOpen(item, packageRoot, proof)`. |
237
+
238
+ ## Actions: Independent Stream
239
+
240
+ An artist's own contract.
241
+
242
+ | Function | What it does | Contract |
243
+ | --- | --- | --- |
244
+ | [`deployIndependentContract`](../src/actions/independent.ts) | Deploys an artist's own 1/1 contract (Independent Stream) from the approved template. The contract is the artist's for good: every work minted there names this artist. It mints nothing until it is listed (`listIndependentContract`). | [`IndependentStreamDeployer.deploy`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/independent/IndependentStreamDeployer.sol) with `encodeIndependent721Config`. |
245
+ | [`deployIndependentEditions`](../src/actions/independent.ts) | Deploys the editions contract that partners an artist's 1/1 contract `master`. It is needed only to sell editions of the artist's works, and must be listed too. | [`IndependentStreamDeployer.deploy`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/independent/IndependentStreamDeployer.sol) with `encodeIndependentEditionsConfig`. |
246
+ | [`listIndependentContract`](../src/actions/independent.ts) | Lists an artist's contract in the Independent Stream module, so sales can mint into it. The wallet signs a consent to the listing, then sends `register`. A contract is listed once and never leaves the directory (the network can delist it, which stops its sales). | [`IndependentStreamRegistry.register`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/independent/IndependentStreamRegistry.sol); messages `ArtistRegistration` and `Consent` in the accounts domain. |
247
+ | [`approveIndependentItem`](../src/actions/independent.ts) | The artist approves one item for one mint into their own 1/1 contract, with the royalty rate its work gets (out of 100,000). Any wallet of the contract's artist may send it. The approval can be changed until the item is minted. Nothing is sent when the item is approved at this rate already. | [`IndependentStreamRegistry.approveItem`, `itemOf`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/independent/IndependentStreamRegistry.sol). |
248
+ | [`signIndependentConsent`](../src/actions/independent.ts) | A collaborator consents to an Independent Stream item at its royalty rate. The result is one entry of `consents` for `startIndependentSale`. The consent holds until it is used. | message `Consent` with subject `token` and what `independentConsent(itemHash, royaltyRate)`, checked by [`Accounts.requireConsent`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/identity/Accounts.sol) when the item is minted. |
249
+ | [`startIndependentSale`](../src/actions/independent.ts) | Starts the sale of an item the artist approved for their own contract: the work is minted into the English auction. Anyone may send it. With `firstBid` (wei) the sender places the first bid in the same transaction. | [`EnglishAuction.start`, `startWithBid`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/EnglishAuction.sol) with `encodeIndependentMint`. |
250
+ | [`openIndependentEditionSale`](../src/actions/independent.ts) | Opens the edition sale of an Independent Stream edition master, beside its 1/1 sale. Anyone may send it, from the start of the 1/1 until 15 minutes after the 1/1 ends. Nothing is sent when it is open already. | [`IndependentEditionAuction.open`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/independent/IndependentEditionAuction.sol) with `encodeIndependentEditionOpen(item)`. |
251
+
252
+ ## Actions: the 1/1 sale
253
+
254
+ Bidding, settling, claiming.
255
+
256
+ | Function | What it does | Contract |
257
+ | --- | --- | --- |
258
+ | [`placeBid`](../src/actions/sale.ts) | Bids on a 1/1. `amount` is the whole bid in wei and must be at least `readSale(...).minimumBid`. The bidder it outbids is credited, not paid: they withdraw with `claimAuctionCredit`. A bid in the last minutes moves the end (the auction's extension window). | [`EnglishAuction.bid`, `minimumBid`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/EnglishAuction.sol). |
259
+ | [`settleSale`](../src/actions/sale.ts) | Finishes a sale after its end. Anyone may send it. A sold work goes to the winner (or waits for `claimDelivery` if it could not be delivered) and the price is split; an unsold curated work goes to the museum; an unsold Independent Stream work stays in the auction and can be offered again (`restartSale`). | [`EnglishAuction.settle`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/EnglishAuction.sol). |
260
+ | [`claimAuctionCredit`](../src/actions/sale.ts) | Withdraws the ETH credited to the connected wallet on the English auction (outbid bids), to `to` (default: the wallet itself). | [`EnglishAuction.claim`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/EnglishAuction.sol). |
261
+ | [`claimDelivery`](../src/actions/sale.ts) | Collects a work whose delivery did not go through at settlement, to `to` (default: the wallet itself). The recipient the bid named may (`readSale(...).pendingDelivery`), and so may the bidder. | [`EnglishAuction.claimDelivery`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/EnglishAuction.sol). |
262
+ | [`restartSale`](../src/actions/sale.ts) | Offers an unsold Independent Stream work again: a new sale under the same sale ID. Anyone may send it, from `restartDelay` seconds after the end. Curated works are never offered again: unsold, they go to the museum. | [`EnglishAuction.restart`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/EnglishAuction.sol). |
263
+ | [`settleOrRefund`](../src/actions/sale.ts) | Settles an ended Independent Stream sale, or, if its token contract refuses the settlement, returns the top bid to its bidder as a credit and leaves the work to be offered again. Accepted from `readSale(...).refusableAt`. Anyone may send it. | [`EnglishAuction.settleOrRefund`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/EnglishAuction.sol). |
264
+ | [`sendRescuedToMuseum`](../src/actions/sale.ts) | Sends a rescued work the auction still holds to the museum. Anyone may. It applies only to a work whose recorded outcome is "rescued" (the network moved it out of a removed sale contract) and that sits in this auction; any other work is left alone and the call reverts. | [`EnglishAuction.sendRescuedToMuseum`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/EnglishAuction.sol). |
265
+ | [`withdrawBid`](../src/actions/sale.ts) | The top bidder takes their bid back from a sale the network paused. Not possible in a running sale. The bid is credited, not paid: withdraw it with `claimAuctionCredit`. | [`EnglishAuction.withdrawBid`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/EnglishAuction.sol). |
266
+
267
+ ## Actions: the edition sale
268
+
269
+ Edition bids, settlement and claims.
270
+
271
+ | Function | What it does | Contract |
272
+ | --- | --- | --- |
273
+ | [`bidEdition`](../src/actions/editions.ts) | Bids for `quantity` copies at price step `step` of the sale's ladder. The bid pays exactly `stepPrice(step) * quantity`, read from the contract here. Every winner pays the one clearing price in the end; what was paid above it comes back when the bid is claimed. | [`UniformEditionAuction.bid`, `stepPrice`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/UniformEditionAuction.sol). |
274
+ | [`raiseEditionBid`](../src/actions/editions.ts) | Moves the wallet's bid up to a higher price step, paying exactly the difference for every unit. A raised bid joins the back of its new step. | [`UniformEditionAuction.raise`, `bidOf`, `stepPrice`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/UniformEditionAuction.sol). |
275
+ | [`settleEditionSale`](../src/actions/editions.ts) | Settles a closed edition sale. Anyone may. Settlement runs in calls of bounded gas, so this sends as many transactions as it takes (at most `maxTransactions`, default 20): the contract is asked for the caller's next slice of the order before each one. | [`UniformEditionAuction.settle`, `settlementOrderFor`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/UniformEditionAuction.sol). |
276
+ | [`claimEditionBid`](../src/actions/editions.ts) | Claims the wallet's bid after settlement: the copies it won are minted to `to` (default: the wallet itself), and the ETH it did not spend is paid back. | [`UniformEditionAuction.claimBid`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/UniformEditionAuction.sol). |
277
+ | [`claimEditionBidFor`](../src/actions/editions.ts) | Claims someone else's bid for them. Anyone may: the copies go to the bidder, and the refund is credited to the bidder, who withdraws it with `claimEditionCredit`. | [`UniformEditionAuction.claimBidFor`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/UniformEditionAuction.sol). |
278
+ | [`claimEditionCredit`](../src/actions/editions.ts) | Withdraws the ETH credited to the connected wallet on an edition auction (refunds that were credited instead of paid), to `to` (default: the wallet itself). | [`UniformEditionAuction.claim`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/UniformEditionAuction.sol) with the ETH currency (the zero address). |
279
+ | [`abandonEditionSale`](../src/actions/editions.ts) | Voids an edition sale that can no longer settle (`readEditionSale(...).abandonable`), so every bidder can take their ETH back. Anyone may. | [`UniformEditionAuction.abandon`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/sales/UniformEditionAuction.sol). |
280
+
281
+ ## Actions: the vaults
282
+
283
+ Taking proceeds out of vaults, the escrow and the network's vaults.
284
+
285
+ | Function | What it does | Contract |
286
+ | --- | --- | --- |
287
+ | [`releaseFromVault`](../src/actions/vault.ts) | Pays a payee its share of what a vault holds. Sale proceeds are held in a work's seller vault until each payee takes its part; royalties arrive there through the royalty vault (`collectRoyalties`). The money goes to the payee: an artist account's payout address, or the fixed address. For a payee named by artist ID the call must come from that account's payout address; a payee named by a fixed address can be paid out by anyone. | [`SplitLedger.release`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/SplitLedger.sol) with salt zero, as a work's seller vault is derived. `readSplit` shows what is releasable. |
288
+ | [`releaseFromVaultTo`](../src/actions/vault.ts) | As `releaseFromVault`, but the payee sends its share to `recipient` instead of its own address. Only the payee itself may: the account's payout address, or the fixed address. | [`SplitLedger.releaseTo`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/SplitLedger.sol). |
289
+ | [`collectRoyalties`](../src/actions/vault.ts) | Moves a work's royalties on from its royalty vault to its seller vault. Royalties from marketplaces are paid to the royalty vault, which splits them between the network and the work's seller vault; this pays out the seller vault's part (and the network's with it). Anyone may call it. The work's payees then take their shares with `releaseFromVault`. | [`SplitLedger.release`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/SplitLedger.sol) on the royalty vault, whose payees are `Splits.royaltyPayees(sellerVault, feeRecipient, feeShare)`. |
290
+ | [`flushEscrow`](../src/actions/money.ts) | Pays out everything the escrow holds for `wallet` to that wallet. Anyone may call it; the money can only go to the wallet it was credited to. | [`RevenueEscrow.flush`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/RevenueEscrow.sol). |
291
+ | [`expireEscrow`](../src/actions/money.ts) | Moves the part of an account's escrow credit that has waited the unclaimed period to the network's fee vault. Anyone may call it, and it reverts while no part has waited long enough (`readEscrow(...).expirableNow` says how much has). | [`RevenueEscrow.expire`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/RevenueEscrow.sol). |
292
+ | [`forwardVault`](../src/actions/money.ts) | Forwards what a network vault holds to its destination. Anyone may call it; the vault can send nowhere else. `amount` is in wei (or the asset's smallest unit). | [`GovernedVault.forward`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/GovernedVault.sol). |
293
+ | [`claimMany`](../src/actions/money.ts) | Pays out several fixed-address payees of several vaults in one transaction. Anyone may call it. Only payees named by a fixed address can be paid this way (a payee named by artist ID must call `releaseFromVault` from its payout address, or sign with `signReleaseAuthorization`). With `continueOnFailure` an item that fails is skipped and reported as zero; without it one failure reverts the batch. | [`ClaimRouter.claim`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/ClaimRouter.sol). |
294
+ | [`signReleaseAuthorization`](../src/actions/money.ts) | A payee signs a permission to release its share of a vault to `recipient`, for anyone to send (`releaseSigned`). The connected wallet must be the payee's own address: the payout address of its account, or the fixed address. | message `ReleaseAuthorization` (`releaseAuthorizationTypedData`), checked by [`SplitLedger.releaseWithAuthorization`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/SplitLedger.sol). |
295
+ | [`releaseSigned`](../src/actions/money.ts) | Sends a release a payee signed (`signReleaseAuthorization`). Anyone may; the money goes to the recipient the payee named. | [`SplitLedger.releaseWithAuthorization`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/economics/SplitLedger.sol). |
296
+ | [`signReplacementAcceptance`](../src/actions/money.ts) | The new root of an account signs its acceptance of a replacement of the root by the network. The network stages the replacement with this proof; it takes effect after its notice period unless a wallet of the account contests it (`cancelIdentityChange`). | message `ReplacementAcceptance` (`replacementAcceptanceTypedData`), checked by [`Accounts.stageReplacement`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/identity/Accounts.sol). |
297
+
298
+ ## Actions: a work's record
299
+
300
+ Record, license, royalty and powers after the mint.
301
+
302
+ | Function | What it does | Contract |
303
+ | --- | --- | --- |
304
+ | [`readWorkState`](../src/actions/record.ts) | A work's changeable state (record file, license, royalty rate, renderer, version) and its state hash, computed here from the fields read and checked against the contract's own answer. Every signature over a change to a work names this hash, so the signer can see which state they sign for. | [`WorkRules.versionOf`, `workStateHash`, `renouncedPowers`, `finalizeNoticeAt`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/records/WorkRules.sol), `StreamWorkFacts6529.factsOf`, `Stream6529.workOf`, `moduleOf`. |
305
+ | [`setRecord`](../src/actions/record.ts) | The lead artist points a work at a new descriptive record, until the record is finalized. The new record must be stored in full in the content store as one chunk, as it is (`storeFile` of a small JSON does that). Any wallet of the lead artist's account may send it. | [`WorkRules.setRecord`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/records/WorkRules.sol). |
306
+ | [`finalizeRecord`](../src/actions/record.ts) | Finalizes a work's record: from then on its descriptive record and its renderer are fixed. A wallet of the lead artist's account finalizes at once. Anyone else may, once the first sale has an outcome: their first call only records a notice, and a call from 14 days later (`WorkRules.FINALIZE_NOTICE`) finalizes the record as it then stands. | [`WorkRules.finalize`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/records/WorkRules.sol). |
307
+ | [`signRelicenseConsent`](../src/actions/record.ts) | A party of a work consents to relicensing it. Every party must consent, in the order the item lists them, and the network then makes the call (`WorkRules.relicense`): a relicense is never the artist's decision alone, and never the network's alone. CC0 is never left. | message `Relicense` (`relicenseTypedData`), checked by [`WorkRules.relicense`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/records/WorkRules.sol). |
308
+ | [`signRoyaltyRateConsent`](../src/actions/record.ts) | A party of a work consents to a new royalty rate (out of 100,000). Every party must consent, and the network then makes the call (`WorkRules.setRoyaltyRate`). | message `RoyaltyRateChange` (`royaltyRateChangeTypedData`), checked by [`WorkRules.setRoyaltyRate`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/records/WorkRules.sol). |
309
+ | [`signRenounce`](../src/actions/record.ts) | The lead artist signs away powers over a work, for good: `powers` is a mask of `WORK_POWERS`. The result is what `renouncePowers` sends. | message `RenouncePowers` (`renouncePowersTypedData`), checked by [`WorkRules.renounce`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/records/WorkRules.sol). |
310
+ | [`renouncePowers`](../src/actions/record.ts) | Sends a renunciation the lead artist signed (`signRenounce`). Giving up the power to repin the renderer (`WORK_POWERS.RENDERER_REPIN`) needs the artist's signature only, on a finalized work, and anyone may send it. Giving up the royalty-rate or relicense power also needs the network to make the call. | [`WorkRules.renounce`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/records/WorkRules.sol). |
311
+ | [`addLocator`](../src/actions/record.ts) | Registers a copy of one of a work's files outside the chain: `ar://<43-character transaction ID>` (kind `LOCATOR_KIND.ARWEAVE`) or `ipfs://<CIDv1>` (kind `LOCATOR_KIND.IPFS`). A wallet of the work's artist account may add locators until the record is finalized; after that only the platform role. Locators are never removed. `fetchFile` checks whatever a locator serves against the file's hash, so a wrong copy is skipped, not shown. | [`WorkDelivery.addLocator`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/stream/WorkDelivery.sol). |
312
+ | [`attestFileComplete`](../src/actions/record.ts) | Attests that the content store holds every chunk of a file, so the file counts as on chain. Anyone may. A large file is attested over several calls of `chunksPerCall` chunks (default 64); this sends them until the file is attested. Nothing is sent when it already is. | [`ContentStore.attestComplete`, `isComplete`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/content/ContentStore.sol). |
313
+ | [`tokenOfRef`](../src/actions/record.ts) | The token contract of a work reference. | none: a local helper |
314
+
315
+ ## Actions: accounts
316
+
317
+ Changes to an artist account.
318
+
319
+ | Function | What it does | Contract |
320
+ | --- | --- | --- |
321
+ | [`readPendingChange`](../src/actions/accounts.ts) | The change waiting on an account, or null. An account's own change (new payout address, root or profile) waits 2 days; a replacement of the root by the network waits 14 days and can be contested by the account. | [`Accounts.pendingChange`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/identity/Accounts.sol). |
322
+ | [`stageIdentityChange`](../src/actions/accounts.ts) | Stages an account's own change: a new payout address, root or profile. A wallet of the account signs it (`IdentityChange`) and anyone relays it; here the connected wallet does both. It takes effect when someone calls `executeIdentityChange` at least 2 days later. | [`Accounts.stageChange`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/identity/Accounts.sol); message `IdentityChange` (`identityChangeTypedData`) at the account's `changeNonce`. |
323
+ | [`executeIdentityChange`](../src/actions/accounts.ts) | Applies an account's due change. Anyone may, from `readPendingChange(...).executableAt`. | [`Accounts.executeChange`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/identity/Accounts.sol). |
324
+ | [`cancelIdentityChange`](../src/actions/accounts.ts) | A wallet of the account cancels the account's own pending change, or contests a pending replacement of its root by the network. | [`Accounts.cancelChange`](https://github.com/6529-Collections/6529-stream/blob/c6d4965861907841519cf3878c9db7052424a9a0/src/identity/Accounts.sol). |
325
+
326
+ ## Actions: shared
327
+
328
+ How every action checks, sends and signs.
329
+
330
+ | Function | What it does | Contract |
331
+ | --- | --- | --- |
332
+ | [`accountOf`](../src/actions/shared.ts) | The address of the wallet client's account. | none: a local helper |
333
+ | [`assertReady`](../src/actions/shared.ts) | Checks both clients are on the instance's chain. The wallet is asked every time, never from memory: a browser wallet can switch network between two steps. | none: a local helper |
334
+ | [`send`](../src/actions/shared.ts) | Simulates a contract call as the wallet's account, sends it, waits for it to be mined and checks that it succeeded. A call that would revert is never sent: the simulation throws first, with the contract's own error. | none: a local helper |
335
+ | [`sign`](../src/actions/shared.ts) | Asks the wallet to sign an EIP-712 message as its account. | none: a local helper |