@unicitylabs/sphere-sdk 0.16.0 → 0.17.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 (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 +566 -171
  8. package/dist/core/index.cjs.map +1 -1
  9. package/dist/core/index.d.cts +67 -0
  10. package/dist/core/index.d.ts +67 -0
  11. package/dist/core/index.js +566 -171
  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 +566 -171
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.d.cts +61 -1
  38. package/dist/index.d.ts +61 -1
  39. package/dist/index.js +566 -171
  40. package/dist/index.js.map +1 -1
  41. package/dist/modules/payments-v2/index.cjs +609 -269
  42. package/dist/modules/payments-v2/index.cjs.map +1 -1
  43. package/dist/modules/payments-v2/index.d.cts +88 -13
  44. package/dist/modules/payments-v2/index.d.ts +88 -13
  45. package/dist/modules/payments-v2/index.js +609 -269
  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
@@ -34,7 +34,7 @@ declare const HOST_READY_TIMEOUT = 30000;
34
34
  * JSON-RPC-like message types for wallet ↔ dApp communication.
35
35
  */
36
36
  declare const SPHERE_CONNECT_NAMESPACE = "sphere-connect";
37
- declare const SPHERE_CONNECT_VERSION = "2.1";
37
+ declare const SPHERE_CONNECT_VERSION = "2.2";
38
38
  declare const RPC_METHODS: {
39
39
  readonly GET_IDENTITY: "sphere_getIdentity";
40
40
  readonly GET_BALANCE: "sphere_getBalance";
@@ -59,6 +59,7 @@ declare const INTENT_ACTIONS: {
59
59
  readonly RECEIVE: "receive";
60
60
  readonly SIGN_MESSAGE: "sign_message";
61
61
  readonly MINT: "mint";
62
+ readonly SEND_NFT: "send_nft";
62
63
  };
63
64
  type IntentAction = (typeof INTENT_ACTIONS)[keyof typeof INTENT_ACTIONS];
64
65
  declare const ERROR_CODES: {
@@ -269,6 +270,8 @@ declare const PERMISSION_SCOPES: {
269
270
  readonly PAYMENT_REQUEST: "payment:request";
270
271
  readonly SIGN_REQUEST: "sign:request";
271
272
  readonly MINT_REQUEST: "mint:request";
273
+ /** #777: moving a coinless token (an NFT). Distinct from transfer:request. */
274
+ readonly NFT_TRANSFER: "nft:transfer";
272
275
  };
273
276
  type PermissionScope = (typeof PERMISSION_SCOPES)[keyof typeof PERMISSION_SCOPES];
274
277
  /** All available permission scopes */
@@ -34,7 +34,7 @@ declare const HOST_READY_TIMEOUT = 30000;
34
34
  * JSON-RPC-like message types for wallet ↔ dApp communication.
35
35
  */
36
36
  declare const SPHERE_CONNECT_NAMESPACE = "sphere-connect";
37
- declare const SPHERE_CONNECT_VERSION = "2.1";
37
+ declare const SPHERE_CONNECT_VERSION = "2.2";
38
38
  declare const RPC_METHODS: {
39
39
  readonly GET_IDENTITY: "sphere_getIdentity";
40
40
  readonly GET_BALANCE: "sphere_getBalance";
@@ -59,6 +59,7 @@ declare const INTENT_ACTIONS: {
59
59
  readonly RECEIVE: "receive";
60
60
  readonly SIGN_MESSAGE: "sign_message";
61
61
  readonly MINT: "mint";
62
+ readonly SEND_NFT: "send_nft";
62
63
  };
63
64
  type IntentAction = (typeof INTENT_ACTIONS)[keyof typeof INTENT_ACTIONS];
64
65
  declare const ERROR_CODES: {
@@ -269,6 +270,8 @@ declare const PERMISSION_SCOPES: {
269
270
  readonly PAYMENT_REQUEST: "payment:request";
270
271
  readonly SIGN_REQUEST: "sign:request";
271
272
  readonly MINT_REQUEST: "mint:request";
273
+ /** #777: moving a coinless token (an NFT). Distinct from transfer:request. */
274
+ readonly NFT_TRANSFER: "nft:transfer";
272
275
  };
273
276
  type PermissionScope = (typeof PERMISSION_SCOPES)[keyof typeof PERMISSION_SCOPES];
274
277
  /** All available permission scopes */
@@ -239,7 +239,7 @@ var HOST_READY_TIMEOUT = 3e4;
239
239
 
240
240
  // connect/protocol.ts
241
241
  var SPHERE_CONNECT_NAMESPACE = "sphere-connect";
242
- var SPHERE_CONNECT_VERSION = "2.1";
242
+ var SPHERE_CONNECT_VERSION = "2.2";
243
243
  var DEFAULT_MIN_CLIENT_SDK_VERSION = "0.14.1-0";
244
244
  var RPC_METHODS = {
245
245
  GET_IDENTITY: "sphere_getIdentity",
@@ -263,7 +263,10 @@ var INTENT_ACTIONS = {
263
263
  PAYMENT_REQUEST: "payment_request",
264
264
  RECEIVE: "receive",
265
265
  SIGN_MESSAGE: "sign_message",
266
- MINT: "mint"
266
+ MINT: "mint",
267
+ // #777: params { to, tokenId, memo? }. Named NFT rather than 'send_token':
268
+ // coins are tokens too, so 'token' does not say which kind moves.
269
+ SEND_NFT: "send_nft"
267
270
  };
268
271
  var ERROR_CODES = {
269
272
  // Standard JSON-RPC
@@ -397,7 +400,7 @@ function checkCompatibility(input) {
397
400
  }
398
401
 
399
402
  // connect/version.ts
400
- var SDK_VERSION = "0.16.0";
403
+ var SDK_VERSION = "0.17.0";
401
404
 
402
405
  // connect/permissions.ts
403
406
  var PERMISSION_SCOPES = {
@@ -413,7 +416,9 @@ var PERMISSION_SCOPES = {
413
416
  DM_MANAGE: "dm:manage",
414
417
  PAYMENT_REQUEST: "payment:request",
415
418
  SIGN_REQUEST: "sign:request",
416
- MINT_REQUEST: "mint:request"
419
+ MINT_REQUEST: "mint:request",
420
+ /** #777: moving a coinless token (an NFT). Distinct from transfer:request. */
421
+ NFT_TRANSFER: "nft:transfer"
417
422
  };
418
423
  var ALL_PERMISSIONS = Object.values(PERMISSION_SCOPES);
419
424
  var DEFAULT_PERMISSIONS = [
@@ -440,7 +445,8 @@ var INTENT_PERMISSIONS = {
440
445
  [INTENT_ACTIONS.PAYMENT_REQUEST]: PERMISSION_SCOPES.PAYMENT_REQUEST,
441
446
  [INTENT_ACTIONS.RECEIVE]: PERMISSION_SCOPES.IDENTITY_READ,
442
447
  [INTENT_ACTIONS.SIGN_MESSAGE]: PERMISSION_SCOPES.SIGN_REQUEST,
443
- [INTENT_ACTIONS.MINT]: PERMISSION_SCOPES.MINT_REQUEST
448
+ [INTENT_ACTIONS.MINT]: PERMISSION_SCOPES.MINT_REQUEST,
449
+ [INTENT_ACTIONS.SEND_NFT]: PERMISSION_SCOPES.NFT_TRANSFER
444
450
  };
445
451
  function hasMethodPermission(granted, method) {
446
452
  const required = METHOD_PERMISSIONS[method];