@unicitylabs/sphere-sdk 0.16.0 → 0.17.1

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 (53) hide show
  1. package/dist/connect/index.cjs +11 -5
  2. package/dist/connect/index.cjs.map +1 -1
  3. package/dist/connect/index.d.cts +4 -1
  4. package/dist/connect/index.d.ts +4 -1
  5. package/dist/connect/index.js +11 -5
  6. package/dist/connect/index.js.map +1 -1
  7. package/dist/core/index.cjs +692 -268
  8. package/dist/core/index.cjs.map +1 -1
  9. package/dist/core/index.d.cts +69 -0
  10. package/dist/core/index.d.ts +69 -0
  11. package/dist/core/index.js +692 -268
  12. package/dist/core/index.js.map +1 -1
  13. package/dist/impl/browser/connect/index.cjs +11 -5
  14. package/dist/impl/browser/connect/index.cjs.map +1 -1
  15. package/dist/impl/browser/connect/index.d.cts +3 -1
  16. package/dist/impl/browser/connect/index.d.ts +3 -1
  17. package/dist/impl/browser/connect/index.js +11 -5
  18. package/dist/impl/browser/connect/index.js.map +1 -1
  19. package/dist/impl/nodejs/connect/index.cjs +10 -4
  20. package/dist/impl/nodejs/connect/index.cjs.map +1 -1
  21. package/dist/impl/nodejs/connect/index.d.cts +1 -1
  22. package/dist/impl/nodejs/connect/index.d.ts +1 -1
  23. package/dist/impl/nodejs/connect/index.js +10 -4
  24. package/dist/impl/nodejs/connect/index.js.map +1 -1
  25. package/dist/impl/nodejs/index.d.cts +11 -0
  26. package/dist/impl/nodejs/index.d.ts +11 -0
  27. package/dist/impl/shared/wallet-api/index.d.cts +11 -0
  28. package/dist/impl/shared/wallet-api/index.d.ts +11 -0
  29. package/dist/impl/wallet-api-v2/index.cjs +2 -0
  30. package/dist/impl/wallet-api-v2/index.cjs.map +1 -1
  31. package/dist/impl/wallet-api-v2/index.d.cts +13 -0
  32. package/dist/impl/wallet-api-v2/index.d.ts +13 -0
  33. package/dist/impl/wallet-api-v2/index.js +2 -0
  34. package/dist/impl/wallet-api-v2/index.js.map +1 -1
  35. package/dist/index.cjs +692 -268
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.d.cts +63 -1
  38. package/dist/index.d.ts +63 -1
  39. package/dist/index.js +692 -268
  40. package/dist/index.js.map +1 -1
  41. package/dist/modules/payments-v2/index.cjs +767 -398
  42. package/dist/modules/payments-v2/index.cjs.map +1 -1
  43. package/dist/modules/payments-v2/index.d.cts +91 -14
  44. package/dist/modules/payments-v2/index.d.ts +91 -14
  45. package/dist/modules/payments-v2/index.js +767 -398
  46. package/dist/modules/payments-v2/index.js.map +1 -1
  47. package/dist/token-engine/index.cjs +132 -34
  48. package/dist/token-engine/index.cjs.map +1 -1
  49. package/dist/token-engine/index.d.cts +19 -0
  50. package/dist/token-engine/index.d.ts +19 -0
  51. package/dist/token-engine/index.js +132 -34
  52. package/dist/token-engine/index.js.map +1 -1
  53. package/package.json +1 -1
