diff --git a/CHANGELOG.md b/CHANGELOG.md index b1edf1c..ee9c970 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. +## [1.11.0] - 2024-01-25 +- Rename `onrampToken` parameter to `sessionToken` + ## [1.10.0] - 2024-01-11 - Add `onrampToken` parameter diff --git a/package.json b/package.json index cbe2918..9ce1d06 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@coinbase/cbpay-js", - "version": "1.10.0", + "version": "1.11.0", "license": "MIT", "main": "dist/index.js", "module": "dist/index.mjs", diff --git a/src/onramp/generateOnRampURL.test.ts b/src/onramp/generateOnRampURL.test.ts index 3cdd1b4..3d8101a 100644 --- a/src/onramp/generateOnRampURL.test.ts +++ b/src/onramp/generateOnRampURL.test.ts @@ -15,15 +15,15 @@ describe('generateOnrampURL', () => { expect(url.searchParams.get('appId')).toEqual('test'); }); - it('should support onrampToken', () => { + it('should support sessionToken', () => { const url = new URL( generateOnRampURL({ - onrampToken: 'test', + sessionToken: 'test', }), ); expect(url.origin).toEqual('https://pay.coinbase.com'); expect(url.pathname).toEqual('/buy/select-asset'); - expect(url.searchParams.get('onrampToken')).toEqual('test'); + expect(url.searchParams.get('sessionToken')).toEqual('test'); }); it('generates URL with empty destination wallets', () => { diff --git a/src/onramp/generateOnRampURL.ts b/src/onramp/generateOnRampURL.ts index 1f70cb5..9b5268f 100644 --- a/src/onramp/generateOnRampURL.ts +++ b/src/onramp/generateOnRampURL.ts @@ -2,12 +2,12 @@ import { DEFAULT_HOST } from '../config'; import { OnRampAppParams } from '../types/onramp'; export type GenerateOnRampURLOptions = { - /** This & destinationWallets or onrampToken are required. */ + /** This & destinationWallets or sessionToken are required. */ appId?: string; destinationWallets?: OnRampAppParams['destinationWallets']; host?: string; /** This or appId & destinationWallets are required. */ - onrampToken?: string; + sessionToken?: string; } & Omit; export const generateOnRampURL = ({