@mysten/wallet-standard 0.4.3 → 0.5.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 +94 -0
- package/README.md +22 -22
- package/dist/detect.d.ts +3 -3
- package/dist/features/index.d.ts +7 -5
- package/dist/features/suiSignAndExecuteTransactionBlock.d.ts +31 -0
- package/dist/features/suiSignMessage.d.ts +25 -0
- package/dist/features/suiSignTransactionBlock.d.ts +26 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -5
- package/src/detect.ts +17 -14
- package/src/features/index.ts +9 -6
- package/src/features/suiSignAndExecuteTransactionBlock.ts +46 -0
- package/src/features/suiSignMessage.ts +34 -0
- package/src/features/suiSignTransactionBlock.ts +35 -0
- package/src/index.ts +2 -2
- package/dist/features/suiSignAndExecuteTransaction.d.ts +0 -29
- package/dist/features/suiSignTransaction.d.ts +0 -27
- package/src/features/suiSignAndExecuteTransaction.ts +0 -44
- package/src/features/suiSignTransaction.ts +0 -36
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,99 @@
|
|
|
1
1
|
# @mysten/wallet-standard
|
|
2
2
|
|
|
3
|
+
## 0.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [976d3e1fe]
|
|
8
|
+
- Updated dependencies [0419b7c53]
|
|
9
|
+
- Updated dependencies [f3c096e3a]
|
|
10
|
+
- Updated dependencies [5a4e3e416]
|
|
11
|
+
- Updated dependencies [27dec39eb]
|
|
12
|
+
- @mysten/sui.js@0.31.0
|
|
13
|
+
|
|
14
|
+
## 0.5.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- 956ec28eb: Change `signMessage` to return message bytes. Add support for sui:signMessage in the wallet standard
|
|
19
|
+
- 19b567f21: Unified self- and delegated staking flows. Removed fields from `Validator` (`stake_amount`, `pending_stake`, and `pending_withdraw`) and renamed `delegation_staking_pool` to `staking_pool`. Additionally removed the `validator_stake` and `delegated_stake` fields in the `ValidatorSet` type and replaced them with a `total_stake` field.
|
|
20
|
+
- 5c3b00cde: Add object id to staking pool and pool id to staked sui.
|
|
21
|
+
- 3d9a04648: Adds `deactivation_epoch` to staking pool object, and adds `inactive_pools` to the validator set object.
|
|
22
|
+
- da72e73a9: Change the address of Move package for staking and validator related Move modules.
|
|
23
|
+
- 0672b5990: The Wallet Standard now only supports the `Transaction` type, instead of the previous `SignableTransaction` type.
|
|
24
|
+
- 0a7b42a6d: This changes almost all occurences of "delegate", "delegation" (and various capitalizations/forms) to their equivalent "stake"-based name. Function names, function argument names, RPC endpoints, Move functions, and object fields have been updated with this new naming convention.
|
|
25
|
+
- c718deef4: wallet-standard: changes sui:signAndExecuteTransaction and sui:signTransaction features to support account and chain options
|
|
26
|
+
wallet-adapter-wallet-standard: change signAndExecuteTransaction and signTransaction signatures to support account and chain options
|
|
27
|
+
wallet-adapter-wallet-standard: ensure version compatibility for of the wallet signAndExecuteTransaction and signTransaction features before using them (same major version)
|
|
28
|
+
wallet-kit-core/wallet-kit: expose accounts as ReadonlyWalletAccount instead of only the address
|
|
29
|
+
wallet-kit-core: signTransaction and signAndExecuteTransaction methods mirror the ones in standard adapter
|
|
30
|
+
- 68e60b02c: Changed where the options and requestType for signAndExecuteTransaction are.
|
|
31
|
+
- dbe73d5a4: Add an optional `contentOptions` field to `SuiSignAndExecuteTransactionOptions` to specify which fields to include in `SuiTransactionBlockResponse` (e.g., transaction, effects, events, etc). By default, only the transaction digest will be included.
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- bf545c7d0: Add `features` prop to wallet kit that allows dapps to define which features they require to function properly.
|
|
36
|
+
- Updated dependencies [956ec28eb]
|
|
37
|
+
- Updated dependencies [4adfbff73]
|
|
38
|
+
- Updated dependencies [4c4573ebe]
|
|
39
|
+
- Updated dependencies [acc2edb31]
|
|
40
|
+
- Updated dependencies [941b03af1]
|
|
41
|
+
- Updated dependencies [a6690ac7d]
|
|
42
|
+
- Updated dependencies [a211dc03a]
|
|
43
|
+
- Updated dependencies [4c1e331b8]
|
|
44
|
+
- Updated dependencies [19b567f21]
|
|
45
|
+
- Updated dependencies [7659e2e91]
|
|
46
|
+
- Updated dependencies [0d3cb44d9]
|
|
47
|
+
- Updated dependencies [00bb9bb66]
|
|
48
|
+
- Updated dependencies [36c264ebb]
|
|
49
|
+
- Updated dependencies [891abf5ed]
|
|
50
|
+
- Updated dependencies [2e0ef59fa]
|
|
51
|
+
- Updated dependencies [33cb357e1]
|
|
52
|
+
- Updated dependencies [6bd88570c]
|
|
53
|
+
- Updated dependencies [f1e42f792]
|
|
54
|
+
- Updated dependencies [272389c20]
|
|
55
|
+
- Updated dependencies [3de8de361]
|
|
56
|
+
- Updated dependencies [be3c4f51e]
|
|
57
|
+
- Updated dependencies [dbe73d5a4]
|
|
58
|
+
- Updated dependencies [14ba89144]
|
|
59
|
+
- Updated dependencies [c82e4b454]
|
|
60
|
+
- Updated dependencies [7a2eaf4a3]
|
|
61
|
+
- Updated dependencies [2ef2bb59e]
|
|
62
|
+
- Updated dependencies [9b29bef37]
|
|
63
|
+
- Updated dependencies [8700809b5]
|
|
64
|
+
- Updated dependencies [5c3b00cde]
|
|
65
|
+
- Updated dependencies [01272ab7d]
|
|
66
|
+
- Updated dependencies [9822357d6]
|
|
67
|
+
- Updated dependencies [3d9a04648]
|
|
68
|
+
- Updated dependencies [da72e73a9]
|
|
69
|
+
- Updated dependencies [a0955c479]
|
|
70
|
+
- Updated dependencies [3eb3a1de8]
|
|
71
|
+
- Updated dependencies [0c9047698]
|
|
72
|
+
- Updated dependencies [4593333bd]
|
|
73
|
+
- Updated dependencies [d5ef1b6e5]
|
|
74
|
+
- Updated dependencies [0a7b42a6d]
|
|
75
|
+
- Updated dependencies [3de8de361]
|
|
76
|
+
- Updated dependencies [dd348cf03]
|
|
77
|
+
- Updated dependencies [57c17e02a]
|
|
78
|
+
- Updated dependencies [65f1372dd]
|
|
79
|
+
- Updated dependencies [a09239308]
|
|
80
|
+
- Updated dependencies [fe335e6ba]
|
|
81
|
+
- Updated dependencies [5dc25faad]
|
|
82
|
+
- Updated dependencies [64234baaf]
|
|
83
|
+
- Updated dependencies [79c2165cb]
|
|
84
|
+
- Updated dependencies [d3170ba41]
|
|
85
|
+
- Updated dependencies [a6ffb8088]
|
|
86
|
+
- Updated dependencies [3304eb83b]
|
|
87
|
+
- Updated dependencies [4189171ef]
|
|
88
|
+
- Updated dependencies [210840114]
|
|
89
|
+
- Updated dependencies [77bdf907f]
|
|
90
|
+
- Updated dependencies [a74df16ec]
|
|
91
|
+
- Updated dependencies [0f7aa6507]
|
|
92
|
+
- Updated dependencies [9b60bf700]
|
|
93
|
+
- Updated dependencies [64fb649eb]
|
|
94
|
+
- Updated dependencies [a6b0c4e5f]
|
|
95
|
+
- @mysten/sui.js@0.30.0
|
|
96
|
+
|
|
3
97
|
## 0.4.3
|
|
4
98
|
|
|
5
99
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -36,24 +36,24 @@ Features are standard methods consumers can use to interact with a wallet. To be
|
|
|
36
36
|
|
|
37
37
|
- `standard:connect` - Used to initiate a connection to the wallet.
|
|
38
38
|
- `standard:events` - Used to listen for changes that happen within the wallet, such as accounts being added or removed.
|
|
39
|
-
- `sui:
|
|
40
|
-
- `sui:
|
|
39
|
+
- `sui:signTransactionBlock` - Used to prompt the user to sign a transaction block, and return the serializated transaction block and signature back to the user. This method does not submit the transaction block for execution.
|
|
40
|
+
- `sui:signAndExecuteTransactionBlock` - Used to prompt the user to sign a transaction block, then submit it for execution to the blockchain.
|
|
41
41
|
|
|
42
42
|
You can implement these features in your wallet class under the `features` property:
|
|
43
43
|
|
|
44
44
|
```typescript
|
|
45
45
|
import {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
StandardConnectFeature,
|
|
47
|
+
StandardConnectMethod,
|
|
48
|
+
StandardEventsFeature,
|
|
49
|
+
StandardEventsOnMethod,
|
|
50
50
|
SuiFeatures,
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
SuiSignTransactionBlockMethod,
|
|
52
|
+
SuiSignAndExecuteTransactionBlockMethod
|
|
53
53
|
} from "@mysten/wallet-standard";
|
|
54
54
|
|
|
55
55
|
class YourWallet implements Wallet {
|
|
56
|
-
get features():
|
|
56
|
+
get features(): StandardConnectFeature & StandardEventsFeature & SuiFeatures {
|
|
57
57
|
return {
|
|
58
58
|
"standard:connect": {
|
|
59
59
|
version: "1.0.0",
|
|
@@ -63,31 +63,31 @@ class YourWallet implements Wallet {
|
|
|
63
63
|
version: "1.0.0",
|
|
64
64
|
on: this.#on,
|
|
65
65
|
},
|
|
66
|
-
"sui:
|
|
66
|
+
"sui:signTransactionBlock": {
|
|
67
67
|
version: "1.0.0",
|
|
68
|
-
|
|
68
|
+
signTransactionBlock: this.#signTransactionBlock,
|
|
69
69
|
},
|
|
70
|
-
"sui:
|
|
70
|
+
"sui:signAndExecuteTransactionBlock": {
|
|
71
71
|
version: "1.1.0",
|
|
72
|
-
|
|
72
|
+
signAndExecuteTransactionBlock: this.#signAndExecuteTransaction,
|
|
73
73
|
},
|
|
74
74
|
};
|
|
75
75
|
},
|
|
76
76
|
|
|
77
|
-
#on:
|
|
78
|
-
// Your wallet's
|
|
77
|
+
#on: StandardEventsOnMethod = () => {
|
|
78
|
+
// Your wallet's on implementation.
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
-
#connect:
|
|
82
|
-
// Your wallet's
|
|
81
|
+
#connect: StandardConnectMethod = () => {
|
|
82
|
+
// Your wallet's implementation
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
-
#
|
|
86
|
-
// Your wallet's
|
|
85
|
+
#signTransactionBlock: SuiSignTransactionBlockMethod = () => {
|
|
86
|
+
// Your wallet's implementation
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
#
|
|
90
|
-
// Your wallet's
|
|
89
|
+
#signAndExecuteTransactionBlock: SuiSignAndExecuteTransactionBlockMethod = () => {
|
|
90
|
+
// Your wallet's implementation
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
```
|
|
@@ -114,7 +114,7 @@ class YourWallet implements Wallet {
|
|
|
114
114
|
chains: [SUI_DEVNET_CHAIN],
|
|
115
115
|
// The features that this account supports. This can be a subset of the wallet's supported features.
|
|
116
116
|
// These features must exist on the wallet as well.
|
|
117
|
-
features: ["sui:
|
|
117
|
+
features: ["sui:signAndExecuteTransactionBlock"],
|
|
118
118
|
})
|
|
119
119
|
);
|
|
120
120
|
}
|
package/dist/detect.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature, Wallet, WalletWithFeatures } from "@wallet-standard/core";
|
|
2
2
|
import { SuiFeatures } from "./features";
|
|
3
|
-
export type StandardWalletAdapterWallet = WalletWithFeatures<
|
|
4
|
-
export declare function isStandardWalletAdapterCompatibleWallet(wallet: Wallet): wallet is StandardWalletAdapterWallet;
|
|
3
|
+
export type StandardWalletAdapterWallet = WalletWithFeatures<StandardConnectFeature & StandardEventsFeature & SuiFeatures & Partial<StandardDisconnectFeature>>;
|
|
4
|
+
export declare function isStandardWalletAdapterCompatibleWallet(wallet: Wallet, features?: string[]): wallet is StandardWalletAdapterWallet;
|
package/dist/features/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { WalletWithFeatures } from "@wallet-standard/core";
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { SuiSignTransactionBlockFeature } from "./suiSignTransactionBlock";
|
|
3
|
+
import type { SuiSignAndExecuteTransactionBlockFeature } from "./suiSignAndExecuteTransactionBlock";
|
|
4
|
+
import { SuiSignMessageFeature } from "./suiSignMessage";
|
|
4
5
|
/**
|
|
5
6
|
* Wallet Standard features that are unique to Sui, and that all Sui wallets are expected to implement.
|
|
6
7
|
*/
|
|
7
|
-
export type SuiFeatures =
|
|
8
|
+
export type SuiFeatures = SuiSignTransactionBlockFeature & SuiSignAndExecuteTransactionBlockFeature & SuiSignMessageFeature;
|
|
8
9
|
export type WalletWithSuiFeatures = WalletWithFeatures<SuiFeatures>;
|
|
9
|
-
export * from "./
|
|
10
|
-
export * from "./
|
|
10
|
+
export * from "./suiSignMessage";
|
|
11
|
+
export * from "./suiSignTransactionBlock";
|
|
12
|
+
export * from "./suiSignAndExecuteTransactionBlock";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ExecuteTransactionRequestType, SuiTransactionBlockResponse, SuiTransactionBlockResponseOptions } from "@mysten/sui.js";
|
|
2
|
+
import type { SuiSignTransactionBlockInput } from "./suiSignTransactionBlock";
|
|
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,25 @@
|
|
|
1
|
+
import type { SignedMessage } from "@mysten/sui.js";
|
|
2
|
+
import type { WalletAccount } from "@wallet-standard/core";
|
|
3
|
+
/** The latest API version of the signMessage API. */
|
|
4
|
+
export type SuiSignMessageVersion = "1.0.0";
|
|
5
|
+
/**
|
|
6
|
+
* A Wallet Standard feature for signing a personal message, and returning the
|
|
7
|
+
* message bytes that were signed, and message signature.
|
|
8
|
+
*/
|
|
9
|
+
export type SuiSignMessageFeature = {
|
|
10
|
+
/** Namespace for the feature. */
|
|
11
|
+
"sui:signMessage": {
|
|
12
|
+
/** Version of the feature API. */
|
|
13
|
+
version: SuiSignMessageVersion;
|
|
14
|
+
signMessage: SuiSignMessageMethod;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export type SuiSignMessageMethod = (input: SuiSignMessageInput) => Promise<SuiSignMessageOutput>;
|
|
18
|
+
/** Input for signing messages. */
|
|
19
|
+
export interface SuiSignMessageInput {
|
|
20
|
+
message: Uint8Array;
|
|
21
|
+
account: WalletAccount;
|
|
22
|
+
}
|
|
23
|
+
/** Output of signing messages. */
|
|
24
|
+
export interface SuiSignMessageOutput extends SignedMessage {
|
|
25
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SignedTransaction, TransactionBlock } from "@mysten/sui.js";
|
|
2
|
+
import type { IdentifierString, WalletAccount } from "@wallet-standard/core";
|
|
3
|
+
/** The latest API version of the signTransactionBlock API. */
|
|
4
|
+
export type SuiSignTransactionBlockVersion = "1.0.0";
|
|
5
|
+
/**
|
|
6
|
+
* A Wallet Standard feature for signing a transaction, and returning the
|
|
7
|
+
* serialized transaction and transaction signature.
|
|
8
|
+
*/
|
|
9
|
+
export type SuiSignTransactionBlockFeature = {
|
|
10
|
+
/** Namespace for the feature. */
|
|
11
|
+
"sui:signTransactionBlock": {
|
|
12
|
+
/** Version of the feature API. */
|
|
13
|
+
version: SuiSignTransactionBlockVersion;
|
|
14
|
+
signTransactionBlock: SuiSignTransactionBlockMethod;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export type SuiSignTransactionBlockMethod = (input: SuiSignTransactionBlockInput) => Promise<SuiSignTransactionBlockOutput>;
|
|
18
|
+
/** Input for signing transactions. */
|
|
19
|
+
export interface SuiSignTransactionBlockInput {
|
|
20
|
+
transactionBlock: TransactionBlock;
|
|
21
|
+
account: WalletAccount;
|
|
22
|
+
chain: IdentifierString;
|
|
23
|
+
}
|
|
24
|
+
/** Output of signing transactions. */
|
|
25
|
+
export interface SuiSignTransactionBlockOutput extends SignedTransaction {
|
|
26
|
+
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -31,8 +31,14 @@ module.exports = __toCommonJS(src_exports);
|
|
|
31
31
|
__reExport(src_exports, require("@wallet-standard/core"), module.exports);
|
|
32
32
|
|
|
33
33
|
// src/detect.ts
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
var REQUIRED_FEATURES = [
|
|
35
|
+
"standard:connect",
|
|
36
|
+
"standard:events"
|
|
37
|
+
];
|
|
38
|
+
function isStandardWalletAdapterCompatibleWallet(wallet, features = []) {
|
|
39
|
+
return [...REQUIRED_FEATURES, ...features].every(
|
|
40
|
+
(feature) => feature in wallet.features
|
|
41
|
+
);
|
|
36
42
|
}
|
|
37
43
|
|
|
38
44
|
// src/chains.ts
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/detect.ts","../src/chains.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nexport * from
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/detect.ts","../src/chains.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nexport * from \"@wallet-standard/core\";\n\nexport * from \"./features\";\nexport * from \"./detect\";\nexport * from \"./chains\";\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n StandardConnectFeature,\n StandardDisconnectFeature,\n StandardEventsFeature,\n Wallet,\n WalletWithFeatures,\n} from \"@wallet-standard/core\";\nimport { SuiFeatures } from \"./features\";\n\nexport type StandardWalletAdapterWallet = WalletWithFeatures<\n StandardConnectFeature &\n StandardEventsFeature &\n SuiFeatures &\n // Disconnect is an optional feature:\n Partial<StandardDisconnectFeature>\n>;\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 StandardWalletAdapterWallet[\"features\"])[] = [\n \"standard:connect\",\n \"standard:events\",\n];\n\nexport function isStandardWalletAdapterCompatibleWallet(\n wallet: Wallet,\n features: string[] = []\n): wallet is StandardWalletAdapterWallet {\n return [...REQUIRED_FEATURES, ...features].every(\n (feature) => feature in wallet.features\n );\n}\n","// 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\nexport const SUI_CHAINS = [\n SUI_DEVNET_CHAIN,\n SUI_TESTNET_CHAIN,\n SUI_LOCALNET_CHAIN,\n] as const;\n\nexport type SuiChain =\n | typeof SUI_DEVNET_CHAIN\n | typeof SUI_TESTNET_CHAIN\n | typeof SUI_LOCALNET_CHAIN;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAc,kCAHd;;;ACsBA,IAAM,oBAAuE;AAAA,EAC3E;AAAA,EACA;AACF;AAEO,SAAS,wCACd,QACA,WAAqB,CAAC,GACiB;AACvC,SAAO,CAAC,GAAG,mBAAmB,GAAG,QAAQ,EAAE;AAAA,IACzC,CAAC,YAAY,WAAW,OAAO;AAAA,EACjC;AACF;;;AC9BO,IAAM,mBAAmB;AAGzB,IAAM,oBAAoB;AAG1B,IAAM,qBAAqB;AAE3B,IAAM,aAAa;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -2,8 +2,14 @@
|
|
|
2
2
|
export * from "@wallet-standard/core";
|
|
3
3
|
|
|
4
4
|
// src/detect.ts
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
var REQUIRED_FEATURES = [
|
|
6
|
+
"standard:connect",
|
|
7
|
+
"standard:events"
|
|
8
|
+
];
|
|
9
|
+
function isStandardWalletAdapterCompatibleWallet(wallet, features = []) {
|
|
10
|
+
return [...REQUIRED_FEATURES, ...features].every(
|
|
11
|
+
(feature) => feature in wallet.features
|
|
12
|
+
);
|
|
7
13
|
}
|
|
8
14
|
|
|
9
15
|
// src/chains.ts
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/detect.ts","../src/chains.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nexport * from
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/detect.ts","../src/chains.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nexport * from \"@wallet-standard/core\";\n\nexport * from \"./features\";\nexport * from \"./detect\";\nexport * from \"./chains\";\n","// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n StandardConnectFeature,\n StandardDisconnectFeature,\n StandardEventsFeature,\n Wallet,\n WalletWithFeatures,\n} from \"@wallet-standard/core\";\nimport { SuiFeatures } from \"./features\";\n\nexport type StandardWalletAdapterWallet = WalletWithFeatures<\n StandardConnectFeature &\n StandardEventsFeature &\n SuiFeatures &\n // Disconnect is an optional feature:\n Partial<StandardDisconnectFeature>\n>;\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 StandardWalletAdapterWallet[\"features\"])[] = [\n \"standard:connect\",\n \"standard:events\",\n];\n\nexport function isStandardWalletAdapterCompatibleWallet(\n wallet: Wallet,\n features: string[] = []\n): wallet is StandardWalletAdapterWallet {\n return [...REQUIRED_FEATURES, ...features].every(\n (feature) => feature in wallet.features\n );\n}\n","// 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\nexport const SUI_CHAINS = [\n SUI_DEVNET_CHAIN,\n SUI_TESTNET_CHAIN,\n SUI_LOCALNET_CHAIN,\n] as const;\n\nexport type SuiChain =\n | typeof SUI_DEVNET_CHAIN\n | typeof SUI_TESTNET_CHAIN\n | typeof SUI_LOCALNET_CHAIN;\n"],"mappings":";AAGA,cAAc;;;ACmBd,IAAM,oBAAuE;AAAA,EAC3E;AAAA,EACA;AACF;AAEO,SAAS,wCACd,QACA,WAAqB,CAAC,GACiB;AACvC,SAAO,CAAC,GAAG,mBAAmB,GAAG,QAAQ,EAAE;AAAA,IACzC,CAAC,YAAY,WAAW,OAAO;AAAA,EACjC;AACF;;;AC9BO,IAAM,mBAAmB;AAGzB,IAAM,oBAAoB;AAG1B,IAAM,qBAAqB;AAE3B,IAAM,aAAa;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mysten/wallet-standard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "A suite of standard utilities for implementing wallets based on the Wallet Standard.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Mysten Labs <build@mystenlabs.com>",
|
|
@@ -20,16 +20,18 @@
|
|
|
20
20
|
"CHANGELOG.md"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@wallet-standard/core": "1.0.
|
|
24
|
-
"@mysten/sui.js": "0.
|
|
23
|
+
"@wallet-standard/core": "1.0.3",
|
|
24
|
+
"@mysten/sui.js": "0.31.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"tsup": "^6.
|
|
27
|
+
"tsup": "^6.7.0",
|
|
28
28
|
"typescript": "^4.9.4"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"clean": "rm -rf tsconfig.tsbuildinfo ./dist",
|
|
32
|
-
"
|
|
32
|
+
"dev": "pnpm build --watch",
|
|
33
|
+
"build": "pnpm build:types && pnpm build:tsup",
|
|
34
|
+
"build:tsup": "tsup ./src/index.ts --format esm,cjs --sourcemap",
|
|
33
35
|
"build:types": "tsc --build"
|
|
34
36
|
}
|
|
35
37
|
}
|
package/src/detect.ts
CHANGED
|
@@ -2,31 +2,34 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
StandardConnectFeature,
|
|
6
|
+
StandardDisconnectFeature,
|
|
7
|
+
StandardEventsFeature,
|
|
8
8
|
Wallet,
|
|
9
9
|
WalletWithFeatures,
|
|
10
10
|
} from "@wallet-standard/core";
|
|
11
11
|
import { SuiFeatures } from "./features";
|
|
12
12
|
|
|
13
13
|
export type StandardWalletAdapterWallet = WalletWithFeatures<
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
StandardConnectFeature &
|
|
15
|
+
StandardEventsFeature &
|
|
16
16
|
SuiFeatures &
|
|
17
17
|
// Disconnect is an optional feature:
|
|
18
|
-
Partial<
|
|
18
|
+
Partial<StandardDisconnectFeature>
|
|
19
19
|
>;
|
|
20
20
|
|
|
21
|
-
//
|
|
21
|
+
// These features are absolutely required for wallets to function in the Sui ecosystem.
|
|
22
|
+
// Eventually, as wallets have more consistent support of features, we may want to extend this list.
|
|
23
|
+
const REQUIRED_FEATURES: (keyof StandardWalletAdapterWallet["features"])[] = [
|
|
24
|
+
"standard:connect",
|
|
25
|
+
"standard:events",
|
|
26
|
+
];
|
|
27
|
+
|
|
22
28
|
export function isStandardWalletAdapterCompatibleWallet(
|
|
23
|
-
wallet: Wallet
|
|
29
|
+
wallet: Wallet,
|
|
30
|
+
features: string[] = []
|
|
24
31
|
): wallet is StandardWalletAdapterWallet {
|
|
25
|
-
return (
|
|
26
|
-
|
|
27
|
-
"standard:events" in wallet.features &&
|
|
28
|
-
// TODO: Enable once ecosystem wallets adopt this:
|
|
29
|
-
// "sui:signTransaction" in wallet.features &&
|
|
30
|
-
"sui:signAndExecuteTransaction" in wallet.features
|
|
32
|
+
return [...REQUIRED_FEATURES, ...features].every(
|
|
33
|
+
(feature) => feature in wallet.features
|
|
31
34
|
);
|
|
32
35
|
}
|
package/src/features/index.ts
CHANGED
|
@@ -2,16 +2,19 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import type { WalletWithFeatures } from "@wallet-standard/core";
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
5
|
+
import type { SuiSignTransactionBlockFeature } from "./suiSignTransactionBlock";
|
|
6
|
+
import type { SuiSignAndExecuteTransactionBlockFeature } from "./suiSignAndExecuteTransactionBlock";
|
|
7
|
+
import { SuiSignMessageFeature } from "./suiSignMessage";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Wallet Standard features that are unique to Sui, and that all Sui wallets are expected to implement.
|
|
10
11
|
*/
|
|
11
|
-
export type SuiFeatures =
|
|
12
|
-
|
|
12
|
+
export type SuiFeatures = SuiSignTransactionBlockFeature &
|
|
13
|
+
SuiSignAndExecuteTransactionBlockFeature &
|
|
14
|
+
SuiSignMessageFeature;
|
|
13
15
|
|
|
14
16
|
export type WalletWithSuiFeatures = WalletWithFeatures<SuiFeatures>;
|
|
15
17
|
|
|
16
|
-
export * from "./
|
|
17
|
-
export * from "./
|
|
18
|
+
export * from "./suiSignMessage";
|
|
19
|
+
export * from "./suiSignTransactionBlock";
|
|
20
|
+
export * from "./suiSignAndExecuteTransactionBlock";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Copyright (c) Mysten Labs, Inc.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type {
|
|
5
|
+
ExecuteTransactionRequestType,
|
|
6
|
+
SuiTransactionBlockResponse,
|
|
7
|
+
SuiTransactionBlockResponseOptions,
|
|
8
|
+
} from "@mysten/sui.js";
|
|
9
|
+
import type { SuiSignTransactionBlockInput } from "./suiSignTransactionBlock";
|
|
10
|
+
|
|
11
|
+
/** The latest API version of the signAndExecuteTransactionBlock API. */
|
|
12
|
+
export type SuiSignAndExecuteTransactionBlockVersion = "1.0.0";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A Wallet Standard feature for signing a transaction, and submitting it to the
|
|
16
|
+
* network. The wallet is expected to submit the transaction to the network via RPC,
|
|
17
|
+
* and return the transaction response.
|
|
18
|
+
*/
|
|
19
|
+
export type SuiSignAndExecuteTransactionBlockFeature = {
|
|
20
|
+
/** Namespace for the feature. */
|
|
21
|
+
"sui:signAndExecuteTransactionBlock": {
|
|
22
|
+
/** Version of the feature API. */
|
|
23
|
+
version: SuiSignAndExecuteTransactionBlockVersion;
|
|
24
|
+
signAndExecuteTransactionBlock: SuiSignAndExecuteTransactionBlockMethod;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type SuiSignAndExecuteTransactionBlockMethod = (
|
|
29
|
+
input: SuiSignAndExecuteTransactionBlockInput
|
|
30
|
+
) => Promise<SuiSignAndExecuteTransactionBlockOutput>;
|
|
31
|
+
|
|
32
|
+
/** Input for signing and sending transactions. */
|
|
33
|
+
export interface SuiSignAndExecuteTransactionBlockInput
|
|
34
|
+
extends SuiSignTransactionBlockInput {
|
|
35
|
+
/**
|
|
36
|
+
* `WaitForEffectsCert` or `WaitForLocalExecution`, see details in `ExecuteTransactionRequestType`.
|
|
37
|
+
* Defaults to `WaitForLocalExecution` if options.showEffects or options.showEvents is true
|
|
38
|
+
*/
|
|
39
|
+
requestType?: ExecuteTransactionRequestType;
|
|
40
|
+
/** specify which fields to return (e.g., transaction, effects, events, etc). By default, only the transaction digest will be returned. */
|
|
41
|
+
options?: SuiTransactionBlockResponseOptions;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Output of signing and sending transactions. */
|
|
45
|
+
export interface SuiSignAndExecuteTransactionBlockOutput
|
|
46
|
+
extends SuiTransactionBlockResponse {}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Copyright (c) Mysten Labs, Inc.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type { SignedMessage } from "@mysten/sui.js";
|
|
5
|
+
import type { WalletAccount } from "@wallet-standard/core";
|
|
6
|
+
|
|
7
|
+
/** The latest API version of the signMessage API. */
|
|
8
|
+
export type SuiSignMessageVersion = "1.0.0";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A Wallet Standard feature for signing a personal message, and returning the
|
|
12
|
+
* message bytes that were signed, and message signature.
|
|
13
|
+
*/
|
|
14
|
+
export type SuiSignMessageFeature = {
|
|
15
|
+
/** Namespace for the feature. */
|
|
16
|
+
"sui:signMessage": {
|
|
17
|
+
/** Version of the feature API. */
|
|
18
|
+
version: SuiSignMessageVersion;
|
|
19
|
+
signMessage: SuiSignMessageMethod;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type SuiSignMessageMethod = (
|
|
24
|
+
input: SuiSignMessageInput
|
|
25
|
+
) => Promise<SuiSignMessageOutput>;
|
|
26
|
+
|
|
27
|
+
/** Input for signing messages. */
|
|
28
|
+
export interface SuiSignMessageInput {
|
|
29
|
+
message: Uint8Array;
|
|
30
|
+
account: WalletAccount;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Output of signing messages. */
|
|
34
|
+
export interface SuiSignMessageOutput extends SignedMessage {}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Copyright (c) Mysten Labs, Inc.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import type { SignedTransaction, TransactionBlock } from "@mysten/sui.js";
|
|
5
|
+
import type { IdentifierString, WalletAccount } from "@wallet-standard/core";
|
|
6
|
+
|
|
7
|
+
/** The latest API version of the signTransactionBlock API. */
|
|
8
|
+
export type SuiSignTransactionBlockVersion = "1.0.0";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A Wallet Standard feature for signing a transaction, and returning the
|
|
12
|
+
* serialized transaction and transaction signature.
|
|
13
|
+
*/
|
|
14
|
+
export type SuiSignTransactionBlockFeature = {
|
|
15
|
+
/** Namespace for the feature. */
|
|
16
|
+
"sui:signTransactionBlock": {
|
|
17
|
+
/** Version of the feature API. */
|
|
18
|
+
version: SuiSignTransactionBlockVersion;
|
|
19
|
+
signTransactionBlock: SuiSignTransactionBlockMethod;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type SuiSignTransactionBlockMethod = (
|
|
24
|
+
input: SuiSignTransactionBlockInput
|
|
25
|
+
) => Promise<SuiSignTransactionBlockOutput>;
|
|
26
|
+
|
|
27
|
+
/** Input for signing transactions. */
|
|
28
|
+
export interface SuiSignTransactionBlockInput {
|
|
29
|
+
transactionBlock: TransactionBlock;
|
|
30
|
+
account: WalletAccount;
|
|
31
|
+
chain: IdentifierString;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Output of signing transactions. */
|
|
35
|
+
export interface SuiSignTransactionBlockOutput extends SignedTransaction {}
|
package/src/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Mysten Labs, Inc.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
export * from
|
|
4
|
+
export * from "@wallet-standard/core";
|
|
5
5
|
|
|
6
6
|
export * from "./features";
|
|
7
7
|
export * from "./detect";
|
|
8
|
-
export * from
|
|
8
|
+
export * from "./chains";
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { ExecuteTransactionRequestType, SignableTransaction, SuiTransactionResponse } from "@mysten/sui.js";
|
|
2
|
-
/** The latest API version of the signAndExecuteTransaction API. */
|
|
3
|
-
export type SuiSignAndExecuteTransactionVersion = "1.1.0";
|
|
4
|
-
/**
|
|
5
|
-
* A Wallet Standard feature for signing a transaction, and submitting it to the
|
|
6
|
-
* network. The wallet is expected to submit the transaction to the network via RPC,
|
|
7
|
-
* and return the transaction response.
|
|
8
|
-
*/
|
|
9
|
-
export type SuiSignAndExecuteTransactionFeature = {
|
|
10
|
-
/** Namespace for the feature. */
|
|
11
|
-
"sui:signAndExecuteTransaction": {
|
|
12
|
-
/** Version of the feature API. */
|
|
13
|
-
version: SuiSignAndExecuteTransactionVersion;
|
|
14
|
-
signAndExecuteTransaction: SuiSignAndExecuteTransactionMethod;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export type SuiSignAndExecuteTransactionMethod = (input: SuiSignAndExecuteTransactionInput) => Promise<SuiSignAndExecuteTransactionOutput>;
|
|
18
|
-
/** Input for signing and sending transactions. */
|
|
19
|
-
export interface SuiSignAndExecuteTransactionInput {
|
|
20
|
-
transaction: SignableTransaction;
|
|
21
|
-
options?: SuiSignAndExecuteTransactionOptions;
|
|
22
|
-
}
|
|
23
|
-
/** Output of signing and sending transactions. */
|
|
24
|
-
export interface SuiSignAndExecuteTransactionOutput extends SuiTransactionResponse {
|
|
25
|
-
}
|
|
26
|
-
/** Options for signing and sending transactions. */
|
|
27
|
-
export interface SuiSignAndExecuteTransactionOptions {
|
|
28
|
-
requestType?: ExecuteTransactionRequestType;
|
|
29
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { SignableTransaction, SignedTransaction } from "@mysten/sui.js";
|
|
2
|
-
/** The latest API version of the signTransaction API. */
|
|
3
|
-
export type SuiSignTransactionVersion = "1.0.0";
|
|
4
|
-
/**
|
|
5
|
-
* A Wallet Standard feature for signing a transaction, and returning the
|
|
6
|
-
* serialized transaction and transaction signature.
|
|
7
|
-
*/
|
|
8
|
-
export type SuiSignTransactionFeature = {
|
|
9
|
-
/** Namespace for the feature. */
|
|
10
|
-
"sui:signTransaction": {
|
|
11
|
-
/** Version of the feature API. */
|
|
12
|
-
version: SuiSignTransactionVersion;
|
|
13
|
-
signTransaction: SuiSignTransactionMethod;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export type SuiSignTransactionMethod = (input: SuiSignTransactionInput) => Promise<SuiSignTransactionOutput>;
|
|
17
|
-
/** Input for signing transactions. */
|
|
18
|
-
export interface SuiSignTransactionInput {
|
|
19
|
-
transaction: SignableTransaction;
|
|
20
|
-
options?: SuiSignTransactionOptions;
|
|
21
|
-
}
|
|
22
|
-
/** Output of signing transactions. */
|
|
23
|
-
export interface SuiSignTransactionOutput extends SignedTransaction {
|
|
24
|
-
}
|
|
25
|
-
/** Options for signing transactions. */
|
|
26
|
-
export interface SuiSignTransactionOptions {
|
|
27
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Mysten Labs, Inc.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import type {
|
|
5
|
-
ExecuteTransactionRequestType,
|
|
6
|
-
SignableTransaction,
|
|
7
|
-
SuiTransactionResponse,
|
|
8
|
-
} from "@mysten/sui.js";
|
|
9
|
-
|
|
10
|
-
/** The latest API version of the signAndExecuteTransaction API. */
|
|
11
|
-
export type SuiSignAndExecuteTransactionVersion = "1.1.0";
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* A Wallet Standard feature for signing a transaction, and submitting it to the
|
|
15
|
-
* network. The wallet is expected to submit the transaction to the network via RPC,
|
|
16
|
-
* and return the transaction response.
|
|
17
|
-
*/
|
|
18
|
-
export type SuiSignAndExecuteTransactionFeature = {
|
|
19
|
-
/** Namespace for the feature. */
|
|
20
|
-
"sui:signAndExecuteTransaction": {
|
|
21
|
-
/** Version of the feature API. */
|
|
22
|
-
version: SuiSignAndExecuteTransactionVersion;
|
|
23
|
-
signAndExecuteTransaction: SuiSignAndExecuteTransactionMethod;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export type SuiSignAndExecuteTransactionMethod = (
|
|
28
|
-
input: SuiSignAndExecuteTransactionInput
|
|
29
|
-
) => Promise<SuiSignAndExecuteTransactionOutput>;
|
|
30
|
-
|
|
31
|
-
/** Input for signing and sending transactions. */
|
|
32
|
-
export interface SuiSignAndExecuteTransactionInput {
|
|
33
|
-
transaction: SignableTransaction;
|
|
34
|
-
options?: SuiSignAndExecuteTransactionOptions;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/** Output of signing and sending transactions. */
|
|
38
|
-
export interface SuiSignAndExecuteTransactionOutput
|
|
39
|
-
extends SuiTransactionResponse {}
|
|
40
|
-
|
|
41
|
-
/** Options for signing and sending transactions. */
|
|
42
|
-
export interface SuiSignAndExecuteTransactionOptions {
|
|
43
|
-
requestType?: ExecuteTransactionRequestType;
|
|
44
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Mysten Labs, Inc.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import type { SignableTransaction, SignedTransaction } from "@mysten/sui.js";
|
|
5
|
-
|
|
6
|
-
/** The latest API version of the signTransaction API. */
|
|
7
|
-
export type SuiSignTransactionVersion = "1.0.0";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* A Wallet Standard feature for signing a transaction, and returning the
|
|
11
|
-
* serialized transaction and transaction signature.
|
|
12
|
-
*/
|
|
13
|
-
export type SuiSignTransactionFeature = {
|
|
14
|
-
/** Namespace for the feature. */
|
|
15
|
-
"sui:signTransaction": {
|
|
16
|
-
/** Version of the feature API. */
|
|
17
|
-
version: SuiSignTransactionVersion;
|
|
18
|
-
signTransaction: SuiSignTransactionMethod;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type SuiSignTransactionMethod = (
|
|
23
|
-
input: SuiSignTransactionInput
|
|
24
|
-
) => Promise<SuiSignTransactionOutput>;
|
|
25
|
-
|
|
26
|
-
/** Input for signing transactions. */
|
|
27
|
-
export interface SuiSignTransactionInput {
|
|
28
|
-
transaction: SignableTransaction;
|
|
29
|
-
options?: SuiSignTransactionOptions;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/** Output of signing transactions. */
|
|
33
|
-
export interface SuiSignTransactionOutput extends SignedTransaction {}
|
|
34
|
-
|
|
35
|
-
/** Options for signing transactions. */
|
|
36
|
-
export interface SuiSignTransactionOptions {}
|