Skip to content

Add SDK getNftMetadata and getNftOwner methods #423

Description

@Levi-Ojukwu

Description:

The contract has NFT query functions (query_nft_metadata and query_nft_owner at nft.rs:247-254) but the SDK does not expose them. These functions are essential for NFT marketplace features.

query_nft_metadata(env, invoice_id) returns Option<InvoiceNftMetadata> containing:

  • invoice_id: u64
  • amount: i128
  • due_date: u32
  • discount_rate: u32
  • token: Address
  • owner: Address
  • minted_at: u32

query_nft_owner(env, invoice_id) returns Option<Address>.

Why it matters: NFT features require querying metadata and ownership.

Acceptance Criteria:

  • Create getNftMetadata(invoiceId) returning InvoiceNftMetadata | null
  • Create getNftOwner(invoiceId) returning string | null
  • Add TypeScript types for NFT metadata
  • Add tests

Relevant Files: contracts/invoice_liquidity/src/nft.rs:247-254, sdk/src/index.ts


Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions