fix: harden 0.4.0 migration for latest Sui/Seal and CI#61
Closed
arbuthnot-eth wants to merge 5 commits intoMystenLabs:mainfrom
Closed
fix: harden 0.4.0 migration for latest Sui/Seal and CI#61arbuthnot-eth wants to merge 5 commits intoMystenLabs:mainfrom
arbuthnot-eth wants to merge 5 commits intoMystenLabs:mainfrom
Conversation
Integrate @mysten/suins to enable human-readable name resolution in the messaging SDK. Users can now use SuiNS names (e.g., "alice.sui") instead of raw addresses when creating channels or adding members. - Add @mysten/suins dependency - Create AddressResolver interface and SuiNSResolver implementation - Add optional addressResolver to client options - Resolve names in createChannelFlow() and addMembers() - Export SuiNSResolver, isSuiNSName, and AddressResolver type
Add comprehensive unit tests for the address resolution utilities: - isSuiNSName() detection function - SuiNSResolver.resolve() single name resolution - SuiNSResolver.resolveMany() batch resolution - Mixed arrays (names + addresses) - Error handling for unresolvable names - Custom AddressResolver implementation example 21 tests covering all edge cases.
Add human-readable channel name support to the messaging SDK. Users can
now reference channels by name (e.g., "#general") instead of raw object IDs.
## New Features
- `ChannelNameResolver` interface for pluggable name resolution
- `LocalChannelRegistry` for in-memory channel name mapping
- `PersistentChannelRegistry` for browser localStorage persistence
- Helper functions: `isChannelName()`, `normalizeChannelName()`, `formatChannelName()`
## SDK Integration
- Added optional `channelResolver` to client options
- Updated methods to accept channel names:
- `getChannelMembers()`
- `getChannelMessages()`
- `getLatestMessages()`
- `executeSendMessageTransaction()`
- `executeAddMembersTransaction()`
- `addMembers()`
## Usage
```typescript
import { messaging, LocalChannelRegistry } from '@mysten/messaging';
const channelRegistry = new LocalChannelRegistry();
await channelRegistry.register('general', '0xchannel123...');
const client = suiClient.$extend(messaging({
channelResolver: channelRegistry,
// ... other options
}));
// Use channel names directly
const members = await client.messaging.getChannelMembers('#general');
```
## Tests
- 40 unit tests for channel resolution utilities
- All 61 unit tests passing
e0ba226 to
c09debf
Compare
Author
|
Closing to reopen from a fresh branch with explicit clean 2-commit history. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR hardens the
0.4.0migration for latest Sui/Seal by addressing runtime and API-compatibility gaps discovered during validation.Fixes #60
Changes
@mysten/sui@2.4.0):.github/workflows/ci.yml.github/workflows/npm-publish.ymlTEST_ENVIRONMENT=localnet pnpm run test:integrationscripts/utils.tsClientWithCoreApiandclient.core.signAndExecuteTransaction(...)client.core.waitForTransaction(...)packages/messaging/package.json->"node": ">=22"Why
@mysten/suiclient APIs.Validation
pnpm -C packages/messaging buildpnpm -C packages/messaging lintpnpm -C packages/messaging test:unitpnpm -C scripts exec tsc -p tsconfig.json --noEmitNote: integration tests require a Docker-capable runtime (testcontainers).