iotaledger / iotaledger/ts-packages

Kiosk SDK: resolve transfer policy by object type instead of TransferPolicyCreated event

Open
#245 0 comments 0 reactions 0 assignees View on GitHub
bug ts-sdk
Dominant language
TypeScript
Stars
3
Forks
3
Avg merge
1d 2h
Merged PRs (30d)
12

Description

Part of #246

## Context
`queryTransferPolicy` in `sdk/kiosk/src/query/transfer-policy.ts` discovers TransferPolicy objects via `queryEvents({ MoveEventType: TransferPolicyCreated })`. After the v1.27 retention cut, policies created more than 30 days ago are no longer discoverable through events, so kiosk item transfers that depend on resolving the policy can fail.

This is consumed through `@iota/kiosk` `KioskClient` by the wallet extension and iota-names (and available to the dashboard), so it is the one true functional regression from pruning.

Per the Indexer doc, the fix is to resolve the TransferPolicy object by type instead of via the event: https://iotafoundation.atlassian.net/wiki/spaces/LSC/pages/3073572866

## Tasks
- [ ] Rewrite `queryTransferPolicy` to resolve the `TransferPolicy` object by type (GraphQL / object-by-type lookup) rather than the `TransferPolicyCreated` event. Keep the existing return shape (id, type, owner, rules, balance).
- [ ] Confirm `KioskClient.getTransferPolicies` and any other `queryTransferPolicy` callers still behave correctly.
- [ ] Bump `@iota/kiosk`, update consumers (wallet, names) to the new version.
- [ ] E2E verify the kiosk NFT transfer flow in the wallet against a pruned environment, using a policy created before the retention window.

## Verification
- [ ] Transfer of a kiosk item whose TransferPolicy was created >30 days ago succeeds.
- [ ] Changesets for `@iota/kiosk` and consuming apps.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in sdk/kiosk/src/query/transfer-policy.ts at queryTransferPolicy and read the Indexer object-by-type guidance. Check KioskClient.getTransferPolicies and its wallet and iota-names consumers, preserving the existing return shape. Done means policies older than 30 days resolve successfully, the kiosk transfer E2E flow passes in a pruned environment, and the required package and consumer changesets are included.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.