@mysten/wallet-standard 0.9.0 → 0.10.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.
- package/CHANGELOG.md +19 -0
- package/dist/cjs/chains.js +38 -0
- package/dist/cjs/chains.js.map +7 -0
- package/dist/{detect.d.ts → cjs/detect.d.ts} +2 -2
- package/dist/{index.js → cjs/detect.js} +5 -39
- package/dist/cjs/detect.js.map +7 -0
- package/dist/{features → cjs/features}/index.d.ts +8 -8
- package/dist/cjs/features/index.js +22 -0
- package/dist/cjs/features/index.js.map +7 -0
- package/dist/{features → cjs/features}/suiSignAndExecuteTransactionBlock.d.ts +1 -1
- package/dist/cjs/features/suiSignAndExecuteTransactionBlock.js +17 -0
- package/dist/cjs/features/suiSignAndExecuteTransactionBlock.js.map +7 -0
- package/dist/cjs/features/suiSignMessage.js +17 -0
- package/dist/cjs/features/suiSignMessage.js.map +7 -0
- package/dist/cjs/features/suiSignPersonalMessage.js +17 -0
- package/dist/cjs/features/suiSignPersonalMessage.js.map +7 -0
- package/dist/{features → cjs/features}/suiSignTransactionBlock.d.ts +1 -1
- package/dist/cjs/features/suiSignTransactionBlock.js +17 -0
- package/dist/cjs/features/suiSignTransactionBlock.js.map +7 -0
- package/dist/cjs/index.d.ts +5 -0
- package/dist/cjs/index.js +22 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +5 -0
- package/dist/cjs/wallet.js +17 -0
- package/dist/cjs/wallet.js.map +7 -0
- package/dist/esm/chains.d.ts +10 -0
- package/dist/esm/chains.js +18 -0
- package/dist/esm/chains.js.map +7 -0
- package/dist/esm/detect.d.ts +7 -0
- package/dist/esm/detect.js +17 -0
- package/dist/esm/detect.js.map +7 -0
- package/dist/esm/features/index.d.ts +19 -0
- package/dist/esm/features/index.js +5 -0
- package/dist/esm/features/index.js.map +7 -0
- package/dist/esm/features/suiSignAndExecuteTransactionBlock.d.ts +31 -0
- package/dist/esm/features/suiSignAndExecuteTransactionBlock.js +1 -0
- package/dist/esm/features/suiSignAndExecuteTransactionBlock.js.map +7 -0
- package/dist/esm/features/suiSignMessage.d.ts +38 -0
- package/dist/esm/features/suiSignMessage.js +1 -0
- package/dist/esm/features/suiSignMessage.js.map +7 -0
- package/dist/esm/features/suiSignPersonalMessage.d.ts +28 -0
- package/dist/esm/features/suiSignPersonalMessage.js +1 -0
- package/dist/esm/features/suiSignPersonalMessage.js.map +7 -0
- package/dist/esm/features/suiSignTransactionBlock.d.ts +30 -0
- package/dist/esm/features/suiSignTransactionBlock.js +1 -0
- package/dist/esm/features/suiSignTransactionBlock.js.map +7 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +5 -0
- package/dist/esm/wallet.d.ts +11 -0
- package/dist/esm/wallet.js +1 -0
- package/dist/esm/wallet.js.map +7 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +13 -16
- package/src/detect.ts +2 -2
- package/src/features/index.ts +8 -8
- package/src/features/suiSignAndExecuteTransactionBlock.ts +1 -1
- package/src/features/suiSignTransactionBlock.ts +1 -1
- package/src/index.ts +4 -4
- package/dist/index.d.ts +0 -5
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -38
- package/dist/index.mjs.map +0 -1
- /package/dist/{chains.d.ts → cjs/chains.d.ts} +0 -0
- /package/dist/{features → cjs/features}/suiSignMessage.d.ts +0 -0
- /package/dist/{features → cjs/features}/suiSignPersonalMessage.d.ts +0 -0
- /package/dist/{wallet.d.ts → cjs/wallet.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @mysten/wallet-standard
|
|
2
2
|
|
|
3
|
+
## 0.10.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9ac0a4ec01: Add extensions to all sdk import paths
|
|
8
|
+
- Updated dependencies [9ac0a4ec01]
|
|
9
|
+
- @mysten/sui.js@0.49.1
|
|
10
|
+
|
|
11
|
+
## 0.10.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- e5f9e3ba21: Replace tsup based build to fix issues with esm/cjs dual publishing
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [e5f9e3ba21]
|
|
20
|
+
- @mysten/sui.js@0.49.0
|
|
21
|
+
|
|
3
22
|
## 0.9.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var chains_exports = {};
|
|
20
|
+
__export(chains_exports, {
|
|
21
|
+
SUI_CHAINS: () => SUI_CHAINS,
|
|
22
|
+
SUI_DEVNET_CHAIN: () => SUI_DEVNET_CHAIN,
|
|
23
|
+
SUI_LOCALNET_CHAIN: () => SUI_LOCALNET_CHAIN,
|
|
24
|
+
SUI_MAINNET_CHAIN: () => SUI_MAINNET_CHAIN,
|
|
25
|
+
SUI_TESTNET_CHAIN: () => SUI_TESTNET_CHAIN
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(chains_exports);
|
|
28
|
+
const SUI_DEVNET_CHAIN = "sui:devnet";
|
|
29
|
+
const SUI_TESTNET_CHAIN = "sui:testnet";
|
|
30
|
+
const SUI_LOCALNET_CHAIN = "sui:localnet";
|
|
31
|
+
const SUI_MAINNET_CHAIN = "sui:mainnet";
|
|
32
|
+
const SUI_CHAINS = [
|
|
33
|
+
SUI_DEVNET_CHAIN,
|
|
34
|
+
SUI_TESTNET_CHAIN,
|
|
35
|
+
SUI_LOCALNET_CHAIN,
|
|
36
|
+
SUI_MAINNET_CHAIN
|
|
37
|
+
];
|
|
38
|
+
//# sourceMappingURL=chains.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/chains.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n/** Sui Devnet */\nexport const SUI_DEVNET_CHAIN = 'sui:devnet';\n\n/** Sui Testnet */\nexport const SUI_TESTNET_CHAIN = 'sui:testnet';\n\n/** Sui Localnet */\nexport const SUI_LOCALNET_CHAIN = 'sui:localnet';\n\n/** Sui Mainnet */\nexport const SUI_MAINNET_CHAIN = 'sui:mainnet';\n\nexport const SUI_CHAINS = [\n\tSUI_DEVNET_CHAIN,\n\tSUI_TESTNET_CHAIN,\n\tSUI_LOCALNET_CHAIN,\n\tSUI_MAINNET_CHAIN,\n] as const;\n\nexport type SuiChain =\n\t| typeof SUI_DEVNET_CHAIN\n\t| typeof SUI_TESTNET_CHAIN\n\t| typeof SUI_LOCALNET_CHAIN\n\t| typeof SUI_MAINNET_CHAIN;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,MAAM,mBAAmB;AAGzB,MAAM,oBAAoB;AAG1B,MAAM,qBAAqB;AAG3B,MAAM,oBAAoB;AAE1B,MAAM,aAAa;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Wallet, WalletWithFeatures } from '@wallet-standard/core';
|
|
2
|
-
import { MinimallyRequiredFeatures, WalletWithSuiFeatures } from './features';
|
|
1
|
+
import type { Wallet, WalletWithFeatures } from '@wallet-standard/core';
|
|
2
|
+
import type { MinimallyRequiredFeatures, WalletWithSuiFeatures } from './features/index.js';
|
|
3
3
|
/** @deprecated Use isWalletWithRequiredFeatureSet instead since it provides more accurate typing! */
|
|
4
4
|
export declare function isWalletWithSuiFeatures(wallet: Wallet,
|
|
5
5
|
/** Extra features that are required to be present, in addition to the expected feature set. */
|
|
@@ -15,25 +15,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
}
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var src_exports = {};
|
|
23
|
-
__export(src_exports, {
|
|
24
|
-
SUI_CHAINS: () => SUI_CHAINS,
|
|
25
|
-
SUI_DEVNET_CHAIN: () => SUI_DEVNET_CHAIN,
|
|
26
|
-
SUI_LOCALNET_CHAIN: () => SUI_LOCALNET_CHAIN,
|
|
27
|
-
SUI_MAINNET_CHAIN: () => SUI_MAINNET_CHAIN,
|
|
28
|
-
SUI_TESTNET_CHAIN: () => SUI_TESTNET_CHAIN,
|
|
19
|
+
var detect_exports = {};
|
|
20
|
+
__export(detect_exports, {
|
|
29
21
|
isWalletWithRequiredFeatureSet: () => isWalletWithRequiredFeatureSet,
|
|
30
22
|
isWalletWithSuiFeatures: () => isWalletWithSuiFeatures
|
|
31
23
|
});
|
|
32
|
-
module.exports = __toCommonJS(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// src/detect.ts
|
|
36
|
-
var REQUIRED_FEATURES = [
|
|
24
|
+
module.exports = __toCommonJS(detect_exports);
|
|
25
|
+
const REQUIRED_FEATURES = [
|
|
37
26
|
"standard:connect",
|
|
38
27
|
"standard:events"
|
|
39
28
|
];
|
|
@@ -45,27 +34,4 @@ function isWalletWithRequiredFeatureSet(wallet, additionalFeatures = []) {
|
|
|
45
34
|
(feature) => feature in wallet.features
|
|
46
35
|
);
|
|
47
36
|
}
|
|
48
|
-
|
|
49
|
-
// src/chains.ts
|
|
50
|
-
var SUI_DEVNET_CHAIN = "sui:devnet";
|
|
51
|
-
var SUI_TESTNET_CHAIN = "sui:testnet";
|
|
52
|
-
var SUI_LOCALNET_CHAIN = "sui:localnet";
|
|
53
|
-
var SUI_MAINNET_CHAIN = "sui:mainnet";
|
|
54
|
-
var SUI_CHAINS = [
|
|
55
|
-
SUI_DEVNET_CHAIN,
|
|
56
|
-
SUI_TESTNET_CHAIN,
|
|
57
|
-
SUI_LOCALNET_CHAIN,
|
|
58
|
-
SUI_MAINNET_CHAIN
|
|
59
|
-
];
|
|
60
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
-
0 && (module.exports = {
|
|
62
|
-
SUI_CHAINS,
|
|
63
|
-
SUI_DEVNET_CHAIN,
|
|
64
|
-
SUI_LOCALNET_CHAIN,
|
|
65
|
-
SUI_MAINNET_CHAIN,
|
|
66
|
-
SUI_TESTNET_CHAIN,
|
|
67
|
-
isWalletWithRequiredFeatureSet,
|
|
68
|
-
isWalletWithSuiFeatures,
|
|
69
|
-
...require("@wallet-standard/core")
|
|
70
|
-
});
|
|
71
|
-
//# sourceMappingURL=index.js.map
|
|
37
|
+
//# sourceMappingURL=detect.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/detect.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Wallet, WalletWithFeatures } from '@wallet-standard/core';\n\nimport type { MinimallyRequiredFeatures, WalletWithSuiFeatures } from './features/index.js';\n\n// These features are absolutely required for wallets to function in the Sui ecosystem.\n// Eventually, as wallets have more consistent support of features, we may want to extend this list.\nconst REQUIRED_FEATURES: (keyof MinimallyRequiredFeatures)[] = [\n\t'standard:connect',\n\t'standard:events',\n];\n\n/** @deprecated Use isWalletWithRequiredFeatureSet instead since it provides more accurate typing! */\nexport function isWalletWithSuiFeatures(\n\twallet: Wallet,\n\t/** Extra features that are required to be present, in addition to the expected feature set. */\n\tfeatures: string[] = [],\n): wallet is WalletWithSuiFeatures {\n\treturn [...REQUIRED_FEATURES, ...features].every((feature) => feature in wallet.features);\n}\n\nexport function isWalletWithRequiredFeatureSet<AdditionalFeatures extends Wallet['features']>(\n\twallet: Wallet,\n\tadditionalFeatures: (keyof AdditionalFeatures)[] = [],\n): wallet is WalletWithFeatures<MinimallyRequiredFeatures & AdditionalFeatures> {\n\treturn [...REQUIRED_FEATURES, ...additionalFeatures].every(\n\t\t(feature) => feature in wallet.features,\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAM,oBAAyD;AAAA,EAC9D;AAAA,EACA;AACD;AAGO,SAAS,wBACf,QAEA,WAAqB,CAAC,GACY;AAClC,SAAO,CAAC,GAAG,mBAAmB,GAAG,QAAQ,EAAE,MAAM,CAAC,YAAY,WAAW,OAAO,QAAQ;AACzF;AAEO,SAAS,+BACf,QACA,qBAAmD,CAAC,GAC2B;AAC/E,SAAO,CAAC,GAAG,mBAAmB,GAAG,kBAAkB,EAAE;AAAA,IACpD,CAAC,YAAY,WAAW,OAAO;AAAA,EAChC;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { IdentifierRecord, StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature, WalletWithFeatures } from '@wallet-standard/core';
|
|
2
|
-
import type { SuiSignAndExecuteTransactionBlockFeature } from './suiSignAndExecuteTransactionBlock';
|
|
3
|
-
import { SuiSignMessageFeature } from './suiSignMessage';
|
|
4
|
-
import { SuiSignPersonalMessageFeature } from './suiSignPersonalMessage';
|
|
5
|
-
import type { SuiSignTransactionBlockFeature } from './suiSignTransactionBlock';
|
|
2
|
+
import type { SuiSignAndExecuteTransactionBlockFeature } from './suiSignAndExecuteTransactionBlock.js';
|
|
3
|
+
import type { SuiSignMessageFeature } from './suiSignMessage.js';
|
|
4
|
+
import type { SuiSignPersonalMessageFeature } from './suiSignPersonalMessage.js';
|
|
5
|
+
import type { SuiSignTransactionBlockFeature } from './suiSignTransactionBlock.js';
|
|
6
6
|
/**
|
|
7
7
|
* Wallet Standard features that are unique to Sui, and that all Sui wallets are expected to implement.
|
|
8
8
|
*/
|
|
@@ -13,7 +13,7 @@ export type WalletWithSuiFeatures = WalletWithFeatures<StandardConnectFeature &
|
|
|
13
13
|
*/
|
|
14
14
|
export type WalletWithRequiredFeatures = WalletWithFeatures<MinimallyRequiredFeatures & Partial<SuiFeatures> & Partial<StandardDisconnectFeature> & IdentifierRecord<unknown>>;
|
|
15
15
|
export type MinimallyRequiredFeatures = StandardConnectFeature & StandardEventsFeature;
|
|
16
|
-
export * from './suiSignMessage';
|
|
17
|
-
export * from './suiSignTransactionBlock';
|
|
18
|
-
export * from './suiSignAndExecuteTransactionBlock';
|
|
19
|
-
export * from './suiSignPersonalMessage';
|
|
16
|
+
export * from './suiSignMessage.js';
|
|
17
|
+
export * from './suiSignTransactionBlock.js';
|
|
18
|
+
export * from './suiSignAndExecuteTransactionBlock.js';
|
|
19
|
+
export * from './suiSignPersonalMessage.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var features_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(features_exports);
|
|
18
|
+
__reExport(features_exports, require("./suiSignMessage.js"), module.exports);
|
|
19
|
+
__reExport(features_exports, require("./suiSignTransactionBlock.js"), module.exports);
|
|
20
|
+
__reExport(features_exports, require("./suiSignAndExecuteTransactionBlock.js"), module.exports);
|
|
21
|
+
__reExport(features_exports, require("./suiSignPersonalMessage.js"), module.exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/features/index.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type {\n\tIdentifierRecord,\n\tStandardConnectFeature,\n\tStandardDisconnectFeature,\n\tStandardEventsFeature,\n\tWalletWithFeatures,\n} from '@wallet-standard/core';\n\nimport type { SuiSignAndExecuteTransactionBlockFeature } from './suiSignAndExecuteTransactionBlock.js';\nimport type { SuiSignMessageFeature } from './suiSignMessage.js';\nimport type { SuiSignPersonalMessageFeature } from './suiSignPersonalMessage.js';\nimport type { SuiSignTransactionBlockFeature } from './suiSignTransactionBlock.js';\n\n/**\n * Wallet Standard features that are unique to Sui, and that all Sui wallets are expected to implement.\n */\nexport type SuiFeatures = SuiSignTransactionBlockFeature &\n\tSuiSignAndExecuteTransactionBlockFeature &\n\tSuiSignPersonalMessageFeature &\n\t// This deprecated feature should be removed once wallets update to the new method:\n\tPartial<SuiSignMessageFeature>;\n\nexport type WalletWithSuiFeatures = WalletWithFeatures<\n\tStandardConnectFeature &\n\t\tStandardEventsFeature &\n\t\tSuiFeatures &\n\t\t// Disconnect is an optional feature:\n\t\tPartial<StandardDisconnectFeature>\n>;\n\n/**\n * Represents a wallet with the absolute minimum feature set required to function in the Sui ecosystem.\n */\nexport type WalletWithRequiredFeatures = WalletWithFeatures<\n\tMinimallyRequiredFeatures &\n\t\tPartial<SuiFeatures> &\n\t\tPartial<StandardDisconnectFeature> &\n\t\tIdentifierRecord<unknown>\n>;\n\nexport type MinimallyRequiredFeatures = StandardConnectFeature & StandardEventsFeature;\n\nexport * from './suiSignMessage.js';\nexport * from './suiSignTransactionBlock.js';\nexport * from './suiSignAndExecuteTransactionBlock.js';\nexport * from './suiSignPersonalMessage.js';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AA6CA,6BAAc,gCA7Cd;AA8CA,6BAAc,yCA9Cd;AA+CA,6BAAc,mDA/Cd;AAgDA,6BAAc,wCAhDd;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExecuteTransactionRequestType, SuiTransactionBlockResponse, SuiTransactionBlockResponseOptions } from '@mysten/sui.js/client';
|
|
2
|
-
import type { SuiSignTransactionBlockInput } from './suiSignTransactionBlock';
|
|
2
|
+
import type { SuiSignTransactionBlockInput } from './suiSignTransactionBlock.js';
|
|
3
3
|
/** The latest API version of the signAndExecuteTransactionBlock API. */
|
|
4
4
|
export type SuiSignAndExecuteTransactionBlockVersion = '1.0.0';
|
|
5
5
|
/**
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var suiSignAndExecuteTransactionBlock_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(suiSignAndExecuteTransactionBlock_exports);
|
|
17
|
+
//# sourceMappingURL=suiSignAndExecuteTransactionBlock.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/features/suiSignAndExecuteTransactionBlock.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type {\n\tExecuteTransactionRequestType,\n\tSuiTransactionBlockResponse,\n\tSuiTransactionBlockResponseOptions,\n} from '@mysten/sui.js/client';\n\nimport type { SuiSignTransactionBlockInput } from './suiSignTransactionBlock.js';\n\n/** The latest API version of the signAndExecuteTransactionBlock API. */\nexport type SuiSignAndExecuteTransactionBlockVersion = '1.0.0';\n\n/**\n * A Wallet Standard feature for signing a transaction, and submitting it to the\n * network. The wallet is expected to submit the transaction to the network via RPC,\n * and return the transaction response.\n */\nexport type SuiSignAndExecuteTransactionBlockFeature = {\n\t/** Namespace for the feature. */\n\t'sui:signAndExecuteTransactionBlock': {\n\t\t/** Version of the feature API. */\n\t\tversion: SuiSignAndExecuteTransactionBlockVersion;\n\t\tsignAndExecuteTransactionBlock: SuiSignAndExecuteTransactionBlockMethod;\n\t};\n};\n\nexport type SuiSignAndExecuteTransactionBlockMethod = (\n\tinput: SuiSignAndExecuteTransactionBlockInput,\n) => Promise<SuiSignAndExecuteTransactionBlockOutput>;\n\n/** Input for signing and sending transactions. */\nexport interface SuiSignAndExecuteTransactionBlockInput extends SuiSignTransactionBlockInput {\n\t/**\n\t * `WaitForEffectsCert` or `WaitForLocalExecution`, see details in `ExecuteTransactionRequestType`.\n\t * Defaults to `WaitForLocalExecution` if options.showEffects or options.showEvents is true\n\t */\n\trequestType?: ExecuteTransactionRequestType;\n\t/** specify which fields to return (e.g., transaction, effects, events, etc). By default, only the transaction digest will be returned. */\n\toptions?: SuiTransactionBlockResponseOptions;\n}\n\n/** Output of signing and sending transactions. */\nexport interface SuiSignAndExecuteTransactionBlockOutput extends SuiTransactionBlockResponse {}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var suiSignMessage_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(suiSignMessage_exports);
|
|
17
|
+
//# sourceMappingURL=suiSignMessage.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/features/suiSignMessage.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { WalletAccount } from '@wallet-standard/core';\n\n/**\n * The latest API version of the signMessage API.\n * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `sui:signPersonalMessage` feature\n */\nexport type SuiSignMessageVersion = '1.0.0';\n\n/**\n * A Wallet Standard feature for signing a personal message, and returning the\n * message bytes that were signed, and message signature.\n *\n * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `sui:signPersonalMessage` feature\n */\nexport type SuiSignMessageFeature = {\n\t/** Namespace for the feature. */\n\t'sui:signMessage': {\n\t\t/** Version of the feature API. */\n\t\tversion: SuiSignMessageVersion;\n\t\tsignMessage: SuiSignMessageMethod;\n\t};\n};\n\n/** @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `sui:signPersonalMessage` feature */\nexport type SuiSignMessageMethod = (input: SuiSignMessageInput) => Promise<SuiSignMessageOutput>;\n\n/**\n * Input for signing messages.\n * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `sui:signPersonalMessage` feature\n */\nexport interface SuiSignMessageInput {\n\tmessage: Uint8Array;\n\taccount: WalletAccount;\n}\n\n/**\n * Output of signing messages.\n * @deprecated Wallets can still implement this method for compatibility, but this has been replaced by the `sui:signPersonalMessage` feature\n */\nexport interface SuiSignMessageOutput {\n\tmessageBytes: string;\n\tsignature: string;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var suiSignPersonalMessage_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(suiSignPersonalMessage_exports);
|
|
17
|
+
//# sourceMappingURL=suiSignPersonalMessage.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/features/suiSignPersonalMessage.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { WalletAccount } from '@wallet-standard/core';\n\n/** The latest API version of the signPersonalMessage API. */\nexport type SuiSignPersonalMessageVersion = '1.0.0';\n\n/**\n * A Wallet Standard feature for signing a personal message, and returning the\n * message bytes that were signed, and message signature.\n */\nexport type SuiSignPersonalMessageFeature = {\n\t/** Namespace for the feature. */\n\t'sui:signPersonalMessage': {\n\t\t/** Version of the feature API. */\n\t\tversion: SuiSignPersonalMessageVersion;\n\t\tsignPersonalMessage: SuiSignPersonalMessageMethod;\n\t};\n};\n\nexport type SuiSignPersonalMessageMethod = (\n\tinput: SuiSignPersonalMessageInput,\n) => Promise<SuiSignPersonalMessageOutput>;\n\n/** Input for signing personal messages. */\nexport interface SuiSignPersonalMessageInput {\n\tmessage: Uint8Array;\n\taccount: WalletAccount;\n}\n\n/** Output of signing personal messages. */\nexport interface SuiSignPersonalMessageOutput extends SignedPersonalMessage {}\n\nexport interface SignedPersonalMessage {\n\tbytes: string;\n\tsignature: string;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TransactionBlock } from '@mysten/sui.js/transactions';
|
|
1
|
+
import type { TransactionBlock } from '@mysten/sui.js/transactions';
|
|
2
2
|
import type { IdentifierString, WalletAccount } from '@wallet-standard/core';
|
|
3
3
|
/** The latest API version of the signTransactionBlock API. */
|
|
4
4
|
export type SuiSignTransactionBlockVersion = '1.0.0';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var suiSignTransactionBlock_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(suiSignTransactionBlock_exports);
|
|
17
|
+
//# sourceMappingURL=suiSignTransactionBlock.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/features/suiSignTransactionBlock.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { TransactionBlock } from '@mysten/sui.js/transactions';\nimport type { IdentifierString, WalletAccount } from '@wallet-standard/core';\n\n/** The latest API version of the signTransactionBlock API. */\nexport type SuiSignTransactionBlockVersion = '1.0.0';\n\n/**\n * A Wallet Standard feature for signing a transaction, and returning the\n * serialized transaction and transaction signature.\n */\nexport type SuiSignTransactionBlockFeature = {\n\t/** Namespace for the feature. */\n\t'sui:signTransactionBlock': {\n\t\t/** Version of the feature API. */\n\t\tversion: SuiSignTransactionBlockVersion;\n\t\tsignTransactionBlock: SuiSignTransactionBlockMethod;\n\t};\n};\n\nexport type SuiSignTransactionBlockMethod = (\n\tinput: SuiSignTransactionBlockInput,\n) => Promise<SuiSignTransactionBlockOutput>;\n\n/** Input for signing transactions. */\nexport interface SuiSignTransactionBlockInput {\n\ttransactionBlock: TransactionBlock;\n\taccount: WalletAccount;\n\tchain: IdentifierString;\n}\n\n/** Output of signing transactions. */\nexport interface SuiSignTransactionBlockOutput extends SignedTransactionBlock {}\n\nexport interface SignedTransactionBlock {\n\ttransactionBlockBytes: string;\n\tsignature: string;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var src_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(src_exports);
|
|
18
|
+
__reExport(src_exports, require("@wallet-standard/core"), module.exports);
|
|
19
|
+
__reExport(src_exports, require("./features/index.js"), module.exports);
|
|
20
|
+
__reExport(src_exports, require("./detect.js"), module.exports);
|
|
21
|
+
__reExport(src_exports, require("./chains.js"), module.exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nexport * from '@wallet-standard/core';\n\nexport type { Wallet } from './wallet.js';\nexport * from './features/index.js';\nexport * from './detect.js';\nexport * from './chains.js';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAGA,wBAAc,kCAHd;AAMA,wBAAc,gCANd;AAOA,wBAAc,wBAPd;AAQA,wBAAc,wBARd;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var wallet_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(wallet_exports);
|
|
17
|
+
//# sourceMappingURL=wallet.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/wallet.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\ndeclare module '@wallet-standard/core' {\n\texport interface Wallet {\n\t\t/**\n\t\t * Unique identifier of the Wallet.\n\t\t *\n\t\t * If not provided, the wallet name will be used as the identifier.\n\t\t */\n\t\treadonly id?: string;\n\t}\n}\n\nexport type { Wallet } from '@wallet-standard/core';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Sui Devnet */
|
|
2
|
+
export declare const SUI_DEVNET_CHAIN = "sui:devnet";
|
|
3
|
+
/** Sui Testnet */
|
|
4
|
+
export declare const SUI_TESTNET_CHAIN = "sui:testnet";
|
|
5
|
+
/** Sui Localnet */
|
|
6
|
+
export declare const SUI_LOCALNET_CHAIN = "sui:localnet";
|
|
7
|
+
/** Sui Mainnet */
|
|
8
|
+
export declare const SUI_MAINNET_CHAIN = "sui:mainnet";
|
|
9
|
+
export declare const SUI_CHAINS: readonly ["sui:devnet", "sui:testnet", "sui:localnet", "sui:mainnet"];
|
|
10
|
+
export type SuiChain = typeof SUI_DEVNET_CHAIN | typeof SUI_TESTNET_CHAIN | typeof SUI_LOCALNET_CHAIN | typeof SUI_MAINNET_CHAIN;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const SUI_DEVNET_CHAIN = "sui:devnet";
|
|
2
|
+
const SUI_TESTNET_CHAIN = "sui:testnet";
|
|
3
|
+
const SUI_LOCALNET_CHAIN = "sui:localnet";
|
|
4
|
+
const SUI_MAINNET_CHAIN = "sui:mainnet";
|
|
5
|
+
const SUI_CHAINS = [
|
|
6
|
+
SUI_DEVNET_CHAIN,
|
|
7
|
+
SUI_TESTNET_CHAIN,
|
|
8
|
+
SUI_LOCALNET_CHAIN,
|
|
9
|
+
SUI_MAINNET_CHAIN
|
|
10
|
+
];
|
|
11
|
+
export {
|
|
12
|
+
SUI_CHAINS,
|
|
13
|
+
SUI_DEVNET_CHAIN,
|
|
14
|
+
SUI_LOCALNET_CHAIN,
|
|
15
|
+
SUI_MAINNET_CHAIN,
|
|
16
|
+
SUI_TESTNET_CHAIN
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=chains.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/chains.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n/** Sui Devnet */\nexport const SUI_DEVNET_CHAIN = 'sui:devnet';\n\n/** Sui Testnet */\nexport const SUI_TESTNET_CHAIN = 'sui:testnet';\n\n/** Sui Localnet */\nexport const SUI_LOCALNET_CHAIN = 'sui:localnet';\n\n/** Sui Mainnet */\nexport const SUI_MAINNET_CHAIN = 'sui:mainnet';\n\nexport const SUI_CHAINS = [\n\tSUI_DEVNET_CHAIN,\n\tSUI_TESTNET_CHAIN,\n\tSUI_LOCALNET_CHAIN,\n\tSUI_MAINNET_CHAIN,\n] as const;\n\nexport type SuiChain =\n\t| typeof SUI_DEVNET_CHAIN\n\t| typeof SUI_TESTNET_CHAIN\n\t| typeof SUI_LOCALNET_CHAIN\n\t| typeof SUI_MAINNET_CHAIN;\n"],
|
|
5
|
+
"mappings": "AAIO,MAAM,mBAAmB;AAGzB,MAAM,oBAAoB;AAG1B,MAAM,qBAAqB;AAG3B,MAAM,oBAAoB;AAE1B,MAAM,aAAa;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Wallet, WalletWithFeatures } from '@wallet-standard/core';
|
|
2
|
+
import type { MinimallyRequiredFeatures, WalletWithSuiFeatures } from './features/index.js';
|
|
3
|
+
/** @deprecated Use isWalletWithRequiredFeatureSet instead since it provides more accurate typing! */
|
|
4
|
+
export declare function isWalletWithSuiFeatures(wallet: Wallet,
|
|
5
|
+
/** Extra features that are required to be present, in addition to the expected feature set. */
|
|
6
|
+
features?: string[]): wallet is WalletWithSuiFeatures;
|
|
7
|
+
export declare function isWalletWithRequiredFeatureSet<AdditionalFeatures extends Wallet['features']>(wallet: Wallet, additionalFeatures?: (keyof AdditionalFeatures)[]): wallet is WalletWithFeatures<MinimallyRequiredFeatures & AdditionalFeatures>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const REQUIRED_FEATURES = [
|
|
2
|
+
"standard:connect",
|
|
3
|
+
"standard:events"
|
|
4
|
+
];
|
|
5
|
+
function isWalletWithSuiFeatures(wallet, features = []) {
|
|
6
|
+
return [...REQUIRED_FEATURES, ...features].every((feature) => feature in wallet.features);
|
|
7
|
+
}
|
|
8
|
+
function isWalletWithRequiredFeatureSet(wallet, additionalFeatures = []) {
|
|
9
|
+
return [...REQUIRED_FEATURES, ...additionalFeatures].every(
|
|
10
|
+
(feature) => feature in wallet.features
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
isWalletWithRequiredFeatureSet,
|
|
15
|
+
isWalletWithSuiFeatures
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=detect.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/detect.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Wallet, WalletWithFeatures } from '@wallet-standard/core';\n\nimport type { MinimallyRequiredFeatures, WalletWithSuiFeatures } from './features/index.js';\n\n// These features are absolutely required for wallets to function in the Sui ecosystem.\n// Eventually, as wallets have more consistent support of features, we may want to extend this list.\nconst REQUIRED_FEATURES: (keyof MinimallyRequiredFeatures)[] = [\n\t'standard:connect',\n\t'standard:events',\n];\n\n/** @deprecated Use isWalletWithRequiredFeatureSet instead since it provides more accurate typing! */\nexport function isWalletWithSuiFeatures(\n\twallet: Wallet,\n\t/** Extra features that are required to be present, in addition to the expected feature set. */\n\tfeatures: string[] = [],\n): wallet is WalletWithSuiFeatures {\n\treturn [...REQUIRED_FEATURES, ...features].every((feature) => feature in wallet.features);\n}\n\nexport function isWalletWithRequiredFeatureSet<AdditionalFeatures extends Wallet['features']>(\n\twallet: Wallet,\n\tadditionalFeatures: (keyof AdditionalFeatures)[] = [],\n): wallet is WalletWithFeatures<MinimallyRequiredFeatures & AdditionalFeatures> {\n\treturn [...REQUIRED_FEATURES, ...additionalFeatures].every(\n\t\t(feature) => feature in wallet.features,\n\t);\n}\n"],
|
|
5
|
+
"mappings": "AASA,MAAM,oBAAyD;AAAA,EAC9D;AAAA,EACA;AACD;AAGO,SAAS,wBACf,QAEA,WAAqB,CAAC,GACY;AAClC,SAAO,CAAC,GAAG,mBAAmB,GAAG,QAAQ,EAAE,MAAM,CAAC,YAAY,WAAW,OAAO,QAAQ;AACzF;AAEO,SAAS,+BACf,QACA,qBAAmD,CAAC,GAC2B;AAC/E,SAAO,CAAC,GAAG,mBAAmB,GAAG,kBAAkB,EAAE;AAAA,IACpD,CAAC,YAAY,WAAW,OAAO;AAAA,EAChC;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IdentifierRecord, StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature, WalletWithFeatures } from '@wallet-standard/core';
|
|
2
|
+
import type { SuiSignAndExecuteTransactionBlockFeature } from './suiSignAndExecuteTransactionBlock.js';
|
|
3
|
+
import type { SuiSignMessageFeature } from './suiSignMessage.js';
|
|
4
|
+
import type { SuiSignPersonalMessageFeature } from './suiSignPersonalMessage.js';
|
|
5
|
+
import type { SuiSignTransactionBlockFeature } from './suiSignTransactionBlock.js';
|
|
6
|
+
/**
|
|
7
|
+
* Wallet Standard features that are unique to Sui, and that all Sui wallets are expected to implement.
|
|
8
|
+
*/
|
|
9
|
+
export type SuiFeatures = SuiSignTransactionBlockFeature & SuiSignAndExecuteTransactionBlockFeature & SuiSignPersonalMessageFeature & Partial<SuiSignMessageFeature>;
|
|
10
|
+
export type WalletWithSuiFeatures = WalletWithFeatures<StandardConnectFeature & StandardEventsFeature & SuiFeatures & Partial<StandardDisconnectFeature>>;
|
|
11
|
+
/**
|
|
12
|
+
* Represents a wallet with the absolute minimum feature set required to function in the Sui ecosystem.
|
|
13
|
+
*/
|
|
14
|
+
export type WalletWithRequiredFeatures = WalletWithFeatures<MinimallyRequiredFeatures & Partial<SuiFeatures> & Partial<StandardDisconnectFeature> & IdentifierRecord<unknown>>;
|
|
15
|
+
export type MinimallyRequiredFeatures = StandardConnectFeature & StandardEventsFeature;
|
|
16
|
+
export * from './suiSignMessage.js';
|
|
17
|
+
export * from './suiSignTransactionBlock.js';
|
|
18
|
+
export * from './suiSignAndExecuteTransactionBlock.js';
|
|
19
|
+
export * from './suiSignPersonalMessage.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/features/index.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type {\n\tIdentifierRecord,\n\tStandardConnectFeature,\n\tStandardDisconnectFeature,\n\tStandardEventsFeature,\n\tWalletWithFeatures,\n} from '@wallet-standard/core';\n\nimport type { SuiSignAndExecuteTransactionBlockFeature } from './suiSignAndExecuteTransactionBlock.js';\nimport type { SuiSignMessageFeature } from './suiSignMessage.js';\nimport type { SuiSignPersonalMessageFeature } from './suiSignPersonalMessage.js';\nimport type { SuiSignTransactionBlockFeature } from './suiSignTransactionBlock.js';\n\n/**\n * Wallet Standard features that are unique to Sui, and that all Sui wallets are expected to implement.\n */\nexport type SuiFeatures = SuiSignTransactionBlockFeature &\n\tSuiSignAndExecuteTransactionBlockFeature &\n\tSuiSignPersonalMessageFeature &\n\t// This deprecated feature should be removed once wallets update to the new method:\n\tPartial<SuiSignMessageFeature>;\n\nexport type WalletWithSuiFeatures = WalletWithFeatures<\n\tStandardConnectFeature &\n\t\tStandardEventsFeature &\n\t\tSuiFeatures &\n\t\t// Disconnect is an optional feature:\n\t\tPartial<StandardDisconnectFeature>\n>;\n\n/**\n * Represents a wallet with the absolute minimum feature set required to function in the Sui ecosystem.\n */\nexport type WalletWithRequiredFeatures = WalletWithFeatures<\n\tMinimallyRequiredFeatures &\n\t\tPartial<SuiFeatures> &\n\t\tPartial<StandardDisconnectFeature> &\n\t\tIdentifierRecord<unknown>\n>;\n\nexport type MinimallyRequiredFeatures = StandardConnectFeature & StandardEventsFeature;\n\nexport * from './suiSignMessage.js';\nexport * from './suiSignTransactionBlock.js';\nexport * from './suiSignAndExecuteTransactionBlock.js';\nexport * from './suiSignPersonalMessage.js';\n"],
|
|
5
|
+
"mappings": "AA6CA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ExecuteTransactionRequestType, SuiTransactionBlockResponse, SuiTransactionBlockResponseOptions } from '@mysten/sui.js/client';
|
|
2
|
+
import type { SuiSignTransactionBlockInput } from './suiSignTransactionBlock.js';
|
|
3
|
+
/** The latest API version of the signAndExecuteTransactionBlock API. */
|
|
4
|
+
export type SuiSignAndExecuteTransactionBlockVersion = '1.0.0';
|
|
5
|
+
/**
|
|
6
|
+
* A Wallet Standard feature for signing a transaction, and submitting it to the
|
|
7
|
+
* network. The wallet is expected to submit the transaction to the network via RPC,
|
|
8
|
+
* and return the transaction response.
|
|
9
|
+
*/
|
|
10
|
+
export type SuiSignAndExecuteTransactionBlockFeature = {
|
|
11
|
+
/** Namespace for the feature. */
|
|
12
|
+
'sui:signAndExecuteTransactionBlock': {
|
|
13
|
+
/** Version of the feature API. */
|
|
14
|
+
version: SuiSignAndExecuteTransactionBlockVersion;
|
|
15
|
+
signAndExecuteTransactionBlock: SuiSignAndExecuteTransactionBlockMethod;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export type SuiSignAndExecuteTransactionBlockMethod = (input: SuiSignAndExecuteTransactionBlockInput) => Promise<SuiSignAndExecuteTransactionBlockOutput>;
|
|
19
|
+
/** Input for signing and sending transactions. */
|
|
20
|
+
export interface SuiSignAndExecuteTransactionBlockInput extends SuiSignTransactionBlockInput {
|
|
21
|
+
/**
|
|
22
|
+
* `WaitForEffectsCert` or `WaitForLocalExecution`, see details in `ExecuteTransactionRequestType`.
|
|
23
|
+
* Defaults to `WaitForLocalExecution` if options.showEffects or options.showEvents is true
|
|
24
|
+
*/
|
|
25
|
+
requestType?: ExecuteTransactionRequestType;
|
|
26
|
+
/** specify which fields to return (e.g., transaction, effects, events, etc). By default, only the transaction digest will be returned. */
|
|
27
|
+
options?: SuiTransactionBlockResponseOptions;
|
|
28
|
+
}
|
|
29
|
+
/** Output of signing and sending transactions. */
|
|
30
|
+
export interface SuiSignAndExecuteTransactionBlockOutput extends SuiTransactionBlockResponse {
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=suiSignAndExecuteTransactionBlock.js.map
|