From 946b87722946ab743f6f4ebfc7576c36b4728d68 Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Tue, 16 Apr 2024 12:16:38 -0400 Subject: [PATCH] updated docs --- docs/404.html | 2 +- docs/README.html | 2 +- ....da38487d.js => example_payment-events.md.e375e10e.js} | 2 +- ...lean.js => example_payment-events.md.e375e10e.lean.js} | 0 ...52a.js => example_payment-verification.md.fe6c0a0f.js} | 2 +- ...s => example_payment-verification.md.fe6c0a0f.lean.js} | 0 ...d.43b8abc7.js => example_react-example.md.e5273e61.js} | 2 +- ....lean.js => example_react-example.md.e5273e61.lean.js} | 0 ....md.d94cfa9b.js => example_vue-example.md.6e37dbcd.js} | 4 ++-- ...9b.lean.js => example_vue-example.md.6e37dbcd.lean.js} | 2 +- ...7a4e03.js => guide_installation-client.md.f6037b38.js} | 4 ++-- ...n.js => guide_installation-client.md.f6037b38.lean.js} | 2 +- ...e93a61.js => guide_installation-server.md.a0ac1cff.js} | 6 +++--- ...n.js => guide_installation-server.md.a0ac1cff.lean.js} | 2 +- ...n.md.f95012e9.js => guide_introduction.md.f2a6a882.js} | 2 +- ...2e9.lean.js => guide_introduction.md.f2a6a882.lean.js} | 0 ...rt.md.0a0cfd19.js => guide_quick-start.md.f7b2ed7e.js} | 2 +- ...fd19.lean.js => guide_quick-start.md.f7b2ed7e.lean.js} | 0 ...5924d3b.js => intents_payment-requests.md.3643330b.js} | 2 +- ...an.js => intents_payment-requests.md.3643330b.lean.js} | 0 docs/example/introduction.html | 2 +- docs/example/payment-events.html | 6 +++--- docs/example/payment-verification.html | 6 +++--- docs/example/react-example.html | 6 +++--- docs/example/request-payment.html | 2 +- docs/example/vue-example.html | 6 +++--- docs/guide/contribution-guide.html | 2 +- docs/guide/installation-client.html | 6 +++--- docs/guide/installation-server.html | 8 ++++---- docs/guide/installation.html | 2 +- docs/guide/introduction.html | 6 +++--- docs/guide/quick-start.html | 6 +++--- docs/hashmap.json | 2 +- docs/index.html | 2 +- docs/intents/custom-backends.html | 2 +- docs/intents/introduction.html | 2 +- docs/intents/payment-requests.html | 6 +++--- docs/markdown-examples.html | 2 +- docs/reference/app.html | 2 +- docs/reference/browser-events.html | 2 +- docs/reference/element-appearance.html | 2 +- docs/reference/idempotency.html | 2 +- docs/reference/rendezvous.html | 2 +- docs/reference/sequencer.html | 2 +- docs/reference/splitter.html | 2 +- docs/reference/timelock.html | 2 +- docs/reference/webhook.html | 2 +- docs/release-notes.html | 2 +- 48 files changed, 65 insertions(+), 65 deletions(-) rename docs/assets/{example_payment-events.md.da38487d.js => example_payment-events.md.e375e10e.js} (99%) rename docs/assets/{example_payment-events.md.da38487d.lean.js => example_payment-events.md.e375e10e.lean.js} (100%) rename docs/assets/{example_payment-verification.md.d219252a.js => example_payment-verification.md.fe6c0a0f.js} (99%) rename docs/assets/{example_payment-verification.md.d219252a.lean.js => example_payment-verification.md.fe6c0a0f.lean.js} (100%) rename docs/assets/{example_react-example.md.43b8abc7.js => example_react-example.md.e5273e61.js} (96%) rename docs/assets/{example_react-example.md.43b8abc7.lean.js => example_react-example.md.e5273e61.lean.js} (100%) rename docs/assets/{example_vue-example.md.d94cfa9b.js => example_vue-example.md.6e37dbcd.js} (96%) rename docs/assets/{example_vue-example.md.d94cfa9b.lean.js => example_vue-example.md.6e37dbcd.lean.js} (62%) rename docs/assets/{guide_installation-client.md.a77a4e03.js => guide_installation-client.md.f6037b38.js} (94%) rename docs/assets/{guide_installation-client.md.a77a4e03.lean.js => guide_installation-client.md.f6037b38.lean.js} (71%) rename docs/assets/{guide_installation-server.md.4be93a61.js => guide_installation-server.md.a0ac1cff.js} (89%) rename docs/assets/{guide_installation-server.md.4be93a61.lean.js => guide_installation-server.md.a0ac1cff.lean.js} (55%) rename docs/assets/{guide_introduction.md.f95012e9.js => guide_introduction.md.f2a6a882.js} (70%) rename docs/assets/{guide_introduction.md.f95012e9.lean.js => guide_introduction.md.f2a6a882.lean.js} (100%) rename docs/assets/{guide_quick-start.md.0a0cfd19.js => guide_quick-start.md.f7b2ed7e.js} (97%) rename docs/assets/{guide_quick-start.md.0a0cfd19.lean.js => guide_quick-start.md.f7b2ed7e.lean.js} (100%) rename docs/assets/{intents_payment-requests.md.25924d3b.js => intents_payment-requests.md.3643330b.js} (99%) rename docs/assets/{intents_payment-requests.md.25924d3b.lean.js => intents_payment-requests.md.3643330b.lean.js} (100%) diff --git a/docs/404.html b/docs/404.html index afe8b41..ac85584 100644 --- a/docs/404.html +++ b/docs/404.html @@ -14,7 +14,7 @@
Skip to content

404

PAGE NOT FOUND

But if you don't change your direction, and if you keep looking, you may end up where you are heading.
- + \ No newline at end of file diff --git a/docs/README.html b/docs/README.html index 77de415..f8abbf6 100644 --- a/docs/README.html +++ b/docs/README.html @@ -17,7 +17,7 @@
Skip to content

Code SDK Documentation

Welcome to the docs/ directory of the Code SDK repository! This folder houses the documentation for the Code SDK. If you're a developer looking to contribute or update the documentation, this guide is for you.

We use vitepress to compile markdown to HTML. You don't necessarily need to run anything locally but it is recommended as you'll get a nicer preview.

Getting Started

Prerequisites

  • Node.js (version 14.x or newer)
  • npm (usually bundled with Node.js)

Setup

Assuming you're already in the root directory of the Code SDK repository:

Navigate to the docs/ directory:

bash
cd docs/
cd docs/

Install the required dependencies:

bash
npm install
npm install

Running Documentation Locally

To preview the documentation locally:

bash
npm run dev
npm run dev

This will serve the documentation with live reloading. You can view it at http://localhost:5173/code-sdk/docs/ or the displayed port.

Building for Production

If you need to generate static files for the documentation:

bash
npm run build
npm run build

These files will be found in the dist/ sub-directory, but you typically won't need to touch these files as the core team will handle the deployment of the documentation.

Contributing to the Documentation

  1. Make sure you're in the docs/ directory.
  2. Create or edit the necessary markdown (.md) files.
  3. The changes will reflect automatically if you have the local server running.

Remember to adhere to our documentation standards and style guide. Make sure your contributions are clear, concise, and add value for the users of the Code SDK.

Pull Requests

Once you've made your changes:

  1. Commit them to a new branch.
  2. Push the branch to the Code SDK repository.
  3. Open a pull request for review.

Ensure your PR clearly describes the changes made. It will be reviewed, and once approved, your contributions will be merged.

Thank you for helping improve the documentation for the Code SDK payment platform!

