Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@coinbase/cbpay-js

Package Overview
Dependencies
Maintainers
12
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coinbase/cbpay-js - npm Package Compare versions

Comparing version 2.2.1 to 2.3.0

3

CHANGELOG.md

@@ -5,2 +5,5 @@ # Changelog

## [2.3.0] - 2024-10-21
- Add Offramp support with `generateOffRampURL` and `initOffRamp` functions
## [2.2.1] - 2024-08-01

@@ -7,0 +10,0 @@ - Added `redirectUrl` widget parameter

2

dist/index.d.ts

@@ -129,3 +129,3 @@ type DestinationWallet = {

type WidgetType = 'buy' | 'checkout';
type WidgetType = 'buy' | 'checkout' | 'sell';
/**

@@ -132,0 +132,0 @@ * Note: Two factor authentication does not work in an iframe, so the embedded experience should not be used. It will

@@ -459,2 +459,26 @@ "use strict";

}, "formatPostMessage");
// src/offramp/generateOffRampURL.ts
var generateOffRampURL = /* @__PURE__ */ __name(function(_param) {
var _param_host = _param.host, host = _param_host === void 0 ? DEFAULT_HOST : _param_host, props = _object_without_properties(_param, [
"host"
]);
var url = new URL(host);
url.pathname = "/v3/sell/input";
Object.keys(props).forEach(function(key) {
var value = props[key];
if (value !== void 0) {
if ([
"string",
"number",
"boolean"
].includes(typeof value === "undefined" ? "undefined" : _type_of(value))) {
url.searchParams.append(key, value.toString());
} else {
url.searchParams.append(key, JSON.stringify(value));
}
}
});
url.searchParams.sort();
return url.toString();
}, "generateOffRampURL");
// src/utils/CoinbasePixel.ts

@@ -489,9 +513,20 @@ var PopupSizes = {

var experience = experienceLoggedOut || experienceLoggedIn;
var url = generateOnRampURL(_object_spread({
appId: _this.appId,
host: _this.host,
theme: _nullishCoalesce(_this.theme, function() {
return void 0;
})
}, _this.appParams));
var url = "";
if (options.path === "/v3/sell") {
url = generateOffRampURL(_object_spread({
appId: _this.appId,
host: _this.host,
theme: _nullishCoalesce(_this.theme, function() {
return void 0;
})
}, _this.appParams));
} else {
url = generateOnRampURL(_object_spread({
appId: _this.appId,
host: _this.host,
theme: _nullishCoalesce(_this.theme, function() {
return void 0;
})
}, _this.appParams));
}
_this.log("Opening experience", {

@@ -819,3 +854,4 @@ experience: experience

buy: "/buy",
checkout: "/checkout"
checkout: "/checkout",
sell: "/v3/sell"
};

@@ -822,0 +858,0 @@ var CBPayInstance = function CBPayInstance(options) {

{
"name": "@coinbase/cbpay-js",
"repository": "https://github.com/coinbase/cbpay-js",
"version": "2.2.1",
"version": "2.3.0",
"license": "MIT",

@@ -6,0 +6,0 @@ "main": "dist/index.js",

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc