@coinbase/cbpay-js
Advanced tools
Comparing version 1.10.0 to 2.1.0
@@ -5,2 +5,8 @@ # Changelog | ||
## [2.1.0] - 2024-03-14 | ||
- Add `theme` parameter | ||
## [2.0.0] - 2024-01-25 | ||
- [BREAKING CHANGE] Rename `onrampToken` parameter to `sessionToken` | ||
## [1.10.0] - 2024-01-11 | ||
@@ -7,0 +13,0 @@ - Add `onrampToken` parameter |
@@ -40,12 +40,2 @@ declare type DestinationWallet = { | ||
declare type GenerateOnRampURLOptions = { | ||
/** This & destinationWallets or onrampToken are required. */ | ||
appId?: string; | ||
destinationWallets?: OnRampAppParams['destinationWallets']; | ||
host?: string; | ||
/** This or appId & destinationWallets are required. */ | ||
onrampToken?: string; | ||
} & Omit<OnRampAppParams, 'destinationWallets'>; | ||
declare const generateOnRampURL: ({ host, destinationWallets, ...otherParams }: GenerateOnRampURLOptions) => string; | ||
declare type OpenEvent = { | ||
@@ -78,2 +68,3 @@ eventName: 'open'; | ||
declare type Experience = 'embedded' | 'popup' | 'new_tab'; | ||
declare type Theme = 'light' | 'dark'; | ||
declare type EmbeddedContentStyles = { | ||
@@ -92,2 +83,3 @@ target?: string; | ||
debug?: boolean; | ||
theme?: Theme; | ||
onExit?: (error?: Error) => void; | ||
@@ -104,2 +96,13 @@ onSuccess?: () => void; | ||
declare type GenerateOnRampURLOptions = { | ||
/** This & destinationWallets or sessionToken are required. */ | ||
appId?: string; | ||
destinationWallets?: OnRampAppParams['destinationWallets']; | ||
host?: string; | ||
/** This or appId & destinationWallets are required. */ | ||
sessionToken?: string; | ||
theme?: Theme; | ||
} & Omit<OnRampAppParams, 'destinationWallets'>; | ||
declare const generateOnRampURL: ({ host, destinationWallets, ...otherParams }: GenerateOnRampURLOptions) => string; | ||
/** | ||
@@ -138,2 +141,3 @@ Matches a JSON object. | ||
debug?: boolean; | ||
theme?: Theme; | ||
}; | ||
@@ -140,0 +144,0 @@ |
@@ -372,3 +372,3 @@ "use strict"; | ||
var CoinbasePixel = function CoinbasePixel(param) { | ||
var _host = param.host, host = _host === void 0 ? DEFAULT_HOST : _host, appId = param.appId, appParams = param.appParams, onReady = param.onReady, onFallbackOpen = param.onFallbackOpen, debug = param.debug; | ||
var _host = param.host, host = _host === void 0 ? DEFAULT_HOST : _host, appId = param.appId, appParams = param.appParams, onReady = param.onReady, onFallbackOpen = param.onFallbackOpen, debug = param.debug, theme = param.theme; | ||
var _this = this; | ||
@@ -415,2 +415,5 @@ _classCallCheck(this, CoinbasePixel); | ||
widgetUrl.searchParams.append("type", "secure_standalone"); | ||
if (_this.theme) { | ||
widgetUrl.searchParams.append("theme", _this.theme); | ||
} | ||
var experience = _this.isLoggedIn ? experienceLoggedIn : experienceLoggedOut || experienceLoggedIn; | ||
@@ -932,2 +935,3 @@ widgetUrl.searchParams.append("nonce", nonce); | ||
this.debug = debug || false; | ||
this.theme = theme; | ||
this.addPixelReadyListener(); | ||
@@ -1042,3 +1046,4 @@ this.addErrorListener(); | ||
appId: options.appId, | ||
host: options.host | ||
host: options.host, | ||
theme: options.theme | ||
}, widgetParameters)); | ||
@@ -1045,0 +1050,0 @@ window.open(url); |
{ | ||
"name": "@coinbase/cbpay-js", | ||
"version": "1.10.0", | ||
"version": "2.1.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -68,3 +68,3 @@ # @coinbase/cbpay-js | ||
let onrampInstance; | ||
const instance = initOnRamp(options, (error, instance) => { | ||
initOnRamp(options, (error, instance) => { | ||
onrampInstance = instance; | ||
@@ -71,0 +71,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
143248
1745
0