Socket
Socket
Sign inDemoInstall

@usecapsule/core-sdk

Package Overview
Dependencies
Maintainers
0
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@usecapsule/core-sdk - npm Package Compare versions

Comparing version 1.22.0 to 1.23.0

9

dist/cjs/index.js

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.capsuleVersion = exports.EmailTheme = exports.PregenIdentifierType = exports.STORAGE_PREFIX = exports.transmissionUtilsRetrieve = exports.decryptPrivateKeyAndDecryptShare = exports.decryptPrivateKey = exports.encryptPrivateKey = exports.getSHA256HashHex = exports.getPublicKeyFromSignature = exports.getDerivedPrivateKeyAndDecrypt = exports.encodePrivateKeyToPemHex = exports.encryptWithDerivedPublicKey = exports.getPublicKeyHex = exports.getAsymmetricKeyPair = exports.decryptWithPrivateKey = exports.decryptWithKeyPair = exports.getBaseUrl = exports.mpcComputationClient = exports.initClient = exports.stringToPhoneNumber = exports.RecoveryStatus = exports.KeyContainer = exports.distributeNewShare = exports.NON_ED25519 = exports.WalletScheme = exports.WalletType = void 0;
exports.capsuleVersion = exports.EmailTheme = exports.getSchemes = exports.PregenIdentifierType = exports.STORAGE_PREFIX = exports.transmissionUtilsRetrieve = exports.decryptPrivateKeyAndDecryptShare = exports.decryptPrivateKey = exports.encryptPrivateKey = exports.getSHA256HashHex = exports.getPublicKeyFromSignature = exports.getDerivedPrivateKeyAndDecrypt = exports.encodePrivateKeyToPemHex = exports.encryptWithDerivedPublicKey = exports.getPublicKeyHex = exports.getAsymmetricKeyPair = exports.decryptWithPrivateKey = exports.decryptWithKeyPair = exports.getBaseUrl = exports.mpcComputationClient = exports.initClient = exports.stringToPhoneNumber = exports.RecoveryStatus = exports.KeyContainer = exports.distributeNewShare = exports.NON_ED25519 = exports.WalletScheme = exports.WalletType = void 0;
const CoreCapsule_js_1 = require("./CoreCapsule.js");
Object.defineProperty(exports, "STORAGE_PREFIX", { enumerable: true, get: function () { return CoreCapsule_js_1.PREFIX; } });
Object.defineProperty(exports, "PregenIdentifierType", { enumerable: true, get: function () { return CoreCapsule_js_1.PregenIdentifierType; } });
Object.defineProperty(exports, "getSchemes", { enumerable: true, get: function () { return CoreCapsule_js_1.getSchemes; } });
var user_management_client_1 = require("@usecapsule/user-management-client");

@@ -41,5 +45,2 @@ Object.defineProperty(exports, "WalletType", { enumerable: true, get: function () { return user_management_client_1.WalletType; } });

Object.defineProperty(exports, "KeyContainer", { enumerable: true, get: function () { return KeyContainer_js_1.KeyContainer; } });
const CoreCapsule_js_1 = require("./CoreCapsule.js");
Object.defineProperty(exports, "STORAGE_PREFIX", { enumerable: true, get: function () { return CoreCapsule_js_1.PREFIX; } });
Object.defineProperty(exports, "PregenIdentifierType", { enumerable: true, get: function () { return CoreCapsule_js_1.PregenIdentifierType; } });
var CoreCapsule_js_2 = require("./CoreCapsule.js");

@@ -46,0 +47,0 @@ Object.defineProperty(exports, "RecoveryStatus", { enumerable: true, get: function () { return CoreCapsule_js_2.RecoveryStatus; } });

@@ -0,1 +1,2 @@

import { CoreCapsule, PREFIX as STORAGE_PREFIX, PregenIdentifierType, getSchemes } from './CoreCapsule.js';
export { WalletType, WalletScheme, NON_ED25519 } from '@usecapsule/user-management-client';

@@ -6,3 +7,2 @@ export * from './definitions.js';

export { KeyContainer } from './shares/KeyContainer.js';
import { CoreCapsule, PREFIX as STORAGE_PREFIX, PregenIdentifierType } from './CoreCapsule.js';
export { RecoveryStatus, stringToPhoneNumber } from './CoreCapsule.js';

@@ -19,5 +19,5 @@ export { initClient } from './external/capsuleClient.js';

