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

@funkit/api-base

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@funkit/api-base - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

7

CHANGELOG.md
# @funkit/api-base
## 0.0.5
### Patch Changes
- 5f70055: refactor: update checkout/quote and checkout/update endpoints
- 5f70055: feat: add new endpoint getCheckoutsByUserId
## 0.0.4

@@ -4,0 +11,0 @@

12

dist/src/services/checkout/endpoints.d.ts

@@ -16,3 +16,3 @@ import { Address } from 'viem';

*/
export declare function getCheckoutQuote({ fromChainId, fromTokenAddress, fromTokenDecimals, toChainId, toTokenAddress, toTokenDecimals, toTokenAmount, expirationTimestampMs, sponsorInitialTransferGasLimit, recipientAddr, needsRefuel, apiKey, }: CheckoutQuoteParams): Promise<CheckoutQuoteResponse>;
export declare function getCheckoutQuote({ fromChainId, fromTokenAddress, fromTokenDecimals, toChainId, toTokenAddress, toTokenDecimals, toTokenAmount, expirationTimestampMs, sponsorInitialTransferGasLimit, recipientAddr, needsRefuel, userId, apiKey, }: CheckoutQuoteParams): Promise<CheckoutQuoteResponse>;
/**

@@ -57,2 +57,12 @@ * Initializes a checkout

}): Promise<CheckoutHistoryItem[]>;
/**
* Gets all checkouts associated with a funkit userId string
* @param userId A userId string.
* @param apiKey A valid fun api key.
* @returns A list of checkout objects if exists. Otherwise, an empty array.
*/
export declare function getCheckoutsByUserId({ userId, apiKey, }: {
userId: string;
apiKey: string;
}): Promise<CheckoutHistoryItem[]>;
export declare function getPaymasterDataForCheckoutSponsoredTransfer({ depositAddress, transferUserOp, apiKey, }: CheckoutTransferSponsorshipParams): Promise<CheckoutTransferSponsorshipResponse>;

@@ -12,2 +12,3 @@ "use strict";

exports.getCheckoutsByRecipientAddress = getCheckoutsByRecipientAddress;
exports.getCheckoutsByUserId = getCheckoutsByUserId;
exports.getPaymasterDataForCheckoutSponsoredTransfer = getPaymasterDataForCheckoutSponsoredTransfer;

@@ -32,3 +33,3 @@ const big_js_1 = __importDefault(require("big.js"));

*/
async function getCheckoutQuote({ fromChainId, fromTokenAddress, fromTokenDecimals, toChainId, toTokenAddress, toTokenDecimals, toTokenAmount, expirationTimestampMs, sponsorInitialTransferGasLimit, recipientAddr, needsRefuel, apiKey, }) {
async function getCheckoutQuote({ fromChainId, fromTokenAddress, fromTokenDecimals, toChainId, toTokenAddress, toTokenDecimals, toTokenAmount, expirationTimestampMs, sponsorInitialTransferGasLimit, recipientAddr, needsRefuel, userId, apiKey, }) {
try {

@@ -38,2 +39,3 @@ const toMultipler = 10 ** toTokenDecimals;

const queryParams = {
userId,
fromChainId,

@@ -115,3 +117,3 @@ fromTokenAddress,

await (0, utils_1.sendPostRequest)({
uri: `${consts_1.API_BASE_URL}/checkout/${depositAddress}`,
uri: `${consts_1.API_BASE_URL}/checkout/update/${depositAddress}`,
body: {

@@ -175,2 +177,15 @@ // Fixed state to cancel the checkout

}
/**
* Gets all checkouts associated with a funkit userId string
* @param userId A userId string.
* @param apiKey A valid fun api key.
* @returns A list of checkout objects if exists. Otherwise, an empty array.
*/
async function getCheckoutsByUserId({ userId, apiKey, }) {
const res = await (0, utils_1.sendGetRequest)({
uri: `${consts_1.API_BASE_URL}/checkout/userId/${userId}`,
apiKey,
});
return res || [];
}
async function getPaymasterDataForCheckoutSponsoredTransfer({ depositAddress, transferUserOp, apiKey, }) {

@@ -177,0 +192,0 @@ const body = {

@@ -15,2 +15,3 @@ /**===============*

refuel: string;
userId: string;
recipientAddr?: Address;

@@ -17,0 +18,0 @@ };

2

package.json
{
"name": "@funkit/api-base",
"version": "0.0.4",
"version": "0.0.5",
"description": "Base API for Funkit",

@@ -5,0 +5,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

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