@internxt/sdk 1.10.9 → 1.10.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,6 +16,7 @@ export declare class Auth {
16
16
  */
17
17
  register(registerDetails: RegisterDetails): Promise<{
18
18
  token: Token;
19
+ newToken: Token;
19
20
  user: Omit<UserSettings, 'bucket'> & {
20
21
  referralCode: string;
21
22
  };
@@ -27,6 +28,7 @@ export declare class Auth {
27
28
  */
28
29
  registerWithoutKeys(registerDetails: Omit<RegisterDetails, 'keys'>): Promise<{
29
30
  token: Token;
31
+ newToken: Token;
30
32
  user: Omit<UserSettings, 'bucket'> & {
31
33
  referralCode: string;
32
34
  };
@@ -24,6 +24,7 @@ export interface RegisterPreCreatedUser extends RegisterDetails {
24
24
  }
25
25
  export interface RegisterPreCreatedUserResponse {
26
26
  token: Token;
27
+ newToken: Token;
27
28
  user: UserSettings & {
28
29
  referralCode: string;
29
30
  };
@@ -67,7 +67,7 @@ var FileVersionOneError = /** @class */ (function (_super) {
67
67
  exports.FileVersionOneError = FileVersionOneError;
68
68
  function downloadFile(fileId, bucketId, mnemonic, network, crypto, toBinaryData, downloadFile, decryptFile, opts) {
69
69
  return __awaiter(this, void 0, void 0, function () {
70
- var iv, indexHex, key, mnemonicIsValid, _a, index, shards, version, size, downloadables, err_1, context;
70
+ var iv, key, mnemonicIsValid, _a, index, shards, version, size, downloadables, err_1, context;
71
71
  return __generator(this, function (_b) {
72
72
  switch (_b.label) {
73
73
  case 0:
@@ -102,12 +102,7 @@ function downloadFile(fileId, bucketId, mnemonic, network, crypto, toBinaryData,
102
102
  bucketId: bucketId,
103
103
  fileId: fileId,
104
104
  user: network.credentials.username,
105
- pass: network.credentials.password,
106
- token: (opts === null || opts === void 0 ? void 0 : opts.token) || 'none',
107
105
  crypto: {
108
- index: indexHex ? indexHex.toString('hex') : 'none',
109
- iv: iv ? iv.toString('hex') : 'none',
110
- key: key ? key.toString('hex') : 'none',
111
106
  mnemonic: mnemonic,
112
107
  },
113
108
  }, err_1);
@@ -1,35 +1,22 @@
1
- import { DownloadInvalidMnemonicError } from './download';
2
- import { UploadInvalidMnemonicError } from './upload';
3
- type NetworkError = UploadInvalidMnemonicError | DownloadInvalidMnemonicError | Error;
4
1
  export type NetworkUploadContext = {
5
2
  bucketId: string;
6
3
  fileSize: number;
7
4
  user: string;
8
- pass: string;
9
5
  crypto: {
10
- index: string;
11
6
  mnemonic?: string;
12
- key: string;
13
- iv: string;
14
7
  };
15
8
  };
16
9
  export type NetworkDownloadContext = {
17
10
  bucketId: string;
18
11
  fileId: string;
19
12
  user: string;
20
- pass: string;
21
- token: string;
22
13
  crypto: {
23
- index: string;
24
14
  mnemonic?: string;
25
- key: string;
26
- iv: string;
27
15
  };
28
16
  };
29
17
  export type NetworkContext = NetworkUploadContext | NetworkDownloadContext;
30
18
  export declare class ErrorWithContext extends Error {
31
- context: Partial<NetworkContext>;
32
- constructor(context: Partial<NetworkContext>);
19
+ context: NetworkContext;
20
+ constructor(context: NetworkContext);
33
21
  }
34
- export declare function getNetworkErrorContext(input: NetworkContext, err: NetworkError): Partial<NetworkContext>;
35
- export {};
22
+ export declare function getNetworkErrorContext(input: NetworkContext, err: unknown): NetworkContext;
@@ -89,11 +89,7 @@ function uploadFile(network, crypto, bucketId, mnemonic, fileSize, encryptFile,
89
89
  bucketId: bucketId,
90
90
  fileSize: fileSize,
91
91
  user: network.credentials.username,
92
- pass: network.credentials.password,
93
92
  crypto: {
94
- index: index ? index.toString('hex') : 'none',
95
- iv: iv ? iv.toString('hex') : 'none',
96
- key: key ? key.toString('hex') : 'none',
97
93
  mnemonic: mnemonic,
98
94
  },
99
95
  }, err_1);
@@ -1,6 +1,6 @@
1
1
  import { CreatedPaymentIntent, CreatedSubscriptionData } from '../drive/payments/types/types';
2
2
  import { ApiSecurity, ApiUrl, AppDetails } from '../shared';
3
- import { CreatePaymentIntentPayload, CreateSubscriptionPayload, GetPriceByIdPayload, PriceWithTax } from './types';
3
+ import { CreatePaymentIntentPayload, CreateSubscriptionPayload, CryptoCurrency, GetPriceByIdPayload, PriceWithTax } from './types';
4
4
  export declare class Checkout {
5
5
  private readonly client;
6
6
  private readonly appDetails;
@@ -59,6 +59,7 @@ export declare class Checkout {
59
59
  * @returns The price object containing the details of the requested price
60
60
  */
61
61
  getPriceById({ priceId, promoCodeName, userAddress, currency, postalCode, country, }: GetPriceByIdPayload): Promise<PriceWithTax>;
62
+ getAvailableCryptoCurrencies(): Promise<CryptoCurrency[]>;
62
63
  /**
63
64
  * Returns the needed headers with authorization header for the module requests
64
65
  * @private
@@ -110,6 +110,9 @@ var Checkout = /** @class */ (function () {
110
110
  query.set('country', country);
111
111
  return this.client.get("/checkout/price-by-id?".concat(query.toString()), this.headers());
112
112
  };
113
+ Checkout.prototype.getAvailableCryptoCurrencies = function () {
114
+ return this.client.get('/checkout/currencies/crypto', this.headers());
115
+ };
113
116
  /**
114
117
  * Returns the needed headers with authorization header for the module requests
115
118
  * @private
@@ -56,3 +56,14 @@ export type PriceWithTax = {
56
56
  price: Price;
57
57
  taxes: Taxes;
58
58
  };
59
+ export interface CryptoCurrency {
60
+ currencyId: string;
61
+ name: string;
62
+ type: 'crypto' | 'fiat';
63
+ receiveType: boolean;
64
+ networks: {
65
+ platformId: string;
66
+ name: string;
67
+ }[];
68
+ imageUrl: string;
69
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@internxt/sdk",
3
3
  "author": "Internxt <hello@internxt.com>",
4
- "version": "1.10.9",
4
+ "version": "1.10.11",
5
5
  "description": "An sdk for interacting with Internxt's services",
6
6
  "repository": {
7
7
  "type": "git",