@usecapsule/user-management-client
Advanced tools
Comparing version 1.18.0-dev.0 to 1.18.0
@@ -26,3 +26,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.OnRampPurchaseStatus = exports.OnRampAsset = exports.OnRampProvider = exports.KeyType = exports.EncryptorType = exports.Chain = exports.SignatureScheme = exports.PublicKeyType = exports.PublicKeyStatus = exports.EmailTheme = exports.USER_NOT_MATCHING_ERROR = exports.USER_NOT_AUTHENTICATED_ERROR = exports.USER_NOT_VERIFIED = void 0; | ||
exports.OnRampPurchaseStatus = exports.OnRampAsset = exports.OnRampProvider = exports.Network = exports.KeyType = exports.EncryptorType = exports.Chain = exports.SignatureScheme = exports.PublicKeyType = exports.PublicKeyStatus = exports.EmailTheme = exports.USER_NOT_MATCHING_ERROR = exports.USER_NOT_AUTHENTICATED_ERROR = exports.USER_NOT_VERIFIED = void 0; | ||
const axios_1 = __importDefault(require("axios")); | ||
@@ -70,2 +70,10 @@ const qs_1 = __importDefault(require("qs")); | ||
}; | ||
var Network; | ||
(function (Network) { | ||
Network["ETHEREUM"] = "ETHEREUM"; | ||
Network["ARBITRUM"] = "ARBITRUM"; | ||
Network["BASE"] = "BASE"; | ||
Network["OPTIMISM"] = "OPTIMISM"; | ||
Network["POLYGON"] = "POLYGON"; | ||
})(Network || (exports.Network = Network = {})); | ||
var OnRampProvider; | ||
@@ -80,2 +88,3 @@ (function (OnRampProvider) { | ||
OnRampAsset["USDC"] = "USDC"; | ||
OnRampAsset["POLYGON"] = "POLYGON"; | ||
})(OnRampAsset || (exports.OnRampAsset = OnRampAsset = {})); | ||
@@ -223,7 +232,2 @@ var OnRampPurchaseStatus; | ||
}); | ||
// POST /users/:userId/wallets/:walletId/set | ||
this.setCurrentWalletId = (userId, walletId, sessionLookupId) => __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/set`, { sessionLookupId }); | ||
return res; | ||
}); | ||
// POST /login | ||
@@ -385,4 +389,4 @@ this.login = (props) => __awaiter(this, void 0, void 0, function* () { | ||
resendVerificationCode(_a) { | ||
var { userId } = _a, rest = __rest(_a, ["userId"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var { userId } = _a, rest = __rest(_a, ["userId"]); | ||
const res = yield this.baseRequest.post(`/users/${userId}/resend-verification-code`, rest); | ||
@@ -394,4 +398,4 @@ return res; | ||
resendVerificationCodeByPhone(_a) { | ||
var { userId } = _a, rest = __rest(_a, ["userId"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var { userId } = _a, rest = __rest(_a, ["userId"]); | ||
const res = yield this.baseRequest.post(`/users/${userId}/resend-verification-code-by-phone`, rest); | ||
@@ -522,5 +526,5 @@ return res; | ||
} | ||
acceptScopes(userId, walletId, body) { | ||
acceptScopes(userId, body) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/scopes/accept`, body); | ||
const res = yield this.baseRequest.post(`/users/${userId}/scopes/accept`, body); | ||
return res; | ||
@@ -541,12 +545,13 @@ }); | ||
} | ||
getPolicyPermissions(userId, policyId, walletId) { | ||
getPolicyPermissions(userId, policyId) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.get(`/users/${userId}/policies/${policyId}/permissions${walletId ? `?walletId=${walletId}` : ''}`); | ||
const res = yield this.baseRequest.get(`/users/${userId}/policies/${policyId}/permissions`); | ||
return res; | ||
}); | ||
} | ||
createOnRampPurchase(userId_1, walletId_1, provider_1, asset_1) { | ||
return __awaiter(this, arguments, void 0, function* (userId, walletId, provider, asset, testMode = false) { | ||
createOnRampPurchase(userId, walletId, provider, network, asset, testMode = false) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/purchases`, { | ||
provider, | ||
network, | ||
asset, | ||
@@ -571,4 +576,4 @@ testMode, | ||
distributeCapsuleShare(_a) { | ||
var { userId, walletId } = _a, rest = __rest(_a, ["userId", "walletId"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var { userId, walletId } = _a, rest = __rest(_a, ["userId", "walletId"]); | ||
const body = rest; | ||
@@ -610,8 +615,2 @@ const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/capsule-share/distribute`, body); | ||
} | ||
getEthToUsdConversionRate() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.get('/ethToUsdConversionRate'); | ||
return res.data; | ||
}); | ||
} | ||
} | ||
@@ -618,0 +617,0 @@ exports.default = Client; |
@@ -63,2 +63,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}; | ||
export var Network; | ||
(function (Network) { | ||
Network["ETHEREUM"] = "ETHEREUM"; | ||
Network["ARBITRUM"] = "ARBITRUM"; | ||
Network["BASE"] = "BASE"; | ||
Network["OPTIMISM"] = "OPTIMISM"; | ||
Network["POLYGON"] = "POLYGON"; | ||
})(Network || (Network = {})); | ||
export var OnRampProvider; | ||
@@ -73,2 +81,3 @@ (function (OnRampProvider) { | ||
OnRampAsset["USDC"] = "USDC"; | ||
OnRampAsset["POLYGON"] = "POLYGON"; | ||
})(OnRampAsset || (OnRampAsset = {})); | ||
@@ -216,7 +225,2 @@ export var OnRampPurchaseStatus; | ||
}); | ||
// POST /users/:userId/wallets/:walletId/set | ||
this.setCurrentWalletId = (userId, walletId, sessionLookupId) => __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/set`, { sessionLookupId }); | ||
return res; | ||
}); | ||
// POST /login | ||
@@ -378,4 +382,4 @@ this.login = (props) => __awaiter(this, void 0, void 0, function* () { | ||
resendVerificationCode(_a) { | ||
var { userId } = _a, rest = __rest(_a, ["userId"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var { userId } = _a, rest = __rest(_a, ["userId"]); | ||
const res = yield this.baseRequest.post(`/users/${userId}/resend-verification-code`, rest); | ||
@@ -387,4 +391,4 @@ return res; | ||
resendVerificationCodeByPhone(_a) { | ||
var { userId } = _a, rest = __rest(_a, ["userId"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var { userId } = _a, rest = __rest(_a, ["userId"]); | ||
const res = yield this.baseRequest.post(`/users/${userId}/resend-verification-code-by-phone`, rest); | ||
@@ -515,5 +519,5 @@ return res; | ||
} | ||
acceptScopes(userId, walletId, body) { | ||
acceptScopes(userId, body) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/scopes/accept`, body); | ||
const res = yield this.baseRequest.post(`/users/${userId}/scopes/accept`, body); | ||
return res; | ||
@@ -534,12 +538,13 @@ }); | ||
} | ||
getPolicyPermissions(userId, policyId, walletId) { | ||
getPolicyPermissions(userId, policyId) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.get(`/users/${userId}/policies/${policyId}/permissions${walletId ? `?walletId=${walletId}` : ''}`); | ||
const res = yield this.baseRequest.get(`/users/${userId}/policies/${policyId}/permissions`); | ||
return res; | ||
}); | ||
} | ||
createOnRampPurchase(userId_1, walletId_1, provider_1, asset_1) { | ||
return __awaiter(this, arguments, void 0, function* (userId, walletId, provider, asset, testMode = false) { | ||
createOnRampPurchase(userId, walletId, provider, network, asset, testMode = false) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/purchases`, { | ||
provider, | ||
network, | ||
asset, | ||
@@ -564,4 +569,4 @@ testMode, | ||
distributeCapsuleShare(_a) { | ||
var { userId, walletId } = _a, rest = __rest(_a, ["userId", "walletId"]); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var { userId, walletId } = _a, rest = __rest(_a, ["userId", "walletId"]); | ||
const body = rest; | ||
@@ -603,8 +608,2 @@ const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/capsule-share/distribute`, body); | ||
} | ||
getEthToUsdConversionRate() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.get('/ethToUsdConversionRate'); | ||
return res.data; | ||
}); | ||
} | ||
} | ||
@@ -611,0 +610,0 @@ export default Client; |
@@ -0,1 +1,2 @@ | ||
import { AxiosResponse } from 'axios'; | ||
export declare const USER_NOT_VERIFIED = "user must verify biometrics"; | ||
@@ -176,2 +177,9 @@ export declare const USER_NOT_AUTHENTICATED_ERROR = "user must be authenticated"; | ||
}; | ||
export declare enum Network { | ||
ETHEREUM = "ETHEREUM", | ||
ARBITRUM = "ARBITRUM", | ||
BASE = "BASE", | ||
OPTIMISM = "OPTIMISM", | ||
POLYGON = "POLYGON" | ||
} | ||
export declare enum OnRampProvider { | ||
@@ -183,3 +191,4 @@ RAMP = "RAMP", | ||
ETHEREUM = "ETHEREUM", | ||
USDC = "USDC" | ||
USDC = "USDC", | ||
POLYGON = "POLYGON" | ||
} | ||
@@ -227,4 +236,3 @@ export declare enum OnRampPurchaseStatus { | ||
updatePregenWallet: (walletId: string, body: updatePregenWalletBody) => Promise<any>; | ||
getWallets: (userId: string) => Promise<any>; | ||
setCurrentWalletId: (userId: string, walletId: string, sessionLookupId?: string) => Promise<any>; | ||
getWallets: (userId: string) => Promise<AxiosResponse<getWalletsRes, any>>; | ||
login: (props: { | ||
@@ -256,30 +264,30 @@ email: string; | ||
userId: string; | ||
} & VerificationEmailProps): Promise<import("axios").AxiosResponse<any, any>>; | ||
} & VerificationEmailProps): Promise<AxiosResponse<any, any>>; | ||
resendVerificationCodeByPhone({ userId, ...rest }: { | ||
userId: string; | ||
} & VerificationEmailProps): Promise<import("axios").AxiosResponse<any, any>>; | ||
cancelRecoveryAttempt(email: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
check2FAStatus(userId: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
enable2FA(userId: string, verificationCode: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
setup2FA(userId: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
initializeRecovery(email: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
initializeFarcasterLogin(): Promise<import("axios").AxiosResponse<any, any>>; | ||
getFarcasterAuthStatus(): Promise<import("axios").AxiosResponse<any, any>>; | ||
initializeRecoveryForPhone(phone: string, countryCode: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
finalizeRecovery(userId: string, walletId: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
recoverUserShares(userId: string, walletId: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
verifyEmailForRecovery(email: string, verificationCode: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
verifyPhoneForRecovery(phone: string, countryCode: string, verificationCode: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
verify2FA(email: string, verificationCode: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
verify2FAForPhone(phone: string, countryCode: string, verificationCode: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
tempTrasmissionInit(message: string, userId?: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
tempTrasmission(id: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
getPartner(partnerId: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
acceptScopes(userId: string, walletId: string, body: AcceptScopesBody): Promise<import("axios").AxiosResponse<any, any>>; | ||
getPendingTransaction(userId: string, pendingTransactionid: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
acceptPendingTransaction(userId: string, pendingTransactionId: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
getPolicyPermissions(userId: string, policyId: string, walletId?: string): Promise<import("axios").AxiosResponse<any, any>>; | ||
createOnRampPurchase(userId: string, walletId: string, provider: OnRampProvider, asset: OnRampAsset, testMode?: boolean): Promise<import("axios").AxiosResponse<OnRampPurchase, any>>; | ||
updateOnRampPurchase(userId: string, walletId: string, purchaseId: string, updates: Partial<Pick<OnRampPurchase, 'status' | 'fiatCurrency' | 'fiatQuantity' | 'providerKey'>>): Promise<import("axios").AxiosResponse<OnRampPurchase, any>>; | ||
getOnRampPurchase(userId: string, walletId: string, purchaseId: string): Promise<import("axios").AxiosResponse<OnRampPurchase, any>>; | ||
} & VerificationEmailProps): Promise<AxiosResponse<any, any>>; | ||
cancelRecoveryAttempt(email: string): Promise<AxiosResponse<any, any>>; | ||
check2FAStatus(userId: string): Promise<AxiosResponse<any, any>>; | ||
enable2FA(userId: string, verificationCode: string): Promise<AxiosResponse<any, any>>; | ||
setup2FA(userId: string): Promise<AxiosResponse<any, any>>; | ||
initializeRecovery(email: string): Promise<AxiosResponse<any, any>>; | ||
initializeFarcasterLogin(): Promise<AxiosResponse<any, any>>; | ||
getFarcasterAuthStatus(): Promise<AxiosResponse<any, any>>; | ||
initializeRecoveryForPhone(phone: string, countryCode: string): Promise<AxiosResponse<any, any>>; | ||
finalizeRecovery(userId: string, walletId: string): Promise<AxiosResponse<any, any>>; | ||
recoverUserShares(userId: string, walletId: string): Promise<AxiosResponse<any, any>>; | ||
verifyEmailForRecovery(email: string, verificationCode: string): Promise<AxiosResponse<any, any>>; | ||
verifyPhoneForRecovery(phone: string, countryCode: string, verificationCode: string): Promise<AxiosResponse<any, any>>; | ||
verify2FA(email: string, verificationCode: string): Promise<AxiosResponse<any, any>>; | ||
verify2FAForPhone(phone: string, countryCode: string, verificationCode: string): Promise<AxiosResponse<any, any>>; | ||
tempTrasmissionInit(message: string, userId?: string): Promise<AxiosResponse<any, any>>; | ||
tempTrasmission(id: string): Promise<AxiosResponse<any, any>>; | ||
getPartner(partnerId: string): Promise<AxiosResponse<any, any>>; | ||
acceptScopes(userId: string, body: AcceptScopesBody): Promise<AxiosResponse<any, any>>; | ||
getPendingTransaction(userId: string, pendingTransactionid: string): Promise<AxiosResponse<any, any>>; | ||
acceptPendingTransaction(userId: string, pendingTransactionId: string): Promise<AxiosResponse<any, any>>; | ||
getPolicyPermissions(userId: string, policyId: string): Promise<AxiosResponse<any, any>>; | ||
createOnRampPurchase(userId: string, walletId: string, provider: OnRampProvider, network: Network, asset: OnRampAsset, testMode?: boolean): Promise<AxiosResponse<OnRampPurchase, any>>; | ||
updateOnRampPurchase(userId: string, walletId: string, purchaseId: string, updates: Partial<Pick<OnRampPurchase, 'status' | 'fiatCurrency' | 'fiatQuantity' | 'providerKey'>>): Promise<AxiosResponse<OnRampPurchase, any>>; | ||
getOnRampPurchase(userId: string, walletId: string, purchaseId: string): Promise<AxiosResponse<OnRampPurchase, any>>; | ||
distributeCapsuleShare({ userId, walletId, ...rest }: { | ||
@@ -289,3 +297,3 @@ userId: string; | ||
useDKLS: boolean; | ||
} & BackupKitEmailProps): Promise<import("axios").AxiosResponse<any, any>>; | ||
} & BackupKitEmailProps): Promise<AxiosResponse<any, any>>; | ||
keepSessionAlive(userId: string): Promise<any>; | ||
@@ -306,4 +314,3 @@ persistRecoveryPublicKeys(userId: string, publicKeys: string[]): Promise<{ | ||
getEncryptedWalletPrivateKeys(userId: string, encryptionKeyHash: string): Promise<any>; | ||
getEthToUsdConversionRate(): Promise<any>; | ||
} | ||
export default Client; |
{ | ||
"name": "@usecapsule/user-management-client", | ||
"version": "1.18.0-dev.0", | ||
"version": "1.18.0", | ||
"main": "dist/cjs/index.js", | ||
@@ -33,3 +33,3 @@ "module": "dist/esm/index.js", | ||
}, | ||
"gitHead": "962c7753e53753785cea67e8b676eaa4c4c92dd0" | ||
"gitHead": "becb455c08a189bd8bc049df1f80e6095912bf55" | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1569
1
71281