diff --git a/src/offramp/generateOffRampURL.test.ts b/src/offramp/generateOffRampURL.test.ts index 608bc1f..dbc8e41 100644 --- a/src/offramp/generateOffRampURL.test.ts +++ b/src/offramp/generateOffRampURL.test.ts @@ -9,7 +9,7 @@ describe('generateOffRampURL', () => { ); expect(url.origin).toEqual('https://pay.coinbase.com'); - expect(url.pathname).toEqual('/v3/offramp/input'); + expect(url.pathname).toEqual('/v3/sell/input'); expect(url.searchParams.get('appId')).toEqual('test'); }); @@ -70,7 +70,7 @@ describe('generateOffRampURL', () => { ); expect(url.origin).toEqual('http://localhost:3000'); - expect(url.pathname).toEqual('/v3/offramp/input'); + expect(url.pathname).toEqual('/v3/sell/input'); expect(url.searchParams.get('appId')).toEqual('test'); }); diff --git a/src/offramp/generateOffRampURL.ts b/src/offramp/generateOffRampURL.ts index 53c615f..c6a98a7 100644 --- a/src/offramp/generateOffRampURL.ts +++ b/src/offramp/generateOffRampURL.ts @@ -13,7 +13,7 @@ export const generateOffRampURL = ({ ...props }: GenerateOffRampURLOptions): string => { const url = new URL(host); - url.pathname = '/v3/offramp/input'; + url.pathname = '/v3/sell/input'; (Object.keys(props) as (keyof typeof props)[]).forEach((key) => { const value = props[key]; diff --git a/src/utils/CBPayInstance.ts b/src/utils/CBPayInstance.ts index 8314fef..1adf8be 100644 --- a/src/utils/CBPayInstance.ts +++ b/src/utils/CBPayInstance.ts @@ -17,7 +17,7 @@ export type CBPayInstanceConstructorArguments = { const widgetRoutes: Record = { buy: '/buy', checkout: '/checkout', - offramp: '/v3/offramp', + offramp: '/v3/sell', }; export interface CBPayInstanceType { diff --git a/src/utils/CoinbasePixel.test.ts b/src/utils/CoinbasePixel.test.ts index 7fc6bae..2bacfd6 100644 --- a/src/utils/CoinbasePixel.test.ts +++ b/src/utils/CoinbasePixel.test.ts @@ -120,11 +120,11 @@ describe('CoinbasePixel', () => { instance.openExperience({ ...defaultOpenOptions, experienceLoggedIn: 'new_tab', - path: '/v3/offramp', + path: '/v3/sell', }); expect(window.chrome.tabs.create).toHaveBeenCalledWith({ - url: 'https://pay.coinbase.com/v3/offramp/input?addresses=%7B%220x0%22%3A%5B%22ethereum%22%5D%7D&appId=test', + url: 'https://pay.coinbase.com/v3/sell/input?addresses=%7B%220x0%22%3A%5B%22ethereum%22%5D%7D&appId=test', }); }); @@ -146,11 +146,11 @@ describe('CoinbasePixel', () => { instance.openExperience({ ...defaultOpenOptions, experienceLoggedIn: 'popup', - path: '/v3/offramp', + path: '/v3/sell', }); expect(window.open).toHaveBeenCalledWith( - 'https://pay.coinbase.com/v3/offramp/input?addresses=%7B%220x0%22%3A%5B%22ethereum%22%5D%7D&appId=test', + 'https://pay.coinbase.com/v3/sell/input?addresses=%7B%220x0%22%3A%5B%22ethereum%22%5D%7D&appId=test', 'Coinbase', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, height=730,width=460', ); @@ -174,11 +174,11 @@ describe('CoinbasePixel', () => { instance.openExperience({ ...defaultOpenOptions, experienceLoggedIn: 'new_tab', - path: '/v3/offramp', + path: '/v3/sell', }); expect(window.open).toHaveBeenCalledWith( - 'https://pay.coinbase.com/v3/offramp/input?addresses=%7B%220x0%22%3A%5B%22ethereum%22%5D%7D&appId=test', + 'https://pay.coinbase.com/v3/sell/input?addresses=%7B%220x0%22%3A%5B%22ethereum%22%5D%7D&appId=test', 'Coinbase', undefined, ); diff --git a/src/utils/CoinbasePixel.ts b/src/utils/CoinbasePixel.ts index 2e6d507..3cf41cb 100644 --- a/src/utils/CoinbasePixel.ts +++ b/src/utils/CoinbasePixel.ts @@ -75,7 +75,7 @@ export class CoinbasePixel { const experience = experienceLoggedOut || experienceLoggedIn; let url = ''; - if (options.path === '/v3/offramp') { + if (options.path === '/v3/sell') { url = generateOffRampURL({ appId: this.appId, host: this.host,