@ordanetwork/sdk 2.0.0-beta.0 → 2.0.0

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/README.md +1 -3
  3. package/dist/browser/api/Balances.d.ts +2 -2
  4. package/dist/browser/api/JWT.d.ts +2 -2
  5. package/dist/browser/api/OffRamp.d.ts +2 -2
  6. package/dist/browser/api/OnRamp.d.ts +2 -2
  7. package/dist/browser/api/Prices.d.ts +2 -2
  8. package/dist/browser/api/Quote.d.ts +2 -2
  9. package/dist/browser/api/Recipient.d.ts +2 -2
  10. package/dist/browser/api/Transaction.d.ts +2 -2
  11. package/dist/browser/api/Transaction.js +1 -1
  12. package/dist/browser/auth/hmac.js +1 -1
  13. package/dist/browser/crypto/factory.d.ts +1 -1
  14. package/dist/browser/crypto/factory.js +2 -2
  15. package/dist/browser/crypto/node-crypto.d.ts +1 -1
  16. package/dist/browser/crypto/node-crypto.js +1 -1
  17. package/dist/browser/crypto/web-crypto.d.ts +1 -1
  18. package/dist/browser/http/client.d.ts +2 -2
  19. package/dist/browser/http/client.js +3 -3
  20. package/dist/browser/index.d.ts +27 -27
  21. package/dist/browser/index.js +29 -29
  22. package/dist/browser/types/guards.d.ts +3 -3
  23. package/dist/browser/types/index.d.ts +6 -6
  24. package/dist/browser/types/index.js +3 -3
  25. package/dist/browser/types/offramp.d.ts +2 -2
  26. package/dist/browser/types/onramp.d.ts +1 -1
  27. package/dist/esm/api/Balances.d.ts +2 -2
  28. package/dist/esm/api/JWT.d.ts +2 -2
  29. package/dist/esm/api/OffRamp.d.ts +2 -2
  30. package/dist/esm/api/OnRamp.d.ts +2 -2
  31. package/dist/esm/api/Prices.d.ts +2 -2
  32. package/dist/esm/api/Quote.d.ts +2 -2
  33. package/dist/esm/api/Recipient.d.ts +2 -2
  34. package/dist/esm/api/Transaction.d.ts +2 -2
  35. package/dist/esm/api/Transaction.js +1 -1
  36. package/dist/esm/auth/hmac.js +1 -1
  37. package/dist/esm/crypto/factory.d.ts +1 -1
  38. package/dist/esm/crypto/factory.js +2 -2
  39. package/dist/esm/crypto/node-crypto.d.ts +1 -1
  40. package/dist/esm/crypto/node-crypto.js +1 -1
  41. package/dist/esm/crypto/web-crypto.d.ts +1 -1
  42. package/dist/esm/http/client.d.ts +2 -2
  43. package/dist/esm/http/client.js +3 -3
  44. package/dist/esm/index.d.ts +27 -27
  45. package/dist/esm/index.js +29 -29
  46. package/dist/esm/types/guards.d.ts +3 -3
  47. package/dist/esm/types/index.d.ts +6 -6
  48. package/dist/esm/types/index.js +3 -3
  49. package/dist/esm/types/offramp.d.ts +2 -2
  50. package/dist/esm/types/onramp.d.ts +1 -1
  51. package/package.json +5 -3
