@metamask/core-backend 5.0.0 → 5.1.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 (159) hide show
  1. package/CHANGELOG.md +25 -1
  2. package/README.md +252 -1
  3. package/dist/AccountActivityService.cjs +1 -1
  4. package/dist/AccountActivityService.cjs.map +1 -1
  5. package/dist/AccountActivityService.mjs +1 -1
  6. package/dist/AccountActivityService.mjs.map +1 -1
  7. package/dist/BackendWebSocketService.cjs +5 -3
  8. package/dist/BackendWebSocketService.cjs.map +1 -1
  9. package/dist/BackendWebSocketService.d.cts +2 -2
  10. package/dist/BackendWebSocketService.d.cts.map +1 -1
  11. package/dist/BackendWebSocketService.d.mts +2 -2
  12. package/dist/BackendWebSocketService.d.mts.map +1 -1
  13. package/dist/BackendWebSocketService.mjs +5 -3
  14. package/dist/BackendWebSocketService.mjs.map +1 -1
  15. package/dist/api/ApiPlatformClient.cjs +177 -0
  16. package/dist/api/ApiPlatformClient.cjs.map +1 -0
  17. package/dist/api/ApiPlatformClient.d.cts +127 -0
  18. package/dist/api/ApiPlatformClient.d.cts.map +1 -0
  19. package/dist/api/ApiPlatformClient.d.mts +127 -0
  20. package/dist/api/ApiPlatformClient.d.mts.map +1 -0
  21. package/dist/api/ApiPlatformClient.mjs +172 -0
  22. package/dist/api/ApiPlatformClient.mjs.map +1 -0
  23. package/dist/api/accounts/client.cjs +492 -0
  24. package/dist/api/accounts/client.cjs.map +1 -0
  25. package/dist/api/accounts/client.d.cts +213 -0
  26. package/dist/api/accounts/client.d.cts.map +1 -0
  27. package/dist/api/accounts/client.d.mts +213 -0
  28. package/dist/api/accounts/client.d.mts.map +1 -0
  29. package/dist/api/accounts/client.mjs +488 -0
  30. package/dist/api/accounts/client.mjs.map +1 -0
  31. package/dist/api/accounts/index.cjs +9 -0
  32. package/dist/api/accounts/index.cjs.map +1 -0
  33. package/dist/api/accounts/index.d.cts +6 -0
  34. package/dist/api/accounts/index.d.cts.map +1 -0
  35. package/dist/api/accounts/index.d.mts +6 -0
  36. package/dist/api/accounts/index.d.mts.map +1 -0
  37. package/dist/api/accounts/index.mjs +5 -0
  38. package/dist/api/accounts/index.mjs.map +1 -0
  39. package/dist/api/accounts/types.cjs +7 -0
  40. package/dist/api/accounts/types.cjs.map +1 -0
  41. package/dist/api/accounts/types.d.cts +195 -0
  42. package/dist/api/accounts/types.d.cts.map +1 -0
  43. package/dist/api/accounts/types.d.mts +195 -0
  44. package/dist/api/accounts/types.d.mts.map +1 -0
  45. package/dist/api/accounts/types.mjs +6 -0
  46. package/dist/api/accounts/types.mjs.map +1 -0
  47. package/dist/api/base-client.cjs +149 -0
  48. package/dist/api/base-client.cjs.map +1 -0
  49. package/dist/api/base-client.d.cts +54 -0
  50. package/dist/api/base-client.d.cts.map +1 -0
  51. package/dist/api/base-client.d.mts +54 -0
  52. package/dist/api/base-client.d.mts.map +1 -0
  53. package/dist/api/base-client.mjs +143 -0
  54. package/dist/api/base-client.mjs.map +1 -0
  55. package/dist/api/index.cjs +35 -0
  56. package/dist/api/index.cjs.map +1 -0
  57. package/dist/api/index.d.cts +18 -0
  58. package/dist/api/index.d.cts.map +1 -0
  59. package/dist/api/index.d.mts +18 -0
  60. package/dist/api/index.d.mts.map +1 -0
  61. package/dist/api/index.mjs +18 -0
  62. package/dist/api/index.mjs.map +1 -0
  63. package/dist/api/prices/client.cjs +521 -0
  64. package/dist/api/prices/client.cjs.map +1 -0
  65. package/dist/api/prices/client.d.cts +235 -0
  66. package/dist/api/prices/client.d.cts.map +1 -0
  67. package/dist/api/prices/client.d.mts +235 -0
  68. package/dist/api/prices/client.d.mts.map +1 -0
  69. package/dist/api/prices/client.mjs +517 -0
  70. package/dist/api/prices/client.mjs.map +1 -0
  71. package/dist/api/prices/index.cjs +9 -0
  72. package/dist/api/prices/index.cjs.map +1 -0
  73. package/dist/api/prices/index.d.cts +6 -0
  74. package/dist/api/prices/index.d.cts.map +1 -0
  75. package/dist/api/prices/index.d.mts +6 -0
  76. package/dist/api/prices/index.d.mts.map +1 -0
  77. package/dist/api/prices/index.mjs +5 -0
  78. package/dist/api/prices/index.mjs.map +1 -0
  79. package/dist/api/prices/types.cjs +7 -0
  80. package/dist/api/prices/types.cjs.map +1 -0
  81. package/dist/api/prices/types.d.cts +61 -0
  82. package/dist/api/prices/types.d.cts.map +1 -0
  83. package/dist/api/prices/types.d.mts +61 -0
  84. package/dist/api/prices/types.d.mts.map +1 -0
  85. package/dist/api/prices/types.mjs +6 -0
  86. package/dist/api/prices/types.mjs.map +1 -0
  87. package/dist/api/shared-types.cjs +93 -0
  88. package/dist/api/shared-types.cjs.map +1 -0
  89. package/dist/api/shared-types.d.cts +131 -0
  90. package/dist/api/shared-types.d.cts.map +1 -0
  91. package/dist/api/shared-types.d.mts +131 -0
  92. package/dist/api/shared-types.d.mts.map +1 -0
  93. package/dist/api/shared-types.mjs +87 -0
  94. package/dist/api/shared-types.mjs.map +1 -0
  95. package/dist/api/test-utils.cjs +70 -0
  96. package/dist/api/test-utils.cjs.map +1 -0
  97. package/dist/api/test-utils.d.cts +30 -0
  98. package/dist/api/test-utils.d.cts.map +1 -0
  99. package/dist/api/test-utils.d.mts +30 -0
  100. package/dist/api/test-utils.d.mts.map +1 -0
  101. package/dist/api/test-utils.mjs +64 -0
  102. package/dist/api/test-utils.mjs.map +1 -0
  103. package/dist/api/token/client.cjs +342 -0
  104. package/dist/api/token/client.cjs.map +1 -0
  105. package/dist/api/token/client.d.cts +193 -0
  106. package/dist/api/token/client.d.cts.map +1 -0
  107. package/dist/api/token/client.d.mts +193 -0
  108. package/dist/api/token/client.d.mts.map +1 -0
  109. package/dist/api/token/client.mjs +338 -0
  110. package/dist/api/token/client.mjs.map +1 -0
  111. package/dist/api/token/index.cjs +9 -0
  112. package/dist/api/token/index.cjs.map +1 -0
  113. package/dist/api/token/index.d.cts +6 -0
  114. package/dist/api/token/index.d.cts.map +1 -0
  115. package/dist/api/token/index.d.mts +6 -0
  116. package/dist/api/token/index.d.mts.map +1 -0
  117. package/dist/api/token/index.mjs +5 -0
  118. package/dist/api/token/index.mjs.map +1 -0
  119. package/dist/api/token/types.cjs +7 -0
  120. package/dist/api/token/types.cjs.map +1 -0
  121. package/dist/api/token/types.d.cts +75 -0
  122. package/dist/api/token/types.d.cts.map +1 -0
  123. package/dist/api/token/types.d.mts +75 -0
  124. package/dist/api/token/types.d.mts.map +1 -0
  125. package/dist/api/token/types.mjs +6 -0
  126. package/dist/api/token/types.mjs.map +1 -0
  127. package/dist/api/tokens/client.cjs +91 -0
  128. package/dist/api/tokens/client.cjs.map +1 -0
  129. package/dist/api/tokens/client.d.cts +45 -0
  130. package/dist/api/tokens/client.d.cts.map +1 -0
  131. package/dist/api/tokens/client.d.mts +45 -0
  132. package/dist/api/tokens/client.d.mts.map +1 -0
  133. package/dist/api/tokens/client.mjs +87 -0
  134. package/dist/api/tokens/client.mjs.map +1 -0
  135. package/dist/api/tokens/index.cjs +9 -0
  136. package/dist/api/tokens/index.cjs.map +1 -0
  137. package/dist/api/tokens/index.d.cts +6 -0
  138. package/dist/api/tokens/index.d.cts.map +1 -0
  139. package/dist/api/tokens/index.d.mts +6 -0
  140. package/dist/api/tokens/index.d.mts.map +1 -0
  141. package/dist/api/tokens/index.mjs +5 -0
  142. package/dist/api/tokens/index.mjs.map +1 -0
  143. package/dist/api/tokens/types.cjs +7 -0
  144. package/dist/api/tokens/types.cjs.map +1 -0
  145. package/dist/api/tokens/types.d.cts +83 -0
  146. package/dist/api/tokens/types.d.cts.map +1 -0
  147. package/dist/api/tokens/types.d.mts +83 -0
  148. package/dist/api/tokens/types.d.mts.map +1 -0
  149. package/dist/api/tokens/types.mjs +6 -0
  150. package/dist/api/tokens/types.mjs.map +1 -0
  151. package/dist/index.cjs +33 -4
  152. package/dist/index.cjs.map +1 -1
  153. package/dist/index.d.cts +6 -7
  154. package/dist/index.d.cts.map +1 -1
  155. package/dist/index.d.mts +6 -7
  156. package/dist/index.d.mts.map +1 -1
  157. package/dist/index.mjs +21 -5
  158. package/dist/index.mjs.map +1 -1
  159. package/package.json +8 -11
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAyBH,yEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAchC,uEAAkE;AAAzD,gIAAA,sBAAsB,OAAA","sourcesContent":["/**\n * @file Backend platform services for MetaMask.\n */\n\n// Transaction and balance update types\nexport type {\n Transaction,\n Asset,\n Balance,\n Transfer,\n BalanceUpdate,\n AccountActivityMessage,\n} from './types';\n\n// WebSocket Service - following MetaMask Data Services pattern\nexport type {\n BackendWebSocketServiceOptions,\n WebSocketMessage,\n WebSocketConnectionInfo,\n WebSocketSubscription,\n BackendWebSocketServiceActions,\n BackendWebSocketServiceMessenger,\n BackendWebSocketServiceEvents,\n BackendWebSocketServiceConnectionStateChangedEvent,\n WebSocketState,\n WebSocketEventType,\n} from './BackendWebSocketService';\nexport { BackendWebSocketService } from './BackendWebSocketService';\n\n// Account Activity Service\nexport type {\n SubscriptionOptions,\n AccountActivityServiceOptions,\n AccountActivityServiceActions,\n AccountActivityServiceTransactionUpdatedEvent,\n AccountActivityServiceBalanceUpdatedEvent,\n AccountActivityServiceSubscriptionErrorEvent,\n AccountActivityServiceStatusChangedEvent,\n AccountActivityServiceEvents,\n AccountActivityServiceMessenger,\n} from './AccountActivityService';\nexport { AccountActivityService } from './AccountActivityService';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,+BAA+B;;;AAE/B,+EAA+E;AAC/E,4BAA4B;AAC5B,+EAA+E;AAE/E,yEAKmC;AAJjC,kIAAA,uBAAuB,OAAA;AACvB,yHAAA,cAAc,OAAA;AACd,yHAAA,cAAc,OAAA;AACd,6HAAA,kBAAkB,OAAA;AAkBpB,+EAA+E;AAC/E,2BAA2B;AAC3B,+EAA+E;AAE/E,uEAIkC;AAHhC,gIAAA,sBAAsB,OAAA;AACtB,kJAAA,wCAAwC,OAAA;AACxC,iJAAA,uCAAuC,OAAA;AA+BzC,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E,uCAiBe;AAhBb,wGAAA,iBAAiB,OAAA;AACjB,8GAAA,uBAAuB,OAAA;AACvB,yBAAyB;AACzB,wGAAA,iBAAiB,OAAA;AACjB,sGAAA,eAAe,OAAA;AACf,qGAAA,cAAc,OAAA;AACd,sGAAA,eAAe,OAAA;AACf,YAAY;AACZ,+FAAA,QAAQ,OAAA;AACR,kGAAA,WAAW,OAAA;AACX,+FAAA,QAAQ,OAAA;AACR,UAAU;AACV,0GAAA,mBAAmB,OAAA;AACnB,kGAAA,WAAW,OAAA;AACX,SAAS;AACT,gGAAA,SAAS,OAAA","sourcesContent":["// Core Backend Package Exports\n\n// ============================================================================\n// BACKEND WEBSOCKET SERVICE\n// ============================================================================\n\nexport {\n BackendWebSocketService,\n getCloseReason,\n WebSocketState,\n WebSocketEventType,\n} from './BackendWebSocketService';\n\nexport type {\n BackendWebSocketServiceOptions,\n ClientRequestMessage,\n ServerResponseMessage,\n ServerNotificationMessage,\n WebSocketMessage,\n ChannelCallback,\n WebSocketSubscription,\n WebSocketConnectionInfo,\n BackendWebSocketServiceActions,\n BackendWebSocketServiceConnectionStateChangedEvent,\n BackendWebSocketServiceEvents,\n BackendWebSocketServiceMessenger,\n} from './BackendWebSocketService';\n\n// ============================================================================\n// ACCOUNT ACTIVITY SERVICE\n// ============================================================================\n\nexport {\n AccountActivityService,\n ACCOUNT_ACTIVITY_SERVICE_ALLOWED_ACTIONS,\n ACCOUNT_ACTIVITY_SERVICE_ALLOWED_EVENTS,\n} from './AccountActivityService';\n\nexport type {\n SystemNotificationData,\n SubscriptionOptions,\n AccountActivityServiceOptions,\n AccountActivityServiceActions,\n AllowedActions as AccountActivityServiceAllowedActions,\n AccountActivityServiceTransactionUpdatedEvent,\n AccountActivityServiceBalanceUpdatedEvent,\n AccountActivityServiceSubscriptionErrorEvent,\n AccountActivityServiceStatusChangedEvent,\n AccountActivityServiceEvents,\n AllowedEvents as AccountActivityServiceAllowedEvents,\n AccountActivityServiceMessenger,\n} from './AccountActivityService';\n\n// ============================================================================\n// SHARED TYPES\n// ============================================================================\n\nexport type {\n Transaction,\n Asset,\n Balance,\n Transfer,\n BalanceUpdate,\n AccountActivityMessage,\n} from './types';\n\n// ============================================================================\n// API PLATFORM CLIENT\n// ============================================================================\n\nexport {\n ApiPlatformClient,\n createApiPlatformClient,\n // Individual API clients\n AccountsApiClient,\n PricesApiClient,\n TokenApiClient,\n TokensApiClient,\n // Constants\n API_URLS,\n STALE_TIMES,\n GC_TIMES,\n // Helpers\n calculateRetryDelay,\n shouldRetry,\n // Errors\n HttpError,\n} from './api';\n\n// ============================================================================\n// API PLATFORM CLIENT TYPES\n// ============================================================================\n\nexport type {\n // Client options\n ApiPlatformClientOptions,\n FetchOptions,\n // Shared types\n PageInfo,\n SupportedCurrency,\n MarketDataDetails,\n // Accounts API types\n V5BalanceItem,\n V5BalancesResponse,\n V2BalanceItem,\n V2BalancesResponse,\n V4BalancesResponse,\n V1SupportedNetworksResponse,\n V2SupportedNetworksResponse,\n V2ActiveNetworksResponse,\n V1TransactionByHashResponse,\n V1AccountTransactionsResponse,\n V4MultiAccountTransactionsResponse,\n ValueTransfer,\n V1AccountRelationshipResult,\n NftItem,\n V2NftsResponse,\n TokenDiscoveryItem,\n V2TokensResponse,\n // Prices API types\n V3SpotPricesResponse,\n CoinGeckoSpotPrice,\n ExchangeRateInfo,\n V1ExchangeRatesResponse,\n PriceSupportedNetworksResponse,\n V1HistoricalPricesResponse,\n V3HistoricalPricesResponse,\n // Token API types\n TokenMetadata,\n V1TokenDescriptionResponse,\n NetworkInfo,\n TopAsset,\n TrendingSortBy,\n TrendingToken,\n TopGainersSortOption,\n TrendingSortOption,\n V1SuggestedOccurrenceFloorsResponse,\n // Tokens API types\n V1TokenSupportedNetworksResponse,\n V2TokenSupportedNetworksResponse,\n V3AssetResponse,\n} from './api';\n"]}
package/dist/index.d.cts CHANGED
@@ -1,9 +1,8 @@
1
- /**
2
- * @file Backend platform services for MetaMask.
3
- */
1
+ export { BackendWebSocketService, getCloseReason, WebSocketState, WebSocketEventType, } from "./BackendWebSocketService.cjs";
2
+ export type { BackendWebSocketServiceOptions, ClientRequestMessage, ServerResponseMessage, ServerNotificationMessage, WebSocketMessage, ChannelCallback, WebSocketSubscription, WebSocketConnectionInfo, BackendWebSocketServiceActions, BackendWebSocketServiceConnectionStateChangedEvent, BackendWebSocketServiceEvents, BackendWebSocketServiceMessenger, } from "./BackendWebSocketService.cjs";
3
+ export { AccountActivityService, ACCOUNT_ACTIVITY_SERVICE_ALLOWED_ACTIONS, ACCOUNT_ACTIVITY_SERVICE_ALLOWED_EVENTS, } from "./AccountActivityService.cjs";
4
+ export type { SystemNotificationData, SubscriptionOptions, AccountActivityServiceOptions, AccountActivityServiceActions, AllowedActions as AccountActivityServiceAllowedActions, AccountActivityServiceTransactionUpdatedEvent, AccountActivityServiceBalanceUpdatedEvent, AccountActivityServiceSubscriptionErrorEvent, AccountActivityServiceStatusChangedEvent, AccountActivityServiceEvents, AllowedEvents as AccountActivityServiceAllowedEvents, AccountActivityServiceMessenger, } from "./AccountActivityService.cjs";
4
5
  export type { Transaction, Asset, Balance, Transfer, BalanceUpdate, AccountActivityMessage, } from "./types.cjs";
