@unicitylabs/sphere-sdk 0.8.0-dev.2 → 0.8.0-dev.3

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.
package/dist/index.js CHANGED
@@ -9657,7 +9657,8 @@ var PaymentsModule = class _PaymentsModule {
9657
9657
  try {
9658
9658
  const peerInfo = await this.deps.transport.resolve?.(request.recipient) ?? null;
9659
9659
  const recipientPubkey = this.resolveTransportPubkey(request.recipient, peerInfo);
9660
- const recipientAddress = await this.resolveRecipientAddress(request.recipient, request.addressMode, peerInfo);
9660
+ const willUseEngine = !!(this.deps?.tokenEngine && peerInfo?.chainPubkey);
9661
+ const recipientAddress = willUseEngine ? null : await this.resolveRecipientAddress(request.recipient, request.addressMode, peerInfo);
9661
9662
  const signingService = await this.createSigningService();
9662
9663
  const stClient = this.deps.oracle.getStateTransitionClient?.();
9663
9664
  if (!stClient) {
@@ -9781,6 +9782,7 @@ var PaymentsModule = class _PaymentsModule {
9781
9782
  splitPlan.remainderAmount,
9782
9783
  splitPlan.coinId,
9783
9784
  recipientAddress,
9785
+ // v1 path only — non-null (would have thrown in resolve otherwise)
9784
9786
  onChainMessage
9785
9787
  );
9786
9788
  committedOnChainTokenIds.add(splitPlan.tokenToSplit.uiToken.id);
@@ -9861,6 +9863,7 @@ var PaymentsModule = class _PaymentsModule {
9861
9863
  splitPlan.remainderAmount,
9862
9864
  splitPlan.coinId,
9863
9865
  recipientAddress,
9866
+ // v1 path only — non-null (would have thrown in resolve otherwise)
9864
9867
  {
9865
9868
  memo: request.memo,
9866
9869
  message: onChainMessage,
@@ -12857,7 +12860,7 @@ var PaymentsModule = class _PaymentsModule {
12857
12860
  const nametag = recipient.startsWith("@") ? recipient.slice(1) : info.nametag || recipient;
12858
12861
  if (!info.directAddress) {
12859
12862
  throw new SphereError(
12860
- `"${nametag}" has no DirectAddress \u2014 the recipient must publish a key-based identity binding.`,
12863
+ `"${nametag}" has no published identity \u2014 the recipient must register a Unicity ID (publish a key-based identity binding) before they can receive payments.`,
12861
12864
  "INVALID_RECIPIENT"
12862
12865
  );
12863
12866
  }