@unicitylabs/sphere-sdk 0.17.2-dev.1 → 0.17.2-dev.3
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 +202 -8
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.cts +81 -4
- package/dist/connect/index.d.ts +81 -4
- package/dist/connect/index.js +202 -8
- package/dist/connect/index.js.map +1 -1
- package/dist/core/index.cjs +48 -21
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +2 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +48 -21
- package/dist/core/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/dist/impl/wallet-api-v2/index.cjs +3 -0
- package/dist/impl/wallet-api-v2/index.cjs.map +1 -1
- package/dist/impl/wallet-api-v2/index.js +3 -0
- package/dist/impl/wallet-api-v2/index.js.map +1 -1
- package/dist/index.cjs +67 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.js +64 -21
- package/dist/index.js.map +1 -1
- package/dist/modules/payments-v2/index.cjs +40 -6
- package/dist/modules/payments-v2/index.cjs.map +1 -1
- package/dist/modules/payments-v2/index.d.cts +22 -1
- package/dist/modules/payments-v2/index.d.ts +22 -1
- package/dist/modules/payments-v2/index.js +37 -6
- package/dist/modules/payments-v2/index.js.map +1 -1
- package/dist/token-engine/index.cjs +67 -21
- package/dist/token-engine/index.cjs.map +1 -1
- package/dist/token-engine/index.d.cts +28 -4
- package/dist/token-engine/index.d.ts +28 -4
- package/dist/token-engine/index.js +64 -21
- package/dist/token-engine/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;
|
|
@@ -115,6 +115,8 @@ declare const PERMISSION_SCOPES: {
|
|
|
115
115
|
readonly MINT_REQUEST: "mint:request";
|
|
116
116
|
/** #777: moving a coinless token (an NFT). Distinct from transfer:request. */
|
|
117
117
|
readonly NFT_TRANSFER: "nft:transfer";
|
|
118
|
+
/** Minting an NFT signs dApp-chosen content as the user; mint:request and nft:transfer do not imply it. */
|
|
119
|
+
readonly NFT_MINT: "nft:mint";
|
|
118
120
|
};
|
|
119
121
|
type PermissionScope = (typeof PERMISSION_SCOPES)[keyof typeof PERMISSION_SCOPES];
|
|
120
122
|
|
|
@@ -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;
|
|
@@ -115,6 +115,8 @@ declare const PERMISSION_SCOPES: {
|
|
|
115
115
|
readonly MINT_REQUEST: "mint:request";
|
|
116
116
|
/** #777: moving a coinless token (an NFT). Distinct from transfer:request. */
|
|
117
117
|
readonly NFT_TRANSFER: "nft:transfer";
|
|
118
|
+
/** Minting an NFT signs dApp-chosen content as the user; mint:request and nft:transfer do not imply it. */
|
|
119
|
+
readonly NFT_MINT: "nft:mint";
|
|
118
120
|
};
|
|
119
121
|
type PermissionScope = (typeof PERMISSION_SCOPES)[keyof typeof PERMISSION_SCOPES];
|
|
120
122
|
|
|
@@ -190,7 +190,7 @@ var HOST_READY_TIMEOUT = 3e4;
|
|
|
190
190
|
|
|
191
191
|
// connect/protocol.ts
|
|
192
192
|
var SPHERE_CONNECT_NAMESPACE = "sphere-connect";
|
|
193
|
-
var SPHERE_CONNECT_VERSION = "2.
|
|
193
|
+
var SPHERE_CONNECT_VERSION = "2.3";
|
|
194
194
|
var RPC_METHODS = {
|
|
195
195
|
GET_IDENTITY: "sphere_getIdentity",
|
|
196
196
|
GET_BALANCE: "sphere_getBalance",
|
|
@@ -216,7 +216,9 @@ var INTENT_ACTIONS = {
|
|
|
216
216
|
MINT: "mint",
|
|
217
217
|
// #777: params { to, tokenId, memo? }. Named NFT rather than 'send_token':
|
|
218
218
|
// coins are tokens too, so 'token' does not say which kind moves.
|
|
219
|
-
SEND_NFT: "send_nft"
|
|
219
|
+
SEND_NFT: "send_nft",
|
|
220
|
+
// Connect 2.3: params MintNftIntentParams, result MintNftIntentResult (connect/nft-wire.ts).
|
|
221
|
+
MINT_NFT: "mint_nft"
|
|
220
222
|
};
|
|
221
223
|
var ERROR_CODES = {
|
|
222
224
|
// Standard JSON-RPC
|
|
@@ -306,7 +308,7 @@ function createRequestId() {
|
|
|
306
308
|
}
|
|
307
309
|
|
|
308
310
|
// connect/version.ts
|
|
309
|
-
var SDK_VERSION = "0.17.2-dev.
|
|
311
|
+
var SDK_VERSION = "0.17.2-dev.3";
|
|
310
312
|
|
|
311
313
|
// connect/permissions.ts
|
|
312
314
|
var PERMISSION_SCOPES = {
|
|
@@ -324,7 +326,9 @@ var PERMISSION_SCOPES = {
|
|
|
324
326
|
SIGN_REQUEST: "sign:request",
|
|
325
327
|
MINT_REQUEST: "mint:request",
|
|
326
328
|
/** #777: moving a coinless token (an NFT). Distinct from transfer:request. */
|
|
327
|
-
NFT_TRANSFER: "nft:transfer"
|
|
329
|
+
NFT_TRANSFER: "nft:transfer",
|
|
330
|
+
/** Minting an NFT signs dApp-chosen content as the user; mint:request and nft:transfer do not imply it. */
|
|
331
|
+
NFT_MINT: "nft:mint"
|
|
328
332
|
};
|
|
329
333
|
var ALL_PERMISSIONS = Object.values(PERMISSION_SCOPES);
|
|
330
334
|
var DEFAULT_PERMISSIONS = [
|
|
@@ -352,7 +356,8 @@ var INTENT_PERMISSIONS = {
|
|
|
352
356
|
[INTENT_ACTIONS.RECEIVE]: PERMISSION_SCOPES.IDENTITY_READ,
|
|
353
357
|
[INTENT_ACTIONS.SIGN_MESSAGE]: PERMISSION_SCOPES.SIGN_REQUEST,
|
|
354
358
|
[INTENT_ACTIONS.MINT]: PERMISSION_SCOPES.MINT_REQUEST,
|
|
355
|
-
[INTENT_ACTIONS.SEND_NFT]: PERMISSION_SCOPES.NFT_TRANSFER
|
|
359
|
+
[INTENT_ACTIONS.SEND_NFT]: PERMISSION_SCOPES.NFT_TRANSFER,
|
|
360
|
+
[INTENT_ACTIONS.MINT_NFT]: PERMISSION_SCOPES.NFT_MINT
|
|
356
361
|
};
|
|
357
362
|
|
|
358
363
|
// connect/host/payments-compat.ts
|
|
@@ -491,6 +496,7 @@ var CHANNEL_ONLY_CODES = /* @__PURE__ */ new Set([
|
|
|
491
496
|
ERROR_CODES.WALLET_LOCKED,
|
|
492
497
|
ERROR_CODES.NOT_CONNECTED
|
|
493
498
|
]);
|
|
499
|
+
var ALWAYS_ASK_INTENTS = /* @__PURE__ */ new Set([INTENT_ACTIONS.MINT_NFT]);
|
|
494
500
|
|
|
495
501
|
// connect/client/ConnectClient.ts
|
|
496
502
|
var ConnectError = class extends Error {
|
|
@@ -827,6 +833,12 @@ var ConnectClient = class {
|
|
|
827
833
|
}
|
|
828
834
|
};
|
|
829
835
|
|
|
836
|
+
// core/base64.ts
|
|
837
|
+
var ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
838
|
+
var INVALID = 255;
|
|
839
|
+
var SEXTETS = new Uint8Array(128).fill(INVALID);
|
|
840
|
+
for (let i = 0; i < ALPHABET.length; i++) SEXTETS[ALPHABET.charCodeAt(i)] = i;
|
|
841
|
+
|
|
830
842
|
// impl/browser/connect/PostMessageTransport.ts
|
|
831
843
|
var POPUP_CLOSE_CHECK_INTERVAL = 1e3;
|
|
832
844
|
function originOf(targetOrigin) {
|