From 9f61f787ce6cff0c3b8a663cfadd2e9ab476186f Mon Sep 17 00:00:00 2001 From: marc Date: Sat, 29 Mar 2025 03:25:29 +0000 Subject: [PATCH] Added file coded with Claude --- LightningReferral | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 LightningReferral diff --git a/LightningReferral b/LightningReferral new file mode 100644 index 0000000..33c9535 --- /dev/null +++ b/LightningReferral @@ -0,0 +1,24 @@ +Here's a simple JavaScript code snippet that creates a referral link that asks for a Bitcoin Lightning address: + +```javascript +function createReferralLink() { + // Get the user's Bitcoin Lightning address + const lightningAddress = prompt("Please enter your Bitcoin Lightning address:"); + + // Construct the referral link + const referralLink = `https://example.com/referral?lightning_address=${encodeURIComponent(lightningAddress)}`; + + // Return the referral link + return referralLink; +} + +// Example usage +const myReferralLink = createReferralLink(); +console.log("Your referral link:", myReferralLink); +``` + +In this code, the `createReferralLink()` function prompts the user to enter their Bitcoin Lightning address, and then constructs a referral link that includes the entered address as a query parameter. The `encodeURIComponent()` function is used to properly encode the Lightning address in the URL6. + +The resulting referral link can then be used to share with others, and when they click on it, the Lightning address will be passed along as a parameter. + +Please note that this is a basic example, and you may want to add additional functionality or error handling as needed for your specific use case. \ No newline at end of file