What's Changed
Simplified UI
This release overhauls the UI elements. In general, less text is used to reduce cognitive load.
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:
- @code-sdk/currency
- @code-sdk/flags
- @code-sdk/intents
- @code-sdk/keys
- @code-sdk/kikcode
- @code-sdk/proxy
- @code-sdk/views
- @code-sdk/web
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