Skip to content

Releases: code-payments/code-sdk

v1.6.0 UX & Tips Relase

09 Apr 18:17
Compare
Choose a tag to compare
Pre-release

What's Changed

This release primarily adds the ability to tip Code Wallet users that have linked their X/Twitter account with a Code Wallet. The scannable codes are persistent and can be printed out on a physical card. They are not unique to each invoke.

Note: This release is part of a larger release and is still under internal testing/development on the mobile app and sequencer sides.

Tip Card Example

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

// Note: the user must have a Code account and have their X account
// connected. The Code Wallet app will show an error message if the user
// does not have a connected X account.

const username = 'elonmusk';
const name = 'x'; // or 'twitter' (if you prefer)

const options = {
  mode: 'tip',
  platform: {
    username,
    name,
  }
}

const { button } = code.elements.create('button', options);

button.mount('#button-container');

Page Flows

Additionally, this release adds the ability to create the Code Wallet card pages directly, without having to use a button. This allows you to create a custom button or interaction that takes the user directly to the card view.

To use this flow, simply replace:
const { button } = code.elements.create('button', options);

with this:
const { page } = code.elements.create('page', options);

Pull Requests

Full Changelog: v1.5.0...v1.6.0

v1.5.0 UX & Fees Feature Release

29 Feb 20:26
768bbc2
Compare
Choose a tag to compare

What's Changed

Simplified UI

This release overhauls the UI elements. In general, less text is used to reduce cognitive load.

image

More Packages

Additionally, many quality of life improvements were made by splitting up the larger packages into smaller ones. This should help improve the packages going forward, as well as make it easier for contributors to get started.

This release includes the following new packages:

Note: the @code-sdk/library package has been deprecated.

Payment Fees

Beyond this, merchant fees have been added. This means you can now take a basis point cut from a payment. Simply add a fee section.

For example,

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

const { button } = code.elements.create('button', {
  currency: 'usd',
  destination: '...',
  amount: 0.25,
  fees: [
    {
      destination: `E8otxw1CVX9bfyddKu3ZB3BVLa4VVF9J7CTPdnUwT9jR`,
      basisPoints: 1000, // take a 10% cut, 2.5 cents in this case
    }
  ],
});

button.mount('#button-container');

Pull requests

Full Changelog: v0.1.4.3...v1.5.0

v1.4.3 Login Feature Release

31 Jan 18:02
Compare
Choose a tag to compare

What's Changed

Example Login Usage

For more information on the new login feature, view the payment with login or login examples:

Quickstart

Live preview: https://example-getcode.com/

  import * as code from "@code-wallet/client";
  import express from "express";

  const app = express();
  const verifier = Keypair.generate();
  const domain = "example-getcode.com";
  
  app.post('/create-intent', async (req, res) => {
    const { clientSecret, id } = await code.loginIntents.create({
      login: {
        verifier: verifier.getPublicKey().toBase58(),
        domain: hostname,
      },
      signers: [ verifier ],
    });
    
    res.send({ clientSecret });
  })
  
  ... 
  
  const status = await code.getStatus({ intent });
  const user   = await code.getUserId({ intent, verifier });

image

Major changes to RPC client

This release unlocks nearly all API request over standard HTTP POST calls. The @code-wallet/client library exports a new lower-level client so that Code SDK users can access almost everything the app has access to (except for bidi streams). Access to bidi streams can be had over Websockets or GRPC using the @code-wallet/rpc library directly.

See example usage of the low level client here:
https://github.com/code-payments/code-sdk/blob/main/packages/client/test/client.test.ts#L12-L19

All RPC APIs can be found here:
https://github.com/code-payments/code-protobuf-api/tree/main

New Contributors

Full Changelog: v1.2.0...v0.1.4.3

v1.2.0 Early/Preview Login Feature Release

09 Jan 19:45
Compare
Choose a tag to compare

What's Changed

  • Updated RPC Services by @zfedoran in #13
  • Feature: Request Login with Payment by @zfedoran in #14
  • Added DebugMobile user agent for debugging mobile flows on desktop in 3aa1d89

Full Changelog: v1.1.2...v1.2.0

Release Files

https://raw.githubusercontent.com/code-wallet/code-sdk/public-http/v1/elements.6c6db02.js

v1.1.2 Library, Client, and Elements Release

08 Nov 16:36
Compare
Choose a tag to compare

Primarily a bug fix release.

What's Changed

  • Updated docs
  • Fix for "Failed to execute 'fetch' on 'Window': Illegal invocation" by @zfedoran in #3
  • Change to px values to avoid rem bug in issue-5 by @zfedoran in #5
  • Fix for invalid addresses in issue-7 by @zfedoran in #7
  • Fix for "Unable to request Kin amount" by @zfedoran in #10

Full Changelog: v1.1.0...v1.1.2

Release Files

v1.1.0 Elements Release

31 Oct 17:40
Compare
Choose a tag to compare

What's Changed

  • Mobile and Desktop modals now report configuration issues to the user
  • Added elements on('error', ...) handling for: amount limits, destination account, paid intents
  • WebSocket connection timeouts are now automatically handled with a fadeout from the modal state
  • Updated durable nonce documentation
  • Update idempotency.md by @geoffwhittington in #1

New Contributors

Full Changelog: v1.0.0...v1.1.0

Release Files