5
- export type { BackendWebSocketServiceOptions, WebSocketMessage, WebSocketConnectionInfo, WebSocketSubscription, BackendWebSocketServiceActions, BackendWebSocketServiceMessenger, BackendWebSocketServiceEvents, BackendWebSocketServiceConnectionStateChangedEvent, WebSocketState, WebSocketEventType, } from "./BackendWebSocketService.cjs";
6
- export { BackendWebSocketService } from "./BackendWebSocketService.cjs";
7
- export type { SubscriptionOptions, AccountActivityServiceOptions, AccountActivityServiceActions, AccountActivityServiceTransactionUpdatedEvent, AccountActivityServiceBalanceUpdatedEvent, AccountActivityServiceSubscriptionErrorEvent, AccountActivityServiceStatusChangedEvent, AccountActivityServiceEvents, AccountActivityServiceMessenger, } from "./AccountActivityService.cjs";
8
- export { AccountActivityService } from "./AccountActivityService.cjs";
6
+ export { ApiPlatformClient, createApiPlatformClient, AccountsApiClient, PricesApiClient, TokenApiClient, TokensApiClient, API_URLS, STALE_TIMES, GC_TIMES, calculateRetryDelay, shouldRetry, HttpError, } from "./api/index.cjs";
7
+ export type { ApiPlatformClientOptions, FetchOptions, PageInfo, SupportedCurrency, MarketDataDetails, V5BalanceItem, V5BalancesResponse, V2BalanceItem, V2BalancesResponse, V4BalancesResponse, V1SupportedNetworksResponse, V2SupportedNetworksResponse, V2ActiveNetworksResponse, V1TransactionByHashResponse, V1AccountTransactionsResponse, V4MultiAccountTransactionsResponse, ValueTransfer, V1AccountRelationshipResult, NftItem, V2NftsResponse, TokenDiscoveryItem, V2TokensResponse, V3SpotPricesResponse, CoinGeckoSpotPrice, ExchangeRateInfo, V1ExchangeRatesResponse, PriceSupportedNetworksResponse, V1HistoricalPricesResponse, V3HistoricalPricesResponse, TokenMetadata, V1TokenDescriptionResponse, NetworkInfo, TopAsset, TrendingSortBy, TrendingToken, TopGainersSortOption, TrendingSortOption, V1SuggestedOccurrenceFloorsResponse, V1TokenSupportedNetworksResponse, V2TokenSupportedNetworksResponse, V3AssetResponse, } from "./api/index.cjs";
9
8
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,YAAY,EACV,WAAW,EACX,KAAK,EACL,OAAO,EACP,QAAQ,EACR,aAAa,EACb,sBAAsB,GACvB,oBAAgB;AAGjB,YAAY,EACV,8BAA8B,EAC9B,gBAAgB,EAChB,uBAAuB,EACvB,qBAAqB,EACrB,8BAA8B,EAC9B,gCAAgC,EAChC,6BAA6B,EAC7B,kDAAkD,EAClD,cAAc,EACd,kBAAkB,GACnB,sCAAkC;AACnC,OAAO,EAAE,uBAAuB,EAAE,sCAAkC;AAGpE,YAAY,EACV,mBAAmB,EACnB,6BAA6B,EAC7B,6BAA6B,EAC7B,6CAA6C,EAC7C,yCAAyC,EACzC,4CAA4C,EAC5C,wCAAwC,EACxC,4BAA4B,EAC5B,+BAA+B,GAChC,qCAAiC;AAClC,OAAO,EAAE,sBAAsB,EAAE,qCAAiC"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,kBAAkB,GACnB,sCAAkC;AAEnC,YAAY,EACV,8BAA8B,EAC9B,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,8BAA8B,EAC9B,kDAAkD,EAClD,6BAA6B,EAC7B,gCAAgC,GACjC,sCAAkC;AAMnC,OAAO,EACL,sBAAsB,EACtB,wCAAwC,EACxC,uCAAuC,GACxC,qCAAiC;AAElC,YAAY,EACV,sBAAsB,EACtB,mBAAmB,EACnB,6BAA6B,EAC7B,6BAA6B,EAC7B,cAAc,IAAI,oCAAoC,EACtD,6CAA6C,EAC7C,yCAAyC,EACzC,4CAA4C,EAC5C,wCAAwC,EACxC,4BAA4B,EAC5B,aAAa,IAAI,mCAAmC,EACpD,+BAA+B,GAChC,qCAAiC;AAMlC,YAAY,EACV,WAAW,EACX,KAAK,EACL,OAAO,EACP,QAAQ,EACR,aAAa,EACb,sBAAsB,GACvB,oBAAgB;AAMjB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EAEvB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,eAAe,EAEf,QAAQ,EACR,WAAW,EACX,QAAQ,EAER,mBAAmB,EACnB,WAAW,EAEX,SAAS,GACV,wBAAc;AAMf,YAAY,EAEV,wBAAwB,EACxB,YAAY,EAEZ,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,EAEjB,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,2BAA2B,EAC3B,2BAA2B,EAC3B,wBAAwB,EACxB,2BAA2B,EAC3B,6BAA6B,EAC7B,kCAAkC,EAClC,aAAa,EACb,2BAA2B,EAC3B,OAAO,EACP,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAEhB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,uBAAuB,EACvB,8BAA8B,EAC9B,0BAA0B,EAC1B,0BAA0B,EAE1B,aAAa,EACb,0BAA0B,EAC1B,WAAW,EACX,QAAQ,EACR,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,mCAAmC,EAEnC,gCAAgC,EAChC,gCAAgC,EAChC,eAAe,GAChB,wBAAc"}
package/dist/index.d.mts CHANGED
@@ -1,9 +1,8 @@
1
- /**
2
- * @file Backend platform services for MetaMask.
3
- */
1
+ export { BackendWebSocketService, getCloseReason, WebSocketState, WebSocketEventType, } from "./BackendWebSocketService.mjs";
2
+ export type { BackendWebSocketServiceOptions, ClientRequestMessage, ServerResponseMessage, ServerNotificationMessage, WebSocketMessage, ChannelCallback, WebSocketSubscription, WebSocketConnectionInfo, BackendWebSocketServiceActions, BackendWebSocketServiceConnectionStateChangedEvent, BackendWebSocketServiceEvents, BackendWebSocketServiceMessenger, } from "./BackendWebSocketService.mjs";
3
+ export { AccountActivityService, ACCOUNT_ACTIVITY_SERVICE_ALLOWED_ACTIONS, ACCOUNT_ACTIVITY_SERVICE_ALLOWED_EVENTS, } from "./AccountActivityService.mjs";
4
+ export type { SystemNotificationData, SubscriptionOptions, AccountActivityServiceOptions, AccountActivityServiceActions, AllowedActions as AccountActivityServiceAllowedActions, AccountActivityServiceTransactionUpdatedEvent, AccountActivityServiceBalanceUpdatedEvent, AccountActivityServiceSubscriptionErrorEvent, AccountActivityServiceStatusChangedEvent, AccountActivityServiceEvents, AllowedEvents as AccountActivityServiceAllowedEvents, AccountActivityServiceMessenger, } from "./AccountActivityService.mjs";
4
5
  export type { Transaction, Asset, Balance, Transfer, BalanceUpdate, AccountActivityMessage, } from "./types.mjs";