@@ -14,7 +14,7 @@ interface NetworkInfo {
14
14
  * JSON-RPC-like message types for wallet ↔ dApp communication.
15
15
  */
16
16
  declare const SPHERE_CONNECT_NAMESPACE = "sphere-connect";
17
- declare const SPHERE_CONNECT_VERSION = "2.1";
17
+ declare const SPHERE_CONNECT_VERSION = "2.2";
18
18
  interface SphereMessageBase {
19
19
  readonly ns: typeof SPHERE_CONNECT_NAMESPACE;
20
20
  readonly v: typeof SPHERE_CONNECT_VERSION;
@@ -113,6 +113,8 @@ declare const PERMISSION_SCOPES: {
113
113
  readonly PAYMENT_REQUEST: "payment:request";
114
114
  readonly SIGN_REQUEST: "sign:request";
115
115
  readonly MINT_REQUEST: "mint:request";
116
+ /** #777: moving a coinless token (an NFT). Distinct from transfer:request. */
117
+ readonly NFT_TRANSFER: "nft:transfer";
116
118
  };
117
119
  type PermissionScope = (typeof PERMISSION_SCOPES)[keyof typeof PERMISSION_SCOPES];
118
120
 
@@ -14,7 +14,7 @@ interface NetworkInfo {
14
14
  * JSON-RPC-like message types for wallet ↔ dApp communication.
15
15
  */
16
16
  declare const SPHERE_CONNECT_NAMESPACE = "sphere-connect";
17
- declare const SPHERE_CONNECT_VERSION = "2.1";
17
+ declare const SPHERE_CONNECT_VERSION = "2.2";
18
18
  interface SphereMessageBase {
19
19
  readonly ns: typeof SPHERE_CONNECT_NAMESPACE;
20
20
  readonly v: typeof SPHERE_CONNECT_VERSION;
@@ -113,6 +113,8 @@ declare const PERMISSION_SCOPES: {
113
113
  readonly PAYMENT_REQUEST: "payment:request";
114
114
  readonly SIGN_REQUEST: "sign:request";
115
115
  readonly MINT_REQUEST: "mint:request";
116
+ /** #777: moving a coinless token (an NFT). Distinct from transfer:request. */
117
+ readonly NFT_TRANSFER: "nft:transfer";
116
118
  };
117
119
  type PermissionScope = (typeof PERMISSION_SCOPES)[keyof typeof PERMISSION_SCOPES];
118
120
 
@@ -187,7 +187,7 @@ var HOST_READY_TIMEOUT = 3e4;
187
187
 
188
188
  // connect/protocol.ts
189
189
  var SPHERE_CONNECT_NAMESPACE = "sphere-connect";
190
- var SPHERE_CONNECT_VERSION = "2.1";
190
+ var SPHERE_CONNECT_VERSION = "2.2";
191
191
  var RPC_METHODS = {
192
192
  GET_IDENTITY: "sphere_getIdentity",
193
193
  GET_BALANCE: "sphere_getBalance",
@@ -210,7 +210,10 @@ var INTENT_ACTIONS = {
210
210
  PAYMENT_REQUEST: "payment_request",
211
211
  RECEIVE: "receive",
212
212
  SIGN_MESSAGE: "sign_message",
213
- MINT: "mint"
213
+ MINT: "mint",
214
+ // #777: params { to, tokenId, memo? }. Named NFT rather than 'send_token':
215
+ // coins are tokens too, so 'token' does not say which kind moves.
216
+ SEND_NFT: "send_nft"
214
217
  };
215
218
  var ERROR_CODES = {
216
219
  // Standard JSON-RPC
@@ -300,7 +303,7 @@ function createRequestId() {
300
303
  }
301
304
 
302
305
  // connect/version.ts
303
- var SDK_VERSION = "0.16.0";
306
+ var SDK_VERSION = "0.17.1";
304
307
 
305
308
  // connect/permissions.ts
306
309
  var PERMISSION_SCOPES = {
@@ -316,7 +319,9 @@ var PERMISSION_SCOPES = {
316
319
  DM_MANAGE: "dm:manage",
317
320
  PAYMENT_REQUEST: "payment:request",
318
321
  SIGN_REQUEST: "sign:request",
319
- MINT_REQUEST: "mint:request"
322
+ MINT_REQUEST: "mint:request",
323
+ /** #777: moving a coinless token (an NFT). Distinct from transfer:request. */
324
+ NFT_TRANSFER: "nft:transfer"
320
325
  };
321
326
  var ALL_PERMISSIONS = Object.values(PERMISSION_SCOPES);
322
327
  var DEFAULT_PERMISSIONS = [
@@ -343,7 +348,8 @@ var INTENT_PERMISSIONS = {
343
348
  [INTENT_ACTIONS.PAYMENT_REQUEST]: PERMISSION_SCOPES.PAYMENT_REQUEST,
344
349
  [INTENT_ACTIONS.RECEIVE]: PERMISSION_SCOPES.IDENTITY_READ,
345
350
  [INTENT_ACTIONS.SIGN_MESSAGE]: PERMISSION_SCOPES.SIGN_REQUEST,
346
- [INTENT_ACTIONS.MINT]: PERMISSION_SCOPES.MINT_REQUEST
351
+ [INTENT_ACTIONS.MINT]: PERMISSION_SCOPES.MINT_REQUEST,
352
+ [INTENT_ACTIONS.SEND_NFT]: PERMISSION_SCOPES.NFT_TRANSFER
347
353
  };
348
354
 
349
355
  // connect/host/payments-compat.ts