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.3 to 0.0.4

7

CHANGELOG.md
# @funkit/api-base
## 0.0.4
### Patch Changes
- 3a65cb2: feat: new checkout state
- 10819e5: feat: deactivate checkout api
## 0.0.3

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

13

dist/src/services/assets/endpoints.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getWalletLidoWithdrawalsByChainId = exports.getAllWalletNFTsByChainId = exports.getAllWalletNFTs = exports.getAllWalletTokensByChainId = exports.getAllWalletTokens = exports.getAssetPriceInfo = void 0;
exports.getAssetPriceInfo = getAssetPriceInfo;
exports.getAllWalletTokens = getAllWalletTokens;
exports.getAllWalletTokensByChainId = getAllWalletTokensByChainId;
exports.getAllWalletNFTs = getAllWalletNFTs;
exports.getAllWalletNFTsByChainId = getAllWalletNFTsByChainId;
exports.getWalletLidoWithdrawalsByChainId = getWalletLidoWithdrawalsByChainId;
const consts_1 = require("../../consts");

@@ -24,3 +29,2 @@ const utils_1 = require("../../utils");

}
exports.getAssetPriceInfo = getAssetPriceInfo;
/**

@@ -39,3 +43,2 @@ * Get all tokens for a given wallet address

}
exports.getAllWalletTokens = getAllWalletTokens;
/**

@@ -55,3 +58,2 @@ * Get all tokens for a given wallet address on a specific chain

}
exports.getAllWalletTokensByChainId = getAllWalletTokensByChainId;
/**=======================

@@ -71,3 +73,2 @@ * POTENTIAL DEPRECATION

}
exports.getAllWalletNFTs = getAllWalletNFTs;
/**

@@ -85,3 +86,2 @@ * Get all the NFTs owned by a wallet on a specific chain

}
exports.getAllWalletNFTsByChainId = getAllWalletNFTsByChainId;
/**

@@ -99,3 +99,2 @@ * Get all lido withdrawal request ids for a wallet address on a specific chain

}
exports.getWalletLidoWithdrawalsByChainId = getWalletLidoWithdrawalsByChainId;
//# sourceMappingURL=endpoints.js.map
import { Address } from 'viem';
import { CheckoutHistoryItem, CheckoutInitParams, CheckoutQuoteParams, CheckoutQuoteResponse, CheckoutTransferSponsorshipParams, CheckoutTransferSponsorshipResponse } from './types';
import { CheckoutDeactivateParams, CheckoutHistoryItem, CheckoutInitParams, CheckoutQuoteParams, CheckoutQuoteResponse, CheckoutTransferSponsorshipParams, CheckoutTransferSponsorshipResponse } from './types';
/**

@@ -25,2 +25,3 @@ * Gets a checkout quote (estimation).

export declare function initializeCheckout({ userOp, quoteId, sourceOfFund, apiKey, clientMetadata, }: CheckoutInitParams): Promise<Address>;
export declare function deactivateCheckout({ depositAddress, apiKey, }: CheckoutDeactivateParams): Promise<boolean>;
/**

@@ -27,0 +28,0 @@ * Gets a checkout given a depositAddress

@@ -6,3 +6,9 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.getPaymasterDataForCheckoutSponsoredTransfer = exports.getCheckoutsByRecipientAddress = exports.getCheckoutsByFunWalletAddress = exports.getCheckoutByDepositAddress = exports.initializeCheckout = exports.getCheckoutQuote = void 0;
exports.getCheckoutQuote = getCheckoutQuote;
exports.initializeCheckout = initializeCheckout;
exports.deactivateCheckout = deactivateCheckout;
exports.getCheckoutByDepositAddress = getCheckoutByDepositAddress;
exports.getCheckoutsByFunWalletAddress = getCheckoutsByFunWalletAddress;
exports.getCheckoutsByRecipientAddress = getCheckoutsByRecipientAddress;
exports.getPaymasterDataForCheckoutSponsoredTransfer = getPaymasterDataForCheckoutSponsoredTransfer;
const big_js_1 = __importDefault(require("big.js"));

@@ -12,2 +18,3 @@ const consts_1 = require("../../consts");

const utils_1 = require("../../utils");
const types_1 = require("./types");
/**

@@ -79,3 +86,2 @@ * Gets a checkout quote (estimation).

}
exports.getCheckoutQuote = getCheckoutQuote;
/**

@@ -106,3 +112,18 @@ * Initializes a checkout

}
exports.initializeCheckout = initializeCheckout;
async function deactivateCheckout({ depositAddress, apiKey, }) {
try {
await (0, utils_1.sendPostRequest)({
uri: `${consts_1.API_BASE_URL}/checkout/${depositAddress}`,
body: {
// Fixed state to cancel the checkout
state: types_1.CheckoutState.CANCELLED,
},
apiKey,
});
return true;
}
catch (err) {
throw new Error('Unable to deactivate checkout');
}
}
/**

@@ -128,3 +149,2 @@ * Gets a checkout given a depositAddress

}
exports.getCheckoutByDepositAddress = getCheckoutByDepositAddress;
/**

@@ -143,3 +163,2 @@ * Gets all checkouts associated with a funWallet

}
exports.getCheckoutsByFunWalletAddress = getCheckoutsByFunWalletAddress;
/**

@@ -158,3 +177,2 @@ * Gets all checkouts associated with a recipient address

}
exports.getCheckoutsByRecipientAddress = getCheckoutsByRecipientAddress;
async function getPaymasterDataForCheckoutSponsoredTransfer({ depositAddress, transferUserOp, apiKey, }) {

@@ -176,3 +194,2 @@ const body = {

}
exports.getPaymasterDataForCheckoutSponsoredTransfer = getPaymasterDataForCheckoutSponsoredTransfer;
//# sourceMappingURL=endpoints.js.map

@@ -55,2 +55,9 @@ /**===============*

export type CheckoutInitResponse = Address;
/**=====================*
* CHECKOUT DEACTIVATE *
*======================*/
export type CheckoutDeactivateParams = {
depositAddress: Address;
apiKey: string;
};
export declare enum CheckoutState {

@@ -67,3 +74,4 @@ FROM_UNFUNDED = "FROM_UNFUNDED",

CHECKOUT_ERROR = "CHECKOUT_ERROR",
EXPIRED = "EXPIRED"
EXPIRED = "EXPIRED",
CANCELLED = "CANCELLED"
}