5
- export type { BackendWebSocketServiceOptions, WebSocketMessage, WebSocketConnectionInfo, WebSocketSubscription, BackendWebSocketServiceActions, BackendWebSocketServiceMessenger, BackendWebSocketServiceEvents, BackendWebSocketServiceConnectionStateChangedEvent, WebSocketState, WebSocketEventType, } from "./BackendWebSocketService.mjs";
6
- export { BackendWebSocketService } from "./BackendWebSocketService.mjs";
7
- export type { SubscriptionOptions, AccountActivityServiceOptions, AccountActivityServiceActions, AccountActivityServiceTransactionUpdatedEvent, AccountActivityServiceBalanceUpdatedEvent, AccountActivityServiceSubscriptionErrorEvent, AccountActivityServiceStatusChangedEvent, AccountActivityServiceEvents, AccountActivityServiceMessenger, } from "./AccountActivityService.mjs";
8
- export { AccountActivityService } from "./AccountActivityService.mjs";
6
+ export { ApiPlatformClient, createApiPlatformClient, AccountsApiClient, PricesApiClient, TokenApiClient, TokensApiClient, API_URLS, STALE_TIMES, GC_TIMES, calculateRetryDelay, shouldRetry, HttpError, } from "./api/index.mjs";
7
+ export type { ApiPlatformClientOptions, FetchOptions, PageInfo, SupportedCurrency, MarketDataDetails, V5BalanceItem, V5BalancesResponse, V2BalanceItem, V2BalancesResponse, V4BalancesResponse, V1SupportedNetworksResponse, V2SupportedNetworksResponse, V2ActiveNetworksResponse, V1TransactionByHashResponse, V1AccountTransactionsResponse, V4MultiAccountTransactionsResponse, ValueTransfer, V1AccountRelationshipResult, NftItem, V2NftsResponse, TokenDiscoveryItem, V2TokensResponse, V3SpotPricesResponse, CoinGeckoSpotPrice, ExchangeRateInfo, V1ExchangeRatesResponse, PriceSupportedNetworksResponse, V1HistoricalPricesResponse, V3HistoricalPricesResponse, TokenMetadata, V1TokenDescriptionResponse, NetworkInfo, TopAsset, TrendingSortBy, TrendingToken, TopGainersSortOption, TrendingSortOption, V1SuggestedOccurrenceFloorsResponse, V1TokenSupportedNetworksResponse, V2TokenSupportedNetworksResponse, V3AssetResponse, } from "./api/index.mjs";
9
8
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,YAAY,EACV,WAAW,EACX,KAAK,EACL,OAAO,EACP,QAAQ,EACR,aAAa,EACb,sBAAsB,GACvB,oBAAgB;AAGjB,YAAY,EACV,8BAA8B,EAC9B,gBAAgB,EAChB,uBAAuB,EACvB,qBAAqB,EACrB,8BAA8B,EAC9B,gCAAgC,EAChC,6BAA6B,EAC7B,kDAAkD,EAClD,cAAc,EACd,kBAAkB,GACnB,sCAAkC;AACnC,OAAO,EAAE,uBAAuB,EAAE,sCAAkC;AAGpE,YAAY,EACV,mBAAmB,EACnB,6BAA6B,EAC7B,6BAA6B,EAC7B,6CAA6C,EAC7C,yCAAyC,EACzC,4CAA4C,EAC5C,wCAAwC,EACxC,4BAA4B,EAC5B,+BAA+B,GAChC,qCAAiC;AAClC,OAAO,EAAE,sBAAsB,EAAE,qCAAiC"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,kBAAkB,GACnB,sCAAkC;AAEnC,YAAY,EACV,8BAA8B,EAC9B,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,8BAA8B,EAC9B,kDAAkD,EAClD,6BAA6B,EAC7B,gCAAgC,GACjC,sCAAkC;AAMnC,OAAO,EACL,sBAAsB,EACtB,wCAAwC,EACxC,uCAAuC,GACxC,qCAAiC;AAElC,YAAY,EACV,sBAAsB,EACtB,mBAAmB,EACnB,6BAA6B,EAC7B,6BAA6B,EAC7B,cAAc,IAAI,oCAAoC,EACtD,6CAA6C,EAC7C,yCAAyC,EACzC,4CAA4C,EAC5C,wCAAwC,EACxC,4BAA4B,EAC5B,aAAa,IAAI,mCAAmC,EACpD,+BAA+B,GAChC,qCAAiC;AAMlC,YAAY,EACV,WAAW,EACX,KAAK,EACL,OAAO,EACP,QAAQ,EACR,aAAa,EACb,sBAAsB,GACvB,oBAAgB;AAMjB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EAEvB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,eAAe,EAEf,QAAQ,EACR,WAAW,EACX,QAAQ,EAER,mBAAmB,EACnB,WAAW,EAEX,SAAS,GACV,wBAAc;AAMf,YAAY,EAEV,wBAAwB,EACxB,YAAY,EAEZ,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,EAEjB,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,2BAA2B,EAC3B,2BAA2B,EAC3B,wBAAwB,EACxB,2BAA2B,EAC3B,6BAA6B,EAC7B,kCAAkC,EAClC,aAAa,EACb,2BAA2B,EAC3B,OAAO,EACP,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAEhB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,uBAAuB,EACvB,8BAA8B,EAC9B,0BAA0B,EAC1B,0BAA0B,EAE1B,aAAa,EACb,0BAA0B,EAC1B,WAAW,EACX,QAAQ,EACR,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,mCAAmC,EAEnC,gCAAgC,EAChC,gCAAgC,EAChC,eAAe,GAChB,wBAAc"}
package/dist/index.mjs CHANGED
@@ -1,6 +1,22 @@
1
- /**
2
- * @file Backend platform services for MetaMask.
3
- */
4
- export { BackendWebSocketService } from "./BackendWebSocketService.mjs";
5
- export { AccountActivityService } from "./AccountActivityService.mjs";
1
+ // Core Backend Package Exports
2
+ // ============================================================================
3
+ // BACKEND WEBSOCKET SERVICE
4
+ // ============================================================================
5
+ export { BackendWebSocketService, getCloseReason, WebSocketState, WebSocketEventType } from "./BackendWebSocketService.mjs";
6
+ // ============================================================================
7
+ // ACCOUNT ACTIVITY SERVICE
8
+ // ============================================================================
9
+ export { AccountActivityService, ACCOUNT_ACTIVITY_SERVICE_ALLOWED_ACTIONS, ACCOUNT_ACTIVITY_SERVICE_ALLOWED_EVENTS } from "./AccountActivityService.mjs";
10
+ // ============================================================================
11
+ // API PLATFORM CLIENT
12
+ // ============================================================================
13
+ export { ApiPlatformClient, createApiPlatformClient,
14
+ // Individual API clients
15
+ AccountsApiClient, PricesApiClient, TokenApiClient, TokensApiClient,
16
+ // Constants
17
+ API_URLS, STALE_TIMES, GC_TIMES,
18
+ // Helpers
19
+ calculateRetryDelay, shouldRetry,
20
+ // Errors
21
+ HttpError } from "./api/index.mjs";
6
22
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAyBH,OAAO,EAAE,uBAAuB,EAAE,sCAAkC;AAcpE,OAAO,EAAE,sBAAsB,EAAE,qCAAiC","sourcesContent":["/**\n * @file Backend platform services for MetaMask.\n */\n\n// Transaction and balance update types\nexport type {\n Transaction,\n Asset,\n Balance,\n Transfer,\n BalanceUpdate,\n AccountActivityMessage,\n} from './types';\n\n// WebSocket Service - following MetaMask Data Services pattern\nexport type {\n BackendWebSocketServiceOptions,\n WebSocketMessage,\n WebSocketConnectionInfo,\n WebSocketSubscription,\n BackendWebSocketServiceActions,\n BackendWebSocketServiceMessenger,\n BackendWebSocketServiceEvents,\n BackendWebSocketServiceConnectionStateChangedEvent,\n WebSocketState,\n WebSocketEventType,\n} from './BackendWebSocketService';\nexport { BackendWebSocketService } from './BackendWebSocketService';\n\n// Account Activity Service\nexport type {\n SubscriptionOptions,\n AccountActivityServiceOptions,\n AccountActivityServiceActions,\n AccountActivityServiceTransactionUpdatedEvent,\n AccountActivityServiceBalanceUpdatedEvent,\n AccountActivityServiceSubscriptionErrorEvent,\n AccountActivityServiceStatusChangedEvent,\n AccountActivityServiceEvents,\n AccountActivityServiceMessenger,\n} from './AccountActivityService';\nexport { AccountActivityService } from './AccountActivityService';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAE/B,+EAA+E;AAC/E,4BAA4B;AAC5B,+EAA+E;AAE/E,OAAO,EACL,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,kBAAkB,EACnB,sCAAkC;AAiBnC,+EAA+E;AAC/E,2BAA2B;AAC3B,+EAA+E;AAE/E,OAAO,EACL,sBAAsB,EACtB,wCAAwC,EACxC,uCAAuC,EACxC,qCAAiC;AA8BlC,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E,OAAO,EACL,iBAAiB,EACjB,uBAAuB;AACvB,yBAAyB;AACzB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,eAAe;AACf,YAAY;AACZ,QAAQ,EACR,WAAW,EACX,QAAQ;AACR,UAAU;AACV,mBAAmB,EACnB,WAAW;AACX,SAAS;AACT,SAAS,EACV,wBAAc","sourcesContent":["// Core Backend Package Exports\n\n// ============================================================================\n// BACKEND WEBSOCKET SERVICE\n// ============================================================================\n\nexport {\n BackendWebSocketService,\n getCloseReason,\n WebSocketState,\n WebSocketEventType,\n} from './BackendWebSocketService';\n\nexport type {\n BackendWebSocketServiceOptions,\n ClientRequestMessage,\n ServerResponseMessage,\n ServerNotificationMessage,\n WebSocketMessage,\n ChannelCallback,\n WebSocketSubscription,\n WebSocketConnectionInfo,\n BackendWebSocketServiceActions,\n BackendWebSocketServiceConnectionStateChangedEvent,\n BackendWebSocketServiceEvents,\n BackendWebSocketServiceMessenger,\n} from './BackendWebSocketService';\n\n// ============================================================================\n// ACCOUNT ACTIVITY SERVICE\n// ============================================================================\n\nexport {\n AccountActivityService,\n ACCOUNT_ACTIVITY_SERVICE_ALLOWED_ACTIONS,\n ACCOUNT_ACTIVITY_SERVICE_ALLOWED_EVENTS,\n} from './AccountActivityService';\n\nexport type {\n SystemNotificationData,\n SubscriptionOptions,\n AccountActivityServiceOptions,\n AccountActivityServiceActions,\n AllowedActions as AccountActivityServiceAllowedActions,\n AccountActivityServiceTransactionUpdatedEvent,\n AccountActivityServiceBalanceUpdatedEvent,\n AccountActivityServiceSubscriptionErrorEvent,\n AccountActivityServiceStatusChangedEvent,\n AccountActivityServiceEvents,\n AllowedEvents as AccountActivityServiceAllowedEvents,\n AccountActivityServiceMessenger,\n} from './AccountActivityService';\n\n// ============================================================================\n// SHARED TYPES\n// ============================================================================\n\nexport type {\n Transaction,\n Asset,\n Balance,\n Transfer,\n BalanceUpdate,\n AccountActivityMessage,\n} from './types';\n\n// ============================================================================\n// API PLATFORM CLIENT\n// ============================================================================\n\nexport {\n ApiPlatformClient,\n createApiPlatformClient,\n // Individual API clients\n AccountsApiClient,\n PricesApiClient,\n TokenApiClient,\n TokensApiClient,\n // Constants\n API_URLS,\n STALE_TIMES,\n GC_TIMES,\n // Helpers\n calculateRetryDelay,\n shouldRetry,\n // Errors\n HttpError,\n} from './api';\n\n// ============================================================================\n// API PLATFORM CLIENT TYPES\n// ============================================================================\n\nexport type {\n // Client options\n ApiPlatformClientOptions,\n FetchOptions,\n // Shared types\n PageInfo,\n SupportedCurrency,\n MarketDataDetails,\n // Accounts API types\n V5BalanceItem,\n V5BalancesResponse,\n V2BalanceItem,\n V2BalancesResponse,\n V4BalancesResponse,\n V1SupportedNetworksResponse,\n V2SupportedNetworksResponse,\n V2ActiveNetworksResponse,\n V1TransactionByHashResponse,\n V1AccountTransactionsResponse,\n V4MultiAccountTransactionsResponse,\n ValueTransfer,\n V1AccountRelationshipResult,\n NftItem,\n V2NftsResponse,\n TokenDiscoveryItem,\n V2TokensResponse,\n // Prices API types\n V3SpotPricesResponse,\n CoinGeckoSpotPrice,\n ExchangeRateInfo,\n V1ExchangeRatesResponse,\n PriceSupportedNetworksResponse,\n V1HistoricalPricesResponse,\n V3HistoricalPricesResponse,\n // Token API types\n TokenMetadata,\n V1TokenDescriptionResponse,\n NetworkInfo,\n TopAsset,\n TrendingSortBy,\n TrendingToken,\n TopGainersSortOption,\n TrendingSortOption,\n V1SuggestedOccurrenceFloorsResponse,\n // Tokens API types\n V1TokenSupportedNetworksResponse,\n V2TokenSupportedNetworksResponse,\n V3AssetResponse,\n} from './api';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/core-backend",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "Core backend services for MetaMask",
5
5
  "keywords": [
6
6
  "MetaMask",
@@ -48,30 +48,27 @@
48
48
  "test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
49
49
  },