- + \ No newline at end of file diff --git a/docs/assets/example_payment-events.md.da38487d.js b/docs/assets/example_payment-events.md.e375e10e.js similarity index 99% rename from docs/assets/example_payment-events.md.da38487d.js rename to docs/assets/example_payment-events.md.e375e10e.js index 265f516..9eb4989 100644 --- a/docs/assets/example_payment-events.md.da38487d.js +++ b/docs/assets/example_payment-events.md.e375e10e.js @@ -1,4 +1,4 @@ -import{_ as s,o as n,c as a,Q as l}from"./chunks/framework.0c8e00f4.js";const h=JSON.parse('{"title":"Payment Events","description":"","frontmatter":{},"headers":[],"relativePath":"example/payment-events.md","filePath":"example/payment-events.md"}'),p={name:"example/payment-events.md"},o=l(`

Payment Events

You may want to know when a payment has been made, or when a user has canceled a payment. You can do this by listening to events.

You have the ability to listen for payment events on both the client- and server-side. The client-side uses a WebSocket connection to the Code Sequencer for events, while the server-side SDK uses a webhook endpoint.

Below you'll find an example of how to use both.


INFO

The webhook URL will need to be public before you create the intent.

You can use cloudflare tunnels to test this locally.


For example, run cloudflared tunnel --url localhost:3030

  1. Then replace the url below with the url provided by cloudflare tunnels
  2. And finally, start the server with node server.js

Events Example

The full example code can be found on GitHub.

js
import code from 'https://js.getcode.com/v1';
+import{_ as s,o as n,c as a,Q as l}from"./chunks/framework.0c8e00f4.js";const h=JSON.parse('{"title":"Payment Events","description":"","frontmatter":{},"headers":[],"relativePath":"example/payment-events.md","filePath":"example/payment-events.md"}'),p={name:"example/payment-events.md"},o=l(`

Payment Events

You may want to know when a payment has been made, or when a user has canceled a payment. You can do this by listening to events.

You have the ability to listen for payment events on both the client- and server-side. The client-side uses a WebSocket connection to the Code Sequencer for events, while the server-side SDK uses a webhook endpoint.

Below you'll find an example of how to use both.


INFO

The webhook URL will need to be public before you create the intent.

You can use cloudflare tunnels to test this locally.


For example, run cloudflared tunnel --url localhost:3030

  1. Then replace the url below with the url provided by cloudflare tunnels
  2. And finally, start the server with node server.js

Events Example

The full example code can be found on GitHub.

js
import code from 'https://js.getcode.com/v1';
 
 const { button } = code.elements.create('button', {
     // ...
diff --git a/docs/assets/example_payment-events.md.da38487d.lean.js b/docs/assets/example_payment-events.md.e375e10e.lean.js
similarity index 100%
rename from docs/assets/example_payment-events.md.da38487d.lean.js
rename to docs/assets/example_payment-events.md.e375e10e.lean.js
diff --git a/docs/assets/example_payment-verification.md.d219252a.js b/docs/assets/example_payment-verification.md.fe6c0a0f.js
similarity index 99%
rename from docs/assets/example_payment-verification.md.d219252a.js
rename to docs/assets/example_payment-verification.md.fe6c0a0f.js
index feefd5c..46548c3 100644
--- a/docs/assets/example_payment-verification.md.d219252a.js
+++ b/docs/assets/example_payment-verification.md.fe6c0a0f.js
@@ -1,4 +1,4 @@
-import{_ as s,o as n,c as a,Q as l}from"./chunks/framework.0c8e00f4.js";const F=JSON.parse('{"title":"Payment Verification","description":"","frontmatter":{},"headers":[],"relativePath":"example/payment-verification.md","filePath":"example/payment-verification.md"}'),p={name:"example/payment-verification.md"},o=l(`

Payment Verification

We encourage you to verify payments on your server. This ensures that the payment was not tampered with in the browser, and that the payment was actually sent to your wallet. This is especially important if you are selling digital goods or services.

Use the following example to create a payment intent on your server and then show a button for that intent on the browser. You can then forward the user to a success page that includes the intent, which you can verify.

INFO

If you need real-time payment events, see the Payment Events example.

Payment Intent Example

The full example code can be found on GitHub.

js
import * as code from "@code-wallet/client";
+import{_ as s,o as n,c as a,Q as l}from"./chunks/framework.0c8e00f4.js";const F=JSON.parse('{"title":"Payment Verification","description":"","frontmatter":{},"headers":[],"relativePath":"example/payment-verification.md","filePath":"example/payment-verification.md"}'),p={name:"example/payment-verification.md"},o=l(`

Payment Verification

We encourage you to verify payments on your server. This ensures that the payment was not tampered with in the browser, and that the payment was actually sent to your wallet. This is especially important if you are selling digital goods or services.

Use the following example to create a payment intent on your server and then show a button for that intent on the browser. You can then forward the user to a success page that includes the intent, which you can verify.

INFO

If you need real-time payment events, see the Payment Events example.

Payment Intent Example

The full example code can be found on GitHub.

js
import * as code from "@code-wallet/client";
 import express from "express";
 
 const app = express();
diff --git a/docs/assets/example_payment-verification.md.d219252a.lean.js b/docs/assets/example_payment-verification.md.fe6c0a0f.lean.js
similarity index 100%
rename from docs/assets/example_payment-verification.md.d219252a.lean.js
rename to docs/assets/example_payment-verification.md.fe6c0a0f.lean.js
diff --git a/docs/assets/example_react-example.md.43b8abc7.js b/docs/assets/example_react-example.md.e5273e61.js
similarity index 96%
rename from docs/assets/example_react-example.md.43b8abc7.js
rename to docs/assets/example_react-example.md.e5273e61.js
index 64a5252..d80f0c5 100644
--- a/docs/assets/example_react-example.md.43b8abc7.js
+++ b/docs/assets/example_react-example.md.e5273e61.js
@@ -1,4 +1,4 @@
-import{_ as s,o as a,c as n,Q as l}from"./chunks/framework.0c8e00f4.js";const F=JSON.parse('{"title":"React Example","description":"","frontmatter":{},"headers":[],"relativePath":"example/react-example.md","filePath":"example/react-example.md"}'),p={name:"example/react-example.md"},e=l(`

React Example

This example shows how to use the Code SDK with React and TypeScript.

First, lets create a new React project:

bash
npx create-react-app my-react-ts-app --template typescript
npx create-react-app my-react-ts-app --template typescript

INFO

You should be able to run the project with npm start and see the default React page.

Payment Request

Once you have a React project, install the Code elements package:

bash
npm install @code-wallet/elements
npm install @code-wallet/elements
bash
yarn add @code-wallet/elements
yarn add @code-wallet/elements
bash
pnpm add @code-wallet/elements
pnpm add @code-wallet/elements
bash
bun install @code-wallet/elements
bun install @code-wallet/elements

Now, use the useEffect hook to create the button when the container component is mounted.

tsx
import React, { useEffect, useRef } from 'react';
+import{_ as s,o as a,c as n,Q as l}from"./chunks/framework.0c8e00f4.js";const F=JSON.parse('{"title":"React Example","description":"","frontmatter":{},"headers":[],"relativePath":"example/react-example.md","filePath":"example/react-example.md"}'),p={name:"example/react-example.md"},e=l(`

React Example

This example shows how to use the Code SDK with React and TypeScript.

First, lets create a new React project:

bash
npx create-react-app my-react-ts-app --template typescript
npx create-react-app my-react-ts-app --template typescript

INFO

You should be able to run the project with npm start and see the default React page.

Payment Request

Once you have a React project, install the Code elements package:

bash
npm install @code-wallet/elements
npm install @code-wallet/elements
bash
yarn add @code-wallet/elements
yarn add @code-wallet/elements
bash
pnpm add @code-wallet/elements
pnpm add @code-wallet/elements
bash
bun install @code-wallet/elements
bun install @code-wallet/elements

Now, use the useEffect hook to create the button when the container component is mounted.

tsx
import React, { useEffect, useRef } from 'react';
 import code from '@code-wallet/elements';
 
 function App() {
diff --git a/docs/assets/example_react-example.md.43b8abc7.lean.js b/docs/assets/example_react-example.md.e5273e61.lean.js
similarity index 100%
rename from docs/assets/example_react-example.md.43b8abc7.lean.js
rename to docs/assets/example_react-example.md.e5273e61.lean.js
diff --git a/docs/assets/example_vue-example.md.d94cfa9b.js b/docs/assets/example_vue-example.md.6e37dbcd.js
similarity index 96%
rename from docs/assets/example_vue-example.md.d94cfa9b.js
rename to docs/assets/example_vue-example.md.6e37dbcd.js
index 183a356..07d089d 100644
--- a/docs/assets/example_vue-example.md.d94cfa9b.js
+++ b/docs/assets/example_vue-example.md.6e37dbcd.js
@@ -1,4 +1,4 @@
-import{_ as s,o as a,c as n,Q as l}from"./chunks/framework.0c8e00f4.js";const h=JSON.parse('{"title":"Vue Example","description":"","frontmatter":{},"headers":[],"relativePath":"example/vue-example.md","filePath":"example/vue-example.md"}'),p={name:"example/vue-example.md"},e=l(`

Vue Example

This example shows how to use the Code SDK with Vue, Vite, and TypeScript.

First, lets create a new Vue project:

bash
npm create vite@latest
npm create vite@latest

Select Vue and TypeScript when prompted.

INFO

You should be able to run the project with npm run dev and see the default Vue page.

Payment Request

Once you have a Vue project, install the Code elements package:

bash
npm install @code-wallet/elements
npm install @code-wallet/elements
bash
yarn add @code-wallet/elements
yarn add @code-wallet/elements
bash
pnpm add @code-wallet/elements
pnpm add @code-wallet/elements
bash
bun install @code-wallet/elements
bun install @code-wallet/elements

Now, use the onMounted hook to create the button when the container component is mounted.

vue
<script setup lang="ts">
+import{_ as s,o as a,c as n,Q as l}from"./chunks/framework.0c8e00f4.js";const F=JSON.parse('{"title":"Vue Example","description":"","frontmatter":{},"headers":[],"relativePath":"example/vue-example.md","filePath":"example/vue-example.md"}'),p={name:"example/vue-example.md"},e=l(`

Vue Example

This example shows how to use the Code SDK with Vue, Vite, and TypeScript.

First, lets create a new Vue project:

bash
npm create vite@latest
npm create vite@latest

Select Vue and TypeScript when prompted.

INFO

You should be able to run the project with npm run dev and see the default Vue page.

Payment Request

Once you have a Vue project, install the Code elements package:

bash
npm install @code-wallet/elements
npm install @code-wallet/elements
bash
yarn add @code-wallet/elements
yarn add @code-wallet/elements
bash
pnpm add @code-wallet/elements
pnpm add @code-wallet/elements
bash
bun install @code-wallet/elements
bun install @code-wallet/elements

Now, use the onMounted hook to create the button when the container component is mounted.

vue
<script setup lang="ts">
 import code from '@code-wallet/elements';
 import { onMounted, ref } from 'vue'
 
@@ -36,4 +36,4 @@ import{_ as s,o as a,c as n,Q as l}from"./chunks/framework.0c8e00f4.js";const h=
 
 <template>
   <div ref="el"></div>
-</template>

This snippet creates a payment button that looks like this:

`,13),o=[e];function t(c,r,E,y,i,d){return a(),n("div",null,o)}const F=s(p,[["render",t]]);export{h as __pageData,F as default}; +</template>

This snippet creates a payment button that looks like this:

`,13),o=[e];function t(c,r,E,y,i,d){return a(),n("div",null,o)}const h=s(p,[["render",t]]);export{F as __pageData,h as default}; diff --git a/docs/assets/example_vue-example.md.d94cfa9b.lean.js b/docs/assets/example_vue-example.md.6e37dbcd.lean.js similarity index 62% rename from docs/assets/example_vue-example.md.d94cfa9b.lean.js rename to docs/assets/example_vue-example.md.6e37dbcd.lean.js index 0706b95..7bb0ce9 100644 --- a/docs/assets/example_vue-example.md.d94cfa9b.lean.js +++ b/docs/assets/example_vue-example.md.6e37dbcd.lean.js @@ -1 +1 @@ -import{_ as s,o as a,c as n,Q as l}from"./chunks/framework.0c8e00f4.js";const h=JSON.parse('{"title":"Vue Example","description":"","frontmatter":{},"headers":[],"relativePath":"example/vue-example.md","filePath":"example/vue-example.md"}'),p={name:"example/vue-example.md"},e=l("",13),o=[e];function t(c,r,E,y,i,d){return a(),n("div",null,o)}const F=s(p,[["render",t]]);export{h as __pageData,F as default}; +import{_ as s,o as a,c as n,Q as l}from"./chunks/framework.0c8e00f4.js";const F=JSON.parse('{"title":"Vue Example","description":"","frontmatter":{},"headers":[],"relativePath":"example/vue-example.md","filePath":"example/vue-example.md"}'),p={name:"example/vue-example.md"},e=l("",13),o=[e];function t(c,r,E,y,i,d){return a(),n("div",null,o)}const h=s(p,[["render",t]]);export{F as __pageData,h as default}; diff --git a/docs/assets/guide_installation-client.md.a77a4e03.js b/docs/assets/guide_installation-client.md.f6037b38.js similarity index 94% rename from docs/assets/guide_installation-client.md.a77a4e03.js rename to docs/assets/guide_installation-client.md.f6037b38.js index 6cf61bb..03ebd68 100644 --- a/docs/assets/guide_installation-client.md.a77a4e03.js +++ b/docs/assets/guide_installation-client.md.f6037b38.js @@ -1,4 +1,4 @@ -import{_ as s,o as a,c as n,Q as l}from"./chunks/framework.0c8e00f4.js";const h=JSON.parse('{"title":"Client-side Install (browser)","description":"","frontmatter":{},"headers":[],"relativePath":"guide/installation-client.md","filePath":"guide/installation-client.md"}'),p={name:"guide/installation-client.md"},o=l(`

Client-side Install (browser)

For use in the browser, you can access the SDK directly at https://js.getcode.com/v1/. However, you can also import the @code-wallet/elements package.

Installation

bash
import code from 'https://js.getcode.com/v1/';
import code from 'https://js.getcode.com/v1/';

If you're using a package manager, you can install the @code-wallet/elements package.

bash
npm install @code-wallet/elements
npm install @code-wallet/elements
bash
yarn add @code-wallet/elements
yarn add @code-wallet/elements
bash
pnpm add @code-wallet/elements
pnpm add @code-wallet/elements
bash
bun install @code-wallet/elements
bun install @code-wallet/elements

Quick Start

html
<script type="module">
+import{_ as s,o as a,c as n,Q as l}from"./chunks/framework.0c8e00f4.js";const u=JSON.parse('{"title":"Client-side Install (browser)","description":"","frontmatter":{},"headers":[],"relativePath":"guide/installation-client.md","filePath":"guide/installation-client.md"}'),p={name:"guide/installation-client.md"},o=l(`

Client-side Install (browser)

For use in the browser, you can access the SDK directly at https://js.getcode.com/v1/. However, you can also import the @code-wallet/elements package.

Installation

bash
import code from 'https://js.getcode.com/v1/';
import code from 'https://js.getcode.com/v1/';

If you're using a package manager, you can install the @code-wallet/elements package.

bash
npm install @code-wallet/elements
npm install @code-wallet/elements
bash
yarn add @code-wallet/elements
yarn add @code-wallet/elements
bash
pnpm add @code-wallet/elements
pnpm add @code-wallet/elements
bash
bun install @code-wallet/elements
bun install @code-wallet/elements

Quick Start

html
<script type="module">
     import code from 'https://js.getcode.com/v1';
 
     const { button } = code.elements.create('button', {
@@ -38,4 +38,4 @@ import{_ as s,o as a,c as n,Q as l}from"./chunks/framework.0c8e00f4.js";const h=
     // ...
 });
 
-button.mount('#button-container');

With this snippet, you can create a payment button that looks like this:

See a minimal example here.

Examples

You can also see the React or Vue examples for more information.

`,13),e=[o];function t(c,r,i,E,y,d){return a(),n("div",null,e)}const b=s(p,[["render",t]]);export{h as __pageData,b as default}; +button.mount('#button-container');

With this snippet, you can create a payment button that looks like this:

See a minimal example here.

Examples

You can also see the React or Vue examples for more information.

`,13),e=[o];function t(c,r,i,E,y,d){return a(),n("div",null,e)}const b=s(p,[["render",t]]);export{u as __pageData,b as default}; diff --git a/docs/assets/guide_installation-client.md.a77a4e03.lean.js b/docs/assets/guide_installation-client.md.f6037b38.lean.js similarity index 71% rename from docs/assets/guide_installation-client.md.a77a4e03.lean.js rename to docs/assets/guide_installation-client.md.f6037b38.lean.js index 302dbf6..b6ba736 100644 --- a/docs/assets/guide_installation-client.md.a77a4e03.lean.js +++ b/docs/assets/guide_installation-client.md.f6037b38.lean.js @@ -1 +1 @@ -import{_ as s,o as a,c as n,Q as l}from"./chunks/framework.0c8e00f4.js";const h=JSON.parse('{"title":"Client-side Install (browser)","description":"","frontmatter":{},"headers":[],"relativePath":"guide/installation-client.md","filePath":"guide/installation-client.md"}'),p={name:"guide/installation-client.md"},o=l("",13),e=[o];function t(c,r,i,E,y,d){return a(),n("div",null,e)}const b=s(p,[["render",t]]);export{h as __pageData,b as default}; +import{_ as s,o as a,c as n,Q as l}from"./chunks/framework.0c8e00f4.js";const u=JSON.parse('{"title":"Client-side Install (browser)","description":"","frontmatter":{},"headers":[],"relativePath":"guide/installation-client.md","filePath":"guide/installation-client.md"}'),p={name:"guide/installation-client.md"},o=l("",13),e=[o];function t(c,r,i,E,y,d){return a(),n("div",null,e)}const b=s(p,[["render",t]]);export{u as __pageData,b as default}; diff --git a/docs/assets/guide_installation-server.md.4be93a61.js b/docs/assets/guide_installation-server.md.a0ac1cff.js similarity index 89% rename from docs/assets/guide_installation-server.md.4be93a61.js rename to docs/assets/guide_installation-server.md.a0ac1cff.js index 2fd83f9..64575e0 100644 --- a/docs/assets/guide_installation-server.md.4be93a61.js +++ b/docs/assets/guide_installation-server.md.a0ac1cff.js @@ -1,4 +1,4 @@ -import{_ as s,o as a,c as n,Q as l}from"./chunks/framework.0c8e00f4.js";const F=JSON.parse('{"title":"Server-side Install","description":"","frontmatter":{},"headers":[],"relativePath":"guide/installation-server.md","filePath":"guide/installation-server.md"}'),e={name:"guide/installation-server.md"},p=l(`

Server-side Install

While server-side integration is optional, you'll usually want to confirm payment on the server-side. The SDK is split into multiple packages, each of which can be installed separately. This allows you to install only the packages you need, and avoid installing unnecessary dependencies.

A typical server-side integration will look something like this:

mermaid
sequenceDiagram
+import{_ as s,o as n,c as a,Q as l}from"./chunks/framework.0c8e00f4.js";const F=JSON.parse('{"title":"Server-side Install","description":"","frontmatter":{},"headers":[],"relativePath":"guide/installation-server.md","filePath":"guide/installation-server.md"}'),p={name:"guide/installation-server.md"},e=l(`

Server-side Install

While server-side integration is optional, you'll usually want to confirm payment on the server-side. The SDK is split into multiple packages, each of which can be installed separately. This allows you to install only the packages you need, and avoid installing unnecessary dependencies.

A typical server-side integration will look something like this:

mermaid
sequenceDiagram
   autonumber
   participant User
   participant Client
@@ -18,7 +18,7 @@ import{_ as s,o as a,c as n,Q as l}from"./chunks/framework.0c8e00f4.js";const F=
   Server->>Code Sequencer: POST /v1/createIntent
   Code Sequencer->>Server: Return PaymentIntent status
   Server->>Client: Return PaymentIntent's client_secret
-  Client->>Code Sequencer: Open message stream at rendezvous value

You can learn more about the payment flow here.

Installation

bash
npm install @code-wallet/client
npm install @code-wallet/client
bash
pip install code-wallet
pip install code-wallet
bash
composer require code-wallet/client
composer require code-wallet/client
bash
go get github.com/code-wallet/code-sdk-go
go get github.com/code-wallet/code-sdk-go

Quick Start

Once installed, you can import the SDK into your project.

js
import code from '@code-wallet/client';
+  Client->>Code Sequencer: Open message stream at rendezvous value

You can learn more about the payment flow here.

Installation

bash
npm install @code-wallet/client
npm install @code-wallet/client
bash
pip install code-wallet
pip install code-wallet
bash
composer require code-wallet/client
composer require code-wallet/client
bash
go get github.com/code-payments/code-sdk-go
go get github.com/code-payments/code-sdk-go

Quick Start

Once installed, you can import the SDK into your project.

js
import code from '@code-wallet/client';
 
 const { intent } = await code.paymentIntents.create({
     // ...
@@ -98,4 +98,4 @@ import{_ as s,o as a,c as n,Q as l}from"./chunks/framework.0c8e00f4.js";const F=
 
 // Check the intent status
 _, err = client.GetIntentStatus(ctx, intent.GetIntentId())
-check(err)

See a minimal server example here.

Full Examples

If you prefer running full examples, we have a few available.

Checkout the full Node.js Examples, our Python Example, our PHP Example, or our Go Example.

`,12),o=[p];function t(c,r,i,y,E,d){return a(),n("div",null,o)}const h=s(e,[["render",t]]);export{F as __pageData,h as default}; +check(err)

See a minimal server example here.

Full Examples

If you prefer running full examples, we have a few available.

Checkout the full Node.js Examples, our Python Example, our PHP Example, or our Go Example.

`,12),o=[e];function t(c,r,i,y,E,d){return n(),a("div",null,o)}const h=s(p,[["render",t]]);export{F as __pageData,h as default}; diff --git a/docs/assets/guide_installation-server.md.4be93a61.lean.js b/docs/assets/guide_installation-server.md.a0ac1cff.lean.js similarity index 55% rename from docs/assets/guide_installation-server.md.4be93a61.lean.js rename to docs/assets/guide_installation-server.md.a0ac1cff.lean.js index 95b732a..c4360be 100644 --- a/docs/assets/guide_installation-server.md.4be93a61.lean.js +++ b/docs/assets/guide_installation-server.md.a0ac1cff.lean.js @@ -1 +1 @@ -import{_ as s,o as a,c as n,Q as l}from"./chunks/framework.0c8e00f4.js";const F=JSON.parse('{"title":"Server-side Install","description":"","frontmatter":{},"headers":[],"relativePath":"guide/installation-server.md","filePath":"guide/installation-server.md"}'),e={name:"guide/installation-server.md"},p=l("",12),o=[p];function t(c,r,i,y,E,d){return a(),n("div",null,o)}const h=s(e,[["render",t]]);export{F as __pageData,h as default}; +import{_ as s,o as n,c as a,Q as l}from"./chunks/framework.0c8e00f4.js";const F=JSON.parse('{"title":"Server-side Install","description":"","frontmatter":{},"headers":[],"relativePath":"guide/installation-server.md","filePath":"guide/installation-server.md"}'),p={name:"guide/installation-server.md"},e=l("",12),o=[e];function t(c,r,i,y,E,d){return n(),a("div",null,o)}const h=s(p,[["render",t]]);export{F as __pageData,h as default}; diff --git a/docs/assets/guide_introduction.md.f95012e9.js b/docs/assets/guide_introduction.md.f2a6a882.js similarity index 70% rename from docs/assets/guide_introduction.md.f95012e9.js rename to docs/assets/guide_introduction.md.f2a6a882.js index 2ab87a7..3368e8e 100644 --- a/docs/assets/guide_introduction.md.f95012e9.js +++ b/docs/assets/guide_introduction.md.f2a6a882.js @@ -1 +1 @@ -import{_ as e,o as t,c as a,Q as o}from"./chunks/framework.0c8e00f4.js";const f=JSON.parse('{"title":"Introduction","description":"","frontmatter":{},"headers":[],"relativePath":"guide/introduction.md","filePath":"guide/introduction.md"}'),n={name:"guide/introduction.md"},r=o('

Introduction

The Code SDK is the first and only payments platform that makes it simple for web developers to accept small payments from users anywhere in the world. It is open and permissionless, so you can get started with no sign up and just a few lines of code.

We built the Code SDK after more than a decade of building mainstream consumer experiences and developer platforms and finding that existing payment platforms are incredibly limiting. As a developer you get limited global functionality (ie. large, one way payments), you can only build more innovative experiences country by country , there are a lot of hoops you have to jump through to get started, and after all that you still have to pay high fees. This constrains the experiences you can build, and the people you can build for.

The Code SDK changes this. It provides a set of tools that allows you to embed a "Pay with Code" button in your web experience and charge users as little as 5 cents, unlocking new and exciting experiences not previously possible with other payment platforms. The only cost as a developer is a flat 1 penny fee collected out of each payment to cover blockchain transaction costs.

What is the Code SDK?

The Code SDK is a set of JavaScript packages that allow you to integrate Code into your website or web app. The SDK is available as a set of JavaScript packages on npm, and can be used in both the browser and on the server.

Early Access

The Code SDK is currently in early access, the maximum payment amount is $1 USD.

What is Code?

Code is the mobile wallet app that users make payments with. The experience is both simple and elegant, where users get all the benefits of self custodial crypto (open, global, secure), without any of the complexity (managing private keys, gas fees, and slow or failed transactions). Code is built on the Solana blockchain, and uses the Code Sequencer to deliver a payments experience that is instant, global, and private.

Don’t have the Code Wallet app yet?

Download It Now and get your first $1 free

Learn More

',12),i=[r];function s(l,c,d,h,p,u){return t(),a("div",null,i)}const y=e(n,[["render",s]]);export{f as __pageData,y as default}; +import{_ as e,o as t,c as a,Q as o}from"./chunks/framework.0c8e00f4.js";const f=JSON.parse('{"title":"Introduction","description":"","frontmatter":{},"headers":[],"relativePath":"guide/introduction.md","filePath":"guide/introduction.md"}'),n={name:"guide/introduction.md"},r=o('

Introduction

The Code SDK is the first and only payments platform that makes it simple for web developers to accept small payments from users anywhere in the world. It is open and permissionless, so you can get started with no sign up and just a few lines of code.

We built the Code SDK after more than a decade of building mainstream consumer experiences and developer platforms and finding that existing payment platforms are incredibly limiting. As a developer you get limited global functionality (ie. large, one way payments), you can only build more innovative experiences country by country , there are a lot of hoops you have to jump through to get started, and after all that you still have to pay high fees. This constrains the experiences you can build, and the people you can build for.

The Code SDK changes this. It provides a set of tools that allows you to embed a "Pay with Code" button in your web experience and charge users as little as 5 cents, unlocking new and exciting experiences not previously possible with other payment platforms. The only cost as a developer is a flat 1 penny fee collected out of each payment to cover blockchain transaction costs.

What is the Code SDK?

The Code SDK is a set of JavaScript packages that allow you to integrate Code into your website or web app. The SDK is available as a set of JavaScript packages on npm, and can be used in both the browser and on the server.

Early Access

The Code SDK is currently in early access, the maximum payment amount is $5 USD.

What is Code?

Code is the mobile wallet app that users make payments with. The experience is both simple and elegant, where users get all the benefits of self custodial crypto (open, global, secure), without any of the complexity (managing private keys, gas fees, and slow or failed transactions). Code is built on the Solana blockchain, and uses the Code Sequencer to deliver a payments experience that is instant, global, and private.

Don’t have the Code Wallet app yet?

Download It Now and get your first $1 free

Learn More

',12),i=[r];function s(l,c,d,h,p,u){return t(),a("div",null,i)}const y=e(n,[["render",s]]);export{f as __pageData,y as default}; diff --git a/docs/assets/guide_introduction.md.f95012e9.lean.js b/docs/assets/guide_introduction.md.f2a6a882.lean.js similarity index 100% rename from docs/assets/guide_introduction.md.f95012e9.lean.js rename to docs/assets/guide_introduction.md.f2a6a882.lean.js diff --git a/docs/assets/guide_quick-start.md.0a0cfd19.js b/docs/assets/guide_quick-start.md.f7b2ed7e.js similarity index 97% rename from docs/assets/guide_quick-start.md.0a0cfd19.js rename to docs/assets/guide_quick-start.md.f7b2ed7e.js index 7888921..dd6e727 100644 --- a/docs/assets/guide_quick-start.md.0a0cfd19.js +++ b/docs/assets/guide_quick-start.md.f7b2ed7e.js @@ -1,4 +1,4 @@ -import{_ as s,o as a,c as e,Q as t}from"./chunks/framework.0c8e00f4.js";const n="/code-sdk/docs/deposit-address.png",m=JSON.parse('{"title":"Getting Started","description":"","frontmatter":{},"headers":[],"relativePath":"guide/quick-start.md","filePath":"guide/quick-start.md"}'),o={name:"guide/quick-start.md"},p=t(`

Getting Started

Learn how to embed a Code Payments button in your website or web app. The client- and server-side code mounts everything needed to complete a payment using the Code app and verify it on your server.

Create a Payment Button

This minimal snippet creates a Code payment button that you can embed in your website or application.

js
import code from 'https://js.getcode.com/v1';
+import{_ as s,o as a,c as e,Q as t}from"./chunks/framework.0c8e00f4.js";const n="/code-sdk/docs/deposit-address.png",m=JSON.parse('{"title":"Getting Started","description":"","frontmatter":{},"headers":[],"relativePath":"guide/quick-start.md","filePath":"guide/quick-start.md"}'),o={name:"guide/quick-start.md"},p=t(`

Getting Started

Learn how to embed a Code Payments button in your website or web app. The client- and server-side code mounts everything needed to complete a payment using the Code app and verify it on your server.

Create a Payment Button

This minimal snippet creates a Code payment button that you can embed in your website or application.

js
import code from 'https://js.getcode.com/v1';
 
 const { button } = code.elements.create('button', {
   currency: 'usd',
diff --git a/docs/assets/guide_quick-start.md.0a0cfd19.lean.js b/docs/assets/guide_quick-start.md.f7b2ed7e.lean.js
similarity index 100%
rename from docs/assets/guide_quick-start.md.0a0cfd19.lean.js
rename to docs/assets/guide_quick-start.md.f7b2ed7e.lean.js
diff --git a/docs/assets/intents_payment-requests.md.25924d3b.js b/docs/assets/intents_payment-requests.md.3643330b.js
similarity index 99%
rename from docs/assets/intents_payment-requests.md.25924d3b.js
rename to docs/assets/intents_payment-requests.md.3643330b.js
index 7d917da..c3faf08 100644
--- a/docs/assets/intents_payment-requests.md.25924d3b.js
+++ b/docs/assets/intents_payment-requests.md.3643330b.js
@@ -18,7 +18,7 @@ import{_ as s,o as n,c as a,Q as e}from"./chunks/framework.0c8e00f4.js";const u=
   Server->>Code Sequencer: POST /v1/createIntent
   Code Sequencer->>Server: Return PaymentIntent status
   Server->>Client: Return PaymentIntent's client_secret
-  Client->>Code Sequencer: Open message stream at rendezvous value

Typically, you'll have a payment button on your website. For example, you might have a button that looks like this:

When a user clicks the button, an invoke event is triggered, allowing you to communicate with your backend; perhaps to check for inventory. On the server side, you'll create a payment intent and return the clientSecret to the browser. This value is then used to generate a rendezvous value on the button.

js
const { button } = code.elements.create('button', { ... });
+  Client->>Code Sequencer: Open message stream at rendezvous value

Typically, you'll have a payment button on your website. For example, you might have a button that looks like this:

When a user clicks the button, an invoke event is triggered, allowing you to communicate with your backend; perhaps to check for inventory. On the server side, you'll create a payment intent and return the clientSecret to the browser. This value is then used to generate a rendezvous value on the button.

js
const { button } = code.elements.create('button', { ... });
 
 ...
 
diff --git a/docs/assets/intents_payment-requests.md.25924d3b.lean.js b/docs/assets/intents_payment-requests.md.3643330b.lean.js
similarity index 100%
rename from docs/assets/intents_payment-requests.md.25924d3b.lean.js
rename to docs/assets/intents_payment-requests.md.3643330b.lean.js
diff --git a/docs/example/introduction.html b/docs/example/introduction.html
index a2f2def..37ae23f 100644
--- a/docs/example/introduction.html
+++ b/docs/example/introduction.html
@@ -17,7 +17,7 @@
   
   
     
Skip to content

Examples

We've put a few samples in our documentation to help you get started. We also have fully working samples as part of the git repository. You can find them in the examples directory.

Walkthroughs

Complete Examples

Need Help?

Let us know if you have any questions or need help integrating Code into your website or application. You can reach us on Discord or Twitter.

- + \ No newline at end of file diff --git a/docs/example/payment-events.html b/docs/example/payment-events.html index ab17860..aed2816 100644 --- a/docs/example/payment-events.html +++ b/docs/example/payment-events.html @@ -11,12 +11,12 @@ - + -
Skip to content

Payment Events

You may want to know when a payment has been made, or when a user has canceled a payment. You can do this by listening to events.

You have the ability to listen for payment events on both the client- and server-side. The client-side uses a WebSocket connection to the Code Sequencer for events, while the server-side SDK uses a webhook endpoint.

Below you'll find an example of how to use both.


INFO

The webhook URL will need to be public before you create the intent.

You can use cloudflare tunnels to test this locally.


For example, run cloudflared tunnel --url localhost:3030

  1. Then replace the url below with the url provided by cloudflare tunnels
  2. And finally, start the server with node server.js

Events Example

The full example code can be found on GitHub.

js
import code from 'https://js.getcode.com/v1';
+    
Skip to content

Payment Events

You may want to know when a payment has been made, or when a user has canceled a payment. You can do this by listening to events.

You have the ability to listen for payment events on both the client- and server-side. The client-side uses a WebSocket connection to the Code Sequencer for events, while the server-side SDK uses a webhook endpoint.

Below you'll find an example of how to use both.


INFO

The webhook URL will need to be public before you create the intent.

You can use cloudflare tunnels to test this locally.


For example, run cloudflared tunnel --url localhost:3030

  1. Then replace the url below with the url provided by cloudflare tunnels
  2. And finally, start the server with node server.js

Events Example

The full example code can be found on GitHub.

js
import code from 'https://js.getcode.com/v1';
 
 const { button } = code.elements.create('button', {
     // ...
@@ -189,7 +189,7 @@
 
   res.send({ success: true });
 });

This snippet creates a payment button that looks like this:

- + \ No newline at end of file diff --git a/docs/example/payment-verification.html b/docs/example/payment-verification.html index 5be1d06..cba2df4 100644 --- a/docs/example/payment-verification.html +++ b/docs/example/payment-verification.html @@ -11,12 +11,12 @@ - + -
Skip to content

Payment Verification

We encourage you to verify payments on your server. This ensures that the payment was not tampered with in the browser, and that the payment was actually sent to your wallet. This is especially important if you are selling digital goods or services.

Use the following example to create a payment intent on your server and then show a button for that intent on the browser. You can then forward the user to a success page that includes the intent, which you can verify.

INFO

If you need real-time payment events, see the Payment Events example.

Payment Intent Example

The full example code can be found on GitHub.

js
import * as code from "@code-wallet/client";
+    
Skip to content

Payment Verification

We encourage you to verify payments on your server. This ensures that the payment was not tampered with in the browser, and that the payment was actually sent to your wallet. This is especially important if you are selling digital goods or services.

Use the following example to create a payment intent on your server and then show a button for that intent on the browser. You can then forward the user to a success page that includes the intent, which you can verify.

INFO

If you need real-time payment events, see the Payment Events example.

Payment Intent Example

The full example code can be found on GitHub.

js
import * as code from "@code-wallet/client";
 import express from "express";
 
 const app = express();
@@ -183,7 +183,7 @@
 </body>
 
 </html>

This snippet creates a payment button that looks like this:

- + \ No newline at end of file diff --git a/docs/example/react-example.html b/docs/example/react-example.html index 6fbc01e..d62862e 100644 --- a/docs/example/react-example.html +++ b/docs/example/react-example.html @@ -11,12 +11,12 @@ - + -
Skip to content

React Example

This example shows how to use the Code SDK with React and TypeScript.

First, lets create a new React project:

bash
npx create-react-app my-react-ts-app --template typescript
npx create-react-app my-react-ts-app --template typescript

INFO

You should be able to run the project with npm start and see the default React page.

Payment Request

Once you have a React project, install the Code elements package:

bash
npm install @code-wallet/elements
npm install @code-wallet/elements
bash
yarn add @code-wallet/elements
yarn add @code-wallet/elements
bash
pnpm add @code-wallet/elements
pnpm add @code-wallet/elements
bash
bun install @code-wallet/elements
bun install @code-wallet/elements

Now, use the useEffect hook to create the button when the container component is mounted.

tsx
import React, { useEffect, useRef } from 'react';
+    
Skip to content

React Example

This example shows how to use the Code SDK with React and TypeScript.

First, lets create a new React project:

bash
npx create-react-app my-react-ts-app --template typescript
npx create-react-app my-react-ts-app --template typescript

INFO

You should be able to run the project with npm start and see the default React page.

Payment Request

Once you have a React project, install the Code elements package:

bash
npm install @code-wallet/elements
npm install @code-wallet/elements
bash
yarn add @code-wallet/elements
yarn add @code-wallet/elements
bash
pnpm add @code-wallet/elements
pnpm add @code-wallet/elements
bash
bun install @code-wallet/elements
bun install @code-wallet/elements

Now, use the useEffect hook to create the button when the container component is mounted.

tsx
import React, { useEffect, useRef } from 'react';
 import code from '@code-wallet/elements';
 
 function App() {
@@ -59,7 +59,7 @@
     </div>
   );
 }

This snippet creates a payment button that looks like this:

- + \ No newline at end of file diff --git a/docs/example/request-payment.html b/docs/example/request-payment.html index 57ca59f..4c9b220 100644 --- a/docs/example/request-payment.html +++ b/docs/example/request-payment.html @@ -77,7 +77,7 @@ </body> </html>

This snippet creates a payment button that looks like this:

- + \ No newline at end of file diff --git a/docs/example/vue-example.html b/docs/example/vue-example.html index fc161a9..162f629 100644 --- a/docs/example/vue-example.html +++ b/docs/example/vue-example.html @@ -11,12 +11,12 @@ - + -
Skip to content

Vue Example

This example shows how to use the Code SDK with Vue, Vite, and TypeScript.

First, lets create a new Vue project:

bash
npm create vite@latest
npm create vite@latest

Select Vue and TypeScript when prompted.

INFO

You should be able to run the project with npm run dev and see the default Vue page.

Payment Request

Once you have a Vue project, install the Code elements package:

bash
npm install @code-wallet/elements
npm install @code-wallet/elements
bash
yarn add @code-wallet/elements
yarn add @code-wallet/elements
bash
pnpm add @code-wallet/elements
pnpm add @code-wallet/elements
bash
bun install @code-wallet/elements
bun install @code-wallet/elements

Now, use the onMounted hook to create the button when the container component is mounted.

vue
<script setup lang="ts">
+    
Skip to content

Vue Example

This example shows how to use the Code SDK with Vue, Vite, and TypeScript.

First, lets create a new Vue project:

bash
npm create vite@latest
npm create vite@latest

Select Vue and TypeScript when prompted.

INFO

You should be able to run the project with npm run dev and see the default Vue page.

Payment Request

Once you have a Vue project, install the Code elements package:

bash
npm install @code-wallet/elements
npm install @code-wallet/elements
bash
yarn add @code-wallet/elements
yarn add @code-wallet/elements
bash
pnpm add @code-wallet/elements
pnpm add @code-wallet/elements
bash
bun install @code-wallet/elements
bun install @code-wallet/elements

Now, use the onMounted hook to create the button when the container component is mounted.

vue
<script setup lang="ts">
 import code from '@code-wallet/elements';
 import { onMounted, ref } from 'vue'
 
@@ -55,7 +55,7 @@
 <template>
   <div ref="el"></div>
 </template>

This snippet creates a payment button that looks like this:

- + \ No newline at end of file diff --git a/docs/guide/contribution-guide.html b/docs/guide/contribution-guide.html index db8e9c3..ab1af85 100644 --- a/docs/guide/contribution-guide.html +++ b/docs/guide/contribution-guide.html @@ -17,7 +17,7 @@ - + \ No newline at end of file diff --git a/docs/guide/installation-client.html b/docs/guide/installation-client.html index 9a843ea..6c705a5 100644 --- a/docs/guide/installation-client.html +++ b/docs/guide/installation-client.html @@ -11,12 +11,12 @@ - + -
Skip to content

Client-side Install (browser)

For use in the browser, you can access the SDK directly at https://js.getcode.com/v1/. However, you can also import the @code-wallet/elements package.

Installation

bash
import code from 'https://js.getcode.com/v1/';
import code from 'https://js.getcode.com/v1/';

If you're using a package manager, you can install the @code-wallet/elements package.

bash
npm install @code-wallet/elements
npm install @code-wallet/elements
bash
yarn add @code-wallet/elements
yarn add @code-wallet/elements
bash
pnpm add @code-wallet/elements
pnpm add @code-wallet/elements
bash
bun install @code-wallet/elements
bun install @code-wallet/elements

Quick Start

html
<script type="module">
+    
Skip to content

Client-side Install (browser)

For use in the browser, you can access the SDK directly at https://js.getcode.com/v1/. However, you can also import the @code-wallet/elements package.

Installation

bash
import code from 'https://js.getcode.com/v1/';
import code from 'https://js.getcode.com/v1/';

If you're using a package manager, you can install the @code-wallet/elements package.

bash
npm install @code-wallet/elements
npm install @code-wallet/elements
bash
yarn add @code-wallet/elements
yarn add @code-wallet/elements
bash
pnpm add @code-wallet/elements
pnpm add @code-wallet/elements
bash
bun install @code-wallet/elements
bun install @code-wallet/elements

Quick Start

html
<script type="module">
     import code from 'https://js.getcode.com/v1';
 
     const { button } = code.elements.create('button', {
@@ -57,7 +57,7 @@
 });
 
 button.mount('#button-container');

With this snippet, you can create a payment button that looks like this:

See a minimal example here.

Examples

You can also see the React or Vue examples for more information.

- + \ No newline at end of file diff --git a/docs/guide/installation-server.html b/docs/guide/installation-server.html index 4fb94d8..fefe1af 100644 --- a/docs/guide/installation-server.html +++ b/docs/guide/installation-server.html @@ -11,7 +11,7 @@ - + @@ -36,7 +36,7 @@ Server->>Code Sequencer: POST /v1/createIntent Code Sequencer->>Server: Return PaymentIntent status Server->>Client: Return PaymentIntent's client_secret - Client->>Code Sequencer: Open message stream at rendezvous value

You can learn more about the payment flow here.

Installation

bash
npm install @code-wallet/client
npm install @code-wallet/client
bash
pip install code-wallet
pip install code-wallet
bash
composer require code-wallet/client
composer require code-wallet/client
bash
go get github.com/code-wallet/code-sdk-go
go get github.com/code-wallet/code-sdk-go

Quick Start

Once installed, you can import the SDK into your project.

js
import code from '@code-wallet/client';
+  Client->>Code Sequencer: Open message stream at rendezvous value

You can learn more about the payment flow here.

Installation

bash
npm install @code-wallet/client
npm install @code-wallet/client
bash
pip install code-wallet
pip install code-wallet
bash
composer require code-wallet/client
composer require code-wallet/client
bash
go get github.com/code-payments/code-sdk-go
go get github.com/code-payments/code-sdk-go

Quick Start

Once installed, you can import the SDK into your project.

js
import code from '@code-wallet/client';
 
 const { intent } = await code.paymentIntents.create({
     // ...
@@ -116,8 +116,8 @@
 
 // Check the intent status
 _, err = client.GetIntentStatus(ctx, intent.GetIntentId())
-check(err)

See a minimal server example here.

Full Examples

If you prefer running full examples, we have a few available.

Checkout the full Node.js Examples, our Python Example, our PHP Example, or our Go Example.

- +check(err)

See a minimal server example here.

Full Examples

If you prefer running full examples, we have a few available.

Checkout the full Node.js Examples, our Python Example, our PHP Example, or our Go Example.

+ \ No newline at end of file diff --git a/docs/guide/installation.html b/docs/guide/installation.html index de500a8..49131d6 100644 --- a/docs/guide/installation.html +++ b/docs/guide/installation.html @@ -17,7 +17,7 @@
Skip to content

Installation

The SDK is split into multiple packages, each of which can be installed separately. This allows you to install only the packages you need, and avoid installing unnecessary dependencies.

For help with installation, see the client-side or server-side guides.

Packages

We have a number of packages available for use in your project. TypeScript is the preferred language for Code SDK development. However, we also provide a Python SDK for server-side integration with others on the way.


TypeScript

  • @code-wallet/elements - Provides the Code elements, which you can add to your website. This is a client-side only package.
  • @code-wallet/client - Allows you to create a payment intent and verify the payment on your server. Can be used on both the server and client-side.
  • @code-wallet/mnemonic - Provides a utility for generating a mnemonic phrase. Implements hierarchical deterministic (HD) wallet functionality (BIP-32 and BIP-39)
  • @code-wallet/library - Provides the internal utility functions used by the other packages. You'll find the intent, keypair, and payment definitions here.
  • @code-wallet/programs - Provides serialization and deserialization functions for the on-chain programs types and instructions.
  • @code-wallet/rpc - Provides a WebSocket envelope for GRPC communication to the Code sequencer.

ES vs CommonJS

The SDK is available as both a CommonJS module and an ECMAScript module (ESM). The ESM version is recommended for use with bundlers, as it allows bundlers to perform tree-shaking and other optimizations.

Learn more about JavaScript modules here.


Python

  • code-wallet - The Code Wallet Python SDK is a module that allows Python developers to integrate Code into their applications. Seamlessly start accepting payments with minimal setup and just a few lines of code.

PHP

  • code-wallet - The Code Wallet PHP SDK is a module that allows PHP developers to integrate Code into their applications. Seamlessly start accepting payments with minimal setup and just a few lines of code.

Go-lang

  • code-wallet - The Code Wallet Go SDK is a module that allows Go developers to integrate Code into their applications. Seamlessly start accepting payments with minimal setup and just a few lines of code.

Next Steps

Take a look at the client-side or server-side guides to learn how to install the SDK. Or check out the examples to see how to use the SDK in your project.



More Languages

Don't see your language? We're working on adding more SDKs. If you'd like to help, please reach out to us on Discord or Twitter.

Check out the Custom Backends page to learn more.

- + \ No newline at end of file diff --git a/docs/guide/introduction.html b/docs/guide/introduction.html index 0c8545c..d000f3b 100644 --- a/docs/guide/introduction.html +++ b/docs/guide/introduction.html @@ -11,13 +11,13 @@ - + -
Skip to content

Introduction

The Code SDK is the first and only payments platform that makes it simple for web developers to accept small payments from users anywhere in the world. It is open and permissionless, so you can get started with no sign up and just a few lines of code.

We built the Code SDK after more than a decade of building mainstream consumer experiences and developer platforms and finding that existing payment platforms are incredibly limiting. As a developer you get limited global functionality (ie. large, one way payments), you can only build more innovative experiences country by country , there are a lot of hoops you have to jump through to get started, and after all that you still have to pay high fees. This constrains the experiences you can build, and the people you can build for.

The Code SDK changes this. It provides a set of tools that allows you to embed a "Pay with Code" button in your web experience and charge users as little as 5 cents, unlocking new and exciting experiences not previously possible with other payment platforms. The only cost as a developer is a flat 1 penny fee collected out of each payment to cover blockchain transaction costs.

What is the Code SDK?

The Code SDK is a set of JavaScript packages that allow you to integrate Code into your website or web app. The SDK is available as a set of JavaScript packages on npm, and can be used in both the browser and on the server.

Early Access

The Code SDK is currently in early access, the maximum payment amount is $1 USD.

What is Code?

Code is the mobile wallet app that users make payments with. The experience is both simple and elegant, where users get all the benefits of self custodial crypto (open, global, secure), without any of the complexity (managing private keys, gas fees, and slow or failed transactions). Code is built on the Solana blockchain, and uses the Code Sequencer to deliver a payments experience that is instant, global, and private.

Don’t have the Code Wallet app yet?

Download It Now and get your first $1 free

Learn More

- +
Skip to content

Introduction

The Code SDK is the first and only payments platform that makes it simple for web developers to accept small payments from users anywhere in the world. It is open and permissionless, so you can get started with no sign up and just a few lines of code.

We built the Code SDK after more than a decade of building mainstream consumer experiences and developer platforms and finding that existing payment platforms are incredibly limiting. As a developer you get limited global functionality (ie. large, one way payments), you can only build more innovative experiences country by country , there are a lot of hoops you have to jump through to get started, and after all that you still have to pay high fees. This constrains the experiences you can build, and the people you can build for.

The Code SDK changes this. It provides a set of tools that allows you to embed a "Pay with Code" button in your web experience and charge users as little as 5 cents, unlocking new and exciting experiences not previously possible with other payment platforms. The only cost as a developer is a flat 1 penny fee collected out of each payment to cover blockchain transaction costs.

What is the Code SDK?

The Code SDK is a set of JavaScript packages that allow you to integrate Code into your website or web app. The SDK is available as a set of JavaScript packages on npm, and can be used in both the browser and on the server.

Early Access

The Code SDK is currently in early access, the maximum payment amount is $5 USD.

What is Code?

Code is the mobile wallet app that users make payments with. The experience is both simple and elegant, where users get all the benefits of self custodial crypto (open, global, secure), without any of the complexity (managing private keys, gas fees, and slow or failed transactions). Code is built on the Solana blockchain, and uses the Code Sequencer to deliver a payments experience that is instant, global, and private.

Don’t have the Code Wallet app yet?

Download It Now and get your first $1 free

Learn More

+ \ No newline at end of file diff --git a/docs/guide/quick-start.html b/docs/guide/quick-start.html index cb75039..0ac616d 100644 --- a/docs/guide/quick-start.html +++ b/docs/guide/quick-start.html @@ -11,12 +11,12 @@ - + -
Skip to content

Getting Started

Learn how to embed a Code Payments button in your website or web app. The client- and server-side code mounts everything needed to complete a payment using the Code app and verify it on your server.

Create a Payment Button

This minimal snippet creates a Code payment button that you can embed in your website or application.

js
import code from 'https://js.getcode.com/v1';
+    
Skip to content

Getting Started

Learn how to embed a Code Payments button in your website or web app. The client- and server-side code mounts everything needed to complete a payment using the Code app and verify it on your server.

Create a Payment Button

This minimal snippet creates a Code payment button that you can embed in your website or application.

js
import code from 'https://js.getcode.com/v1';
 
 const { button } = code.elements.create('button', {
   currency: 'usd',
@@ -33,7 +33,7 @@
 });
 
 button.mount('#button-container');
js
<div id="button-container"></div>
<div id="button-container"></div>

With this snippet, you can create a payment button that looks like this:


Early Access

The Code SDK is currently in early access, the maximum payment amount is $1 USD.

Prerequisites

While we have tried our best to keep things simple, the rest of the documentation assumes basic familiarity with HTML, CSS, and JavaScript. You can refer to this JavaScript overview. Prior experience with other frameworks helps, but is not required.

Deposit Address

If you are a Code user, you can find your deposit address in the Code app under settings. Use the address from the Deposit Kin tab as the destination parameter in the snippet above.

You'll receive push notifications when payments are made to this address.


Deposit Address

Next Steps

Now that you've learned how to create a payment button, you can learn about:

Need Help?

If you have any questions or need help integrating Code into your website or application, please reach out to us on Discord or Twitter.

- + \ No newline at end of file diff --git a/docs/hashmap.json b/docs/hashmap.json index 395327f..405d86b 100644 --- a/docs/hashmap.json +++ b/docs/hashmap.json @@ -1 +1 @@ -{"example_introduction.md":"755c17a3","guide_installation.md":"3f61216c","readme.md":"44d932fc","guide_contribution-guide.md":"1598c897","example_vue-example.md":"d94cfa9b","index.md":"15e00ac0","example_react-example.md":"43b8abc7","intents_introduction.md":"89801b1c","reference_app.md":"7a8e6aa1","guide_introduction.md":"f95012e9","guide_installation-server.md":"4be93a61","reference_idempotency.md":"5574edc3","guide_quick-start.md":"0a0cfd19","release-notes.md":"021b76f2","example_payment-verification.md":"d219252a","intents_payment-requests.md":"25924d3b","example_request-payment.md":"716f45d4","reference_browser-events.md":"9765a3b1","reference_rendezvous.md":"989ac2ee","guide_installation-client.md":"a77a4e03","reference_webhook.md":"ee948085","example_payment-events.md":"da38487d","reference_element-appearance.md":"db1d6d2c","markdown-examples.md":"f0f9a98d","reference_sequencer.md":"3ee4efe6","intents_custom-backends.md":"48f78982","reference_timelock.md":"a08c7c7f","reference_splitter.md":"451a2400"} +{"example_introduction.md":"755c17a3","readme.md":"44d932fc","guide_introduction.md":"f2a6a882","guide_quick-start.md":"f7b2ed7e","example_payment-verification.md":"fe6c0a0f","guide_installation-server.md":"a0ac1cff","guide_installation-client.md":"f6037b38","example_react-example.md":"e5273e61","example_payment-events.md":"e375e10e","intents_custom-backends.md":"48f78982","example_vue-example.md":"6e37dbcd","guide_installation.md":"3f61216c","example_request-payment.md":"716f45d4","intents_introduction.md":"89801b1c","index.md":"15e00ac0","guide_contribution-guide.md":"1598c897","markdown-examples.md":"f0f9a98d","intents_payment-requests.md":"3643330b","reference_app.md":"7a8e6aa1","reference_element-appearance.md":"db1d6d2c","reference_browser-events.md":"9765a3b1","reference_rendezvous.md":"989ac2ee","reference_idempotency.md":"5574edc3","reference_sequencer.md":"3ee4efe6","reference_timelock.md":"a08c7c7f","release-notes.md":"021b76f2","reference_splitter.md":"451a2400","reference_webhook.md":"ee948085"} diff --git a/docs/index.html b/docs/index.html index c8a3b2d..2135a35 100644 --- a/docs/index.html +++ b/docs/index.html @@ -17,7 +17,7 @@
Skip to content

Code SDK

Permissionless micropayments for the web

Build new and exciting experiences that only become possible when you can charge your users as little as 5 cents. Get started in minutes, with no sign up required.

- + \ No newline at end of file diff --git a/docs/intents/custom-backends.html b/docs/intents/custom-backends.html index c1ceaa7..dc58b56 100644 --- a/docs/intents/custom-backends.html +++ b/docs/intents/custom-backends.html @@ -139,7 +139,7 @@ partial: currency: "usd" native_amount: 10.0

This is then signed using the rendezvous key and POSTed to the Code Sequencer's createIntent endpoint.

You can see an example of this in our Python SDK.

- + \ No newline at end of file diff --git a/docs/intents/introduction.html b/docs/intents/introduction.html index e0d7ebe..f39a762 100644 --- a/docs/intents/introduction.html +++ b/docs/intents/introduction.html @@ -23,7 +23,7 @@ Intent -->|1 or more| Actions Actions -->|1 or more| Transactions Transactions -->|1 or more| Instructions

From both the app and SDK point of view, you only need to create an intent and the tooling will take care of the rest.

Example

A user may wish to Withdraw funds from their account, this suggests that the app needs to create transactions for unlocking multiple Timelock accounts and then transfer the funds to a destination account. From a developer perspective, the app only needs to create a Withdraw intent and the tooling will take care of the rest.

We plan to support a wide variety of intents in the future, but for now, we will focus on the most common ones. Specifically, we will focus on the PaymentIntent.

Intent vs. Transaction: The Distinction

  • Creation & Fulfillment: When a user decides to pay another user in the Code app, they're essentially crafting a "payment intent." This isn't a blockchain transaction itself. Instead, it sets in motion a chain of events that culminates in several transactions, ultimately fulfilling that payment intent.

  • The Role of the Code Sequencer: Unlike traditional wallets, the Code app doesn’t directly push transactions onto the blockchain. After an intent is created, the Code app communicates with the Code Sequencer. The Sequencer, equipped with nonce values, assists in breaking down this intent into individual transactions.

  • Signature-based Communication: Transactions formulated within the mobile app are not communicated in their entirety to the Sequencer. Only the signatures are. The Sequencer, aware of the intent type, re-creates these transactions on its end and appends the received signatures. A discrepancy in intent perceptions between the app and Sequencer would invalidate these transactions, assuring alignment and consistency on both ends.

  • Ensuring On-Chain Privacy: Payments are uniquely partitioned into categorized values via the splitter contract. This ensures that while the transactions are visible on-chain, the exact value and intent remain obscured, promoting user privacy.

Why This Matters?

The distinction between an intent and a transaction is more than semantics, it's a foundational shift in approach. It mirrors the functionality of mainstream payment platforms but is tailored for the blockchain, providing several advantages:

  • Future Flexibility: This model paves the way for the introduction of diverse intent types, expanding the app's functionalities.

  • Blockchain Abstraction: The actual blockchain mechanics are abstracted from the user's intent. They specify what they wish to accomplish, and the system handles the underlying complexities.

  • Intent Identification: The intent ID typically corresponds to the rendezvous public key, ensuring a cohesive link with the Rendezvous Key system discussed earlier.

Intents, especially payment intents in the Code app, represent a strategic departure from standard transaction models. By segmenting user intentions from blockchain transactions and intricately linking them with systems like the Rendezvous Key, the Code app promises an efficient, flexible, and private payment experience.

How to Use Intents

The Code app supports many intent types internally and we plan to roll out more in the future. Our initial focus will be on keeping things simple and easy to use. Currently, the SDK only supports a subset of the intents that the app supports.

If you want to get close to the metal you can use the raw @code-wallet/rpc package to create intents that are not yet supported by the SDK but documentation is limited and you won't have the tooling to assist in generating the right transactions.

Proceed to the next section to learn how to create Payment Requests using the SDK.

Example Usage

You can also refer to the examples for more information.

- + \ No newline at end of file diff --git a/docs/intents/payment-requests.html b/docs/intents/payment-requests.html index f46bdc3..44c4c05 100644 --- a/docs/intents/payment-requests.html +++ b/docs/intents/payment-requests.html @@ -11,7 +11,7 @@ - + @@ -36,7 +36,7 @@ Server->>Code Sequencer: POST /v1/createIntent Code Sequencer->>Server: Return PaymentIntent status Server->>Client: Return PaymentIntent's client_secret - Client->>Code Sequencer: Open message stream at rendezvous value

Typically, you'll have a payment button on your website. For example, you might have a button that looks like this:

When a user clicks the button, an invoke event is triggered, allowing you to communicate with your backend; perhaps to check for inventory. On the server side, you'll create a payment intent and return the clientSecret to the browser. This value is then used to generate a rendezvous value on the button.

js
const { button } = code.elements.create('button', { ... });
+  Client->>Code Sequencer: Open message stream at rendezvous value

Typically, you'll have a payment button on your website. For example, you might have a button that looks like this:

When a user clicks the button, an invoke event is triggered, allowing you to communicate with your backend; perhaps to check for inventory. On the server side, you'll create a payment intent and return the clientSecret to the browser. This value is then used to generate a rendezvous value on the button.

js
const { button } = code.elements.create('button', { ... });
 
 ...
 
@@ -131,7 +131,7 @@
     Code Sequencer->>Code Sequencer: Verify and Schedule Transactions
     Code Sequencer->>-Code App: Return confirmation
     Code App->>Client: Open new browser tab with success URL

WARNING

The default browser could be different than the one they came from. Additionally, the user will definitely be redirected to a new tab. This is a limitation of Android and iOS. There is no garantuee that the user will go back to the tab they came from and therefore the on("success", ...) event may not be triggered.

See Confirmation URLs to learn more.

Example

You can find a full example here.

- + \ No newline at end of file diff --git a/docs/markdown-examples.html b/docs/markdown-examples.html index ec3b073..396da84 100644 --- a/docs/markdown-examples.html +++ b/docs/markdown-examples.html @@ -81,7 +81,7 @@ ::: details This is a details block. :::

Output

INFO

This is an info box.

TIP

This is a tip.

WARNING

This is a warning.

DANGER

This is a dangerous warning.

Details

This is a details block.

More

Check out the documentation for the full list of markdown extensions.

- + \ No newline at end of file diff --git a/docs/reference/app.html b/docs/reference/app.html index 3582ab6..2270007 100644 --- a/docs/reference/app.html +++ b/docs/reference/app.html @@ -17,7 +17,7 @@
Skip to content

Code App

Code is a wallet app that leverages self custodial blockchain technology to deliver a seamless payments experience that is instant, global, and private.

Why Code?

Code is the simplest way to send money or pay for things online. The experience is both simple and elegant, so users get all the benefits of self custodial crypto, without any of the complexity of managing private keys, gas fees, and slow or failed transactions.

For peer to peer payments, users can hand each other Digital Paper Cash, or send it through any messenger. For online payments, users can grab a Receipt that is generated by the Micropayments SDK on behalf of the merchant, and with a simple swipe to pay interaction the payment is made instantly.

Code leverages sophisticated blockchain technology to deliver instant, guaranteed payments where the user pays no fees. In addition to this core observable user experience, Code has a layer of privacy where neither the balance nor the transaction history is publicly visible, ensuring user financial confidentiality. We believe this is a fundamental requirement for a payments experience as users shouldn't have to worry about others being able to see their balance or transaction history.

Code Sequencer

Code is able to deliver this experience because of the Code Sequencer, an L2 we've built on Solana.


Learn more at getcode.com.


Don’t have the Code Wallet app yet?

Download It Now.

- + \ No newline at end of file diff --git a/docs/reference/browser-events.html b/docs/reference/browser-events.html index a0d673b..f8e9706 100644 --- a/docs/reference/browser-events.html +++ b/docs/reference/browser-events.html @@ -67,7 +67,7 @@ }); button.mount('#button-container');

Both the success and cancel urls can contain a special INTENT_ID variable, which will be automatically replaced with the intent ID once the payment has been made or cancelled. You can use this on your server to verify the intent status.

Note

These are optional but encouraged, especially on mobile devices where the success event may not be triggered. You can learn more about the differences between desktop and mobile flows on the Payment Requests page.

The full example code can be found on GitHub.

- + \ No newline at end of file diff --git a/docs/reference/element-appearance.html b/docs/reference/element-appearance.html index eec643a..982cbd0 100644 --- a/docs/reference/element-appearance.html +++ b/docs/reference/element-appearance.html @@ -35,7 +35,7 @@ }); button.mount('#button-container'); - + \ No newline at end of file diff --git a/docs/reference/idempotency.html b/docs/reference/idempotency.html index cd8bdb8..4ee0d42 100644 --- a/docs/reference/idempotency.html +++ b/docs/reference/idempotency.html @@ -45,7 +45,7 @@ // to setup a payment with this intent instance. res.send({ clientSecret }); });

See a full example here.


By incorporating the idempotencyKey with specific game and item IDs:

INFO

Since the idempotencyKey is global among all payments, developers should consider incorporating a unique value to further differentiate a payment. For example, use destination address when appropriate or also include a developer-specific random GUID.

- + \ No newline at end of file diff --git a/docs/reference/rendezvous.html b/docs/reference/rendezvous.html index c64ff1b..3eac3aa 100644 --- a/docs/reference/rendezvous.html +++ b/docs/reference/rendezvous.html @@ -23,7 +23,7 @@ +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ | T | C | Fiat | Nonce | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

You can find the payload details here and the communication protocol here.

- + \ No newline at end of file diff --git a/docs/reference/sequencer.html b/docs/reference/sequencer.html index cd230e2..c4110b2 100644 --- a/docs/reference/sequencer.html +++ b/docs/reference/sequencer.html @@ -55,7 +55,7 @@ g --> j h --> j j --> k([Solana])

For example, when a user sends Digital Paper Cash using the Code App, the result is an Intent. The mobile app will eventually compose the intent into several transactions during the life-cycle of the intent.

This follows 4 steps:

  1. Local Simulation: The mobile app will submit the intent to the Code Sequencer. The Code Sequencer will confirm the state transitions are valid based on the global state. If valid, the Code Sequencer will respond with durable nonce values that should be used to sign transactions as part of the intent.
  2. Transaction Submission: Assuming the intent is valid, the Code app will then construct a set of transactions that fulfill the intent and sign them using the provided durable nonces. These transactions get sent as signatures to the Code Sequencer, which then re-constructs the transactions from the original intent. If any of the account values don't line up, the signatures would not be valid and would get rejected by the Sequencer (and Solana).
  3. Transaction Scheduling: If the signatures are valid, the Code Sequencer will update its global state. The transactions are scheduled asynchronously, along with transactions from other users, to be sent to the Solana blockchain.
  4. Confirmation: The Code Sequencer will then send a confirmation to the Code app that the intent has been fulfilled.

This is a highly simplified overview. To learn more, please refer to the Code Privacy Protocol.

- + \ No newline at end of file diff --git a/docs/reference/splitter.html b/docs/reference/splitter.html index f61e45c..289341b 100644 --- a/docs/reference/splitter.html +++ b/docs/reference/splitter.html @@ -129,7 +129,7 @@ a --> f(["`...`"]) a --> |0x1,000,000Kin| h(["`**Account 7** 1,000,000 Kin bills`"])

For example, if Alice is paying Bob 70,212 Kin, then the Code app will split that payment into 7 transactions. Each transaction will be for a different amount, but the sum of all the transactions will equal the original payment amount.

In practice, this requires using the change making algorithm to determine the best way to split the payment. The Code app will then submit each transaction to the Code Sequencer.

Shielded Accounts

We briefly spoke about multiple accounts above for storing a user's total balance. In addition to those accounts, we use two additional accounts for every payment intent. These accounts are called shielded accounts and are used to protect the privacy of the payment amount and the total balance.

Before a payment is made, the amount for that payment is moved to a newly derived outgoing account. This account is then used to make the payment. After the payment is made, the amount is moved to a newly derived incoming account on the recipient side. This account is then used to receive the payment into their denomination accounts.

In practice, this results in roughly ~25 transactions total for a typical payment (including account rotations, denomination movements, re-organizations, etc...). The Code app handles all of this for the user.

You can review the derivation strategy for these accounts under the Timelock section.

Batched Transfers

The final component of our privacy protocol is batched transfers. This is a fairly simple concept. Instead of submitting a transaction to the Solana blockchain for every payment, the Code Sequencer will wait until it has enough similar payments to batch them together. This is done to obscure the association between a user's balance and any transaction.

We have 63 possible payment types, so in practice we wait for at least 1 in 10 transactions to be similar before submitting them to the Solana blockchain.

- + \ No newline at end of file diff --git a/docs/reference/timelock.html b/docs/reference/timelock.html index 0fd63f2..1e68fff 100644 --- a/docs/reference/timelock.html +++ b/docs/reference/timelock.html @@ -61,7 +61,7 @@ throw new Error(`Unknown account type: ${accountType}`); } }

If you'd like to derive your own Timelock accounts, you can use the mnemonic package to do so. However, that is out of the scope of this documentation.

Security Concerns

The on-chain programs are open-source and audited. However, if you find something that would improve the efficacy of the program we welcome and encourage patches but ask that you submit any security concerns privately by using this Report a Vulnerability link.

Disclosures

Please do not disclose security concerns publicly, or through email or twitter, until they have been addressed by the Code team.

- + \ No newline at end of file diff --git a/docs/reference/webhook.html b/docs/reference/webhook.html index 3cf6a76..1bef491 100644 --- a/docs/reference/webhook.html +++ b/docs/reference/webhook.html @@ -143,7 +143,7 @@ res.send({ success: true }); }); - + \ No newline at end of file diff --git a/docs/release-notes.html b/docs/release-notes.html index c68d353..d4d62bf 100644 --- a/docs/release-notes.html +++ b/docs/release-notes.html @@ -17,7 +17,7 @@
- + \ No newline at end of file