@@ -70,0 +78,0 @@ export type CheckoutHistoryItem = {

@@ -20,3 +20,4 @@ "use strict";

CheckoutState["EXPIRED"] = "EXPIRED";
CheckoutState["CANCELLED"] = "CANCELLED";
})(CheckoutState || (exports.CheckoutState = CheckoutState = {}));
//# sourceMappingURL=types.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAssetFromFaucet = void 0;
exports.getAssetFromFaucet = getAssetFromFaucet;
const consts_1 = require("../../consts");

@@ -12,3 +12,2 @@ const utils_1 = require("../../utils");

}
exports.getAssetFromFaucet = getAssetFromFaucet;
//# sourceMappingURL=endpoints.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.meshExecuteTransfer = exports.meshPreviewTransfer = exports.meshGetLinkToken = exports.meshGetTransferIntegrations = exports.meshGetCryptocurrencyHoldings = void 0;
exports.meshGetCryptocurrencyHoldings = meshGetCryptocurrencyHoldings;
exports.meshGetTransferIntegrations = meshGetTransferIntegrations;
exports.meshGetLinkToken = meshGetLinkToken;
exports.meshPreviewTransfer = meshPreviewTransfer;
exports.meshExecuteTransfer = meshExecuteTransfer;
const consts_1 = require("../../consts");

