-
Notifications
You must be signed in to change notification settings - Fork 1
add Appdata, linkedAppdata, displayOptions #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary by CodeRabbit
Summary by CodeRabbit
WalkthroughThe changes introduce support for a new Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant DAS_Module
participant RPC_Layer
Client->>DAS_Module: getAssetsByOwner({ owner, displayOptions })
DAS_Module->>DAS_Module: validateDisplayOptions(displayOptions)
alt Valid displayOptions
DAS_Module->>RPC_Layer: searchAssets({ owner, displayOptions })
RPC_Layer-->>DAS_Module: assetsWithCollectionMetadata
DAS_Module-->>Client: assetsWithCollectionMetadata
else Invalid displayOptions
DAS_Module-->>Client: Error (unsupported display options)
end
sequenceDiagram
participant Client
participant DAS_Module
participant RPC_Layer
Client->>DAS_Module: getAsset(asset, options, displayOptions)
DAS_Module->>DAS_Module: validateDisplayOptions(displayOptions)
alt Valid displayOptions
DAS_Module->>RPC_Layer: getAsset(asset, options, displayOptions)
RPC_Layer-->>DAS_Module: assetWithAppDatasAndCollectionMetadata
DAS_Module-->>Client: assetWithAppDatasAndCollectionMetadata
else Invalid displayOptions
DAS_Module-->>Client: Error (unsupported display options)
end
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
src/helpers.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "airbnb-base" to extend from. Please check that the name of the config is correct. The config "airbnb-base" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learnings
src/helpers.ts (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
package.json
(1 hunks)src/das.ts
(7 hunks)src/helpers.ts
(2 hunks)src/types.ts
(1 hunks)test/das.test.ts
(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/das.ts (2)
src/constants.ts (1)
MPL_CORE_ASSET
(1-1)src/types.ts (4)
Pagination
(7-10)AssetOptions
(12-14)AssetResult
(29-29)CollectionResult
(30-30)
🪛 Biome (1.9.4)
test/das.test.ts
[error] 313-313: Forbidden non-null assertion.
Unsafe fix: Replace with optional chain operator ?. This operator includes runtime checks, so it is safer than the compile-only non-null assertion operator
(lint/style/noNonNullAssertion)
[error] 314-314: Forbidden non-null assertion.
Unsafe fix: Replace with optional chain operator ?. This operator includes runtime checks, so it is safer than the compile-only non-null assertion operator
(lint/style/noNonNullAssertion)
src/das.ts
[error] 30-31: Template literals are preferred over string concatenation.
Unsafe fix: Use a template literal.
(lint/style/useTemplate)
🔇 Additional comments (2)
src/helpers.ts (1)
302-363
:DataSection
/LinkedAppData
conversion – correctness & maintainability
dataAuthority
is assigned either an object orauthority.type
, causing a union of incompatible shapes.
Always return a proper object to keep the adapter type sound.
offset
for theLinkedAppData
branch silently falls back toexternalPlugin.data_offset ?? offset
.
Ifdata_offset
is0
, the??
operator skips it – use??
only fornull
/undefined
checks or switch to ternary.- offset: externalPlugin.data_offset ? BigInt(externalPlugin.data_offset) : BigInt(offset), + offset: externalPlugin.data_offset !== undefined + ? BigInt(externalPlugin.data_offset) + : BigInt(offset),package.json (1)
28-37
: Dependency bumps – double-check breaking changesUpgrading to
@metaplex-foundation/digital-asset-standard-api@2.x
and@metaplex-foundation/mpl-core@1.4.x
introduces several breaking changes (e.g. renamed RPC args).
Ensure the library is built & the full test suite (including downstream consumers) still passes after the bump.
@danenbm please rereview. |
This adds
Open questions: