From dee75e5edd56e45edd478b48abe3645c371bb5ea Mon Sep 17 00:00:00 2001 From: Emmanuel Jacquier Date: Mon, 10 Aug 2026 12:30:27 -0400 Subject: [PATCH 01/10] Functions cancel guide --- src/config/sidebar.ts | 4 ++ .../guides/cancel-subscription.mdx | 61 +++++++++++++++++++ src/content/chainlink-functions/llms-full.txt | 53 ++++++++++++++++ .../resources/subscriptions.mdx | 2 + src/content/cre/llms-full-go.txt | 2 +- src/content/cre/llms-full-ts.txt | 10 ++- .../cre/reference/clf-migration-go.mdx | 2 +- .../cre/reference/clf-migration-ts.mdx | 10 ++- 8 files changed, 136 insertions(+), 8 deletions(-) create mode 100644 src/content/chainlink-functions/guides/cancel-subscription.mdx diff --git a/src/config/sidebar.ts b/src/config/sidebar.ts index b09e8c30c46..7d08ad6d464 100644 --- a/src/config/sidebar.ts +++ b/src/config/sidebar.ts @@ -1763,6 +1763,10 @@ export const SIDEBAR: Partial> = { { section: "Guides", contents: [ + { + title: "Cancel a Subscription and Withdraw Funds", + url: "chainlink-functions/guides/cancel-subscription", + }, { title: "Simple Computation", url: "chainlink-functions/tutorials/simple-computation", diff --git a/src/content/chainlink-functions/guides/cancel-subscription.mdx b/src/content/chainlink-functions/guides/cancel-subscription.mdx new file mode 100644 index 00000000000..99cb468572b --- /dev/null +++ b/src/content/chainlink-functions/guides/cancel-subscription.mdx @@ -0,0 +1,61 @@ +--- +section: chainlinkFunctions +date: Last Modified +title: "Cancel a Subscription and Withdraw Funds" +isMdx: true +whatsnext: + { + "Managing CL Functions Subscriptions": "/chainlink-functions/resources/subscriptions", + "Chainlink Functions Billing": "/chainlink-functions/resources/billing", + "Migrate from Chainlink Functions to Chainlink CRE": "/cre/reference/clf-migration", + } +--- + +import { Aside } from "@components" +import ChainlinkFunctions from "@features/chainlink-functions/common/ChainlinkFunctions.astro" + + + +Cancelling a Chainlink Functions subscription and withdrawing its remaining LINK balance is a single onchain transaction: calling `cancelSubscription` deletes the subscription, removes all associated consumers, and transfers the remaining balance in one call. Only the subscription owner can perform this action. + +## Prerequisites + +- **Your Subscription ID.** If you don't know it, see [Find your Subscription ID](#find-your-subscription-id) below. +- **The FunctionsRouter address** for the network your subscription is on. Find it in the [Supported Networks](/chainlink-functions/supported-networks) reference. +- **No in-flight requests.** A subscription cannot be canceled while it has pending requests. Any request that has been pending for longer than five minutes must first be [timed out](/chainlink-functions/resources/subscriptions#time-out-pending-requests-manually). +- **A wallet you can sign transactions with** using the subscription owner address. The examples below use [Foundry's `cast`](https://getfoundry.sh/cast/overview) with a raw private key, but you can substitute a keystore or Ledger. See [Sending Transactions](https://www.getfoundry.sh/cast/sending-transactions) in the Foundry docs for the equivalent `--account` or `--ledger` flags. + +## Find your Subscription ID + +If you already know your Subscription ID, skip to [Cancel the subscription and withdraw funds](#cancel-the-subscription-and-withdraw-funds). + +- **Using the Subscription Manager:** Go to the [Chainlink Functions Subscription Manager](https://functions.chain.link/), connect the owner wallet, and open the subscription under **My Subscriptions**. The Subscription ID is shown on the subscription's detail page. +- **Using the lookup spreadsheet:** If you no longer have access to the owner wallet's session or the subscription isn't showing in the app, look up your Subscription ID by owner address in the [Chainlink Functions Subscription ID Registry](https://docs.google.com/spreadsheets/d/1X33O8ra6lwhhFKV7o3Ut-dOq8pXVAyb6gcHlXOtYmUA/edit?gid=1541416076#gid=1541416076). + +## Cancel the subscription and withdraw funds + +Call `cancelSubscription` on the FunctionsRouter contract, passing your Subscription ID and the address that should receive the remaining LINK balance: + +```shell +cast send FUNCTIONS_ROUTER_ADDRESS \ +"cancelSubscription(uint64,address)" \ +SUBSCRIPTION_ID \ +TO_ADDRESS \ +--rpc-url $CHAIN_RPC_URL \ +--private-key $PRIVATE_KEY +``` + +Where: + +- `FUNCTIONS_ROUTER_ADDRESS` is the address of the FunctionsRouter contract for your network. +- `SUBSCRIPTION_ID` is your numerical Subscription ID. +- `TO_ADDRESS` is the wallet address that should receive the withdrawn LINK. +- `CHAIN_RPC_URL` is the HTTP RPC URL for your network. + + + +Once this transaction confirms, the Subscription ID is deleted, all consumers are removed, and the remaining LINK balance is transferred to `TO_ADDRESS`. diff --git a/src/content/chainlink-functions/llms-full.txt b/src/content/chainlink-functions/llms-full.txt index c3c94e88939..070408e7823 100644 --- a/src/content/chainlink-functions/llms-full.txt +++ b/src/content/chainlink-functions/llms-full.txt @@ -879,6 +879,57 @@ Now that you understand the structure of the API. Let's delve into the JavaScrip --- +# Cancel a Subscription and Withdraw Funds +Source: https://docs.chain.link/chainlink-functions/guides/cancel-subscription + + + +Cancelling a Chainlink Functions subscription and withdrawing its remaining LINK balance is a single onchain transaction: calling `cancelSubscription` deletes the subscription, removes all associated consumers, and transfers the remaining balance in one call. Only the subscription owner can perform this action. + +## Prerequisites + +- **Your Subscription ID.** If you don't know it, see [Find your Subscription ID](#find-your-subscription-id) below. +- **The FunctionsRouter address** for the network your subscription is on. Find it in the [Supported Networks](/chainlink-functions/supported-networks) reference. +- **No in-flight requests.** A subscription cannot be canceled while it has pending requests. Any request that has been pending for longer than five minutes must first be [timed out](/chainlink-functions/resources/subscriptions#time-out-pending-requests-manually). +- **A wallet you can sign transactions with** using the subscription owner address. The examples below use [Foundry's `cast`](https://getfoundry.sh/cast/overview) with a raw private key, but you can substitute a keystore or Ledger. See [Sending Transactions](https://www.getfoundry.sh/cast/sending-transactions) in the Foundry docs for the equivalent `--account` or `--ledger` flags. + +## Find your Subscription ID + +If you already know your Subscription ID, skip to [Cancel the subscription and withdraw funds](#cancel-the-subscription-and-withdraw-funds). + +- **Using the Subscription Manager:** Go to the [Chainlink Functions Subscription Manager](https://functions.chain.link/), connect the owner wallet, and open the subscription under **My Subscriptions**. The Subscription ID is shown on the subscription's detail page. +- **Using the lookup spreadsheet:** If you no longer have access to the owner wallet's session or the subscription isn't showing in the app, look up your Subscription ID by owner address in the [Chainlink Functions Subscription ID Registry](https://docs.google.com/spreadsheets/d/1X33O8ra6lwhhFKV7o3Ut-dOq8pXVAyb6gcHlXOtYmUA/edit?gid=1541416076#gid=1541416076). + +## Cancel the subscription and withdraw funds + +Call `cancelSubscription` on the FunctionsRouter contract, passing your Subscription ID and the address that should receive the remaining LINK balance: + +```shell +cast send FUNCTIONS_ROUTER_ADDRESS \ +"cancelSubscription(uint64,address)" \ +SUBSCRIPTION_ID \ +TO_ADDRESS \ +--rpc-url $CHAIN_RPC_URL \ +--private-key $PRIVATE_KEY +``` + +Where: + +- `FUNCTIONS_ROUTER_ADDRESS` is the address of the FunctionsRouter contract for your network. +- `SUBSCRIPTION_ID` is your numerical Subscription ID. +- `TO_ADDRESS` is the wallet address that should receive the withdrawn LINK. +- `CHAIN_RPC_URL` is the HTTP RPC URL for your network. + + + +Once this transaction confirms, the Subscription ID is deleted, all consumers are removed, and the remaining LINK balance is transferred to `TO_ADDRESS`. + +--- + # Chainlink Functions Source: https://docs.chain.link/chainlink-functions @@ -1473,6 +1524,8 @@ You use a Chainlink Functions subscription to pay for, manage, and track Functio 4. After you confirm the transaction, a confirmation screen appears: +For step-by-step instructions, including how to cancel and withdraw directly on the FunctionsRouter contract if you don't have access to the Subscription Manager, see [Cancel a Subscription and Withdraw Funds](/chainlink-functions/guides/cancel-subscription). + ## Time out pending requests manually The Subscription Manager provides the option to time out requests manually. You can time out requests that have been pending for longer than five minutes to unlock your subscription funds. diff --git a/src/content/chainlink-functions/resources/subscriptions.mdx b/src/content/chainlink-functions/resources/subscriptions.mdx index c6cdadb4a8f..a39fb369ec7 100644 --- a/src/content/chainlink-functions/resources/subscriptions.mdx +++ b/src/content/chainlink-functions/resources/subscriptions.mdx @@ -205,6 +205,8 @@ You use a Chainlink Functions subscription to pay for, manage, and track Functio alt="Chainlink Functions subscription canceled" /> +For step-by-step instructions, including how to cancel and withdraw directly on the FunctionsRouter contract if you don't have access to the Subscription Manager, see [Cancel a Subscription and Withdraw Funds](/chainlink-functions/guides/cancel-subscription). + ## Time out pending requests manually The Subscription Manager provides the option to time out requests manually. You can time out requests that have been pending for longer than five minutes to unlock your subscription funds. diff --git a/src/content/cre/llms-full-go.txt b/src/content/cre/llms-full-go.txt index 1100a05c75c..f15c05d72de 100644 --- a/src/content/cre/llms-full-go.txt +++ b/src/content/cre/llms-full-go.txt @@ -19707,7 +19707,7 @@ When mapping your existing CLF script: - Deploy a `ReceiverTemplate`-based consumer contract to receive reports. - Test your logic locally with `cre workflow simulate` before deploying with `cre workflow deploy`. -Migrate your workflows one at a time and decommission your CLF subscriptions only after confirming the CRE workflows are successfully producing reports on-chain. +Migrate your workflows one at a time and decommission your CLF subscriptions only after confirming the CRE workflows are successfully producing reports on-chain. See [Cancel a Subscription and Withdraw Funds](/chainlink-functions/guides/cancel-subscription) for instructions on cancelling a subscription and withdrawing its remaining LINK balance. For end-to-end runnable examples covering different use cases, see the [`smartcontractkit/cre-templates`](https://github.com/smartcontractkit/cre-templates) repo. diff --git a/src/content/cre/llms-full-ts.txt b/src/content/cre/llms-full-ts.txt index a3056a24fb1..64db0cdefb3 100644 --- a/src/content/cre/llms-full-ts.txt +++ b/src/content/cre/llms-full-ts.txt @@ -19651,8 +19651,12 @@ Directly replaces the on-chain entry path of `_sendRequest()`. Instead of your c ```ts const evmClient = new cre.evm.EVMClient(CHAIN_SELECTOR) const trigger = evmClient.logTrigger({ - addresses: [/* base64-encoded contract address */], - topics: [/* base64-encoded event signature hash */], + addresses: [ + /* base64-encoded contract address */ + ], + topics: [ + /* base64-encoded event signature hash */ + ], }) ``` @@ -19830,7 +19834,7 @@ When mapping your existing CLF script: - Deploy a `ReceiverTemplate`-based consumer contract to receive reports. - Test your logic locally with `cre workflow simulate` before deploying with `cre workflow deploy`. -Migrate your workflows one at a time and decommission your CLF subscriptions only after confirming the CRE workflows are successfully producing reports on-chain. +Migrate your workflows one at a time and decommission your CLF subscriptions only after confirming the CRE workflows are successfully producing reports on-chain. See [Cancel a Subscription and Withdraw Funds](/chainlink-functions/guides/cancel-subscription) for instructions on cancelling a subscription and withdrawing its remaining LINK balance. For end-to-end runnable examples covering different use cases, see the [`smartcontractkit/cre-templates`](https://github.com/smartcontractkit/cre-templates) repo. diff --git a/src/content/cre/reference/clf-migration-go.mdx b/src/content/cre/reference/clf-migration-go.mdx index e9b97dd1655..65877b254e8 100644 --- a/src/content/cre/reference/clf-migration-go.mdx +++ b/src/content/cre/reference/clf-migration-go.mdx @@ -307,7 +307,7 @@ When mapping your existing CLF script: - Deploy a `ReceiverTemplate`-based consumer contract to receive reports. - Test your logic locally with `cre workflow simulate` before deploying with `cre workflow deploy`. -Migrate your workflows one at a time and decommission your CLF subscriptions only after confirming the CRE workflows are successfully producing reports on-chain. +Migrate your workflows one at a time and decommission your CLF subscriptions only after confirming the CRE workflows are successfully producing reports on-chain. See [Cancel a Subscription and Withdraw Funds](/chainlink-functions/guides/cancel-subscription) for instructions on cancelling a subscription and withdrawing its remaining LINK balance. For end-to-end runnable examples covering different use cases, see the [`smartcontractkit/cre-templates`](https://github.com/smartcontractkit/cre-templates) repo. diff --git a/src/content/cre/reference/clf-migration-ts.mdx b/src/content/cre/reference/clf-migration-ts.mdx index 121c25a01b6..543c35fcbbd 100644 --- a/src/content/cre/reference/clf-migration-ts.mdx +++ b/src/content/cre/reference/clf-migration-ts.mdx @@ -94,8 +94,12 @@ Directly replaces the on-chain entry path of `_sendRequest()`. Instead of your c ```ts const evmClient = new cre.evm.EVMClient(CHAIN_SELECTOR) const trigger = evmClient.logTrigger({ - addresses: [/* base64-encoded contract address */], - topics: [/* base64-encoded event signature hash */], + addresses: [ + /* base64-encoded contract address */ + ], + topics: [ + /* base64-encoded event signature hash */ + ], }) ``` @@ -273,7 +277,7 @@ When mapping your existing CLF script: - Deploy a `ReceiverTemplate`-based consumer contract to receive reports. - Test your logic locally with `cre workflow simulate` before deploying with `cre workflow deploy`. -Migrate your workflows one at a time and decommission your CLF subscriptions only after confirming the CRE workflows are successfully producing reports on-chain. +Migrate your workflows one at a time and decommission your CLF subscriptions only after confirming the CRE workflows are successfully producing reports on-chain. See [Cancel a Subscription and Withdraw Funds](/chainlink-functions/guides/cancel-subscription) for instructions on cancelling a subscription and withdrawing its remaining LINK balance. For end-to-end runnable examples covering different use cases, see the [`smartcontractkit/cre-templates`](https://github.com/smartcontractkit/cre-templates) repo. From 24e0c127a220353eaced5055194da0b131b9df51 Mon Sep 17 00:00:00 2001 From: Emmanuel Jacquier Date: Mon, 10 Aug 2026 13:46:23 -0400 Subject: [PATCH 02/10] lint fix --- src/pages/[...path].md.ts | 4 +++- src/scripts/chains-metadata.ts | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/[...path].md.ts b/src/pages/[...path].md.ts index 1b4d916d93d..93be892199a 100644 --- a/src/pages/[...path].md.ts +++ b/src/pages/[...path].md.ts @@ -80,7 +80,9 @@ async function resolveSpecialCanonicalMarkdownPath(cleanPath: string): Promise { if (!cleanPath.startsWith("cre/")) { diff --git a/src/scripts/chains-metadata.ts b/src/scripts/chains-metadata.ts index bb53b20793c..ac015aa5202 100644 --- a/src/scripts/chains-metadata.ts +++ b/src/scripts/chains-metadata.ts @@ -87,7 +87,8 @@ function normalizeChainName(name: string): string { } type ChainMatchResult = - { matched: true; reason: "name" | "nativeCurrency" } | { matched: false; existingName: string | undefined } + | { matched: true; reason: "name" | "nativeCurrency" } + | { matched: false; existingName: string | undefined } /** * When chainid.network flags a chain as reusedChainId, determines whether the incoming From 7f10720fd070020d6c297d311c4baa23b809e4e5 Mon Sep 17 00:00:00 2001 From: Emmanuel Jacquier Date: Tue, 11 Aug 2026 14:27:25 -0400 Subject: [PATCH 03/10] removed brownout shcedule for CLF and CLA --- src/content/cre/llms-full-go.txt | 18 ++++-------------- src/content/cre/llms-full-ts.txt | 18 ++++-------------- src/content/cre/reference/cla-migration-go.mdx | 15 ++++++--------- src/content/cre/reference/cla-migration-ts.mdx | 15 ++++++--------- src/content/cre/reference/clf-migration-go.mdx | 10 ++-------- src/content/cre/reference/clf-migration-ts.mdx | 10 ++-------- 6 files changed, 24 insertions(+), 62 deletions(-) diff --git a/src/content/cre/llms-full-go.txt b/src/content/cre/llms-full-go.txt index f15c05d72de..ae2a2e7931f 100644 --- a/src/content/cre/llms-full-go.txt +++ b/src/content/cre/llms-full-go.txt @@ -19109,13 +19109,8 @@ Source: https://docs.chain.link/cre/reference/cla-migration-go Last Updated: 2026-05-25