@@ -19,3 +23,2 @@ const utils_1 = require("../../utils");

}
exports.meshGetCryptocurrencyHoldings = meshGetCryptocurrencyHoldings;
/**

@@ -31,3 +34,2 @@ * @return https://docs.meshconnect.com/reference/get_api-v1-transfers-managed-integrations

}
exports.meshGetTransferIntegrations = meshGetTransferIntegrations;
/**

@@ -61,3 +63,2 @@ * @param userId A unique Id representing the end user. Typically this will be a user Id from the

}
exports.meshGetLinkToken = meshGetLinkToken;
/**

@@ -110,3 +111,2 @@ * @param fromAuthToken The authentication token to send the asset from.

}
exports.meshPreviewTransfer = meshPreviewTransfer;
/**

@@ -132,3 +132,2 @@ *

}
exports.meshExecuteTransfer = meshExecuteTransfer;
//# sourceMappingURL=endpoints.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMoonpayOnRampSupportedCurrencies = exports.getMoonpayOffRampUrl = exports.getMoonpayOnRampUrl = exports.getMoonpayBuyQuoteForCreditCard = exports.getMoonpayUrlSignature = void 0;
exports.getMoonpayUrlSignature = getMoonpayUrlSignature;
exports.getMoonpayBuyQuoteForCreditCard = getMoonpayBuyQuoteForCreditCard;
exports.getMoonpayOnRampUrl = getMoonpayOnRampUrl;
exports.getMoonpayOffRampUrl = getMoonpayOffRampUrl;
exports.getMoonpayOnRampSupportedCurrencies = getMoonpayOnRampSupportedCurrencies;
const consts_1 = require("../../consts");

@@ -18,3 +22,2 @@ const errors_1 = require("../../errors");

}
exports.getMoonpayUrlSignature = getMoonpayUrlSignature;
async function getMoonpayBuyQuoteForCreditCard({ currencyCode, baseCurrencyCode, quoteCurrencyAmount, baseCurrencyAmount, extraFeePercentage, areFeesIncluded, apiKey, }) {

@@ -43,3 +46,2 @@ const params = new URLSearchParams({

}
exports.getMoonpayBuyQuoteForCreditCard = getMoonpayBuyQuoteForCreditCard;
/**=======================

@@ -62,3 +64,2 @@ * POTENTIAL DEPRECATION

}
exports.getMoonpayOnRampUrl = getMoonpayOnRampUrl;
async function getMoonpayOffRampUrl({ walletAddr, apiKey, }) {

@@ -74,3 +75,2 @@ const url = (await (0, utils_1.sendGetRequest)({

}
exports.getMoonpayOffRampUrl = getMoonpayOffRampUrl;
async function getMoonpayOnRampSupportedCurrencies({ apiKey, }) {

@@ -86,3 +86,2 @@ const currencies = await (0, utils_1.sendGetRequest)({

}
exports.getMoonpayOnRampSupportedCurrencies = getMoonpayOnRampSupportedCurrencies;
//# sourceMappingURL=endpoints.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sendSupportMessage = void 0;
exports.sendSupportMessage = sendSupportMessage;
const consts_1 = require("../../consts");

@@ -20,3 +20,2 @@ const utils_1 = require("../../utils");

}
exports.sendSupportMessage = sendSupportMessage;
//# sourceMappingURL=endpoints.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createTurnkeyPrivateKey = exports.createTurnkeySubOrg = void 0;
exports.createTurnkeySubOrg = createTurnkeySubOrg;
exports.createTurnkeyPrivateKey = createTurnkeyPrivateKey;
const consts_1 = require("../../consts");

@@ -14,3 +15,2 @@ const utils_1 = require("../../utils");

}
exports.createTurnkeySubOrg = createTurnkeySubOrg;
async function createTurnkeyPrivateKey({ signedRequest, apiKey, }) {

@@ -27,3 +27,2 @@ const res = await (0, utils_1.sendPostRequest)({

}
exports.createTurnkeyPrivateKey = createTurnkeyPrivateKey;
//# sourceMappingURL=endpoints.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.roundToNearestBottomTenth = exports.generateRandomCheckoutSalt = exports.randomBytes = void 0;
exports.randomBytes = randomBytes;
exports.generateRandomCheckoutSalt = generateRandomCheckoutSalt;
exports.roundToNearestBottomTenth = roundToNearestBottomTenth;
const viem_1 = require("viem");

@@ -12,11 +14,8 @@ function randomBytes(length) {

}
exports.randomBytes = randomBytes;
function generateRandomCheckoutSalt() {
return BigInt(randomBytes(32));
}
exports.generateRandomCheckoutSalt = generateRandomCheckoutSalt;
function roundToNearestBottomTenth(n) {
return Math.floor(n / 10) * 10;
}
exports.roundToNearestBottomTenth = roundToNearestBottomTenth;
//# sourceMappingURL=checkout.js.map

@@ -26,3 +26,7 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.sendPutRequest = exports.sendDeleteRequest = exports.sendPostRequest = exports.sendGetRequest = exports.sendRequest = void 0;
exports.sendRequest = void 0;
exports.sendGetRequest = sendGetRequest;
exports.sendPostRequest = sendPostRequest;
exports.sendDeleteRequest = sendDeleteRequest;
exports.sendPutRequest = sendPutRequest;
const attempt_1 = require("@lifeomic/attempt");

@@ -99,3 +103,2 @@ const viem_1 = require("viem");

}
exports.sendGetRequest = sendGetRequest;
async function sendPostRequest({ uri, body, apiKey, retryOptions, }) {

@@ -110,3 +113,2 @@ return await (0, exports.sendRequest)({

}
exports.sendPostRequest = sendPostRequest;
async function sendDeleteRequest({ uri, apiKey, retryOptions, }) {

@@ -120,3 +122,2 @@ await (0, exports.sendRequest)({

}
exports.sendDeleteRequest = sendDeleteRequest;
async function sendPutRequest({ uri, body, apiKey, retryOptions, }) {

@@ -131,3 +132,2 @@ return await (0, exports.sendRequest)({

}
exports.sendPutRequest = sendPutRequest;
//# sourceMappingURL=request.js.map
{
"name": "@funkit/api-base",
"version": "0.0.3",
"version": "0.0.4",
"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

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

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

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