Skip to main content
fn reject_migration(env: Env, subscriber: Address, sub_id: u64)
Rejects a pending migration for a subscription. The migration_target field is cleared and the subscriber continues on their current plan with no changes.

Parameters

NameTypeDescription
subscriberAddressThe subscriber’s Stellar address. Must sign the transaction.
sub_idu64The subscription ID with a pending migration.

Authorization

subscriber.require_auth();
Only the subscriber on the subscription can reject the migration.

Return value

None (void).

Events emitted

EventTopicsData
mig_rejectsubscriber, sub_idRejection details

Error cases

CodeNameDescription
9UnauthorizedCaller is not the subscriber on this subscription.
12NoMigrationPendingNo migration has been requested for this subscription.

Examples

import { VowenaClient, NETWORKS } from "vowena";

const client = new VowenaClient({
  contractId: NETWORKS.testnet.contractId,
  rpcUrl: NETWORKS.testnet.rpcUrl,
  networkPassphrase: NETWORKS.testnet.networkPassphrase,
});

// Reject the pending migration - stay on current plan
const tx = await client.buildRejectMigration(
  "GSUBSCRIBER...ADDR",   // Subscriber's address
  subscriptionId            // Subscription ID
);

const signedXdr = await signTransaction(tx);
await client.submitTransaction(signedXdr);
Rejecting a migration has no side effects. The subscription continues as normal on the current plan, billing proceeds unchanged, and the subscriber can still cancel at any time.