package/CHANGELOG.md ADDED
@@ -0,0 +1,92 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@ordanetwork/sdk` are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [2.0.0] — BREAKING — Core SDK
9
+
10
+ `@ordanetwork/sdk@2.0.0` is a slim, pure API wrapper. All React, wallet, and UI
11
+ surface has been removed. The SDK is now intended for backend and pure-data
12
+ integrations; React/widget consumers should install
13
+ [`@ordanetwork/widget`](https://www.npmjs.com/package/@ordanetwork/widget) instead.
14
+
15
+ ### Added
16
+
17
+ - `OrdaSDK.prices` — `Prices` API for fetching USD token prices via `/v1/prices`.
18
+ - `OrdaSDK.balances` — `Balances` API for fetching wallet token balances across
19
+ chains via `/v1/balances`.
20
+ - New exported types: `TokenPriceRequest`, `TokenPriceData`, `PricesFetchParams`,
21
+ `PricesFetchResponse`, `TokenBalance`, `BalancesFetchOptions`,
22
+ `BalancesFetchParams`, `BalancesSummary`, `ChainFailure`,
23
+ `BalancesFetchResponse`.
24
+
25
+ ### Changed
26
+
27
+ - `OrdaSDK.version` now returns `'2.0.0'`.
28
+
29
+ ### Fixed
30
+
31
+ - `web-crypto` HMAC provider now compiles cleanly under stricter `BufferSource`
32
+ typings shipped by recent `@types/node` / TypeScript releases.
33
+
34
+ ### Removed
35
+
36
+ #### Removed exports
37
+
38
+ - `SmartWalletClient`
39
+ - `SmartWalletManager`
40
+ - `LocalSigner`
41
+ - `createSmartWallet`
42
+ - `SmartWalletError`
43
+ - `ConnectionError`
44
+ - `UserOperationError`
45
+ - `InsufficientFundsError`
46
+ - `AccountNotDeployedError`
47
+ - Type exports: `SmartWalletConfig`, `SmartWalletInterface`,
48
+ `UserOperationRequest`, `TransactionResult`, `AccountType`, `SmartWalletState`
49
+ - Crypto helpers previously exposed via `SmartWalletManager`:
50
+ `generatePrivateKey`, `validatePrivateKey`, `getAddressFromPrivateKey`.
51
+ Modern integrators already have these via `viem`, `wagmi`, or `node:crypto`.
52
+
53
+ #### Removed instance members
54
+
55
+ - `OrdaSDK#smartWallets` (the `SmartWalletManager` instance).
56
+
57
+ #### Removed configuration
58
+
59
+ - `OrdaConfig.alchemyApiKey`
60
+ - `JWTAuthConfig.alchemyApiKey`
61
+
62
+ #### Dropped runtime dependencies
63
+
64
+ - `@aa-sdk/core`
65
+ - `@account-kit/core`
66
+ - `@account-kit/infra`
67
+ - `@account-kit/smart-contracts`
68
+ - `viem`
69
+
70
+ #### Dropped dev dependencies
71
+
72
+ - `viem`
73
+
74
+ ### Migration notes
75
+
76
+ - **Recipient auto-generation is unaffected.** Smart wallets for recipients
77
+ continue to be created server-side by the Orda API. Calling
78
+ `sdk.recipients.create({...})` without `toAddress` still returns a recipient
79
+ with an auto-generated smart wallet.
80
+ - **Existing smart wallets remain operable.** Deployed wallets are standard
81
+ ERC-4337 accounts with no Orda lock-in. Any compatible account-abstraction
82
+ SDK (Alchemy Account Kit, ZeroDev, Biconomy, etc.) can interact with them
83
+ given the holder's private key.
84
+ - **No `/react` subpath in this line.** The widget product has moved to a
85
+ separate package: install `@ordanetwork/widget` alongside
86
+ `@ordanetwork/sdk@^2.0.0` to get the drop-in React widget, hooks, and
87
+ `OrdaProvider`.
88
+ - **No deprecation shim.** Accessing `sdk.smartWallets` or any removed export
89
+ throws at type-check / runtime. The final `1.x` release of
90
+ `@ordanetwork/sdk` carries the deprecation warnings.
91
+
92
+ [2.0.0]: https://github.com/ordanetwork/orda-sdk/releases/tag/v2.0.0
package/README.md CHANGED
@@ -466,9 +466,7 @@ if (recipient.smartWallet) {
466
466
 
467
467
  For client-side operations (UserOperations, batching, etc.) use any
468
468
  ERC-4337-compatible library: Alchemy Account Kit, ZeroDev, Biconomy, or
469
- `viem`'s account-abstraction utilities. See
470
- [`docs/04-smart-wallets.md`](./docs/04-smart-wallets.md) for the full
471
- migration notes from `@ordanetwork/sdk@1.x`.
469
+ `viem`'s account-abstraction utilities.
472
470
 
473
471
  > Looking for the drop-in React widget? It moved to
474
472
  > [`@ordanetwork/widget`](https://www.npmjs.com/package/@ordanetwork/widget).
@@ -1,5 +1,5 @@
1
- import { UniversalHttpClient } from '../http/client';
2
- import { BalancesFetchOptions, BalancesFetchResponse } from '../types/balances';
1
+ import { UniversalHttpClient } from '../http/client.js';
2
+ import { BalancesFetchOptions, BalancesFetchResponse } from '../types/balances.js';
3
3
  /**
4
4
  * API wrapper for token balance operations
5
5
  */
@@ -1,5 +1,5 @@
1
- import { UniversalHttpClient } from '../http/client';
2
- import { GenerateJWTRequest, GenerateJWTResponse } from '../types/jwt';
1
+ import { UniversalHttpClient } from '../http/client.js';
2
+ import { GenerateJWTRequest, GenerateJWTResponse } from '../types/jwt.js';
3
3
  /**
4
4
  * API wrapper for JWT authentication operations
5
5
  *
@@ -1,5 +1,5 @@
1
- import { UniversalHttpClient } from '../http/client';
2
- import { OffRampQuoteParams, OffRampQuoteResponse, OffRampStatusResponse, OffRampStatusType } from '../types/offramp';
1
+ import { UniversalHttpClient } from '../http/client.js';
2
+ import { OffRampQuoteParams, OffRampQuoteResponse, OffRampStatusResponse, OffRampStatusType } from '../types/offramp.js';
3
3
  /**
4
4
  * Polling options for off-ramp operations
5
5
  */
@@ -1,5 +1,5 @@
1
- import { UniversalHttpClient } from '../http/client';
2
- import { OnRampQuoteParams, OnRampQuoteResponse, OnRampStatusResponse } from '../types/onramp';
1
+ import { UniversalHttpClient } from '../http/client.js';
2
+ import { OnRampQuoteParams, OnRampQuoteResponse, OnRampStatusResponse } from '../types/onramp.js';
3
3
  export interface OnRampPollingOptions {
4
4
  intervalMs?: number;
5
5
  timeoutMs?: number;
@@ -1,5 +1,5 @@
1
- import { UniversalHttpClient } from '../http/client';
2
- import { TokenPriceRequest, PricesFetchResponse } from '../types/prices';
1
+ import { UniversalHttpClient } from '../http/client.js';
2
+ import { TokenPriceRequest, PricesFetchResponse } from '../types/prices.js';
3
3
  /**
4
4
  * API wrapper for token price operations
5
5
  */
@@ -1,5 +1,5 @@
1
- import { UniversalHttpClient } from '../http/client';
2
- import { QuoteRequestParams, TransferResponse, DirectTransferResponse } from '../types';
1
+ import { UniversalHttpClient } from '../http/client.js';
2
+ import { QuoteRequestParams, TransferResponse, DirectTransferResponse } from '../types/index.js';
3
3
  /**
4
4
  * API wrapper for quote operations
5
5
  */
@@ -1,5 +1,5 @@
1
- import { UniversalHttpClient } from '../http/client';
2
- import { CreateRecipientParams, UpdateRecipientSettlementParams, DeactivateRecipientParams, CreateRecipientResponse, UpdateRecipientResponse, DeactivateRecipientResponse, ListRecipientsParams, ListRecipientsResponse } from '../types';
1
+ import { UniversalHttpClient } from '../http/client.js';
2
+ import { CreateRecipientParams, UpdateRecipientSettlementParams, DeactivateRecipientParams, CreateRecipientResponse, UpdateRecipientResponse, DeactivateRecipientResponse, ListRecipientsParams, ListRecipientsResponse } from '../types/index.js';
3
3
  export declare class Recipient {
4
4
  private httpClient;
5
5
  constructor(httpClient: UniversalHttpClient);
@@ -1,5 +1,5 @@
1
- import { UniversalHttpClient } from '../http/client';
2
- import { TransactionStatusParams, TransactionStatusResponse, TransactionListItem, TransactionStatus } from '../types';
1
+ import { UniversalHttpClient } from '../http/client.js';
2
+ import { TransactionStatusParams, TransactionStatusResponse, TransactionListItem, TransactionStatus } from '../types/index.js';
3
3
  export interface PollingOptions {
4
4
  intervalMs?: number;
5
5
  timeoutMs?: number;
@@ -1,4 +1,4 @@
1
- import { TransactionStatus } from '../types';
1
+ import { TransactionStatus } from '../types/index.js';
2
2
  export class Transaction {
3
3
  constructor(httpClient) {
4
4
  this.httpClient = httpClient;
@@ -1,4 +1,4 @@
1
- import { getCryptoProvider } from '../crypto/factory';
1
+ import { getCryptoProvider } from '../crypto/factory.js';
2
2
  export class HmacAuthenticator {
3
3
  constructor(clientId, clientSecret) {
4
4
  this.clientId = clientId;
@@ -1,4 +1,4 @@
1
- import { CryptoProvider } from './types';
1
+ import { CryptoProvider } from './types.js';
2
2
  /**
3
3
  * Factory function to get the appropriate crypto provider
4
4
  * based on the current environment
@@ -1,5 +1,5 @@
1
- import { WebCryptoProvider } from './web-crypto';
2
- import { NodeCryptoProvider } from './node-crypto';
1
+ import { WebCryptoProvider } from './web-crypto.js';
2
+ import { NodeCryptoProvider } from './node-crypto.js';
3
3
  /**
4
4
  * Factory function to get the appropriate crypto provider
5
5
  * based on the current environment
@@ -1,4 +1,4 @@
1
- import { CryptoProvider } from './types';
1
+ import { CryptoProvider } from './types.js';
2
2
  /**
3
3
  * Node.js crypto module provider for server environments
4
4
  */
@@ -16,7 +16,7 @@ export class NodeCryptoProvider {
16
16
  if (!this.crypto) {
17
17
  // fallback to Web Crypto if available in Node
18
18
  if (typeof globalThis.crypto !== 'undefined' && globalThis.crypto.subtle) {
19
- const webProvider = await import('./web-crypto');
19
+ const webProvider = await import('./web-crypto.js');
20
20
  const provider = new webProvider.WebCryptoProvider();
21
21
  return provider.createHmacSha256(secret, message);
22
22
  }
@@ -1,4 +1,4 @@
1
- import { CryptoProvider } from './types';
1
+ import { CryptoProvider } from './types.js';
2
2
  /**
3
3
  * Web Crypto API provider for browsers and Node.js
4
4
  */
@@ -1,5 +1,5 @@
1
- import { HmacAuthenticator } from '../auth/hmac';
2
- import { JWTAuthenticator } from '../auth/jwt';
1
+ import { HmacAuthenticator } from '../auth/hmac.js';
2
+ import { JWTAuthenticator } from '../auth/jwt.js';
3
3
  /**
4
4
  * Request configuration
5
5
  */
@@ -1,6 +1,6 @@
1
- import { HmacAuthenticator } from '../auth/hmac';
2
- import { JWTAuthenticator } from '../auth/jwt';
3
- import { OrdaError, BadRequestError, UnauthorizedError, ForbiddenError, NotFoundError, NetworkError, TimeoutError, ExternalApiError, DatabaseError } from '../errors';
1
+ import { HmacAuthenticator } from '../auth/hmac.js';
2
+ import { JWTAuthenticator } from '../auth/jwt.js';
3
+ import { OrdaError, BadRequestError, UnauthorizedError, ForbiddenError, NotFoundError, NetworkError, TimeoutError, ExternalApiError, DatabaseError } from '../errors/index.js';
4
4
  /**
5
5
  * Universal HTTP client using fetch API
6
6
  */
@@ -1,12 +1,12 @@
1
- import { Quote } from './api/Quote';
2
- import { Recipient } from './api/Recipient';
3
- import { Transaction } from './api/Transaction';
4
- import { OffRamp } from './api/OffRamp';
5
- import { OnRamp } from './api/OnRamp';
6
- import { JWT } from './api/JWT';
7
- import { Prices } from './api/Prices';
8
- import { Balances } from './api/Balances';
9
- import { JWTAuthConfig } from './types/jwt';
1
+ import { Quote } from './api/Quote.js';
2
+ import { Recipient } from './api/Recipient.js';
3
+ import { Transaction } from './api/Transaction.js';
4
+ import { OffRamp } from './api/OffRamp.js';
5
+ import { OnRamp } from './api/OnRamp.js';
6
+ import { JWT } from './api/JWT.js';
7
+ import { Prices } from './api/Prices.js';
8
+ import { Balances } from './api/Balances.js';
9
+ import { JWTAuthConfig } from './types/jwt.js';
10
10
  /**
11
11
  * Configuration options for OrdaSDK
12
12
  */
@@ -51,23 +51,23 @@ export declare class OrdaSDK {
51
51
  */
52
52
  static get version(): string;
53
53
  }
54
- export * from './types';
55
- export * from './types/offramp';
56
- export * from './types/onramp';
57
- export * from './types/jwt';
58
- export * from './types/prices';
59
- export * from './types/balances';
60
- export * from './errors';
61
- export { Quote } from './api/Quote';
62
- export { Recipient } from './api/Recipient';
63
- export { Transaction, type PollingOptions } from './api/Transaction';
64
- export { OffRamp, type OffRampPollingOptions } from './api/OffRamp';
65
- export { OnRamp, type OnRampPollingOptions } from './api/OnRamp';
66
- export { JWT } from './api/JWT';
67
- export { Prices } from './api/Prices';
68
- export { Balances } from './api/Balances';
69
- export { UniversalHttpClient, type RequestConfig, type HttpClientConfig } from './http/client';
70
- export { HmacAuthenticator } from './auth/hmac';
71
- export { JWTAuthenticator } from './auth/jwt';
54
+ export * from './types/index.js';
55
+ export * from './types/offramp.js';
56
+ export * from './types/onramp.js';
57
+ export * from './types/jwt.js';
58
+ export * from './types/prices.js';
59
+ export * from './types/balances.js';
60
+ export * from './errors/index.js';
61
+ export { Quote } from './api/Quote.js';
62
+ export { Recipient } from './api/Recipient.js';
63
+ export { Transaction, type PollingOptions } from './api/Transaction.js';
64
+ export { OffRamp, type OffRampPollingOptions } from './api/OffRamp.js';
65
+ export { OnRamp, type OnRampPollingOptions } from './api/OnRamp.js';
66
+ export { JWT } from './api/JWT.js';
67
+ export { Prices } from './api/Prices.js';
68
+ export { Balances } from './api/Balances.js';
69
+ export { UniversalHttpClient, type RequestConfig, type HttpClientConfig } from './http/client.js';
70
+ export { HmacAuthenticator } from './auth/hmac.js';
71
+ export { JWTAuthenticator } from './auth/jwt.js';
72
72
  export default OrdaSDK;
73
73
  //# sourceMappingURL=index.d.ts.map
@@ -1,14 +1,14 @@
1
- import { Quote } from './api/Quote';
2
- import { Recipient } from './api/Recipient';
3
- import { Transaction } from './api/Transaction';
4
- import { OffRamp } from './api/OffRamp';
5
- import { OnRamp } from './api/OnRamp';
6
- import { JWT } from './api/JWT';
7
- import { Prices } from './api/Prices';
8
- import { Balances } from './api/Balances';
9
- import { UniversalHttpClient } from './http/client';
10
- import { HmacAuthenticator } from './auth/hmac';
11
- import { JWTAuthenticator } from './auth/jwt';
1
+ import { Quote } from './api/Quote.js';
2
+ import { Recipient } from './api/Recipient.js';
3
+ import { Transaction } from './api/Transaction.js';
4
+ import { OffRamp } from './api/OffRamp.js';
5
+ import { OnRamp } from './api/OnRamp.js';
6
+ import { JWT } from './api/JWT.js';
7
+ import { Prices } from './api/Prices.js';
8
+ import { Balances } from './api/Balances.js';
9
+ import { UniversalHttpClient } from './http/client.js';
10
+ import { HmacAuthenticator } from './auth/hmac.js';
11
+ import { JWTAuthenticator } from './auth/jwt.js';
12
12
  /**
13
13
  * Main SDK class for interacting with Orda API
14
14
  *
@@ -98,23 +98,23 @@ export class OrdaSDK {
98
98
  return '2.0.0';
99
99
  }
100
100
  }
101
- export * from './types';
102
- export * from './types/offramp';
103
- export * from './types/onramp';
104
- export * from './types/jwt';
105
- export * from './types/prices';
106
- export * from './types/balances';
107
- export * from './errors';
108
- export { Quote } from './api/Quote';
109
- export { Recipient } from './api/Recipient';
110
- export { Transaction } from './api/Transaction';
111
- export { OffRamp } from './api/OffRamp';
112
- export { OnRamp } from './api/OnRamp';
113
- export { JWT } from './api/JWT';
114
- export { Prices } from './api/Prices';
115
- export { Balances } from './api/Balances';
116
- export { UniversalHttpClient } from './http/client';
117
- export { HmacAuthenticator } from './auth/hmac';
118
- export { JWTAuthenticator } from './auth/jwt';
101
+ export * from './types/index.js';
102
+ export * from './types/offramp.js';
103
+ export * from './types/onramp.js';
104
+ export * from './types/jwt.js';
105
+ export * from './types/prices.js';
106
+ export * from './types/balances.js';
107
+ export * from './errors/index.js';
108
+ export { Quote } from './api/Quote.js';
109
+ export { Recipient } from './api/Recipient.js';
110
+ export { Transaction } from './api/Transaction.js';
111
+ export { OffRamp } from './api/OffRamp.js';
112
+ export { OnRamp } from './api/OnRamp.js';
113
+ export { JWT } from './api/JWT.js';
114
+ export { Prices } from './api/Prices.js';
115
+ export { Balances } from './api/Balances.js';
116
+ export { UniversalHttpClient } from './http/client.js';
117
+ export { HmacAuthenticator } from './auth/hmac.js';
118
+ export { JWTAuthenticator } from './auth/jwt.js';
119
119
  export default OrdaSDK;
120
120
  //# sourceMappingURL=index.js.map
@@ -2,9 +2,9 @@
2
2
  * Type guards for discriminated union types
3
3
  * Use these to narrow QuoteResponse to specific types
4
4
  */
5
- import type { QuoteResponse, TransferResponse, DirectTransferResponse } from './index';
6
- import type { OffRampQuoteResponse } from './offramp';
7
- import type { OnRampQuoteResponse } from './onramp';
5
+ import type { QuoteResponse, TransferResponse, DirectTransferResponse } from './index.js';
6
+ import type { OffRampQuoteResponse } from './offramp.js';
7
+ import type { OnRampQuoteResponse } from './onramp.js';
8
8
  /**
9
9
  * Type guard for TransferResponse (crypto-to-crypto)
10
10
  * Identified by presence of 'quote' with 'providerQuoteDetails' and absence of 'depositInstructions'
@@ -1,9 +1,9 @@
1
- import type { OffRampQuoteResponse } from './offramp';
2
- import type { OnRampQuoteResponse } from './onramp';
3
- import type { ApprovalTransactionParams, TransactionRequest, ProviderQuoteDetails } from './transaction';
4
- export * from './jwt';
5
- export * from './transaction';
6
- export * from './guards';
1
+ import type { OffRampQuoteResponse } from './offramp.js';
2
+ import type { OnRampQuoteResponse } from './onramp.js';
3
+ import type { ApprovalTransactionParams, TransactionRequest, ProviderQuoteDetails } from './transaction.js';
4
+ export * from './jwt.js';
5
+ export * from './transaction.js';
6
+ export * from './guards.js';
7
7
  export type IntentMethod = 'usd' | 'fromAmount' | 'toAmount';
8
8
  export interface Intent {
9
9
  method: IntentMethod;
@@ -1,6 +1,6 @@
1
- export * from './jwt';
2
- export * from './transaction';
3
- export * from './guards';
1
+ export * from './jwt.js';
2
+ export * from './transaction.js';
3
+ export * from './guards.js';
4
4
  export var TransactionStatus;
5
5
  (function (TransactionStatus) {
6
6
  TransactionStatus["PENDING"] = "Pending";
@@ -1,5 +1,5 @@
1
- import type { Intent, KYCInformation, FiatSettlementDetails } from './index';
2
- import type { ApprovalTransactionParams, TransactionRequest } from './transaction';
1
+ import type { Intent, KYCInformation, FiatSettlementDetails } from './index.js';
2
+ import type { ApprovalTransactionParams, TransactionRequest } from './transaction.js';
3
3
  export interface OffRampQuoteParams {
4
4
  fromChain: string;
5
5
  fromToken: string;
@@ -1,4 +1,4 @@
1
- import type { Intent } from './index';
1
+ import type { Intent } from './index.js';
2
2
  /**
3
3
  * On-Ramp (Fiat to Crypto) Types
4
4
  */
@@ -1,5 +1,5 @@
1
- import { UniversalHttpClient } from '../http/client';
2
- import { BalancesFetchOptions, BalancesFetchResponse } from '../types/balances';
1
+ import { UniversalHttpClient } from '../http/client.js';
2
+ import { BalancesFetchOptions, BalancesFetchResponse } from '../types/balances.js';
3
3
  /**
4
4
  * API wrapper for token balance operations
5
5
  */
@@ -1,5 +1,5 @@
1
- import { UniversalHttpClient } from '../http/client';
2
- import { GenerateJWTRequest, GenerateJWTResponse } from '../types/jwt';
1
+ import { UniversalHttpClient } from '../http/client.js';
2
+ import { GenerateJWTRequest, GenerateJWTResponse } from '../types/jwt.js';
3
3
  /**
4
4
  * API wrapper for JWT authentication operations
5
5
  *
@@ -1,5 +1,5 @@
1
- import { UniversalHttpClient } from '../http/client';
2
- import { OffRampQuoteParams, OffRampQuoteResponse, OffRampStatusResponse, OffRampStatusType } from '../types/offramp';
1
+ import { UniversalHttpClient } from '../http/client.js';
2
+ import { OffRampQuoteParams, OffRampQuoteResponse, OffRampStatusResponse, OffRampStatusType } from '../types/offramp.js';
3
3
  /**
4
4
  * Polling options for off-ramp operations
5
5
  */
@@ -1,5 +1,5 @@
1
- import { UniversalHttpClient } from '../http/client';
2
- import { OnRampQuoteParams, OnRampQuoteResponse, OnRampStatusResponse } from '../types/onramp';
1
+ import { UniversalHttpClient } from '../http/client.js';
2
+ import { OnRampQuoteParams, OnRampQuoteResponse, OnRampStatusResponse } from '../types/onramp.js';
3
3
  export interface OnRampPollingOptions {
4
4
  intervalMs?: number;
5
5
  timeoutMs?: number;
@@ -1,5 +1,5 @@
1
- import { UniversalHttpClient } from '../http/client';
2
- import { TokenPriceRequest, PricesFetchResponse } from '../types/prices';
1
+ import { UniversalHttpClient } from '../http/client.js';
2
+ import { TokenPriceRequest, PricesFetchResponse } from '../types/prices.js';
3
3
  /**
4
4
  * API wrapper for token price operations
5
5
  */
@@ -1,5 +1,5 @@
1
- import { UniversalHttpClient } from '../http/client';
2
- import { QuoteRequestParams, TransferResponse, DirectTransferResponse } from '../types';
1
+ import { UniversalHttpClient } from '../http/client.js';
2
+ import { QuoteRequestParams, TransferResponse, DirectTransferResponse } from '../types/index.js';
3
3
  /**
4
4
  * API wrapper for quote operations
5
5
  */
@@ -1,5 +1,5 @@
1
- import { UniversalHttpClient } from '../http/client';
2
- import { CreateRecipientParams, UpdateRecipientSettlementParams, DeactivateRecipientParams, CreateRecipientResponse, UpdateRecipientResponse, DeactivateRecipientResponse, ListRecipientsParams, ListRecipientsResponse } from '../types';
1
+ import { UniversalHttpClient } from '../http/client.js';
2
+ import { CreateRecipientParams, UpdateRecipientSettlementParams, DeactivateRecipientParams, CreateRecipientResponse, UpdateRecipientResponse, DeactivateRecipientResponse, ListRecipientsParams, ListRecipientsResponse } from '../types/index.js';
3
3
  export declare class Recipient {
4
4
  private httpClient;
5
5
  constructor(httpClient: UniversalHttpClient);
@@ -1,5 +1,5 @@
1
- import { UniversalHttpClient } from '../http/client';
2
- import { TransactionStatusParams, TransactionStatusResponse, TransactionListItem, TransactionStatus } from '../types';
1
+ import { UniversalHttpClient } from '../http/client.js';
2
+ import { TransactionStatusParams, TransactionStatusResponse, TransactionListItem, TransactionStatus } from '../types/index.js';
3
3
  export interface PollingOptions {
4
4
  intervalMs?: number;
5
5
  timeoutMs?: number;
@@ -1,4 +1,4 @@
1
- import { TransactionStatus } from '../types';
1
+ import { TransactionStatus } from '../types/index.js';
2
2
  export class Transaction {
3
3
  constructor(httpClient) {
4
4
  this.httpClient = httpClient;
@@ -1,4 +1,4 @@
1
- import { getCryptoProvider } from '../crypto/factory';
1
+ import { getCryptoProvider } from '../crypto/factory.js';
2
2
  export class HmacAuthenticator {
3
3
  constructor(clientId, clientSecret) {
4
4
  this.clientId = clientId;
@@ -1,4 +1,4 @@
1
- import { CryptoProvider } from './types';
1
+ import { CryptoProvider } from './types.js';
2
2
  /**
3
3
  * Factory function to get the appropriate crypto provider
4
4
  * based on the current environment
@@ -1,5 +1,5 @@
1
- import { WebCryptoProvider } from './web-crypto';
2
- import { NodeCryptoProvider } from './node-crypto';
1
+ import { WebCryptoProvider } from './web-crypto.js';
2
+ import { NodeCryptoProvider } from './node-crypto.js';
3
3
  /**
4
4
  * Factory function to get the appropriate crypto provider
5
5
  * based on the current environment
@@ -1,4 +1,4 @@
1
- import { CryptoProvider } from './types';
1
+ import { CryptoProvider } from './types.js';
2
2
  /**
3
3
  * Node.js crypto module provider for server environments
4
4
  */
@@ -16,7 +16,7 @@ export class NodeCryptoProvider {
16
16
  if (!this.crypto) {
17
17
  // fallback to Web Crypto if available in Node
18
18
  if (typeof globalThis.crypto !== 'undefined' && globalThis.crypto.subtle) {
19
- const webProvider = await import('./web-crypto');
19
+ const webProvider = await import('./web-crypto.js');
20
20
  const provider = new webProvider.WebCryptoProvider();
21
21
  return provider.createHmacSha256(secret, message);
22
22
  }
@@ -1,4 +1,4 @@
1
- import { CryptoProvider } from './types';
1
+ import { CryptoProvider } from './types.js';
2
2
  /**
3
3
  * Web Crypto API provider for browsers and Node.js
4
4
  */
@@ -1,5 +1,5 @@
1
- import { HmacAuthenticator } from '../auth/hmac';
2
- import { JWTAuthenticator } from '../auth/jwt';
1
+ import { HmacAuthenticator } from '../auth/hmac.js';
2
+ import { JWTAuthenticator } from '../auth/jwt.js';
3
3
  /**
4
4
  * Request configuration
5
5
  */
@@ -1,6 +1,6 @@
1
- import { HmacAuthenticator } from '../auth/hmac';
2
- import { JWTAuthenticator } from '../auth/jwt';
3
- import { OrdaError, BadRequestError, UnauthorizedError, ForbiddenError, NotFoundError, NetworkError, TimeoutError, ExternalApiError, DatabaseError } from '../errors';
1
+ import { HmacAuthenticator } from '../auth/hmac.js';
2
+ import { JWTAuthenticator } from '../auth/jwt.js';
3
+ import { OrdaError, BadRequestError, UnauthorizedError, ForbiddenError, NotFoundError, NetworkError, TimeoutError, ExternalApiError, DatabaseError } from '../errors/index.js';
4
4
  /**
5
5
  * Universal HTTP client using fetch API
6
6
  */
@@ -1,12 +1,12 @@
1
- import { Quote } from './api/Quote';
2
- import { Recipient } from './api/Recipient';
3
- import { Transaction } from './api/Transaction';
4
- import { OffRamp } from './api/OffRamp';
5
- import { OnRamp } from './api/OnRamp';
6
- import { JWT } from './api/JWT';
7
- import { Prices } from './api/Prices';
8
- import { Balances } from './api/Balances';
9
- import { JWTAuthConfig } from './types/jwt';
1
+ import { Quote } from './api/Quote.js';
2
+ import { Recipient } from './api/Recipient.js';
3
+ import { Transaction } from './api/Transaction.js';
4
+ import { OffRamp } from './api/OffRamp.js';
5
+ import { OnRamp } from './api/OnRamp.js';
6
+ import { JWT } from './api/JWT.js';
7
+ import { Prices } from './api/Prices.js';
8
+ import { Balances } from './api/Balances.js';
9
+ import { JWTAuthConfig } from './types/jwt.js';
10
10
  /**
11
11
  * Configuration options for OrdaSDK
12
12
  */
@@ -51,23 +51,23 @@ export declare class OrdaSDK {
51
51
  */
52
52
  static get version(): string;
53
53
  }
54
- export * from './types';
55
- export * from './types/offramp';
56
- export * from './types/onramp';
57
- export * from './types/jwt';
58
- export * from './types/prices';
59
- export * from './types/balances';
60
- export * from './errors';
61
- export { Quote } from './api/Quote';
62
- export { Recipient } from './api/Recipient';
63
- export { Transaction, type PollingOptions } from './api/Transaction';
64
- export { OffRamp, type OffRampPollingOptions } from './api/OffRamp';
65
- export { OnRamp, type OnRampPollingOptions } from './api/OnRamp';
66
- export { JWT } from './api/JWT';
67
- export { Prices } from './api/Prices';
68
- export { Balances } from './api/Balances';
69
- export { UniversalHttpClient, type RequestConfig, type HttpClientConfig } from './http/client';
70
- export { HmacAuthenticator } from './auth/hmac';
71
- export { JWTAuthenticator } from './auth/jwt';
54
+ export * from './types/index.js';
55
+ export * from './types/offramp.js';
56
+ export * from './types/onramp.js';
57
+ export * from './types/jwt.js';
58
+ export * from './types/prices.js';
59
+ export * from './types/balances.js';
60
+ export * from './errors/index.js';
61
+ export { Quote } from './api/Quote.js';
62
+ export { Recipient } from './api/Recipient.js';
63
+ export { Transaction, type PollingOptions } from './api/Transaction.js';
64
+ export { OffRamp, type OffRampPollingOptions } from './api/OffRamp.js';
65
+ export { OnRamp, type OnRampPollingOptions } from './api/OnRamp.js';
66
+ export { JWT } from './api/JWT.js';
67
+ export { Prices } from './api/Prices.js';
68
+ export { Balances } from './api/Balances.js';
69
+ export { UniversalHttpClient, type RequestConfig, type HttpClientConfig } from './http/client.js';
70
+ export { HmacAuthenticator } from './auth/hmac.js';
71
+ export { JWTAuthenticator } from './auth/jwt.js';
72
72
  export default OrdaSDK;
73
73
  //# sourceMappingURL=index.d.ts.map
package/dist/esm/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { Quote } from './api/Quote';
2
- import { Recipient } from './api/Recipient';
3
- import { Transaction } from './api/Transaction';
4
- import { OffRamp } from './api/OffRamp';
5
- import { OnRamp } from './api/OnRamp';
6
- import { JWT } from './api/JWT';
7
- import { Prices } from './api/Prices';
8
- import { Balances } from './api/Balances';
9
- import { UniversalHttpClient } from './http/client';
10
- import { HmacAuthenticator } from './auth/hmac';
11
- import { JWTAuthenticator } from './auth/jwt';
1
+ import { Quote } from './api/Quote.js';
2
+ import { Recipient } from './api/Recipient.js';
3
+ import { Transaction } from './api/Transaction.js';
4
+ import { OffRamp } from './api/OffRamp.js';
5
+ import { OnRamp } from './api/OnRamp.js';
6
+ import { JWT } from './api/JWT.js';
7
+ import { Prices } from './api/Prices.js';
8
+ import { Balances } from './api/Balances.js';
9
+ import { UniversalHttpClient } from './http/client.js';
10
+ import { HmacAuthenticator } from './auth/hmac.js';
11
+ import { JWTAuthenticator } from './auth/jwt.js';
12
12
  /**
13
13
  * Main SDK class for interacting with Orda API
14
14
  *
@@ -98,23 +98,23 @@ export class OrdaSDK {
98
98
  return '2.0.0';
99
99
  }
100
100
  }
101
- export * from './types';
102
- export * from './types/offramp';
103
- export * from './types/onramp';
104
- export * from './types/jwt';
105
- export * from './types/prices';
106
- export * from './types/balances';
107
- export * from './errors';
108
- export { Quote } from './api/Quote';
109
- export { Recipient } from './api/Recipient';
110
- export { Transaction } from './api/Transaction';
111
- export { OffRamp } from './api/OffRamp';
112
- export { OnRamp } from './api/OnRamp';
113
- export { JWT } from './api/JWT';
114
- export { Prices } from './api/Prices';
115
- export { Balances } from './api/Balances';
116
- export { UniversalHttpClient } from './http/client';
117
- export { HmacAuthenticator } from './auth/hmac';
118
- export { JWTAuthenticator } from './auth/jwt';
101
+ export * from './types/index.js';
102
+ export * from './types/offramp.js';
103
+ export * from './types/onramp.js';
104
+ export * from './types/jwt.js';
105
+ export * from './types/prices.js';
106
+ export * from './types/balances.js';
107
+ export * from './errors/index.js';
108
+ export { Quote } from './api/Quote.js';
109
+ export { Recipient } from './api/Recipient.js';
110
+ export { Transaction } from './api/Transaction.js';
111
+ export { OffRamp } from './api/OffRamp.js';
112
+ export { OnRamp } from './api/OnRamp.js';
113
+ export { JWT } from './api/JWT.js';
114
+ export { Prices } from './api/Prices.js';
115
+ export { Balances } from './api/Balances.js';
116
+ export { UniversalHttpClient } from './http/client.js';
117
+ export { HmacAuthenticator } from './auth/hmac.js';
118
+ export { JWTAuthenticator } from './auth/jwt.js';
119
119
  export default OrdaSDK;
120
120
  //# sourceMappingURL=index.js.map
@@ -2,9 +2,9 @@
2
2
  * Type guards for discriminated union types
3
3
  * Use these to narrow QuoteResponse to specific types
4
4
  */
5
- import type { QuoteResponse, TransferResponse, DirectTransferResponse } from './index';
6
- import type { OffRampQuoteResponse } from './offramp';
7
- import type { OnRampQuoteResponse } from './onramp';
5
+ import type { QuoteResponse, TransferResponse, DirectTransferResponse } from './index.js';
6
+ import type { OffRampQuoteResponse } from './offramp.js';
7
+ import type { OnRampQuoteResponse } from './onramp.js';
8
8
  /**
9
9
  * Type guard for TransferResponse (crypto-to-crypto)
10
10
  * Identified by presence of 'quote' with 'providerQuoteDetails' and absence of 'depositInstructions'
@@ -1,9 +1,9 @@
1
- import type { OffRampQuoteResponse } from './offramp';
2
- import type { OnRampQuoteResponse } from './onramp';
3
- import type { ApprovalTransactionParams, TransactionRequest, ProviderQuoteDetails } from './transaction';
4
- export * from './jwt';
5
- export * from './transaction';
6
- export * from './guards';
1
+ import type { OffRampQuoteResponse } from './offramp.js';
2
+ import type { OnRampQuoteResponse } from './onramp.js';
3
+ import type { ApprovalTransactionParams, TransactionRequest, ProviderQuoteDetails } from './transaction.js';
4
+ export * from './jwt.js';
5
+ export * from './transaction.js';
6
+ export * from './guards.js';
7
7
  export type IntentMethod = 'usd' | 'fromAmount' | 'toAmount';
8
8
  export interface Intent {
9
9
  method: IntentMethod;
@@ -1,6 +1,6 @@
1
- export * from './jwt';
2
- export * from './transaction';
3
- export * from './guards';
1
+ export * from './jwt.js';
2
+ export * from './transaction.js';
3
+ export * from './guards.js';
4
4
  export var TransactionStatus;
5
5
  (function (TransactionStatus) {
6
6
  TransactionStatus["PENDING"] = "Pending";
@@ -1,5 +1,5 @@
1
- import type { Intent, KYCInformation, FiatSettlementDetails } from './index';
2
- import type { ApprovalTransactionParams, TransactionRequest } from './transaction';
1
+ import type { Intent, KYCInformation, FiatSettlementDetails } from './index.js';
2
+ import type { ApprovalTransactionParams, TransactionRequest } from './transaction.js';
3
3
  export interface OffRampQuoteParams {
4
4
  fromChain: string;
5
5
  fromToken: string;
@@ -1,4 +1,4 @@
1
- import type { Intent } from './index';
1
+ import type { Intent } from './index.js';
2
2
  /**
3
3
  * On-Ramp (Fiat to Crypto) Types
4
4
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ordanetwork/sdk",
3
- "version": "2.0.0-beta.0",
3
+ "version": "2.0.0",
4
4
  "description": "TypeScript SDK for orda API",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -18,7 +18,8 @@
18
18
  "files": [
19
19
  "dist",
20
20
  "README.md",
21
- "LICENSE"
21
+ "LICENSE",
22
+ "CHANGELOG.md"
22
23
  ],
23
24
  "scripts": {
24
25
  "build": "npm run clean && npm run build:types && npm run build:esm && npm run build:cjs && npm run build:browser && npm run postbuild",
@@ -27,9 +28,10 @@
27
28
  "build:esm": "tsc --module esnext --outDir dist/esm",
28
29
  "build:cjs": "tsc --module commonjs --outDir dist/cjs",
29
30
  "build:browser": "tsc --module esnext --outDir dist/browser --lib es2020,dom",
30
- "postbuild": "npm run postbuild:esm && npm run postbuild:cjs",
31
+ "postbuild": "npm run postbuild:esm && npm run postbuild:cjs && npm run postbuild:fix-extensions",
31
32
  "postbuild:esm": "echo '{\"type\": \"module\"}' > dist/esm/package.json",
32
33
  "postbuild:cjs": "echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json",
34
+ "postbuild:fix-extensions": "node scripts/fix-esm-extensions.mjs dist/esm dist/browser",
33
35
  "prepare": "npm run build",
34
36
  "test": "jest",
35
37
  "test:watch": "jest --watch",