50
50
  "dependencies": {
51
- "@metamask/controller-utils": "^11.16.0",
51
+ "@metamask/accounts-controller": "^35.0.2",
52
+ "@metamask/controller-utils": "^11.18.0",
53
+ "@metamask/keyring-controller": "^25.1.0",
52
54
  "@metamask/messenger": "^0.3.0",
53
55
  "@metamask/profile-sync-controller": "^27.0.0",
54
- "@metamask/utils": "^11.8.1",
56
+ "@metamask/utils": "^11.9.0",
57
+ "@tanstack/query-core": "^5.62.16",
55
58
  "uuid": "^8.3.2"
56
59
  },
57
60
  "devDependencies": {
58
- "@metamask/accounts-controller": "^35.0.0",
59
61
  "@metamask/auto-changelog": "^3.4.4",
60
- "@metamask/keyring-controller": "^25.0.0",
61
62
  "@ts-bridge/cli": "^0.6.4",
62
- "@types/jest": "^27.4.1",
63
+ "@types/jest": "^27.5.2",
63
64
  "deepmerge": "^4.2.2",
64
65
  "jest": "^27.5.1",
65
66
  "sinon": "^9.2.4",
66
- "ts-jest": "^27.1.4",
67
+ "ts-jest": "^27.1.5",
67
68
  "typedoc": "^0.24.8",
68
69
  "typedoc-plugin-missing-exports": "^2.0.0",
69
70
  "typescript": "~5.3.3"
70
71
  },
71
- "peerDependencies": {
72
- "@metamask/accounts-controller": "^35.0.0",
73
- "@metamask/keyring-controller": "^25.0.0"
74
- },
75
72
  "engines": {
76
73
  "node": "^18.18 || >=20"
77
74
  },