export { retrieve as transmissionUtilsRetrieve } from './transmission/transmissionUtils.js';
export { STORAGE_PREFIX, PregenIdentifierType };
export { STORAGE_PREFIX, PregenIdentifierType, getSchemes };
export { EmailTheme } from '@usecapsule/user-management-client';
export const capsuleVersion = CoreCapsule.version;
export default CoreCapsule;
import { EmailTheme, OnRampPurchase, PartnerEntity, WalletEntity, WalletType, WalletScheme } from '@usecapsule/user-management-client';
import { pki } from 'node-forge';
import { Ctx, NetworkProp, OnRampAssetProp, OnRampProviderProp } from './definitions.js';
import { Environment, OAuthMethod } from './definitions.js';
import { FullSignatureRes } from './types/walletTypes.js';
import { Ctx, NetworkProp, OnRampAssetProp, OnRampProviderProp, Environment, OAuthMethod } from './definitions.js';
import { Theme, FullSignatureRes } from './types/index.js';
import { PlatformUtils } from './PlatformUtils.js';
import { Theme } from './types/theme.js';
import { CountryCallingCode } from 'libphonenumber-js';
export declare function getSchemes(supportedWalletTypes: SupportedWalletTypes): WalletScheme[];
type WalletFilters = {

@@ -14,14 +13,9 @@ type?: WalletType[];

};
type EvmType = {
[WalletType.EVM]: true;
};
type SolanaType = {
[WalletType.SOLANA]: true;
};
type CosmosType = {
[WalletType.COSMOS]: {
prefix: string;
export type SupportedWalletTypes = {
[WalletType.EVM]?: true;
[WalletType.SOLANA]?: true;
[WalletType.COSMOS]?: true | {
prefix?: string;
};
};
export type SupportedWalletTypes = EvmType | SolanaType | CosmosType;
export declare enum RecoveryStatus {

@@ -135,3 +129,5 @@ INITIATED = "INITIATED",

/**
* Which type of wallet your application supports, in the form `{ [WalletType]: true }`. Currently allowed values for `WalletType` are `"EVM"`, `"SOLANA"`, or `"COSMOS"`.
* Which type of wallet your application supports, in the form `{ [WalletType]: true }`. Currently allowed values for `WalletType` are `'evm'`, `'solana'`, or `'cosmos'` (case insensitive).
*
* To specify which prefix to use for new Cosmos wallets, pass `{ cosmos: { prefix: 'your-prefix' } }`. Defaults to `'cosmos'`.
*/

@@ -161,3 +157,3 @@ supportedWalletTypes?: SupportedWalletTypes;

/**
* The ids of the currently active wallets. Any signer integrations will default to the first id in this list.
* The IDs of the currently active wallets. Any signer integrations will default to the first viable wallet ID in this list.
*/

@@ -247,2 +243,3 @@ currentWalletIds?: string[];

* Remove all local storage and prefixed session storage.
* @param {'local' | 'session' | 'secure' | 'all'} type - Type of storage to clear. Defaults to 'all'.
*/

@@ -262,5 +259,10 @@ clearStorage: (type?: 'local' | 'session' | 'secure' | 'all') => Promise<void>;

* @param walletId - the ID of the wallet address to display.
* @returns - the wallet address.
* @param options.truncate - whether to truncate the address.
* @returns - the formatted address string.
*/
getDisplayAddress(walletId: string): string;
getDisplayAddress(walletId: string, { truncate }?: {
truncate?: boolean;
} | undefined): string;
getWallets(): Record<string, Wallet>;
getAddress(walletId?: string): string | undefined;
protected abstract getPlatformUtils(): PlatformUtils;

@@ -330,13 +332,17 @@ /**

getPhoneNumber(): string | undefined;
setCurrentWalletIds(currentWalletIds: string[], sessionLookupId?: string): Promise<void>;
get cosmosPrefix(): string | undefined;
setCurrentWalletIds(currentWalletIds: string[], sessionLookupId?: string, needsWallet?: boolean): Promise<void>;
/**
* The prefix for the instance's managed Cosmos wallets. Defaults to `'cosmos'`.
*/
get cosmosPrefix(): string;
/**
* Validates that a wallet ID is present on the instance, usable, and matches the desired filters.
* If no ID is passed, this will instead return the first valid, usable wallet ID that matches the filters.
* @param {string} [walletId] - the wallet ID to validate.
* @param {WalletFilters} [filter] - a `WalletFilters` object specifying allowed types, schemes, and whether to forbid unclaimed pregen wallets.
* @returns {string} - the wallet ID originally passed, or the one found.
* @param {string} [walletId] the wallet ID to validate.
* @param {WalletFilters} [filter={}] a `WalletFilters` object specifying allowed types, schemes, and whether to forbid unclaimed pregen wallets.
* @returns {string} the wallet ID originally passed, or the one found.
*/
findWalletId(walletId?: string, filter?: WalletFilters): string;
private assertIsValidWalletId;
private assertIsValidWalletType;
private getPartnerURL;

@@ -536,2 +542,3 @@ /**

partnerId?: string;
needsWallet?: boolean;
sessionLookupId: string;

@@ -583,3 +590,3 @@ };

**/
createWallet(type?: WalletType, skipDistribute?: boolean, _customFunction?: (params?: any) => void): Promise<[Wallet, string | null]>;
createWallet(_type?: WalletType, skipDistribute?: boolean, _customFunction?: (params?: any) => void): Promise<[Wallet, string | null]>;
/**

@@ -592,3 +599,3 @@ * Creates a new pregenerated wallet.

**/
createWalletPreGen(type: WalletType, pregenIdentifier: string, pregenIdentifierType?: PregenIdentifierType): Promise<Wallet>;
createWalletPreGen(_type: WalletType, pregenIdentifier: string, pregenIdentifierType?: PregenIdentifierType): Promise<Wallet>;
/**

@@ -625,3 +632,3 @@ * Claims a pregenerated wallet.

**/
getPregenWallets(pregenIdentifier: string, pregenIdentifierType?: PregenIdentifierType, expand?: boolean): Promise<WalletEntity[]>;
getPregenWallets(pregenIdentifier: string, pregenIdentifierType?: PregenIdentifierType): Promise<WalletEntity[]>;
private encodeWalletBase64;

@@ -628,0 +635,0 @@ /**

@@ -24,2 +24,3 @@ import Client, { Network, OnRampAsset, OnRampProvider, OnRampPurchase, OnRampPurchaseStatus, WalletScheme, WalletType } from '@usecapsule/user-management-client';

wasmOverride?: ArrayBuffer;
cosmosPrefix?: string;
}

@@ -26,0 +27,0 @@ export declare enum OAuthMethod {

@@ -0,1 +1,2 @@

import { CoreCapsule, PREFIX as STORAGE_PREFIX, PregenIdentifierType, getSchemes } from './CoreCapsule.js';
export { WalletType, WalletScheme, NON_ED25519 } from '@usecapsule/user-management-client';

@@ -7,3 +8,2 @@ export * from './definitions.js';

export { KeyContainer } from './shares/KeyContainer.js';
import { CoreCapsule, PREFIX as STORAGE_PREFIX, PregenIdentifierType } from './CoreCapsule.js';
export { RecoveryStatus, stringToPhoneNumber } from './CoreCapsule.js';

@@ -22,5 +22,5 @@ export type { Wallet, ConstructorOpts, SupportedWalletTypes } from './CoreCapsule.js';

export { retrieve as transmissionUtilsRetrieve } from './transmission/transmissionUtils.js';
export { STORAGE_PREFIX, PregenIdentifierType };
export { STORAGE_PREFIX, PregenIdentifierType, getSchemes };
export { EmailTheme } from '@usecapsule/user-management-client';
export declare const capsuleVersion: string;
export default CoreCapsule;

@@ -9,9 +9,9 @@ /// <reference types="node" />

getPrivateKey(ctx: Ctx, userId: string, walletId: string, share: string, sessionCookie: string): Promise<string>;
keygen(ctx: Ctx, userId: string, secretKey: string | null, // should be acceptable as null in RN as we don't pre-gen them
sessionCookie: string, emailProps?: BackupKitEmailProps, type?: Exclude<WalletType, WalletType.SOLANA>): Promise<{
keygen(ctx: Ctx, userId: string, type: Exclude<WalletType, WalletType.SOLANA>, secretKey: string | null, // should be acceptable as null in RN as we don't pre-gen them
sessionCookie: string, emailProps?: BackupKitEmailProps): Promise<{
signer: string;
walletId: string;
}>;
preKeygen(ctx: Ctx, partnerId: string, pregenIdentifier: string, pregenIdentifierType: PregenIdentifierType, secretKey: string | null, // should be acceptable as null in RN as we don't pre-gen them
sessionCookie: string, type?: Exclude<WalletType, WalletType.SOLANA>): Promise<{
preKeygen(ctx: Ctx, partnerId: string, pregenIdentifier: string, pregenIdentifierType: PregenIdentifierType, type: Exclude<WalletType, WalletType.SOLANA>, secretKey: string | null, // should be acceptable as null in RN as we don't pre-gen them
sessionCookie: string): Promise<{
signer: string;

@@ -18,0 +18,0 @@ walletId: string;

{
"name": "@usecapsule/core-sdk",
"version": "1.22.0",
"version": "1.23.0",
"main": "dist/cjs/index.js",

@@ -14,3 +14,3 @@ "module": "dist/esm/index.js",

"@cosmjs/encoding": "^0.32.4",
"@usecapsule/user-management-client": "1.19.0",
"@usecapsule/user-management-client": "1.20.0",
"base64url": "^3.0.1",

@@ -43,3 +43,3 @@ "buffer": "6.0.3",

},
"gitHead": "2f9f59b43c147849f37d50a136970f56dce05be9"
"gitHead": "530e3c81e17c2027ff82abe9b77abb8d6bf0fd7a"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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