@unicitylabs/sphere-sdk 0.17.2-dev.1 → 0.17.2-dev.2
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 +199 -8
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.cts +77 -4
- package/dist/connect/index.d.ts +77 -4
- package/dist/connect/index.js +199 -8
- package/dist/connect/index.js.map +1 -1
- package/dist/impl/browser/connect/index.cjs +17 -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 +17 -5
- package/dist/impl/browser/connect/index.js.map +1 -1
- package/dist/impl/nodejs/connect/index.cjs +16 -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 +16 -4
- package/dist/impl/nodejs/connect/index.js.map +1 -1
- 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.
|
|
17
|
+
declare const SPHERE_CONNECT_VERSION = "2.3";
|
|
18
18
|
interface SphereMessageBase {
|
|
19
19
|
readonly ns: typeof SPHERE_CONNECT_NAMESPACE;
|
|
20
20
|
readonly v: typeof SPHERE_CONNECT_VERSION;
|
|
@@ -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.
|
|
17
|
+
declare const SPHERE_CONNECT_VERSION = "2.3";
|
|
18
18
|
interface SphereMessageBase {
|
|
19
19
|
readonly ns: typeof SPHERE_CONNECT_NAMESPACE;
|
|
20
20
|
readonly v: typeof SPHERE_CONNECT_VERSION;
|
|
@@ -188,7 +188,7 @@ var SPHERE_NETWORKS = {
|
|
|
188
188
|
|
|
189
189
|
// connect/protocol.ts
|
|
190
190
|
var SPHERE_CONNECT_NAMESPACE = "sphere-connect";
|
|
191
|
-
var SPHERE_CONNECT_VERSION = "2.
|
|
191
|
+
var SPHERE_CONNECT_VERSION = "2.3";
|
|
192
192
|
var RPC_METHODS = {
|
|
193
193
|
GET_IDENTITY: "sphere_getIdentity",
|
|
194
194
|
GET_BALANCE: "sphere_getBalance",
|
|
@@ -214,7 +214,9 @@ var INTENT_ACTIONS = {
|
|
|
214
214
|
MINT: "mint",
|
|
215
215
|
// #777: params { to, tokenId, memo? }. Named NFT rather than 'send_token':
|
|
216
216
|
// coins are tokens too, so 'token' does not say which kind moves.
|
|
217
|
-
SEND_NFT: "send_nft"
|
|
217
|
+
SEND_NFT: "send_nft",
|
|
218
|
+
// Connect 2.3: params MintNftIntentParams, result MintNftIntentResult (connect/nft-wire.ts).
|
|
219
|
+
MINT_NFT: "mint_nft"
|
|
218
220
|
};
|
|
219
221
|
var ERROR_CODES = {
|
|
220
222
|
// Standard JSON-RPC
|
|
@@ -310,7 +312,9 @@ var PERMISSION_SCOPES = {
|
|
|
310
312
|
SIGN_REQUEST: "sign:request",
|
|
311
313
|
MINT_REQUEST: "mint:request",
|
|
312
314
|
/** #777: moving a coinless token (an NFT). Distinct from transfer:request. */
|
|
313
|
-
NFT_TRANSFER: "nft:transfer"
|
|
315
|
+
NFT_TRANSFER: "nft:transfer",
|
|
316
|
+
/** Minting an NFT signs dApp-chosen content as the user; mint:request and nft:transfer do not imply it. */
|
|
317
|
+
NFT_MINT: "nft:mint"
|
|
314
318
|
};
|
|
315
319
|
var ALL_PERMISSIONS = Object.values(PERMISSION_SCOPES);
|
|
316
320
|
var DEFAULT_PERMISSIONS = [
|
|
@@ -338,7 +342,8 @@ var INTENT_PERMISSIONS = {
|
|
|
338
342
|
[INTENT_ACTIONS.RECEIVE]: PERMISSION_SCOPES.IDENTITY_READ,
|
|
339
343
|
[INTENT_ACTIONS.SIGN_MESSAGE]: PERMISSION_SCOPES.SIGN_REQUEST,
|
|
340
344
|
[INTENT_ACTIONS.MINT]: PERMISSION_SCOPES.MINT_REQUEST,
|
|
341
|
-
[INTENT_ACTIONS.SEND_NFT]: PERMISSION_SCOPES.NFT_TRANSFER
|
|
345
|
+
[INTENT_ACTIONS.SEND_NFT]: PERMISSION_SCOPES.NFT_TRANSFER,
|
|
346
|
+
[INTENT_ACTIONS.MINT_NFT]: PERMISSION_SCOPES.NFT_MINT
|
|
342
347
|
};
|
|
343
348
|
|
|
344
349
|
// connect/host/payments-compat.ts
|
|
@@ -477,6 +482,13 @@ var CHANNEL_ONLY_CODES = /* @__PURE__ */ new Set([
|
|
|
477
482
|
ERROR_CODES.WALLET_LOCKED,
|
|
478
483
|
ERROR_CODES.NOT_CONNECTED
|
|
479
484
|
]);
|
|
485
|
+
var ALWAYS_ASK_INTENTS = /* @__PURE__ */ new Set([INTENT_ACTIONS.MINT_NFT]);
|
|
486
|
+
|
|
487
|
+
// core/base64.ts
|
|
488
|
+
var ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
489
|
+
var INVALID = 255;
|
|
490
|
+
var SEXTETS = new Uint8Array(128).fill(INVALID);
|
|
491
|
+
for (let i = 0; i < ALPHABET.length; i++) SEXTETS[ALPHABET.charCodeAt(i)] = i;
|
|
480
492
|
|
|
481
493
|
// transport/websocket.ts
|
|
482
494
|
var WebSocketReadyState = {
|