/** * Facilitates interaction with the auth server. * * @class */ declare class AuthServer { constructor(sdk: ShelfNetwork, serverUrl: string, opts: { allowHttp?: boolean; proxy?: any; httpBasicAuth?: any; customHeaders?: any; withCredentials?: boolean; responseType?: string; }); /** * Get a JWT token using credentials. * * @param {string} email Email. * @param {string} password Password. * @param {string} [platformId] User's platform ID. * * @return {Promise.} */ getToken(email: string, password: string, platformId?: string): Promise; /** * Refresh a JWT token. * * @param {string} [token] JWT token to be refreshed. The token attached to the sdk instance will be used by default. * * @return {Promise.} */ refreshToken(token?: string): Promise; /** * Change the password. * * @param {string} oldPassword Old user's password. * @param {string} newPassword Desired password. * * @return {Promise.} */ changePassword(oldPassword: string, newPassword: string): Promise; /** * Request password recovery. * * @param {string} email User's email. * * @return {Promise.} */ requestRecovery(email: string): Promise; /** * Confirm the password recovery. * * @param {string} accountId User's account ID. * @param {string} token Recovery token from the email. * @param {string} newPassword Desired password. * * @return {Promise.} */ confirmRecovery(accountId: string, token: string, newPassword: string): Promise; /** * Create credentials. * * @param {string} password Desired password. * @param {string} [accountId] User's account ID. * @return {Promise.} */ createCredentials(password: string, accountId?: string): Promise; } /** * User's token. */ declare class Token { constructor(jwtToken: string); /** * Encoded JWT token. * * @type {string} */ rawJWT: string; /** * User's account ID. * * @type {string} */ accountId: string; /** * User's account type. * * @type {string} */ accountType: string; /** * User's platform ID. * * @type {string} */ platformId: string; /** * Token payload. * * @type {string} */ payload: string; } /** * Facilitates interaction with the AZRY leasing server. * * @class */ declare class AzryLeasingServer { constructor(sdk: ShelfNetwork, serverUrl: string, opts: { allowHttp?: boolean; proxy?: any; httpBasicAuth?: any; customHeaders?: any; withCredentials?: boolean; }); /** * Get multiple leasing statements * * @param {string} opts.sort Sort requests by: created_at, updated_at, lot_end_time * @param {string} opts.status Filter by request status: created, confirmed * @param {string} opts.lotId Filter by lot id * @param {string} opts.clientId Filter by user account id */ getStatements(): void; /** * Get leasing statement by ID. * * @param {string} lotId Lot ID. * @param {string} clientId User accound ID * @param {object} opts Request misc options * @param {string} opts.status Request status * @param {string} opts.sort Sort by created_at/updated_at * * @return {JsonApiResponse} */ getStatement(lotId: string, clientId: string, opts: { status: string; sort: string; }): JsonApiResponse; /** * Get multiple fees. * * @param {object} attributes Leasing statement attributes. * @param {string} attributes.initialInstallment Initial payment. * @param {string} attributes.amount Estimated price of the lot. * @param {string} attributes.currency Leasing currency. * @param {string} attributes.paymentsNumber Desired number of payments. * @param {string} attributes.clientId User's account ID. * @param {string} attributes.clientNationalId User's national ID. * @param {string} attributes.clientName User's full name. * @param {string} attributes.clientPhoneNumber User's phone number. * @param {string} attributes.lotId Lot ID * @param {string} attributes.lotLink Link to the lot. * * @return {JsonApiResponse} */ createStatement(attributes: { initialInstallment: string; amount: string; currency: string; paymentsNumber: string; clientId: string; clientNationalId: string; clientName: string; clientPhoneNumber: string; lotId: string; lotLink: string; }): JsonApiResponse; } /** * `Memo` represents memos attached to transactions. Use static methods to create memos. * * @see [Transactions concept](https://www.stellar.org/developers/learn/concepts/transactions.html) * @class Memo */ declare class Memo { /** * Returns an empty memo (`MEMO_NONE`). * @returns {xdr.Memo} */ static none(): xdr.Memo; /** * Creates and returns a `MEMO_TEXT` memo. * @param {string} text - memo text * @returns {xdr.Memo} */ static text(text: string): xdr.Memo; /** * Creates and returns a `MEMO_ID` memo. * @param {string} id - 64-bit number represented as a string * @returns {xdr.Memo} */ static id(id: string): xdr.Memo; /** * Creates and returns a `MEMO_HASH` memo. * @param {array|string} hash - 32 byte hash or hex encoded string * @returns {xdr.Memo} */ static hash(hash: array | string): xdr.Memo; /** * Creates and returns a `MEMO_RETURN` memo. * @param {array|string} hash - 32 byte hash or hex encoded string * @returns {xdr.Memo} */ static returnHash(hash: array | string): xdr.Memo; } /** * Contains passphrases for common networks: * * `Networks.PUBLIC`: `Public Global Stellar Network ; September 2015` * * `Networks.TESTNET`: `Test SDF Network ; September 2015` * @type {{PUBLIC: string, TESTNET: string}} */ declare var Networks: any; /** * Lot types. */ declare var lotTypes: any; /** * Auction close actions. */ declare var closeAuctionActions: any; /** * Manage participant actions. */ declare var manageParticipantActions: any; /** * Review request actions. */ declare var reviewRequestActions: any; /** * Reviewable request types. */ declare var reviewableRequestTypes: any; /** * Account types. */ declare var accountTypes: any; /** * `Operation` class represents [operations](https://www.stellar.org/developers/learn/concepts/operations.html) in Stellar network. * Use one of static methods to create operations: * * `{@link Operation.createAccount}` * * `{@link Operation.payment}` * * `{@link Operation.pathPayment}` * * `{@link Operation.manageOffer}` * * `{@link Operation.createPassiveOffer}` * * `{@link Operation.setOptions}` * * `{@link Operation.changeTrust}` * * `{@link Operation.allowTrust}` * * `{@link Operation.accountMerge}` * * `{@link Operation.inflation}` * * @class Operation */ declare class Operation { /** * Create and fund a non existent account. * @param {object} opts * @param {string} opts.destination - Destination account ID to create an account for. * @param {string} opts.platformId - id of platform account belongs to * @param {xdr.AccountType} opts.accountType - account type * @param {string} [opts.source] - The source account for the payment. Defaults to the transaction's source account. * @returns {xdr.CreateAccountOp} */ static createAccount(opts: { destination: string; platformId: string; accountType: xdr.AccountType; source?: string; }): xdr.CreateAccountOp; /** * Creates a lot. * * @param {object} opts Operation options. * @param {string} opts.requestId Lot creation request ID. * @param {string} opts.type Lot type. * @param {string} opts.startPrice Start price. * @param {string} opts.minStep Minimum bid step. * @param {string} opts.maxStep Maximum bid step. * @param {string} opts.duration Auction duration in seconds. * @param {string} opts.details Lot details. * @param {boolean} [opts.buyNowSupport] Allow "buy now" feature for this lot. * @param {string} [opts.buyNowPrice] "Buy now" price. * @param {string} [opts.deposit] Required deposit amount. * @param {string} opts.startTime Auction start time. * @param {string} opts.currency Lot's currency. * * @return {Operation} */ static createLot(opts: { requestId: string; type: string; startPrice: string; minStep: string; maxStep: string; duration: string; details: string; buyNowSupport?: boolean; buyNowPrice?: string; deposit?: string; startTime: string; currency: string; }): Operation; /** * Approve or reject reviewable request * * @param {object} opts * @param {string} opts.requestId - id of reviewable request * @param {string} opts.hash - hash of the body a request (need this to ensure that we review what we expect) * @param {string} opts.requestType - type of the request to review * @param {string} opts.action - on of the {approve, reject, permanentReject} * @param {string} opts.rejectReason - reason of reject or permanent reject (for approve pass empty string) */ static reviewRequest(opts: { requestId: string; hash: string; requestType: string; action: string; rejectReason: string; }): void; /** * CancelRequestOp * cancels request with a given id. * Only creator of the request is allowed to perform this operation. * * @param {string} opts.requestId - id of the request to cancel * @param {string} opts.source - source of the operation * @return {xdr.Operation} */ static cancelRequest(): xdr.Operation; /** * Request "buy now". * * @param {object} opts * @param {string} opts.lotId ID of the lot to be bought. * * @return {xdr.RequestBuyNowOp} */ static requestBuyNow(opts: { lotId: string; }): xdr.RequestBuyNowOp; /** * Create a recovery op. * * @param {object} opts * @param {string} opts.account - The target account to recover * @param {string} opts.newSigner - Signer to recover to. * @param {string} [opts.source] - The source account for the payment. Defaults to the transaction's source account. * @returns {xdr.RecoverOp} */ static recover(opts: { account: string; newSigner: string; source?: string; }): xdr.RecoverOp; /** * Create a bid. * * @param {object} opts Operation options. * @param {string} opts.lotId ID of the lot. * @param {string} opts.amount Amount of the bid. * * @return {Operation} */ static createBid(opts: { lotId: string; amount: string; }): Operation; /** * Leave a message for the lot. * * @param {object} opts Operation options. * @param {string} opts.lotId The lot to which this message is assigned to. * @param {string} opts.receiverId accountId of the receiver. * @param {string} opts.text Message content. * * @return {Operation} * */ static sendMessage(opts: { lotId: string; receiverId: string; text: string; }): Operation; /** * Returns an XDR SetOptionsOp. A "set options" operations set or clear account flags, * set the account's inflation destination, and/or add new signers to the account. * The account flags are the xdr.AccountFlags enum, which are: * - AUTH_REQUIRED_FLAG = 0x1 * - AUTH_REVOCABLE_FLAG = 0x2 * @param {object} opts * @param {string} [opts.inflationDest] - Set this account ID as the account's inflation destination. * @param {number} [opts.clearFlags] - Bitmap integer for which flags to clear. * @param {number} [opts.setFlags] - Bitmap integer for which flags to set. * @param {number} [opts.masterWeight] - The master key weight. * @param {number} [opts.lowThreshold] - The sum weight for the low threshold. * @param {number} [opts.medThreshold] - The sum weight for the medium threshold. * @param {number} [opts.highThreshold] - The sum weight for the high threshold. * @param {object} [opts.signer] - Add or remove a signer from the account. The signer is * deleted if the weight is 0. * @param {string} [opts.signer.address] - The address of the new signer. * @param {number} [opts.signer.weight] - The weight of the new signer (0 to delete or 1-255) * @param {string} [opts.homeDomain] - sets the home domain used for reverse federation lookup. * @param {string} [opts.source] - The source account (defaults to transaction source). * @returns {xdr.SetOptionsOp} */ static setOptions(opts: { inflationDest?: string; clearFlags?: number; setFlags?: number; masterWeight?: number; lowThreshold?: number; medThreshold?: number; highThreshold?: number; signer?: { address?: string; weight?: number; }; homeDomain?: string; source?: string; }): xdr.SetOptionsOp; /** * Make a request to participate in an auction. * * @param {object} opts Operation options. * @param {string} opts.lotId ID of the lot. * @param {boolean} opts.isBuyNow do buy now after registration * * @return {Operation} */ static requestParticipation(opts: { lotId: string; isBuyNow: boolean; }): Operation; /** * Close the auction. * * @param {object} opts Operation options. * @param {string} opts.lotId ID of the lot. * @param {string} opts.action Auction resolution action. * * @return {xdr.CloseAuctionOp} */ static closeAuction(opts: { lotId: string; action: string; }): xdr.CloseAuctionOp; /** * Manage participant. * * @param {object} opts Operation options. * @param {string} opts.lotId ID of the lot. * @param {string} opts.action Participant manage action. * @param {string} opts.accountId Participant's account ID. * * @return {xdr.manageParticipantOp} */ static manageParticipant(opts: { lotId: string; action: string; accountId: string; }): xdr.manageParticipantOp; /** * Converts the XDR Operation object to the opts object used to create the XDR * operation. * @param {xdr.Operation} operation - An XDR Operation. * @return {Operation} */ static operationToObject(operation: xdr.Operation): Operation; } /** * Use this flag to check if fast signing (provided by `ed25519` package) is available. * If your app is signing a large number of transaction or verifying a large number * of signatures make sure `ed25519` package is installed. */ declare var FastSigning: any; /** * Creates a new {@link CallBuilder}. * * @param {axios} axios Instance of axios. * @param {Wallet} wallet User's wallet. * * @class CallBuilder */ declare class CallBuilder { constructor(axios: axios, wallet: Wallet); /** * Append URL segment. * * @param {(string|number|string[])} segment URL path segment(s). * @param {object} [opts] Options. * @param {boolean} [opts.base64=false] Treat segment as a base64-encoded value. * * @return {CallBuilder} Self. */ appendUrlSegment(segment: string | number | string[], opts?: { base64?: boolean; }): CallBuilder; /** * Append an account ID to the URL. * Uses wallet's account ID by default. * * @param {string} [accountId] Custom account ID. * @return {CallBuilder} Self. */ appendAccountId(accountId?: string): CallBuilder; /** * Attach token to this request. * * @param {Token} [opts.token] Use another token for the request. * @param {Wallet} [opts.wallet] Use another wallet for signature. Deprecated. * * @return {CallBuilder} Self. */ withCredentials(): CallBuilder; /** * Attach token to this request if any were provided. * * @param {Token} [opts.token] Use another token for the request. * @param {Wallet} [opts.wallet] Use another wallet for signature. Deprecated. * * @return {CallBuilder} Self. */ withOptionalCredentials(): CallBuilder; /** * Set a request timeout. * * @param {Number} timeout Request timeout. * @return {CallBuilder} Self. */ withTimeout(timeout: number): CallBuilder; /** * Set custom headers for the request. * * @param {object} headers Headers to send along the request. */ withHeaders(headers: any): void; /** * Perform a POST request. * * @param {Object} [data] Request body. * @return {Promise} Request result. */ post(data?: any): Promise; /** * Perform a GET request. * * @param {Object} [query] Request body. * @return {Promise} Request result. */ get(query?: any): Promise; /** * Perform a PUT request. * * @param {Object} [data] Request body. * @return {Promise} Request result. */ put(data?: any): Promise; /** * Perform a PATCH request. * * @param {Object} [data] Request body. * @return {Promise} Request result. */ patch(data?: any): Promise; /** * Perform a DELETE request. * * @param {Object} [data] Request body. * @return {Promise} Request result. */ delete(data?: any): Promise; } declare module CallBuilder { /** * Creates a CallBuilder instance. * * @constructor * @param {Object} axios Axios.js instance. * @param {ShelfNetwork} [sdk] ShelfNetwork SDK instance. */ class CallBuilder { constructor(axios: any, sdk?: ShelfNetwork); } } /** * Facilitates interaction with the cart server. * * @class */ declare class CartServer { constructor(sdk: ShelfNetwork, serverUrl: string, opts: { allowHttp?: boolean; proxy?: any; httpBasicAuth?: any; customHeaders?: any; withCredentials?: boolean; responseType?: string; }); /** * Create service. * * @param {string} name Service name. * @param {Number} price Service price. * * @return {Promise.} Cart response. */ createService(name: string, price: number): Promise; /** * Update service. * * @param {string} name Service name. * @param {Number} price Service price. * * @return {Promise.} Cart response. */ updateService(name: string, price: number): Promise; /** * Delete service. * * @param {string} name Service name. * * @return {Promise.} Cart response. */ deleteService(name: string): Promise; /** * Create request. * * @param {string} opts * @param {string} opts.service Service name. * @param {string} [opts.accountId] Account ID of requestor. * @param {string} [opts.token] Request token. The meaning of token is specific for each service. * @param {Number} [opts.lotId] ID of the lot that service is requested for. * @param {string} [opts.email] Email (for unauthorized users). * @param {Object} [opts.details] Request details. * * @return {Promise.} Cart response. */ createRequest(opts: { service: string; accountId?: string; token?: string; lotId?: number; email?: string; details?: any; }): Promise; /** * Set documents. * * @param {Number} id Request ID. * @param {string[]} documents Document IDs. * * @return {Promise.} Cart response. */ setDocuments(id: number, documents: string[]): Promise; /** * Set links. * * @param {Number} id Request ID. * @param {string[]} links Links to documents. * * @return {Promise.} Cart response. */ setLinks(id: number, links: string[]): Promise; /** * Get services. * * @return {Promise.} Cart response. */ getServices(): Promise; /** * Get carfax reports count. * * @param {string} vin Vin code. * * @return {Promise.} Cart response. */ getCarfaxReportsCount(vin: string): Promise; /** * Get requests. * * @param {object} [query] Request options. * @param {string} [query.accountId] Account ID of the requestor. * @param {string} [query.service] Name of the service. * @param {Number} [query.lotId] ID of the lot that service is requested for. * @param {Number} [query.page.number] Page number. * @param {Number} [query.page.size] Page size. * @param {string} [query.search] Search by 'token' field. * @param {string} [query.sort] Sort. Default '-created_at'. * * @return {Promise.} Cart response. */ getPage(query?: { accountId?: string; service?: string; lotId?: number; search?: string; sort?: string; }): Promise; /** * Get request by ID. * * @param {Number} id Request ID. * * @return {Promise.} Cart response. */ get(id: number): Promise; } /** * Network error. * * @export * @class */ declare class NetworkError { constructor(); } /** * Request timeout error. * * @export * @class */ declare class ClientTimeoutError { constructor(); } /** * Base class for server errors. */ declare class ServerErrorBase { constructor(originalError: any, axios: axios); /** * Response HTTP status. */ httpStatus: any; /** * Error meta. */ meta: any; /** * A short, human-readable summary of the problem. */ title: any; /** * A human-readable explanation specific to this occurrence of the problem. */ detail: any; /** * Retry the failed request. * Use it to retry requests after 2FA. */ retryRequest(): void; } /** * Generic Not Found(404) error. */ declare class NotFoundError { } /** * Generic Bad Gateway(502) error. */ declare class BadGatewayError { } /** * Generic Service Unavailable(503) error. */ declare class ServiceUnavailableError { } /** * Generic Gateway Timeout(504) error. */ declare class GatewayTimeoutError { } /** * Facilitates interaction with the FeeCalculator server. * * @class */ declare class FeeCalculatorServer { constructor(sdk: ShelfNetwork, serverUrl: string, opts: { allowHttp?: boolean; proxy?: any; httpBasicAuth?: any; customHeaders?: any; withCredentials?: boolean; }); /** * Get fee amount. * * @param {object} query Request options. * @param {Number} query.price Lot price. * @param {Number} query.lotType Lot type. * @param {string} query.currency Currency. */ calculate(query: { price: number; lotType: number; currency: string; }): void; /** * Get multiple fees. * * @param {object[]} pairs Array of pairs for convertation. * @param {Number} pairs.price Lot price. * @param {Number} pairs.lotType Lot type. * @param {string} pairs.currency Currency. * @param {Number} pairs.lotId Lot ID. Will be returned in response just for frontend mapping purposes. */ calculateBulk(pairs: { price: number; lotType: number; currency: string; lotId: number; }): void; } /** * Facilitates interaction with the wallet server. * * @class */ declare class FileServer { constructor(sdk: ShelfNetwork, serverUrl: string, opts: { allowHttp?: boolean; proxy?: any; httpBasicAuth?: any; customHeaders?: any; withCredentials?: boolean; responseType?: string; }); /** * Uploads a file to the storage server. * * @param {(File|Blob|ReadableStream)} file A file to upload. * @param {object} opts Document options. * @param {string} [opts.accessType='public'] Document access type. 'private' or 'public' * @param {string[]} [opts.owners=[]] Account IDs of the document owners * @param {string} [opts.expires] Document expiration time. * @return {Promise.} Payment server response. */ upload(file: File | Blob | ReadableStream, opts: { accessType?: string; owners?: string[]; expires?: string; }): Promise; /** * Get a file by ID. * * @param {string} fileId File ID. * @return {Promise.} Payment server response. */ get(fileId: string): Promise; /** * Get personal files. * * @param {object} [query] Request options. * @param {string[]} [query.in] Array of document id's. * @param {Number} [query.page.number] Page number. * @param {Number} [query.page.size] Page size. * * @return {Promise.} Cart response. */ getPage(query?: { in?: string[]; }): Promise; } /** * Reviewable request states. * * @enum {string} */ declare const enum reviewableRequestStates { } /** * Lot states. * * @enum {string} */ declare const enum lotStates { } /** * Lot types. */ declare var lotTypes: any; /** * Account types. */ declare var accountTypes: any; /** * Participant states. * * @enum {string} */ declare const enum participantStates { } /** * Deposit states. * * @enum {string} */ declare const enum depositStates { } /** * Account. * * @class */ declare class Account { /** * Create an account. * * @param {object} opts Account options. * @param {string} opts.type Account type. * @param {string} opts.platformId User's platform. * @param {string} [opts.facebookToken] Can override email, firstName, lastName and city. * @param {string} [opts.currency] Preferred currency. * @param {string} [opts.locale] Preferred user's locale. * @param {string} opts.email User's email. * @param {string} opts.firstName User's first name. * @param {string} opts.lastName User's last name. * @param {string} opts.phoneNumber User's phone number. * @param {string} [opts.city] User's city. * @param {string} [opts.company] User's company. * @param {string} opts.email Preferred user's locale. * @param {string} [accountId] User's account ID. Use account ID of the attached wallet by default. * @param {string} [password] Desired password. * * @return {JsonApiResponse} */ create(opts: { type: string; platformId: string; facebookToken?: string; currency?: string; locale?: string; email: string; firstName: string; lastName: string; phoneNumber: string; city?: string; company?: string; email: string; }, accountId?: string, password?: string): JsonApiResponse; /** * Update account details. * * @param {object} opts Account options. * @param {string} [opts.facebookToken] Can override email, firstName, lastName and city. * @param {string} [opts.currency] Preferred currency. * @param {string} [opts.locale] Preferred user's locale. * @param {string} [opts.firstName] User's first name. * @param {string} [opts.lastName] User's last name. * @param {string} [opts.city] User's city. * @param {string} [opts.company] User's company. * @param {string} [accountId] User's account ID. Use account ID of the attached wallet by default. * * @return {JsonApiResponse} */ update(opts: { facebookToken?: string; currency?: string; locale?: string; firstName?: string; lastName?: string; city?: string; company?: string; }, accountId?: string): JsonApiResponse; /** * Verify user's phone number. * * @param {string} token 6-digit token from SMS. * @param {string} [accountId] User's account ID. Use account ID of the attached wallet by default. */ verifyPhone(token: string, accountId?: string): void; /** * Verify user's phone number. * * @param {string} token 6-digit token from SMS. * @param {string} [accountId] User's account ID. Use account ID of the attached wallet by default. */ verifyEmail(token: string, accountId?: string): void; /** * Resend phone verification code. * * @param {string} [accountId] User's account ID. Use account ID of the attached wallet by default. */ resendPhoneVerificationCode(accountId?: string): void; /** * Resend phone verification code. * * @param {string} [accountId] User's account ID. Use account ID of the attached wallet by default. */ resendEmailVerificationCode(accountId?: string): void; /** * Get user's account. * * @param {sting} [accountId] User's account ID. Use account ID of the attached wallet by default. * @return {JsonApiResponse} */ get(accountId?: sting): JsonApiResponse; /** * Get multiple accounts. * * @param {object} query Request options. * @param {string} query.in List of account ids splitted by ',' * @return {JsonApiResponse} */ getAccounts(query: { in: string; }): JsonApiResponse; /** * Get account signers. * * @param {string} [accountId] User's account ID. Use account ID of the attached wallet by default. * @return {JsonApiResponse} */ getSigners(accountId?: string): JsonApiResponse; /** * Get account stars. * * @param {object} [query] Request options. * @param {Number} [query.page.number] Page number. * @param {Number} [query.page.size] Page size. * @param {string} [accountId] User's account ID. Use account ID of the attached wallet by default. * * @return {JsonApiResponse} */ getStars(query?: any, accountId?: string): JsonApiResponse; /** * Create star. * * @param {Number} lotId Lot ID. * @param {string} [accountId] User's account ID. Use account ID of the attached wallet by default. * * @return {JsonApiResponse} */ createStar(lotId: number, accountId?: string): JsonApiResponse; /** * Delete star. * * @param {Number} lotId Lot ID. * @param {string} [accountId] User's account ID. Use account ID of the attached wallet by default. * * @return {JsonApiResponse} */ deleteStar(lotId: number, accountId?: string): JsonApiResponse; /** * Get account signers. * * @param {sting} signerId Signer ID. * @param {sting} [accountId] User's account ID. Use account ID of the attached wallet by default. * @return {JsonApiResponse} */ getSigner(signerId: sting, accountId?: sting): JsonApiResponse; /** * Get account participation requests. * * @param {object} [query] Request options. * @param {Number} [query.page.number] Page number. * @param {Number} [query.page.size] Page size. * @param {string[]} [query.sort] Sorting params. * @param {string} [query.requestor] Requestor of the request. * @param {reviewer} [query.reviewer] Reviewer of th request. * @return {JsonApiResponse} */ getParticipationRequests(query?: { sort?: string[]; requestor?: string; reviewer?: reviewer; }): JsonApiResponse; /** * Get account bid requests. * * @param {object} [query] Request options. * @param {Number} [query.page.number] Page number. * @param {Number} [query.page.size] Page size. * @param {string[]} [query.sort] Sorting params. * @param {string} [query.requestor] Requestor of the request. * @param {reviewer} [query.reviewer] Reviewer of the request. * @return {JsonApiResponse} */ getBidRequests(query?: { sort?: string[]; requestor?: string; reviewer?: reviewer; }): JsonApiResponse; /** * Get account create lot requests. * * @param {object} [query] Request options. * @param {Number} [query.page.number] Page number. * @param {Number} [query.page.size] Page size. * @param {string[]} [query.sort] Sorting params. * @param {string} [query.requestor] Requestor of the request. * @param {reviewer} [query.reviewer] Reviewer of the request. * @return {JsonApiResponse} */ getCreateLotRequests(query?: { sort?: string[]; requestor?: string; reviewer?: reviewer; }): JsonApiResponse; /** * Request account recovery. * * @param {string} email User's email. */ requestRecovery(email: string): void; /** * Recover account. * * @param {string} email User's email. * @param {string} token Recovery token. * @param {string} newSigner Public key of the new signer. */ recover(email: string, token: string, newSigner: string): void; } declare module Account { /** * Account types. * * @enum {sting} */ enum types { } } /** * Deposits. * * @class */ declare class Deposits { /** * Set deposit state. * * @param {state} depositId Deposit ID. * @param {string} newState New deposit state. * * @return {JsonApiResponse} */ setState(depositId: state, newState: string): JsonApiResponse; } /** * Enums. * * @class */ declare class Enums { } /** * Lots. * * @class */ declare class Lots { /** * Create a lot. Creation might need approval depending on the account type. * * @param {object} lot Lot data. * @param {string} lot.type Lot type. * @param {string} lot.currency Lot currency. * @param {string} lot.startPrice Start price in lot currency. * @param {string} [lot.deposit] Desired deposit amount in lot currency. * @param {string} [lot.buyNowPrice] "Buy Now" price in lot currency. * @param {string} [lot.minStep] Minimal bid increment in lot currency. For 'eng' auctions only. * @param {string} [lot.maxStep] Maximal bid increment in lot currency. For 'eng' auctions only. * @param {number} [lot.startTime] Auction start time. Unix timestamp in seconds. * @param {number} [lot.duration] Auction duration. In seconds. * @param {object} [lot.details] Lot details. * * @return {Promise} */ create(lot: { type: string; currency: string; startPrice: string; deposit?: string; buyNowPrice?: string; minStep?: string; maxStep?: string; startTime?: number; duration?: number; details?: any; }): Promise; /** * Close the lot. * * @param {string} lotId ID of the lot. * @param {string} state New lot state. * * @return {Promise.} */ close(lotId: string, state: string): Promise; /** * Manage auction participant. * * @param {string} lotId ID of the lot. * @param {string} participantId ID of the participant to be rejected. * * @return {Promise.} */ rejectParticipant(lotId: string, participantId: string): Promise; /** * Participate in auction or sale. * * @param {string} lotId ID of the lot. * @param {boolean} [buyNow=false] Request "Buy Now" if true. * * @return {Promise.} */ participate(lotId: string, buyNow?: boolean): Promise; /** * Submit a bid. * * @param {string} lotId ID of the lot. * @param {string} amount Bid amount in lot currency. * * @return {Promise.} */ submitBid(lotId: string, amount: string): Promise; /** * Request "buy now" for a lot. * * @param {string} lotId ID of the lot. * @param {string} participantId ID of the participant to request "Buy Now" for. * * @return {Promise.} */ requestBuyNow(lotId: string, participantId: string): Promise; /** * Set the winner. * * @param {string} lotId ID of the lot. * @param {string} participantId ID of the winner. * @param {boolean} [buyNow=false] Is 'buy now' winner. * * @return {Promise.} */ setWinner(lotId: string, participantId: string, buyNow?: boolean): Promise; /** * Get lot by ID. * * @param {string} lotId ID of the lot. * @param {object} [query] Request options. * @param {object} [query.include] Include resources associated with the lot. * * @return {JsonApiResponse} */ get(lotId: string, query?: { include?: any; }): JsonApiResponse; /** * Get lots. * * @param {object} [query] Request options. * @param {Number} [query.page.number] Page number. * @param {Number} [query.page.size] Page size. * @param {string[]} [query.sort] Sorting params. * @return {JsonApiResponse} */ getPage(query?: { sort?: string[]; }): JsonApiResponse; /** * Get lots count. * * @param {object} [query] Request options. * @return {JsonApiResponse} */ getCount(query?: any): JsonApiResponse; /** * Get lot participants. * * @param {object} [query] Request options. * @param {Number} [query.page.number] Page number. * @param {Number} [query.page.size] Page size. * @param {string[]} [query.sort] Sorting params. * @return {JsonApiResponse} */ getParticipants(query?: { sort?: string[]; }): JsonApiResponse; /** * Get messages associated with the lot. * * @param {object} [query] Request options. * @param {Number} [query.page.number] Page number. * @param {Number} [query.page.size] Page size. * @param {string[]} [query.sort] Sorting params. * @return {JsonApiResponse} */ getMessages(query?: { sort?: string[]; }): JsonApiResponse; /** * Get the lot participation requests. * * @param {object} [query] Request options. * @param {Number} [query.page.number] Page number. * @param {Number} [query.page.size] Page size. * @param {string[]} [query.sort] Sorting params. * @param {string} [query.requestor] Requestor of the request. * @param {reviewer} [query.reviewer] Reviewer of the request. * @return {JsonApiResponse} */ getParticipationRequests(query?: { sort?: string[]; requestor?: string; reviewer?: reviewer; }): JsonApiResponse; /** * Get the lot bid requests. * * @param {object} [query] Request options. * @param {Number} [query.page.number] Page number. * @param {Number} [query.page.size] Page size. * @param {string[]} [query.sort] Sorting params. * @param {string} [query.requestor] Requestor of the request. * @param {reviewer} [query.reviewer] Reviewer of the request. * @return {JsonApiResponse} */ getBidRequests(query?: { sort?: string[]; requestor?: string; reviewer?: reviewer; }): JsonApiResponse; /** * Create a callback request * @param {String} lotId - ID of the lot * @return {JsonApiResponse} */ createCallback(lotId: string): JsonApiResponse; /** * Set lot winner details * @param {String} lotId * @param {Object} details * @param {String} [details.invoiceId] * @param {Boolean} [details.invoicePaid] * @param {String} [details.containerId] * @param {String} [details.serviceLink] * @param {Number} [details.feeAmount] * @param {Number} [details.transportationFee] * @param {String} [details.feeCurrency] * @param {Number} [details.totalAmount] */ setWinnerDetails(lotId: string, details: { invoiceId?: string; invoicePaid?: boolean; containerId?: string; serviceLink?: string; feeAmount?: number; transportationFee?: number; feeCurrency?: string; totalAmount?: number; }): void; /** * Delete a callback request * @param {String} lotId - ID of the lot * @param {string} [accountId] Account ID of the user. * @return {JsonApiResponse} */ deleteCallback(lotId: string, accountId?: string): JsonApiResponse; } /** * Messages. * * @class */ declare class Messages { /** * Get messages. * * @param {object} [query] Request options. * @param {Number} [query.page.number] Page number. * @param {Number} [query.page.size] Page size. * @param {string[]} [query.sort] Sorting params. * @param {string} query.sender Account id of the sender. * @param {Number} query.lotId ID of the lot. * @param {string} query.search Full text search. * @return {JsonApiResponse} */ getPage(query?: { sort?: string[]; sender: string; lotId: number; search: string; }): JsonApiResponse; /** * Get unread messages counter. * * @param {object} [query] Request options. * @param {string} query.sender Account id of the sender. * @param {Number} query.lotId ID of the lot. * @return {JsonApiResponse} */ getUnreadCounter(query?: { sender: string; lotId: number; }): JsonApiResponse; /** * Get dialogs list. * * @param {object} [query] Request options. * @param {string} query.with Account id of dialog companion. * @param {Number} query.lotId ID of the lot. * @return {JsonApiResponse} */ getDialogs(query?: { with: string; lotId: number; }): JsonApiResponse; /** * Mark messages as read. * * @param {object} opts Account options. * @param {string} [opts.sender] Account ID of the sender. * @param {Number} [opts.lotId] ID of the lot. * @param {Number} [opts.receiver] ID of the lot. */ markRead(opts: { sender?: string; lotId?: number; receiver?: number; }): void; /** * Send a message. * * @param {object} opts Message options. * @param {string} opts.receiver Message receiver. * @param {string} opts.lotId Lot ID. * @param {string} opts.text Message text. * @param {string} [opts.sender] Message sender. * * @return {Promise.} */ send(opts: { receiver: string; lotId: string; text: string; sender?: string; }): Promise; } /** * Auction participants. * * @class */ declare class Participants { /** * Get participants. * * @param {object} [query] Request options. * @param {Number} [query.page.number] Page number. * @param {Number} [query.page.size] Page size. * @param {string[]} [query.sort] Sorting params. * @return {JsonApiResponse} */ getPage(query?: { sort?: string[]; }): JsonApiResponse; } /** * ReviewableRequests. * * @class */ declare class ReviewableRequests { /** * Get reviewable requests. * * @param {object} [query] Request options. * @param {Number} [query.page.number] Page number. * @param {Number} [query.page.size] Page size. * @param {string[]} [query.sort] Sorting params. * @param {string} [query.requestor] Requestor of the request. * @param {reviewer} [query.reviewer] Reviewer of the request. * @param {string} [query.type] Type of the request. * * @return {Promise.} */ getPage(query?: { sort?: string[]; requestor?: string; reviewer?: reviewer; type?: string; }): Promise; /** * Get a reviewable request by id * @param requestId * @param {object} [query] Request options. * * @return {Promise.} */ get(requestId: any, query?: any): Promise; /** * Manage a reviewable request. * * @param {string} requestId Reviewable request ID. * @param {string} hash Reviewable request hash. * @param {string} state The new state of the request. * @param {string} [rejectReason] The reason why the request was rejected. * * @return {Promise.} */ manage(requestId: string, hash: string, state: string, rejectReason?: string): Promise; /** * Cancel a reviewable request. * * @param {string} requestId Reviewable request ID. * * @return {Promise.} */ cancel(requestId: string): Promise; } /** * Transactions. * * @class */ declare class Transactions { /** * Submit a transaction. * * @param {Transaction} transaction A transaction to be submitted. * @return {JsonApiResponse} Response. */ submit(transaction: Transaction): JsonApiResponse; } /** * Facilitates interaction with a Horizon server instance. * * @class */ declare class HorizonServer { constructor(sdk: ShelfNetwork, serverUrl: string, opts: { allowHttp?: boolean; proxy?: any; httpBasicAuth?: any; customHeaders?: any; withCredentials?: boolean; }); /** * Get network details. * * @return {JsonApiResponse} Network details. */ getNetworkDetails(): JsonApiResponse; /** * Convert currency. * * @param {object} query Request options. * @param {string} query.from From currency. * @param {string} query.to To currency. * @param {Number} query.amount Ampount. * @return {JsonApiResponse} Network details. */ convertCurrency(query: { from: string; to: string; amount: number; }): JsonApiResponse; /** * Convert multiple amounts. * * @param {object[]} paris Array of currency paris for convertation. * @param {string} paris.from From currency. * @param {string} paris.to To currency. * @param {Number} paris.amount Amount. * @return {JsonApiResponse} Network details. */ convertCurrencyBulk(paris: { from: string; to: string; amount: number; }): JsonApiResponse; /** * Migrate a legacy cardeal account. * * @param {string} email Email. * @param {string} password Password. * @param {string} [platformId] User's platform ID. * * @return {JsonApiResponse} */ migrateLegacyAccount(email: string, password: string, platformId?: string): JsonApiResponse; /** * Account details. * * @return {Account} */ account: any; /** * Enums. * * @return {Enums} */ enums: any; /** * Transactions. * * @return {Account} */ transactions: any; /** * Messages. * * @return {Messages} */ messages: any; /** * Participants. * * @return {Participants} */ participants: any; /** * Lots. * * @return {Lots} */ lots: any; /** * ReviewableRequests. * * @return {ReviewableRequests} */ reviewableRequests: any; /** * Deposits management. * * @return {Deposits} */ deposits: any; } /** * Generic JSON API error response. */ declare class JsonApiError { constructor(originalError: Error, axios: axios); } /** * "Bad Request" error. * `error.nestedErrors` may contain per-field errors. * * @export * @class */ declare class JsonApiBadRequestError { constructor(originalError: Error, axios: axios); /** * Errors for every invalid field. */ nestedErrors: any; } /** * User is not allowed to perform this action. * * @export * @class */ declare class JsonApiNotAllowedError { } /** * Forbidden. * * @export * @class */ declare class JsonApiForbiddenRequestError { } /** * The requested resource was not found. * * @export * @class */ declare class JsonApiNotFoundError { } /** * The request could not be completed due to a conflict with the current state of the target resource. * * @export * @class */ declare class JsonApiConflictError { } /** * Internal server error. * * @export * @class */ declare class JsonApiInternalServerError { } /** * JSON API response wrapper. * * JSON API spec: http: //jsonapi.org/ * * @class */ declare class JsonApiResponse { constructor(rawResponse: any, sdk: ShelfNetwork); /** * Get response data. */ data: any; /** * Get response HTTP status. */ httpStatus: any; /** * Get response headers. */ headers: any; /** * Get response metadata. */ meta: any; /** * Override JSON serialization. * * @return {object} Data to be serialized. */ toJSON(): any; } /** * Base class for services following the JSON API spec. * * @class */ declare class JsonApiServer { constructor(sdk: ShelfNetwork, serverUrl: string, opts: { alias?: string; allowHttp?: boolean; proxy?: any; httpBasicAuth?: any; customHeaders?: any; withCredentials?: boolean; }); /** * Use request interceptor. * @see [axios.js docs](https://github.com/axios/axios#interceptors) * * @param {function} handleSuccess Handler for successful requests. * @param {function} handleFailure Handler for failed requests. * * @return {Object} Axios.js interceptor object. */ useRequestInterceptor(handleSuccess: (...params: any[]) => any, handleFailure: (...params: any[]) => any): any; /** * Eject request interceptor. * @see [axios.js docs](https://github.com/axios/axios#interceptors) * * @param {Object} interceptor Axios.js interceptor descriptor. */ ejectRequestInterceptor(interceptor: any): void; /** * Use response interceptor. * @see [axios.js docs](https://github.com/axios/axios#interceptors) * * @param {function} handleSuccess Handler for successful responses. * @param {function} handleFailure Handler for failed responses. * * @return {Object} Axios.js interceptor object. */ useResponseInterceptor(handleSuccess: (...params: any[]) => any, handleFailure: (...params: any[]) => any): any; /** * Eject response interceptor. * @see [axios.js docs](https://github.com/axios/axios#interceptors) * * @param {Object} interceptor Axios.js interceptor descriptor. */ ejectResponseInterceptor(interceptor: any): void; } /** * @typedef {number} NotificationTypes * */ declare type NotificationTypes = number; /** * Supported notification types. * * @enum {NotificationTypes} */ declare const enum notificationTypes { } /** * Auction in tab _registered auctions_ is finishing in 3 hours */ declare var registeredFinishingIn3h: any; /** * Direct Sale from _watchlist_ is finishing in 3 hours. */ declare var watchlistDirectSaleFinishingIn3h: any; /** * Auction from _watchlist_ is finishing in 3 hours. */ declare var watchlistAuctionFinishingIn3h: any; /** * Deposit pending. */ declare var depositPending: any; /** * Deposit received. */ declare var depositReceived: any; /** * New high bidder. */ declare var overbid: any; /** * User won a lot. */ declare var winner: any; /** * Seller attached invoice. */ declare var invoiceAttached: any; /** * Inspection report for a lot from _registered auctions_ was received. */ declare var inspectionReportForRegisteredAuction: any; /** * Inspection report for a direct sale from _watchlist_. */ declare var inspectionReportForWatchlistDirectSale: any; /** * Inspection report for an auction from _watchlist_. */ declare var inspectionReportForWatchlistAuction: any; /** * Carfax report for a lot from _registered auction_. */ declare var carfaxReportForRegistered: any; /** * Carfax report for a direct sale from _watchlist_. */ declare var carfaxReportForWatchlistDirectSale: any; /** * Carfax report for an auction from _watchlist_. */ declare var carfaxReportForWatchlistAuction: any; /** * Direct sale request was approved. */ declare var directSaleApproved: any; /** * Direct sale request was rejected. */ declare var directSaleRejected: any; /** * Message from potential buyer of my direct sale lot. */ declare var messageFromBuyer: any; /** * Message from the seller of the lot I want to buy. */ declare var messageFromSeller: any; /** * User has requested a callback. */ declare var callbackRequested: any; /** * User has registered on a lot(or requested buy now) and paid deposit. */ declare var newActiveTrade: any; /** * User hase made a lot creation request. */ declare var newUpload: any; /** * User paid for look live request. */ declare var lookLiveRequest: any; /** * User bought a carfax report. */ declare var carfaxPurchase: any; /** * Auction is ending in 3 h but there 's participant with unpaid deposit. */ declare var reminderUnpaidDeposit3h: any; /** * Invoice is still 'due' 12h after lot is closed. */ declare var reminderUnpaidInvoice: any; /** * Auction is finished. */ declare var auctionFinished: any; /** * User 've just requested financing. */ declare var financingPending: any; /** * Financing request is approved. */ declare var financingApproved: any; /** * Financing request is rejected */ declare var financingRejected: any; /** * Facilitates interaction with the Notifications server. * * @class */ declare class NotificationServer { constructor(sdk: ShelfNetwork, serverUrl: string, opts: { allowHttp?: boolean; proxy?: any; httpBasicAuth?: any; customHeaders?: any; withCredentials?: boolean; responseType?: string; }); /** * Available notification types. * * @type {NotificationTypes} */ types: NotificationTypes; /** * Get all notifications. * * @param {object} [opts] Request options. * @param {string} [opts.sort] Sort mode. * * @return {Promise} */ getAll(opts?: { sort?: string; }): Promise; /** * Get notification counters. * * @return {Promise} */ getCounters(): Promise; /** * Mark some type of notifications as seen. * * @param {string} id ID of the notification to mark as seen. * @return {Promise.} */ markAsSeen(id: string): Promise; /** * Mark an array of notifications as seen. * * @param {string[]} ids IDs of the notifications to mark as seen. * @return {Promise.} */ markAsSeenBulk(ids: string[]): Promise; } /** * Facilitates interaction with the parser server. * * @class */ declare class ParserServer { constructor(sdk: ShelfNetwork, serverUrl: string, opts: { allowHttp?: boolean; proxy?: any; httpBasicAuth?: any; customHeaders?: any; withCredentials?: boolean; responseType?: string; }); /** * Get copart lot details. * * @param {Number} id Copart lot ID. * * @return {Promise.} Parser response. */ getLotDetails(id: number): Promise; } /** * Facilitates interaction with the wallet server. * * @class */ declare class PaymentServer { constructor(sdk: ShelfNetwork, serverUrl: string, opts: { allowHttp?: boolean; proxy?: any; httpBasicAuth?: any; customHeaders?: any; withCredentials?: boolean; responseType?: string; }); /** * Preauthorize a transaction. * * @param {object} opts Payment details. * @param {string} opts.currency Payment currency. * @param {string} opts.amount Payment amount in cents. * @param {string} opts.description Payment description. * @param {string} opts.purpose Payment purpose. * @param {string} [opts.invoiceId] Invoice id. * @param {string} [opts.redirect] Custom redirect. * * @return {Promise.} Payment server response. */ create(opts: { currency: string; amount: string; description: string; purpose: string; invoiceId?: string; redirect?: string; }): Promise; /** * Confirm a transaction. * * @param {object} opts Payment details. * @param {string} opts.transactionId Transaction ID. * * @return {Promise.} Payment server response. */ confirm(opts: { transactionId: string; }): Promise; /** * Reverse a transaction. * * @param {object} opts Payment details. * @param {string} opts.transactionId Transaction ID. * * @return {Promise.} Payment server response. */ reverse(opts: { transactionId: string; }): Promise; /** * Get a transaction ID. * * @param {string} transactionId Transaction ID. * @return {Promise.} Payment server response. */ get(transactionId: string): Promise; /** * Get a page of transactions. * * @param {object} [query] Request options. * @param {Number} [query.page.cursor] Pagination cursor. * @param {Number} [query.page.limit] Page size. * @param {string[]} [query.sort] Sorting params. * @param {string} [query.accountId] Filter by account ID. * @param {string} [query.status] Filter by payment status. * @param {string} [query.purpose] Filter by payment purpose. * @param {string} [query.invoiceId] Filter by invoice ID. * * @return {Promise.} Payment server response. */ getPage(query?: { sort?: string[]; accountId?: string; status?: string; purpose?: string; invoiceId?: string; }): Promise; } /** * Represents interaction with a resource group withing server. * * @class */ declare class ResourceGroupBase { constructor(server: JsonApiServer, sdk: ShelfNetwork); } /** * Shelf.Network Software Development Toolkit. * * @export */ declare class ShelfNetwork { constructor(opts?: { platformId?: string; gatewayUrl?: string; horizonUrl?: string; walletServerUrl?: string; cartServerUrl?: string; parserServerUrl?: string; transportationServerUrl?: string; feeCalculatorServerUrl?: string; paymentServerUrl?: string; authServerUrl?: string; azryLeasingUrl?: string; allowHttp?: boolean; proxy?: any; httpBasicAuth?: any; customHeaders?: any; withCredentials?: boolean; }); /** * Make a new ShelfNetwork SDK instance. * Deprecated. Use constructor instead. * * @deprecated * @param {object} [opts] * @param {string} [opts.platformId] Shelf.Network platform ID. * @param {string} [opts.gatewayUrl] Gateway server url. * @param {string} [opts.horizonUrl] Horizon server url. * @param {string} [opts.walletServerUrl] Wallet server url. * @param {string} [opts.cartServerUrl] Cart server url. * @param {string} [opts.parserServerUrl] Parser server url. * @param {string} [opts.transportationServerUrl] Transportation server url. * @param {string} [opts.feeCalculatorServerUrl] Fee server url. * @param {string} [opts.paymentServerUrl] Payment server url. * @param {string} [opts.authServerUrl] Auth server url. * @param {string} [opts.azryLeasingUrl] AZRY leasing server url. * @param {boolean} [opts.allowHttp] Allow connecting to http servers, default: `false`. This must be set to false in production deployments! * @param {object} [opts.proxy] Proxy configuration. Look [axios docs](https://github.com/axios/axios#request-config) for more info * @param {object} [opts.httpBasicAuth] HTTP basic auth credentials. Look [axios docs](https://github.com/axios/axios#request-config) for more info. * @param {object} [opts.customHeaders] Custom headers for request. * @param {boolean} [opts.withCredentials] Indicates whether or not cross-site Access-Control requests should be made using credentials. * * @return {Promise.} */ static create(opts?: { platformId?: string; gatewayUrl?: string; horizonUrl?: string; walletServerUrl?: string; cartServerUrl?: string; parserServerUrl?: string; transportationServerUrl?: string; feeCalculatorServerUrl?: string; paymentServerUrl?: string; authServerUrl?: string; azryLeasingUrl?: string; allowHttp?: boolean; proxy?: any; httpBasicAuth?: any; customHeaders?: any; withCredentials?: boolean; }): Promise; /** * Shelf.Network platform ID. * * @type {string} */ platformId: string; /** * Horizon server instance. * * @type {HorizonServer} */ horizon: HorizonServer; /** * Wallet server instance. * * @type {WalletServer} */ wallets: WalletServer; /** * Cart server instance. * * @type {CartServer} */ cart: CartServer; /** * Parser server instance. * * @type {ParserServer} */ parser: ParserServer; /** * Transportation server instance. * * @type {TransportationServer} */ transportation: TransportationServer; /** * Fee server instance. * * @type {FeeCalculatorServer} */ feeCalculator: FeeCalculatorServer; /** * Payment server instance. * * @type {PaymentServer} */ payments: PaymentServer; /** * File server instance. * * @type {FileServer} */ files: FileServer; /** * Notification server instance. * * @type {NotificationServer} */ notifications: NotificationServer; /** * Notification server instance. * * @type {AuthServer} */ auth: AuthServer; /** * AZRY leasing server url. * * @type {AuthServer} */ azryLeasing: AuthServer; /** * User's wallet. * * @type {Wallet} */ wallet: Wallet; /** * User's token. * * @type {Token} */ token: Token; /** * Clock difference with the backend. * * @type {Number} */ clockDiff: number; /** * Use a wallet to sign transactions. * * @param {Wallet} wallet User's wallet. */ useWallet(wallet: Wallet): void; /** * Use user's token to authenticate requests. * * @param {Token} token User's token. */ useToken(token: Token): void; /** * Eject current wallet. */ ejectWallet(): void; /** * Eject current JWT token. */ ejectToken(): void; /** * Fetch network details. * Use it if you are going to use wallets or manually sign transactions. * * @return {Promise} */ fetchNetworkDetails(): Promise; } /** * Facilitates interaction with the Transportation server. * * @class */ declare class TransportationServer { constructor(sdk: ShelfNetwork, serverUrl: string, opts: { allowHttp?: boolean; proxy?: any; httpBasicAuth?: any; customHeaders?: any; withCredentials?: boolean; responseType?: string; }); /** * Get available cities. * * @return {Promise.} Transportation response. */ getCities(): Promise; /** * Get transportation price. * * @param {object} query Request options. * @param {number} [query.cityId] City ID. * @param {string} [query.lotType] Lot type. * @param {string} [query.city] City. * @param {string} [query.zip] ZIP code. * @param {string} [query.state] State code. E.g. "CA" * * @return {JsonApiResponse} */ getPrice(query: { cityId?: number; lotType?: string; city?: string; zip?: string; state?: string; }): JsonApiResponse; /** * Calculate multiple transportation prices. * * @param {object[]} cities Array of cities data. * @param {Number} [cities.id] City ID. * @param {string} [cities.zip] City zip code. * @param {string} [cities.name] City name. * @param {string} [cities.state] City state. * @param {Number} [cities.lotId] Lot ID. Will be returned in response just for frontend mapping purposes. * @param {string} [query.lotType] Lot type. * * @return {JsonApiResponse} */ getPriceBulk(cities: { id?: number; zip?: string; name?: string; state?: string; lotId?: number; }): JsonApiResponse; } /** * Facilitates interaction with the wallet server. * * @class */ declare class WalletServer { constructor(sdk: ShelfNetwork, serverUrl: string, opts: { allowHttp?: boolean; proxy?: any; httpBasicAuth?: any; customHeaders?: any; withCredentials?: boolean; responseType?: string; }); /** * Create an encrypted wallet. * * @param {Wallet} wallet User's wallet. * @param {string} password User's password. * * @return {Promise.} User's wallet. */ create(wallet: Wallet, password: string): Promise; /** * Get user's wallet. * * @param {string} email User's email. * @param {string} password User's password. * @param {string} [accountId] User's account ID. Can be used instead of email. * @param {string} [platformId] User's platform ID. Must be used with email. * * @return {Promise.} User's email. */ get(email: string, password: string, accountId?: string, platformId?: string): Promise; /** * Verify if password is matching the wallet's one. * * @param {string} walletId User's wallet ID. * @param {string} password A password to be verified. * @param {string} accountId Account ID. */ checkPassword(walletId: string, password: string, accountId: string): void; /** * Change user's password. * * @param {string} newPassword User's password. * @param {string} [wallet] A wallet to be updated. * * @return {Promise.} Updated wallet. */ changePassword(newPassword: string, wallet?: string): Promise; /** * Recover user's wallet. * * @param {string} accountId User's account ID. * @param {Keypair} newSignerKeypair New singer's keypair. * @param {string} newPassword New password. * * @return {Promise.} Updated wallet. */ recover(accountId: string, newSignerKeypair: Keypair, newPassword: string): Promise; } /** * Manages user's key pair. * * @class */ declare class Wallet { constructor(keypair: Keypair | string, accountId: string, walletId?: string); /** * Clone a wallet. * * @return {Wallet} Cloned wallet. */ clone(): Wallet; /** * Generate a new wallet. * * @param {string} [accountId] User's account ID. * * @return {Wallet} The new wallet. */ static generate(accountId?: string): Wallet; /** * Decrypt a wallet obtained from a wallet server. * * @param {object} keychainData Encrypted wallet seed. * @param {object} kdfParams Scrypt params used for encryption. * @param {string} salt Salt used for encryption. * @param {string} password User's password. */ static fromEncrypted(keychainData: any, kdfParams: any, salt: string, password: string): void; /** * Derive the wallet ID. * * @param {string} password * @param {object} kdfParams * @param {string} salt * * @return {string} Wallet ID. */ static deriveId(password: string, kdfParams: any, salt: string): string; /** * Wallet ID. */ id: any; /** * Account ID. */ accountId: any; /** * Email used for login. */ email: any; /** * Secret seed. */ secretSeed: any; /** * Get signing keypair. */ keypair: any; /** * Encrypt wallet to securely store it. * * @param {object} kdfParams Scrypt params. * @param {string} password User's password. * @return {object} Encrypted keychain and metadata. */ encrypt(kdfParams: any, password: string): any; }