@usecapsule/user-management-client
Advanced tools
Comparing version 1.20.0-dev.2 to 1.20.0-dev.5
@@ -113,2 +113,6 @@ "use strict"; | ||
}); | ||
this.externalWalletLogin = (body) => __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.post(`/users/external-wallets/login`, body); | ||
return res.data; | ||
}); | ||
// POST /users/:userId/verify-email | ||
@@ -234,4 +238,4 @@ this.verifyEmail = (userId, body) => __awaiter(this, void 0, void 0, function* () { | ||
// GET /users/:userId/wallets | ||
this.getWallets = (userId) => __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.get(`/users/${userId}/wallets`); | ||
this.getWallets = (userId, includePartnerData) => __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.get(`/users/${userId}/wallets${includePartnerData ? `?includePartnerData=${encodeURIComponent(includePartnerData)}` : ''}`); | ||
return res; | ||
@@ -565,5 +569,6 @@ }); | ||
} | ||
createOnRampPurchase(userId_1, walletId_1, provider_1, network_1, asset_1) { | ||
return __awaiter(this, arguments, void 0, function* (userId, walletId, provider, network, asset, testMode = false) { | ||
const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/purchases`, { | ||
createOnRampPurchase(_a) { | ||
return __awaiter(this, arguments, void 0, function* ({ userId, walletId, externalWalletAddress, provider, network, asset, testMode = false, }) { | ||
const walletString = walletId ? `wallets/${walletId}` : `external-wallets/${externalWalletAddress}`; | ||
const res = yield this.baseRequest.post(`/users/${userId}/${walletString}/purchases`, { | ||
provider, | ||
@@ -577,11 +582,13 @@ network, | ||
} | ||
updateOnRampPurchase(userId, walletId, purchaseId, updates) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.patch(`/users/${userId}/wallets/${walletId}/purchases/${purchaseId}`, updates); | ||
updateOnRampPurchase(_a) { | ||
return __awaiter(this, arguments, void 0, function* ({ userId, walletId, externalWalletAddress, purchaseId, updates, }) { | ||
const walletString = walletId ? `wallets/${walletId}` : `external-wallets/${externalWalletAddress}`; | ||
const res = yield this.baseRequest.patch(`/users/${userId}/${walletString}/purchases/${purchaseId}`, updates); | ||
return res; | ||
}); | ||
} | ||
getOnRampPurchase(userId, walletId, purchaseId) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.get(`/users/${userId}/wallets/${walletId}/purchases/${purchaseId}`); | ||
getOnRampPurchase(_a) { | ||
return __awaiter(this, arguments, void 0, function* ({ userId, walletId, externalWalletAddress, purchaseId, }) { | ||
const walletString = walletId ? `wallets/${walletId}` : `external-wallets/${externalWalletAddress}`; | ||
const res = yield this.baseRequest.get(`/users/${userId}/${walletString}/purchases/${purchaseId}`); | ||
return res; | ||
@@ -588,0 +595,0 @@ }); |
@@ -107,2 +107,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}); | ||
this.externalWalletLogin = (body) => __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.post(`/users/external-wallets/login`, body); | ||
return res.data; | ||
}); | ||
// POST /users/:userId/verify-email | ||
@@ -228,4 +232,4 @@ this.verifyEmail = (userId, body) => __awaiter(this, void 0, void 0, function* () { | ||
// GET /users/:userId/wallets | ||
this.getWallets = (userId) => __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.get(`/users/${userId}/wallets`); | ||
this.getWallets = (userId, includePartnerData) => __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.get(`/users/${userId}/wallets${includePartnerData ? `?includePartnerData=${encodeURIComponent(includePartnerData)}` : ''}`); | ||
return res; | ||
@@ -559,5 +563,6 @@ }); | ||
} | ||
createOnRampPurchase(userId_1, walletId_1, provider_1, network_1, asset_1) { | ||
return __awaiter(this, arguments, void 0, function* (userId, walletId, provider, network, asset, testMode = false) { | ||
const res = yield this.baseRequest.post(`/users/${userId}/wallets/${walletId}/purchases`, { | ||
createOnRampPurchase(_a) { | ||
return __awaiter(this, arguments, void 0, function* ({ userId, walletId, externalWalletAddress, provider, network, asset, testMode = false, }) { | ||
const walletString = walletId ? `wallets/${walletId}` : `external-wallets/${externalWalletAddress}`; | ||
const res = yield this.baseRequest.post(`/users/${userId}/${walletString}/purchases`, { | ||
provider, | ||
@@ -571,11 +576,13 @@ network, | ||
} | ||
updateOnRampPurchase(userId, walletId, purchaseId, updates) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.patch(`/users/${userId}/wallets/${walletId}/purchases/${purchaseId}`, updates); | ||
updateOnRampPurchase(_a) { | ||
return __awaiter(this, arguments, void 0, function* ({ userId, walletId, externalWalletAddress, purchaseId, updates, }) { | ||
const walletString = walletId ? `wallets/${walletId}` : `external-wallets/${externalWalletAddress}`; | ||
const res = yield this.baseRequest.patch(`/users/${userId}/${walletString}/purchases/${purchaseId}`, updates); | ||
return res; | ||
}); | ||
} | ||
getOnRampPurchase(userId, walletId, purchaseId) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const res = yield this.baseRequest.get(`/users/${userId}/wallets/${walletId}/purchases/${purchaseId}`); | ||
getOnRampPurchase(_a) { | ||
return __awaiter(this, arguments, void 0, function* ({ userId, walletId, externalWalletAddress, purchaseId, }) { | ||
const walletString = walletId ? `wallets/${walletId}` : `external-wallets/${externalWalletAddress}`; | ||
const res = yield this.baseRequest.get(`/users/${userId}/${walletString}/purchases/${purchaseId}`); | ||
return res; | ||
@@ -582,0 +589,0 @@ }); |
@@ -45,2 +45,10 @@ import { AxiosResponse } from 'axios'; | ||
} | ||
export interface ExternalWalletLoginBody { | ||
externalAddress: string; | ||
type: 'EVM' | 'SOLANA' | 'COSMOS'; | ||
externalWalletProvider?: string; | ||
} | ||
export interface ExternalWalletLoginRes { | ||
userId: string; | ||
} | ||
export interface createUserIdRes { | ||
@@ -118,2 +126,4 @@ protocolId: string; | ||
policiesEnabled: boolean; | ||
backgroundColor?: string; | ||
foregroundColor?: string; | ||
} | ||
@@ -227,3 +237,4 @@ export interface WalletEntity { | ||
userId: string; | ||
walletId: string; | ||
walletId?: string | null; | ||
externalWalletAddress?: string | null; | ||
status: OnRampPurchaseStatus; | ||
@@ -242,2 +253,3 @@ provider: OnRampProvider; | ||
checkUserExists: (email: string, phone: string, countryCode: string) => Promise<any>; | ||
externalWalletLogin: (body: ExternalWalletLoginBody) => Promise<ExternalWalletLoginRes>; | ||
verifyEmail: (userId: string, body: verifyBody) => Promise<any>; | ||
@@ -262,3 +274,3 @@ verifyPhone: (userId: string, body: verifyBody) => Promise<any>; | ||
updatePregenWallet: (walletId: string, body: updatePregenWalletBody) => Promise<any>; | ||
getWallets: (userId: string) => Promise<AxiosResponse<getWalletsRes, any>>; | ||
getWallets: (userId: string, includePartnerData?: boolean) => Promise<AxiosResponse<getWalletsRes, any>>; | ||
getAllWallets: (userId: string) => Promise<AxiosResponse<getWalletsRes, any>>; | ||
@@ -316,5 +328,24 @@ setCurrentWalletIds: (userId: string, walletIds: string[], needsWallet?: boolean, sessionLookupId?: string) => Promise<any>; | ||
acceptPendingTransaction(userId: string, pendingTransactionId: 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>>; | ||
createOnRampPurchase({ userId, walletId, externalWalletAddress, provider, network, asset, testMode, }: { | ||
userId: string; | ||
walletId?: string; | ||
externalWalletAddress?: string; | ||
provider: OnRampProvider; | ||
network: Network; | ||
asset: OnRampAsset; | ||
testMode: boolean; | ||
}): Promise<AxiosResponse<OnRampPurchase, any>>; | ||
updateOnRampPurchase({ userId, walletId, externalWalletAddress, purchaseId, updates, }: { | ||
userId: string; | ||
walletId?: string; | ||
externalWalletAddress?: string; | ||
purchaseId: string; | ||
updates: Partial<Pick<OnRampPurchase, 'status' | 'fiatCurrency' | 'fiatQuantity' | 'providerKey'>>; | ||
}): Promise<AxiosResponse<OnRampPurchase, any>>; | ||
getOnRampPurchase({ userId, walletId, externalWalletAddress, purchaseId, }: { | ||
userId: string; | ||
walletId?: string; | ||
externalWalletAddress?: string; | ||
purchaseId: string; | ||
}): Promise<AxiosResponse<OnRampPurchase, any>>; | ||
distributeCapsuleShare({ userId, walletId, ...rest }: { | ||
@@ -321,0 +352,0 @@ userId: string; |
{ | ||
"name": "@usecapsule/user-management-client", | ||
"version": "1.20.0-dev.2", | ||
"version": "1.20.0-dev.5", | ||
"main": "dist/cjs/index.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/esm/index.js", |
77091
1688