@unicitylabs/sphere-sdk 0.16.0-dev.2 → 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.
- package/dist/connect/index.cjs +11 -5
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.cts +4 -1
- package/dist/connect/index.d.ts +4 -1
- package/dist/connect/index.js +11 -5
- package/dist/connect/index.js.map +1 -1
- package/dist/core/index.cjs +568 -172
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +67 -0
- package/dist/core/index.d.ts +67 -0
- package/dist/core/index.js +568 -172
- package/dist/core/index.js.map +1 -1
- package/dist/impl/browser/connect/index.cjs +11 -5
- package/dist/impl/browser/connect/index.cjs.map +1 -1
- package/dist/impl/browser/connect/index.d.cts +3 -1
- package/dist/impl/browser/connect/index.d.ts +3 -1
- package/dist/impl/browser/connect/index.js +11 -5
- package/dist/impl/browser/connect/index.js.map +1 -1
- package/dist/impl/browser/index.cjs +2 -2
- package/dist/impl/browser/index.cjs.map +1 -1
- package/dist/impl/browser/index.js +2 -2
- package/dist/impl/browser/index.js.map +1 -1
- package/dist/impl/nodejs/connect/index.cjs +10 -4
- package/dist/impl/nodejs/connect/index.cjs.map +1 -1
- package/dist/impl/nodejs/connect/index.d.cts +1 -1
- package/dist/impl/nodejs/connect/index.d.ts +1 -1
- package/dist/impl/nodejs/connect/index.js +10 -4
- package/dist/impl/nodejs/connect/index.js.map +1 -1
- package/dist/impl/nodejs/index.cjs +19 -3
- package/dist/impl/nodejs/index.cjs.map +1 -1
- package/dist/impl/nodejs/index.d.cts +11 -0
- package/dist/impl/nodejs/index.d.ts +11 -0
- package/dist/impl/nodejs/index.js +19 -3
- package/dist/impl/nodejs/index.js.map +1 -1
- package/dist/impl/shared/wallet-api/index.d.cts +11 -0
- package/dist/impl/shared/wallet-api/index.d.ts +11 -0
- package/dist/impl/wallet-api-v2/index.cjs +2 -0
- package/dist/impl/wallet-api-v2/index.cjs.map +1 -1
- package/dist/impl/wallet-api-v2/index.d.cts +13 -0
- package/dist/impl/wallet-api-v2/index.d.ts +13 -0
- package/dist/impl/wallet-api-v2/index.js +2 -0
- package/dist/impl/wallet-api-v2/index.js.map +1 -1
- package/dist/index.cjs +568 -172
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +61 -1
- package/dist/index.d.ts +61 -1
- package/dist/index.js +568 -172
- package/dist/index.js.map +1 -1
- package/dist/modules/payments-v2/index.cjs +609 -269
- package/dist/modules/payments-v2/index.cjs.map +1 -1
- package/dist/modules/payments-v2/index.d.cts +88 -13
- package/dist/modules/payments-v2/index.d.ts +88 -13
- package/dist/modules/payments-v2/index.js +609 -269
- package/dist/modules/payments-v2/index.js.map +1 -1
- package/dist/token-engine/index.cjs +132 -34
- package/dist/token-engine/index.cjs.map +1 -1
- package/dist/token-engine/index.d.cts +19 -0
- package/dist/token-engine/index.d.ts +19 -0
- package/dist/token-engine/index.js +132 -34
- package/dist/token-engine/index.js.map +1 -1
- package/package.json +1 -1
package/dist/connect/index.cjs
CHANGED
|
@@ -288,7 +288,7 @@ var HOST_READY_TIMEOUT = 3e4;
|
|
|
288
288
|
|
|
289
289
|
// connect/protocol.ts
|
|
290
290
|
var SPHERE_CONNECT_NAMESPACE = "sphere-connect";
|
|
291
|
-
var SPHERE_CONNECT_VERSION = "2.
|
|
291
|
+
var SPHERE_CONNECT_VERSION = "2.2";
|
|
292
292
|
var DEFAULT_MIN_CLIENT_SDK_VERSION = "0.14.1-0";
|
|
293
293
|
var RPC_METHODS = {
|
|
294
294
|
GET_IDENTITY: "sphere_getIdentity",
|
|
@@ -312,7 +312,10 @@ var INTENT_ACTIONS = {
|
|
|
312
312
|
PAYMENT_REQUEST: "payment_request",
|
|
313
313
|
RECEIVE: "receive",
|
|
314
314
|
SIGN_MESSAGE: "sign_message",
|
|
315
|
-
MINT: "mint"
|
|
315
|
+
MINT: "mint",
|
|
316
|
+
// #777: params { to, tokenId, memo? }. Named NFT rather than 'send_token':
|
|
317
|
+
// coins are tokens too, so 'token' does not say which kind moves.
|
|
318
|
+
SEND_NFT: "send_nft"
|
|
316
319
|
};
|
|
317
320
|
var ERROR_CODES = {
|
|
318
321
|
// Standard JSON-RPC
|
|
@@ -446,7 +449,7 @@ function checkCompatibility(input) {
|
|
|
446
449
|
}
|
|
447
450
|
|
|
448
451
|
// connect/version.ts
|
|
449
|
-
var SDK_VERSION = "0.
|
|
452
|
+
var SDK_VERSION = "0.17.0";
|
|
450
453
|
|
|
451
454
|
// connect/permissions.ts
|
|
452
455
|
var PERMISSION_SCOPES = {
|
|
@@ -462,7 +465,9 @@ var PERMISSION_SCOPES = {
|
|
|
462
465
|
DM_MANAGE: "dm:manage",
|
|
463
466
|
PAYMENT_REQUEST: "payment:request",
|
|
464
467
|
SIGN_REQUEST: "sign:request",
|
|
465
|
-
MINT_REQUEST: "mint:request"
|
|
468
|
+
MINT_REQUEST: "mint:request",
|
|
469
|
+
/** #777: moving a coinless token (an NFT). Distinct from transfer:request. */
|
|
470
|
+
NFT_TRANSFER: "nft:transfer"
|
|
466
471
|
};
|
|
467
472
|
var ALL_PERMISSIONS = Object.values(PERMISSION_SCOPES);
|
|
468
473
|
var DEFAULT_PERMISSIONS = [
|
|
@@ -489,7 +494,8 @@ var INTENT_PERMISSIONS = {
|
|
|
489
494
|
[INTENT_ACTIONS.PAYMENT_REQUEST]: PERMISSION_SCOPES.PAYMENT_REQUEST,
|
|
490
495
|
[INTENT_ACTIONS.RECEIVE]: PERMISSION_SCOPES.IDENTITY_READ,
|
|
491
496
|
[INTENT_ACTIONS.SIGN_MESSAGE]: PERMISSION_SCOPES.SIGN_REQUEST,
|
|
492
|
-
[INTENT_ACTIONS.MINT]: PERMISSION_SCOPES.MINT_REQUEST
|
|
497
|
+
[INTENT_ACTIONS.MINT]: PERMISSION_SCOPES.MINT_REQUEST,
|
|
498
|
+
[INTENT_ACTIONS.SEND_NFT]: PERMISSION_SCOPES.NFT_TRANSFER
|
|
493
499
|
};
|
|
494
500
|
function hasMethodPermission(granted, method) {
|
|
495
501
|
const required = METHOD_PERMISSIONS[method];
|